Difference between revisions of "NodeCore CommandLine"

From Veriblock Wiki
Jump to: navigation, search
Line 952: Line 952:
 
</pre>
 
</pre>
  
See also: refreshwalletcache --> rebuilds the cache
+
See also: [[NodeCore_CommandLine#refreshwalletcache]] --> rebuilds the cache
  
 
Example:
 
Example:
Line 963: Line 963:
 
"Wrote 193 wallet transactions to file C:\\outputs\V4m6JbAs8VaEa3wwemJPgsPRY8ETdk.csv"
 
"Wrote 193 wallet transactions to file C:\\outputs\V4m6JbAs8VaEa3wwemJPgsPRY8ETdk.csv"
 
</pre>
 
</pre>
 
  
 
=== importprivatekey ===
 
=== importprivatekey ===

Revision as of 20:00, 15 January 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

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

decryptwallet
Decrypts the wallet loaded in NodeCore

disconnect

Simply disconnects from the current NodeCore instance

dumpprivatekey

See also: importprivatekey

dumpprivatekey <address>
Gets private key for an address

encryptwallet

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": []
}


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": 121,
    "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": []
}

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

lockwallet
Disables the temporary unlock on the NodeCore wallet

makeunsignedmultisigtx

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

refreshwalletcache

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

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": []
}