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/index.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ The Orchestration API handles asynchronous tasks and complex workflows, includin
22
22
23
23
## Introduction to Orchestration API Flow
24
24
25
-
The following sequence diagram provides a comprehensive overview of the orchestration process within the Agoric platform. This example illustrates the interaction between various components, highlighting how the orchestration library (`OrchLib`) facilitates cross-chain operations. This is a good first example to understand the flow of the Orchestration API, showing the steps involved in creating and managing cross-chain transactions.
25
+
The following sequence diagram provides a comprehensive overview of the Orchestration process within the Agoric platform. This example illustrates the interaction between various components, highlighting how the Orchestration library (`OrchLib`) facilitates cross-chain operations. This is a good first example to understand the flow of the Orchestration API, showing the steps involved in creating and managing cross-chain transactions.
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
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
38
+
interaction and management of interchain accounts. The Orchestration accounts abstract the complexity of interchain
39
39
interactions, providing a unified and simplified interface for developers.
Copy file name to clipboardExpand all lines: main/guides/orchestration/orchestration-basics/contract.md
+59-38
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,17 @@
1
1
# Orca Contract Code Walkthrough
2
2
3
-
This section provides a walkthrough of the Orca contract code, explaining its structure, key components, and functionality. The Orca contract is designed to manage orchestration accounts and fund them. It interacts with multiple chains and provides functionality for creating accounts and funding them. The code for the contract logic is in two files:
3
+
This section provides a walkthrough of the Orca contract code, explaining its structure, key components, and
4
+
functionality. The Orca contract is designed to manage Orchestration accounts and fund them. It interacts with multiple
5
+
chains and provides functionality for creating accounts and funding them. The code for the contract logic is in two
The `orca.contract.js` files brings in necessary dependencies and types from various Agoric packages. The flows import contains specific logic for the Orca contract operations.
13
+
The `orca.contract.js` file brings in necessary dependencies and types from various Agoric packages. The `flows` import
14
+
contains specific logic for the Orca contract offer handling operations.
11
15
12
16
```js
13
17
import { AmountShape } from'@agoric/ertp';
@@ -21,7 +25,7 @@ import * as flows from './orca.flows.js';
21
25
22
26
### Type Definitions and Shapes
23
27
24
-
These definitions create shapes for validating the structure of amounts and orchestration powers.
28
+
The following definitions create shapes for validating the structure of `amount` and Orchestration powers.
This is the main contract function that sets up the contract's functionality.
47
+
This is the main `contract` function that initializes and sets up the contract's functionality.
44
48
45
49
```js
46
50
constcontract=async (
@@ -55,7 +59,7 @@ const contract = async (
55
59
56
60
Within the `contract` function, following actions are performed.
57
61
58
-
-**Chain Registration**: Below section registers chains and their connections with the `chainHub`.
62
+
-**Chain Registration**: Below code section registers chains and their connections with the `chainHub`.
59
63
60
64
```js
61
65
const { chainDetails } =zcf.getTerms();
@@ -72,15 +76,18 @@ for (const [name, info] of entries(chainDetails)) {
72
76
}
73
77
```
74
78
75
-
-**Creating Account and Funding Functions**: These functions are created using the `orchestrateAll` helper, which sets up the necessary flow logic for account creation and funding.
79
+
-**Creating Account and Funding Functions**: These functions are created using the `orchestrateAll` helper, which sets
80
+
up the necessary flow logic for account creation and funding but the logic is implemented in `orca.flows.js` file
-**Public Facet**: The public facet provides two methods: `makeAccountInvitation` creates an invitation to make an orchestration account, and `makeCreateAndFundInvitation` creates an invitation to make an account and fund it.
89
+
-**Public Facet**: The public facet provides two methods: `makeAccountInvitation` creates an invitation to make an
90
+
Orchestration account, and `makeCreateAndFundInvitation` creates an invitation to make an account and fund it.
84
91
85
92
```js
86
93
constpublicFacet=zone.exo(
@@ -107,7 +114,8 @@ const publicFacet = zone.exo(
107
114
108
115
### `start` Function
109
116
110
-
The start function is wrapped with `withOrchestration`, which provides additional orchestration setup and tools for the contract.
117
+
The start function is wrapped with `withOrchestration`, which provides additional Orchestration setup and tools for the
118
+
contract.
111
119
112
120
```js
113
121
exportconststart=withOrchestration(contract);
@@ -116,7 +124,8 @@ harden(start);
116
124
117
125
## Walkthrough `orca.flows.js`
118
126
119
-
This section provides a walkthrough of the `orca.flows.js` file, which contains flow functions for the Orca contract. The `orca.flows.js` file defines two main functions:
127
+
This section provides a walkthrough of the `orca.flows.js` file, which contains flow functions for the Orca contract.
128
+
The `orca.flows.js` file defines two main functions:
120
129
121
130
1.`makeAccount`: Creates an account on a Cosmos chain.
122
131
2.`makeCreateAndFund`: Creates an account on a Cosmos chain and funds it.
@@ -125,14 +134,21 @@ These functions are called by the Zoe vat when a user makes an offer using a cor
125
134
126
135
### `makeAccount` Function
127
136
128
-
This function creates an account on a specified Cosmos chain. This function not only creates the account but also returns a continuing offer that allows the user to perform further actions like delegation, rewards withdrawl, and transfers. Here are the parameters of this function:
137
+
This function creates an account on a specified Cosmos chain. This function not only creates the account but also
138
+
returns a continuing offer that allows the user to perform further actions like delegation, rewards withdrawl, and
139
+
transfers. Here are the parameters of this function:
140
+
141
+
-`orch`: An Orchestrator instance parameter represents an instance of the `Orchestrator`, a powerful abstraction that
142
+
manages interactions with the blockchain. It provides methods to interact with different chains, create accounts, and
143
+
fetch chain information.
129
144
130
-
-`orch`: An Orchestrator instance parameter represents an instance of the `Orchestrator`, a powerful abstraction that manages interactions with the blockchain. It provides methods to interact with different chains, create accounts, and fetch chain information.
131
145
-`_ctx`: Unused context object
132
146
-`seat`: A `ZCFSeat` instance. It holds a proposal object corresponding to the current offer.
133
-
-`offerArgs`: An object containing `chainName` (that identifies the chain the orchestration account should be created on) and `denom`.
147
+
-`offerArgs`: An object containing `chainName` (that identifies the chain the Orchestration account should be created on) and `denom`.
134
148
135
-
The function validates the `offerArgs` to ensure it contains a `chainName`, retrieves the specified chain using `orch`, creates an account on the chain using `chain.makeAccount()`, and returns the account as a continuing offer. Below is the code of `makeAccount` after removing some debug information logging code.
149
+
The function validates the `offerArgs` to ensure it contains a `chainName`, retrieves the specified chain using `orch`,
150
+
creates an account on the chain using `chain.makeAccount()`, and returns the account as a continuing offer. Below is the
151
+
code of `makeAccount` after removing some debug information logging code.
Once the account is created, the function returns a continuing offer by calling `chainAccount.asContinuingOffer()`. This allows the user to perform further actions on the account, such as delegating tokens or withdrawing rewards, through subsequent offers.
162
+
Once the account is created, the function returns a continuing offer by calling `chainAccount.asContinuingOffer()`. This
163
+
allows the user to perform further actions on the account, such as delegating tokens or withdrawing rewards, through
164
+
subsequent offers.
147
165
148
166
### `makeCreateAndFund` Function
149
167
150
-
This function creates an account on a specified Cosmos chain and funds it. It accepts the same set of parameters as `make Account`. The function:
168
+
This function creates an account on a specified Cosmos chain and funds it. It accepts the same set of parameters as
169
+
`make Account`. The function:
151
170
152
171
- Extracts the amount to be transferred from the seat's proposal, and retrieves both the Agoric chain and the specified target chain.
153
172
- Fetches chain info and asset information.
@@ -159,27 +178,29 @@ This function creates an account on a specified Cosmos chain and funds it. It ac
159
178
Below is the code of `makeCreateAndFund` after removing some debug information logging code.
As in the previous case, the function returns a continuing offer by calling `remoteAccount.asContinuingOffer()` for further actions on the account.
202
+
As in the previous case, the function returns a continuing offer by calling `remoteAccount.asContinuingOffer()` for
203
+
further actions on the account.
184
204
185
-
Apart from above mentioned logic, several trace calls are made to log the current state of the function. This is useful for debugging and ensuring that the function's inputs and intermediate states are correct.
205
+
Apart from above mentioned logic, several trace calls are made to log the current state of the function. This is useful
206
+
for debugging and ensuring that the function's inputs and intermediate states are correct.
Copy file name to clipboardExpand all lines: main/guides/orchestration/orchestration-basics/index.md
+3-1
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,9 @@
2
2
3
3
To get started with developing using the Orchestration API, developers can make use of our [dapp-orchestration-basics](https://github.com/Agoric/dapp-orchestration-basics) template.
4
4
5
-
Following the dApp pattern of our existing dapp templates, `dapp-orchestration-basics` contains both ui & contract directory within a single yarn workspace. In this walkthrough, we learn about the installation process, the contract code, and UI components of `dapp-orchestration-basics`.
5
+
Following the dApp pattern of our existing dapp templates, `dapp-orchestration-basics` also contains a `contract` and a `ui`
6
+
directory within a single yarn workspace. In this walkthrough, we learn about the installation process, the contract
7
+
code, and UI components of `dapp-orchestration-basics`.
0 commit comments