From 64d7e6489c519c2cb3da24b9042c68e9bdf4d8e6 Mon Sep 17 00:00:00 2001 From: Mudassir Shabbir Date: Tue, 10 Sep 2024 17:27:54 +0500 Subject: [PATCH] chore: merged key concepts and API in orch --- .../getting-started/key-concepts.md | 42 ++++++++++++++----- 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/main/guides/orchestration/getting-started/key-concepts.md b/main/guides/orchestration/getting-started/key-concepts.md index 9a4fae06f..2f2881def 100644 --- a/main/guides/orchestration/getting-started/key-concepts.md +++ b/main/guides/orchestration/getting-started/key-concepts.md @@ -4,11 +4,13 @@ This document provides an overview of the fundamental concepts involved in build ## Orchestrator Interface -The [`Orchestrator`](https://agoric-sdk.pages.dev/interfaces/_agoric_orchestration.Orchestrator) interface provides a set of high-level methods to manage and interact with local and remote chains. Below are the primary methods: +The [`Orchestrator`](https://agoric-sdk.pages.dev/interfaces/_agoric_orchestration.Orchestrator) interface provides a set of high-level methods to manage and interact with +local and remote chains. Below are the primary methods: ### Access Chain Object -- `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). +- `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). ```javascript const chain = await orchestrator.getChain('chainName'); @@ -40,7 +42,11 @@ const amount = orchestrator.asAmount({ denom: 'uatom', value: 1000n }); ## Orchestration Account -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. +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. ### Address Management @@ -76,23 +82,39 @@ await orchestrationAccount.deposit(payment); ## ChainHub -ChainHub is a centralized registry of chains, connections, and denoms that simplifies accessing and interacting with multiple chains, providing a unified interface for the orchestration logic to manage cross-chain operations effectively. A ChainHub instance can be created using a call to `makeChainHub` that makes a new ChainHub in the zone (or in the heap if no [zone](/glossary/#zone) is provided). The resulting object is an [Exo](/glossary/#exo) singleton. It has no precious state. Its only state is a cache of queries to `agoricNames` and the info provided in registration calls. When you need a newer version you can simply make a hub and repeat the registrations. ChainHub allows dynamic registration and use of chain and connection information using the following API. +ChainHub is a centeralized registry of chains, connections, and denoms +that simplifies accessing and interacting with multiple chains, providing +a unified interface for the orchestration logic to manage cross-chain +operations effectively. A chainHub instance can be created using a call +to `makeChainHub` that makes a new ChainHub in the zone (or in the heap +if no [zone](/glossary/#zone) is provided). The resulting object is an [Exo](/glossary/#exo) singleton. +It has no precious state. Its only state is a cache of queries to +`agoricNames` and the info provided in registration calls. When you +need a newer version you can simply make a hub and repeat the registrations. +ChainHub allows dynamic registration and use of chain and connection +information using the following API. ### Registration APIs -- `registerChain` registers a new chain with `chainHub`. The name will override a name in well-known chain names. If a durable zone was not provided, registration will not survive a reincarnation of the vat, and will have to be registered again. -- `registerConnection` registers a connection between two given chain IDs. -- `registerAsset` registers an asset that may be held on a chain other than the issuing chain. Both corresponding chains should already be registered before this call. +- `registerChain` register a new chain with `chainHub`. The name will override + a name in well known chain names. If a durable zone was not provided, + registration will not survive a reincarnation of the vat, and will have to be + registered again. +- `registerConnection` registers a connections between two given chain IDs. +- `registerAsset` registers an asset that may be held on a chain other than + the issuing chain. Both corresponding chains should already be registered + before this call. ### Information Retrieval - `getChainInfo` takes a chain name to get chain info. - `getConnectionInfo` returns `Vow` for two given chain IDs. -- `getChainsAndConnection` is used to get chain and connection info given primary and counter chain names. -- `getAsset` retrieves holding, issuing chain names, etc. for a denom. +- `getChainsAndConnection` is used to get chain and connection info give primary and counter chain names. +- `getAsset` retrieves holding, issuing chain names etc. for a denom. - `getDenom` retrieves denom (string) for a `Brand`. -In the below example, `chainHub` is used to register a new chain and establish a connection between the Agoric chain and the newly registered chain. +In the below example, `chainHub` is used to register a new chain and establish a connection +between the Agoric chain and the newly registered chain. ```javascript const chainHub = makeChainHub(privateArgs.agoricNames, vowTools);