-
Notifications
You must be signed in to change notification settings - Fork 39
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
Added orchestration overview and a code snippet #1129
Conversation
Deploying documentation with Cloudflare Pages
|
Cloudflare deployment logs are available here |
@Jovonni Please review the text and suggest changes. |
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.
Good to see us getting started on this!
I have several technical comments.
main/guides/orchestration/index.md
Outdated
|
||
```javascript | ||
const amount = coins(100, 'utia'); | ||
const celestiaChain = E(orchestration).getChain('celestia'); |
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.
technical: We don't use E
like this in the orchestration API.
const celestiaChain = E(orchestration).getChain('celestia'); | |
const celestiaChain = await orchestration.getChain('celestia'); |
Here's hoping we add an example to Orchestrator.getChain ... and clean up the huge inline chainInfo stuff there. cc @turadg
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.
I fixed it as suggested but just wanted to double-check though because the following is a snippet from an example code (stakeIca.contract
) in orchestration package:
const account = await E(orchestration).makeAccount(
chainId,
hostConnectionId,
controllerConnectionId,
);
@dckc Please confirm.
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.
Good question.
E(orchestration).makeAccount(...)
is a method call on an OrchestrationService
, which is in a separate vat, so it needs E
. In contrast, getChain
is a method on Orchestrator
, which is near (in the same vat).
Perhaps it would be more clear to use orchestrator
in place of orchestration
.
Here's hoping we manage to get the reference docs cleaned up soon:
https://agoric-sdk.pages.dev/interfaces/_agoric_orchestration.Orchestrator#getChain
https://agoric-sdk.pages.dev/types/_agoric_orchestration.OrchestrationService
main/guides/orchestration/index.md
Outdated
const icaCelestia = await E(celestiaChain).createAccount(); | ||
await E(icaOsmosis).send(icaCelestia.receiver, amount); | ||
await E(timerService).delay(6000n); | ||
return E(icaCelestia).delegate(amount, celestiaValidator); |
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.
technical
const icaCelestia = await E(celestiaChain).createAccount(); | |
await E(icaOsmosis).send(icaCelestia.receiver, amount); | |
await E(timerService).delay(6000n); | |
return E(icaCelestia).delegate(amount, celestiaValidator); | |
const icaCelestia = await celestiaChain.createAccount(); | |
await icaOsmosis.transfer(icaCelestia.getAddress(), amount); | |
await E(timerService).delay(600n); | |
return icaCelestia.delegate(celestiaValidator, amount); |
- no
E
for chain objects, ica objects .receiver
->.getAddress()
.send()
only works within 1 chain. use.transfer()
to do an IBC transfer across chains6000n
is not a typical time period.600n
is more typical: 10 minutes.- Note: It's correct to use
E()
fortimerService
, but integration ofE
with the orchestration API is not yet available: asyncFlow should directly supportE
via promise handlers agoric-sdk#9299 - arguments to delegate go in the other order.
I'd really like us to use snippets of code that's tested in ci for examples such as this. Perhaps we can include https://github.com/Agoric/dapp-orchestration-basics as a git submodule and get snippets from there?
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.
Fixed as suggested.
This comment was marked as outdated.
This comment was marked as outdated.
This seems relevant to #930; I went ahead and edited the PR description to say so. |
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.
My technical comments are addressed. (editorial too).
I'd like to defer to @mitdralla to approve.
This is a good first pass. I would like to see a few more inter-links to our documentation where possible - for example to SwingSet, even the glossary term vat and IBC. This landing page will also evolve over time as the API gets built out. |
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.
To make this more clear, let's get those links in: (SwingSet, the glossary term vat and IBC)
@mitdralla, Done. |
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.
looks good, approved
Also maybe we should make an outline for this section, so we can knock out the sections pretty quick at least a first pass. Should we maybe start from our curriculum? @mudassir-agoric |
orchestration
directory undermain/guides/
and createdindex.md
file.rendered:
refs