2.4.15 • Published 3 years ago

@dxos/cli-wns v2.4.15

Weekly downloads
148
License
AGPL-3.0
Repository
github
Last release
3 years ago

WNS CLI

Account Setup

Registering records in WNS requires an account. To create an account, activate the required profile and run the following command:

$ wire wns account create
? Post a Tweet with text 'Fund cosmos1jeh4d8ym99t235p22n6j4lyyf9wk56jgzjq9dk' and paste the URL: "<PASTE TWEET URL HERE>"
Requesting funds from faucet...
Got funds from faucet:
[
  {
    "type": "uwire",
    "quantity": 1000000000
  }
]
Creating a bond...
Bond created successfully.
Account created successfully. Copy the mnemonic to another safe location.
There is no way to recover the account and associated funds if this mnemonic is lost.
{
  "mnemonic": "rely lounge lock never tuition relax ostrich depth clever pill clap express",
  "privateKey": "87bb801596815239cc79c0e62f76d0f94a0c6be25e9cfcc13f7297ed01db3794",
  "publicKey": "02c65789582ad62e527e1fcd1d267aad79864dd2e8bfbb19bce90997fe630aa3ac",
  "address": "cosmos1jeh4d8ym99t235p22n6j4lyyf9wk56jgzjq9dk",
  "bondId": "0b73fdcbbf7033c51c405cbcb4498ddcf1a9c6b6d17873e22db34f39e3f3ca3c"
}
Mnemonic saved to ~/.wire/profile/devnet.secrets.yml

The profile configuration file is automatically updated with the WNS account private key and bond.

Operations

These commands require wire CLI to be configured, and a profile to be active.

Get node status:

$ wire wns status
{
  "version": "0.3.0",
  "node": {
    "id": "f31006c3c9c56a3fc118661110c16a00eaef3635",
    "network": "wireline",
    "moniker": "Ashwins-MacBook-Pro-2.local"
  },
  "sync": {
    "latest_block_hash": "E2A7DF2DB9184EA505B78BEF84CE457AA349762ABA25E612CFF282926A5BA827",
    "latest_block_height": "3",
    "latest_block_time": "2020-04-07 10:34:42.702299 +0000 UTC",
    "catching_up": false
  },
  "validator": {
    "address": "258A5BA35D399BAD5D7129B95784A43167536AF4",
    "voting_power": "10000000"
  },
  "validators": [
    {
      "address": "258A5BA35D399BAD5D7129B95784A43167536AF4",
      "voting_power": "10000000",
      "proposer_priority": "0"
    }
  ],
  "num_peers": "0",
  "peers": [],
  "disk_usage": "124K"
}

Create account (automatically requests faucet funds, creates a bond and updates profile config):

$ wire wns account create

Get account details:

$ wire wns account get --address cosmos1wh8vvd0ymc5nt37h29z8kk2g2ays45ct2qu094
[
  {
    "address": "cosmos1wh8vvd0ymc5nt37h29z8kk2g2ays45ct2qu094",
    "pubKey": "61rphyEC6tEq0pxTI2Sy97VlWCSZhA/PRaUfFlQjhQcpYfTfYtg=",
    "number": "0",
    "sequence": "2",
    "balance": [
      {
        "type": "uwire",
        "quantity": "89990000000000"
      }
    ]
  }
]

Request funds from faucet:

$ wire faucet request --post-url "<TWEET URL>"
{
  "requestTokens": {
    "status": true,
    "error": null,
    "tokens": [
      {
        "type": "uwire",
        "quantity": 1000000000
      }
    ]
  }
} 

Send tokens:

$ wire wns tokens send --address cosmos1w5q7xy9sk8hqvlklftdfdkc3kgsd90cxlkwvty --type uwire --quantity 1000000000
[
  {
    "address": "cosmos1wh8vvd0ymc5nt37h29z8kk2g2ays45ct2qu094",
    "pubKey": "61rphyEC6tEq0pxTI2Sy97VlWCSZhA/PRaUfFlQjhQcpYfTfYtg=",
    "number": "0",
    "sequence": "3",
    "balance": [
      {
        "type": "uwire",
        "quantity": "89989000000000"
      }
    ]
  },
  {
    "address": "cosmos1w5q7xy9sk8hqvlklftdfdkc3kgsd90cxlkwvty",
    "pubKey": null,
    "number": "7",
    "sequence": "0",
    "balance": [
      {
        "type": "uwire",
        "quantity": "1000000000"
      }
    ]
  }
]

Create record (generic):

# protocol.yml
record:
    type: wrn:protocol
    name: example/chess-protocol
    version: 1.1.1
    displayName: chess-protocol

Publish record (see below for commands to create/query bonds):

$ wire wns record publish --filename protocol.yml

Get record:

