You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/PULL_REQUEST_TEMPLATE.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,7 +36,7 @@ write a little note why.
36
36
37
37
-[ ] Targeted PR against the correct branch (see [CONTRIBUTING.md](https://github.com/cosmos/ibc-go/blob/main/docs/dev/pull-requests.md#pull-request-targeting)).
38
38
-[ ] Linked to GitHub issue with discussion and accepted design, OR link to spec that describes this work.
39
-
-[ ] Code follows the [module structure standards](https://github.com/cosmos/cosmos-sdk/blob/main/docs/build/building-modules/11-structure.md) and [Go style guide](../docs/dev/go-style-guide.md).
39
+
-[ ] Code follows the [module structure standards](https://docs.cosmos.network/main/build/building-modules/intro) and [Go style guide](../docs/dev/go-style-guide.md).
40
40
-[ ] Wrote unit and integration [tests](https://github.com/cosmos/ibc-go/blob/main/testing/README.md#ibc-testing-package).
Copy file name to clipboardExpand all lines: docs/dev/project-structure.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Project structure
2
2
3
-
If you're not familiar with the overall module structure from the SDK modules, please check this [document](https://github.com/cosmos/cosmos-sdk/blob/main/docs/build/building-modules/11-structure.md) as prerequisite reading.
3
+
If you're not familiar with the overall module structure from the SDK modules, please check this [document](https://docs.cosmos.network/main/build/building-modules/intro) as prerequisite reading.
4
4
5
5
Every Interchain Standard (ICS) has been developed in its own package. The development team separated the IBC TAO (Transport, Authentication, Ordering) ICS specifications from the IBC application level specification. The following sections describe the architecture of the most relevant directories that comprise this repository.
Copy file name to clipboardExpand all lines: docs/docs/01-ibc/02-integration.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -197,7 +197,7 @@ With IBC v2, there is a new [router](https://github.com/cosmos/ibc-go/blob/main/
197
197
198
198
### Module `Manager` and `SimulationManager`
199
199
200
-
In order to use IBC, we need to add the new modules to the module `Manager` and to the `SimulationManager`, in case your application supports [simulations](https://github.com/cosmos/cosmos-sdk/blob/main/docs/build/building-modules/14-simulator.md).
200
+
In order to use IBC, we need to add the new modules to the module `Manager` and to the `SimulationManager`, in case your application supports [simulations](https://docs.cosmos.network/main/learn/advanced/simulation).
The IBC transfer application module exposes the following set of [metrics](https://github.com/cosmos/cosmos-sdk/blob/main/docs/learn/advanced/09-telemetry.md).
10
+
The IBC transfer application module exposes the following set of [metrics](https://docs.cosmos.network/main/learn/advanced/telemetry).
Copy file name to clipboardExpand all lines: docs/versioned_docs/version-v10.1.x/00-intro.md
+12-6Lines changed: 12 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,17 +5,23 @@ sidebar_position: 0
5
5
6
6
# IBC-Go Documentation
7
7
8
-
Welcome to the documentation for IBC-Go, the Golang implementation of the Inter-Blockchain Communication Protocol! Looking for information on ibc-rs? [Click here to go to the ibc-rs github repo](https://github.com/cosmos/ibc-rs).
8
+
Welcome to the documentation for IBC-Go, the Golang implementation of the Inter-Blockchain Communication Protocol!
9
9
10
-
The Inter-Blockchain Communication Protocol (IBC) is an end-to-end, connection-oriented, stateful protocol for reliable, ordered, and authenticated communication between heterogeneous blockchains arranged in an unknown and dynamic topology.
11
-
12
-
IBC is a protocol that allows blockchains to talk to each other. Chains that speak IBC can share any type of data as long as it's encoded in bytes, enabling the industry’s most feature-rich cross-chain interactions. IBC is secure and permissionless.
10
+
The Inter-Blockchain Communication Protocol (IBC) is a protocol that allows blockchains to talk to each other. Chains that speak IBC can share any type of data as long as it's encoded in bytes, enabling the industry’s most feature-rich cross-chain interactions. IBC can be used to build a wide range of cross-chain applications that include token transfers, atomic swaps, multi-chain smart contracts (with or without mutually comprehensible VMs), and cross-chain account control. IBC is secure and permissionless.
13
11
14
12
The protocol realizes this interoperability by specifying a set of data structures, abstractions, and semantics that can be implemented by any distributed ledger that satisfies a small set of requirements.
15
13
16
-
IBC can be used to build a wide range of cross-chain applications that include token transfers, atomic swaps, multi-chain smart contracts (with or without mutually comprehensible VMs), cross-chain account control, and data and code sharding of various kinds.
14
+
:::note Notice
15
+
Since ibc-go v10, there are two versions of the protocol in the same release: IBC classic and IBC v2. The protocols are seperate - a connection uses either IBC classic or IBC v2
16
+
:::
17
+
18
+
## High-level overview of IBC v2
19
+
20
+
For a high level overview of IBC v2, please refer to [this blog post.](https://ibcprotocol.dev/blog/ibc-v2-announcement) For a more detailed understanding of the IBC v2 protocol, please refer to the [IBC v2 protocol specification.](https://github.com/cosmos/ibc/tree/main/spec/IBC_V2)
21
+
22
+
If you are interested in using the cannonical deployment of IBC v2, connecting Cosmos chains and Ethereum, take a look at the [IBC Eureka](https://docs.skip.build/go/eureka/eureka-overview) documentation to get started.
17
23
18
-
## High-level overview of IBC
24
+
## High-level overview of IBC Classic
19
25
20
26
The following diagram shows how IBC works at a high level:
Learn how to integrate IBC to your application and send data packets to other chains.
11
+
Learn how to integrate IBC to your application
12
12
:::
13
13
14
14
This document outlines the required steps to integrate and configure the [IBC
15
-
module](https://github.com/cosmos/ibc-go/tree/main/modules/core) to your Cosmos SDK application and
16
-
send fungible token transfers to other chains.
15
+
module](https://github.com/cosmos/ibc-go/tree/main/modules/core) to your Cosmos SDK application and enable sending fungible token transfers to other chains. An [example app using ibc-go v10 is linked](https://github.com/gjermundgaraba/probe/tree/ibc/v10).
17
16
18
17
## Integrating the IBC module
19
18
20
19
Integrating the IBC module to your SDK-based application is straightforward. The general changes can be summarized in the following steps:
21
20
22
21
-[Define additional `Keeper` fields for the new modules on the `App` type](#add-application-fields-to-app).
23
22
-[Add the module's `StoreKey`s and initialize their `Keeper`s](#configure-the-keepers).
23
+
-[Create Application Stacks with Middleware](#create-application-stacks-with-middleware)
24
24
-[Set up IBC router and add route for the `transfer` module](#register-module-routes-in-the-ibc-router).
25
25
-[Grant permissions to `transfer`'s `ModuleAccount`](#module-account-permissions).
26
26
-[Add the modules to the module `Manager`](#module-manager-and-simulationmanager).
@@ -30,14 +30,17 @@ Integrating the IBC module to your SDK-based application is straightforward. The
30
30
31
31
### Add application fields to `App`
32
32
33
-
We need to register the core `ibc` and `transfer``Keeper`s as follows:
33
+
We need to register the core `ibc` and `transfer``Keeper`s. To support the use of IBC v2, `transferv2` and `callbacksv2` must also be registered as follows:
During initialization, besides initializing the IBC `Keeper`s (for core `ibc` and `transfer` modules), we need to grant specific capabilities through the capability module `ScopedKeeper`s so that we can authenticate the object-capability permissions for each of the IBC channels.
61
+
Initialize the IBC `Keeper`s (for core `ibc` and `transfer` modules), and any additional modules you want to include.
62
+
63
+
:::note Notice
64
+
The capability module has been removed in ibc-go v10, therefore the `ScopedKeeper` has also been removed
Middleware stacks in IBC allow you to wrap an `IBCModule` with additional logic for packets and acknowledgements. This is a chain of handlers that execute in order. The transfer stack below shows how to wire up transfer to use packet forward middleware, and the callbacks middleware. Note that the order is important.
// Setting Router will finalize all routes by sealing router
150
179
// No more routes can be added
151
180
app.IBCKeeper.SetRouter(ibcRouter)
152
181
153
182
// ... continues
154
183
```
155
184
185
+
#### IBC v2 Router
186
+
187
+
With IBC v2, there is a new [router](https://github.com/cosmos/ibc-go/blob/main/modules/core/api/router.go) that needs to register the routes for a portID to a given IBCModule.
// Setting Router will finalize all routes by sealing router
194
+
// No more routes can be added
195
+
app.IBCKeeper.SetRouterV2(ibcRouterV2)
196
+
```
197
+
156
198
### Module `Manager` and `SimulationManager`
157
199
158
-
In order to use IBC, we need to add the new modules to the module `Manager` and to the `SimulationManager`, in case your application supports [simulations](https://github.com/cosmos/cosmos-sdk/blob/main/docs/build/building-modules/14-simulator.md).
200
+
In order to use IBC, we need to add the new modules to the module `Manager` and to the `SimulationManager`, in case your application supports [simulations](https://docs.cosmos.network/main/learn/advanced/simulation).
159
201
160
202
```go title="app.go"
161
203
import (
@@ -218,13 +260,11 @@ var (
218
260
)
219
261
```
220
262
221
-
#### Integrating light clients
222
-
223
-
> Note that from v9 onwards, all light clients are expected to implement the [`LightClientInterface` interface](../03-light-clients/01-developer-guide/02-light-client-module.md#implementing-the-lightclientmodule-interface) defined by core IBC, and have to be explicitly registered in a chain's app.go. This is in contrast to earlier versions of ibc-go when `07-tendermint` and `06-solomachine` were added out of the box. Follow the steps below to integrate the `07-tendermint` light client.
263
+
### Integrating light clients
224
264
225
-
All light clients must be registered with `module.Manager`in a chain's app.go file.
265
+
> Note that from v10 onwards, all light clients are expected to implement the [`LightClientInterface` interface](../03-light-clients/01-developer-guide/02-light-client-module.md#implementing-the-lightclientmodule-interface) defined by core IBC, and have to be explicitly registered in a chain's app.go. This is in contrast to earlier versions of ibc-go when `07-tendermint` and `06-solomachine` were added out of the box. Follow the steps below to integrate the `07-tendermint` light client.
226
266
227
-
The following code example shows how to instantiate `07-tendermint` light client module and register its `ibctm.AppModule`.
267
+
All light clients must be registered with `module.Manager` in a chain's app.go file. The following code example shows how to instantiate `07-tendermint` light client module and register its `ibctm.AppModule`.
The allowed clients parameter defines an allow list of client types supported by the chain. The
300
+
default value is a single-element list containing the [`AllowedClients`](https://github.com/cosmos/ibc-go/blob/main/modules/core/02-client/types/client.pb.go#L248-L253) wildcard (`"*"`). Alternatively, the parameter
301
+
may be set with a list of client types (e.g. `"06-solomachine","07-tendermint","09-localhost"`).
302
+
A client type that is not registered on this list will fail upon creation or on genesis validation.
303
+
Note that, since the client type is an arbitrary string, chains must not register two light clients
304
+
which return the same value for the `ClientType()` function, otherwise the allow list check can be
305
+
bypassed.
306
+
256
307
### Application ABCI ordering
257
308
258
-
One addition from IBC is the concept of `HistoricalInfo` which is stored in the Cosmos SDK `x/staking` module. The number of records stored by `x/staking` is controlled by the `HistoricalEntries` parameter which stores `HistoricalInfo` on a perheight basis.
309
+
One addition from IBC is the concept of `HistoricalInfo` which is stored in the Cosmos SDK `x/staking` module. The number of records stored by `x/staking` is controlled by the `HistoricalEntries` parameter which stores `HistoricalInfo` on a per-height basis.
259
310
Each entry contains the historical information for the `Header` and `ValidatorSet` of this chain which is stored
260
311
at each height during the `BeginBlock` call. The `HistoricalInfo` is required to introspect a blockchain's prior state at a given height in order to verify the light client `ConsensusState` during the
0 commit comments