Difference between revisions of "NodeCore CommandLine"

From VeriBlock Wiki
Jump to: navigation, search
(Commands: Connected)
(getpop)
 
(47 intermediate revisions by 2 users not shown)
Line 5: Line 5:
 
== Overview ==
 
== Overview ==
  
The NodeCore CommandLine can access an instance of NodeCore
+
The NodeCore CommandLine (i.e. NC_CLI) can access an instance of NodeCore.
 +
 
 +
To run the NC_CLI, click on the nodecore-cli.bat (for windows) or nodecore-cli (for linux/mac).
 +
 
 +
Initially NC_CLI is not connected, so run the connect command to connect to a local instance (this will require running NodeCore (see: [[HowTo_run_NodeCore]]):
 +
 
 +
<pre>
 +
connect 127.0.0.1:10501
 +
</pre>
 +
 
 +
One can also auto-connect by passing the host:port via the command line, for example in windows:
 +
<pre>
 +
nodecore-cli.bat -connect 127.0.0.1:10501
 +
</pre>
 +
 
 +
=== Script with command file ===
 +
 
 +
Given an input.txt file, this will read each line of the input file as a command:
 +
 
 +
<pre>
 +
connect 127.0.0.1:10501
 +
getinfo
 +
quit
 +
</pre>
 +
 
 +
LINUX
 +
 
 +
<pre>
 +
#using pipe | instead of input redirection <
 +
cat input.txt | ./nodecore-cli
 +
</pre>
 +
 
 +
WINDOWS
 +
<pre>
 +
#from powershell
 +
./nodecore-cli < input.txt
 +
</pre>
 +
 
 +
=== Write output to file ===
 +
 
 +
Add the -o <myFile> to write the output to a JSON file:
 +
 
 +
<pre>
 +
getinfo -o myData.json
 +
</pre>
  
 
== Commands: Not Connected ==
 
== Commands: Not Connected ==
Line 31: Line 75:
 
<pre>
 
<pre>
 
#connect to an instance
 
#connect to an instance
connect 78.46.106.162:10500
+
connect 77.46.106.162:10500
  
 
</pre>
 
</pre>
Line 61: Line 105:
 
== Commands: Connected ==
 
== Commands: Connected ==
  
Most often the command line will be connected to a NodeCore instance, as that is its point.
+
Once the CLI is connected to a NodeCore instance, then there are many other commands that can be run.
 +
 
 +
 
 +
=== addallowed ===
 +
 
 +
Adds an IP to the whitelist. See: [[NodeCore_Networking]]. See command [[NodeCore_CommandLine#clearallowed]]
 +
 
 +
Syntax
 +
<pre>
 +
addallowed <address>
 +
</pre>
 +
 
 +
Example
  
 +
<pre>
 +
# input
 +
addallowed 33.33.33.33
  
TODO --> add in these commands
+
# This will update [[nodecore.properties]] file:
 +
# rpc.whitelist.addresses=33.33.33.33
  
*~getblocktimes [historyLength] --> BUG, not returning anything
+
#output
*~getpendingtransactionsreadable --> same output as getpendingtransactions
+
rpc (127.0.0.1:10500) > {
*getpop
+
  "payload": {},
*~getrawblockfromhash <blockHash> [searchLength] --> get ERROR: [V800] Remote service call failure io.grpc.StatusRuntimeException: UNAVAILABLE
+
  "success": true,
*~getrawblockfromindex <blockIndex>
+
  "messages": []
*~getrawtransaction <txId> [searchLength]
+
}
*~gettransaction <txId> [searchLength]
 
*settxfee <transactionFee>
 
*submitblock <rawBlock>
 
*submitpop <endorsedBlockHeader> <bitcoinTransaction> <bitcoinMerklePathToRoot> <bitcoinBlockHeader> [address]
 
*submitttx <rawTransaction>
 
  
Note, these sets of commands are currently identical, but both commands (in both sets) will change, so not adding them yet:
+
</pre>
*getrawtransaction vs. gettransaction
 
*getrawblockfromindex vs. getblock
 
  
 
=== addnode ===
 
=== addnode ===
  
Add a peer node to the local configuration and connect
+
Add a peer node to the local configuration and connect. After adding a node, you should see it when running getpeerinfo,
  
 
Syntax
 
Syntax
Line 95: Line 148:
 
<pre>
 
<pre>
 
# input
 
# input
addnode 94.130.33.180:10500
+
addnode 93.130.33.180:7501
  
 
#output (also run getpeerinfo to see the node added)
 
#output (also run getpeerinfo to see the node added)
Line 105: Line 158:
 
</pre>
 
</pre>
  
 +
=== backupwallet ===
 +
 +
Backup the wallet of the NodeCore instance to the given folder. Copies multiple wallet-related files. Takes either a folder, or a specific file.
 +
 +
See: [[NodeCore_CommandLine#importwallet]], [[NodeCore_File_Structure]]
 +
 +
Syntax
 +
<pre>
 +
backupwallet <targetLocation>
 +
</pre>
 +
 +
Example: Folder
 +
 +
<pre>
 +
# input A
 +
backupwallet C:\Temp\myFolder
 +
 +
#copies
 +
# wallet_backup.dat
 +
# walletconfig_backup.dat
 +
 +
</pre>
 +
 +
Example: File
 +
 +
<pre>
 +
# input A
 +
backupwallet C:\Temp\myFolder\wallet.dat
 +
 +
#copies
 +
# wallet.dat
 +
# walletconfig.dat
 +
 +
</pre>
 +
 +
=== clearallowed ===
 +
 +
Clears the list of allowed addresses.  See command [[NodeCore_CommandLine#addallowed]].
 +
 +
Syntax
 +
<pre>
 +
clearallowed
 +
</pre>
 +
 +
Example
 +
 +
<pre>
 +
# input
 +
clearallowed
 +
 +
# This will update [[nodecore.properties]] file:
 +
# rpc.whitelist.addresses=
 +
 +
#output
 +
rpc (127.0.0.1:10500) > {
 +
  "payload": {},
 +
  "success": true,
 +
  "messages": []
 +
}
 +
 +
</pre>
 +
 +
=== clearpoolbans ===
 +
 +
<pre>
 +
clearpoolbans
 +
Clears the list of pool connections that have been banned
 +
</pre>
 +
 +
=== decryptwallet ===
 +
 +
See: [[Wallet_Encryption]]
 +
 +
<pre>
 +
decryptwallet
 +
Decrypts the wallet loaded in NodeCore
 +
</pre>
  
 
=== disconnect ===
 
=== disconnect ===
  
 
Simply disconnects from the current NodeCore instance
 
Simply disconnects from the current NodeCore instance
 +
 +
=== drainaddress ===
 +
 +
<pre>
 +
drainaddress <sourceAddress> <destinationAddress>
 +
Fully drain all VBK from one address to another. The result of sourceAddress will be zero.
 +
</pre>
 +
 +
=== dumpprivatekey ===
 +
 +
See also: importprivatekey
 +
 +
<pre>
 +
dumpprivatekey <address>
 +
Gets private key for an address
 +
</pre>
 +
 +
=== encryptwallet ===
 +
 +
See: [[Wallet_Encryption]]
 +
 +
<pre>
 +
encryptwallet
 +
Encrypts the wallet loaded in NodeCore with a passphrase
 +
</pre>
 +
 +
=== generatemultisigaddress ===
 +
 +
<pre>
 +
generatemultisigaddress <csvaddresses> <signatureThreshold>
 +
(Generates a multisig address from the provided standard addresses)
 +
</pre>
  
 
=== getblocktemplate ===
 
=== getblocktemplate ===
Line 124: Line 286:
  
 
#returns info for a specific command
 
#returns info for a specific command
rpc (78.46.106.162:10500) > {
+
rpc (77.46.106.162:10500) > {
 
   "payload": {
 
   "payload": {
 
     "target": -7236281451971613363,
 
     "target": -7236281451971613363,
Line 195: Line 357:
  
 
#output
 
#output
rpc (78.46.106.162:10500) > {
+
rpc (77.46.106.162:10500) > {
 
   "payload": {
 
   "payload": {
 
     "confirmed": [
 
     "confirmed": [
Line 222: Line 384:
  
 
#output
 
#output
rpc (78.46.106.162:10500) > {
+
rpc (77.46.106.162:10500) > {
 
   "payload": {
 
   "payload": {
 
     "confirmed": [
 
     "confirmed": [
Line 251: Line 413:
  
  
=== getblock ===
+
=== getbalanceunlockschedule ===
 +
 
 +
Shows the schedule for unlocking coins.
 +
 
 +
<pre>
 +
getbalanceunlockschedule
 +
[
 +
  {
 +
    "address": "V7t4RfqkdJedmH3DG8EPdF6tnG6jdJ",
 +
    "totalBalance": "733.74304500",
 +
    "unlockedBalance": "733.74304500",
 +
    "lockedBalance": "0.00000000",
 +
    "schedule": []
 +
  }
 +
]
 +
</pre>
 +
 
 +
=== getblockfromindex ===
  
 
Returns the block for the specified block number
 
Returns the block for the specified block number
Line 257: Line 436:
 
Syntax
 
Syntax
 
<pre>
 
<pre>
getblock <blockNumber>
+
getblockfromindex <blockNumber>
 
</pre>
 
</pre>
  
Line 263: Line 442:
 
<pre>
 
<pre>
 
#get info for block 30000
 
#get info for block 30000
getblock 30000
+
getblockfromindex 30000
  
 
#returns info for a specific command
 
#returns info for a specific command
rpc (78.46.106.162:10500) > {
+
rpc (77.46.106.162:10500) > {
 
   "payload": {
 
   "payload": {
 
     "blocks": [
 
     "blocks": [
Line 309: Line 488:
  
 
#returns info for a specific command
 
#returns info for a specific command
rpc (78.46.106.162:10500) > {
+
rpc (77.46.106.162:10500) > {
 
   "payload": {
 
   "payload": {
 
     "best_length": 37530,
 
     "best_length": 37530,
Line 335: Line 514:
  
 
#returns info for a specific command
 
#returns info for a specific command
rpc (78.46.106.162:10500) > {
+
rpc (77.46.106.162:10500) > {
 
   "payload": {
 
   "payload": {
 
     "blocks": [
 
     "blocks": [
Line 362: Line 541:
  
 
</pre>
 
</pre>
 +
 +
=== getdiagnosticinfo ===
 +
 +
<pre>
 +
Returns diagnostic info about the NodeCore instance
 +
</pre>
 +
  
 
=== gethistory ===
 
=== gethistory ===
Line 378: Line 564:
  
 
#returns info for a specific command
 
#returns info for a specific command
rpc (78.46.106.162:10500) > {
+
rpc (77.46.106.162:10500) > {
 
   "payload": [
 
   "payload": [
 
     {
 
     {
Line 461: Line 647:
  
 
#returns info for a specific command
 
#returns info for a specific command
rpc (78.46.106.162:10500) > {
+
rpc (77.46.106.162:10500) > {
 
   "payload": {
 
   "payload": {
 
     "default_address": {
 
     "default_address": {
Line 469: Line 655:
 
     "estimated_hash_rate": 6,
 
     "estimated_hash_rate": 6,
 
     "number_of_blocks": 37532,
 
     "number_of_blocks": 37532,
     "transaction_fee": 121,
+
     "transaction_fee": "0.00000801",
 
     "last_block": {
 
     "last_block": {
 
       "coinbaseReward": 1000000000,
 
       "coinbaseReward": 1000000000,
Line 529: Line 715:
  
 
#output
 
#output
rpc (78.46.106.162:10500) > {
+
rpc (77.46.106.162:10500) > {
 
   "payload": "VCGeXVDjH9EHv8zkGmh6VwL5mHXfpm",
 
   "payload": "VCGeXVDjH9EHv8zkGmh6VwL5mHXfpm",
 
   "success": true,
 
   "success": true,
Line 535: Line 721:
 
}
 
}
 
</pre>
 
</pre>
 +
 +
Create multiple addresses at once
 +
 +
<pre>
 +
getnewaddress [count]
 +
Gets {count} new address from the wallet (default: 1)
 +
</pre>
 +
  
 
=== getpeerinfo ===
 
=== getpeerinfo ===
Line 550: Line 744:
 
     "configured_endpoints": [
 
     "configured_endpoints": [
 
       {
 
       {
         "address": "94.130.33.180",
+
         "address": "93.130.33.180",
 
         "port": 6500
 
         "port": 6500
 
       },
 
       },
 
       {
 
       {
         "address": "78.46.106.162",
+
         "address": "77.46.106.162",
 
         "port": 6500
 
         "port": 6500
 
       }
 
       }
Line 560: Line 754:
 
     "connected": [
 
     "connected": [
 
       {
 
       {
         "address": "78.46.106.162",
+
         "address": "77.46.106.162",
 
         "port": 6500,
 
         "port": 6500,
 
         "application": "VeriBlock NodeCore v0.1.0-rc.28",
 
         "application": "VeriBlock NodeCore v0.1.0-rc.28",
Line 610: Line 804:
  
 
#returns info for a specific command
 
#returns info for a specific command
rpc (78.46.106.162:10500) > {
+
rpc (77.46.106.162:10500) > {
 
   "payload": [
 
   "payload": [
 
     {
 
     {
Line 636: Line 830:
 
}
 
}
  
 +
</pre>
 +
 +
=== getpoolinfo ===
 +
 +
Shows pool info if running a pool.
 +
 +
<pre>
 +
getpoolinfo
 +
{
 +
  "running": true,
 +
  "configuration": {
 +
    "solo": false,
 +
    "type": "GPU",
 +
    "pool_target": "00000000ffffffffffffffffffffffffffffffffffffffff",
 +
    "pool_address": "V4upDbv4ne6f88Pr8h5oHdok9Ezzzz",
 +
    "operator_address": "V4cP4AfoSomxYHfnCDN8tuWFstrgdw",
 +
    "operator_fee": 0.01,
 +
    "coinbase_comment": "myPoolCommentHere"
 +
  },
 +
  "stats": {
 +
    "current_round": 4536,
 +
    "mining_block_number": 55855,
 +
    "last_block_number": 55854,
 +
    "recent_hash_rate": "772.66 GH/s"
 +
  }
 +
}
 +
</pre>
 +
 +
 +
=== getpop ===
 +
 +
<pre>
 +
getpop [block]
 +
Gets the data VeriBlock wants Proof-of-Proof published to Bitcoin
 +
</pre>
 +
 +
=== getpopendorsementsinfo ===
 +
 +
Returns transaction history for specified address or the default if not.
 +
 +
<pre>
 +
getpopendorsementsinfo <address> [searchLength]
 +
</pre>
 +
 +
Example
 +
 +
<pre>
 +
# input
 +
getpopendorsementsinfo V34RwWk5CEp5uE8L4SSpJWcwN29dKu
 +
 +
#output
 +
  "payload": [
 +
    {
 +
      "miner_address": "V34RwWk5CEp5uE8L4SSpJWcwN29dKu",
 +
      "endorsed_veriblock_block_hash": "0000000330089FE0A8335AEF138265D7F9A7E9EFC251001A",
 +
      "contained_in_veriblock_block_hash": "00000003028BD9FD9A3FD188BF2D70A4B99FC8BB43EC9786",
 +
      "veriblock_transaction_id": "E9E18AFB9212EC873B5D1E7A6AFE7727AF8D5FCC07C9CAA4DD39662C5C8EB1D2",
 +
      "bitcoin_transaction": "0100000001497856D96BCC107D844DE83F711A30101AAD1BF2EF68213CAAE72225C8E65A08000000006B4830450221009AD5105F19A1A03D48E69860659BEBAF456DF4A80D0A047C8A0F67C020A230C502203F6EFC440B2BC177A6CA91914E8CD881D4D60E496AC22AFE6704E9DA1DA9480D0121025EA042772B22B46E924C1EAFF3D24F369501D615ECF4063C2C6C97C820C107C7FFFFFFFF0208413900000000001976A914E9C0E8D5D4C74F427A4836C8E6E3A582E761958588AC0000000000000000536A4C50000000010000000019E1492ECF1943299294D1B72AB25E56AD2A5BDA0C28A9D3E1299F501DA61E9FE2081CE3DEAD8DFFDD6041125ADA3E9A044AE83904116460217C8C3562659235A15C85F155CA620C00000000",
 +
      "bitcoin_transaction_id": "1CA7C540AF39C6D11F40569AA549AA716B12AAF052A57D521ED41049C12A97B7",
 +
      "bitcoin_block_header": "00000020605C4627C7168F21B41CECF20DC8C4AC0C7F32C8B9CF186ACF00000000000000C232B26F9AFCCFDDCA7819A9FBF7B146FEC2B17E88968ADD318CD74279C878138540DA5A9B03031A4CDDF632",
 +
      "bitcoin_block_header_hash": "0000000000000107EB54ED752020E978BBAC7504659EC1745A61A1905E40B66F",
 +
      "reward": "28.00000000",
 +
      "finalized": true
 +
    },
 +
 +
</pre>
 +
 +
=== getprotectedchildren ===
 +
 +
Returns the children protected by PoP transactions in a particular VeriBlock block identified by the provided block hash.
 +
 +
The paradigm is "A parent protects children"
 +
 +
See: [[NodeCore_CommandLine#getprotectingparents]]
 +
 +
Syntax
 +
<pre>
 +
getprotectedchildren <blockhash> [searchLength]
 +
</pre>
 +
 +
Example
 +
 +
<pre>
 +
# input
 +
getprotectedchildren 00000001176E53EA4CB9872910F9E567C6DC4B09C01DBB6B 10000
 +
 +
#output
 +
  "payload": [
 +
    {
 +
      "miner_address": "V34RwWk5CEp5uE8L4SSpJWcwN29dKu",
 +
      "endorsed_veriblock_block_hash": "00000000EBDFF3806FEFC22799E75FD36C3935F7FA36AA53",
 +
      "contained_in_veriblock_block_hash": "00000001176E53EA4CB9872910F9E567C6DC4B09C01DBB6B",
 +
      "veriblock_transaction_id": "E25E8ECFFF3A3DB843167C066AC052AE42BE44EB528934EEE6ED8CF5219A17C3",
 +
      "bitcoin_transaction": "020000000129F1343830462940EC71F9A041FA3FF3FCBC87360AD891F1F93FDFC19E030E63010000006A473044022017ACFF98378B2865981C9E2D4D79AF27005B4FE4843EC7811BAEC12F0C40189602203087F1B456E6A7E794AE67A369D3214CEEC2AE0923AE9D73084FC7B25C474BBF0121029787960F4CE284F40F1C8953E2F8DDFC5E664088580588153E5FC7513AC88C7DFFFFFFFF020000000000000000536A4C500000000100000002666994A2AFEF035F53D0048991648A8304839BF07B1C3A9F5CE2071B1EE66E039F8E3477A2FD940FC87CE7A45ACE5178045F55BE585CA12F217C8C3562659235A15C85F155CA620CC0270900000000001976A914ABA57562278E5D543E33A20E5AE1B8427B51AD0988AC00000000",
 +
      "bitcoin_transaction_id": "840AD8CB3D5A64979220FA9CE9BE302FF644D294E0186CD14C876BE7B54C87E8",
 +
      "bitcoin_block_header": "00000020F0055E0D2B1D78409650AE4C23D9501EBDF3AA00D03B50014D0000000000000089ABCEA79221A9BCFF8BA8DF17719C23AB399D6B171CC5A2199878D76AB859C6B552CE5A9B03031ADD59C1A0",
 +
      "bitcoin_block_header_hash": "000000000000017CC389D86556814B198A4B9673E5D55CC846A6853B0C283279",
 +
      "reward": "28.00000000",
 +
      "finalized": true
 +
</pre>
 +
 +
=== getprotectingparents ===
 +
 +
Returns the pop endorsement information of parents protecting the provided block hash.
 +
 +
The paradigm is "A child can be protected by mulitple parents"
 +
 +
See: [[NodeCore_CommandLine#getprotectedchildren]]
 +
 +
Syntax
 +
<pre>
 +
getprotectingparents <blockhash> [searchLength]
 +
</pre>
 +
 +
Example
 +
 +
<pre>
 +
# input
 +
getprotectingparents 00000000EBDFF3806FEFC22799E75FD36C3935F7FA36AA53 10000
 +
 +
#output
 +
  "payload": [
 +
    {
 +
      "miner_address": "V34RwWk5CEp5uE8L4SSpJWcwN29dKu",
 +
      "endorsed_veriblock_block_hash": "00000000EBDFF3806FEFC22799E75FD36C3935F7FA36AA53",
 +
      "contained_in_veriblock_block_hash": "00000001176E53EA4CB9872910F9E567C6DC4B09C01DBB6B",
 +
      "veriblock_transaction_id": "E25E8ECFFF3A3DB843167C066AC052AE42BE44EB528934EEE6ED8CF5219A17C3",
 +
      "bitcoin_transaction": "020000000129F1343830462940EC71F9A041FA3FF3FCBC87360AD891F1F93FDFC19E030E63010000006A473044022017ACFF98378B2865981C9E2D4D79AF27005B4FE4843EC7811BAEC12F0C40189602203087F1B456E6A7E794AE67A369D3214CEEC2AE0923AE9D73084FC7B25C474BBF0121029787960F4CE284F40F1C8953E2F8DDFC5E664088580588153E5FC7513AC88C7DFFFFFFFF020000000000000000536A4C500000000100000002666994A2AFEF035F53D0048991648A8304839BF07B1C3A9F5CE2071B1EE66E039F8E3477A2FD940FC87CE7A45ACE5178045F55BE585CA12F217C8C3562659235A15C85F155CA620CC0270900000000001976A914ABA57562278E5D543E33A20E5AE1B8427B51AD0988AC00000000",
 +
      "bitcoin_transaction_id": "840AD8CB3D5A64979220FA9CE9BE302FF644D294E0186CD14C876BE7B54C87E8",
 +
      "bitcoin_block_header": "00000020F0055E0D2B1D78409650AE4C23D9501EBDF3AA00D03B50014D0000000000000089ABCEA79221A9BCFF8BA8DF17719C23AB399D6B171CC5A2199878D76AB859C6B552CE5A9B03031ADD59C1A0",
 +
      "bitcoin_block_header_hash": "000000000000017CC389D86556814B198A4B9673E5D55CC846A6853B0C283279",
 +
      "reward": "28.00000000",
 +
      "finalized": true
 +
    },
 +
 +
</pre>
 +
 +
=== getstateinfo ===
 +
 +
<pre>
 +
getstateinfo
 +
Returns blockchain, operating, and network state information
 +
</pre>
 +
 +
Example:
 +
 +
<pre>
 +
getstateinfo
 +
{
 +
  "blockchain_state": "LOADED",
 +
  "operating_state": "RUNNING",
 +
  "network_state": "CONNECTED",
 +
  "connected_peer_count": 8,
 +
  "current_sync_peer": "",
 +
  "network_height": 148816,
 +
  "local_blockchain_height": 148816,
 +
  "network_version": "TestNet",
 +
  "data_directory": "",
 +
  "program_version": "0.3.8",
 +
  "nodecore_starttime": 1541471711,
 +
  "wallet_cache_sync_height": 148816
 +
}
 +
</pre>
 +
 +
 +
 +
=== gettransaction ===
 +
 +
<pre>
 +
gettransaction <txId> [searchLength]
 +
Gets information regarding provided TxID
 +
</pre>
 +
 +
=== getwallettransactions ===
 +
 +
This requires the wallet cache be up to date (run getstateinfo to see how far along wallet cache is caught up). If you just imported a new wallet, it may take some time to rebuild that cache.
 +
 +
<pre>
 +
getwallettransactions <address> [type]
 +
Writes transaction history for an address to a local file. This could take a while.
 +
</pre>
 +
 +
See also: [[NodeCore_CommandLine#refreshwalletcache]] --> rebuilds the cache
 +
 +
Example:
 +
 +
<pre>
 +
getwallettransactions V4m6JbAs8VaEa3wwemJPgsPRY8ETdk
 +
Append to file: C:\outputs\V4m6JbAs8VaEa3wwemJPgsPRY8ETdk.csv
 +
Got page 1 with 100 rows, appended to file
 +
Got page 2 with 93 rows, appended to file
 +
"Wrote 193 wallet transactions to file C:\\outputs\V4m6JbAs8VaEa3wwemJPgsPRY8ETdk.csv"
 +
</pre>
 +
 +
=== importprivatekey ===
 +
 +
See also: dumpprivatekey
 +
 +
<pre>
 +
importprivatekey <privateKey>
 +
Imports the provided private key into NodeCore
 +
</pre>
 +
 +
=== importwallet ===
 +
 +
Import a NodeCore wallet backup from the provided location. Expects an exact wallet file.
 +
 +
Run getbalance before and after the importwallet command to see the impact. Note that importwallet merges the addresses into the existing wallet, it does NOT overwrite them. If nodecore has wallet with address A, and one runs the importwallet command with a wallet.dat file containing B and C, then the final nodecore addresses from getbalance will show A, B, and C.
 +
 +
See: [[NodeCore_CommandLine#backupwallet]], [[NodeCore_File_Structure]]
 +
 +
Syntax
 +
<pre>
 +
importwallet <sourceLocation>
 +
</pre>
 +
 +
Example
 +
 +
<pre>
 +
# input
 +
importwallet C:\MyBackups\wallet_backup.dat
 +
 +
#output
 +
rpc (127.0.0.1:10500) > {
 +
  "payload": {},
 +
  "success": true,
 +
  "messages": []
 +
}
 +
</pre>
 +
 +
=== listbannedminers ===
 +
 +
<pre>
 +
listbannedminers
 +
Returns a list of UCP clients that are currently banned
 +
</pre>
 +
 +
=== listallowed ===
 +
 +
Returns a list of allowed whitelist addresses
 +
 +
<pre>
 +
listallowed
 +
</pre>
 +
 +
=== lockwallet ===
 +
 +
See: [[Wallet_Encryption]]
 +
 +
<pre>
 +
lockwallet
 +
Disables the temporary unlock on the NodeCore wallet
 +
</pre>
 +
 +
=== makeunsignedmultisigtx ===
 +
 +
<pre>
 +
makeunsignedmultisigtx <sourceAddress> <amount> <destinationAddress> [transactionFee] [signatureIndex]
 +
(Generates an unsigned multisig transaction)
 +
</pre>
 +
 +
=== refreshwalletcache ===
 +
 +
See also: [[NodeCore_CommandLine#getwallettransactions]]
 +
 +
<pre>
 +
refreshwalletcache
 +
Rescans the blockchain for transactions belonging to imported wallets
 +
</pre>
 +
 +
=== removeallowed ===
 +
 +
<pre>
 +
removeallowed <address>
 +
Remove allowed addresses
 
</pre>
 
</pre>
  
Line 651: Line 1,120:
 
<pre>
 
<pre>
 
# input
 
# input
removenode 94.130.33.180:10500
+
removenode 93.130.33.180:10500
  
 
#output (also run getpeerinfo to see the node removed)
 
#output (also run getpeerinfo to see the node removed)
Line 661: Line 1,130:
 
</pre>
 
</pre>
  
 +
=== restartpoolwebserver ===
 +
 +
<pre>
 +
restartpoolwebserver
 +
Restarts the built-in pool web server
 +
</pre>
  
 
=== send ===
 
=== send ===
  
 
Send coins to the specified address. Will automatically pick a source address that has sufficient coins.
 
Send coins to the specified address. Will automatically pick a source address that has sufficient coins.
 +
 +
Can return multiple Transactions if pulling from multiple addresses.
  
 
Syntax
 
Syntax
 
<pre>
 
<pre>
send <amount> <destinationAddress>
+
send <amount> <destinationAddress> [sourceAddress]
 
</pre>
 
</pre>
  
Line 675: Line 1,152:
 
#send 1000 coins to address "VE2TkS4er4JeZJRnPkSKUdSeaAew5E"
 
#send 1000 coins to address "VE2TkS4er4JeZJRnPkSKUdSeaAew5E"
 
send 1000 VE2TkS4er4JeZJRnPkSKUdSeaAew5E
 
send 1000 VE2TkS4er4JeZJRnPkSKUdSeaAew5E
 +
 +
#returns the VBK transaction ID
 +
rpc (127.0.0.1:10501) > {
 +
  "payload": {
 +
    "txids": [
 +
      "76796500882C927FF057BDA528C94BE883A06A1B6430655067ACF51F09A6E376",
 +
      "79AC6FFE176F068BBB0F5B4F79A2FD1AA92925CA9310FEC58236E220804B58DF"
 +
    ]
 +
  },
 +
  "success": true,
 +
  "messages": []
 +
}
 +
 +
</pre>
 +
 +
=== setdefaultaddress ===
 +
 +
Sets a new default address. This is what will show up when running getinfo
 +
 +
<pre>
 +
setdefaultaddress <address>
 +
(Sets the default address of a NodeCore instance)
 +
</pre>
 +
 +
=== settxfee ===
 +
 +
Sets the transaction fee per byte. You can view the transaction fee by running getinfo
 +
 +
Syntax
 +
<pre>
 +
settxfee <transactionFee>
 +
</pre>
 +
 +
Examples:
 +
<pre>
 +
#Set the transaction fee
 +
settxfee 0.00001000
  
 
#returns info for a specific command
 
#returns info for a specific command
rpc (78.46.106.162:10500) > {
+
rpc (127.0.0.1:10500) > {
 
   "payload": {},
 
   "payload": {},
 
   "success": true,
 
   "success": true,
Line 684: Line 1,198:
  
 
</pre>
 
</pre>
 +
 +
=== signhexmessage ===
 +
 +
<pre>
 +
signhexmessage <address> <message>
 +
(Signs a hex-encoded message with the addresses private key)
 +
</pre>
 +
  
 
=== sigindex ===
 
=== sigindex ===
Line 748: Line 1,270:
 
Syntax
 
Syntax
 
<pre>
 
<pre>
startpool
+
startpool <type>
 +
(Starts the built-in pool service in NodeCore)
 
</pre>
 
</pre>
  
Line 754: Line 1,277:
 
<pre>
 
<pre>
 
#start the UCP pool on an instance
 
#start the UCP pool on an instance
startpool
+
 
 +
#CPU
 +
startpool CPU
 +
 
 +
#GPU
 +
startpool GPU
  
 
#returns info for a specific command
 
#returns info for a specific command
Line 764: Line 1,292:
  
 
</pre>
 
</pre>
 +
 +
=== startsolopool ===
 +
 +
<pre>
 +
startsolopool [address]
 +
Starts the built-in pool service in NodeCore in solo mode
 +
</pre>
 +
 +
=== stopnodecore ===
 +
 +
Gracefully stops the connected instance of NodeCore. Very useful for remote instances.
 +
 +
An alternative is to CTRL+C NodeCore.
  
 
=== stoppool ===
 
=== stoppool ===
Line 785: Line 1,326:
 
}
 
}
  
 +
</pre>
 +
 +
=== submitmultisigtx ===
 +
 +
[[How_to_Submit_Multisig_Tx]]
 +
 +
 +
=== troubleshootpopbyaddress ===
 +
 +
<pre>
 +
Command: Troubleshoot PoP By Address
 +
 +
troubleshootpopbyaddress <onlyFailures> [searchLength] [address]
 +
(Returns a troubleshooting report of the PoP transaction(s) matching the provided address in the specified history)
 +
 +
Example:
 +
troubleshootpopbyaddress true 1000 VHPgy7kUNtkKFLdx3CyB6rAyHAhd7n
 +
 +
</pre>
 +
 +
=== unlockwallet===
 +
 +
See: [[Wallet_Encryption]]
 +
 +
<pre>
 +
Command: Unlock Wallet
 +
 +
unlockwallet
 +
Temporarily unlocks the NodeCore wallet
 
</pre>
 
</pre>
  
Line 802: Line 1,372:
  
 
#returns info for a specific command
 
#returns info for a specific command
rpc (78.46.106.162:10500) > {
+
rpc (77.46.106.162:10500) > {
 
   "payload": {
 
   "payload": {
 
     "address": "VazUQm9TaPmbhTWEi6FYUUPp28Eynq",
 
     "address": "VazUQm9TaPmbhTWEi6FYUUPp28Eynq",

Latest revision as of 11:37, 17 April 2019

See: Main_Page

Overview

The NodeCore CommandLine (i.e. NC_CLI) can access an instance of NodeCore.

To run the NC_CLI, click on the nodecore-cli.bat (for windows) or nodecore-cli (for linux/mac).

Initially NC_CLI is not connected, so run the connect command to connect to a local instance (this will require running NodeCore (see: HowTo_run_NodeCore):

connect 127.0.0.1:10501

One can also auto-connect by passing the host:port via the command line, for example in windows:

nodecore-cli.bat -connect 127.0.0.1:10501

Script with command file

Given an input.txt file, this will read each line of the input file as a command:

connect 127.0.0.1:10501
getinfo
quit

LINUX

#using pipe | instead of input redirection <
cat input.txt | ./nodecore-cli

WINDOWS

#from powershell
./nodecore-cli < input.txt

Write output to file

Add the -o <myFile> to write the output to a JSON file:

getinfo -o myData.json

Commands: Not Connected

When first started, the command line is not connected.

clear

Standard command, clears the screen

connect

Connects to an instance of nodecore via gRPC, on port 10500.

If connected to a node, then many other commands are available.

Syntax:

connect <peer>

Examples:

#connect to an instance
connect 77.46.106.162:10500

help

Standard help command.

Syntax:

help [command]

Examples:

#returns list of available commands
help

#returns info for a specific command
help connect

quit

Standard quit command, exits the console

Commands: Connected

Once the CLI is connected to a NodeCore instance, then there are many other commands that can be run.


addallowed

Adds an IP to the whitelist. See: NodeCore_Networking. See command NodeCore_CommandLine#clearallowed

Syntax

addallowed <address>

Example

# input
addallowed 33.33.33.33

# This will update [[nodecore.properties]] file:
# rpc.whitelist.addresses=33.33.33.33

#output
rpc (127.0.0.1:10500) > {
  "payload": {},
  "success": true,
  "messages": []
}

addnode

Add a peer node to the local configuration and connect. After adding a node, you should see it when running getpeerinfo,

Syntax

addnode <peer>

Example

# input
addnode 93.130.33.180:7501

#output (also run getpeerinfo to see the node added)
rpc (127.0.0.1:10500) > {
  "payload": {},
  "success": true,
  "messages": []
}

backupwallet

Backup the wallet of the NodeCore instance to the given folder. Copies multiple wallet-related files. Takes either a folder, or a specific file.

See: NodeCore_CommandLine#importwallet, NodeCore_File_Structure

Syntax

backupwallet <targetLocation>

Example: Folder

# input A
backupwallet C:\Temp\myFolder

#copies 
# wallet_backup.dat
# walletconfig_backup.dat

Example: File

# input A
backupwallet C:\Temp\myFolder\wallet.dat

#copies 
# wallet.dat 
# walletconfig.dat

clearallowed

Clears the list of allowed addresses. See command NodeCore_CommandLine#addallowed.

Syntax

clearallowed

Example

# input
clearallowed

# This will update [[nodecore.properties]] file:
# rpc.whitelist.addresses=

#output
rpc (127.0.0.1:10500) > {
  "payload": {},
  "success": true,
  "messages": []
}

clearpoolbans

clearpoolbans
Clears the list of pool connections that have been banned

decryptwallet

See: Wallet_Encryption

decryptwallet
Decrypts the wallet loaded in NodeCore

disconnect

Simply disconnects from the current NodeCore instance

drainaddress

drainaddress <sourceAddress> <destinationAddress>
Fully drain all VBK from one address to another. The result of sourceAddress will be zero.

dumpprivatekey

See also: importprivatekey

dumpprivatekey <address>
Gets private key for an address

encryptwallet

See: Wallet_Encryption

encryptwallet
Encrypts the wallet loaded in NodeCore with a passphrase

generatemultisigaddress

generatemultisigaddress <csvaddresses> <signatureThreshold>
(Generates a multisig address from the provided standard addresses)

getblocktemplate

Returns a block template along with candidate transactions

Syntax

getblocktemplate [mode] [capabilities]

Examples:

getblocktemplate

#returns info for a specific command
rpc (77.46.106.162:10500) > {
  "payload": {
    "target": -7236281451971613363,
    "size_limit": 1232896,
    "block_height": 37625,
    "coinbase_value": 500000000000,
    "minimum_timestamp": 1516502622,
    "current_timestamp": 1516503768,
    "previous_block_hash": "00000002F22575136B63F90BBAB423CC1241C0ED8EA6FB40",
    "mutable": [
      "timestamp",
      "transactions"
    ],
    "transactions": [
      {
        "fee": 121,
        "weight": 221,
        "required": true,
        "transaction_id": "2EB013AC6B62D192FD0EA3D8DBB757BB8D4F6008BC3A17846A42CBB629F27D58",
        "transaction": {
          "type": "signed",
          "signed": {
            "signature": "304402202F8DDB95B57F536C5317B19C63BDBF41314BBEB9C8A02484DCF09C9069FB2F6F022077902BDC9CDE23BA9FFD6256E9DF57BB37D9D21EF6D793F8B2A2959789A60110",
            "public_key": "3056301006072A8648CE3D020106052B8104000A034200042704DEA2E9BDB74133E298C3AAD8E76588E48AED614674869380B959BB49DF69E8DAA1B7EF4E14240952C2BB082C89FB54A528D6502F8934E1BDA95F651F8D29",
            "signature_index": 27,
            "transaction": {
              "size": 56,
              "txid": "2EB013AC6B62D192FD0EA3D8DBB757BB8D4F6008BC3A17846A42CBB629F27D58",
              "data": "",
              "type": "standard",
              "fee": 121,
              "source_amount": 1121,
              "merkle_path": "",
              "source_address": "VazUQm9TaPmbhTWEi6FYUUPp28Eynq",
              "bitcoin_transaction": "",
              "bitcoin_block_header": "",
              "endorsed_block_header": "",
              "outputs": [
                {
                  "address": "VEP6ZjXby6Ska22bb4fcrirL4Dj2Vo",
                  "amount": 1000
                }
              ]
            }
          }
        },
        "depends": []
      }
    ]
  },
  "success": true,
  "messages": []
}


getbalance

Find the balance for a given address

Syntax

getbalance [address]

Case 1: Specific address

#input
getbalance VEYtYxYUJY3MinMa7oyC7vjdGBLrfV

#output
rpc (77.46.106.162:10500) > {
  "payload": {
    "confirmed": [
      {
        "address": "VEYtYxYUJY3MinMa7oyC7vjdGBLrfV",
        "amount": 992331
      }
    ],
    "unconfimed": [
      {
        "address": "VEYtYxYUJY3MinMa7oyC7vjdGBLrfV",
        "amount": 0
      }
    ]
  },
  "success": true,
  "messages": []
}

Case 2: All addresses

#input
getbalance

#output
rpc (77.46.106.162:10500) > {
  "payload": {
    "confirmed": [
      {
        "address": "VEYtYxYUJY3MinMa7oyC7vjdGBLrfV",
        "amount": 992331
      },
      {
        "address": "VCGeXVDjH9EHv8zkGmh6VwL5mHXfpm",
        "amount": 0
      }
    ],
    "unconfimed": [
      {
        "address": "VEYtYxYUJY3MinMa7oyC7vjdGBLrfV",
        "amount": 0
      },
      {
        "address": "VC4YViRdJuiiZw8VSMZMBaUUXBzr8v",
        "amount": 0
      }
    ]
  },
  "success": true,
  "messages": []
}


getbalanceunlockschedule

Shows the schedule for unlocking coins.

getbalanceunlockschedule
[
  {
    "address": "V7t4RfqkdJedmH3DG8EPdF6tnG6jdJ",
    "totalBalance": "733.74304500",
    "unlockedBalance": "733.74304500",
    "lockedBalance": "0.00000000",
    "schedule": []
  }
]

getblockfromindex

Returns the block for the specified block number

Syntax

getblockfromindex <blockNumber>

Examples:

#get info for block 30000
getblockfromindex 30000

#returns info for a specific command
rpc (77.46.106.162:10500) > {
  "payload": {
    "blocks": [
      {
        "coinbaseReward": 1000000000,
        "transactionFees": 0,
        "size": 0,
        "raw": "CLDqARDu+t7SBRoYAAABzlcP6/yCPKGucmMsLyg5lpSry1lAIhgAAAOgOclPMbNBFhGVm/qG/Hamtlw3HtYpRgAAAAAAAAAwhsm43/v/////AToWaVLnTYcGoeUPflsiB8rJOoy/viPRGkIk0000003815F944BD02E2AA76E69E7DFBD493D689ADE032ACaICU69wD",
        "number": 30000,
        "timestamp": 1515699566,
        "hash": "000001CE570FEBFC823CA1AE72632C2F28399694ABCB5940",
        "previous_hash": "000003A039C94F31B3411611959BFA86FC76A6B65C371ED6",
        "difficulty": 70,
        "winning_nonce": -1142020986,
        "miner_address": "VazUQm9TaPmbhTWEi6FYUUPp28Eynq",
        "ledgerHash": "D34D34D34DFCD7917DE38043D36136000EFA13AF44EC31410F8F770FAF3D003134DF6002",
        "bitcoin_block_headers": [],
        "transactions": []
      }
    ]
  },
  "success": true,
  "messages": []
}


getblockchains

Returns blockchain information

Syntax

getblockchains

Examples:

#get info about the current blockchain
getblockchains

#returns info for a specific command
rpc (77.46.106.162:10500) > {
  "payload": {
    "best_length": 37530,
    "longest_length": 37530
  },
  "success": true,
  "messages": []
}

getblockfromhash

Returns the block for the specified hash

Syntax

getblockfromhash <blockHash>

Examples:

#get block given specific hash
getblockfromhash 0000000B1F90DED765A69641F9840568839BCA0DB02EF126

#returns info for a specific command
rpc (77.46.106.162:10500) > {
  "payload": {
    "blocks": [
      {
        "coinbaseReward": 1000000000,
        "transactionFees": 0,
        "size": 0,
        "raw": "CKulAhCcxI7TBRoYAAAACx+Q3tdlppZB+YQFaIObyg2wLvEmIhgAAAAQSRpa2pkGjaMFF0g+7uedXcOynIopfQcAAAAAAAAwof3QwP//////AToWaVLnTYcGoeUPflsiB8rJOoy/viPRGkIk0000003815F944BD02E2AA76E69E7DFBD493D689ADE032ACaICU69wD",
        "number": 37547,
        "timestamp": 1516479004,
        "hash": "0000000B1F90DED765A69641F9840568839BCA0DB02EF126",
        "previous_hash": "00000010491A5ADA99068DA30517483EEEE79D5DC3B29C8A",
        "difficulty": 1917,
        "winning_nonce": -132890975,
        "miner_address": "VazUQm9TaPmbhTWEi6FYUUPp28Eynq",
        "ledgerHash": "D34D34D34DFCD7917DE38043D36136000EFA13AF44EC31410F8F770FAF3D003134DF6002",
        "bitcoin_block_headers": [],
        "transactions": []
      }
    ]
  },
  "success": true,
  "messages": []
}


getdiagnosticinfo

Returns diagnostic info about the NodeCore instance


gethistory

Returns transaction history for specified address or the default if not.

Syntax

gethistory [address]

Examples:

#Get history for a specific address
gethistory VE2TkS4er4JeZJRnPkSKUdSeaAew5E

#returns info for a specific command
rpc (77.46.106.162:10500) > {
  "payload": [
    {
      "balance": 2000,
      "blocks_mined": 0,
      "transactions": [
        {
          "type": "signed",
          "signed": {
            "signature": "3046022100E786556F3693541F6D059165903F261D8971E6DC92316457FA5381C039E3D8F4022100A08D4B8838053B48474ECABE9EF340E83D8A3A330A814316EA75958D510A1B76",
            "public_key": "3056301006072A8648CE3D020106052B8104000A034200042704DEA2E9BDB74133E298C3AAD8E76588E48AED614674869380B959BB49DF69E8DAA1B7EF4E14240952C2BB082C89FB54A528D6502F8934E1BDA95F651F8D29",
            "signature_index": 25,
            "transaction": {
              "size": 56,
              "txid": "B6C62ADB8CFAC18FBAC5F9F5BD3E828249E176A64C71445BD443752C8635787D",
              "data": "",
              "type": "standard",
              "fee": 121,
              "source_amount": 1121,
              "merkle_path": "",
              "source_address": "VazUQm9TaPmbhTWEi6FYUUPp28Eynq",
              "bitcoin_transaction": "",
              "bitcoin_block_header": "",
              "endorsed_block_header": "",
              "outputs": [
                {
                  "address": "VE2TkS4er4JeZJRnPkSKUdSeaAew5E",
                  "amount": 1000
                }
              ]
            }
          }
        },
        {
          "type": "signed",
          "signed": {
            "signature": "3044022042C19F6CC85D64E9D87583011D020D232A056DBDAAECA0499BD711AFF72B87540220010A9D4F7BFC7CF4F3202FC8774542ECFBE94CC1B4876DAB9EFC1CE586959073",
            "public_key": "3056301006072A8648CE3D020106052B8104000A034200042704DEA2E9BDB74133E298C3AAD8E76588E48AED614674869380B959BB49DF69E8DAA1B7EF4E14240952C2BB082C89FB54A528D6502F8934E1BDA95F651F8D29",
            "signature_index": 26,
            "transaction": {
              "size": 56,
              "txid": "7BA24151FA9A8D59D009B952BC259E3228FFE753526C38F8F1C4703EFFA8C115",
              "data": "",
              "type": "standard",
              "fee": 121,
              "source_amount": 1121,
              "merkle_path": "",
              "source_address": "VazUQm9TaPmbhTWEi6FYUUPp28Eynq",
              "bitcoin_transaction": "",
              "bitcoin_block_header": "",
              "endorsed_block_header": "",
              "outputs": [
                {
                  "address": "VE2TkS4er4JeZJRnPkSKUdSeaAew5E",
                  "amount": 1000
                }
              ]
            }
          }
        }
      ]
    }
  ],
  "success": true,
  "messages": []
}

getinfo

Returns general information about this node and the presently-known blockchain

Syntax

getinfo

Examples:

getinfo

#returns info for a specific command
rpc (77.46.106.162:10500) > {
  "payload": {
    "default_address": {
      "address": "VazUQm9TaPmbhTWEi6FYUUPp28Eynq",
      "amount": 187457753607875
    },
    "estimated_hash_rate": 6,
    "number_of_blocks": 37532,
    "transaction_fee": "0.00000801",
    "last_block": {
      "coinbaseReward": 1000000000,
      "transactionFees": 0,
      "size": 0,
      "raw": "CJulAhCLoo7TBRoYAAAAKxIj2rocYAtCHvclu0nOg6mEdUFFIhgAAAAV+9oXWONJpFXwDTd3aUIEabXUJJ8pfQcAAAAAAAAw6q+nsvr/////AToWaVLnTYcGoeUPflsiB8rJOoy/viPRGkIk0000003815F944BD02E2AA76E69E7DFBD493D689ADE032ACaICU69wD",
      "number": 37531,
      "timestamp": 1516474635,
      "hash": "0000002B1223DABA1C600B421EF725BB49CE83A984754145",
      "previous_hash": "00000015FBDA1758E349A455F00D377769420469B5D4249F",
      "difficulty": 1917,
      "winning_nonce": -1505110038,
      "miner_address": "VazUQm9TaPmbhTWEi6FYUUPp28Eynq",
      "ledgerHash": "D34D34D34DFCD7917DE38043D36136000EFA13AF44EC31410F8F770FAF3D003134DF6002",
      "bitcoin_block_headers": [],
      "transactions": []
    },
    "difficulty": 1917
  },
  "success": true,
  "messages": []
}


getlastbitcoinblock

Returns the last bitcoin block.

Syntax

getlastbitcoinblock

Example

# input
getlastbitcoinblock

#output
rpc (127.0.0.1:10500) > {
  "payload": "00000020F3E15A9E8C0D18957E6E048311B85014F54EDD6FDB27442809C9A64C00000000324227DB35ECF6AC8E35C403366C84BCBA613F3A8F5C67DA3B40E302731A1BD8A90EA35AFFFF001D6887AE1E",
  "success": true,
  "messages": []
}

getnewaddress

Creates a new address from the wallet

Example

# input
getnewaddress

#output
rpc (77.46.106.162:10500) > {
  "payload": "VCGeXVDjH9EHv8zkGmh6VwL5mHXfpm",
  "success": true,
  "messages": []
}

Create multiple addresses at once

getnewaddress [count]
Gets {count} new address from the wallet (default: 1)


getpeerinfo

Returns a list of connected peers

Syntax

getpeerinfo 

Examples:

rpc (127.0.0.1:10500) > {
  "payload": {
    "configured_endpoints": [
      {
        "address": "93.130.33.180",
        "port": 6500
      },
      {
        "address": "77.46.106.162",
        "port": 6500
      }
    ],
    "connected": [
      {
        "address": "77.46.106.162",
        "port": 6500,
        "application": "VeriBlock NodeCore v0.1.0-rc.28",
        "protocol_version": 1,
        "platform": "Windows Server 2016",
        "start_timestamp": 1520633272
      }
    ],
    "disconnected": [],
    "candidates": [
      {
        "address": "23.96.176.247",
        "port": 6500,
        "application": "VeriBlock NodeCore v0.1.0-rc.28",
        "protocol_version": 1,
        "platform": "Linux",
        "start_timestamp": 1520634269
      },
      {
        "address": "13.95.160.234",
        "port": 6500,
        "application": "VeriBlock NodeCore v0.1.0-rc.24",
        "protocol_version": 1,
        "platform": "Linux",
        "start_timestamp": 1520625288
      }
    ]
  },
  "success": true,
  "messages": []
}


getpendingtransactions

Returns the serialized mempool transactions. Returns nothing if there are no transactions.

Syntax

getpendingtransactions

Examples:

#First send some coins (to ensure there is a transaction), then check for pending transactions.
send 1000 VE2TkS4er4JeZJRnPkSKUdSeaAew5E
getpendingtransactions

#returns info for a specific command
rpc (77.46.106.162:10500) > {
  "payload": [
    {
      "size": 56,
      "txid": "2EB013AC6B62D192FD0EA3D8DBB757BB8D4F6008BC3A17846A42CBB629F27D58",
      "data": "",
      "type": "standard",
      "fee": 121,
      "source_amount": 1121,
      "merkle_path": "",
      "source_address": "VazUQm9TaPmbhTWEi6FYUUPp28Eynq",
      "bitcoin_transaction": "",
      "bitcoin_block_header": "",
      "endorsed_block_header": "",
      "outputs": [
        {
          "address": "VEP6ZjXby6Ska22bb4fcrirL4Dj2Vo",
          "amount": 1000
        }
      ]
    }
  ],
  "success": true,
  "messages": []
}

getpoolinfo

Shows pool info if running a pool.

getpoolinfo
{
  "running": true,
  "configuration": {
    "solo": false,
    "type": "GPU",
    "pool_target": "00000000ffffffffffffffffffffffffffffffffffffffff",
    "pool_address": "V4upDbv4ne6f88Pr8h5oHdok9Ezzzz",
    "operator_address": "V4cP4AfoSomxYHfnCDN8tuWFstrgdw",
    "operator_fee": 0.01,
    "coinbase_comment": "myPoolCommentHere"
  },
  "stats": {
    "current_round": 4536,
    "mining_block_number": 55855,
    "last_block_number": 55854,
    "recent_hash_rate": "772.66 GH/s"
  }
}


getpop

getpop [block]
Gets the data VeriBlock wants Proof-of-Proof published to Bitcoin

getpopendorsementsinfo

Returns transaction history for specified address or the default if not.

getpopendorsementsinfo <address> [searchLength]

Example

# input
getpopendorsementsinfo V34RwWk5CEp5uE8L4SSpJWcwN29dKu

#output
  "payload": [
    {
      "miner_address": "V34RwWk5CEp5uE8L4SSpJWcwN29dKu",
      "endorsed_veriblock_block_hash": "0000000330089FE0A8335AEF138265D7F9A7E9EFC251001A",
      "contained_in_veriblock_block_hash": "00000003028BD9FD9A3FD188BF2D70A4B99FC8BB43EC9786",
      "veriblock_transaction_id": "E9E18AFB9212EC873B5D1E7A6AFE7727AF8D5FCC07C9CAA4DD39662C5C8EB1D2",
      "bitcoin_transaction": "0100000001497856D96BCC107D844DE83F711A30101AAD1BF2EF68213CAAE72225C8E65A08000000006B4830450221009AD5105F19A1A03D48E69860659BEBAF456DF4A80D0A047C8A0F67C020A230C502203F6EFC440B2BC177A6CA91914E8CD881D4D60E496AC22AFE6704E9DA1DA9480D0121025EA042772B22B46E924C1EAFF3D24F369501D615ECF4063C2C6C97C820C107C7FFFFFFFF0208413900000000001976A914E9C0E8D5D4C74F427A4836C8E6E3A582E761958588AC0000000000000000536A4C50000000010000000019E1492ECF1943299294D1B72AB25E56AD2A5BDA0C28A9D3E1299F501DA61E9FE2081CE3DEAD8DFFDD6041125ADA3E9A044AE83904116460217C8C3562659235A15C85F155CA620C00000000",
      "bitcoin_transaction_id": "1CA7C540AF39C6D11F40569AA549AA716B12AAF052A57D521ED41049C12A97B7",
      "bitcoin_block_header": "00000020605C4627C7168F21B41CECF20DC8C4AC0C7F32C8B9CF186ACF00000000000000C232B26F9AFCCFDDCA7819A9FBF7B146FEC2B17E88968ADD318CD74279C878138540DA5A9B03031A4CDDF632",
      "bitcoin_block_header_hash": "0000000000000107EB54ED752020E978BBAC7504659EC1745A61A1905E40B66F",
      "reward": "28.00000000",
      "finalized": true
    },

getprotectedchildren

Returns the children protected by PoP transactions in a particular VeriBlock block identified by the provided block hash.

The paradigm is "A parent protects children"

See: NodeCore_CommandLine#getprotectingparents

Syntax

getprotectedchildren <blockhash> [searchLength]

Example

# input
getprotectedchildren 00000001176E53EA4CB9872910F9E567C6DC4B09C01DBB6B 10000

#output
  "payload": [
    {
      "miner_address": "V34RwWk5CEp5uE8L4SSpJWcwN29dKu",
      "endorsed_veriblock_block_hash": "00000000EBDFF3806FEFC22799E75FD36C3935F7FA36AA53",
      "contained_in_veriblock_block_hash": "00000001176E53EA4CB9872910F9E567C6DC4B09C01DBB6B",
      "veriblock_transaction_id": "E25E8ECFFF3A3DB843167C066AC052AE42BE44EB528934EEE6ED8CF5219A17C3",
      "bitcoin_transaction": "020000000129F1343830462940EC71F9A041FA3FF3FCBC87360AD891F1F93FDFC19E030E63010000006A473044022017ACFF98378B2865981C9E2D4D79AF27005B4FE4843EC7811BAEC12F0C40189602203087F1B456E6A7E794AE67A369D3214CEEC2AE0923AE9D73084FC7B25C474BBF0121029787960F4CE284F40F1C8953E2F8DDFC5E664088580588153E5FC7513AC88C7DFFFFFFFF020000000000000000536A4C500000000100000002666994A2AFEF035F53D0048991648A8304839BF07B1C3A9F5CE2071B1EE66E039F8E3477A2FD940FC87CE7A45ACE5178045F55BE585CA12F217C8C3562659235A15C85F155CA620CC0270900000000001976A914ABA57562278E5D543E33A20E5AE1B8427B51AD0988AC00000000",
      "bitcoin_transaction_id": "840AD8CB3D5A64979220FA9CE9BE302FF644D294E0186CD14C876BE7B54C87E8",
      "bitcoin_block_header": "00000020F0055E0D2B1D78409650AE4C23D9501EBDF3AA00D03B50014D0000000000000089ABCEA79221A9BCFF8BA8DF17719C23AB399D6B171CC5A2199878D76AB859C6B552CE5A9B03031ADD59C1A0",
      "bitcoin_block_header_hash": "000000000000017CC389D86556814B198A4B9673E5D55CC846A6853B0C283279",
      "reward": "28.00000000",
      "finalized": true

getprotectingparents

Returns the pop endorsement information of parents protecting the provided block hash.

The paradigm is "A child can be protected by mulitple parents"

See: NodeCore_CommandLine#getprotectedchildren

Syntax

getprotectingparents <blockhash> [searchLength]

Example

# input
getprotectingparents 00000000EBDFF3806FEFC22799E75FD36C3935F7FA36AA53 10000

#output
  "payload": [
    {
      "miner_address": "V34RwWk5CEp5uE8L4SSpJWcwN29dKu",
      "endorsed_veriblock_block_hash": "00000000EBDFF3806FEFC22799E75FD36C3935F7FA36AA53",
      "contained_in_veriblock_block_hash": "00000001176E53EA4CB9872910F9E567C6DC4B09C01DBB6B",
      "veriblock_transaction_id": "E25E8ECFFF3A3DB843167C066AC052AE42BE44EB528934EEE6ED8CF5219A17C3",
      "bitcoin_transaction": "020000000129F1343830462940EC71F9A041FA3FF3FCBC87360AD891F1F93FDFC19E030E63010000006A473044022017ACFF98378B2865981C9E2D4D79AF27005B4FE4843EC7811BAEC12F0C40189602203087F1B456E6A7E794AE67A369D3214CEEC2AE0923AE9D73084FC7B25C474BBF0121029787960F4CE284F40F1C8953E2F8DDFC5E664088580588153E5FC7513AC88C7DFFFFFFFF020000000000000000536A4C500000000100000002666994A2AFEF035F53D0048991648A8304839BF07B1C3A9F5CE2071B1EE66E039F8E3477A2FD940FC87CE7A45ACE5178045F55BE585CA12F217C8C3562659235A15C85F155CA620CC0270900000000001976A914ABA57562278E5D543E33A20E5AE1B8427B51AD0988AC00000000",
      "bitcoin_transaction_id": "840AD8CB3D5A64979220FA9CE9BE302FF644D294E0186CD14C876BE7B54C87E8",
      "bitcoin_block_header": "00000020F0055E0D2B1D78409650AE4C23D9501EBDF3AA00D03B50014D0000000000000089ABCEA79221A9BCFF8BA8DF17719C23AB399D6B171CC5A2199878D76AB859C6B552CE5A9B03031ADD59C1A0",
      "bitcoin_block_header_hash": "000000000000017CC389D86556814B198A4B9673E5D55CC846A6853B0C283279",
      "reward": "28.00000000",
      "finalized": true
    },
	

getstateinfo

getstateinfo
Returns blockchain, operating, and network state information

Example:

getstateinfo
{
  "blockchain_state": "LOADED",
  "operating_state": "RUNNING",
  "network_state": "CONNECTED",
  "connected_peer_count": 8,
  "current_sync_peer": "",
  "network_height": 148816,
  "local_blockchain_height": 148816,
  "network_version": "TestNet",
  "data_directory": "",
  "program_version": "0.3.8",
  "nodecore_starttime": 1541471711,
  "wallet_cache_sync_height": 148816
}


gettransaction

gettransaction <txId> [searchLength]
Gets information regarding provided TxID

getwallettransactions

This requires the wallet cache be up to date (run getstateinfo to see how far along wallet cache is caught up). If you just imported a new wallet, it may take some time to rebuild that cache.

getwallettransactions <address> [type]
Writes transaction history for an address to a local file. This could take a while.

See also: NodeCore_CommandLine#refreshwalletcache --> rebuilds the cache

Example:

getwallettransactions V4m6JbAs8VaEa3wwemJPgsPRY8ETdk
Append to file: C:\outputs\V4m6JbAs8VaEa3wwemJPgsPRY8ETdk.csv
Got page 1 with 100 rows, appended to file
Got page 2 with 93 rows, appended to file
"Wrote 193 wallet transactions to file C:\\outputs\V4m6JbAs8VaEa3wwemJPgsPRY8ETdk.csv"

importprivatekey

See also: dumpprivatekey

importprivatekey <privateKey>
Imports the provided private key into NodeCore

importwallet

Import a NodeCore wallet backup from the provided location. Expects an exact wallet file.

Run getbalance before and after the importwallet command to see the impact. Note that importwallet merges the addresses into the existing wallet, it does NOT overwrite them. If nodecore has wallet with address A, and one runs the importwallet command with a wallet.dat file containing B and C, then the final nodecore addresses from getbalance will show A, B, and C.

See: NodeCore_CommandLine#backupwallet, NodeCore_File_Structure

Syntax

importwallet <sourceLocation>

Example

# input
importwallet C:\MyBackups\wallet_backup.dat

#output
rpc (127.0.0.1:10500) > {
  "payload": {},
  "success": true,
  "messages": []
}

listbannedminers

listbannedminers
Returns a list of UCP clients that are currently banned

listallowed

Returns a list of allowed whitelist addresses

listallowed

lockwallet

See: Wallet_Encryption

lockwallet
Disables the temporary unlock on the NodeCore wallet

makeunsignedmultisigtx

makeunsignedmultisigtx <sourceAddress> <amount> <destinationAddress> [transactionFee] [signatureIndex]
(Generates an unsigned multisig transaction)

refreshwalletcache

See also: NodeCore_CommandLine#getwallettransactions

refreshwalletcache
Rescans the blockchain for transactions belonging to imported wallets

removeallowed

removeallowed <address>
Remove allowed addresses

removenode

Removes the peer address from the configuration

Syntax

removenode <peer>

Example

# input
removenode 93.130.33.180:10500

#output (also run getpeerinfo to see the node removed)
rpc (127.0.0.1:10500) > {
  "payload": {},
  "success": true,
  "messages": []
}

restartpoolwebserver

restartpoolwebserver
Restarts the built-in pool web server

send

Send coins to the specified address. Will automatically pick a source address that has sufficient coins.

Can return multiple Transactions if pulling from multiple addresses.

Syntax

send <amount> <destinationAddress> [sourceAddress]

Examples:

#send 1000 coins to address "VE2TkS4er4JeZJRnPkSKUdSeaAew5E"
send 1000 VE2TkS4er4JeZJRnPkSKUdSeaAew5E

#returns the VBK transaction ID
rpc (127.0.0.1:10501) > {
  "payload": {
    "txids": [
      "76796500882C927FF057BDA528C94BE883A06A1B6430655067ACF51F09A6E376",
      "79AC6FFE176F068BBB0F5B4F79A2FD1AA92925CA9310FEC58236E220804B58DF"
    ]
  },
  "success": true,
  "messages": []
}

setdefaultaddress

Sets a new default address. This is what will show up when running getinfo

setdefaultaddress <address>
(Sets the default address of a NodeCore instance)

settxfee

Sets the transaction fee per byte. You can view the transaction fee by running getinfo

Syntax

settxfee <transactionFee>

Examples:

#Set the transaction fee
settxfee 0.00001000

#returns info for a specific command
rpc (127.0.0.1:10500) > {
  "payload": {},
  "success": true,
  "messages": []
}

signhexmessage

signhexmessage <address> <message>
(Signs a hex-encoded message with the addresses private key)


sigindex

Return the signature index for the specified address

Syntax

sigindex [address]

Examples:

#get the signature index
sigindex VE2TkS4er4JeZJRnPkSKUdSeaAew5E

#returns info for a specific command
rpc (127.0.0.1:10500) > {
  "payload": {
    "addresses": [
      {
        "pool_index": -1,
        "address": "VE2TkS4er4JeZJRnPkSKUdSeaAew5E",
        "blockchain_index": -1
      }
    ]
  },
  "success": true,
  "messages": []
}


signmessage

Signs a message with the addresses private key

Syntax

signmessage <address> <message>

Examples:

#sign a message, infer the private key from the address
signmessage VDonzX9vwXxcL9BapJWkhnBiyAX6ia ThisIsSomeText

#returns info for a specific command
rpc (127.0.0.1:10500) > {
  "payload": "MEYCIQDDxExDiIGkjxrs20cl5RhlbHo5MEgSdub+MmdEE5d21AIhAJk7alAVUAuH/+j3/PuUY7BEuLtH4vIjAFwvGEaLdexh",
  "success": true,
  "messages": []
}

startpool

Starts the built-in pool service in NodeCore.

Requires permissions.

Syntax

startpool <type>
(Starts the built-in pool service in NodeCore)

Examples:

#start the UCP pool on an instance

#CPU
startpool CPU

#GPU
startpool GPU

#returns info for a specific command
rpc (127.0.0.1:10500) > {
  "payload": {},
  "success": true,
  "messages": []
}

startsolopool

startsolopool [address]
Starts the built-in pool service in NodeCore in solo mode

stopnodecore

Gracefully stops the connected instance of NodeCore. Very useful for remote instances.

An alternative is to CTRL+C NodeCore.

stoppool

Stops the built-in pool service in NodeCore

Syntax

stoppool

Examples:

stoppool

#returns info for a specific command
rpc (127.0.0.1:10500) > {
  "payload": {},
  "success": true,
  "messages": []
}

submitmultisigtx

How_to_Submit_Multisig_Tx


troubleshootpopbyaddress

Command: Troubleshoot PoP By Address

troubleshootpopbyaddress <onlyFailures> [searchLength] [address]
(Returns a troubleshooting report of the PoP transaction(s) matching the provided address in the specified history)

Example:
troubleshootpopbyaddress true 1000 VHPgy7kUNtkKFLdx3CyB6rAyHAhd7n

unlockwallet

See: Wallet_Encryption

Command: Unlock Wallet

unlockwallet
Temporarily unlocks the NodeCore wallet

validateaddress

Returns details about an address if it's valid

Syntax

validateaddress <address>

Examples:

#Check a specific address
validateaddress VazUQm9TaPmbhTWEi6FYUUPp28Eynq

#returns info for a specific command
rpc (77.46.106.162:10500) > {
  "payload": {
    "address": "VazUQm9TaPmbhTWEi6FYUUPp28Eynq",
    "is_remote": false,
    "public_key": "3056301006072A8648CE3D020106052B8104000A034200042704DEA2E9BDB74133E298C3AAD8E76588E48AED614674869380B959BB49DF69E8DAA1B7EF4E14240952C2BB082C89FB54A528D6502F8934E1BDA95F651F8D29"
  },
  "success": true,
  "messages": []
}