$ wire wns record get --id QmYDtNCKtTu6u6jaHaFAC5PWZXcj7fAmry6NoWwMaixFHz
[
  {
    "id": "QmYDtNCKtTu6u6jaHaFAC5PWZXcj7fAmry6NoWwMaixFHz",
    "type": "wrn:protocol",
    "name": "example/chess-protocol",
    "version": "1.1.1",
    "owners": [
      "6ee3328f65c8566cd5451e49e97a767d10a8adf7"
    ],
    "bondId": "8e340dd7cf6fc91c27eeefce9cca1406c262e93fd6f3a4f3b1e99b01161fcef3",
    "createTime": "2020-04-07T10:38:10.044857000",
    "expiryTime": "2021-04-07T10:38:10.044857000",
    "attributes": {
      "displayName": "chess-protocol",
      "name": "example/chess-protocol",
      "type": "wrn:protocol",
      "version": "1.1.1"
    }
  }
]

List records:

$ wire wns record list
[
  {
    "id": "QmYDtNCKtTu6u6jaHaFAC5PWZXcj7fAmry6NoWwMaixFHz",
    "type": "wrn:protocol",
    "name": "example/chess-protocol",
    "version": "1.1.1",
    "owners": [
      "6ee3328f65c8566cd5451e49e97a767d10a8adf7"
    ],
    "bondId": "8e340dd7cf6fc91c27eeefce9cca1406c262e93fd6f3a4f3b1e99b01161fcef3",
    "createTime": "2020-04-07T10:38:10.044857000",
    "expiryTime": "2021-04-07T10:38:10.044857000",
    "attributes": {
      "displayName": "chess-protocol",
      "name": "example/chess-protocol",
      "type": "wrn:protocol",
      "version": "1.1.1"
    }
  }
]

Resolve record by ref:

$ wire wns record resolve 'wrn:protocol:example/chess-protocol#^1.0.0'
[
    {
        "id": "QmYDtNCKtTu6u6jaHaFAC5PWZXcj7fAmry6NoWwMaixFHz",
        "type": "wrn:protocol",
        "name": "example/chess-protocol",
        "version": "1.1.1",
        "owners": [
            "6ee3328f65c8566cd5451e49e97a767d10a8adf7"
        ],
        "bondId": "8e340dd7cf6fc91c27eeefce9cca1406c262e93fd6f3a4f3b1e99b01161fcef3",
        "createTime": "2020-04-07T10:38:10.044857000",
        "expiryTime": "2021-04-07T10:38:10.044857000",
        "attributes": {
            "version": "1.1.1",
            "displayName": "chess-protocol",
            "name": "example/chess-protocol",
            "type": "wrn:protocol"
        }
    }
]

Create bond:

$ wire wns bond create --type uwire --quantity 1000

List bonds:

$ wire wns bond list
[
  {
    "id": "288425db041a7dff6e06e966067625479ae80b29d4c36f9360634eb0cbe2961d",
    "owner": "cosmos1wh8vvd0ymc5nt37h29z8kk2g2ays45ct2qu094",
    "balance": [
      {
        "type": "uwire",
        "quantity": "1000"
      }
    ]
  },
  {
    "id": "8e340dd7cf6fc91c27eeefce9cca1406c262e93fd6f3a4f3b1e99b01161fcef3",
    "owner": "cosmos1wh8vvd0ymc5nt37h29z8kk2g2ays45ct2qu094",
    "balance": [
      {
        "type": "uwire",
        "quantity": "9999000000"
      }
    ]
  }
]

Get bond:

$ wire wns bond get --id 8e340dd7cf6fc91c27eeefce9cca1406c262e93fd6f3a4f3b1e99b01161fcef3
[
  {
    "id": "8e340dd7cf6fc91c27eeefce9cca1406c262e93fd6f3a4f3b1e99b01161fcef3",
    "owner": "cosmos1wh8vvd0ymc5nt37h29z8kk2g2ays45ct2qu094",
    "balance": [
      {
        "type": "uwire",
        "quantity": "9999000000"
      }
    ]
  }
]

Query bonds by owner:

$ wire wns bond list --owner cosmos1wh8vvd0ymc5nt37h29z8kk2g2ays45ct2qu094
[
  {
    "id": "288425db041a7dff6e06e966067625479ae80b29d4c36f9360634eb0cbe2961d",
    "owner": "cosmos1wh8vvd0ymc5nt37h29z8kk2g2ays45ct2qu094",
    "balance": [
      {
        "type": "uwire",
        "quantity": "1000"
      }
    ]
  },
  {
    "id": "8e340dd7cf6fc91c27eeefce9cca1406c262e93fd6f3a4f3b1e99b01161fcef3",
    "owner": "cosmos1wh8vvd0ymc5nt37h29z8kk2g2ays45ct2qu094",
    "balance": [
      {
        "type": "uwire",
        "quantity": "9999000000"
      }
    ]
  }
]

