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: main/guides/orchestration/chainhub.md
+20-12
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,10 @@ These `MapStores` are not exposed directly. They are abstracted and used interna
21
21
22
22
The core functionality is encapsulated within the `makeChainHub` function, which sets up a new `ChainHub` in the given zone. The `ChainHub` is responsible for:
23
23
24
-
## **Registering Chain Information (`registerChain`)**
24
+
## **chainHub.registerChain(name, chainInfo)**
25
+
26
+
- name: **string**
27
+
- chainInfo: **CosmosChainInfo**
25
28
26
29
Stores information about a chain inside the `chainInfos` mapstore, which can be used for quickly looking up details without querying a remote source.
The function takes two parameters: `name`, which is a `string` representing the unique identifier of the chain, and `chainInfo`, which is an object structured according to the `CosmosChainInfo` format.
47
+
## **chainHub.getChainInfo(chainName)**
45
48
46
-
## **Retrieving Chain Information (`getChainInfo`)**
49
+
- chainName: **string**
50
+
- Returns: **Vow\<ActualChainInfo\<K\>\>**
47
51
48
52
Retrieves stored chain information from the `chainInfos` mapstore or fetches it from a remote source if not available locally.
49
53
50
54
```js
51
55
chainHub.getChainInfo('agoric-3');
52
56
```
53
57
54
-
The function takes a single parameter, `chainName`, which is a `string` template type `K`, and returns a promise (`Vow`) that resolves to `ActualChainInfo<K>`, providing detailed information about the specified chain based on its name.
58
+
## **registerConnection(chainId1, chainId2)**
55
59
56
-
## **Registering Connection Information (`registerConnection`)**
60
+
- chainId1: **string**
61
+
- chainId2: **string**
62
+
- Returns: **IBCConnectionInfo**
57
63
58
64
Stores information about a connection between two chains in `connectionInfos` mapstore, such as IBC connection details.
The function accepts three parameters: `chainId1` and `chainId2`, both of which are `strings` representing the identifiers of the two chains being connected, and `connectionInfo`, which is an object containing the details of the IBC connection as specified by the `IBCConnectionInfo` format
92
+
## **getConnectionInfo(chain1, chain2)**
87
93
88
-
## **Retrieving Connection Information (`getConnectionInfo`)**
94
+
- chain1: **string** | { chainId: **string** }
95
+
- chain2: **string** | { chainId: **string** }
96
+
- Returns: **Vow\<IBCConnectionInfo\<K\>\>**
89
97
90
98
Retrieves stored connection information from `connectionInfos` mapstore or fetches it from a remote source if not available locally.
The function takes two parameters, `chain1` and `chain2`, each of which can be either a `string` representing a chain identifier or an `object` with a `chainId` property, and it returns a promise (`Vow`) that resolves with an `IBCConnectionInfo` object detailing the connection between the two chains.
The function accepts two parameters, `chainName1` and `chainName2`, both of which are strings but defined as template types `C1` and `C2` respectively. It returns a promise (`Vow`) that resolves to a tuple containing the detailed information of both chains, `ActualChainInfo<C1>` and `ActualChainInfo<C2>`, along with their IBC connection information (`IBCConnectionInfo`).
0 commit comments