frostfs-http-gw/docs/nns.md
Alex Vanin 9e24498eee
All checks were successful
/ Lint (pull_request) Successful in 5m48s
/ Tests (pull_request) Successful in 4m34s
/ DCO (pull_request) Successful in 6m51s
/ Vulncheck (pull_request) Successful in 7m4s
/ Builds (pull_request) Successful in 7m20s
[#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-16 16:03:09 +03: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