πŸ“„
CLI Reference
The cli subcommand provides a human-friendly command-line interface to the node JSON-RPC API.

Usage

See all the available options by running the help command using docker, binary or cargo.
Docker
Binary
Cargo
1
docker exec witnet_node witnet node --help
Copied!
1
witnet node --help
Copied!
1
cargo run -- node --help
Copied!
To get more information about any specific command, simply add --help at the end. For instance, this will show the available options for the blockchain command:
Docker
Binary
Cargo
1
docker exec witnet_node witnet node blockchain --help
Copied!
1
witnet node blockchain --help
Copied!
1
cargo run -- node blockchain --help
Copied!
The JSON-RPC server address is obtained from the configuration file. The path of this file can be set using the -c or --config flag. This flag must appear before node.
Docker
Binary
Cargo
1
docker exec witnet_node witnet node -c witnet.toml node blockchain
Copied!
1
witnet -c witnet.toml node blockchain
Copied!
1
cargo run -- -c witnet.toml node blockchain
Copied!
You can use the -n flag to easily overwrite the node address. This flag must appear after the command name.
Docker
Binary
Cargo
1
docker exec witnet_node witnet node -c witnet.toml node blockchain -n "127.0.0.1:1234"
Copied!
1
witnet -c witnet.toml node blockchain -n "127.0.0.1:1234"
Copied!
1
cargo run -- -c witnet.toml node blockchain -n "127.0.0.1:1234"
Copied!
If there is any error, the process will return a non-zero exit code.
Docker
Binary
Cargo
1
docker exec witnet_node witnet node node blockchain
2
Error: Connection refused (os error 111)
Copied!
1
witnet node blockchain
2
Error: Connection refused (os error 111)
Copied!
1
cargo run -- node blockchain
2
Error: Connection refused (os error 111)
Copied!
The executable implements the usual logging API, which can be enabled using RUST_LOG=witnet=debug:
Docker
Binary
Cargo
1
$ docker exec witnet_node witnet node blockchain
2
INFO 2019-01-03T12:04:43Z: witnet::json_rpc_client: Connecting to JSON-RPC server at 127.0.0.1:21338
3
ERROR 2019-01-03T12:04:43Z: witnet: Error: Connection refused (os error 111)
Copied!
1
$ RUST_LOG=witnet=debug witnet node blockchain
2
INFO 2019-01-03T12:04:43Z: witnet::json_rpc_client: Connecting to JSON-RPC server at 127.0.0.1:21338
3
ERROR 2019-01-03T12:04:43Z: witnet: Error: Connection refused (os error 111)
Copied!
1
$ RUST_LOG=witnet=debug cargo run -- node blockchain
2
INFO 2019-01-03T12:04:43Z: witnet::json_rpc_client: Connecting to JSON-RPC server at 127.0.0.1:21338
3
ERROR 2019-01-03T12:04:43Z: witnet: Error: Connection refused (os error 111)
Copied!

Commands

addPeers

Add addresses to the node's peers and try to connect to them.
The IP addresses are expected in format: list of "address:port" separated by spaces.
Docker
Binary
Cargo
1
docker exec witnet_node witnet node addPeers 52.166.178.145:21337 52.166.178.145:22337
Copied!
1
witnet node addPeers 52.166.178.145:12337 52.166.178.145:22337
Copied!
1
cargo run -- node addPeers 52.166.178.145:12337 52.166.178.145:22337
Copied!
Example output:
1
Successfully added peer addresses: ["52.166.178.145:12337", "52.166.178.145:22337"]
Copied!

address

Get the identifier of the node that acts as its address when interacting with the protocol through transactions.
This is the address used for mining blocks, resolving data requests, and receiving value transfer transactions.
Docker
Binary
Cargo
1
docker exec witnet_node witnet node address
Copied!
1
witnet node address
Copied!
1
cargo run -- node address
Copied!
Example output:
1
twit1ulyzvnknjnndkfva636erkkp83wxhhwdfhptsr
Copied!

balance

