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

sui ns rpc: resolve between address and name #10684

Merged
merged 3 commits into from
Apr 13, 2023

Conversation

gegaowp
Copy link
Contributor

@gegaowp gegaowp commented Apr 10, 2023

The related Move change is:
https://github.com/MystenLabs/sui/compare/ds/archive?expand=1

Test Plan

Test locally with Move contract ^^

  1. start Sui network, publish module and make move calls to add new pairs
target/debug/sui start

// under sui/sui_programmability/examples/archive
sui client publish --gas-budget 100000000

sui client call --package 0xf12ab3bf6c1b53add39529bedd0ebb1b083a3dc7e4736ff35bbeccf2be80f80f --module archive --function add_record --gas-budget 100000000 --args 0xd3db0bd1b6847412b1aa0e4f0ff5c96eceba1a8cc0f30df5946f38102b8da3fa 0x6 0x54f349899f6b521547bcfcb2605c65f307934b4f32c256fd3e2d4df6feecb870 "ccc"
  1. stop Sui network, override FN config file with the fetched resolver object ID by adding this line to ~/.sui/sui_config/fullnode.yaml
name-service-resolver-object-id: <archive_object_id>
  1. restart Sui network without FN; start FN based on config with fetched resolved object ID
target/debug/sui start --no-full-node

cargo run --bin sui-node -- --config-path  /Users/gegao/.sui/sui_config/fullnode.yaml

  1. test on RPC
curl --location --request POST http://127.0.0.1:9000 \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "suix_resolveNameServiceAddress",
    "params": ["ccc"]
}'
{"jsonrpc":"2.0","result":"0x54f349899f6b521547bcfcb2605c65f307934b4f32c256fd3e2d4df6feecb870","id":1}%                                                                 

curl --location --request POST http://127.0.0.1:9000 \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "suix_resolveNameServiceNames",
    "params": ["0x54f349899f6b521547bcfcb2605c65f307934b4f32c256fd3e2d4df6feecb870"]
}'
{"jsonrpc":"2.0","result":["ccc"],"id":1}%

@vercel
Copy link

vercel bot commented Apr 10, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

4 Ignored Deployments
Name Status Preview Comments Updated (UTC)
explorer ⬜️ Ignored (Inspect) Apr 12, 2023 7:20pm
explorer-storybook ⬜️ Ignored (Inspect) Apr 12, 2023 7:20pm
sui-wallet-kit ⬜️ Ignored (Inspect) Apr 12, 2023 7:20pm
wallet-adapter ⬜️ Ignored (Inspect) Apr 12, 2023 7:20pm

@gegaowp gegaowp marked this pull request as ready for review April 10, 2023 22:58
@gegaowp gegaowp changed the title sui ns: resolve between address and name sui ns rpc: resolve between address and name Apr 10, 2023
@gegaowp gegaowp force-pushed the sui-ns-resolve branch 2 times, most recently from 66d8c87 to 13d0700 Compare April 12, 2023 13:57
Copy link
Contributor

@Jordan-Mysten Jordan-Mysten left a comment

Choose a reason for hiding this comment

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

API Changes LGTM, would get a rust review tho

@gegaowp gegaowp enabled auto-merge (squash) April 13, 2023 19:57
@gegaowp gegaowp merged commit 7d6070e into MystenLabs:main Apr 13, 2023
@gegaowp gegaowp deleted the sui-ns-resolve branch April 13, 2023 21:40
gegaowp added a commit that referenced this pull request May 17, 2023
## Description 

Update JSON RPC with new spec

## Test Plan 

local testing, similar to 
#10684
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.

2 participants