Stratos-chain 'stchaincli' Commands(Part2)

This document is the secon part that describes a summarized list of 'stchaincli' commands for Stratos-chain.

Overview

For ease of use, these commands have been classified by the following modules:

PART 2:

PART 1:

'stchaincli' Commands

Global Flags

Each command has its specific flags as well as several global flags. The specific flags will be explained along with each command, while the global flags are summarized as the following that can be used for all stchaincli commands.

Global Flags(can be used for all stchaincli commands):
      --chain-id string   Chain ID of tendermint node
  -e, --encoding string   Binary encoding (hex|b64|btc) (default "hex")
      --home string       directory for config and data (default "$HOME/.stchaincli")
  -o, --output string     Output format (text|json) (default "text")
      --trace             print out full stack trace on errors

--chain-id the current chain-id may change when updating in testing phase . When it is applied, user needs to point out current chain-id which can be found on this page, right next to the search bar at the top of the page.

--home is the directory containing a node's account information. By default, node's account info is saved or created under $HOME/.stchaincli. In this case, user does not need to add --home flag in the commands. Otherwise, user has to use this flag to specify the path to the node's root directory(default '$HOME') explicitly if not using the default directory. In the following instruction, we suppose the node info has been installed or created under $HOME/.stchaincli and skip the --home flag. User can add it where applicable.

Register Module

Transactions

-create-resource-node

Create a new resource node

Usage:
  stchaincli tx register create-resource-node [flags]

