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

poc orch docs, key-concepts- introduction, and dapp pages #1132

Merged
merged 20 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions main/.vitepress/config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,35 @@ export default defineConfig({
{
text: 'Orchestration',
link: '/guides/orchestration/',
collapsed: true,
items: [
{
text: 'Key Concepts',
link: '/guides/orchestration/getting-started/key-concepts',
},
{
text: 'API',
link: '/guides/orchestration/getting-started/api',
},
{
text: 'Contract Walkthroughs',
link: '/guides/orchestration/getting-started/contract-walkthroughs',
items: [
{
text: 'Cross-Chain Swap Example',
link: '/guides/orchestration/getting-started/contract-walkthrough/cross-chain-swap',
},
{
text: 'Cross-Chain Unbond Example',
link: '/guides/orchestration/getting-started/contract-walkthrough/cross-chain-unbond',
},
{
text: 'Orchestration Basics',
link: '/guides/orchestration/getting-started/contract-walkthrough/orchestration-basics',
}
]
},
]
},
{
text: 'JavaScript Framework',
Expand Down
2 changes: 1 addition & 1 deletion main/.vitepress/theme/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// https://vitepress.dev/guide/custom-theme
import { h } from 'vue'
import { h, nextTick } from 'vue'
import DefaultTheme from 'vitepress/theme'
import './style.css'
import '../styles/index.styl';
Expand Down
7 changes: 6 additions & 1 deletion main/.vitepress/themeConfig/nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,12 @@ export const nav = [
collapsed: true,
items: [],
},

{
text: 'Orchestration',
link: '/guides/orchestration/',
collapsed: true,
items: [],
},
{
text: 'Zoe Smart Contract Framework',
link: '/guides/zoe/',
Expand Down
12 changes: 12 additions & 0 deletions main/glossary/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,10 @@ Guide](https://github.com/endojs/endo/blob/HEAD/packages/ses/docs/guide.md) for
The Inter-Blockchain Communication protocol, used by blockchains to communicate with each other.
For more details, see [What developers need to know about inter-blockchain communication](https://www.computerweekly.com/blog/Open-Source-Insider/What-developers-need-to-know-about-inter-blockchain-communication).

## Interchain Account (ICA)
Interchain Accounts outlines a cross-chain account management protocol built upon IBC. Also see the ICS-027 Interchain Account [spec](https://tutorials.cosmos.network/academy/3-ibc/8-ica.html)


## Invitation

A [payment](#payment) whose amount represents (and is required for) participation in a contract instance.
Expand Down Expand Up @@ -593,6 +597,14 @@ communicate with other vats and their objects and functions, but can only commun

For more information, see the [Vat section in the Distributed JS Programming documentation](/guides/js-programming/#vats-the-unit-of-synchrony).

The concept of a vat is metaphorically inspired by the philosophical experiment known as “Brain in a Vat.” This thought experiment, explored in philosophy, posits a scenario in which a brain is sustained in a vat and connected to a computer that simulates reality, raising questions about knowledge, reality, and perception. Similarly, in the context of distributed systems, a vat isolates and encapsulates its contents, maintaining strict boundaries on synchronous and asynchronous communication, much like the hypothetical brain’s isolated and controlled environment. For more details, see the Wikipedia page on [Brain in a Vat](https://en.wikipedia.org/wiki/Brain_in_a_vat).


# Vow

Vows are objects that represent promises that can be stored durably. Native promises are not compatible with Agoric's durable stores, which means that on the Agoric platform, such promises disconnect their clients when their creator vat is upgraded.


## Wallet

The overall place a party keeps their assets of all brands. For example, your wallet might contain 5 Quatloos
Expand Down
Binary file added main/guides/orchestration/assets/icaoverview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added main/guides/orchestration/assets/orca.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added main/guides/orchestration/assets/orca2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
86 changes: 86 additions & 0 deletions main/guides/orchestration/getting-started/api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# Orchestration API
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure if it's worth working on but I'm a very visual person so I like graphs. In my mind I kinda produced below graph that helped me mentally:

orchestrator
|
getChain()
|
v
chain
|
makeAccount()
|
v
orchestrationAccount (getAddress, getBalances, getBalance, etc)
|
uses under the hood
|
v
IcaAccount

Worth adding something like this graph(albeit a lot more nicely looking) at the top of this page?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

love this idea! @LuqiPan

Copy link
Contributor

Choose a reason for hiding this comment

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

this is a great idea @LuqiPan, having a visual up top is impactful

Copy link
Member

Choose a reason for hiding this comment

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

we've had pretty good luck with mermaid sequence diagrams

e.g. there are several in the Trading with Offer Safety walkthru

Note that both the mermaid source and generated .svg are checked in
There's a nice vs-code extension for generating the .svg with one key


The Agoric Orchestration API enables developers to seamlessly manage and interact with accounts across multiple blockchain networks, simplifying the complexities of cross-chain operations.

See [Orchestration API Spec](https://agoric-sdk.pages.dev/modules/_agoric_orchestration)

## API Surface Functions
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
## API Surface Functions
## Orchestrator Interface


The Orchestration API provides a set of high-level functions to manage and interact with interchain accounts. Below are the primary functions available to developers:

### getChain
Retrieves the chain information and provides access to chain-specific methods.

```javascript
const chain = await orchestrator.getChain('chainName');
```

### makeLocalAccount
Creates a new local chain account.

```javascript
const localAccount = await orchestrator.makeLocalAccount();
```

### getBrandInfo
Returns information about a denom, including the equivalent local Brand, the chain where the denom is held, and the chain that issues the corresponding asset.

```javascript
const brandInfo = orchestrator.getBrandInfo('denom');
```

### asAmount
Converts a denom amount to a local structured Amount.

```javascript
const amount = orchestrator.asAmount({ denom: 'uatom', value: 1000n });
```

## Orchestration Account Functions
Orchestration accounts provide high-level operations for managing accounts on remote chains. Below are the primary methods available:

### getAddress
Retrieves the address of the account on the remote chain.
```javascript
const address = await orchestrationAccount.getAddress();
```

### getBalances
Returns an array of amounts for every balance in the account.

```
Copy link
Contributor

Choose a reason for hiding this comment

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

This is missing syntax highlighting for javascript

const balances = await orchestrationAccount.getBalances();
```

### getBalance
Retrieves the balance of a specific denom for the account.

```javascript
const balance = await orchestrationAccount.getBalance('uatom');
```

### send
Transfers an amount to another account on the same chain. The promise settles when the transfer is complete.

```javascript
await orchestrationAccount.send(receiverAddress, amount);
```

### transfer
Transfers an amount to another account, typically on another chain. The promise settles when the transfer is complete.

```javascript
await orchestrationAccount.transfer(amount, destinationAddress);
```

### transferSteps
Transfers an amount to another account in multiple steps. The promise settles when the entire path of the transfer is complete.
```javascript
await orchestrationAccount.transferSteps(amount, transferMsg);
```

### deposit
Deposits payment from Zoe to the account. For remote accounts, an IBC Transfer will be executed to transfer funds there.
```javascript
await orchestrationAccount.deposit(payment);
```
Loading