-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* docs: v0.5.0 * imp: ran 'npm run docusaurus docs:version v0.5.x'
- Loading branch information
Showing
20 changed files
with
782 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
--- | ||
title: Introduction | ||
sidebar_label: Introduction | ||
sidebar_position: 0 | ||
slug: / | ||
--- | ||
|
||
import HighlightTag from '@site/src/components/HighlightTag'; | ||
|
||
# CosmWasm ICA Controller | ||
|
||
<HighlightTag type="concepts"/><HighlightTag type="basics"/> | ||
|
||
Welcome to the documentation for CosmWasm Interchain Accounts Controller. This document will guide you through | ||
understanding the [ICS-27](https://github.com/cosmos/ibc/tree/main/spec/app/ics-027-interchain-accounts) | ||
Interchain Accounts protocol and how to use `cw-ica-controller` to create and manage interchain accounts on | ||
any IBC enabled CosmWasm chain. | ||
|
||
The CosmWasm ICA Controller is a CosmWasm contract that implements the ICS-27 interchain accounts controller in | ||
pure Rust. It is designed to be used by other CosmWasm contracts to create and manage interchain accounts on | ||
the chain where the contract is deployed. | ||
|
||
## High Level Overview | ||
|
||
The following diagram shows how `cw-ica-controller` works at a high level. | ||
|
||
![High Level Overview](/img/cw-ica-controller.svg) | ||
|
||
The `cw-ica-controller` contract code is deployed on a chain that supports IBC CosmWasm. This chain does not need | ||
to support ICS-27 interchain accounts nor does it need to support any custom IBC bindings. Then when an external | ||
account or a contract instantiates a `cw-ica-controller` contract, the contract will initiate the ICS-27 handshake | ||
with a chain that supports ICS-27 interchain accounts based on the options provided by the caller. | ||
|
||
:::note | ||
|
||
The counterparty chain need not be a CosmWasm chain. It can be any chain that uses ibc-go and supports `ICS-27`. | ||
Such as CosmosHub, Osmosis, etc. | ||
|
||
::: | ||
|
||
Then the rest of the ICS-27 handshake is completed by the relayers automatically. Both the hermes relayer and the | ||
go relayer support `ICS-27` interchain accounts. Once the handshake is complete, the `cw-ica-controller` contract | ||
makes a callback to the callback contract if one was provided during instantiation. |
22 changes: 22 additions & 0 deletions
22
docs/versioned_docs/version-v0.5.x/contract-api/00-intro.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
title: Contract API | ||
sidebar_label: Overview | ||
sidebar_position: 0 | ||
slug: /contract-api/intro | ||
--- | ||
|
||
import HighlightTag from '@site/src/components/HighlightTag'; | ||
|
||
# Contract API | ||
|
||
<HighlightTag type="developer"/> | ||
|
||
In this section we will cover how to interact with the contract and design decisions that were made. A full integration guide is work in progress. | ||
|
||
In this section, we cover the following topics: | ||
|
||
- ✉️ [`InstantiateMsg`](./01-instantiate-msg.mdx) | ||
- 📨 [`ExecuteMsg`](./02-execute-msg.mdx) | ||
- 🤔 [`QueryMsg`](./03-query-msg.mdx) | ||
- 🤙 [Callbacks](./04-callbacks.mdx) | ||
- 📜 [Events](./05-events.mdx) |
65 changes: 65 additions & 0 deletions
65
docs/versioned_docs/version-v0.5.x/contract-api/01-instantiate-msg.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
--- | ||
title: InstantiateMsg | ||
sidebar_label: InstantiateMsg | ||
sidebar_position: 1 | ||
slug: /contract-api/instantiate-msg | ||
--- | ||
|
||
# `InstantiateMsg` | ||
|
||
The `InstantiateMsg` is the message that is used to instantiate the `cw-ica-controller` contract. | ||
|
||
```rust reference | ||
https://github.com/srdtrk/cw-ica-controller/blob/v0.5.0/src/types/msg.rs#L8-L21 | ||
``` | ||
|
||
## Fields | ||
|
||
### `owner` | ||
|
||
This contract has an owner who is allowed to call the `ExecuteMsg` methods. | ||
The owner management is handled by the amazing [cw-ownable](https://crates.io/crates/cw-ownable) crate. | ||
If left empty, the owner is set to the sender of the `InstantiateMsg`. | ||
|
||
### `channel_open_init_options` | ||
|
||
```rust reference | ||
https://github.com/srdtrk/cw-ica-controller/blob/v0.5.0/src/types/msg.rs#L124-L140 | ||
``` | ||
|
||
These are the options required for the contract to initiate an ICS-27 channel open handshake. | ||
This contract requires there to be an IBC connection between the two chains before it can open a channel. | ||
|
||
#### `connection_id` | ||
|
||
The identifier of the IBC connection end on the deployed (source) chain. (The underlying IBC light client must | ||
be live.) If this field is set to a non-existent connection, the execution of the `InstantiateMsg` will fail. | ||
|
||
#### `counterparty_connection_id` | ||
|
||
The identifier of the IBC connection end on the counterparty (destination) chain. (The underlying IBC light | ||
client must be live.) If this field is set to a non-existent connection or a different connection's end, | ||
then the execution of the `InstantiateMsg` will not fail. This is because the source chain does not know | ||
about the counterparty chain's connections. Instead, the channel open handshake will fail to complete. | ||
|
||
If the contract was instantiated with a `counterparty_connection_id` that does not match the connection | ||
end on the counterparty chain, then the owner must call [`ExecuteMsg::CreateChannel`](./02-execute-msg.mdx#createchannel) with the correct parameters to start a new channel open handshake. | ||
|
||
#### `counterparty_port_id` | ||
|
||
This is a required parameter for the ICS-27 channel version metadata. I've added it here for consistency. | ||
Currently, the only supported value is `icahost`. If left empty, it is set to `icahost`. | ||
**So you should ignore this field.** | ||
|
||
#### `tx_encoding` | ||
|
||
The ICS-27 implementation in `ibc-go` supports two transaction encoding formats: `proto3` and `proto3json`. | ||
This contract supports both formats, but defaults to `proto3`. This is because most chains don't yet support | ||
`proto3json` encoding. Moreover, this contract does not support some `CosmosMsg` while using `proto3json`. | ||
**So, if you are unsure, leave this field empty.** | ||
|
||
### `send_callbacks_to` | ||
|
||
This is the address of the contract that will receive the callbacks from the `cw-ica-controller` contract. | ||
This may be the same address as the `owner` or a different address. If left empty, no callbacks will be sent. | ||
Learn more about callbacks [here](./04-callbacks.mdx). |
Oops, something went wrong.