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
Here, we overview the fundamental concepts involved with building orchestration smart contracts.
3
+
This document provides an overview of the fundamental concepts involved in building orchestration smart contracts,
4
+
focusing on Orchestrator Interface, Orchestration Accounts, and ChainHub.
4
5
5
-
### Interchain Account (ICA)
6
+
##Orchestrator Interface
6
7
7
-
[Interchain Accounts](/glossary/#interchain-account-ica) (ICAs) are an IBC feature used in Agoric’s Orchestration API. They enable an Agoric smart contract to control an account on another blockchain within the Cosmos ecosystem, facilitated by Agoric [Orchestration](/glossary/#orchestration) API. This feature leverages the [Inter-Blockchain Communication (IBC)](/glossary/#ibc) protocol to facilitate interactions and transactions across different blockchains seamlessly.
8
+
The [`Orchestrator`](https://agoric-sdk.pages.dev/interfaces/_agoric_orchestration.Orchestrator) interface provides a
9
+
set of high-level methods to manage and interact with local and remote chains. Below are the primary methods:
-`getChain` retrieves a chain object for the given `chainName` to get access to chain-specific methods. See [getChain](https://agoric-sdk.pages.dev/interfaces/_agoric_orchestration.Orchestrator#getChain).
14
14
15
-
A key advantage of ICAs is that they make accounts on other chains look like any other (remotable) object. When a contract creates an ICA, it has sole access to and control over the account but can delegate certain forms of access to its clients.
16
-
17
-
For a detailed explanation of these access control rules, see [Access Control with Objects](/guides/zoe/contract-access-control).
This sample is taken from one of the [example contracts](https://github.com/Agoric/agoric-sdk/blob/master/packages/orchestration/src/examples/swapExample.contract.js)
21
+
-`getBrandInfo` returns information about a `denom`, including the equivalent local Brand, the chain where the denom is
22
+
held, and the chain that issues the corresponding asset. See [getBrandInfo](https://agoric-sdk.pages.dev/interfaces/_agoric_orchestration.Orchestrator#getBrandInfo).
The `makeChainHub` utility manages the connections and metadata for various blockchain 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.
52
-
53
-
It simplifies accessing and interacting with multiple chains, providing a unified interface for the orchestration logic to manage cross-chain operations effectively.
54
-
ChainHub also allows dynamic registration and use of chain and connection information.
28
+
-`asAmount` converts a denom amount to an `Amount` with a brand. See [asAmount](https://agoric-sdk.pages.dev/interfaces/_agoric_orchestration.Orchestrator#asAmount).
// Register a connection between the Agoric chain and the new chain
63
-
chainHub.registerConnection(
64
-
agoricChainInfo.chainId,
65
-
chainInfo.chainId,
66
-
connectionInfo
67
-
);
68
-
```
36
+
Orchestration accounts are a key concept in the Agoric Orchestration API, represented by the [`OrchestrationAccountI`](https://agoric-sdk.pages.dev/interfaces/_agoric_orchestration.OrchestrationAccountI)
37
+
interface. These accounts provide high-level operations for managing accounts on remote chains, allowing seamless
38
+
interaction and management of interchain accounts. The orchestration accounts abstract the complexity of interchain
39
+
interactions, providing a unified and simplified interface for developers.
69
40
70
-
In this example, `chainHub` is used to register a new chain and establish a connection between the Agoric chain and the newly registered chain.
41
+
### Account Creation
71
42
72
-
### Orchestration Account
43
+
-`makeAccount` (for a chain object) creates a new account on local and/or remote chain as below.
73
44
74
-
Orchestration accounts are a key concept in the Agoric Orchestration API, represented by the [`OrchestrationAccountI`](https://agoric-sdk.pages.dev/interfaces/_agoric_orchestration.OrchestrationAccountI) interface. These accounts provide high-level operations for managing accounts on remote chains, allowing seamless interaction and management of interchain accounts. The orchestration accounts abstract the complexity of interchain interactions, providing a unified and simplified interface for developers.
0 commit comments