Skip to content

Commit

Permalink
Add FAQ for ANS
Browse files Browse the repository at this point in the history
  • Loading branch information
banool committed Dec 20, 2022
1 parent 8a9ac07 commit 79f8d0a
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 0 deletions.
6 changes: 6 additions & 0 deletions developer-docs-site/docs/concepts/aptos-names-service.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: "Aptos Names Service"
id: "aptos-names-service"
---

Aptos Names is a service that allows users to associate a name with an address. Developers may lookup address -> name or name -> address.
54 changes: 54 additions & 0 deletions developer-docs-site/docs/guides/aptos-names-service-faq.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
title: "ANS FAQ"
id: "aptos-names-service-faq"
---

todo, this is a bit of a mess bc currently we recommend using aptosnames.com/api, but really we should use a fullnode

## Which query method should I use?
For now, query via aptosnames.com. SDK support will land soon for querying directly via the fullnode, which is a more reliable approach.

## How do I query name -> address via aptosnames.com/api?
See https://www.aptosnames.com/about/doc.

## How do I query address -> name via an aptosnames.com/api?
See https://www.aptosnames.com/about/doc.

## What name is returned if multiple names point to the same address?
TODO: Answer what the address -> name lookup returns.

## How do I query name -> address via a fullnode?
Coming soon!

TODO: Provide answers for curl + each of the SDKs (which should use the fullnode).

## How do I query address -> name via a fullnode?
Coming soon!

TODO: Provide answers for curl + each of the SDKs (which should use the fullnode) (once the contract change lands).

## How do I query name -> address via an indexer?
If you prefer to do it this way, you can do so with a query like this:
```
todo
```

Note that the fullnode approach is lower latency and has fewer dependencies though, so using a fullnode (which is what the SDKs use) is recommended.

## How do I query address -> name via an indexer?
If you prefer to do it this way, you can do so with a query like this:
```
todo
```

## Are the endpoints at aptosnames.com/api reliable?
Consider a lookup via aptosnames.com/api, for example this name to address lookup:
```ts
const name = "test";
const response = await fetch(`https://www.aptosnames.com/api/testnet/v1/address/${name}`);
const { address } = await response.json();
```

This takes the following path: Client -> aptosnames.com/api -> Google Cloud Functions -> Public Aptos Indexer. The indexer in turn relies on its own DB and fullnode.

So far this service has never gone down, but if you consider this too many potential points of failure, you may do a lookup via the fullnode directly (coming soon).
8 changes: 8 additions & 0 deletions developer-docs-site/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,14 @@ const sidebars = {
collapsed: true,
items: ["guides/wallet-adapter-for-dapp", "guides/wallet-adapter-for-wallets"],
},
{
type: "category",
label: "Aptos Names Service",
link: { type: "doc", id: "concepts/aptos-names-service" },
collapsible: true,
collapsed: true,
items: ["guides/aptos-names-service-faq"],
},
{
type: "html",
value: "Run Nodes",
Expand Down

0 comments on commit 79f8d0a

Please sign in to comment.