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

docs: name services: agoricNames, namesByAddress, board (WIP) #913

Merged
merged 3 commits into from
Jan 16, 2024

Conversation

dckc
Copy link
Member

@dckc dckc commented Jan 9, 2024

fixes #807

DRAFT until

  • add TOC entry (and decide whether integrations/ is a reasonable place to put this)

stretch goals:

  • make code examples into tested snippets
    • by adding an example dapp that uses these namespaces
  • explain relationship between agoricNames and consume/produce patterns in permissioned contract deployment
  • reconcile with existing board docs under REPL
  • integrate with generated API doc? more typedoc agoric-sdk#8720

const { instance } = await E(zoe).startInstance(myNewContract);
const { brands: { Thing: thingBrand } } = await E(zoe).getTerms(instance);
const brandAdmin = E(agoricNamesAdmin).lookupAdmin('brand');
await E(brandAdmin).update('Thing', thingBrand);
Copy link
Member Author

Choose a reason for hiding this comment

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

This is a bad example. BLD staker governance should not approve meaningless names such as Thing.

Copy link
Member Author

Choose a reason for hiding this comment

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

Also TODO: note the risk of registering under a name such as BTC a brand for an asset that I just made up and that the market will not value at 1 BTC.

The keys of `agoricNames` include:
- `brand` - IST, BLD, Invitation (Zoe invitation brand), timer (a TimerBrand, not an ERTP brand)
- `issuer` - IST, BLD, Invitation, ...
- `vbankAsset` - IST, BLD, USDC, ATOM, ... - including info about corresponding cosmos denom
Copy link
Member Author

Choose a reason for hiding this comment

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

TODO: give the type of the values of the vbankAsset namehub

Copy link
Member Author

Choose a reason for hiding this comment

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

@dckc dckc requested a review from gibson042 January 9, 2024 07:59
@dckc dckc requested a review from Chris-Hibbert January 16, 2024 22:38
Comment on lines +64 to +69
```js
const bobAddress = 'agoric1...';
const anInvitationPayment = await zcf.makeInvitation(...);
const bobDepositFacet = E(namesByAddress).lookup(bobAddress, 'depositFacet');
const amtReceived = await E(bobDepositFacet).receive(anInvitationPayment);
```
Copy link
Member Author

Choose a reason for hiding this comment

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

ideally, these would be tested snippets of an example dapp

But dapp-offer-up doesn't use namesByAddress.

Copy link

cloudflare-workers-and-pages bot commented Jan 16, 2024

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 472ebe7
Status: ✅  Deploy successful!
Preview URL: https://ad34e637.documentation-7tp.pages.dev
Branch Preview URL: https://dc-name-services.documentation-7tp.pages.dev

View logs

@dckc dckc marked this pull request as ready for review January 16, 2024 23:17
@dckc dckc enabled auto-merge (rebase) January 16, 2024 23:17
@dckc dckc merged commit b453c04 into main Jan 16, 2024
4 checks passed
@dckc dckc deleted the dc-name-services branch January 16, 2024 23:19
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.

document NameHub API, agoricNames, namesByAddress
2 participants