Flags:
  -a, --account-number uint       The account number of the signing account (offline mode only)
      --amount string             Amount of coins to bond
  -b, --broadcast-mode string     Transaction broadcasting mode (sync|async|block) (default "sync")
      --details string            The node's (optional) details
      --dry-run                   ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it
      --fees string               Fees to pay along with transaction; eg: 10ustos
      --from string               Name or address of private key with which to sign
      --gas string                gas limit to set per-transaction; set to "auto" to calculate required gas automatically (default 200000) (default "200000")
      --gas-adjustment float      adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored  (default 1)
      --gas-prices string         Gas prices to determine the transaction fee (e.g. 10ustos)
      --generate-only             Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase is not accessible and the node operates offline)
  -h, --help                      help for create-resource-node
      --identity string           The optional identity signature (ex. UPort or Keybase)
      --indent                    Add indent to JSON response
      --keyring-backend string    Select keyring's backend (os|file|test) (default "os")
      --ledger                    Use a connected Ledger device
      --memo string               Memo to send along with transaction
      --moniker string            The node's name
      --network-id string         The network id of the node
      --node string               <host>:<port> to tendermint rpc interface for this chain (default "tcp://localhost:26657")
      --node-type int             The value of node_type is determined by the three node types('storage', 'database'', and 'computation') and their arbitrary combinations.
                                  Suppose, we define:
                                        computation     = 1,
                                        database        = 2,
                                        storage         = 4,
                                  Then, their combinations:
                                        computation && database                         = 1 + 2 = 3,
                                        computation && storage                          = 1 + 4 = 5,
                                        database && storage                             = 2 + 4 = 6,
                                        computation && database && storage              = 1 + 2 + 4 = 7,
                                  As a result, the value of node_type should be one of the following digits:
                                        1:  "computation",
                                        2:  "database",
                                        3:  "computation/database",
                                        4:  "storage",
                                        5:  "computation/storage",
                                        6:  "database/storage",
                                        7:  "computation/database/storage"
      --pubkey string             The Bech32 encoded PubKey of the node
      --security-contact string   The node's (optional) security contact email
  -s, --sequence uint             The sequence number of the signing account (offline mode only)
      --trust-node                Trust connected full node (don't verify proofs for responses) (default true)
      --website string            The node's (optional) website
  -y, --yes                       Skip tx broadcasting prompt confirmation

  In testing phase, --keyring-backend="test"

Tx command:

stchaincli tx register create-resource-node --network-id=<network-id> --amount=<amount> --pubkey=<pubkey of resource node > --from=<Name|address of private key> --chain-id=<current chain-id> --keyring-backend=<keyring's backend> --moniker=<name of resource node> --node-type=<resource node type, int 1~7> --gas=auto

Example:

$ ./stchaincli tx register create-resource-node --network-id="sdm://resourcenode1" --amount=1000000000ustos --pubkey=stsdsp2p1addwnpepq0c7356e4s5kg6g4tamd0wwalaun5pk7fcphpk0zjdskeg52m5s3vyqvl9r --from=user0 --chain-id=test-chain --keyring-backend=test --moniker="sds-resource4" --node-type=1 --gas=auto
{"chain_id":"test-chain","account_number":"0","sequence":"1","fee":{"amount":[],"gas":"440467"},"msgs":[{"type":"register/MsgCreateResourceNode",
"value":{"network_id":"sdm://resourcenode1","pubkey":{"type":"tendermint/PubKeySecp256k1","value":"A/Ho01msKWRpFV9217nd/3k6Bt5OA3DZ4pNhbKKK3SEW"},
"value":{"denom":"ustos","amount":"1000000000"},"owner_address":"st1w0l3aamanqn2z2x4nqzpnlf0qa7sdjvmsc2yml",
"description":{"moniker":"sds-resource4","identity":"","website":"","security_contact":"","details":""},"node_type":"1: computation"}}],"memo":""}

confirm transaction before signing and broadcasting [y/N]: y
height: 0
txhash: EF9E16EFF4EBCBFCE86500F4994C75184888DC33ABD7128106D2C5E620356EE3
codespace: ""
code: 0
data: ""
rawlog: '[]'
logs: []
info: ""
gaswanted: 0
gasused: 0
tx: null
timestamp: ""

Check if the new resource node in the resource-node list using REST API

http://127.0.0.1:1317/register/resource-nodes

Response:

{
    "height": "14",
    "result": [
        {
            "network_id": "sds://resourcenode1",
            "pubkey": {
                "type": "tendermint/PubKeySecp256k1",
                "value": "A/Ho01msKWRpFV9217nd/3k6Bt5OA3DZ4pNhbKKK3SEW"
            },
            "suspend": false,
            "status": 2,
            "tokens": "1000000000",
            "owner_address": "st1w0l3aamanqn2z2x4nqzpnlf0qa7sdjvmsc2yml",
            "description": {
                "moniker": "sds-resource4",
                "identity": "",
                "website": "",
                "security_contact": "",
                "details": ""
            },
            "node_type": "1: computation",
            "creation_time": "2021-09-21T18:04:36.076486361Z"
        },
    ...
      ]
}

-update-resource-node

Update a resource node info

Usage:
  stchaincli tx register update-resource-node [flags]

Flags:
  -a, --account-number uint       The account number of the signing account (offline mode only)
  -b, --broadcast-mode string     Transaction broadcasting mode (sync|async|block) (default "sync")
      --details string            The node's (optional) details
      --dry-run                   ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it
      --fees string               Fees to pay along with transaction; eg: 10ustos
      --from string               Name or address of private key with which to sign
      --gas string                gas limit to set per-transaction; set to "auto" to calculate required gas automatically (default 200000) (default "200000")
      --gas-adjustment float      adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored  (default 1)
      --gas-prices string         Gas prices to determine the transaction fee (e.g. 10ustos)
      --generate-only             Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase is not accessible and the node operates offline)
  -h, --help                      help for update-resource-node
      --identity string           The optional identity signature (ex. UPort or Keybase)
      --indent                    Add indent to JSON response
      --keyring-backend string    Select keyring's backend (os|file|test) (default "os")
      --ledger                    Use a connected Ledger device
      --memo string               Memo to send along with transaction
      --moniker string            The node's name
      --network-address string     (default "The address of the PP node")
      --network-id string         The network id of the node
      --node string               <host>:<port> to tendermint rpc interface for this chain (default "tcp://localhost:26657")
      --node-type int             The value of node_type is determined by the three node types('storage', 'database'', and 'computation') and their arbitrary combinations.
                                  Suppose, we define:
                                        computation     = 1,
                                        database        = 2,
                                        storage         = 4,
                                  Then, their combinations:
                                        computation && database                         = 1 + 2 = 3,
                                        computation && storage                          = 1 + 4 = 5,
                                        database && storage                             = 2 + 4 = 6,
                                        computation && database && storage              = 1 + 2 + 4 = 7,
                                  As a result, the value of node_type should be one of the following digits:
                                        1:  "computation",
                                        2:  "database",
                                        3:  "computation/database",
                                        4:  "storage",
                                        5:  "computation/storage",
                                        6:  "database/storage",
                                        7:  "computation/database/storage"
      --security-contact string   The node's (optional) security contact email
  -s, --sequence uint             The sequence number of the signing account (offline mode only)
      --trust-node                Trust connected full node (don't verify proofs for responses) (default true)
      --website string            The node's (optional) website
  -y, --yes                       Skip tx broadcasting prompt confirmation
  
  In testing phase, --keyring-backend="test"

Tx command:

stchaincli tx register update-resource-node --network-id=<network-id> --from=<Name|address of private key> --chain-id=<current chain-id> --keyring-backend=<keyring's backend> --moniker=<name of resource node> --node-type=<resource node type, int 1~7> --network-address=<resource_node_address> --gas=auto

Example:

$ ./stchaincli tx register update-resource-node --network-id="sds://resourceNode1" --from=user0 --chain-id=test-chain --keyring-backend=test --moniker="sds-resourceNode4" --node-type=7 --network-address=st1880rh8f0585ek4476lcf279y2trm5q493zrfdx --gas=auto
{"chain_id":"test-chain","account_number":"0","sequence":"2","fee":{"amount":[],"gas":"355375"},"msgs":[{"type":"register/MsgUpdateResourceNode",
"value":{"network_id":"sds://resourceNode1","description":{"moniker":"sds-resourceNode4","identity":"","website":"","security_contact":"","details":""},
"node_type":"7","network_address":"st1880rh8f0585ek4476lcf279y2trm5q493zrfdx","owner_address":"st1w0l3aamanqn2z2x4nqzpnlf0qa7sdjvmsc2yml"}}],"memo":""}

confirm transaction before signing and broadcasting [y/N]: y
height: 0
txhash: D2D7FF629C8AAB12699B1A45F8BC92A206F006B789E2A0E2818AC39F89AD05B7
codespace: ""
code: 0
data: ""
rawlog: '[]'
logs: []
info: ""
gaswanted: 0
gasused: 0
tx: null
timestamp: "" 

Check if the new resource node info has been modified using REST API

http://127.0.0.1:1317/register/resource-nodes

Response:

{
    "height": "363",
    "result": [
        {
            "network_id": "sds://resourceNode1",
            "pubkey": {
                "type": "tendermint/PubKeySecp256k1",
                "value": "A/Ho01msKWRpFV9217nd/3k6Bt5OA3DZ4pNhbKKK3SEW"
            },
            "suspend": false,
            "status": 2,
            "tokens": "1000000000",
            "owner_address": "st1w0l3aamanqn2z2x4nqzpnlf0qa7sdjvmsc2yml",
            "description": {
                "moniker": "sds-resourceNode4",
                "identity": "",
                "website": "",
                "security_contact": "",
                "details": ""
            },
            "node_type": "7",
            "creation_time": "2021-09-21T18:04:36.076486361Z"
        },
        ...
      ]
}

-remove-resource-node

remove a resource node

Usage:
  stchaincli tx register remove-resource-node <resource_node_address> <owner_address> [flags]

Flags:
  -a, --account-number uint      The account number of the signing account (offline mode only)
  -b, --broadcast-mode string    Transaction broadcasting mode (sync|async|block) (default "sync")
      --dry-run                  ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it
      --fees string              Fees to pay along with transaction; eg: 10ustos
      --from string              Name or address of private key with which to sign
      --gas string               gas limit to set per-transaction; set to "auto" to calculate required gas automatically (default 200000) (default "200000")
      --gas-adjustment float     adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored  (default 1)
      --gas-prices string        Gas prices to determine the transaction fee (e.g. 10ustos)
      --generate-only            Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase is not accessible and the node operates offline)
  -h, --help                     help for remove-resource-node
      --indent                   Add indent to JSON response
      --keyring-backend string   Select keyring's backend (os|file|test) (default "os")
      --ledger                   Use a connected Ledger device
      --memo string              Memo to send along with transaction
      --node string              <host>:<port> to tendermint rpc interface for this chain (default "tcp://localhost:26657")
  -s, --sequence uint            The sequence number of the signing account (offline mode only)
      --trust-node               Trust connected full node (don't verify proofs for responses) (default true)
  -y, --yes                      Skip tx broadcasting prompt confirmation
  
  In testing phase, --keyring-backend="test"

Tx command:

stchaincli tx register remove-resource-node <resource_node_address> <owner_address> --chain-id=<current chain-id> --keyring-backend=<keyring's backend> --gas=auto

Example:

$ ./stchaincli tx register remove-resource-node st1880rh8f0585ek4476lcf279y2trm5q493zrfdx st1w0l3aamanqn2z2x4nqzpnlf0qa7sdjvmsc2yml --keyring-backend=test --chain-id=test-chain --gas=auto
{"chain_id":"test-chain","account_number":"0","sequence":"6","fee":{"amount":[],"gas":"345418"},"msgs":[{"type":"register/MsgRemoveResourceNode",
"value":{"resource_node_address":"st1880rh8f0585ek4476lcf279y2trm5q493zrfdx","owner_address":"st1w0l3aamanqn2z2x4nqzpnlf0qa7sdjvmsc2yml"}}],"memo":""}

confirm transaction before signing and broadcasting [y/N]: y
height: 0
txhash: 2D41BF5B5B4CBBDECABA898A1263134C055FA0C788AF6B35B0929100E9C06DD1
codespace: ""
code: 0
data: ""
rawlog: '[]'
logs: []
info: ""
gaswanted: 0
gasused: 0
tx: null
timestamp: ""

Check if the resource node has benn removed from the resource-node list using REST API

http://127.0.0.1:1317/register/resource-nodes

Response:

{
  "height": "832",
  "result": [
    {
      "network_id": "sds://resourceNode1",
      "pubkey": {
        "type": "tendermint/PubKeySecp256k1",
        "value": "Aynu8/vLk2kcjxEitE2AMh3rdsdJz+aFJTSnxFAa6gFH"
      },
      "suspend": false,
      "status": 2,
      "tokens": "10000000000",
      "owner_address": "st1w0l3aamanqn2z2x4nqzpnlf0qa7sdjvmsc2yml",
      "description": {
        "moniker": "sds://resourceNode1",
        "identity": "",
        "website": "",
        "security_contact": "",
        "details": ""
      },
      "node_type": "7",
      "creation_time": "0001-01-01T00:00:00Z"
    },
    {
      "network_id": "sds://resourceNode2",
      "pubkey": {
        "type": "tendermint/PubKeySecp256k1",
        "value": "A5VeIG1rLTen1OhuYu6GARowrCi6HrHlGukHOMIQfs8s"
      },
      "suspend": false,
      "status": 2,
      "tokens": "200000000000",
      "owner_address": "st1w0l3aamanqn2z2x4nqzpnlf0qa7sdjvmsc2yml",
      "description": {
        "moniker": "sds://resourceNode2",
        "identity": "",
        "website": "",
        "security_contact": "",
        "details": ""
      },
      "node_type": "7",
      "creation_time": "0001-01-01T00:00:00Z"
    },
    {
      "network_id": "sds://resourceNode3",
      "pubkey": {
        "type": "tendermint/PubKeySecp256k1",
        "value": "Agogj/9LY3N9ZGRg+rkjMQgTRaJ6u7apKePI6TCX8NUY"
      },
      "suspend": false,
      "status": 2,
      "tokens": "30000000000",
      "owner_address": "st1a4a4q2h7anjpf0kergjpyee078667znfmzjl0z",
      "description": {
        "moniker": "sds://resourceNode3",
        "identity": "",
        "website": "",
        "security_contact": "",
        "details": ""
      },
      "node_type": "4",
      "creation_time": "0001-01-01T00:00:00Z"
    }
  ]
}

-create-indexing-node

Create a new indexing node

Usage:
  stchaincli tx register create-indexing-node [flags]

Flags:
  -a, --account-number uint       The account number of the signing account (offline mode only)
      --amount string             Amount of coins to bond
  -b, --broadcast-mode string     Transaction broadcasting mode (sync|async|block) (default "sync")
      --details string            The node's (optional) details
      --dry-run                   ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it
      --fees string               Fees to pay along with transaction; eg: 10ustos
      --from string               Name or address of private key with which to sign
      --gas string                gas limit to set per-transaction; set to "auto" to calculate required gas automatically (default 200000) (default "200000")
      --gas-adjustment float      adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored  (default 1)
      --gas-prices string         Gas prices to determine the transaction fee (e.g. 10ustos)
      --generate-only             Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase is not accessible and the node operates offline)
  -h, --help                      help for create-indexing-node
      --identity string           The optional identity signature (ex. UPort or Keybase)
      --indent                    Add indent to JSON response
      --keyring-backend string    Select keyring's backend (os|file|test) (default "os")
      --ledger                    Use a connected Ledger device
      --memo string               Memo to send along with transaction
      --moniker string            The node's name
      --network-id string         The network id of the node
      --node string               <host>:<port> to tendermint rpc interface for this chain (default "tcp://localhost:26657")
      --pubkey string             The Bech32 encoded PubKey of the node
      --security-contact string   The node's (optional) security contact email
  -s, --sequence uint             The sequence number of the signing account (offline mode only)
      --trust-node                Trust connected full node (don't verify proofs for responses) (default true)
      --website string            The node's (optional) website
  -y, --yes                       Skip tx broadcasting prompt confirmation
  
  In testing phase, --keyring-backend="test"

Tx command:

stchaincli tx register create-indexing-node --network-id=<network-id> --amount=<amount> --pubkey=<pubkey of indexing node> --from=<Name|address of private key> --chain-id=<current chain-id> --keyring-backend=<keyring's backend> --moniker=<name of resource node --gas=auto

Example:

$ ./stchaincli tx register create-indexing-node --network-id="sds://newIndexingNode1" --amount=1000000000ustos --pubkey=stsdsp2p1addwnpepq0c7356e4s5kg6g4tamd0wwalaun5pk7fcphpk0zjdskeg52m5s3vyqvl9r --from=user0 --chain-id=test-chain --keyring-backend=test --moniker="sds-newIndexingNode1" --gas=auto
{"chain_id":"test-chain","account_number":"0","sequence":"1","fee":{"amount":[],"gas":"429140"},"msgs":[{"type":"register/MsgCreateIndexingNode",
"value":{"network_id":"sds://newIndexingNode1","pubkey":{"type":"tendermint/PubKeySecp256k1","value":"A/Ho01msKWRpFV9217nd/3k6Bt5OA3DZ4pNhbKKK3SEW"},
"value":{"denom":"ustos","amount":"1000000000"},"owner_address":"st1w0l3aamanqn2z2x4nqzpnlf0qa7sdjvmsc2yml",
"description":{"moniker":"sds-newIndexingNode1","identity":"","website":"","security_contact":"","details":""}}}],"memo":""}

confirm transaction before signing and broadcasting [y/N]: y
height: 0
txhash: D3485700464CDE64E5FD31E8232526FEDA18E475127FBB08A2523FB9FFCF623D
codespace: ""
code: 0
data: ""
rawlog: '[]'
logs: []
info: ""
gaswanted: 0
gasused: 0
tx: null
timestamp: ""

-indexing_node_reg_vote

Indexing nodes vote for the registration of a new indexing node

Usage:
  stchaincli tx register indexing_node_reg_vote [flags]

Flags:
  -a, --account-number uint                The account number of the signing account (offline mode only)
  -b, --broadcast-mode string              Transaction broadcasting mode (sync|async|block) (default "sync")
      --candidate-network-address string    (default "The network address of the candidate PP node")
      --candidate-owner-address string      (default "The owner address of the candidate PP node")
      --dry-run                            ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it
      --fees string                        Fees to pay along with transaction; eg: 10ustos
      --from string                        Name or address of private key with which to sign
      --gas string                         gas limit to set per-transaction; set to "auto" to calculate required gas automatically (default 200000) (default "200000")
      --gas-adjustment float               adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored  (default 1)
      --gas-prices string                  Gas prices to determine the transaction fee (e.g. 10ustos)
      --generate-only                      Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase is not accessible and the node operates offline)
  -h, --help                               help for indexing_node_reg_vote
      --indent                             Add indent to JSON response
      --keyring-backend string             Select keyring's backend (os|file|test) (default "os")
      --ledger                             Use a connected Ledger device
      --memo string                        Memo to send along with transaction
      --node string                        <host>:<port> to tendermint rpc interface for this chain (default "tcp://localhost:26657")
      --opinion                            Opinion of the vote for the registration of Indexing node(true|false).
  -s, --sequence uint                      The sequence number of the signing account (offline mode only)
      --trust-node                         Trust connected full node (don't verify proofs for responses) (default true)
      --voter-network-address string        (default "The address of the PP node that made the vote.")
  -y, --yes                                Skip tx broadcasting prompt confirmation
  
  In testing phase, --keyring-backend="test"

A newly-created indexing node needs 7 days to be voted by other active indexing nodes

Tx command:

./stchaincli tx register indexing_node_reg_vote --candidate-network-address=<candidate-network-address> --candidate-owner-address=<candidate-owner-address> --opinion=<true|false> --voter-network-address=<voter-network-address> --from=<Name|address of private key> --chain-id=<current chain-id> --keyring-backend=<keyring's backend> --gas=auto

Example:

$ ./stchaincli tx register indexing_node_reg_vote --candidate-network-address=st1880rh8f0585ek4476lcf279y2trm5q493zrfdx --candidate-owner-address=st1w0l3aamanqn2z2x4nqzpnlf0qa7sdjvmsc2yml --opinion=true --voter-network-address=st1k3whylvzwk64ewhhlk3v3kc2w65u09493y6de2 --from=user --chain-id=test-chain --keyring-backend=test --gas=auto

gas estimate: 374807
{"chain_id":"test-chain","account_number":"0","sequence":"3","fee":{"amount":[],"gas":"374807"},"msgs":[{"type":"register/MsgIndexingNodeRegistrationVote",
"value":{"candidate_network_address":"st1880rh8f0585ek4476lcf279y2trm5q493zrfdx","candidate_owner_address":"st1w0l3aamanqn2z2x4nqzpnlf0qa7sdjvmsc2yml",
"opinion":true,"voter_network_address":"st1k3whylvzwk64ewhhlk3v3kc2w65u09493y6de2","voter_owner_address":"st1w0l3aamanqn2z2x4nqzpnlf0qa7sdjvmsc2yml"}}],"memo":""}

confirm transaction before signing and broadcasting [y/N]: y
height: 0
txhash: CEA81289CA8D4CE88CF902F6A6F0256436A03598E7FDD2EC9919F5B3DC0D218C
codespace: ""
code: 0
data: ""
rawlog: '[]'
logs: []
info: ""
gaswanted: 0
gasused: 0
tx: null
timestamp: ""

Check if the new indexing node info has been modified using REST API

http://127.0.0.1:1317/register/indexing-nodes

Response:

{
    "height": "59",
    "result": [
        {
            "network_id": "sds://newIndexingNode1",
            "pubkey": {
                "type": "tendermint/PubKeySecp256k1",
                "value": "A/Ho01msKWRpFV9217nd/3k6Bt5OA3DZ4pNhbKKK3SEW"
            },
            "suspend": false,
            "status": 0,
            "tokens": "1000000000",
            "owner_address": "st1w0l3aamanqn2z2x4nqzpnlf0qa7sdjvmsc2yml",
            "description": {
                "moniker": "sds-newIndexingNode1",
                "identity": "",
                "website": "",
                "security_contact": "",
                "details": ""
            },
            "creation_time": "2021-09-22T12:59:17.716682594Z"
        },
        {
            "network_id": "sds://indexingNode0",
            "pubkey": {
                "type": "tendermint/PubKeySecp256k1",
                "value": "A48JBiFMX4UzKcDSXGMWvYdyLWOYgJhDweLfeQJqiVlN"
            },
            "suspend": false,
            "status": 2,
            "tokens": "100000000000",
            "owner_address": "st1w0l3aamanqn2z2x4nqzpnlf0qa7sdjvmsc2yml",
            "description": {
                "moniker": "sds://indexingNode0",
                "identity": "",
                "website": "",
                "security_contact": "",
                "details": ""
            },
            "creation_time": "0001-01-01T00:00:00Z"
        },
        {
            "network_id": "sds://indexingNode1",
            "pubkey": {
                "type": "tendermint/PubKeySecp256k1",
                "value": "AoblppsE5u7s1P4B61gUW5/L4aZEIjWk4skTbanT1rwj"
            },
            "suspend": false,
            "status": 2,
            "tokens": "20000000000",
            "owner_address": "st1k3whylvzwk64ewhhlk3v3kc2w65u09493y6de2",
            "description": {
                "moniker": "sds://indexingNode1",
                "identity": "",
                "website": "",
                "security_contact": "",
                "details": ""
            },
            "creation_time": "0001-01-01T00:00:00Z"
        }
    ]
}

-update-indexing-node

Update indexing node info

Usage:
  stchaincli tx register update-indexing-node [flags]

Flags:
  -a, --account-number uint       The account number of the signing account (offline mode only)
  -b, --broadcast-mode string     Transaction broadcasting mode (sync|async|block) (default "sync")
      --details string            The node's (optional) details
      --dry-run                   ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it
      --fees string               Fees to pay along with transaction; eg: 10ustos
      --from string               Name or address of private key with which to sign
      --gas string                gas limit to set per-transaction; set to "auto" to calculate required gas automatically (default 200000) (default "200000")
      --gas-adjustment float      adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored  (default 1)
      --gas-prices string         Gas prices to determine the transaction fee (e.g. 10ustos)
      --generate-only             Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase is not accessible and the node operates offline)
  -h, --help                      help for update-indexing-node
      --identity string           The optional identity signature (ex. UPort or Keybase)
      --indent                    Add indent to JSON response
      --keyring-backend string    Select keyring's backend (os|file|test) (default "os")
      --ledger                    Use a connected Ledger device
      --memo string               Memo to send along with transaction
      --moniker string            The node's name
      --network-address string     (default "The address of the PP node")
      --network-id string         The network id of the node
      --node string               <host>:<port> to tendermint rpc interface for this chain (default "tcp://localhost:26657")
      --security-contact string   The node's (optional) security contact email
  -s, --sequence uint             The sequence number of the signing account (offline mode only)
      --trust-node                Trust connected full node (don't verify proofs for responses) (default true)
      --website string            The node's (optional) website
  -y, --yes                       Skip tx broadcasting prompt confirmation
  
  In testing phase, --keyring-backend="test"

Tx command:

stchaincli tx register update-indexing-node --network-id=<network-id> --from=<Name|address of private key> --chain-id=<current chain-id> --keyring-backend=<keyring's backend> --moniker=<name of indexing node> --network-address=<indexing_node_address> --gas=auto

Example:

$ ./stchaincli tx register update-indexing-node --network-id="sds://updatedIndexingNode1" --from=user0 --chain-id=test-chain --keyring-backend=test --moniker="sds://indexingNode2" --network-address=st1880rh8f0585ek4476lcf279y2trm5q493zrfdx --gas=auto
gas estimate: 361570
{"chain_id":"test-chain","account_number":"0","sequence":"4","fee":{"amount":[],"gas":"361570"},"msgs":[{"type":"register/MsgUpdateIndexingNode","value":{"network_id":"sds://updatedIndexingNode1","description":{"moniker":"sds://indexingNode2","identity":"","website":"","security_contact":"","details":""},"network_address":"st1880rh8f0585ek4476lcf279y2trm5q493zrfdx","owner_address":"st1w0l3aamanqn2z2x4nqzpnlf0qa7sdjvmsc2yml"}}],"memo":""}

confirm transaction before signing and broadcasting [y/N]: y
height: 0
txhash: 41D0433545FC360DB6F17C4C7B82947F58C7D2E34A1AD5D387EB5CD82CF20C83
codespace: ""
code: 0
data: ""
rawlog: '[]'
logs: []
info: ""
gaswanted: 0
gasused: 0
tx: null
timestamp: ""

Check if the new indexing node info has been modified using REST API

http://127.0.0.1:1317/register/indexing-nodes

Response:

{
    "height": "387",
    "result": [
        {
            "network_id": "sds://updatedIndexingNode1",
            "pubkey": {
                "type": "tendermint/PubKeySecp256k1",
                "value": "A/Ho01msKWRpFV9217nd/3k6Bt5OA3DZ4pNhbKKK3SEW"
            },
            "suspend": false,
            "status": 2,
            "tokens": "1000000000",
            "owner_address": "st1w0l3aamanqn2z2x4nqzpnlf0qa7sdjvmsc2yml",
            "description": {
                "moniker": "sds://indexingNode2",
                "identity": "",
                "website": "",
                "security_contact": "",
                "details": ""
            },
            "creation_time": "2021-09-22T13:16:47.931105673Z"
        },
        {
            "network_id": "sds://indexingNode0",
            "pubkey": {
                "type": "tendermint/PubKeySecp256k1",
                "value": "A48JBiFMX4UzKcDSXGMWvYdyLWOYgJhDweLfeQJqiVlN"
            },
            "suspend": false,
            "status": 2,
            "tokens": "100000000000",
            "owner_address": "st1w0l3aamanqn2z2x4nqzpnlf0qa7sdjvmsc2yml",
            "description": {
                "moniker": "sds://indexingNode0",
                "identity": "",
                "website": "",
                "security_contact": "",
                "details": ""
            },
            "creation_time": "0001-01-01T00:00:00Z"
        },
        {
            "network_id": "sds://indexingNode1",
            "pubkey": {
                "type": "tendermint/PubKeySecp256k1",
                "value": "AoblppsE5u7s1P4B61gUW5/L4aZEIjWk4skTbanT1rwj"
            },
            "suspend": false,
            "status": 2,
            "tokens": "20000000000",
            "owner_address": "st1k3whylvzwk64ewhhlk3v3kc2w65u09493y6de2",
            "description": {
                "moniker": "sds://indexingNode1",
                "identity": "",
                "website": "",
                "security_contact": "",
                "details": ""
            },
            "creation_time": "0001-01-01T00:00:00Z"
        }
    ]
}

-remove-indexing-node

Remove an indexing node

Usage:
  stchaincli tx register remove-indexing-node <indexing_node_address> <owner_address> [flags]

Flags:
  -a, --account-number uint      The account number of the signing account (offline mode only)
  -b, --broadcast-mode string    Transaction broadcasting mode (sync|async|block) (default "sync")
      --dry-run                  ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it
      --fees string              Fees to pay along with transaction; eg: 10ustos
      --from string              Name or address of private key with which to sign
      --gas string               gas limit to set per-transaction; set to "auto" to calculate required gas automatically (default 200000) (default "200000")
      --gas-adjustment float     adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored  (default 1)
      --gas-prices string        Gas prices to determine the transaction fee (e.g. 10ustos)
      --generate-only            Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase is not accessible and the node operates offline)
  -h, --help                     help for remove-indexing-node
      --indent                   Add indent to JSON response
      --keyring-backend string   Select keyring's backend (os|file|test) (default "os")
      --ledger                   Use a connected Ledger device
      --memo string              Memo to send along with transaction
      --node string              <host>:<port> to tendermint rpc interface for this chain (default "tcp://localhost:26657")
  -s, --sequence uint            The sequence number of the signing account (offline mode only)
      --trust-node               Trust connected full node (don't verify proofs for responses) (default true)
  -y, --yes                      Skip tx broadcasting prompt confirmation
  
  In testing phase, --keyring-backend="test"

Tx command:

stchaincli tx register remove-indexing-node <indexing_node_address> <owner_address> --chain-id=<current chain-id> --keyring-backend=<keyring's backend> --gas=auto

Example:

$ ./stchaincli tx register remove-indexing-node st1880rh8f0585ek4476lcf279y2trm5q493zrfdx st1w0l3aamanqn2z2x4nqzpnlf0qa7sdjvmsc2yml --chain-id=test-chain --keyring-backend=test --gas=auto
gas estimate: 339643
{"chain_id":"test-chain","account_number":"0","sequence":"5","fee":{"amount":[],"gas":"339643"},"msgs":[{"type":"register/MsgRemoveIndexingNode","value":{"indexing_node_address":"st1880rh8f0585ek4476lcf279y2trm5q493zrfdx","owner_address":"st1w0l3aamanqn2z2x4nqzpnlf0qa7sdjvmsc2yml"}}],"memo":""}

confirm transaction before signing and broadcasting [y/N]: y
height: 0
txhash: 0028D5DEFDD9959844826AF5C2A83137C6D85EF668A1372EF9FF82566601DA44
codespace: ""
code: 0
data: ""
rawlog: '[]'
logs: []
info: ""
gaswanted: 0
gasused: 0
tx: null
timestamp: ""

Check if the indexing node has been removed from the indexing-node list using REST API

http://127.0.0.1:1317/register/indexing-nodes

Response:

{
    "height": "451",
    "result": [
        {
            "network_id": "sds://indexingNode0",
            "pubkey": {
                "type": "tendermint/PubKeySecp256k1",
                "value": "A48JBiFMX4UzKcDSXGMWvYdyLWOYgJhDweLfeQJqiVlN"
            },
            "suspend": false,
            "status": 2,
            "tokens": "100000000000",
            "owner_address": "st1w0l3aamanqn2z2x4nqzpnlf0qa7sdjvmsc2yml",
            "description": {
                "moniker": "sds://indexingNode0",
                "identity": "",
                "website": "",
                "security_contact": "",
                "details": ""
            },
            "creation_time": "0001-01-01T00:00:00Z"
        },
        {
            "network_id": "sds://indexingNode1",
            "pubkey": {
                "type": "tendermint/PubKeySecp256k1",
                "value": "AoblppsE5u7s1P4B61gUW5/L4aZEIjWk4skTbanT1rwj"
            },
            "suspend": false,
            "status": 2,
            "tokens": "20000000000",
            "owner_address": "st1k3whylvzwk64ewhhlk3v3kc2w65u09493y6de2",
            "description": {
                "moniker": "sds://indexingNode1",
                "identity": "",
                "website": "",
                "security_contact": "",
                "details": ""
            },
            "creation_time": "0001-01-01T00:00:00Z"
        }
    ]
}

Queries

get-resource-nodes

Query all resource nodes by network id or moniker

Usage:
  stchaincli query register get-resource-nodes [flags]

Flags:
      --details string            The node's (optional) details
      --height int                Use a specific height to query state at (this can error if the node is pruning state)
  -h, --help                      help for get-resource-nodes
      --identity string           The optional identity signature (ex. UPort or Keybase)
      --indent                    Add indent to JSON response
      --ledger                    Use a connected Ledger device
      --moniker string            The node's name
      --network-id string         The network id of the node
      --node string               <host>:<port> to Tendermint RPC interface for this chain (default "tcp://localhost:26657")
      --security-contact string   The node's (optional) security contact email
      --trust-node                Trust connected full node (don't verify proofs for responses)
      --website string            The node's (optional) website

Query by network-id:

stchaincli query register get-resource-nodes --network-id=<network-id1[;network-id2]> --trust-node

Example:

$./stchaincli query register get-resource-nodes --network-id="sds://resourceNode1;sds://resourceNode2" --trust-node
'[{"network_id":"sds://resourceNode1","pubkey":{"type":"tendermint/PubKeySecp256k1","value":"Aynu8/vLk2kcjxEitE2AMh3rdsdJz+aFJTSnxFAa6gFH"},
"suspend":false,"status":2,"tokens":"10000000000","owner_address":"st1w0l3aamanqn2z2x4nqzpnlf0qa7sdjvmsc2yml",
"description":{"moniker":"sds://resourceNode1","identity":"","website":"","security_contact":"","details":""},
"node_type":"7","creation_time":"0001-01-01T00:00:00Z"}];[{"network_id":"sds://resourceNode2",
"pubkey":{"type":"tendermint/PubKeySecp256k1","value":"A5VeIG1rLTen1OhuYu6GARowrCi6HrHlGukHOMIQfs8s"},
"suspend":false,"status":2,"tokens":"200000000000","owner_address":"st1w0l3aamanqn2z2x4nqzpnlf0qa7sdjvmsc2yml",
"description":{"moniker":"sds://resourceNode2","identity":"","website":"","security_contact":"","details":""},
"node_type":"7","creation_time":"0001-01-01T00:00:00Z"}]'

Query by moniker:

stchaincli query register get-resource-nodes --moniker=<name1[;name2]> --trust-node

Example:

$./stchaincli query register get-resource-nodes --moniker="sds://resourceNode1;sds://resourceNode2" --trust-node
'[{"network_id":"sds://resourceNode1","pubkey":{"type":"tendermint/PubKeySecp256k1","value":"Aynu8/vLk2kcjxEitE2AMh3rdsdJz+aFJTSnxFAa6gFH"},
"suspend":false,"status":2,"tokens":"10000000000","owner_address":"st1w0l3aamanqn2z2x4nqzpnlf0qa7sdjvmsc2yml",
"description":{"moniker":"sds://resourceNode1","identity":"","website":"","security_contact":"","details":""},
"node_type":"7","creation_time":"0001-01-01T00:00:00Z"}];[{"network_id":"sds://resourceNode2",
"pubkey":{"type":"tendermint/PubKeySecp256k1","value":"A5VeIG1rLTen1OhuYu6GARowrCi6HrHlGukHOMIQfs8s"},
"suspend":false,"status":2,"tokens":"200000000000","owner_address":"st1w0l3aamanqn2z2x4nqzpnlf0qa7sdjvmsc2yml",
"description":{"moniker":"sds://resourceNode2","identity":"","website":"","security_contact":"","details":""},
"node_type":"7","creation_time":"0001-01-01T00:00:00Z"}]'