Refill bond:

$ wire wns bond refill --id 8e340dd7cf6fc91c27eeefce9cca1406c262e93fd6f3a4f3b1e99b01161fcef3 --type uwire --quantity 1000

Withdraw funds from bond:

$ wire wns bond withdraw --id 8e340dd7cf6fc91c27eeefce9cca1406c262e93fd6f3a4f3b1e99b01161fcef3 --type uwire --quantity 500

Cancel bond:

$ wire wns bond cancel --id 288425db041a7dff6e06e966067625479ae80b29d4c36f9360634eb0cbe2961d

Associate bond (with record):

$ wire wns bond associate --id QmYDtNCKtTu6u6jaHaFAC5PWZXcj7fAmry6NoWwMaixFHz --bond-id 8e340dd7cf6fc91c27eeefce9cca1406c262e93fd6f3a4f3b1e99b01161fcef3

Disassociate bond (from record):

$ wire wns bond dissociate --id QmYDtNCKtTu6u6jaHaFAC5PWZXcj7fAmry6NoWwMaixFHz

Dissociate all records from bond:

$ wire wns bond records dissociate --bond-id 8e340dd7cf6fc91c27eeefce9cca1406c262e93fd6f3a4f3b1e99b01161fcef3

Reassociate records (switch bond):

$ wire wns bond records reassociate --old-bond-id 8e340dd7cf6fc91c27eeefce9cca1406c262e93fd6f3a4f3b1e99b01161fcef3 --new-bond-id 146b5ed7a2771ae2e6b323f334f1c2d1134fd7917eb72dea9c88457e912785ab

Run arbitrary query:

$ wire wns query '{ getStatus { version }}'

For more complex query:

$ echo 'query ($refs: [String!]) { resolveRecords(refs: $refs) { id type name version }}' | wire wns query --variables='{ "refs": ["wrn:bot:dxos.org/echo"] }'

Read query from file:

$ wire wns query --filename='<file_with_query>' --variables='{ "refs": ["wrn:bot:dxos.org/echo"] }'
2.6.8-alpha.0

3 years ago

2.6.4-alpha.0

3 years ago

2.6.0-alpha.0

3 years ago

2.6.3-alpha.0

3 years ago

2.6.7-alpha.0

3 years ago

2.6.2-alpha.0

3 years ago

2.5.1-alpha.0

3 years ago

2.6.6-alpha.0

3 years ago

2.6.9-alpha.0

3 years ago

2.6.1-alpha.0

3 years ago

2.6.5-alpha.0

3 years ago

2.5.0-alpha.0

3 years ago

2.4.15-beta.0

3 years ago

2.4.15

3 years ago

2.4.15-alpha.0

3 years ago

2.4.14-alpha.0

3 years ago

2.4.12-alpha.0

3 years ago

2.4.13

3 years ago

2.4.13-beta.0

3 years ago

2.4.13-alpha.0

3 years ago

2.4.11-alpha.0

3 years ago

2.4.10-alpha.0

3 years ago

2.4.9-alpha.0

3 years ago

2.4.8-alpha.0

3 years ago

2.4.7-test.0

3 years ago

2.4.7

3 years ago

2.4.7-beta.0

3 years ago

2.4.7-alpha.0

3 years ago

2.4.5-alpha.0

3 years ago

2.4.6

3 years ago

2.4.6-beta.0

3 years ago

2.4.6-alpha.0

3 years ago

2.4.4

3 years ago

2.4.4-alpha.0

3 years ago

2.4.4-beta.0

3 years ago

2.4.3-alpha.0

3 years ago

2.4.3-beta.0

3 years ago

2.4.2-alpha.0

3 years ago

2.4.1

3 years ago

2.4.1-beta.0

3 years ago

2.4.1-alpha.0

3 years ago

2.4.0-alpha.0

3 years ago

2.3.1-beta.0

3 years ago

2.3.1-alpha.0

3 years ago

2.3.0-alpha.0

3 years ago

2.2.2-alpha.0

3 years ago

2.2.1-alpha.0

3 years ago

2.2.0-alpha.0

3 years ago

2.1.6-alpha.0

3 years ago

2.1.5-alpha.0

3 years ago

2.1.3-alpha.0

3 years ago

2.1.4-alpha.0

3 years ago

2.1.2-alpha.0

3 years ago

2.0.62-alpha.0

3 years ago

2.0.58-alpha.0

3 years ago

2.1.1-alpha.0

3 years ago

2.0.60-alpha.0

3 years ago

2.0.59-alpha.0

3 years ago

2.0.61-alpha.0

3 years ago

2.1.0-alpha.0

