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
-`asAmount`converts a denom amount to an `Amount` with a brand. See [asAmount](https://agoric-sdk.pages.dev/interfaces/_agoric_orchestration.Orchestrator#asAmount).
35
+
-`asAmount`converts a denom amount to an `Amount` with a brand. See [asAmount](https://agoric-sdk.pages.dev/interfaces/_agoric_orchestration.Orchestrator#asAmount).
The `makeChainHub` utility manages the connections and metadata for various blockchain
85
-
networks. It creates a new `ChainHub` instance implementing the [`ChainHubI`](https://github.com/Agoric/agoric-sdk/blob/000693442f821c1fcea007a2df740733b1f75ebe/packages/orchestration/src/exos/chain-hub.js#L70-L80C4) interface.
86
-
87
-
It simplifies accessing and interacting with multiple chains, providing a unified interface
88
-
for the orchestration logic to manage cross-chain operations effectively.
89
-
ChainHub also allows dynamic registration and use of chain and connection information.
84
+
ChainHub is a centeralized registry of chains, connections, and denoms
85
+
that simplifies accessing and interacting with multiple chains, providing
86
+
a unified interface for the orchestration logic to manage cross-chain
87
+
operations effectively. A chainHub instance can be created using a call
88
+
to `makeChainHub` that makes a new ChainHub in the zone (or in the heap
89
+
if no [zone](/glossary/#zone) is provided). The resulting object is an [Exo](/glossary/#exo) singleton.
90
+
It has no precious state. Its only state is a cache of queries to
91
+
`agoricNames` and the info provided in registration calls. When you
92
+
need a newer version you can simply make a hub and repeat the registrations.
93
+
ChainHub allows dynamic registration and use of chain and connection
94
+
information using the following API.
95
+
96
+
97
+
### Registration APIs
98
+
99
+
-`registerChain` register a new chain with `chainHub`. The name will override
100
+
a name in well known chain names. If a durable zone was not provided,
101
+
registration will not survive a reincarnation of the vat, and will have to be
102
+
registered again.
103
+
-`registerConnection` registers a connections between two given chain IDs.
104
+
-`registerAsset` registers an asset that may be held on a chain other than
105
+
the issuing chain. Both corresponding chains should already be registered
106
+
before this call.
107
+
108
+
### Information Retrieval
109
+
110
+
-`getChainInfo` takes a chain name to get chain info.
111
+
-`getConnectionInfo` returns `Vow<IBCConnectionInfo>` for two given chain IDs.
112
+
-`getChainsAndConnection` is used to get chain and connection info give primary and counter chain names.
113
+
-`getAsset` retrieves holding, issuing chain names etc. for a denom.
114
+
-`getDenom` retrieves denom (string) for a `Brand`.
115
+
116
+
In the below example, `chainHub` is used to register a new chain and establish a connection
117
+
between the Agoric chain and the newly registered chain.
0 commit comments