get-indexing-nodes

Query all indexing nodes by network id or moniker

Usage:
  stchaincli query register get-indexing-nodes [flags]

Flags:
      --height int          Use a specific height to query state at (this can error if the node is pruning state)
  -h, --help                help for get-indexing-nodes
      --indent              Add indent to JSON response
      --ledger              Use a connected Ledger device
      --moniker string      (optional) The name of the node
      --network-id string   (optional) The network id of the node
      --node string         <host>:<port> to Tendermint RPC interface for this chain (default "tcp://localhost:26657")
      --trust-node          Trust connected full node (don't verify proofs for responses)

Query by network-id:

stchaincli query register get-indexing-nodes --network-id=<network-id1[;network-id2]> --trust-node

Example:

$./stchaincli query register get-indexing-nodes --network-id="sds://indexingNode0;sds://indexingNode0" --trust-node
'[{"network_id":"sds://indexingNode0","pubkey":{"type":"tendermint/PubKeySecp256k1","value":"A48JBiFMX4UzKcDSXGMWvYdyLWOYgJhDweLfeQJqiVlN"},
"suspend":false,"status":2,"tokens":"100000000000","owner_address":"st1w0l3aamanqn2z2x4nqzpnlf0qa7sdjvmsc2yml",
"description":{"moniker":"sds://indexingNode0","identity":"","website":"","security_contact":"","details":""},
"creation_time":"0001-01-01T00:00:00Z"}];[{"network_id":"sds://indexingNode0","pubkey":{"type":"tendermint/PubKeySecp256k1",
"value":"A48JBiFMX4UzKcDSXGMWvYdyLWOYgJhDweLfeQJqiVlN"},"suspend":false,"status":2,"tokens":"100000000000",
"owner_address":"st1w0l3aamanqn2z2x4nqzpnlf0qa7sdjvmsc2yml","description":{"moniker":"sds://indexingNode0","identity":"",
"website":"","security_contact":"","details":""},"creation_time":"0001-01-01T00:00:00Z"}]'

