Skip to content
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

Merged
6 commits merged into from
Jun 25, 2024

Conversation

ghost
Copy link

@ghost ghost commented Jun 21, 2024

  • Added an orchestration directory under main/guides/ and created index.md file.
  • Added orchestration overview and a code snippet - this will probably be updated very soon

rendered:

refs

@ghost ghost marked this pull request as ready for review June 21, 2024 15:03
@ghost ghost requested review from Jovonni and dckc June 21, 2024 15:04
Copy link

cloudflare-workers-and-pages bot commented Jun 21, 2024

Deploying documentation with  Cloudflare Pages  Cloudflare Pages

Latest commit: 705279f
Status: ✅  Deploy successful!
Preview URL: https://09df7349.documentation-7tp.pages.dev
Branch Preview URL: https://ms-addding-orchestartion-ind.documentation-7tp.pages.dev

View logs

Copy link

github-actions bot commented Jun 21, 2024

Cloudflare deployment logs are available here

@ghost
Copy link
Author

ghost commented Jun 21, 2024

@Jovonni Please review the text and suggest changes.

@dckc dckc requested a review from mitdralla June 21, 2024 15:23
Copy link
Member

@dckc dckc left a 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 Show resolved Hide resolved
main/guides/orchestration/index.md Outdated Show resolved Hide resolved
main/guides/orchestration/index.md Outdated Show resolved Hide resolved
main/guides/orchestration/index.md Outdated Show resolved Hide resolved

```javascript
const amount = coins(100, 'utia');
const celestiaChain = E(orchestration).getChain('celestia');
Copy link
Member

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.

Suggested change
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

Copy link
Author

@ghost ghost Jun 24, 2024

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.

Copy link
Member

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

Comment on lines 15 to 18
const icaCelestia = await E(celestiaChain).createAccount();
await E(icaOsmosis).send(icaCelestia.receiver, amount);
await E(timerService).delay(6000n);
return E(icaCelestia).delegate(amount, celestiaValidator);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

technical

Suggested change
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 chains
  • 6000n is not a typical time period. 600n is more typical: 10 minutes.
  • Note: It's correct to use E() for timerService, but integration of E with the orchestration API is not yet available: asyncFlow should directly support E 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?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed as suggested.

@dckc

This comment was marked as outdated.

@dckc
Copy link
Member

dckc commented Jun 21, 2024

This seems relevant to #930; I went ahead and edited the PR description to say so.

@ghost ghost changed the title Adding Orchestration Docs index.md File Added orchestration overview and a code snippet Jun 21, 2024
Copy link
Member

@dckc dckc left a 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.

@mitdralla
Copy link
Contributor

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.

Copy link
Contributor

@mitdralla mitdralla left a 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)

@ghost
Copy link
Author

ghost commented Jun 25, 2024

To make this more clear, let's get those links in: (SwingSet, the glossary term vat and IBC)

@mitdralla, Done.

@ghost ghost requested a review from mitdralla June 25, 2024 07:47
Copy link
Contributor

@mitdralla mitdralla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, approved

@ghost ghost merged commit 185d891 into main Jun 25, 2024
5 checks passed
@ghost ghost deleted the ms/addding-orchestartion-index-docs branch June 25, 2024 16:19
@Jovonni
Copy link
Contributor

Jovonni commented Jun 26, 2024

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

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants