frostfs-http-gw/docs/nns.md
Alex Vanin a945a947ac
Some checks failed
/ Vulncheck (push) Successful in 2m19s
/ Builds (push) Has been cancelled
/ Lint (push) Has been cancelled
/ Tests (push) Has been cancelled
[#183] Unlink API.md to README file
This is useful for auto-generated document tools
which parse docs dir.

Signed-off-by: Alex Vanin <a.vanin@yadro.com>
2024-12-17 13:03:02 +00:00

1.2 KiB

Nicename Resolving with NNS

Steps to start using name resolving:

  1. Enable NNS resolving in config (rpc_endpoint must be a valid neo rpc node, see configs for other examples):
rpc_endpoint: http://morph-chain.frostfs.devenv:30333
resolve_order:
  - nns
  1. Make sure your container is registered in NNS contract. If you use frostfs-dev-env you can check if your container (e.g. with container-name name) is registered in NNS:
$ curl -s --data '{"id":1,"jsonrpc":"2.0","method":"getcontractstate","params":[1]}' \
    http://morph-chain.frostfs.devenv:30333 | jq -r '.result.hash'

0x8e6c3cd4b976b28e84a3788f6ea9e2676c15d667

$ docker exec -it morph_chain neo-go \
    contract testinvokefunction \
    -r http://morph-chain.frostfs.devenv:30333 0x8e6c3cd4b976b28e84a3788f6ea9e2676c15d667 \
    resolve string:container-name.container int:16 \
    | jq -r '.stack[0].value | if type=="array" then .[0].value else . end' \
    | base64 -d && echo

7f3vvkw4iTiS5ZZbu5BQXEmJtETWbi3uUjLNaSs29xrL
  1. Use container name instead of its $CID. For example:
$ curl http://localhost:8082/get_by_attribute/container-name/FileName/object-name