Get total balance of a given Witnet address. Balances are shown in wits.
  • --address=address: address for which to get balance. If omitted, defaults to the node's own address.
Docker
Binary
Cargo
1
docker exec witnet_node witnet node balance
2
docker exec witnet_node witnet node balance --address=twit1ulyzvnknjnndkfva636erkkp83wxhhwdfhptsr
Copied!
1
witnet node balance
2
witnet node balance --address=twit1ulyzvnknjnndkfva636erkkp83wxhhwdfhptsr
Copied!
1
cargo run -- node balance
2
cargo run -- node balance --address=twit1ulyzvnknjnndkfva636erkkp83wxhhwdfhptsr
Copied!
Example output:
1
34099.999950005 wits
Copied!

block

Print out detailed information about a block being queried by its hash.
Docker
Binary
Cargo
1
docker exec witnet_node witnet node block 9372e2ed0c637a9733e92d7e0d4f1aa1f297c43a80bc3be57fc7d7738efb0ef4
Copied!
1
witnet node block 9372e2ed0c637a9733e92d7e0d4f1aa1f297c43a80bc3be57fc7d7738efb0ef4
Copied!
1
cargo run -- node block 9372e2ed0c637a9733e92d7e0d4f1aa1f297c43a80bc3be57fc7d7738efb0ef4
Copied!
The hash of the block should be provided as a hexadecimal string.
Example output:
1
{
2
"jsonrpc": "2.0",
3
"result": {
4
"block_header": {
5
"beacon": {
6
"checkpoint": 74005,
7
"hashPrevBlock": "ac6ec0020e726577fa3df3fd04de2a30b020c4a864602375a129e090707a90dc"
8
},
9
"merkle_roots": {
10
"commit_hash_merkle_root": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","dr_hash_merkle_root": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","mint_hash": "a02e6038ec2a472d6daa8f374bdeca84a62cd5731d33dd865f497f34360874ef","reveal_hash_merkle_root": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","tally_hash_merkle_root": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","vt_hash_merkle_root": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
11
},
12
"proof": {
13
"proof": {
14
"proof": [
15
2,76,213,68,242,86,29,133,44,102,231,220,74,198,196,117,106,87,200,168,77,176,129,130,10,164,24,13,131,141,240,28,46,72,247,80,196,178,67,144,46,246,44,191,20,119,187,160,110,73,60,243,160,231,188,124,69,238,130,148,69,137,102,60,56,33,62,127,90,62,47,62,77,79,163,151,49,233,127,65,103
16
],
17
"public_key": {
18
"bytes": [
19
163,236,130,238,47,169,114,32,51,173,139,216,109,148,153,253,189,195,194,125,3,156,222,125,123,96,212,247,24,171,132,136
20
],
21
"compressed": 2
22
}
23
}
24
},
25
"version":0
26
},
27
"block_sig": {
28
"public_key": {
29
"bytes": [
30
163,236,130,238,47,169,114,32,51,173,139,216,109,148,153,253,189,195,194,125,3,156,222,125,123,96,212,247,24,171,132,136
31
],
32
"compressed": 2
33
},
34
"signature": {
35
"Secp256k1": {
36
"der": [
37
48,68,2,32,13,144,153,43,104,8,14,205,157,88,181,226,110,189,101,148,248,193,170,99,177,219,228,149,239,34,1,245,13,207,123,220,2,32,108,71,130,109,147,73,92,96,149,102,125,144,146,252,143,66,74,105,52,185,196,217,95,249,157,11,108,254,35,187,67,12
38
]
39
}
40
}
41
},
42
"txns": {
43
"commit_txns": [],
44
"data_request_txns": [],
45
"mint": {
46
"epoch":74005,"output": {
47
"pkh": "twit1ulyzvnknjnndkfva636erkkp83wxhhwdfhptsr",
48
"time_lock": 0,
49
"value":50000000000
50
}
51
},
52
"reveal_txns": [],
53
"tally_txns": [],
54
"value_transfer_txns": []
55
}
56
},
57
"id": "1"
58
}
Copied!

blockchain

List block hashes in the local block chain, matched with their epochs.
Docker
Binary
Cargo
1
docker exec witnet_node witnet node blockchain
Copied!
1
witnet node blockchain
Copied!
1
cargo --run node blockchain
Copied!
This method accepts two optional arguments:
  • --epoch=n: the first epoch for which to show block hashes. A negative epoch means "n epochs ago".
  • --limit=n: the number of epochs. If zero, unlimited.
Docker
Binary
Cargo
1
# Get all the block hashes from the genesis block
2
docker exec witnet_node witnet node blockchain --epoch=0 --limit=0
3
​
4
# Get the block hashes from epochs [0, 19]
5
docker exec witnet_node witnet node blockchain --epoch=0 --limit=20
6
​
7
# Get the block hashes from the last 10 epochs
8
docker exec witnet_node witnet node blockchain --epoch=-10 --limit=0
9
​
10
# Get the block hash from 10 epochs ago
11
docker exec witnet_node witnet node blockchain --epoch=-10 --limit=1
12
​
13
# Get the block hash from the last block
14
docker exec witnet_node witnet node blockchain --epoch=-1 --limit=1
Copied!
1
# Get all the block hashes from the genesis block
2
witnet node blockchain --epoch=0 --limit=0
3
4
# Get the block hashes from epochs [0, 19]
5
witnet node blockchain --epoch=0 --limit=20
6
7
# Get the block hashes from the last 10 epochs
8
witnet node blockchain --epoch=-10 --limit=0
9
10
# Get the block hash from 10 epochs ago
11
witnet node blockchain --epoch=-10 --limit=1
12
13
# Get the block hash from the last block
14
witnet node blockchain --epoch=-1 --limit=1
Copied!
1
# Get all the block hashes from the genesis block
2
cargo run -- node blockchain --epoch=0 --limit=0
3
4
# Get the block hashes from epochs [0, 19]
5
cargo run -- node blockchain --epoch=0 --limit=20
6
7
# Get the block hashes from the last 10 epochs
8
cargo run -- node blockchain --epoch=-10 --limit=0
9
10
# Get the block hash from 10 epochs ago
11
cargo run -- node blockchain --epoch=-10 --limit=1
12
13
# Get the block hash from the last block
14
cargo run -- node blockchain --epoch=-1 --limit=1
Copied!
Example output:
1
block for epoch #76229 had digest 8dd75bb0d5475a93c27c4166677fbb3bc154e6731c7e07ecad549a58851c84a4
Copied!

dataRequestReport

Show information about a data request.
Docker
Binary
Cargo
1
docker exec witnet_node witnet node dataRequestReport 33c656101dd1dfa2258415d6487c648152b95983d1151f46a679b5d1902f6a8d
Copied!
1
witnet node dataRequestReport 33c656101dd1dfa2258415d6487c648152b95983d1151f46a679b5d1902f6a8d
Copied!
1
cargo run -- node dataRequestReport 33c656101dd1dfa2258415d6487c648152b95983d1151f46a679b5d1902f6a8d
Copied!
Example output:
1
Report for data request 33c656101dd1dfa2258415d6487c648152b95983d1151f46a679b5d1902f6a8d:
2
Deployed in block 159045c67d97e284588be4da89a43319735919144b2aaf1468e7eae6682f42b6 by twit10smy4dez7dpuc8yk3ck2qzgtuaa4vx3nqh5ysl
3
FINISHED with 2 commits and 2 reveals
4
Commit rounds: 1/2
5
Reveal rounds: 1/2
6
Reveals:
7
[Rewarded ] twit1xpc5d7dz6rsnnjrlp98vtn496qzrawu7y5cyx4: RadonTypes::RadonFloat(10172.642950000001)
8
[Rewarded ] twit1xcnfm3q57h7uh7y2m23y6hd7jsqufyrlmxgfnq: RadonTypes::RadonFloat(10172.642950000001)
9
Tally: RadonTypes::RadonFloat(10172.642950000001)
Copied!
If you want to see the request move forwards through its different stages in real time you can use the watch command while it is being resolved:
Docker
Binary
Cargo
1
watch --color docker exec witnet_node witnet node dataRequestReport 33c656101dd1dfa2258415d6487c648152b95983d1151f46a679b5d1902f6a8d
Copied!
1
watch --color witnet node dataRequestReport 33c656101dd1dfa2258415d6487c648152b95983d1151f46a679b5d1902f6a8d
Copied!
1
watch --color cargo run -- node dataRequestReport 33c656101dd1dfa2258415d6487c648152b95983d1151f46a679b5d1902f6a8d
Copied!