Query by moniker:

stchaincli query register get-indexing-nodes --moniker=<name1[;name2]> --trust-node

Example:

$./stchaincli query register get-indexing-nodes --moniker="sds://indexingNode1" --trust-node
'[{"network_id":"sds://indexingNode1","pubkey":{"type":"tendermint/PubKeySecp256k1","value":"AoblppsE5u7s1P4B61gUW5/L4aZEIjWk4skTbanT1rwj"},
"suspend":false,"status":2,"tokens":"20000000000","owner_address":"st1k3whylvzwk64ewhhlk3v3kc2w65u09493y6de2",
"description":{"moniker":"sds://indexingNode1","identity":"","website":"","security_contact":"","details":""},"creation_time":"0001-01-01T00:00:00Z"}]'

Sds Module

Transactions

-upload

Create and sign a file upload tx

Usage:
  stchaincli tx sds upload [flags]

Flags:
  -a, --account-number uint      The account number of the signing account (offline mode only)
  -b, --broadcast-mode string    Transaction broadcasting mode (sync|async|block) (default "sync")
      --dry-run                  ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it
      --fees string              Fees to pay along with transaction; eg: 10ustos
      --file-hash string         Hash of uploaded file
      --from string              Name or address of private key with which to sign
      --gas string               gas limit to set per-transaction; set to "auto" to calculate required gas automatically (default 200000) (default "200000")
      --gas-adjustment float     adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored  (default 1)
      --gas-prices string        Gas prices to determine the transaction fee (e.g. 10ustos)
      --generate-only            Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase is not accessible and the node operates offline)
  -h, --help                     help for upload
      --indent                   Add indent to JSON response
      --keyring-backend string   Select keyring's backend (os|file|test) (default "os")
      --ledger                   Use a connected Ledger device
      --memo string              Memo to send along with transaction
      --node string              <host>:<port> to tendermint rpc interface for this chain (default "tcp://localhost:26657")
      --reporter string          Reporter of file
  -s, --sequence uint            The sequence number of the signing account (offline mode only)
      --trust-node               Trust connected full node (don't verify proofs for responses) (default true)
      --uploader string          Uploader of file
  -y, --yes                      Skip tx broadcasting prompt confirma
  
  In testing phase, --keyring-backend="test"

Tx command:

stchaincli tx sds upload --file-hash=<file hash> --uploader=<file uploader, resource node address> --reporter=<file reporter, indexing node> --from=<Name|address of private key> --chain-id=<current chain-id> --keyring-backend=<keyring's backend> --gas=auto

Example:

$ ./stchaincli tx sds upload --file-hash=001A1FC0B82DD3B0353B59E90388EEA2B73DEECA872955B414EBC99ECD3E3C1F --uploader=st162xm62m75cjv2529p7yydkxmqfwhknsl60cmu4 --reporter=st1fh6eayruwpq5u2r97tsvmdqwc8a25hgs6y8h60 --from=st1qzx8na3ujlaxstgcyguudaecr6mpsemflhhzua --chain-id=test-chain --keyring-backend=test --gas=auto
gas estimate: 400294
{"chain_id":"test-chain","account_number":"0","sequence":"1","fee":{"amount":[],"gas":"400294"},"msgs":[{"type":"sds/FileUploadTx","value":{"file_hash":"001A1FC0B82DD3B0353B59E90388EEA2B73DEECA872955B414EBC99ECD3E3C1F","from":"st1qzx8na3ujlaxstgcyguudaecr6mpsemflhhzua","reporter":"st1fh6eayruwpq5u2r97tsvmdqwc8a25hgs6y8h60","uploader":"st162xm62m75cjv2529p7yydkxmqfwhknsl60cmu4"}}],"memo":""}

confirm transaction before signing and broadcasting [y/N]: y
height: 0
txhash: C3A322C251C9EAACD51BEBC7B25A6E2BF871164AF60855458DCC959E519C586E
codespace: ""
code: 0
data: ""
rawlog: '[]'
logs: []
info: ""
gaswanted: 0
gasused: 0
tx: null
timestamp: ""

-prepay

Create and sign a prepay tx

Usage:
  stchaincli tx sds prepay <from_address> <coins> [flags]

Flags:
  -a, --account-number uint      The account number of the signing account (offline mode only)
  -b, --broadcast-mode string    Transaction broadcasting mode (sync|async|block) (default "sync")
      --dry-run                  ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it
      --fees string              Fees to pay along with transaction; eg: 10ustos
      --from string              Name or address of private key with which to sign
      --gas string               gas limit to set per-transaction; set to "auto" to calculate required gas automatically (default 200000) (default "200000")
      --gas-adjustment float     adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored  (default 1)
      --gas-prices string        Gas prices to determine the transaction fee (e.g. 10ustos)
      --generate-only            Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase is not accessible and the node operates offline)
  -h, --help                     help for prepay
      --indent                   Add indent to JSON response
      --keyring-backend string   Select keyring's backend (os|file|test) (default "os")
      --ledger                   Use a connected Ledger device
      --memo string              Memo to send along with transaction
      --node string              <host>:<port> to tendermint rpc interface for this chain (default "tcp://localhost:26657")
  -s, --sequence uint            The sequence number of the signing account (offline mode only)
      --trust-node               Trust connected full node (don't verify proofs for responses) (default true)
  -y, --yes                      Skip tx broadcasting prompt confirmation
  
  In testing phase, --keyring-backend="test"

Tx command:

stchaincli tx sds prepay <from_address, Name|address of private key> <coins> --chain-id=<current chain-id> --keyring-backend=<keyring's backend> --gas=auto

Example:

$  ./stchaincli tx sds prepay user0 9000000000000ustos --chain-id=test-chain --keyring-backend=test --gas=auto
gas estimate: 325912
{"chain_id":"test-chain","account_number":"0","sequence":"6","fee":{"amount":[],"gas":"325912"},"msgs":[{"type":"sds/MsgPrepay","value":{"sender":"st1w0l3aamanqn2z2x4nqzpnlf0qa7sdjvmsc2yml","coins":[{"denom":"ustos","amount":"9000000000000"}]}}],"memo":""}

confirm transaction before signing and broadcasting [y/N]: y
height: 0
txhash: 89D72683F3CD80F92937ACEAF2C2A9134B8ECC42707A89FBDB89AAC15E87BD02
codespace: ""
code: 0
data: ""
rawlog: '[]'
logs: []
info: ""
gaswanted: 0
gasused: 0
tx: null
timestamp: ""

Queries:

upload

Query uploaded file info by hash

Usage:
  stchaincli query sds upload <file_hash> [flags]

Flags:
      --height int    Use a specific height to query state at (this can error if the node is pruning state)
  -h, --help          help for upload
      --indent        Add indent to JSON response
      --ledger        Use a connected Ledger device
      --node string   <host>:<port> to Tendermint RPC interface for this chain (default "tcp://localhost:26657")
      --trust-node    Trust connected full node (don't verify proofs for responses)

Query command:

stchaincli query sds upload <file hash> --trust-node

Example:

$./stchaincli query sds upload 010A1FC0B82DD3B0353B59E90388EEA2B73DEECA872955B414EBC99ECD3E3C1F --trust-node
"FileInfo:{
Height:2250 
Reporter:st1v0r46n9vr62q3xac80xmtsf5sct3qazp7azfya
Uploader:st1w0l3aamanqn2z2x4nqzpnlf0qa7sdjvmsc2yml
}"

prepay

Query balance of prepayment in volume Pool

Usage:
  stchaincli query sds prepay <acct_addr> [flags]

Flags:
      --height int    Use a specific height to query state at (this can error if the node is pruning state)
  -h, --help          help for prepay
      --indent        Add indent to JSON response
      --ledger        Use a connected Ledger device
      --node string   <host>:<port> to Tendermint RPC interface for this chain (default "tcp://localhost:26657")
      --trust-node    Trust connected full node (don't verify proofs for responses)

Query command:

stchaincli query sds prepay <acct_addr> --trust-node

Example:

$./stchaincli query sds prepay st1w0l3aamanqn2z2x4nqzpnlf0qa7sdjvmsc2yml --trust-node
"9000000000000"

Pot Module

Transactions

-foundation-deposit

Deposit to foundation account

Usage:
  stchaincli tx pot foundation-deposit [flags]

Flags:
  -a, --account-number uint      The account number of the signing account (offline mode only)
      --amount string            Amount of coins to withdraw
  -b, --broadcast-mode string    Transaction broadcasting mode (sync|async|block) (default "sync")
      --dry-run                  ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it
      --fees string              Fees to pay along with transaction; eg: 10ustos
      --from string              Name or address of private key with which to sign
      --gas string               gas limit to set per-transaction; set to "auto" to calculate required gas automatically (default 200000) (default "200000")
      --gas-adjustment float     adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored  (default 1)
      --gas-prices string        Gas prices to determine the transaction fee (e.g. 10ustos)
      --generate-only            Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase is not accessible and the node operates offline)
  -h, --help                     help for foundation-deposit
      --indent                   Add indent to JSON response
      --keyring-backend string   Select keyring's backend (os|file|test) (default "os")
      --ledger                   Use a connected Ledger device
      --memo string              Memo to send along with transaction
      --node string              <host>:<port> to tendermint rpc interface for this chain (default "tcp://localhost:26657")
  -s, --sequence uint            The sequence number of the signing account (offline mode only)
      --trust-node               Trust connected full node (don't verify proofs for responses) (default true)
  -y, --yes                      Skip tx broadcasting prompt confirmation
  
  In testing phase, --keyring-backend="test"

Tx command:

stchaincli tx pot foundation-deposit --amount=<amount> --from=<from_address, Name|address of private key> --chain-id=<current chain-id> --keyring-backend=<keyring's backend> --gas=auto

Example:

$ ./stchaincli tx pot foundation-deposit --amount=400000000000000ustos --from=user0 --chain-id=test-chain-localnet --keyring-backend=test --gas=auto
gas estimate: 323098
{"chain_id":"test-chain-localnet","account_number":"0","sequence":"1","fee":{"amount":[],"gas":"323098"},"msgs":[{"type":"pot/MsgFoundationDeposit","value":{"amount":{"denom":"ustos","amount":"400000000000000"},"from":"st13rzt6mzep4wh3tzzppk2uvtapw6pnmdcr8nr2x"}}],"memo":""}

confirm transaction before signing and broadcasting [y/N]: y
height: 0
txhash: 8702CB1C33F3A8459E2D8893F3274A1D95AF31C60B12DE359D0431BE6387DC55
codespace: ""
code: 0
data: ""
rawlog: '[]'
logs: []
info: ""
gaswanted: 0
gasused: 0
tx: null
timestamp: ""

-report

Create and sign a pot volume report tx

Usage:
  stchaincli tx pot report [flags]

Flags:
  -a, --account-number uint      The account number of the signing account (offline mode only)
  -b, --broadcast-mode string    Transaction broadcasting mode (sync|async|block) (default "sync")
      --dry-run                  ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it
      --epoch string             the epoch when this PoT message reported.
      --fees string              Fees to pay along with transaction; eg: 10ustos
      --from string              Name or address of private key with which to sign
      --gas string               gas limit to set per-transaction; set to "auto" to calculate required gas automatically (default 200000) (default "200000")
      --gas-adjustment float     adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored  (default 1)
      --gas-prices string        Gas prices to determine the transaction fee (e.g. 10ustos)
      --generate-only            Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase is not accessible and the node operates offline)
  -h, --help                     help for report
      --indent                   Add indent to JSON response
      --keyring-backend string   Select keyring's backend (os|file|test) (default "os")
      --ledger                   Use a connected Ledger device
      --memo string              Memo to send along with transaction
      --node string              <host>:<port> to tendermint rpc interface for this chain (default "tcp://localhost:26657")
      --reference string          the hash used as a reference to this PoT report
      --reporter-addr string     the node address of reporter
  -s, --sequence uint            The sequence number of the signing account (offline mode only)
      --trust-node               Trust connected full node (don't verify proofs for responses) (default true)
      --wallet-volumes string    a string of KEY-VALUE pairs. The KEY is 'wallet-volumes' and the VALUE is the proof of traffic of this wallet`
  -y, --yes                      Skip tx broadcasting prompt confirmation
  
  In testing phase, --keyring-backend="test"

Tx command:

stchaincli tx pot report --reporter-addr=<reporter-address, indexing node> --epoch=<epoch> --reference=<reference> --wallet-volumes='[{"wallet_address":<wallet_address1>,"volume":<value1>}, {"wallet_address":<wallet_address2>,"volume":<value2>}, ...]' \ 
--from=<from_address, Name|address of private key> --chain-id=<current chain-id> --keyring-backend=<keyring's backend> --gas=auto -y

Example:

$ ./stchaincli tx pot report --reporter-addr=st1fh6eayruwpq5u2r97tsvmdqwc8a25hgs6y8h60 --epoch=2017 \
--reference=20171FC0B82DD3B0353B59E90388EEA2B73DEECA872955B414EBC99ECD3E3C1F \
--wallet-volumes='[{"wallet_address":"st19nsx80gtknyukzy6p8z8009c3xptftgy2drxaz","volume":"500000"}, {"wallet_address":"st1se0hwymfz353xqj4nmxhrqz6g3qzeng5d9mjf4","volume":"500000"}]' \
 --from=st19nsx80gtknyukzy6p8z8009c3xptftgy2drxaz --chain-id=test-chain-localnet --keyring-backend=test --gas=auto -y
gas estimate: 6605197
height: 0
txhash: 55209954794D08DABFC38000C60153430160A08A9DA7248EBFA9DB0FB69F518E
codespace: ""
code: 0
data: ""
rawlog: '[]'
logs: []
info: ""
gaswanted: 0
gasused: 0
tx: null
timestamp: ""

check volume report using query command

stchaincli query pot report --epoch=<epoch> --trust-node

Example:

$./stchaincli query pot report --epoch=1 --trust-node
epoch: "1"
reference: |-
  {
    "Reporter": "st1v0r46n9vr62q3xac80xmtsf5sct3qazp7azfya",
    "ReportReference": "100A1FC0B82DD3B0353B59E90388EEA2B73DEECA872955B414EBC99ECD3E3C1F",
    "TxHash": "5F5E9A23057D4E079F74E24B24D80A33C3908E55A89A6C3B8235529CA3EF71CB"
  }

Also, we can get a concise response from REST API

http://127.0.0.1:1317/pot/report/epoch/1

Response:

{
    "height": "1819",
    "result": {
        "Reporter": "st1v0r46n9vr62q3xac80xmtsf5sct3qazp7azfya",
        "ReportReference": "100A1FC0B82DD3B0353B59E90388EEA2B73DEECA872955B414EBC99ECD3E3C1F",
        "TxHash": "5F5E9A23057D4E079F74E24B24D80A33C3908E55A89A6C3B8235529CA3EF71CB"
    }
}

-withdraw

withdraw POT reward


Usage:
  stchaincli tx pot withdraw [flags]

Flags:
  -a, --account-number uint      The account number of the signing account (offline mode only)
      --amount string            Amount of coins to withdraw
  -b, --broadcast-mode string    Transaction broadcasting mode (sync|async|block) (default "sync")
      --dry-run                  ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it
      --fees string              Fees to pay along with transaction; eg: 10ustos
      --from string              Name or address of private key with which to sign
      --gas string               gas limit to set per-transaction; set to "auto" to calculate required gas automatically (default 200000) (default "200000")
      --gas-adjustment float     adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored  (default 1)
      --gas-prices string        Gas prices to determine the transaction fee (e.g. 10ustos)
      --generate-only            Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase is not accessible and the node operates offline)
  -h, --help                     help for withdraw
      --indent                   Add indent to JSON response
      --keyring-backend string   Select keyring's backend (os|file|test) (default "os")
      --ledger                   Use a connected Ledger device
      --memo string              Memo to send along with transaction
      --node string              <host>:<port> to tendermint rpc interface for this chain (default "tcp://localhost:26657")
  -s, --sequence uint            The sequence number of the signing account (offline mode only)
      --target-address string    The target account where the money is deposited after withdraw
      --trust-node               Trust connected full node (don't verify proofs for responses) (default true)
  -y, --yes                      Skip tx broadcasting prompt confirmation
  
  In testing phase, --keyring-backend="test"

Tx command:

stchaincli tx pot withdraw --amount=<amount to withdraw> --target-address=<wallet address of reciever> --from=<from_address, Name|address of private key> --chain-id=<current chain-id> --keyring-backend=<keyring's backend> --gas=auto

Example:

$ ./stchaincli tx pot withdraw --amount=100rstos --target-address=st19nsx80gtknyukzy6p8z8009c3xptftgy2drxaz --from=st19nsx80gtknyukzy6p8z8009c3xptftgy2drxaz --chain-id=test-chain-localnet --keyring-backend=test --gas=auto
gas estimate: 331550
{"chain_id":"test-chain-localnet","account_number":"0","sequence":"7","fee":{"amount":[],"gas":"331550"},"msgs":[{"type":"pot/WithdrawTx","value":{"amount":{"denom":"rstos","amount":"100"},"wallet_address":"st19nsx80gtknyukzy6p8z8009c3xptftgy2drxaz","target_address":"st19nsx80gtknyukzy6p8z8009c3xptftgy2drxaz"}}],"memo":""}

confirm transaction before signing and broadcasting [y/N]: y
height: 0
txhash: 2500841575AFC74279BA39F77FA8C770ABD616D0ADA6F801EFE4CB9EFB3BBFBB
codespace: ""
code: 0
data: ""
rawlog: '[]'
logs: []
info: ""
gaswanted: 0
gasused: 0
tx: null
timestamp: ""

Queries

report

Query volume report by epoch

Usage:
  stchaincli query pot report [flags]

Flags:
      --epoch string   the epoch when this PoT message reported.
      --height int     Use a specific height to query state at (this can error if the node is pruning state)
  -h, --help           help for report
      --indent         Add indent to JSON response
      --ledger         Use a connected Ledger device
      --node string    <host>:<port> to Tendermint RPC interface for this chain (default "tcp://localhost:26657")
      --trust-node     Trust connected full node (don't verify proofs for responses)

Query command:

stchaincli query pot report --epoch=<epoch> --trust-node

Example:

$./stchaincli query pot report --epoch=1 --trust-node
epoch: "1"
reference: |-
  {
    "Reporter": "st1v0r46n9vr62q3xac80xmtsf5sct3qazp7azfya",
    "ReportReference": "100A1FC0B82DD3B0353B59E90388EEA2B73DEECA872955B414EBC99ECD3E3C1F",
    "TxHash": "5F5E9A23057D4E079F74E24B24D80A33C3908E55A89A6C3B8235529CA3EF71CB"
  }

Last updated