-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improvements to Orchestration Key-Concepts Page #1201
Merged
+112
−165
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next
Next commit
docs: structural improvements to key-concepts.md
commit c2cf57880e769e94ce0986ee2ad9b896054e0979
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,26 @@ | ||
# Orchestration Key Concepts | ||
|
||
Here, we overview the fundamental concepts involved with building orchestration smart contracts. | ||
This document provides an overview of the fundamental concepts involved in building orchestration smart contracts, focusing on Interchain Accounts (ICA), ChainHub, and Orchestration Accounts. | ||
|
||
### Interchain Account (ICA) | ||
--- | ||
|
||
[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. | ||
## Interchain Account (ICA) | ||
|
||
<br/> | ||
<img src="../assets/icaoverview.png" width="100%" /> | ||
Jovonni marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<br/> | ||
[Interchain Accounts](/glossary/#interchain-account-ica) (ICAs) are an IBC feature utilized within Agoric’s Orchestration API. They enable an Agoric smart contract to control an account on another blockchain in the Cosmos ecosystem. The [Inter-Blockchain Communication (IBC)](/glossary/#ibc) protocol facilitates seamless interactions and transactions across different blockchains. | ||
|
||
Photo credit: [cosmos.network documentation](https://tutorials.cosmos.network/academy/3-ibc/8-ica.html) | ||
#### Benefits of ICAs | ||
- **Cross-chain Control**: ICAs allow a contract to manage accounts on other chains, treating them like any other (remotable) object. | ||
- **Access Control**: Only the contract that creates the ICA has full control over it but can delegate specific access permissions to clients. | ||
|
||
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. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. any reason we are removing this? |
||
For more details on access control, refer to [Access Control with Objects](/guides/zoe/contract-access-control). | ||
|
||
For a detailed explanation of these access control rules, see [Access Control with Objects](/guides/zoe/contract-access-control). | ||
|
||
### Example ICA Usage from a Smart Contract | ||
### Example: ICA Usage in a Smart Contract | ||
|
||
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) | ||
Here’s an example of ICA usage from one of the [sample contracts](https://github.com/Agoric/agoric-sdk/blob/master/packages/orchestration/src/examples/swapExample.contract.js): | ||
|
||
```js | ||
const stakeAndSwapFn = async (orch, ...) => { | ||
// ... | ||
const omni = await orch.getChain('omniflixhub'); | ||
const agoric = await orch.getChain('agoric'); | ||
|
||
|
@@ -33,8 +31,7 @@ const stakeAndSwapFn = async (orch, ...) => { | |
|
||
const omniAddress = omniAccount.getAddress(); | ||
|
||
// deposit funds from user seat to LocalChainAccount | ||
// ... | ||
// Deposit funds from user seat to LocalChainAccount | ||
const transferMsg = orcUtils.makeOsmosisSwap({ ... }); | ||
|
||
try { | ||
|
@@ -46,7 +43,7 @@ const stakeAndSwapFn = async (orch, ...) => { | |
}; | ||
``` | ||
|
||
### ChainHub | ||
## ChainHub | ||
|
||
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. | ||
|
||
|
@@ -69,7 +66,7 @@ chainHub.registerConnection( | |
|
||
In this example, `chainHub` is used to register a new chain and establish a connection between the Agoric chain and the newly registered chain. | ||
|
||
### Orchestration Account | ||
## 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. | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a reason why we are removing all education on interchain accounts? would like to understand this decision. If the team supports it then so be it, but I've found developers usually don't have an understanding on what an ICA is.
Although it can still be debated whether or not its useful, we have found it useful to explain it to them, and why its important. Other than that, orchestration accounts seem like magic.