joinTransaction

Create a value transfer transaction that joins UTXOs.
The following arguments must be provided.
  • --value=amount: amount in nanoWits.
  • --fee=fee: miner fee in nanoWits.
Docker
Binary
Cargo
1
docker exec witnet_node witnet node joinTransaction --value=100 --fee=1
Copied!
1
witnet node joinTransaction --value=100 --fee=1
Copied!
1
cargo run -- node joinTransaction --value=100 --fee=1
Copied!

knownPeers

Get the list of peer addresses known to the node. These addresses are tagged as:
Docker
Binary
Cargo
1
docker exec witnet_node witnet node knownPeers
Copied!
1
witnet node knownPeers
Copied!
1
cargo run -- node knownPeers
Copied!

masterKeyExport

Export the node's master private key. Please keep this totally secret. Anyone with knowledge of this key has full access to all your wit tokens.
Docker
Binary
Cargo
1
docker exec witnet_node witnet node masterKeyExport
Copied!
1
witnet node masterkeyExport
Copied!
1
cargo run -- node masterkeyExport
Copied!

minerList

Display the list of block hashes for each epoch, their miners and the numbers of blocks mined by each address.
Docker
Binary
Cargo
1
docker exec witnet_node ./witnet node minerList
Copied!
1
witnet node minerList
Copied!
1
cargo run -- node minerList
Copied!

nodeStats

Display local node stats.
Docker
Binary
Cargo
1
docker exec witnet_node witnet node nodeStats
Copied!
1
witnet node nodeStats
Copied!
1
cargo run -- node nodeStats
Copied!
Among other information, this shows counters for proposed and accepted blocks and participations in resolving data requests ("commitments"):
Block mining stats
  • Proposed blocks
  • Blocks included in the block chain
Data Request mining stats:
  • Times with eligibility to mine a data request
  • Proposed commits
  • Accepted commits
  • Slashed commits
Example output:
1
Block mining stats:
2
- Proposed blocks: 81
3
- Blocks included in the block chain: 1
4
Data Request mining stats:
5
- Times with eligibility to mine a data request: 2
6
- Proposed commits: 0
7
- Accepted commits: 0
8
- Slashed commits: 0
Copied!
!!! tip Note that it is perfectly normal for a node to show 0 "blocks included" or "accepted commits" for the first days of it being up. Please be patient, new identities in the system are subject to a slow start for critical security reasons.

output

Display a transaction output, as referred by it's "output pointer", that is, <transaction_id>:<output_index>.
Docker
Binary
Cargo
1
docker exec witnet_node witnet node output 33c656101dd1dfa2258415d6487c648152b95983d1151f46a679b5d1902f6a8d:0
Copied!
1
witnet node output 33c656101dd1dfa2258415d6487c648152b95983d1151f46a679b5d1902f6a8d
Copied!
1
cargo run -- node output 33c656101dd1dfa2258415d6487c648152b95983d1151f46a679b5d1902f6a8d
Copied!

peers

List inbound and outbound connections currently established by the node. Outbound connections are those initiated on our side, and inbound connections are those that were initiated by peer nodes. A node that does not announce a public address (IP and port) will normally have no inbound connections, as there is no way for other nodes to discover a valid network route to it.
Docker
Binary
Cargo
1
docker exec witnet_node witnet node peers
Copied!
1
witnet node peers
Copied!
1
cargo run -- node peers
Copied!

raw

The raw command allows sending raw JSON-RPC requests from the command line. It can be used in an interactive way (don't forget the -i flag when using Docker): each line of user input will be sent to the JSON-RPC server without any modifications:
Docker
Binary
Cargo
1
$ docker exec -i witnet_node witnet node raw
Copied!
1
$ witnet -c witnet.toml node raw
Copied!
1
$ cargo run -- -c witnet.toml node raw
Copied!
Each block represents a method call: the first line is a request, the second line is a response.
1
hi
2
{"jsonrpc": "2.0","error": {"code":-32700,"message": "Parse error"},"id":null}
Copied!
1
{"jsonrpc": "2.0","method": "blockChain", "id": 1}
2
{"jsonrpc": "2.0","result": [[242037,"3f8c9ed0fa721e39de9483f61f290f76a541757a828e54a8d951101b1940c59a"]],"id":1}
Copied!
1
{"jsonrpc": "2.0","method": "someInvalidMethod", "id": 2}
2
{"jsonrpc": "2.0","error": {"code":-32601,"message": "Method not found"},"id":2}
Copied!
1
bye
2
{"jsonrpc": "2.0","error": {"code":-32700,"message": "Parse error"},"id":null}
Copied!
Alternatively, the input can be read from a file using pipes, as is usual in Unix-like environments. For instance, the bitcoin_price.json data request example from the witnet-rust reposity can be easily deployed into the network using the raw command like this:
Docker
Binary
Cargo
1
cat examples/bitcoin_price.json | docker exec -i witnet_node witnet node raw
2
{"jsonrpc": "2.0","result": "06e19d996a6776d6cd1ca215f6acd0975d71e64a9dacc06fcfdd7b2538cdbf6d","id": "1"}
Copied!
1
cat examples/bitcoin_price.json | witnet node raw
2
{"jsonrpc": "2.0","result": "06e19d996a6776d6cd1ca215f6acd0975d71e64a9dacc06fcfdd7b2538cdbf6d","id": "1"}
Copied!
1
cat examples/bitcoin_price.json | cargo run -- node raw
2
{"jsonrpc": "2.0","result": "06e19d996a6776d6cd1ca215f6acd0975d71e64a9dacc06fcfdd7b2538cdbf6d","id": "1"}
Copied!

reputation

Displays the reputation score associated with a given Witnet address and its elegibility to mine a block.
  • --address=address: address for which to get reputation score. If omitted, defaults to the node's own address.
Docker
Binary
Cargo
1
docker exec witnet_node witnet node reputation
2
docker exec witnet_node witnet node reputation --address=twit1p2my760gmg4gwsnhunwnx3epvj9c4whnsnn8j4
Copied!
1
witnet node reputation
2
witnet node reputation --address=twit1p2my760gmg4gwsnhunwnx3epvj9c4whnsnn8j4
Copied!
1
cargo run -- node reputation
2
cargo run -- node reputation --address=twit1p2my760gmg4gwsnhunwnx3epvj9c4whnsnn8j4
Copied!
Example output:
1
[A] twit1p2my760gmg4gwsnhunwnx3epvj9c4whnsnn8j4 -> Reputation: 1, Eligibility: 28.571429%
Copied!
The parameter [A] notifies that the node is active.
Adding the flag --all lists all the nodes active and their elegibility. It also lists the nodes with reputation grater than 0 but not active, if any.
!!! tip Note that it is perfectly normal for a node to show 0 reputation for the first days of it being up. Please be patient, new identities in the system are subject to a slow start for critical security reasons.
Docker
Binary
Cargo
1
docker exec witnet_node witnet node reputation --all
Copied!
1
witnet node reputation --all
Copied!
1
cargo run -- node reputation --all
Copied!
Example output:
1
Total Reputation: {
2
[A] twit1hgert0dwtfmfcnv34epvjyhwamny20vkx09zjc -> Reputation: 2, Eligibility: 42.857143%
3
[A] twit1p2my760gmg4gwsnhunwnx3epvj9c4whnsnn8j4 -> Reputation: 1, Eligibility: 28.571429%
4
[A] twit18gqex3jg4pazz5am2588fc89qyvg350gs603j2 -> Reputation: 1, Eligibility: 28.571429%
5
​
6
}
Copied!

send

Create and broadcast a value transfer transaction. That is, send some amount of wit tokens from the node's own balance into a different Witnet address.
  • --address=address: recipient address.
  • --value=amount: amount in nanoWits.
  • --fee=fee: miner fee in nanoWits.
  • --time-lock=timestamp: optional time lock for the created output: the receiver will not be able to spend the output until the timestamp is reached. 0 means no time-lock.
On success, returns the transaction hash:
Docker
Binary
Cargo
1
docker exec witnet_node witnet node send --address=twit1ulyzvnknjnndkfva636erkkp83wxhhwdfhptsr --value=1234 --fee=1
2
{"jsonrpc": "2.0","result": "a6c26804cf76e08ab379ea63e4aa046095dade2ae52fb3ecac90817583e61349","id": "1"}
Copied!
1
witnet node send --address=twit1ulyzvnknjnndkfva636erkkp83wxhhwdfhptsr --value=1234 --fee=1
2
{"jsonrpc": "2.0","result": "a6c26804cf76e08ab379ea63e4aa046095dade2ae52fb3ecac90817583e61349","id": "1"}
Copied!
1
cargo run -- node send --address=twit1ulyzvnknjnndkfva636erkkp83wxhhwdfhptsr --value=1234 --fee=1
2
{"jsonrpc": "2.0","result": "a6c26804cf76e08ab379ea63e4aa046095dade2ae52fb3ecac90817583e61349","id": "1"}
Copied!
On error, returns the error message:
Docker
Binary
Cargo
1
docker exec witnet_node witnet node send --address=twit1ulyzvnknjnndkfva636erkkp83wxhhwdfhptsr --value=9999999999999999999 --fee=1
2
{"jsonrpc": "2.0","error": {"code":-32603,"message": "Cannot build a transaction transferring more value than the current available balance: 9999999999999999999 + 1 > 39649999949502"},"id": "1"}
Copied!
1
witnet node send --address=twit1ulyzvnknjnndkfva636erkkp83wxhhwdfhptsr --value=9999999999999999999 --fee=1
2
{"jsonrpc": "2.0","error": {"code":-32603,"message": "Cannot build a transaction transferring more value than the current available balance: 9999999999999999999 + 1 > 39649999949502"},"id": "1"}
Copied!
1
cargo run -- node send --address=twit1ulyzvnknjnndkfva636erkkp83wxhhwdfhptsr --value=9999999999999999999 --fee=1
2
{"jsonrpc": "2.0","error": {"code":-32603,"message": "Cannot build a transaction transferring more value than the current available balance: 9999999999999999999 + 1 > 39649999949502"},"id": "1"}
Copied!
Example with time lock set to 2019-10-01
Docker
Binary
Cargo
1
docker exec witnet_node witnet node send --address=twit1ulyzvnknjnndkfva636erkkp83wxhhwdfhptsr --value=1234 --fee=1 --time-lock=1569888000
2
{"jsonrpc": "2.0","result": "e5b55ec4930f32383e63de9316238f369ee26d89d4375521071a885fc46b4c17","id": "1"}
Copied!
1
witnet node send --address=twit1ulyzvnknjnndkfva636erkkp83wxhhwdfhptsr --value=1234 --fee=1 --time-lock=1569888000
2
{"jsonrpc": "2.0","result": "e5b55ec4930f32383e63de9316238f369ee26d89d4375521071a885fc46b4c17","id": "1"}
Copied!
1
cargo run -- node send --address=twit1ulyzvnknjnndkfva636erkkp83wxhhwdfhptsr --value=1234 --fee=1 --time-lock=1569888000
2
{"jsonrpc": "2.0","result": "e5b55ec4930f32383e63de9316238f369ee26d89d4375521071a885fc46b4c17","id": "1"}
Copied!

sendRequest

Send a serialized data request. An example of how to create such a request can be found in the tutorial.
Docker
Cargo
Binary
1
docker exec witnet_node witnet node sendRequest --hex "data request output serialized in hexadecimal format"
Copied!
1
cargo run -- node sendRequest --hex "data request output serialized in hexadecimal format"
Copied!
1
witnet node sendRequest --hex "data request output serialized in hexadecimal format"
Copied!

server

Run a Witnet node server.
Docker
Binary
Cargo
1
docker exec witnet_node witnet node server
Copied!
1
witnet node server
Copied!
1
cargo run -- node server
Copied!

splitTransaction

Create a value transfer transaction that splits UTXOs.
The following arguments must be provided:
  • --value=amount: amount in nanoWits.
  • --size=size: amount in nanoWits of each UTXO.
  • --fee=fee: miner fee in nanoWits.
Docker
Binary
Cargo
1
docker exec witnet_node witnet node joinTransaction --value=100 --size=3 --fee=1
Copied!
1
witnet node joinTransaction --value=100 --size=3 --fee=1
Copied!
1
cargo run -- node joinTransaction --value=100 --size=3 --fee=1
Copied!

transaction

Print out detailed information about a transaction being queried by its hash.
Docker
Binary
Cargo
1
docker exec witnet_node witnet node transaction f6ebdd2e3f52af8404ae3dfbf87fcfc85803a8c14a35966acca6e18585acb8f5
Copied!
1
witnet node transaction f6ebdd2e3f52af8404ae3dfbf87fcfc85803a8c14a35966acca6e18585acb8f5
Copied!
1
cargo run -- node transaction f6ebdd2e3f52af8404ae3dfbf87fcfc85803a8c14a35966acca6e18585acb8f5
Copied!
The hash of the transaction should be provided as a hexadecimal string.
Example output:
1
{
2
"jsonrpc": "2.0",
3
"result": {
4
"blockHash": "0c29023ec3c8c9e1a51871a67e235168315160d9f757737c2c390f0a35ad1b24",
5
"transaction": {
6
"ValueTransfer": {
7
"body": {
8
"inputs": [
9
{
10
"output_pointer": "126549b3ea96f40bb211660d7991109d72b43e68e846ea76d4d2f6cd5a3cc7ff:1"
11
}
12
],
13
"outputs": [
14
{
15
"pkh": "twit12nqlkyp0zfhthfz898tplh3ns7nedcvlezx4r4",
16
"time_lock": 0,
17
"value": 100
18
},
19
{
20
"pkh": "twit10smy4dez7dpuc8yk3ck2qzgtuaa4vx3nqh5ysl",
21
"time_lock": 0,
22
"value":499999999987
23
}
24
]
25
},
26
"signatures": [
27
{
28
"public_key": {
29
"bytes": [
30
109,158,138,247,58,8,183,138,57,113,147,147,136,177,252,244,33,147,143,200,255,89,208,192,214,81,128,224,219,180,136,155
31
],
32
"compressed": 3
33
},
34
"signature": {
35
"Secp256k1": {
36
"der": [
37
48,68,2,32,25,163,14,139,5,92,35,157,90,73,162,93,88,67,117,152,104,178,208,225,123,131,236,59,240,136,18,55,79,168,12,218,2,32,76,68,59,125,99,133,74,11,232,70,157,116,68,151,70,39,187,132,190,110,245,214,29,179,198,182,24,133,137,177,187,142
38
]
39
}
40
}
41
}
42
]
43
}
44
}
45
},
46
"id": "1"
47
}
Copied!

utxos

Get the unspent transaction outputs of the node. This shows how many UTXOs are available for your node to spend or collateralize.
Docker
Binary
Cargo
1
docker exec witnet_node witnet node utxos
Copied!
1
witnet node utxos
Copied!
1
cargo run -- node utxos
Copied!
The output includes information about:
  • Total number of utxos
  • Total number of utxos bigger than collateral minimum
  • Total number of utxos older than collateral coinage
The flag --long can be added to the command to get a detailed list of the UTXOs and whether each of them is spendable or collateralizable at this time.