laconicd-deprecated/x/nameservice
2022-04-20 17:21:52 +05:30
..
client chore: replace with wrn with crn 2022-04-20 13:19:07 +05:30
helpers migrate: add dxns module 2022-04-05 12:39:27 +05:30
keeper nameservice: return record id in setRecord message response 2022-04-20 17:21:52 +05:30
types nameservice: return record id in setRecord message response 2022-04-20 17:21:52 +05:30
abci.go nameservice: implement processing record and authority expiry 2022-04-19 15:51:37 +05:30
genesis.go nameservice: return names with records query 2022-04-18 14:44:32 +05:30
module.go migrate: add dxns module 2022-04-05 12:39:27 +05:30
README.md chore: replace with wrn with crn 2022-04-20 13:19:07 +05:30

Build chain

# it will create binary in build folder with `ethermintd`
$ make build

Setup Chain

./build/chibaclonkd keys add root
./build/chibaclonkd init test-moniker --chain-id ethermint_9000-1
./build/chibaclonkd add-genesis-account $(./build/chibaclonkd keys show root -a) 1000000000000000000aphoton,1000000000000000000stake
./build/chibaclonkd gentx root 1000000000000000000stake --chain-id ethermint_9000-1
./build/chibaclonkd collect-gentxs
./build/chibaclonkd start

Get Params