3 years ago

2.0.57-alpha.0

3 years ago

2.0.56-alpha.0

3 years ago

2.0.55-alpha.0

3 years ago

2.0.54-alpha.0

3 years ago

2.0.49-alpha.0

3 years ago

2.0.50-alpha.0

3 years ago

2.0.45-alpha.0

3 years ago

2.0.53-alpha.0

3 years ago

2.0.48-alpha.0

3 years ago

2.0.44-alpha.0

3 years ago

2.0.52-alpha.0

3 years ago

2.0.47-alpha.0

3 years ago

2.0.43-alpha.0

3 years ago

2.0.51-alpha.0

3 years ago

2.0.46-alpha.0

3 years ago

2.0.42-alpha.0

3 years ago

2.0.40-alpha.0

3 years ago

2.0.39-alpha.0

3 years ago

2.0.41-alpha.0

3 years ago

2.0.38-alpha.0

3 years ago

2.0.37-alpha.0

3 years ago

2.0.36-alpha.0

3 years ago

2.0.35-alpha.0

3 years ago

2.0.34-alpha.0

3 years ago

2.0.33-alpha.0

3 years ago

2.0.32

3 years ago

2.0.32-alpha.0

3 years ago

2.0.32-beta.0

3 years ago

2.0.30-alpha.0

3 years ago

2.0.30-beta.0

3 years ago

2.0.31-alpha.0

3 years ago

2.0.29-alpha.0

3 years ago

2.0.28-alpha.0

3 years ago

2.0.27-alpha.0

3 years ago

2.0.26-alpha.0

3 years ago

2.0.25-alpha.0

3 years ago

2.0.24

3 years ago

2.0.24-beta.0

3 years ago

2.0.24-alpha.0

3 years ago

2.0.23-alpha.0

3 years ago

2.0.22-alpha.0

3 years ago

2.0.21-alpha.0

3 years ago

2.0.20

3 years ago

2.0.20-beta.0

3 years ago

2.0.19-alpha.0

3 years ago

2.0.20-alpha.0

3 years ago

2.0.18-alpha.0

3 years ago

2.0.17-alpha.0

3 years ago

2.0.16-beta.0

3 years ago

2.0.17-beta.0

3 years ago

2.0.16

3 years ago

2.0.17

3 years ago

2.0.16-alpha.0

3 years ago

2.0.15-alpha.0

3 years ago

2.0.14-alpha.0

3 years ago

2.0.13-alpha.0

3 years ago

2.0.9-alpha.0

3 years ago

2.0.10-alpha.0

3 years ago

2.0.12-alpha.0

3 years ago

2.0.8

3 years ago

2.0.8-beta.0

3 years ago

2.0.7

3 years ago

2.0.8-alpha.0

3 years ago

2.0.7-alpha.0

3 years ago

2.0.6-alpha.0

3 years ago

2.0.5-alpha.0

3 years ago

2.0.3-alpha.0

4 years ago

2.0.4-alpha.0

4 years ago

2.0.3-beta.0

4 years ago

2.0.3

4 years ago

2.0.2

4 years ago

2.0.2-beta.0

4 years ago

2.0.2-alpha.0

4 years ago

2.0.1-alpha.0

4 years ago

1.1.0-beta.11

4 years ago

1.1.0-beta.10

4 years ago

1.1.0-beta.9

4 years ago

1.1.0-beta.8

4 years ago

1.1.0-beta.7

4 years ago

1.1.0-beta.6

4 years ago

1.1.0-beta.5

4 years ago

1.1.0-beta.4

4 years ago

1.1.0-beta.3

4 years ago

1.1.0-beta.2

4 years ago

1.1.0-beta.1

4 years ago

1.0.1-moon.8

4 years ago

1.1.0-beta.0

4 years ago

1.0.1-moon.7

4 years ago

1.0.1-moon.5

4 years ago

1.0.1-moon.6

4 years ago

1.0.1-moon.4

4 years ago

1.0.1-moon.3

4 years ago

1.0.1-moon.1

4 years ago

1.0.1-moon.0

4 years ago

1.0.1-moon.2

4 years ago

1.0.1-beta.31

4 years ago

1.0.1-beta.30

4 years ago

1.0.1-beta.29

4 years ago

1.0.1-beta.28

4 years ago

1.0.1-beta.27

4 years ago

1.0.1-beta.26

4 years ago

1.0.1-beta.25

4 years ago

1.0.1-beta.24

4 years ago

1.0.1-beta.23

4 years ago

1.0.1-beta.22

4 years ago

1.0.1-beta.21

4 years ago

1.0.1-beta.20

4 years ago

1.0.1-beta.19

4 years ago

1.0.1-beta.18

4 years ago

1.0.1-beta.17

4 years ago