$ ./build/chibaclonkd q nameservice params -o json | jq .
{
  "params": {
    "record_rent": {
      "denom": "stake",
      "amount": "1000000"
    },

    "record_rent_duration": "31536000s",
    "authority_rent": {
      "denom": "stake",
      "amount": "1000000"
    },
    "authority_rent_duration": "31536000s",
    "authority_grace_period": "172800s",
    "authority_auction_enabled": false,
    "authority_auction_commits_duration": "86400s",
    "authority_auction_reveals_duration": "86400s",
    "authority_auction_commit_fee": {
      "denom": "stake",
      "amount": "1000000"
    },
    "authority_auction_reveal_fee": {
      "denom": "stake",
      "amount": "1000000"
    },
    "authority_auction_minimum_bid": {
      "denom": "stake",
      "amount": "5000000"
    }
  }

Create (Set) Record

First you have to Create bond

$ ./build/chibaclonkd tx nameservice set ~/Desktop/examples/records/example1.yml 95f68b1b862bfd1609b0c9aaf7300287b92fec90ac64027092c3e723af36e83d --from root --chain-id ethermint_9000-1 --yes -o json
{
  "height": "0",
  "txhash": "BA44ABE1194724694E7CB290F9F3121DB4E63E1A030D95CB84813EEA132CF95F",
  "codespace": "",
  "code": 0,
  "data": "",
  "raw_log": "[]",
  "logs": [],
  "info": "",
  "gas_wanted": "0",
  "gas_used": "0",
  "tx": null,
  "timestamp": ""
}

Get records list

$ ./build/chibaclonkd q nameservice list -o json  | jq
[
  {
    "id": "bafyreih7un2ntk235wshncebus5emlozdhdixrrv675my5umb6fgdergae",
    "bondId": "c3f7a78c5042d2003880962ba31ff3b01fcf5942960e0bc3ca331f816346a440",
    "createTime": "2021-10-04T06:50:06.369025861Z",
    "expiryTime": "2022-10-04T06:50:06.369025861Z",
    "attributes": {
      "attr1": "value1",
      "attr2": "value2",
      "link1": {
        "/": "QmSnuWmxptJZdLJpKRarxBMS2Ju2oANVrgbr2xWbie9b2D"
      },
      "link2": {
        "/": "QmP8jTG1m9GSDJLCbeWhVSVgEzCPPwXRdCRuJtQ5Tz9Kc9"
      }
    }
  }
]


Get record by id

$ ./build/chibaclonkd q nameservice get bafyreih7un2ntk235wshncebus5emlozdhdixrrv675my5umb6fgdergae -o json | jq .
{
  "record": {
    "id": "bafyreih7un2ntk235wshncebus5emlozdhdixrrv675my5umb6fgdergae",
    "bond_id": "95f68b1b862bfd1609b0c9aaf7300287b92fec90ac64027092c3e723af36e83d",
    "create_time": "2021-09-27T07:23:25.558111606Z",
    "expiry_time": "2022-09-27T07:23:25.558111606Z",
    "deleted": false,
    "owners": [],
    "attributes": "eyJhdHRyMSI6InZhbHVlMSIsImF0dHIyIjoidmFsdWUyIiwibGluazEiOnsiLyI6IlFtU251V214cHRKWmRMSnBLUmFyeEJNUzJKdTJvQU5WcmdicjJ4V2JpZTliMkQifSwibGluazIiOnsiLyI6IlFtUDhqVEcxbTlHU0RKTENiZVdoVlNWZ0V6Q1BQd1hSZENSdUp0UTVUejlLYzkifX0="
  }
}

Reserve name

 ./build/chibaclonkd tx nameservice reserve-name hello --from root --chain-id ethermint_9000-1 --owner $(./build/chibaclonkd key
s show root -a) -y -o json | jq .
{
  "height": "0",
  "txhash": "7EC19157AC89279DEBE840EA3384FC95D1E2A0931C27746CA42AC23AE285B7ED",
  "codespace": "",
  "code": 0,
  "data": "",
  "raw_log": "[]",
  "logs": [],
  "info": "",
  "gas_wanted": "0",
  "gas_used": "0",
  "tx": null,
  "timestamp": ""
}

Query Whois for name authority

 ./build/chibaclonkd q nameservice whois hello -o json | jq .
{
  "name_authority": {
    "owner_public_key": "Au3hH1tzL1KgZfXfA71jGYSe5RV9Wg95kwhBWs8V+N+h",
    "owner_address": "ethm1mfdjngh5jvjs9lqtt9a7y2hlgw8v3syh3hsqzk",
    "height": "174",
    "status": "active",
    "auction_id": "",
    "bond_id": "",
    "expiry_time": "2021-09-29T07:34:36.304545965Z"
  }
}

Query the nameservice module balance

$ ./build/chibaclonkd q nameservice  balance -o json | jq .
{
  "balances": [
    {
      "account_name": "record_rent",
      "balance": [
        {
          "denom": "stake",
          "amount": "1000000"
        }
      ]
    }
  ]
}

add bond to the authority

$ ./build/chibaclonkd tx nameservice authority-bond [Authority Name] [Bond ID ]  --from root --chain-id ethermint_9000-1  -y -o json | jq .
$ ./build/chibaclonkd tx nameservice authority-bond hello 95f68b1b862bfd1609b0c9aaf7300287b92fec90ac64027092c3e723af36e83d  --from root --chain-id ethermint_9000-1  -y -o json | jq .

Query the records by associate bond id

$ ./build/chibaclonkd q nameservice query-by-bond 95f68b1b862bfd1609b0c9aaf7300287b92fec90ac64027092c3e723af36e83d -o json | jq .
{
  "records": [
    {
      "id": "bafyreih7un2ntk235wshncebus5emlozdhdixrrv675my5umb6fgdergae",
      "bond_id": "95f68b1b862bfd1609b0c9aaf7300287b92fec90ac64027092c3e723af36e83d",
      "create_time": "2021-09-27T08:25:32.893155609Z",
      "expiry_time": "2022-09-27T08:25:32.893155609Z",
      "deleted": false,
      "owners": [],
      "attributes": "eyJhdHRyMSI6InZhbHVlMSIsImF0dHIyIjoidmFsdWUyIiwibGluazEiOnsiLyI6IlFtU251V214cHRKWmRMSnBLUmFyeEJNUzJKdTJvQU5WcmdicjJ4V2JpZTliMkQifSwibGluazIiOnsiLyI6IlFtUDhqVEcxbTlHU0RKTENiZVdoVlNWZ0V6Q1BQd1hSZENSdUp0UTVUejlLYzkifX0="
    }
  ],
  "pagination": null
}

dissociate bond from record

$ ./build/chibaclonkd tx nameservice dissociate-bond bafyreih7un2ntk235wshncebus5emlozdhdixrrv675my5umb6fgdergae  --from root --chain-id ethermint_9000-1
{"body":{"messages":[{"@type":"/vulcanize.nameservice.v1beta1.MsgDissociateBond","record_id":"bafyreih7un2ntk235wshncebus5emlozdhdixrrv675my5umb6fgdergae","signer":"ethm1mfdjngh5jvjs9lqtt9a7y2hlgw8v3syh3hsqzk"}],"memo":"","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[],"gas_limit":"200000","payer":"","granter":""}},"signatures":[]}

confirm transaction before signing and broadcasting [y/N]: y
code: 0
codespace: ""
data: ""
gas_used: "0"
gas_wanted: "0"
height: "0"
info: ""
logs: []
raw_log: '[]'
timestamp: ""
tx: null
txhash: 7AFEF524CB0D92D6576FC08601A787786E802449888FD8DDAA7635698CC85060

Associate bond with record

./build/chibaclonkd tx nameservice associate-bond bafyreih7un2ntk235wshncebus5emlozdhdixrrv675my5umb6fgdergae c3f7a78c5042d2003880962ba31ff3b01fcf5942960e0bc3ca331f816346a440 --from root --chain-id ethermint_9000-1  -y -o json | jq .
{
  "height": "0",
  "txhash": "F75C2BF2FE73668AE1332E1237F924AC549E31E822A56394DE5AC17200B199F9",
  "codespace": "",
  "code": 0,
  "data": "",
  "raw_log": "[]",
  "logs": [],
  "info": "",
  "gas_wanted": "0",
  "gas_used": "0",
  "tx": null,
  "timestamp": ""
}

dissociate-records => remove all record from bond

$./build/chibaclonkd tx nameservice dissociate-records c3f7a78c5042d2003880962ba31ff3b01fcf5942960e0bc3ca331f816346a440 --from root --chain-id ethermint_9000-1  -y -o json | jq .
{
  "height": "0",
  "txhash": "0316F503E5DEA47CB108AE6C7C7FFAF3F71CC56BC22F63CB97322E1BE48B33B9",
  "codespace": "",
  "code": 0,
  "data": "",
  "raw_log": "[]",
  "logs": [],
  "info": "",
  "gas_wanted": "0",
  "gas_used": "0",
  "tx": null,
  "timestamp": ""
}

Renew a record

When a record is expires , needs to renew record

$ ./build/chibaclonkd tx nameservice renew-record bafyreih7un2ntk235wshncebus5emlozdhdixrrv675my5umb6fgdergae --from root --chain-id ethermint_9000-1

Set the authority name

$ ./build/chibaclonkd tx nameservice set-name crn://hello/test test_hello_cid  --from root --chain-id ethermint_9000-1 -y -o json | jq .
{
  "height": "0",
  "txhash": "66A63C73B076EEE9A2F7605354448EDEB161F0115D4D03AF68C01BA28DB97486",
  "codespace": "",
  "code": 0,
  "data": "",
  "raw_log": "[]",
  "logs": [],
  "info": "",
  "gas_wanted": "0",
  "gas_used": "0",
  "tx": null,
  "timestamp": ""
}

Delete the name

$./build/chibaclonkd tx nameservice delete-name crn://hello/test --from root --chain-id ethermint_9000-1 -y
code: 0
codespace: ""
data: ""
gas_used: "0"
gas_wanted: "0"
height: "0"
info: ""
logs: []
raw_log: '[]'
timestamp: ""
tx: null
txhash: A3FF4C46BAC7BD6E54BBB743A49830AE8C6F6FE59282384789CBA323C1FE540C

List of Authorities Expire Queue

$ ./build/chibaclonkd q nameservice authority-expiry  -o json | jq .
{
  "authorities": [],
  "pagination": null
}

List of Records Expire Queue

$  ./build/chibaclonkd q nameservice record-expiry -o json | jq .
{
  "records": [],
  "pagination": null
}