From 503036bf7ff71d5d2c61cec07b1a840f1728d77f Mon Sep 17 00:00:00 2001 From: luisantoniocrag Date: Sun, 7 Mar 2021 19:39:23 -0600 Subject: [PATCH 01/33] Fix RPC misc call help messages --- src/rpc/misc.cpp | 88 ++++++++++++++++++++++++++---------------------- 1 file changed, 47 insertions(+), 41 deletions(-) diff --git a/src/rpc/misc.cpp b/src/rpc/misc.cpp index b4e6c52e3e..0794d18456 100644 --- a/src/rpc/misc.cpp +++ b/src/rpc/misc.cpp @@ -48,18 +48,18 @@ UniValue getinfo(const UniValue& params, bool fHelp) "\nResult:\n" "{\n" " \"version\": xxxxx, (numeric) the server version\n" - " \"protocolversion\": xxxxx, (numeric) the protocol version\n" + " \"protocolversion\": xxxxx, (numeric) the latest supported protocol version\n" " \"walletversion\": xxxxx, (numeric) the wallet version\n" - " \"balance\": xxxxxxx, (numeric) the total Zcash balance of the wallet\n" + " \"balance\": x.xxxxxxxx, (numeric) the total ZEN balance of the wallet\n" " \"blocks\": xxxxxx, (numeric) the current number of blocks processed in the server\n" - " \"timeoffset\": xxxxx, (numeric) the time offset (deprecated; always 0)\n" - " \"connections\": xxxxx, (numeric) the number of connections\n" + " \"timeoffset\": 0, (numeric) the time offset (deprecated; always 0)\n" + " \"connections\": xxx, (numeric) the number of connected peers\n" " \"proxy\": \"host:port\", (string, optional) the proxy used by the server\n" - " \"difficulty\": xxxxxx, (numeric) the current difficulty\n" + " \"difficulty\": x.xxxxx, (numeric) the current difficulty\n" " \"testnet\": true|false, (boolean) if the server is using testnet or not\n" - " \"keypoololdest\": xxxxxx, (numeric) the timestamp (seconds since GMT epoch) of the oldest pre-generated key in the key pool\n" + " \"keypoololdest\": xxxxxx, (numeric) the timestamp in seconds of the oldest pre-generated key in the key pool\n" " \"keypoolsize\": xxxx, (numeric) how many new keys are pre-generated\n" - " \"unlocked_until\": ttt, (numeric) the timestamp in seconds since epoch (midnight Jan 1 1970 GMT) that the wallet is unlocked for transfers, or 0 if the wallet is locked\n" + " \"unlocked_until\": ttt, (numeric, optional) the timestamp in seconds that the wallet is unlocked for transfers, or 0 if the wallet is locked\n" " \"paytxfee\": x.xxxx, (numeric) the transaction fee set in " + CURRENCY_UNIT + "/kB\n" " \"relayfee\": x.xxxx, (numeric) minimum relay fee for non-free transactions in " + CURRENCY_UNIT + "/kB\n" " \"errors\": \"...\" (string) any error messages\n" @@ -151,24 +151,25 @@ UniValue validateaddress(const UniValue& params, bool fHelp) { if (fHelp || params.size() != 1) throw runtime_error( - "validateaddress \"zcashaddress\"\n" - "\nReturn information about the given Zcash address.\n" + "validateaddress \"zenaddress\"\n" + "\nVerify an ZEN address is valid.\n" "\nArguments:\n" - "1. \"zcashaddress\" (string, required) The Zcash address to validate\n" + "1. \"zenaddress\" (string, required) The ZEN address to validate\n" "\nResult:\n" "{\n" - " \"isvalid\" : true|false, (boolean) If the address is valid or not. If not, this is the only property returned.\n" - " \"address\" : \"zcashaddress\", (string) The Zcash address validated\n" - " \"scriptPubKey\" : \"hex\", (string) The hex encoded scriptPubKey generated by the address\n" - " \"ismine\" : true|false, (boolean) If the address is yours or not\n" - " \"isscript\" : true|false, (boolean) If the key is a script\n" - " \"pubkey\" : \"publickeyhex\", (string) The hex value of the raw public key\n" - " \"iscompressed\" : true|false, (boolean) If the address is compressed\n" - " \"account\" : \"account\" (string) DEPRECATED. The account associated with the address, \"\" is the default account\n" + " \"isvalid\" : true|false, (boolean) if the address is valid or not. If not, this is the only property returned.\n" + " \"address\" : \"zenaddress\", (string) the ZEN address validated\n" + " \"scriptPubKey\" : \"hex\", (string) the hex encoded scriptPubKey generated by the address\n" + " \"ismine\" : true|false, (boolean) if the address is yours or not\n" + " \"iswatchonly\" : true|false, (boolean) if the address is set to watch only mode or not\n" + " \"isscript\" : true|false, (boolean) if the key is a script\n" + " \"pubkey\" : \"publickeyhex\", (string, optional) the hex value of the raw public key, only when the address is yours\n" + " \"iscompressed\" : true|false, (boolean, optional) if the address is compressed, only when the address is yours\n" + " \"account\" : \"account\" (string, optional) DEPRECATED. The account associated with the address, \"\" is the default account, only when the address is yours\n" "}\n" "\nExamples:\n" - + HelpExampleCli("validateaddress", "\"1PSSGeFHDnKNxiEyFrD1wcEaHr9hrQDDWc\"") - + HelpExampleRpc("validateaddress", "\"1PSSGeFHDnKNxiEyFrD1wcEaHr9hrQDDWc\"") + + HelpExampleCli("validateaddress", "\"zenaddress\"") + + HelpExampleRpc("validateaddress", "\"zenaddress\"") ); #ifdef ENABLE_WALLET @@ -215,21 +216,21 @@ UniValue z_validateaddress(const UniValue& params, bool fHelp) if (fHelp || params.size() != 1) throw runtime_error( "z_validateaddress \"zaddr\"\n" - "\nReturn information about the given z address.\n" + "\nVerify an zaddress is valid.\n" "\nArguments:\n" - "1. \"zaddr\" (string, required) The z address to validate\n" + "1. \"zaddr\" (string, required) The zaddress to validate\n" "\nResult:\n" "{\n" - " \"isvalid\" : true|false, (boolean) If the address is valid or not. If not, this is the only property returned.\n" - " \"address\" : \"zaddr\", (string) The z address validated\n" - " \"ismine\" : true|false, (boolean) If the address is yours or not\n" - " \"payingkey\" : \"hex\", (string) The hex value of the paying key, a_pk\n" - " \"transmissionkey\" : \"hex\", (string) The hex value of the transmission key, pk_enc\n" + " \"isvalid\" : true|false, (boolean) if the address is valid or not. If not, this is the only property returned.\n" + " \"address\" : \"zaddr\", (string) the zaddress validated\n" + " \"payingkey\" : \"hex\", (string) the hex value of the paying key, a_pk\n" + " \"transmissionkey\" : \"hex\", (string) the hex value of the transmission key, pk_enc\n" + " \"ismine\" : true|false, (boolean) if the address is yours or not\n" "}\n" "\nExamples:\n" - + HelpExampleCli("z_validateaddress", "\"zcWsmqT4X2V4jgxbgiCzyrAfRT1vi1F4sn7M5Pkh66izzw8Uk7LBGAH3DtcSMJeUb2pi3W4SQF8LMKkU2cUuVP68yAGcomL\"") - + HelpExampleRpc("z_validateaddress", "\"zcWsmqT4X2V4jgxbgiCzyrAfRT1vi1F4sn7M5Pkh66izzw8Uk7LBGAH3DtcSMJeUb2pi3W4SQF8LMKkU2cUuVP68yAGcomL\"") + + HelpExampleCli("z_validateaddress", "\"zaddr\"") + + HelpExampleRpc("z_validateaddress", "\"zaddr\"") ); @@ -347,23 +348,23 @@ UniValue createmultisig(const UniValue& params, bool fHelp) "\nArguments:\n" "1. nrequired (numeric, required) The number of required signatures out of the n keys or addresses.\n" - "2. \"keys\" (string, required) A json array of keys which are Zcash addresses or hex-encoded public keys\n" + "2. \"keys\" (string, required) A json array of keys which are ZEN addresses or hex-encoded public keys\n" " [\n" - " \"key\" (string) Zcash address or hex-encoded public key\n" + " \"key\" (string) ZEN address or hex-encoded public key\n" " ,...\n" " ]\n" "\nResult:\n" "{\n" - " \"address\":\"multisigaddress\", (string) The value of the new multisig address.\n" - " \"redeemScript\":\"script\" (string) The string value of the hex-encoded redemption script.\n" + " \"address\":\"multisigaddress\", (string) the value of the new multisig address.\n" + " \"redeemScript\":\"script\" (string) the string value of the hex-encoded redemption script.\n" "}\n" "\nExamples:\n" "\nCreate a multisig address from 2 addresses\n" - + HelpExampleCli("createmultisig", "2 \"[\\\"t16sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5\\\",\\\"t171sgjn4YtPu27adkKGrdDwzRTxnRkBfKV\\\"]\"") + + + HelpExampleCli("createmultisig", "2 \"[\\\"addr1\\\",\\\"addr2\\\"]\"") + "\nAs a json rpc call\n" - + HelpExampleRpc("createmultisig", "2, \"[\\\"t16sSauSf5pF2UkUwvKGq4qjNRzBZYqgEL5\\\",\\\"t171sgjn4YtPu27adkKGrdDwzRTxnRkBfKV\\\"]\"") + + HelpExampleRpc("createmultisig", "2, \"[\\\"addr1\\\",\\\"addr2\\\"]\"") ; throw runtime_error(msg); } @@ -384,23 +385,23 @@ UniValue verifymessage(const UniValue& params, bool fHelp) { if (fHelp || params.size() != 3) throw runtime_error( - "verifymessage \"zcashaddress\" \"signature\" \"message\"\n" + "verifymessage \"zenaddress\" \"signature\" \"message\"\n" "\nVerify a signed message\n" "\nArguments:\n" - "1. \"zcashaddress\" (string, required) The Zcash address to use for the signature.\n" + "1. \"zenaddress\" (string, required) The ZEN address to use for the signature.\n" "2. \"signature\" (string, required) The signature provided by the signer in base 64 encoding (see signmessage).\n" "3. \"message\" (string, required) The message that was signed.\n" "\nResult:\n" - "true|false (boolean) If the signature is verified or not.\n" + "true|false (boolean) if the signature is verified or not.\n" "\nExamples:\n" "\nUnlock the wallet for 30 seconds\n" + HelpExampleCli("walletpassphrase", "\"mypassphrase\" 30") + "\nCreate the signature\n" - + HelpExampleCli("signmessage", "\"t14oHp2v54vfmdgQ3v3SNuQga8JKHTNi2a1\" \"my message\"") + + + HelpExampleCli("signmessage", "\"zenaddress\" \"my message\"") + "\nVerify the signature\n" - + HelpExampleCli("verifymessage", "\"t14oHp2v54vfmdgQ3v3SNuQga8JKHTNi2a1\" \"signature\" \"my message\"") + + + HelpExampleCli("verifymessage", "\"zenaddress\" \"signature\" \"my message\"") + "\nAs json rpc\n" - + HelpExampleRpc("verifymessage", "\"t14oHp2v54vfmdgQ3v3SNuQga8JKHTNi2a1\", \"signature\", \"my message\"") + + HelpExampleRpc("verifymessage", "\"zenaddress\", \"signature\", \"my message\"") ); LOCK(cs_main); @@ -443,6 +444,11 @@ UniValue setmocktime(const UniValue& params, bool fHelp) "\nArguments:\n" "1. timestamp (integer, required) Unix seconds-since-epoch timestamp\n" " Pass 0 to go back to using the system time." + "\nResult:\n" + " \n" + "\nExamples:\n" + + HelpExampleCli("setmocktime", "0") + + HelpExampleRpc("setmocktime", "0") ); if (!Params().MineBlocksOnDemand()) From 2dd2016a8228e3b917bc10af124a5deaf53152aa Mon Sep 17 00:00:00 2001 From: luisantoniocrag Date: Sat, 13 Mar 2021 18:49:47 -0600 Subject: [PATCH 02/33] Fix RPC blockchain call help messages --- src/rpc/blockchain.cpp | 309 +++++++++++++++++++++++++---------------- 1 file changed, 192 insertions(+), 117 deletions(-) diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index 80a9e3916a..7691e18e3a 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -177,8 +177,10 @@ UniValue getblockcount(const UniValue& params, bool fHelp) throw runtime_error( "getblockcount\n" "\nReturns the number of blocks in the longest block chain.\n" + "\nResult:\n" - "n (numeric) The current block count\n" + "n (numeric) the current block count\n" + "\nExamples:\n" + HelpExampleCli("getblockcount", "") + HelpExampleRpc("getblockcount", "") @@ -193,9 +195,11 @@ UniValue getbestblockhash(const UniValue& params, bool fHelp) if (fHelp || params.size() != 0) throw runtime_error( "getbestblockhash\n" - "\nReturns the hash of the best (tip) block in the longest block chain.\n" + "\nReturns the hash of the best (most recent) block in the longest block chain.\n" + "\nResult\n" - "\"hex\" (string) the block hash hex encoded\n" + "\"hex\" (string) the block hash hex encoded\n" + "\nExamples\n" + HelpExampleCli("getbestblockhash", "") + HelpExampleRpc("getbestblockhash", "") @@ -211,8 +215,10 @@ UniValue getdifficulty(const UniValue& params, bool fHelp) throw runtime_error( "getdifficulty\n" "\nReturns the proof-of-work difficulty as a multiple of the minimum difficulty.\n" + "\nResult:\n" - "n.nnn (numeric) the proof-of-work difficulty as a multiple of the minimum difficulty.\n" + "n.nnn (numeric) the proof-of-work difficulty as a multiple of the minimum difficulty\n" + "\nExamples:\n" + HelpExampleCli("getdifficulty", "") + HelpExampleRpc("getdifficulty", "") @@ -277,27 +283,30 @@ UniValue getrawmempool(const UniValue& params, bool fHelp) throw runtime_error( "getrawmempool ( verbose )\n" "\nReturns all transaction ids in memory pool as a json array of string transaction ids.\n" + "\nArguments:\n" - "1. verbose (boolean, optional, default=false) true for a json object, false for array of transaction ids\n" - "\nResult: (for verbose = false):\n" - "[ (json array of string)\n" - " \"transactionid\" (string) The transaction id\n" + "1. verbose (boolean, optional, default=false) true for a json object, false for array of transaction ids\n" + "\nResult: (for verbose = false):\n" + "[ (json array of string)\n" + " \"transactionid\" (string) the transaction id\n" " ,...\n" "]\n" + "\nResult: (for verbose = true):\n" - "{ (json object)\n" - " \"transactionid\" : { (json object)\n" - " \"size\" : n, (numeric) transaction size in bytes\n" - " \"fee\" : n, (numeric) transaction fee in " + CURRENCY_UNIT + "\n" - " \"time\" : n, (numeric) local time transaction entered pool in seconds since 1 Jan 1970 GMT\n" - " \"height\" : n, (numeric) block height when transaction entered pool\n" - " \"startingpriority\" : n, (numeric) priority when transaction entered pool\n" - " \"currentpriority\" : n, (numeric) transaction priority now\n" - " \"depends\" : [ (array) unconfirmed transactions used as inputs for this transaction\n" + "{ (json object)\n" + " \"transactionid\": { (json object)\n" + " \"size\": n, (numeric) transaction size in bytes\n" + " \"fee\": n, (numeric) transaction fee in " + CURRENCY_UNIT + "\n" + " \"time\": n, (numeric) local time transaction entered pool in seconds since 1 Jan 1970 GMT\n" + " \"height\": n, (numeric) block height when transaction entered pool\n" + " \"startingpriority\": n, (numeric) priority when transaction entered pool\n" + " \"currentpriority\": n, (numeric) transaction priority now\n" + " \"depends\": [ (array) unconfirmed transactions used as inputs for this transaction\n" " \"transactionid\", (string) parent transaction id\n" " ... ]\n" " }, ...\n" "}\n" + "\nExamples\n" + HelpExampleCli("getrawmempool", "true") + HelpExampleRpc("getrawmempool", "true") @@ -318,10 +327,13 @@ UniValue getblockhash(const UniValue& params, bool fHelp) throw runtime_error( "getblockhash index\n" "\nReturns hash of block in best-block-chain at index provided.\n" + "\nArguments:\n" - "1. index (numeric, required) The block index\n" + "1. index (numeric, required) the block index\n" + "\nResult:\n" - "\"hash\" (string) The block hash\n" + "\"hash\" (string) the block hash\n" + "\nExamples:\n" + HelpExampleCli("getblockhash", "1000") + HelpExampleRpc("getblockhash", "1000") @@ -344,25 +356,29 @@ UniValue getblockheader(const UniValue& params, bool fHelp) "getblockheader \"hash\" ( verbose )\n" "\nIf verbose is false, returns a string that is serialized, hex-encoded data for blockheader 'hash'.\n" "If verbose is true, returns an Object with information about blockheader .\n" + "\nArguments:\n" - "1. \"hash\" (string, required) The block hash\n" - "2. verbose (boolean, optional, default=true) true for a json object, false for the hex encoded data\n" + "1. \"hash\" (string, required) the block hash\n" + "2. verbose (boolean, optional, default=true) true for a json object, false for the hex encoded data\n" + "\nResult (for verbose = true):\n" "{\n" - " \"hash\" : \"hash\", (string) the block hash (same as provided)\n" - " \"confirmations\" : n, (numeric) The number of confirmations, or -1 if the block is not on the main chain\n" - " \"height\" : n, (numeric) The block height or index\n" - " \"version\" : n, (numeric) The block version\n" - " \"merkleroot\" : \"xxxx\", (string) The merkle root\n" - " \"time\" : ttt, (numeric) The block time in seconds since epoch (Jan 1 1970 GMT)\n" - " \"nonce\" : n, (numeric) The nonce\n" - " \"bits\" : \"1d00ffff\", (string) The bits\n" - " \"difficulty\" : x.xxx, (numeric) The difficulty\n" - " \"previousblockhash\" : \"hash\", (string) The hash of the previous block\n" - " \"nextblockhash\" : \"hash\" (string) The hash of the next block\n" + " \"hash\": \"hash\", (string) the block hash (same as provided)\n" + " \"confirmations\": n, (numeric) the number of confirmations, or -1 if the block is not on the main chain\n" + " \"height\": n, (numeric) the block height or index\n" + " \"version\": n, (numeric) the block version\n" + " \"merkleroot\": \"xxxx\", (string) the merkle root\n" + " \"time\": ttt, (numeric) the block time in seconds since epoch (Jan 1 1970 GMT)\n" + " \"nonce\": n, (numeric) the nonce\n" + " \"bits\": \"1d00ffff\", (string) the bits\n" + " \"difficulty\": xxxx, (numeric) the difficulty\n" + " \"previousblockhash\": \"hash\", (string) the hash of the previous block\n" + " \"nextblockhash\": \"hash\" (string) the hash of the next block\n" "}\n" + "\nResult (for verbose=false):\n" - "\"data\" (string) A string that is serialized, hex-encoded data for block 'hash'.\n" + "\"data\": \"hex\" (string) a string that is serialized, hex-encoded data for block 'hash'\n" + "\nExamples:\n" + HelpExampleCli("getblockheader", "\"00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09\"") + HelpExampleRpc("getblockheader", "\"00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09\"") @@ -400,45 +416,60 @@ UniValue getblock(const UniValue& params, bool fHelp) "getblock \"hash|height\" ( verbose )\n" "\nIf verbosity is 0, returns a string that is serialized, hex-encoded data for the block.\n" "If verbosity is 1, returns an Object with information about the block.\n" - "If verbosity is 2, returns an Object with information about the block and information about each transaction. \n" + "If verbosity is 2, returns an Object with information about the block and information about each transaction.\n" + "\nArguments:\n" - "1. \"hash|height\" (string, required) The block hash or height\n" - "2. verbosity (numeric, optional, default=1) 0 for hex encoded data, 1 for a json object, and 2 for json object with transaction data,\n" - "also accept boolean for backward compatibility where true=1 and false=0\n" + "1. \"hash|height\" (string, required) the block hash or height\n" + "2. verbosity (numeric, optional, default=1) 0 for hex encoded data, 1 for a json object, and 2 for json object with transaction data,\n" + " also accept boolean for backward compatibility where true=1 and false=0\n" + "\nResult (for verbose = 1):\n" "{\n" - " \"hash\" : \"hash\", (string) the block hash (same as provided hash)\n" - " \"confirmations\" : n, (numeric) The number of confirmations, or -1 if the block is not on the main chain\n" - " \"size\" : n, (numeric) The block size\n" - " \"height\" : n, (numeric) The block height or index (same as provided height)\n" - " \"version\" : n, (numeric) The block version\n" - " \"merkleroot\" : \"xxxx\", (string) The merkle root\n" - " \"tx\" : [ (array of string) The transaction ids\n" - " \"transactionid\" (string) The transaction id\n" + " \"hash\": \"hash\", (string) the block hash (same as provided hash)\n" + " \"confirmations\": n, (numeric) the number of confirmations, or -1 if the block is not on the main chain\n" + " \"size\": n, (numeric) the block size\n" + " \"height\": n, (numeric) the block height or index (same as provided height)\n" + " \"version\": n, (numeric) the block version\n" + " \"merkleroot\": \"xxxx\", (string) the merkle root\n" + " \"tx\": [ (array of string) the transaction ids\n" + " \"transactionid\": \"hash\", (string) the transaction id\n" " ,...\n" " ],\n" - " \"time\" : ttt, (numeric) The block time in seconds since epoch (Jan 1 1970 GMT)\n" - " \"nonce\" : n, (numeric) The nonce\n" - " \"bits\" : \"1d00ffff\", (string) The bits\n" - " \"difficulty\" : x.xxx, (numeric) The difficulty\n" - " \"previousblockhash\" : \"hash\", (string) The hash of the previous block\n" - " \"nextblockhash\" : \"hash\" (string) The hash of the next block\n" + " \"time\": ttt, (numeric) the block time in seconds since epoch (Jan 1 1970 GMT)\n" + " \"nonce\": n, (numeric) the nonce\n" + " \"bits\": \"hex\", (string) the bits\n" + " \"difficulty\": xxxx, (numeric) the difficulty\n" + " \"chainwork\": \"hex\", (string) txpected number of hashes required to produce the chain up to this block (in hex)\n" + " \"anchor\": \"hex\", (string) the anchor\n" + " \"valuePools\": [ (array) value pools\n" + " \"id\": \"sprout\"|\"sapling\", (string) the pool id\n" + " \"monitored\": true|false, (boolean) if is monitored or not\n" + " \"chainValue\": n.nnn, (numeric) the chain value\n" + " \"chainValueZat\": n, (numeric) the chain value zat\n" + " \"valueDelta\": n.nnn, (numeric)the delta value\n" + " \"valueDeltaZat\": n (numeric) the delta zat value\n" + " ],\n" + " \"previousblockhash\": \"hash\", (string, optional) the hash of the previous block (if available)\n" + " \"nextblockhash\": \"hash\" (string, optional) the hash of the next block (if available)\n" "}\n" + "\nResult (for verbose=0):\n" - "\"data\" (string) A string that is serialized, hex-encoded data for block 'hash'.\n" + "\"data\" (string) a string that is serialized, hex-encoded data for block 'hash'\n" + "\nResult (for verbosity = 2):\n" "{\n" - " ..., Same output as verbosity = 2.\n" - " \"tx\" : [ (array of Objects) The transactions in the format of the getrawtransaction RPC.\n" + " ..., same output as verbosity = 2\n" + " \"tx\" : [ (array of Objects) the transactions in the format of the getrawtransaction RPC\n" " ,...\n" " ],\n" - " ,... Same output as verbosity = 1.\n" + " ,... same output as verbosity = 1\n" "}\n" + "\nExamples:\n" - + HelpExampleCli("getblock", "\"00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09\"") - + HelpExampleRpc("getblock", "\"00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09\"") - + HelpExampleCli("getblock", "12800") - + HelpExampleRpc("getblock", "12800") + + HelpExampleCli("getblock", "\"hash\"") + + HelpExampleRpc("getblock", "\"hash\"") + + HelpExampleCli("getblock", "height") + + HelpExampleRpc("getblock", "height") ); LOCK(cs_main); @@ -512,16 +543,18 @@ UniValue gettxoutsetinfo(const UniValue& params, bool fHelp) "gettxoutsetinfo\n" "\nReturns statistics about the unspent transaction output set.\n" "Note this call may take some time.\n" + "\nResult:\n" "{\n" - " \"height\":n, (numeric) The current block height (index)\n" - " \"bestblock\": \"hex\", (string) the best block hash hex\n" - " \"transactions\": n, (numeric) The number of transactions\n" - " \"txouts\": n, (numeric) The number of output transactions\n" - " \"bytes_serialized\": n, (numeric) The serialized size\n" - " \"hash_serialized\": \"hash\", (string) The serialized hash\n" - " \"total_amount\": x.xxx (numeric) The total amount\n" + " \"height\":n, (numeric) the current block height (index)\n" + " \"bestblock\": \"hex\", (string) the best block hash hex\n" + " \"transactions\": n, (numeric) the number of transactions\n" + " \"txouts\": n, (numeric) the number of output transactions\n" + " \"bytes_serialized\": n, (numeric) the serialized size\n" + " \"hash_serialized\": \"hash\", (string) the serialized hash\n" + " \"total_amount\": xxxx (numeric) the total amount\n" "}\n" + "\nExamples:\n" + HelpExampleCli("gettxoutsetinfo", "") + HelpExampleRpc("gettxoutsetinfo", "") @@ -549,27 +582,29 @@ UniValue gettxout(const UniValue& params, bool fHelp) throw runtime_error( "gettxout \"txid\" n ( includemempool )\n" "\nReturns details about an unspent transaction output.\n" + "\nArguments:\n" - "1. \"txid\" (string, required) The transaction id\n" - "2. n (numeric, required) vout value\n" - "3. includemempool (boolean, optional) Whether to included the mem pool\n" + "1. \"txid\" (string, required) the transaction id\n" + "2. n (numeric, required) vout value\n" + "3. includemempool (boolean, optional) whether to included the mem pool\n" + "\nResult:\n" "{\n" - " \"bestblock\" : \"hash\", (string) the block hash\n" - " \"confirmations\" : n, (numeric) The number of confirmations\n" - " \"value\" : x.xxx, (numeric) The transaction value in " + CURRENCY_UNIT + "\n" - " \"scriptPubKey\" : { (json object)\n" - " \"asm\" : \"code\", (string) \n" - " \"hex\" : \"hex\", (string) \n" - " \"reqSigs\" : n, (numeric) Number of required signatures\n" - " \"type\" : \"pubkeyhash\", (string) The type, eg pubkeyhash\n" - " \"addresses\" : [ (array of string) array of Horizen addresses\n" - " \"horizenaddress\" (string) Horizen address\n" + " \"bestblock\": \"hash\", (string) the block hash\n" + " \"confirmations\": n, (numeric) the number of confirmations\n" + " \"value\": xxxx, (numeric) the transaction value in " + CURRENCY_UNIT + "\n" + " \"scriptPubKey\": { (json object)\n" + " \"asm\": \"code\", (string) the asm\n" + " \"hex\": \"hex\", (string) the hex\n" + " \"reqSigs\" : n, (numeric) number of required signatures\n" + " \"type\": \"pubkeyhash\", (string) the type, eg pubkeyhash\n" + " \"addresses\": [ (array of string) array of Horizen addresses\n" + " \"horizenaddress\" (string) Horizen address\n" " ,...\n" " ]\n" " },\n" - " \"version\" : n, (numeric) The version\n" - " \"coinbase\" : true|false (boolean) Coinbase or not\n" + " \"version\": n, (numeric) the version\n" + " \"coinbase\": true|false (boolean) coinbase or not\n" "}\n" "\nExamples:\n" @@ -629,11 +664,14 @@ UniValue verifychain(const UniValue& params, bool fHelp) throw runtime_error( "verifychain ( checklevel numblocks )\n" "\nVerifies blockchain database.\n" + "\nArguments:\n" - "1. checklevel (numeric, optional, 0-4, default=3) How thorough the block verification is.\n" - "2. numblocks (numeric, optional, default=288, 0=all) The number of blocks to check.\n" + "1. checklevel (numeric, optional, 0-4, default=3) how thorough the block verification is\n" + "2. numblocks (numeric, optional, default=288, 0=all) the number of blocks to check\n" + "\nResult:\n" - "true|false (boolean) Verified or not\n" + "true|false (boolean) verified or not\n" + "\nExamples:\n" + HelpExampleCli("verifychain", "") + HelpExampleRpc("verifychain", "") @@ -707,37 +745,39 @@ UniValue getblockchaininfo(const UniValue& params, bool fHelp) throw runtime_error( "getblockchaininfo\n" "Returns an object containing various state info regarding block chain processing.\n" + "\nResult:\n" "{\n" - " \"chain\": \"xxxx\", (string) current network name as defined in BIP70 (main, test, regtest)\n" - " \"blocks\": xxxxxx, (numeric) the current number of blocks processed in the server\n" - " \"headers\": xxxxxx, (numeric) the current number of headers we have validated\n" - " \"bestblockhash\": \"...\", (string) the hash of the currently best block\n" - " \"difficulty\": xxxxxx, (numeric) the current difficulty\n" - " \"verificationprogress\": xxxx, (numeric) estimate of verification progress [0..1]\n" - " \"chainwork\": \"xxxx\" (string) total amount of work in active chain, in hexadecimal\n" - " \"commitments\": xxxxxx, (numeric) the current number of note commitments in the commitment tree\n" - " \"softforks\": [ (array) status of softforks in progress\n" + " \"chain\": \"xxxx\", (string) current network name as defined in BIP70 (main, test, regtest)\n" + " \"blocks\": xxxxxx, (numeric) the current number of blocks processed in the server\n" + " \"headers\": xxxxxx, (numeric) the current number of headers we have validated\n" + " \"bestblockhash\": \"...\", (string) the hash of the currently best block\n" + " \"difficulty\": xxxxxx, (numeric) the current difficulty\n" + " \"verificationprogress\": xxxx, (numeric) estimate of verification progress [0..1]\n" + " \"chainwork\": \"xxxx\" (string) total amount of work in active chain, in hexadecimal\n" + " \"commitments\": xxxxxx, (numeric) the current number of note commitments in the commitment tree\n" + " \"softforks\": [ (array) status of softforks in progress\n" " {\n" - " \"id\": \"xxxx\", (string) name of softfork\n" - " \"version\": xx, (numeric) block version\n" - " \"enforce\": { (object) progress toward enforcing the softfork rules for new-version blocks\n" - " \"status\": xx, (boolean) true if threshold reached\n" - " \"found\": xx, (numeric) number of blocks with the new version found\n" - " \"required\": xx, (numeric) number of blocks required to trigger\n" - " \"window\": xx, (numeric) maximum size of examined window of recent blocks\n" + " \"id\": \"xxxx\", (string) name of softfork\n" + " \"version\": xx, (numeric) block version\n" + " \"enforce\": { (object) progress toward enforcing the softfork rules for new-version blocks\n" + " \"status\": xx, (boolean) true if threshold reached\n" + " \"found\": xx, (numeric) number of blocks with the new version found\n" + " \"required\": xx, (numeric) number of blocks required to trigger\n" + " \"window\": xx, (numeric) maximum size of examined window of recent blocks\n" " },\n" - " \"reject\": { ... } (object) progress toward rejecting pre-softfork blocks (same fields as \"enforce\")\n" + " \"reject\": { ... } (object) progress toward rejecting pre-softfork blocks (same fields as \"enforce\")\n" " }, ...\n" - " \n" + " ],\n" + " \"bip9_softforks\": { (object) status of BIP9 softforks in progress\n" + " \"xxxx\": { (string) name of the softfork\n" + " \"status\": \"xxxx\", (string) one of \"defined\", \"started\", \"lockedin\", \"active\", \"failed\"\n" + " \"bit\": xx, (numeric) the bit, 0-28, in the block version field used to signal this soft fork\n" + " \"startTime\": xx, (numeric) the minimum median time past of a block at which the bit gains its meaning\n" + " \"timeout\": xx (numeric) the median time past of a block at which the deployment is considered failed if not yet locked in\n" + " }\n" "}\n" - " \"bip9_softforks\": { (object) status of BIP9 softforks in progress\n" - " \"xxxx\" : { (string) name of the softfork\n" - " \"status\": \"xxxx\", (string) one of \"defined\", \"started\", \"lockedin\", \"active\", \"failed\"\n" - " \"bit\": xx, (numeric) the bit, 0-28, in the block version field used to signal this soft fork\n" - " \"startTime\": xx, (numeric) the minimum median time past of a block at which the bit gains its meaning\n" - " \"timeout\": xx (numeric) the median time past of a block at which the deployment is considered failed if not yet locked in\n" - " }\n" + "\nExamples:\n" + HelpExampleCli("getblockchaininfo", "") + HelpExampleRpc("getblockchaininfo", "") @@ -815,13 +855,16 @@ UniValue getchaintips(const UniValue& params, bool fHelp) " \"penalty-at-tip\": \"xxxx\" (numeric, optional) penalty of the current tip of the branch\n" " \"blocks-to-mainchain\": \"xxxx\" (numeric, optional) confirmations needed for current branch to become the active chain (capped to 2000) \n" " }\n" + " ,...\n" "]\n" + "Possible values for status:\n" - "1. \"invalid\" This branch contains at least one invalid block\n" - "2. \"headers-only\" Not all blocks for this branch are available, but the headers are valid\n" - "3. \"valid-headers\" All blocks are available for this branch, but they were never fully validated\n" - "4. \"valid-fork\" This branch is not part of the active chain, but is fully validated\n" - "5. \"active\" This is the tip of the active main chain, which is certainly valid\n" + "1. \"invalid\" this branch contains at least one invalid block\n" + "2. \"headers-only\" not all blocks for this branch are available, but the headers are valid\n" + "3. \"valid-headers\" all blocks are available for this branch, but they were never fully validated\n" + "4. \"valid-fork\" this branch is not part of the active chain, but is fully validated\n" + "5. \"active\" this is the tip of the active main chain, which is certainly valid\n" + "\nExamples:\n" + HelpExampleCli("getchaintips", "") + HelpExampleRpc("getchaintips", "") @@ -922,12 +965,14 @@ UniValue getmempoolinfo(const UniValue& params, bool fHelp) throw runtime_error( "getmempoolinfo\n" "\nReturns details on the active state of the TX memory pool.\n" + "\nResult:\n" "{\n" - " \"size\": xxxxx (numeric) Current tx count\n" - " \"bytes\": xxxxx (numeric) Sum of all tx sizes\n" - " \"usage\": xxxxx (numeric) Total memory usage for the mempool\n" + " \"size\": xxxxx (numeric) current tx count\n" + " \"bytes\": xxxxx (numeric) sum of all tx sizes\n" + " \"usage\": xxxxx (numeric) total memory usage for the mempool\n" "}\n" + "\nExamples:\n" + HelpExampleCli("getmempoolinfo", "") + HelpExampleRpc("getmempoolinfo", "") @@ -942,9 +987,13 @@ UniValue invalidateblock(const UniValue& params, bool fHelp) throw runtime_error( "invalidateblock \"hash\"\n" "\nPermanently marks a block as invalid, as if it violated a consensus rule.\n" + "\nArguments:\n" "1. hash (string, required) the hash of the block to mark as invalid\n" + "\nResult:\n" + "Nothing\n" + "\nExamples:\n" + HelpExampleCli("invalidateblock", "\"blockhash\"") + HelpExampleRpc("invalidateblock", "\"blockhash\"") @@ -981,9 +1030,13 @@ UniValue reconsiderblock(const UniValue& params, bool fHelp) "reconsiderblock \"hash\"\n" "\nRemoves invalidity status of a block and its descendants, reconsider them for activation.\n" "This can be used to undo the effects of invalidateblock.\n" + "\nArguments:\n" "1. hash (string, required) the hash of the block to reconsider\n" + "\nResult:\n" + "Nothing\n" + "\nExamples:\n" + HelpExampleCli("reconsiderblock", "\"blockhash\"") + HelpExampleRpc("reconsiderblock", "\"blockhash\"") @@ -1077,8 +1130,16 @@ UniValue getblockfinalityindex(const UniValue& params, bool fHelp) throw runtime_error( "getblockfinalityindex \"hash\"\n" "\nReturns the minimum number of consecutive blocks a miner should mine from now in order to revert the block of given hash\n" + + "\nArguments:\n" + "1. hash (string, required) the block hash" + + "\"Result:\n" + "n (numeric) number of consecutive blocks a miner should mine from now in order to revert the block of given hash\n" + "\nExamples:\n" + HelpExampleCli("getblockfinalityindex", "\"hash\"") + + HelpExampleRpc("getblockfinalityindex", "\"hash\"") ); LOCK(cs_main); @@ -1142,8 +1203,17 @@ UniValue getglobaltips(const UniValue& params, bool fHelp) throw runtime_error( "getglobaltips\n" "\nReturns the list of hashes of the tips of all the existing forks\n" + + "\nResult:\n" + "Global tips: n (numeric, global forks tips)\n" + "-----------------------\n" + "h(n (numeric, block height index)) \"hash\" (string, block hash) onFork[-] time[xxxxx (numeric, time)]\n" + "Ordered: ---------------\n" + "[\"hash\" (string, block hash) ]\n" + "\nExamples:\n" + HelpExampleCli("getglobaltips", "\"hash\"") + + HelpExampleRpc("getglobaltips", "\"hash\"") ); } LOCK(cs_main); @@ -1161,8 +1231,13 @@ UniValue dbg_log(const UniValue& params, bool fHelp) "dbg_log\n" "\nPrints on debug.log any passed string." "\n(Valid only in regtest)\n" + + "\nResult:\n" + "Nothing\n" + "\nExamples:\n" + HelpExampleCli("dbg_log", "\"\"") + + HelpExampleRpc("dbg_log", "\"\"") ); } if (Params().NetworkIDString() != "regtest") From dacbe28e16f2cf873b446956a9912351566e933a Mon Sep 17 00:00:00 2001 From: luisantoniocrag Date: Sat, 13 Mar 2021 18:49:58 -0600 Subject: [PATCH 03/33] Fix RPC mining call help messages --- src/rpc/mining.cpp | 190 +++++++++++++++++++++++++++------------------ 1 file changed, 116 insertions(+), 74 deletions(-) diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp index c0b485d86f..d1f106e1b0 100644 --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -85,8 +85,10 @@ UniValue getlocalsolps(const UniValue& params, bool fHelp) "getlocalsolps\n" "\nReturns the average local solutions per second since this node was started.\n" "This is the same information shown on the metrics screen (if enabled).\n" + "\nResult:\n" - "xxx.xxxxx (numeric) Solutions per second average\n" + "xxxx (numeric) solutions per second average\n" + "\nExamples:\n" + HelpExampleCli("getlocalsolps", "") + HelpExampleRpc("getlocalsolps", "") @@ -104,11 +106,14 @@ UniValue getnetworksolps(const UniValue& params, bool fHelp) "\nReturns the estimated network solutions per second based on the last n blocks.\n" "Pass in [blocks] to override # of blocks, -1 specifies over difficulty averaging window.\n" "Pass in [height] to estimate the network speed at the time when a certain block was found.\n" + "\nArguments:\n" - "1. blocks (numeric, optional, default=120) The number of blocks, or -1 for blocks over difficulty averaging window.\n" - "2. height (numeric, optional, default=-1) To estimate at the time of the given height.\n" + "1. blocks (numeric, optional, default=120) the number of blocks, or -1 for blocks over difficulty averaging window\n" + "2. height (numeric, optional, default=-1) to estimate at the time of the given height\n" + "\nResult:\n" - "x (numeric) Solutions per second estimated\n" + "x (numeric) solutions per second estimated\n" + "\nExamples:\n" + HelpExampleCli("getnetworksolps", "") + HelpExampleRpc("getnetworksolps", "") @@ -127,11 +132,14 @@ UniValue getnetworkhashps(const UniValue& params, bool fHelp) "\nReturns the estimated network solutions per second based on the last n blocks.\n" "Pass in [blocks] to override # of blocks, -1 specifies over difficulty averaging window.\n" "Pass in [height] to estimate the network speed at the time when a certain block was found.\n" + "\nArguments:\n" - "1. blocks (numeric, optional, default=120) The number of blocks, or -1 for blocks over difficulty averaging window.\n" - "2. height (numeric, optional, default=-1) To estimate at the time of the given height.\n" + "1. blocks (numeric, optional, default=120) the number of blocks, or -1 for blocks over difficulty averaging window\n" + "2. height (numeric, optional, default=-1) to estimate at the time of the given height\n" + "\nResult:\n" - "x (numeric) Solutions per second estimated\n" + "x (numeric) solutions per second estimated\n" + "\nExamples:\n" + HelpExampleCli("getnetworkhashps", "") + HelpExampleRpc("getnetworkhashps", "") @@ -150,8 +158,10 @@ UniValue getgenerate(const UniValue& params, bool fHelp) "\nReturn if the server is set to generate coins or not. The default is false.\n" "It is set with the command line argument -gen (or zen.conf setting gen)\n" "It can also be set with the setgenerate call.\n" + "\nResult\n" - "true|false (boolean) If the server is set to generate coins or not\n" + "true|false (boolean) if the server is set to generate coins or not\n" + "\nExamples:\n" + HelpExampleCli("getgenerate", "") + HelpExampleRpc("getgenerate", "") @@ -165,15 +175,22 @@ UniValue generate(const UniValue& params, bool fHelp) if (fHelp || params.size() < 1 || params.size() > 1) throw runtime_error( "generate numblocks\n" - "\nMine blocks immediately (before the RPC call returns)\n" - "\nNote: this function can only be used on the regtest network\n" + "\nMine blocks immediately (before the RPC call returns).\n" + "\nNote: this function can only be used on the regtest network.\n" + "\nArguments:\n" - "1. numblocks (numeric) How many blocks are generated immediately.\n" + "1. numblocks (numeric) how many blocks are generated immediately\n" + "\nResult\n" - "[ blockhashes ] (array) hashes of blocks generated\n" + "[ (array) hashes of blocks generated\n" + "\"hash\": (string) hash of the block\n" + ",...\n" + "]\n" + "\nExamples:\n" "\nGenerate 11 blocks\n" + HelpExampleCli("generate", "11") + + HelpExampleRpc("generate", "11") ); if (GetArg("-mineraddress", "").empty()) { @@ -239,9 +256,13 @@ UniValue setgenerate(const UniValue& params, bool fHelp) "\nSet 'generate' true or false to turn generation on or off.\n" "Generation is limited to 'genproclimit' processors, -1 is unlimited.\n" "See the getgenerate call for the current setting.\n" + "\nArguments:\n" - "1. generate (boolean, required) Set to true to turn on generation, off to turn off.\n" - "2. genproclimit (numeric, optional) Set the processor limit for when generation is on. Can be -1 for unlimited.\n" + "1. generate (boolean, required) set to true to turn on generation, off to turn off\n" + "2. genproclimit (numeric, optional) set the processor limit for when generation is on. Can be -1 for unlimited\n" + "\nResult:\n" + "Nothing\n" + "\nExamples:\n" "\nSet the generation on with a limit of one processor\n" + HelpExampleCli("setgenerate", "true 1") + @@ -296,21 +317,23 @@ UniValue getmininginfo(const UniValue& params, bool fHelp) throw runtime_error( "getmininginfo\n" "\nReturns a json object containing mining-related information." + "\nResult:\n" "{\n" - " \"blocks\": nnn, (numeric) The current block\n" - " \"currentblocksize\": nnn, (numeric) The last block size\n" - " \"currentblocktx\": nnn, (numeric) The last block transaction\n" - " \"difficulty\": xxx.xxxxx (numeric) The current difficulty\n" - " \"errors\": \"...\" (string) Current errors\n" - " \"generate\": true|false (boolean) If the generation is on or off (see getgenerate or setgenerate calls)\n" - " \"genproclimit\": n (numeric) The processor limit for generation. -1 if no generation. (see getgenerate or setgenerate calls)\n" - " \"localsolps\": xxx.xxxxx (numeric) The average local solution rate in Sol/s since this node was started\n" - " \"networksolps\": x (numeric) The estimated network solution rate in Sol/s\n" - " \"pooledtx\": n (numeric) The size of the mem pool\n" - " \"testnet\": true|false (boolean) If using testnet or not\n" - " \"chain\": \"xxxx\", (string) current network name as defined in BIP70 (main, test, regtest)\n" + " \"blocks\": nnn, (numeric) the current block\n" + " \"currentblocksize\": nnn, (numeric) the last block size\n" + " \"currentblocktx\": nnn, (numeric) the last block transaction\n" + " \"difficulty\": xxxxxxxx, (numeric) the current difficulty\n" + " \"errors\": \"...\", (string) current errors\n" + " \"generate\": true|false, (boolean) if the generation is on or off (see getgenerate or setgenerate calls)\n" + " \"genproclimit\": n, (numeric) the processor limit for generation. -1 if no generation. (see getgenerate or setgenerate calls)\n" + " \"localsolps\": xxxxxxxx, (numeric) the average local solution rate in Sol/s since this node was started\n" + " \"networksolps\": x, (numeric) the estimated network solution rate in Sol/s\n" + " \"pooledtx\": n, (numeric) the size of the mem pool\n" + " \"testnet\": true|false, (boolean) if using testnet or not\n" + " \"chain\": \"xxxx\" (string) current network name as defined in BIP70 (main, test, regtest)\n" "}\n" + "\nExamples:\n" + HelpExampleCli("getmininginfo", "") + HelpExampleRpc("getmininginfo", "") @@ -346,16 +369,19 @@ UniValue prioritisetransaction(const UniValue& params, bool fHelp) throw runtime_error( "prioritisetransaction \n" "Accepts the transaction into mined blocks at a higher (or lower) priority\n" + "\nArguments:\n" - "1. \"txid\" (string, required) The transaction id.\n" - "2. priority delta (numeric, required) The priority to add or subtract.\n" - " The transaction selection algorithm considers the tx as it would have a higher priority.\n" + "1. \"txid\" (string, required) the transaction id\n" + "2. priority delta (numeric, required) the priority to add or subtract\n" + " the transaction selection algorithm considers the tx as it would have a higher priority\n" " (priority of a transaction is calculated: coinage * value_in_satoshis / txsize) \n" - "3. fee delta (numeric, required) The fee value (in satoshis) to add (or subtract, if negative).\n" - " The fee is not actually paid, only the algorithm for selecting transactions into a block\n" - " considers the transaction as it would have paid a higher (or lower) fee.\n" + "3. fee delta (numeric, required) the fee value (in satoshis) to add (or subtract, if negative)\n" + " the fee is not actually paid, only the algorithm for selecting transactions into a block\n" + " considers the transaction as it would have paid a higher (or lower) fee\n" + "\nResult\n" - "true (boolean) Returns true\n" + "true (boolean) returns true\n" + "\nExamples:\n" + HelpExampleCli("prioritisetransaction", "\"txid\" 0.0 10000") + HelpExampleRpc("prioritisetransaction", "\"txid\", 0.0, 10000") @@ -400,11 +426,11 @@ UniValue getblocktemplate(const UniValue& params, bool fHelp) "See https://en.bitcoin.it/wiki/BIP_0022 for full specification.\n" "\nArguments:\n" - "1. \"jsonrequestobject\" (string, optional) A json object in the following spec\n" + "1. \"jsonrequestobject\" (string, optional) a json object in the following spec\n" " {\n" - " \"mode\":\"template\" (string, optional) This must be set to \"template\" or omitted\n" - " \"capabilities\":[ (array, optional) A list of strings\n" - " \"support\" (string) client side supported feature, 'longpoll', 'coinbasetxn', 'coinbasevalue', 'proposal', 'serverlist', 'workid'\n" + " \"mode\":\"template\" (string, optional) this must be set to \"template\" or omitted\n" + " \"capabilities\":[ (array, optional) a list of strings\n" + " \"support\" (string) client side supported feature, 'longpoll', 'coinbasetxn', 'coinbasevalue', 'proposal', 'serverlist', 'workid'\n" " ,...\n" " ]\n" " }\n" @@ -412,39 +438,40 @@ UniValue getblocktemplate(const UniValue& params, bool fHelp) "\nResult:\n" "{\n" - " \"version\" : n, (numeric) The block version\n" - " \"previousblockhash\" : \"xxxx\", (string) The hash of current highest block\n" - " \"transactions\" : [ (array) contents of non-coinbase transactions that should be included in the next block\n" + " \"version\" : n, (numeric) the block version\n" + " \"previousblockhash\" : \"xxxx\", (string) the hash of current highest block\n" + " \"transactions\" : [ (array) contents of non-coinbase transactions that should be included in the next block\n" " {\n" - " \"data\" : \"xxxx\", (string) transaction data encoded in hexadecimal (byte-for-byte)\n" - " \"hash\" : \"xxxx\", (string) hash/id encoded in little-endian hexadecimal\n" - " \"depends\" : [ (array) array of numbers \n" - " n (numeric) transactions before this one (by 1-based index in 'transactions' list) that must be present in the final block if this one is\n" + " \"data\" : \"xxxx\", (string) transaction data encoded in hexadecimal (byte-for-byte)\n" + " \"hash\" : \"xxxx\", (string) hash/id encoded in little-endian hexadecimal\n" + " \"depends\" : [ (array) array of numbers \n" + " n (numeric) transactions before this one (by 1-based index in 'transactions' list) that must be present in the final block if this one is\n" " ,...\n" " ],\n" - " \"fee\": n, (numeric) difference in value between transaction inputs and outputs (in Satoshis); for coinbase transactions, this is a negative Number of the total collected block fees (ie, not including the block subsidy); if key is not present, fee is unknown and clients MUST NOT assume there isn't one\n" - " \"sigops\" : n, (numeric) total number of SigOps, as counted for purposes of block limits; if key is not present, sigop count is unknown and clients MUST NOT assume there aren't any\n" - " \"required\" : true|false (boolean) if provided and true, this transaction must be in the final block\n" + " \"fee\": n, (numeric) difference in value between transaction inputs and outputs (in Satoshis); for coinbase transactions, this is a negative Number of the total collected block fees (ie, not including the block subsidy); if key is not present, fee is unknown and clients MUST NOT assume there isn't one\n" + " \"sigops\" : n, (numeric) total number of SigOps, as counted for purposes of block limits; if key is not present, sigop count is unknown and clients MUST NOT assume there aren't any\n" + " \"required\" : true|false (boolean) if provided and true, this transaction must be in the final block\n" " }\n" " ,...\n" " ],\n" -// " \"coinbaseaux\" : { (json object) data that should be included in the coinbase's scriptSig content\n" -// " \"flags\" : \"flags\" (string) \n" +// " \"coinbaseaux\" : { (json object) data that should be included in the coinbase's scriptSig content\n" +// " \"flags\" : \"flags\" (string) \n" // " },\n" -// " \"coinbasevalue\" : n, (numeric) maximum allowable input to coinbase transaction, including the generation award and transaction fees (in Satoshis)\n" - " \"coinbasetxn\" : { ... }, (json object) information for coinbase transaction\n" - " \"target\" : \"xxxx\", (string) The hash target\n" - " \"mintime\" : xxx, (numeric) The minimum timestamp appropriate for next block time in seconds since epoch (Jan 1 1970 GMT)\n" - " \"mutable\" : [ (array of string) list of ways the block template may be changed \n" - " \"value\" (string) A way the block template may be changed, e.g. 'time', 'transactions', 'prevblock'\n" +// " \"coinbasevalue\" : n, (numeric) maximum allowable input to coinbase transaction, including the generation award and transaction fees (in Satoshis)\n" + " \"coinbasetxn\" : { ... }, (json object) information for coinbase transaction\n" + " \"longpollid\": \"xxxx\" (string) id to wait for" + " \"target\" : \"xxxx\", (string) the hash target\n" + " \"mintime\" : xxx, (numeric) the minimum timestamp appropriate for next block time in seconds since epoch (Jan 1 1970 GMT)\n" + " \"mutable\" : [ (array of string) list of ways the block template may be changed \n" + " \"value\" (string) a way the block template may be changed, e.g. 'time', 'transactions', 'prevblock'\n" " ,...\n" " ],\n" - " \"noncerange\" : \"00000000ffffffff\", (string) A range of valid nonces\n" - " \"sigoplimit\" : n, (numeric) limit of sigops in blocks\n" - " \"sizelimit\" : n, (numeric) limit of block size\n" - " \"curtime\" : ttt, (numeric) current timestamp in seconds since epoch (Jan 1 1970 GMT)\n" - " \"bits\" : \"xxx\", (string) compressed target of next block\n" - " \"height\" : n (numeric) The height of the next block\n" + " \"noncerange\" : \"00000000ffffffff\", (string) a range of valid nonces\n" + " \"sigoplimit\" : n, (numeric) limit of sigops in blocks\n" + " \"sizelimit\" : n, (numeric) limit of block size\n" + " \"curtime\" : ttt, (numeric) current timestamp in seconds since epoch (Jan 1 1970 GMT)\n" + " \"bits\" : \"xxx\", (string) compressed target of next block\n" + " \"height\" : n (numeric) the height of the next block\n" "}\n" "\nExamples:\n" @@ -726,18 +753,21 @@ UniValue submitblock(const UniValue& params, bool fHelp) "See https://en.bitcoin.it/wiki/BIP_0022 for full specification.\n" "\nArguments\n" - "1. \"hexdata\" (string, required) the hex-encoded block data to submit\n" + "1. \"hexdata\" (string, required) the hex-encoded block data to submit\n" "2. \"jsonparametersobject\" (string, optional) object of optional parameters\n" " {\n" - " \"workid\" : \"id\" (string, optional) if the server provided a workid, it MUST be included with submissions\n" + " \"workid\" : \"id\" (string, optional) if the server provided a workid, it MUST be included with submissions\n" " }\n" + "\nResult:\n" + "Nothing if success\n" "\"duplicate\" - node already has valid copy of block\n" "\"duplicate-invalid\" - node already has block, but it is invalid\n" "\"duplicate-inconclusive\" - node already has block but has not validated it\n" "\"inconclusive\" - node has not validated the block, it may not be on the node's current best chain\n" "\"rejected\" - block was rejected as invalid\n" "For more information on submitblock parameters and results, see: https://github.com/bitcoin/bips/blob/master/bip-0022.mediawiki#block-submission\n" + "\nExamples:\n" + HelpExampleCli("submitblock", "\"mydata\"") + HelpExampleRpc("submitblock", "\"mydata\"") @@ -791,16 +821,20 @@ UniValue estimatefee(const UniValue& params, bool fHelp) "\nEstimates the approximate fee per kilobyte\n" "needed for a transaction to begin confirmation\n" "within nblocks blocks.\n" + "\nArguments:\n" - "1. nblocks (numeric)\n" + "1. nblocks (numeric) number of blocks\n" + "\nResult:\n" - "n : (numeric) estimated fee-per-kilobyte\n" + "n : (numeric) estimated fee-per-kilobyte\n" "\n" "-1.0 is returned if not enough transactions and\n" "blocks have been observed to make an estimate.\n" + "\nExample:\n" + HelpExampleCli("estimatefee", "6") - ); + + HelpExampleRpc("estimatefee", "6") + ); RPCTypeCheck(params, boost::assign::list_of(UniValue::VNUM)); @@ -823,15 +857,19 @@ UniValue estimatepriority(const UniValue& params, bool fHelp) "\nEstimates the approximate priority\n" "a zero-fee transaction needs to begin confirmation\n" "within nblocks blocks.\n" + "\nArguments:\n" - "1. nblocks (numeric)\n" + "1. nblocks (numeric) number of blocks\n" + "\nResult:\n" - "n : (numeric) estimated priority\n" + "n : (numeric) estimated priority\n" "\n" "-1.0 is returned if not enough transactions and\n" "blocks have been observed to make an estimate.\n" + "\nExample:\n" + HelpExampleCli("estimatepriority", "6") + + HelpExampleRpc("estimatepriority", "6") ); RPCTypeCheck(params, boost::assign::list_of(UniValue::VNUM)); @@ -849,18 +887,22 @@ UniValue getblocksubsidy(const UniValue& params, bool fHelp) throw runtime_error( "getblocksubsidy height\n" "\nReturns block subsidy reward, taking into account the mining slow start and the community fund, of block at index provided.\n" + "\nArguments:\n" - "1. height (numeric, optional) The block height. If not provided, defaults to the current height of the chain.\n" + "1. height (numeric, optional) the block height\n" + " if not provided, defaults to the current height of the chain\n" + "\nResult:\n" "{\n" - " \"miner\" : x.xxx (numeric) The mining reward amount in ZEN.\n" - " \"community\" : x.xxx (numeric) The community fund amount in ZEN.\n" - " \"securenodes\" : x.xxx (numeric) The securenodes fund amount in ZEN (only if securenode HF fund is available).\n" - " \"supernodes\" : x.xxx (numeric) The supernodes fund amount in ZEN (only if supernode HF fund is available).\n" + " \"miner\": xxxx, (numeric) the mining reward amount in " + CURRENCY_UNIT + "\n" + " \"community\": xxxx, (numeric) the community fund amount in " + CURRENCY_UNIT + "\n" + " \"securenodes\": xxxx, (numeric) the securenodes fund amount in " + CURRENCY_UNIT + " (only if securenode HF fund is available)\n" + " \"supernodes\": xxxx (numeric) the supernodes fund amount in " + CURRENCY_UNIT + " (only if supernode HF fund is available)\n" "}\n" + "\nExamples:\n" + HelpExampleCli("getblocksubsidy", "1000") - + HelpExampleRpc("getblockubsidy", "1000") + + HelpExampleRpc("getblocksubsidy", "1000") ); LOCK(cs_main); From 4917fd3ec4420128072ad150ef1850665fbb2935 Mon Sep 17 00:00:00 2001 From: luisantoniocrag Date: Sat, 13 Mar 2021 18:50:05 -0600 Subject: [PATCH 04/33] Fix RPC net call help messages --- src/rpc/net.cpp | 213 +++++++++++++++++++++++++++++------------------- 1 file changed, 130 insertions(+), 83 deletions(-) diff --git a/src/rpc/net.cpp b/src/rpc/net.cpp index 2b3c5fe96a..50ed9afefc 100644 --- a/src/rpc/net.cpp +++ b/src/rpc/net.cpp @@ -26,9 +26,11 @@ UniValue getconnectioncount(const UniValue& params, bool fHelp) if (fHelp || params.size() != 0) throw runtime_error( "getconnectioncount\n" - "\nReturns the number of connections to other nodes.\n" - "\nbResult:\n" - "n (numeric) The connection count\n" + "\nReturns the number of active connections to other peers.\n" + + "\nResult:\n" + "n (numeric) the connection count\n" + "\nExamples:\n" + HelpExampleCli("getconnectioncount", "") + HelpExampleRpc("getconnectioncount", "") @@ -47,6 +49,10 @@ UniValue ping(const UniValue& params, bool fHelp) "\nRequests that a ping be sent to all other nodes, to measure ping time.\n" "Results provided in getpeerinfo, pingtime and pingwait fields are decimal seconds.\n" "Ping command is handled in queue with all other commands, so it measures processing backlog, not just network ping.\n" + + "\nResult:\n" + "Nothing\n" + "\nExamples:\n" + HelpExampleCli("ping", "") + HelpExampleRpc("ping", "") @@ -81,37 +87,40 @@ UniValue getpeerinfo(const UniValue& params, bool fHelp) throw runtime_error( "getpeerinfo\n" "\nReturns data about each connected network node as a json array of objects.\n" + "\nbResult:\n" "[\n" " {\n" - " \"id\": n, (numeric) Peer index\n" - " \"addr\":\"host:port\", (string) The ip address and port of the peer\n" - " \"addrlocal\":\"ip:port\", (string) local address\n" - " \"services\":\"xxxxxxxxxxxxxxxx\", (string) The services offered\n" - " \"tls_established\": true:false, (boolean) Status of TLS connection\n" - " \"tls_verified\": true:false, (boolean) Status of peer certificate. Will be true if a peer certificate can be verified with some trusted root certs \n" - " \"lastsend\": ttt, (numeric) The time in seconds since epoch (Jan 1 1970 GMT) of the last send\n" - " \"lastrecv\": ttt, (numeric) The time in seconds since epoch (Jan 1 1970 GMT) of the last receive\n" - " \"bytessent\": n, (numeric) The total bytes sent\n" - " \"bytesrecv\": n, (numeric) The total bytes received\n" - " \"conntime\": ttt, (numeric) The connection time in seconds since epoch (Jan 1 1970 GMT)\n" - " \"timeoffset\": ttt, (numeric) The time offset in seconds\n" - " \"pingtime\": n, (numeric) ping time\n" - " \"pingwait\": n, (numeric) ping wait\n" - " \"version\": v, (numeric) The peer version, such as 170002\n" - " \"subver\": \"/MagicBean:x.y.z[-v]/\", (string) The string version\n" - " \"inbound\": true|false, (boolean) Inbound (true) or Outbound (false)\n" - " \"startingheight\": n, (numeric) The starting height (block) of the peer\n" - " \"banscore\": n, (numeric) The ban score\n" - " \"synced_headers\": n, (numeric) The last header we have in common with this peer\n" - " \"synced_blocks\": n, (numeric) The last block we have in common with this peer\n" + " \"id\": n, (numeric) peer index\n" + " \"addr\": \"host:port\", (string) the ip address and port of the peer\n" + " \"addrlocal\": \"ip:port\", (string) local address\n" + " \"services\":\"xxxxxxxxxxxxxxxx\", (string) the services offered\n" + " \"tls_established\": true|false, (boolean) status of TLS connection\n" + " \"tls_verified\": true|false, (boolean) status of peer certificate. Will be true if a peer certificate can be verified with some trusted root certs \n" + " \"lastsend\": ttt, (numeric) the time in seconds since epoch (Jan 1 1970 GMT) of the last send\n" + " \"lastrecv\": ttt, (numeric) the time in seconds since epoch (Jan 1 1970 GMT) of the last receive\n" + " \"bytessent\": n, (numeric) the total bytes sent\n" + " \"bytesrecv\": n, (numeric) the total bytes received\n" + " \"conntime\": ttt, (numeric) the connection time in seconds since 1 Jan 1970 GMT\n" + " \"timeoffset\": ttt, (numeric) the time offset in seconds\n" + " \"pingtime\": n, (numeric) ping time\n" + " \"pingwait\": n, (numeric) ping wait\n" + " \"version\": v, (numeric) the protocol version of the peer\n" + " \"subver\": \"/MagicBean:x.y.z[-v]/\", (string) the user agent of the peer\n" + " \"inbound\": true|false, (boolean) inbound (true) or outbound (false)\n" + " \"startingheight\": n, (numeric) the starting height (block) of the peer\n" + " \"banscore\": n, (numeric) the ban score\n" + " \"synced_headers\": n, (numeric) the last header we have in common with this peer\n" + " \"synced_blocks\": n, (numeric) the last block we have in common with this peer\n" " \"inflight\": [\n" - " n, (numeric) The heights of blocks we're currently asking from this peer\n" + " n, (numeric) the heights of blocks we're currently asking from this peer\n" " ...\n" - " ]\n" + " ],\n" + " \"whitelisted\": true|false (boolean) whether the peer is whitelisted\n" " }\n" " ,...\n" "]\n" + "\nExamples:\n" + HelpExampleCli("getpeerinfo", "") + HelpExampleRpc("getpeerinfo", "") @@ -180,9 +189,14 @@ UniValue addnode(const UniValue& params, bool fHelp) "addnode \"node\" \"add|remove|onetry\"\n" "\nAttempts add or remove a node from the addnode list.\n" "Or try a connection to a node once.\n" + "\nArguments:\n" - "1. \"node\" (string, required) The node (see getpeerinfo for nodes)\n" + "1. \"node\" (string, required) the node (see getpeerinfo for nodes)\n" "2. \"command\" (string, required) 'add' to add a node to the list, 'remove' to remove a node from the list, 'onetry' to try a connection to the node once\n" + + "\nResult:\n" + "Nothing\n" + "\nExamples:\n" + HelpExampleCli("addnode", "\"192.168.0.6:8233\" \"onetry\"") + HelpExampleRpc("addnode", "\"192.168.0.6:8233\", \"onetry\"") @@ -225,8 +239,13 @@ UniValue disconnectnode(const UniValue& params, bool fHelp) throw runtime_error( "disconnectnode \"node\" \n" "\nImmediately disconnects from the specified node.\n" + "\nArguments:\n" - "1. \"node\" (string, required) The node (see getpeerinfo for nodes)\n" + "1. \"node\" (string, required) the node (see getpeerinfo for nodes)\n" + + "\nResult:\n" + "Nothing\n" + "\nExamples:\n" + HelpExampleCli("disconnectnode", "\"192.168.0.6:8233\"") + HelpExampleRpc("disconnectnode", "\"192.168.0.6:8233\"") @@ -245,22 +264,24 @@ UniValue getaddednodeinfo(const UniValue& params, bool fHelp) { if (fHelp || params.size() < 1 || params.size() > 2) throw runtime_error( - "getaddednodeinfo dns ( \"node\" )\n" + "getaddednodeinfo dns ( \"node\" )\n" "\nReturns information about the given added node, or all added nodes\n" "(note that onetry addnodes are not listed here)\n" "If dns is false, only a list of added nodes will be provided,\n" "otherwise connected information will also be available.\n" + "\nArguments:\n" - "1. dns (boolean, required) If false, only a list of added nodes will be provided, otherwise connected information will also be available.\n" - "2. \"node\" (string, optional) If provided, return information about this specific node, otherwise all nodes are returned.\n" + "1. dns (boolean, required) if false, only a list of added nodes will be provided, otherwise connected information will also be available\n" + "2. \"node\" (string, optional) if provided, return information about this specific node, otherwise all nodes are returned\n" + "\nResult:\n" "[\n" " {\n" - " \"addednode\" : \"192.168.0.201\", (string) The node ip address\n" - " \"connected\" : true|false, (boolean) If connected\n" + " \"addednode\" : \"192.168.0.201\", (string) the node ip address\n" + " \"connected\" : true|false, (boolean) if connected\n" " \"addresses\" : [\n" " {\n" - " \"address\" : \"192.168.0.201:8233\", (string) The Horizen server host and port\n" + " \"address\" : \"192.168.0.201:8233\", (string) the Horizen server host and port\n" " \"connected\" : \"outbound\" (string) connection, inbound or outbound\n" " }\n" " ,...\n" @@ -268,6 +289,7 @@ UniValue getaddednodeinfo(const UniValue& params, bool fHelp) " }\n" " ,...\n" "]\n" + "\nExamples:\n" + HelpExampleCli("getaddednodeinfo", "true") + HelpExampleCli("getaddednodeinfo", "true \"192.168.0.201\"") @@ -363,12 +385,14 @@ UniValue getnettotals(const UniValue& params, bool fHelp) "getnettotals\n" "\nReturns information about network traffic, including bytes in, bytes out,\n" "and current time.\n" + "\nResult:\n" "{\n" - " \"totalbytesrecv\": n, (numeric) Total bytes received\n" - " \"totalbytessent\": n, (numeric) Total bytes sent\n" - " \"timemillis\": t (numeric) Total cpu time\n" + " \"totalbytesrecv\": n, (numeric) total bytes received\n" + " \"totalbytessent\": n, (numeric) total bytes sent\n" + " \"timemillis\": t (numeric) number of milliseconds since 1 Jan 1970 GMT\n" "}\n" + "\nExamples:\n" + HelpExampleCli("getnettotals", "") + HelpExampleRpc("getnettotals", "") @@ -408,35 +432,38 @@ UniValue getnetworkinfo(const UniValue& params, bool fHelp) throw runtime_error( "getnetworkinfo\n" "Returns an object containing various state info regarding P2P networking.\n" + "\nResult:\n" "{\n" - " \"version\": xxxxx, (numeric) the server version\n" - " \"subversion\": \"/MagicBean:x.y.z[-v]/\", (string) the server subversion string\n" - " \"protocolversion\": xxxxx, (numeric) the protocol version\n" - " \"localservices\": \"xxxxxxxxxxxxxxxx\", (string) the services we offer to the network\n" - " \"timeoffset\": xxxxx, (numeric) the time offset (deprecated; always 0)\n" - " \"connections\": xxxxx, (numeric) the number of connections\n" - " \"tls_cert_verified\": true|flase, (boolean) true if the certificate of the current node is verified\n" - " \"networks\": [ (array) information per network\n" + " \"version\": xxxxx, (numeric) the version of the node as a numeric\n" + " \"subversion\": \"/MagicBean:x.y.z[-v]/\", (string) the subversion of the node, as advertised to peers\n" + " \"protocolversion\": xxxxx, (numeric) the protocol version of the node\n" + " \"localservices\": \"xxxxxxx\", (string) the services supported by the node, as advertised in its version message\n" + " \"timeoffset\": 0, (numeric) the time offset (deprecated; always 0)\n" + " \"connections\": xxxxx, (numeric) the total number of open connections for the node\n" + " \"tls_cert_verified\": true|flase, (boolean) true if the certificate of the current node is verified\n" + " \"networks\": [ (array) an array of objects describing IPV4, IPV6 and Onion network interface states\n" " {\n" - " \"name\": \"xxx\", (string) network (ipv4, ipv6 or onion)\n" - " \"limited\": true|false, (boolean) is the network limited using -onlynet?\n" - " \"reachable\": true|false, (boolean) is the network reachable?\n" - " \"proxy\": \"host:port\" (string) the proxy that is used for this network, or empty if none\n" + " \"name\": \"xxx\", (string) network (ipv4, ipv6 or onion)\n" + " \"limited\": true|false, (boolean) is the network limited using -onlynet?\n" + " \"reachable\": true|false, (boolean) is the network reachable?\n" + " \"proxy\": \"host:port\", (string) the proxy that is used for this network, or empty if none\n" + " \"proxy_randomize_credentials\": true|false (boolean) whether randomized credentials are used\n" " }\n" " ,...\n" " ],\n" - " \"relayfee\": x.xxxxxxxx, (numeric) minimum relay fee for non-free transactions in " + CURRENCY_UNIT + "/kB\n" - " \"localaddresses\": [ (array) list of local addresses\n" - " {\n" - " \"address\": \"xxxx\", (string) network address\n" - " \"port\": xxx, (numeric) network port\n" - " \"score\": xxx (numeric) relative score\n" - " }\n" - " ,...\n" - " ]\n" - " \"warnings\": \"...\" (string) any network warnings (such as alert messages) \n" + " \"relayfee\": xxxxxx, (numeric) minimum relay fee for non-free transactions in " + CURRENCY_UNIT + "/kB\n" + " \"localaddresses\": [ (array) an array of objects describing local addresses being listened on by the node\n" + " {\n" + " \"address\": \"xxxx\", (string) network address\n" + " \"port\": xxx, (numeric) network port\n" + " \"score\": xxx (numeric) relative score\n" + " }\n" + " ,...\n" + " ],\n" + " \"warnings\": \"...\" (string) any network warnings (such as alert messages) \n" "}\n" + "\nExamples:\n" + HelpExampleCli("getnetworkinfo", "") + HelpExampleRpc("getnetworkinfo", "") @@ -480,18 +507,23 @@ UniValue setban(const UniValue& params, bool fHelp) if (fHelp || params.size() < 2 || (strCommand != "add" && strCommand != "remove")) throw runtime_error( - "setban \"ip(/netmask)\" \"add|remove\" (bantime) (absolute)\n" - "\nAttempts add or remove a IP/Subnet from the banned list.\n" - "\nArguments:\n" - "1. \"ip(/netmask)\" (string, required) The IP/Subnet (see getpeerinfo for nodes ip) with a optional netmask (default is /32 = single ip)\n" - "2. \"command\" (string, required) 'add' to add a IP/Subnet to the list, 'remove' to remove a IP/Subnet from the list\n" - "3. \"bantime\" (numeric, optional) time in seconds how long (or until when if [absolute] is set) the ip is banned (0 or empty means using the default time of 24h which can also be overwritten by the -bantime startup argument)\n" - "4. \"absolute\" (boolean, optional) If set, the bantime must be a absolute timestamp in seconds since epoch (Jan 1 1970 GMT)\n" - "\nExamples:\n" - + HelpExampleCli("setban", "\"192.168.0.6\" \"add\" 86400") - + HelpExampleCli("setban", "\"192.168.0.0/24\" \"add\"") - + HelpExampleRpc("setban", "\"192.168.0.6\", \"add\" 86400") - ); + "setban \"ip(/netmask)\" \"add|remove\" (bantime) (absolute)\n" + "\nAttempts add or remove a IP/Subnet from the banned list.\n" + + "\nArguments:\n" + "1. \"ip(/netmask)\" (string, required) the IP/Subnet (see getpeerinfo for nodes ip) with a optional netmask (default is /32 = single ip)\n" + "2. \"command\" (string, required) 'add' to add a IP/Subnet to the list, 'remove' to remove a IP/Subnet from the list\n" + "3. \"bantime\" (numeric, optional) time in seconds how long (or until when if [absolute] is set) the ip is banned (0 or empty means using the default time of 24h which can also be overwritten by the -bantime startup argument)\n" + "4. \"absolute\" (boolean, optional) if set, the bantime must be a absolute timestamp in seconds since epoch (Jan 1 1970 GMT)\n" + + "\nResult:\n" + "Nothing\n" + + "\nExamples:\n" + + HelpExampleCli("setban", "\"192.168.0.6\" \"add\" 86400") + + HelpExampleCli("setban", "\"192.168.0.0/24\" \"add\"") + + HelpExampleRpc("setban", "\"192.168.0.6\", \"add\", 86400") + ); CSubNet subNet; CNetAddr netAddr; @@ -540,12 +572,23 @@ UniValue listbanned(const UniValue& params, bool fHelp) { if (fHelp || params.size() != 0) throw runtime_error( - "listbanned\n" - "\nList all banned IPs/Subnets.\n" - "\nExamples:\n" - + HelpExampleCli("listbanned", "") - + HelpExampleRpc("listbanned", "") - ); + "listbanned\n" + "\nList all banned IPs/Subnets.\n" + "If there are no banned IPs, it will return an empty array.\n" + + "\nResult:\n" + "[\n" + " {\n" + " \"address\": \"xxxxxx\" (numeric) IP/Subnet,\n" + " \"banned_until\": tttt (numeric) time in seconds how long the ip is banned\n" + " }\n" + " ,...\n" + "]\n" + + "\nExamples:\n" + + HelpExampleCli("listbanned", "") + + HelpExampleRpc("listbanned", "") + ); std::map banMap; CNode::GetBanned(banMap); @@ -566,12 +609,16 @@ UniValue clearbanned(const UniValue& params, bool fHelp) { if (fHelp || params.size() != 0) throw runtime_error( - "clearbanned\n" - "\nClear all banned IPs.\n" - "\nExamples:\n" - + HelpExampleCli("clearbanned", "") - + HelpExampleRpc("clearbanned", "") - ); + "clearbanned\n" + "\nClear all banned IPs.\n" + + "\nResult:\n" + "Nothing\n" + + "\nExamples:\n" + + HelpExampleCli("clearbanned", "") + + HelpExampleRpc("clearbanned", "") + ); CNode::ClearBanned(); From 5c10706f68cd485c0794be0777edb9ddbab4239b Mon Sep 17 00:00:00 2001 From: luisantoniocrag Date: Sat, 13 Mar 2021 18:50:29 -0600 Subject: [PATCH 05/33] Fix RPC rawtransaction call help messages --- src/rpc/rawtransaction.cpp | 245 ++++++++++++++++++++----------------- 1 file changed, 131 insertions(+), 114 deletions(-) diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp index 3ced285ae5..43eae1549a 100644 --- a/src/rpc/rawtransaction.cpp +++ b/src/rpc/rawtransaction.cpp @@ -180,78 +180,78 @@ UniValue getrawtransaction(const UniValue& params, bool fHelp) "If verbose is non-zero, returns an Object with information about 'txid'.\n" "\nArguments:\n" - "1. \"txid\" (string, required) The transaction id\n" - "2. verbose (numeric, optional, default=0) If 0, return a string, other return a json object\n" + "1. \"txid\" (string, required) the transaction id\n" + "2. verbose (numeric, optional, default=0) if 0, return a string, other return a json object\n" "\nResult (if verbose is not set or set to 0):\n" - "\"data\" (string) The serialized, hex-encoded data for 'txid'\n" + "\"data\": \"hex\" (string) the serialized, hex-encoded data for 'txid'\n" "\nResult (if verbose > 0):\n" "{\n" - " \"hex\" : \"data\", (string) The serialized, hex-encoded data for 'txid'\n" - " \"txid\" : \"id\", (string) The transaction id (same as provided)\n" - " \"version\" : n, (numeric) The version\n" - " \"locktime\" : ttt, (numeric) The lock time\n" - " \"vin\" : [ (array of json objects)\n" + " \"hex\": \"data\", (string) the serialized, hex-encoded data for 'txid'\n" + " \"txid\": \"id\", (string) the transaction id (same as provided)\n" + " \"version\": n, (numeric) the version\n" + " \"locktime\": ttt, (numeric) the lock time\n" + " \"vin\": [ (array of json objects)\n" " {\n" - " \"txid\": \"id\", (string) The transaction id\n" - " \"vout\": n, (numeric) \n" - " \"scriptSig\": { (json object) The script\n" - " \"asm\": \"asm\", (string) asm\n" - " \"hex\": \"hex\" (string) hex\n" + " \"txid\": \"id\", (string) the transaction id\n" + " \"vout\": n, (numeric) the output number\n" + " \"scriptSig\": { (json object) the script\n" + " \"asm\": \"asm\", (string) the asm\n" + " \"hex\": \"hex\" (string) the hex\n" " },\n" - " \"sequence\": n (numeric) The script sequence number\n" + " \"sequence\": n (numeric) the script sequence number\n" " }\n" " ,...\n" " ],\n" - " \"vout\" : [ (array of json objects)\n" + " \"vout\" : [ (array of json objects)\n" " {\n" - " \"value\" : x.xxx, (numeric) The value in " + CURRENCY_UNIT + "\n" - " \"n\" : n, (numeric) index\n" + " \"value\": x.xxx, (numeric) the value in " + CURRENCY_UNIT + "\n" + " \"n\": n, (numeric) index\n" " \"scriptPubKey\" : { (json object)\n" - " \"asm\" : \"asm\", (string) the asm\n" - " \"hex\" : \"hex\", (string) the hex\n" - " \"reqSigs\" : n, (numeric) The required sigs\n" - " \"type\" : \"pubkeyhash\", (string) The type, eg 'pubkeyhash'\n" - " \"addresses\" : [ (json array of string)\n" - " \"horizenaddress\" (string) Horizen address\n" + " \"asm\": \"asm\", (string) the asm\n" + " \"hex\": \"hex\", (string) the hex\n" + " \"reqSigs\": n, (numeric) the required sigs\n" + " \"type\": \"pubkeyhash\", (string) the type, eg 'pubkeyhash'\n" + " \"addresses\": [ (json array of string)\n" + " \"horizenaddress\" (string) Horizen address\n" " ,...\n" " ]\n" " }\n" " }\n" " ,...\n" " ],\n" - " \"vjoinsplit\" : [ (array of json objects, only for version >= 2)\n" + " \"vjoinsplit\" : [ (array of json objects, only for version >= 2)\n" " {\n" - " \"vpub_old\" : x.xxx, (numeric) public input value in " + CURRENCY_UNIT + "\n" - " \"vpub_new\" : x.xxx, (numeric) public output value in " + CURRENCY_UNIT + "\n" - " \"anchor\" : \"hex\", (string) the anchor\n" - " \"nullifiers\" : [ (json array of string)\n" + " \"vpub_old\": x.xxx, (numeric) public input value in " + CURRENCY_UNIT + "\n" + " \"vpub_new\": x.xxx, (numeric) public output value in " + CURRENCY_UNIT + "\n" + " \"anchor\": \"hex\", (string) the anchor\n" + " \"nullifiers\": [ (json array of string)\n" " \"hex\" (string) input note nullifier\n" " ,...\n" " ],\n" - " \"commitments\" : [ (json array of string)\n" + " \"commitments\": [ (json array of string)\n" " \"hex\" (string) output note commitment\n" " ,...\n" " ],\n" - " \"onetimePubKey\" : \"hex\", (string) the onetime public key used to encrypt the ciphertexts\n" - " \"randomSeed\" : \"hex\", (string) the random seed\n" - " \"macs\" : [ (json array of string)\n" + " \"onetimePubKey\": \"hex\", (string) the onetime public key used to encrypt the ciphertexts\n" + " \"randomSeed\": \"hex\", (string) the random seed\n" + " \"macs\": [ (json array of string)\n" " \"hex\" (string) input note MAC\n" " ,...\n" " ],\n" - " \"proof\" : \"hex\", (string) the zero-knowledge proof\n" - " \"ciphertexts\" : [ (json array of string)\n" + " \"proof\": \"hex\", (string) the zero-knowledge proof\n" + " \"ciphertexts\": [ (json array of string)\n" " \"hex\" (string) output note ciphertext\n" " ,...\n" " ]\n" " }\n" " ,...\n" " ],\n" - " \"blockhash\" : \"hash\", (string) the block hash\n" - " \"confirmations\" : n, (numeric) The confirmations\n" - " \"time\" : ttt, (numeric) The transaction time in seconds since epoch (Jan 1 1970 GMT)\n" - " \"blocktime\" : ttt (numeric) The block time in seconds since epoch (Jan 1 1970 GMT)\n" + " \"blockhash\": \"hash\", (string) the block hash\n" + " \"confirmations\": n, (numeric) The confirmations\n" + " \"time\": ttt, (numeric) The transaction time in seconds since epoch (Jan 1 1970 GMT)\n" + " \"blocktime\": ttt (numeric) The block time in seconds since epoch (Jan 1 1970 GMT)\n" "}\n" "\nExamples:\n" @@ -294,15 +294,21 @@ UniValue gettxoutproof(const UniValue& params, bool fHelp) "you need to maintain a transaction index, using the -txindex command line option or\n" "specify the block in which the transaction is included in manually (by blockhash).\n" "\nReturn the raw transaction data.\n" + "\nArguments:\n" - "1. \"txids\" (string) A json array of txids to filter\n" + "1. \"txids\" (string) a json array of txids to filter\n" " [\n" - " \"txid\" (string) A transaction hash\n" + " \"txid\" (string) a transaction hash\n" " ,...\n" " ]\n" - "2. \"block hash\" (string, optional) If specified, looks for txid in the block with this hash\n" + "2. \"block hash\" (string, optional) if specified, looks for txid in the block with this hash\n" + "\nResult:\n" - "\"data\" (string) A string that is a serialized, hex-encoded data for the proof.\n" + "\"data\": \"hex\" (string) a string that is a serialized, hex-encoded data for the proof\n" + + "\nExamples:\n" + + HelpExampleCli("gettxoutproof", "[\"txid\"]") + + HelpExampleRpc("gettxoutproof", "[\"txid\"]") ); set setTxids; @@ -371,10 +377,16 @@ UniValue verifytxoutproof(const UniValue& params, bool fHelp) "verifytxoutproof \"proof\"\n" "\nVerifies that a proof points to a transaction in a block, returning the transaction it commits to\n" "and throwing an RPC error if the block is not in our best chain\n" + "\nArguments:\n" - "1. \"proof\" (string, required) The hex-encoded proof generated by gettxoutproof\n" + "1. \"hexproof\" (string, required) the hex-encoded proof generated by gettxoutproof\n" + "\nResult:\n" - "[\"txid\"] (array, strings) The txid(s) which the proof commits to, or empty array if the proof is invalid\n" + "[\"txid\"] (array, strings) the txid(s) which the proof commits to, or empty array if the proof is invalid\n" + + "\nExamples:\n" + + HelpExampleCli("verifytxoutproof", "\"hexproof\"") + + HelpExampleRpc("verifytxoutproof", "\"hexproof\"") ); CDataStream ssMB(ParseHexV(params[0], "proof"), SER_NETWORK, PROTOCOL_VERSION); @@ -408,22 +420,22 @@ UniValue createrawtransaction(const UniValue& params, bool fHelp) "it is not stored in the wallet or transmitted to the network.\n" "\nArguments:\n" - "1. \"transactions\" (string, required) A json array of json objects\n" + "1. \"transactions\" (string, required) a json array of json objects\n" " [\n" " {\n" - " \"txid\":\"id\", (string, required) The transaction id\n" - " \"vout\":n (numeric, required) The output number\n" + " \"txid\": \"id\", (string, required) the transaction id\n" + " \"vout\": n (numeric, required) the output number\n" " }\n" " ,...\n" " ]\n" - "2. \"addresses\" (string, required) a json object with addresses as keys and amounts as values\n" + "2. \"addresses\" (string, required) a json object with addresses as keys and amounts as values\n" " {\n" - " \"address\": x.xxx (numeric, required) The key is the Horizen address, the value is the " + CURRENCY_UNIT + " amount\n" + " \"address\": xxxx (numeric, required) the key is the Horizen address, the value is the " + CURRENCY_UNIT + " amount\n" " ,...\n" " }\n" "\nResult:\n" - "\"transaction\" (string) hex string of the transaction\n" + "\"transaction\" (string) hex string of the transaction\n" "\nExamples\n" + HelpExampleCli("createrawtransaction", "\"[{\\\"txid\\\":\\\"myid\\\",\\\"vout\\\":0}]\" \"{\\\"address\\\":0.01}\"") @@ -484,64 +496,64 @@ UniValue decoderawtransaction(const UniValue& params, bool fHelp) "\nReturn a JSON object representing the serialized, hex-encoded transaction.\n" "\nArguments:\n" - "1. \"hex\" (string, required) The transaction hex string\n" + "1. \"hex\" (string, required) the transaction hex string\n" "\nResult:\n" "{\n" - " \"txid\" : \"id\", (string) The transaction id\n" - " \"version\" : n, (numeric) The version\n" - " \"locktime\" : ttt, (numeric) The lock time\n" - " \"vin\" : [ (array of json objects)\n" + " \"txid\": \"id\", (string) the transaction id\n" + " \"version\" : n, (numeric) the version\n" + " \"locktime\": ttt, (numeric) the lock time\n" + " \"vin\": [ (array of json objects)\n" " {\n" - " \"txid\": \"id\", (string) The transaction id\n" - " \"vout\": n, (numeric) The output number\n" - " \"scriptSig\": { (json object) The script\n" - " \"asm\": \"asm\", (string) asm\n" - " \"hex\": \"hex\" (string) hex\n" + " \"txid\": \"id\", (string) the transaction id\n" + " \"vout\": n, (numeric) the output number\n" + " \"scriptSig\": { (json object) the script\n" + " \"asm\": \"asm\", (string) the asm\n" + " \"hex\": \"hex\" (string) the hex\n" " },\n" - " \"sequence\": n (numeric) The script sequence number\n" + " \"sequence\": n (numeric) the script sequence number\n" " }\n" " ,...\n" " ],\n" - " \"vout\" : [ (array of json objects)\n" + " \"vout\" : [ (array of json objects)\n" " {\n" - " \"value\" : x.xxx, (numeric) The value in " + CURRENCY_UNIT + "\n" - " \"n\" : n, (numeric) index\n" - " \"scriptPubKey\" : { (json object)\n" - " \"asm\" : \"asm\", (string) the asm\n" - " \"hex\" : \"hex\", (string) the hex\n" - " \"reqSigs\" : n, (numeric) The required sigs\n" - " \"type\" : \"pubkeyhash\", (string) The type, eg 'pubkeyhash'\n" - " \"addresses\" : [ (json array of string)\n" - " \"t12tvKAXCxZjSmdNbao16dKXC8tRWfcF5oc\" (string) Horizen address\n" + " \"value\" : x.xxx, (numeric) the value in " + CURRENCY_UNIT + "\n" + " \"n\" : n, (numeric) index\n" + " \"scriptPubKey\" : { (json object)\n" + " \"asm\": \"asm\", (string) the asm\n" + " \"hex\": \"hex\", (string) the hex\n" + " \"reqSigs\": n, (numeric) the required sigs\n" + " \"type\": \"pubkeyhash\", (string) the type, eg 'pubkeyhash'\n" + " \"addresses\": [ (json array of string)\n" + " \"xxxxxxxx\" (string) Horizen address\n" " ,...\n" " ]\n" " }\n" " }\n" " ,...\n" " ],\n" - " \"vjoinsplit\" : [ (array of json objects, only for version >= 2)\n" + " \"vjoinsplit\": [ (array of json objects, only for version >= 2)\n" " {\n" - " \"vpub_old\" : x.xxx, (numeric) public input value in " + CURRENCY_UNIT + "\n" - " \"vpub_new\" : x.xxx, (numeric) public output value in " + CURRENCY_UNIT + "\n" - " \"anchor\" : \"hex\", (string) the anchor\n" - " \"nullifiers\" : [ (json array of string)\n" - " \"hex\" (string) input note nullifier\n" + " \"vpub_old\": xxxx, (numeric) public input value in " + CURRENCY_UNIT + "\n" + " \"vpub_new\": xxxx, (numeric) public output value in " + CURRENCY_UNIT + "\n" + " \"anchor\": \"hex\", (string) the anchor\n" + " \"nullifiers\": [ (json array of string)\n" + " \"hex\" (string) input note nullifier\n" " ,...\n" " ],\n" - " \"commitments\" : [ (json array of string)\n" - " \"hex\" (string) output note commitment\n" + " \"commitments\": [ (json array of string)\n" + " \"hex\" (string) output note commitment\n" " ,...\n" " ],\n" - " \"onetimePubKey\" : \"hex\", (string) the onetime public key used to encrypt the ciphertexts\n" - " \"randomSeed\" : \"hex\", (string) the random seed\n" - " \"macs\" : [ (json array of string)\n" - " \"hex\" (string) input note MAC\n" + " \"onetimePubKey\": \"hex\", (string) the onetime public key used to encrypt the ciphertexts\n" + " \"randomSeed\": \"hex\", (string) the random seed\n" + " \"macs\": [ (json array of string)\n" + " \"hex\" (string) input note MAC\n" " ,...\n" " ],\n" - " \"proof\" : \"hex\", (string) the zero-knowledge proof\n" - " \"ciphertexts\" : [ (json array of string)\n" - " \"hex\" (string) output note ciphertext\n" + " \"proof\": \"hex\", (string) the zero-knowledge proof\n" + " \"ciphertexts\": [ (json array of string)\n" + " \"hex\" (string) output note ciphertext\n" " ,...\n" " ]\n" " }\n" @@ -575,19 +587,21 @@ UniValue decodescript(const UniValue& params, bool fHelp) "decodescript \"hex\"\n" "\nDecode a hex-encoded script.\n" "\nArguments:\n" - "1. \"hex\" (string) the hex encoded script\n" + "1. \"hex\" (string) the hex encoded script\n" + "\nResult:\n" "{\n" - " \"asm\":\"asm\", (string) Script public key\n" - " \"hex\":\"hex\", (string) hex encoded public key\n" - " \"type\":\"type\", (string) The output type\n" - " \"reqSigs\": n, (numeric) The required signatures\n" - " \"addresses\": [ (json array of string)\n" - " \"address\" (string) Zen address\n" + " \"asm\": \"asm\", (string) script public key\n" + " \"hex\": \"hex\", (string) hex encoded public key\n" + " \"type\": \"type\", (string) the output type\n" + " \"reqSigs\": n, (numeric) the required signatures\n" + " \"addresses\": [ (json array of string)\n" + " \"address\" (string) Zen address\n" " ,...\n" " ],\n" - " \"p2sh\",\"address\" (string) script address\n" + " \"p2sh\",\"address\" (string) script address\n" "}\n" + "\nExamples:\n" + HelpExampleCli("decodescript", "\"hexstring\"") + HelpExampleRpc("decodescript", "\"hexstring\"") @@ -637,23 +651,23 @@ UniValue signrawtransaction(const UniValue& params, bool fHelp) #endif "\nArguments:\n" - "1. \"hexstring\" (string, required) The transaction hex string\n" - "2. \"prevtxs\" (string, optional) An json array of previous dependent transaction outputs\n" - " [ (json array of json objects, or 'null' if none provided)\n" + "1. \"hexstring\" (string, required) the transaction hex string\n" + "2. \"prevtxs\" (string, optional) an json array of previous dependent transaction outputs\n" + " [ (json array of json objects, or 'null' if none provided)\n" " {\n" - " \"txid\":\"id\", (string, required) The transaction id\n" - " \"vout\":n, (numeric, required) The output number\n" + " \"txid\": \"id\", (string, required) the transaction id\n" + " \"vout\": n, (numeric, required) the output number\n" " \"scriptPubKey\": \"hex\", (string, required) script key\n" " \"redeemScript\": \"hex\" (string, required for P2SH) redeem script\n" " }\n" " ,...\n" " ]\n" - "3. \"privatekeys\" (string, optional) A json array of base58-encoded private keys for signing\n" - " [ (json array of strings, or 'null' if none provided)\n" - " \"privatekey\" (string) private key in base58-encoding\n" + "3. \"privatekeys\" (string, optional) a json array of base58-encoded private keys for signing\n" + " [ (json array of strings, or 'null' if none provided)\n" + " \"privatekey\" (string) private key in base58-encoding\n" " ,...\n" " ]\n" - "4. \"sighashtype\" (string, optional, default=ALL) The signature hash type. Must be one of\n" + "4. \"sighashtype\" (string, optional, default=ALL) the signature hash type. Must be one of\n" " \"ALL\"\n" " \"NONE\"\n" " \"SINGLE\"\n" @@ -663,15 +677,15 @@ UniValue signrawtransaction(const UniValue& params, bool fHelp) "\nResult:\n" "{\n" - " \"hex\" : \"value\", (string) The hex-encoded raw transaction with signature(s)\n" - " \"complete\" : true|false, (boolean) If the transaction has a complete set of signatures\n" - " \"errors\" : [ (json array of objects) Script verification errors (if there are any)\n" + " \"hex\": \"value\", (string) the hex-encoded raw transaction with signature(s)\n" + " \"complete\": true|false, (boolean) if the transaction has a complete set of signatures\n" + " \"errors\": [ (json array of objects) script verification errors (if there are any)\n" " {\n" - " \"txid\" : \"hash\", (string) The hash of the referenced, previous transaction\n" - " \"vout\" : n, (numeric) The index of the output to spent and used as input\n" - " \"scriptSig\" : \"hex\", (string) The hex-encoded signature script\n" - " \"sequence\" : n, (numeric) Script sequence number\n" - " \"error\" : \"text\" (string) Verification or signing error related to the input\n" + " \"txid\": \"hash\", (string) the hash of the referenced, previous transaction\n" + " \"vout\": n, (numeric) the index of the output to spent and used as input\n" + " \"scriptSig\": \"hex\", (string) the hex-encoded signature script\n" + " \"sequence\": n, (numeric) script sequence number\n" + " \"error\": \"text\" (string) verification or signing error related to the input\n" " }\n" " ,...\n" " ]\n" @@ -871,11 +885,14 @@ UniValue sendrawtransaction(const UniValue& params, bool fHelp) "sendrawtransaction \"hexstring\" ( allowhighfees )\n" "\nSubmits raw transaction (serialized, hex-encoded) to local node and network.\n" "\nAlso see createrawtransaction and signrawtransaction calls.\n" + "\nArguments:\n" - "1. \"hexstring\" (string, required) The hex string of the raw transaction)\n" - "2. allowhighfees (boolean, optional, default=false) Allow high fees\n" + "1. \"hexstring\" (string, required) the hex string of the raw transaction)\n" + "2. allowhighfees (boolean, optional, default=false) allow high fees\n" + "\nResult:\n" - "\"hex\" (string) The transaction hash in hex\n" + "\"hex\" (string) the transaction hash in hex\n" + "\nExamples:\n" "\nCreate a transaction\n" + HelpExampleCli("createrawtransaction", "\"[{\\\"txid\\\" : \\\"mytxid\\\",\\\"vout\\\":0}]\" \"{\\\"myaddress\\\":0.01}\"") + From 78c788bd816623792e054a6204e40f2c5d0586f9 Mon Sep 17 00:00:00 2001 From: luisantoniocrag Date: Sat, 13 Mar 2021 18:50:51 -0600 Subject: [PATCH 06/33] Fix RPC rpcdisclosure call help messages --- src/wallet/rpcdisclosure.cpp | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/src/wallet/rpcdisclosure.cpp b/src/wallet/rpcdisclosure.cpp index ca71c1bf5b..a0d933857c 100644 --- a/src/wallet/rpcdisclosure.cpp +++ b/src/wallet/rpcdisclosure.cpp @@ -53,13 +53,15 @@ UniValue z_getpaymentdisclosure(const UniValue& params, bool fHelp) "\nGenerate a payment disclosure for a given joinsplit output.\n" "\nEXPERIMENTAL FEATURE\n" + strPaymentDisclosureDisabledMsg + + "\nArguments:\n" - "1. \"txid\" (string, required) \n" - "2. \"js_index\" (string, required) \n" - "3. \"output_index\" (string, required) \n" - "4. \"message\" (string, optional) \n" + "1. \"txid\" (string, required) the transaction id\n" + "2. \"js_index\" (numeric, required) the js index\n" + "3. \"output_index\" (numeric, required) the output index\n" + "4. \"message\" (string, optional) the message\n" + "\nResult:\n" - "\"paymentdisclosure\" (string) Hex data string, with \"zpd:\" prefix.\n" + "\"paymentdisclosure\" (string) hex data string, with \"zpd:\" prefix.\n" "\nExamples:\n" + HelpExampleCli("z_getpaymentdisclosure", "96f12882450429324d5f3b48630e3168220e49ab7b0f066e5c2935a6b88bb0f2 0 0 \"refund\"") + HelpExampleRpc("z_getpaymentdisclosure", "\"96f12882450429324d5f3b48630e3168220e49ab7b0f066e5c2935a6b88bb0f2\", 0, 0, \"refund\"") @@ -159,8 +161,27 @@ UniValue z_validatepaymentdisclosure(const UniValue& params, bool fHelp) "\nValidates a payment disclosure.\n" "\nEXPERIMENTAL FEATURE\n" + strPaymentDisclosureDisabledMsg + + "\nArguments:\n" - "1. \"paymentdisclosure\" (string, required) Hex data string, with \"zpd:\" prefix.\n" + "1. \"paymentdisclosure\" (string, required) hex data string, with \"zpd:\" prefix\n" + + "\nResult:\n" + "{\n (array) information about the payment disclosure\n" + "\"txid\": \"hash\", (string) the transaction id\n" + "\"jsIndex\": n, (numeric) the js index\n" + "\"outputIndex\": n, (numeric) the output index\n" + "\"version\": nn, (numeric) version 0 = experimental, 1 = first production version\n" + "\"onetimePrivKey\": \"hex\", (string) one time private key for validate the payment disclosure\n" + "\"message\": \"xxxxx\", (string) message of the payment disclosure\n" + "\"joinSplitPubKey\": \"hex\", (string) the hex-coded public key\n" + "\"signatureVerified\": true|false, (boolean) if the signature is verified or not\n" + "\"paymentAddress\": \"zenaddress\", (string) the ZEN address for the payment\n" + "\"memo\": \"hex\", (string) hexademical string representation of memo field\n" + "\"value\": nnn, (numeric) the total value\n" + "\"commitmentMatch\": true|false, (boolean) if the commitment derived from payment disclosure match blockchain commitment or not\n" + "\"valid\": true|false (boolean) if the payment disclosure is valid or not\n" + "}\n" + "\nExamples:\n" + HelpExampleCli("z_validatepaymentdisclosure", "\"zpd:706462ff004c561a0447ba2ec51184e6c204...\"") + HelpExampleRpc("z_validatepaymentdisclosure", "\"zpd:706462ff004c561a0447ba2ec51184e6c204...\"") From cec668cabc70cdb24f987f112e68f05cfef1377d Mon Sep 17 00:00:00 2001 From: luisantoniocrag Date: Sat, 13 Mar 2021 18:50:57 -0600 Subject: [PATCH 07/33] Fix RPC server call help messages --- src/rpc/server.cpp | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/rpc/server.cpp b/src/rpc/server.cpp index 6a11b55f86..3e33cd93b4 100644 --- a/src/rpc/server.cpp +++ b/src/rpc/server.cpp @@ -225,10 +225,15 @@ UniValue help(const UniValue& params, bool fHelp) throw runtime_error( "help ( \"command\" )\n" "\nList all commands, or get help for a specified command.\n" + "\nArguments:\n" - "1. \"command\" (string, optional) The command to get help on\n" + "1. \"command\" (string, optional) the command to get help on\n" "\nResult:\n" - "\"text\" (string) The help text\n" + "\"text\" (string) the help text\n" + + "\nExamples:\n" + + HelpExampleCli("help", "") + + HelpExampleRpc("help", "") ); string strCommand; @@ -245,7 +250,16 @@ UniValue stop(const UniValue& params, bool fHelp) if (fHelp || params.size() > 1) throw runtime_error( "stop\n" - "\nStop Zen server."); + "\nStop Zen server." + + "\nResult\n" + "Nothing if is success\n" + "\"Failure\": \"xxxx\" (string) rejected reason" + + "\nExamples:\n" + + HelpExampleCli("stop", "") + + HelpExampleRpc("stop", "") + ); // Shutdown will take long enough that the response should get back StartShutdown(); return "Zen server stopping"; From dc825086f7343e384e295e8e3f50bff91352ec1b Mon Sep 17 00:00:00 2001 From: luisantoniocrag Date: Sat, 13 Mar 2021 18:51:09 -0600 Subject: [PATCH 08/33] Fix RPC rpcdump call help messages --- src/wallet/rpcdump.cpp | 125 +++++++++++++++++++++++++++-------------- 1 file changed, 83 insertions(+), 42 deletions(-) diff --git a/src/wallet/rpcdump.cpp b/src/wallet/rpcdump.cpp index c8168b9068..95acab4cfa 100644 --- a/src/wallet/rpcdump.cpp +++ b/src/wallet/rpcdump.cpp @@ -82,11 +82,16 @@ UniValue importprivkey(const UniValue& params, bool fHelp) throw runtime_error( "importprivkey \"horizenprivkey\" ( \"label\" rescan )\n" "\nAdds a private key (as returned by dumpprivkey) to your wallet.\n" + "\nArguments:\n" - "1. \"horizenprivkey\" (string, required) The private key (see dumpprivkey)\n" - "2. \"label\" (string, optional, default=\"\") An optional label\n" - "3. rescan (boolean, optional, default=true) Rescan the wallet for transactions\n" + "1. \"horizenprivkey\" (string, required) the private key (see dumpprivkey)\n" + "2. \"label\" (string, optional, default=\"\") an optional label\n" + "3. rescan (boolean, optional, default=true) rescan the wallet for transactions\n" "\nNote: This call can take minutes to complete if rescan is true.\n" + + "\nResult:\n" + "\"zenaddress\n (string) the zen address corresponding to the given private key\n" + "\nExamples:\n" "\nDump a private key\n" + HelpExampleCli("dumpprivkey", "\"myaddress\"") + @@ -157,11 +162,16 @@ UniValue importaddress(const UniValue& params, bool fHelp) throw runtime_error( "importaddress \"address\" ( \"label\" rescan )\n" "\nAdds an address or script (in hex) that can be watched as if it were in your wallet but cannot be used to spend.\n" + "\nArguments:\n" - "1. \"address\" (string, required) The address\n" - "2. \"label\" (string, optional, default=\"\") An optional label\n" - "3. rescan (boolean, optional, default=true) Rescan the wallet for transactions\n" + "1. \"address\" (string, required) the address\n" + "2. \"label\" (string, optional, default=\"\") an optional label\n" + "3. rescan (boolean, optional, default=true) rescan the wallet for transactions\n" "\nNote: This call can take minutes to complete if rescan is true.\n" + + "\nResult:\n" + "Nothing\n" + "\nExamples:\n" "\nImport an address with rescan\n" + HelpExampleCli("importaddress", "\"myaddress\"") + @@ -230,15 +240,20 @@ UniValue z_importwallet(const UniValue& params, bool fHelp) throw runtime_error( "z_importwallet \"filename\"\n" "\nImports taddr and zaddr keys from a wallet export file (see z_exportwallet).\n" + "\nArguments:\n" - "1. \"filename\" (string, required) The wallet file\n" + "1. \"filename\" (string, required) the wallet file\n" + + "\nResult:\n" + "Nothing\n" + "\nExamples:\n" "\nDump the wallet\n" - + HelpExampleCli("z_exportwallet", "\"test\"") + + + HelpExampleCli("z_exportwallet", "\"filename\"") + "\nImport the wallet\n" - + HelpExampleCli("z_importwallet", "\"test\"") + + + HelpExampleCli("z_importwallet", "\"filename\"") + "\nImport using the json rpc call\n" - + HelpExampleRpc("z_importwallet", "\"test\"") + + HelpExampleRpc("z_importwallet", "\"filename\"") ); return importwallet_impl(params, fHelp, true); @@ -253,15 +268,20 @@ UniValue importwallet(const UniValue& params, bool fHelp) throw runtime_error( "importwallet \"filename\"\n" "\nImports taddr keys from a wallet dump file (see dumpwallet).\n" + "\nArguments:\n" - "1. \"filename\" (string, required) The wallet file\n" + "1. \"filename\" (string, required) the wallet file\n" + + "\nResult:\n" + "Nothing\n" + "\nExamples:\n" "\nDump the wallet\n" - + HelpExampleCli("dumpwallet", "\"test\"") + + + HelpExampleCli("dumpwallet", "\"filename\"") + "\nImport the wallet\n" - + HelpExampleCli("importwallet", "\"test\"") + + + HelpExampleCli("importwallet", "\"filename\"") + "\nImport using the json rpc call\n" - + HelpExampleRpc("importwallet", "\"test\"") + + HelpExampleRpc("importwallet", "\"filename\"") ); return importwallet_impl(params, fHelp, false); @@ -391,10 +411,13 @@ UniValue dumpprivkey(const UniValue& params, bool fHelp) "dumpprivkey \"horizenaddress\"\n" "\nReveals the private key corresponding to 'horizenaddress'.\n" "Then the importprivkey can be used with this output\n" + "\nArguments:\n" - "1. \"horizenaddress\" (string, required) The Horizen address for the private key\n" + "1. \"horizenaddress\" (string, required) the Horizen address for the private key\n" + "\nResult:\n" - "\"key\" (string) The private key\n" + "\"key\" (string) the private key\n" + "\nExamples:\n" + HelpExampleCli("dumpprivkey", "\"myaddress\"") + HelpExampleCli("importprivkey", "\"mykey\"") @@ -430,12 +453,15 @@ UniValue z_exportwallet(const UniValue& params, bool fHelp) "z_exportwallet \"filename\"\n" "\nExports all wallet keys, for taddr and zaddr, in a human-readable format. Overwriting an existing file is not permitted.\n" "\nArguments:\n" + "1. \"filename\" (string, required) The filename, saved in folder set by zend -exportdir option\n" + "\nResult:\n" - "\"path\" (string) The full path of the destination file\n" + "\"path\" (string) the full path of the destination file\n" + "\nExamples:\n" - + HelpExampleCli("z_exportwallet", "\"test\"") - + HelpExampleRpc("z_exportwallet", "\"test\"") + + HelpExampleCli("z_exportwallet", "\"filename\"") + + HelpExampleRpc("z_exportwallet", "\"filename\"") ); return dumpwallet_impl(params, fHelp, true); @@ -450,13 +476,16 @@ UniValue dumpwallet(const UniValue& params, bool fHelp) throw runtime_error( "dumpwallet \"filename\"\n" "\nDumps taddr wallet keys in a human-readable format. Overwriting an existing file is not permitted.\n" + "\nArguments:\n" - "1. \"filename\" (string, required) The filename, saved in folder set by zend -exportdir option\n" + "1. \"filename\" (string, required) the filename, saved in folder set by zend -exportdir option\n" + "\nResult:\n" - "\"path\" (string) The full path of the destination file\n" + "\"path\" (string) the full path of the destination file\n" + "\nExamples:\n" - + HelpExampleCli("dumpwallet", "\"test\"") - + HelpExampleRpc("dumpwallet", "\"test\"") + + HelpExampleCli("dumpwallet", "\"filename\"") + + HelpExampleRpc("dumpwallet", "\"filename\"") ); return dumpwallet_impl(params, fHelp, false); @@ -561,22 +590,27 @@ UniValue z_importkey(const UniValue& params, bool fHelp) throw runtime_error( "z_importkey \"zkey\" ( rescan startHeight )\n" "\nAdds a zkey (as returned by z_exportkey) to your wallet.\n" + "\nArguments:\n" - "1. \"zkey\" (string, required) The zkey (see z_exportkey)\n" - "2. rescan (string, optional, default=\"whenkeyisnew\") Rescan the wallet for transactions - can be \"yes\", \"no\" or \"whenkeyisnew\"\n" - "3. startHeight (numeric, optional, default=0) Block height to start rescan from\n" + "1. \"zkey\" (string, required) the zkey (see z_exportkey)\n" + "2. rescan (string, optional, default=\"whenkeyisnew\") rescan the wallet for transactions - can be \"yes\", \"no\" or \"whenkeyisnew\"\n" + "3. startHeight (numeric, optional, default=0) block height to start rescan from\n" "\nNote: This call can take minutes to complete if rescan is true.\n" + + "\nResult:\n" + "Nothing\n" + "\nExamples:\n" "\nExport a zkey\n" + HelpExampleCli("z_exportkey", "\"myaddress\"") + "\nImport the zkey with rescan\n" - + HelpExampleCli("z_importkey", "\"mykey\"") + + + HelpExampleCli("z_importkey", "\"zkey\"") + "\nImport the zkey with partial rescan\n" - + HelpExampleCli("z_importkey", "\"mykey\" whenkeyisnew 30000") + + + HelpExampleCli("z_importkey", "\"zkey\" whenkeyisnew 30000") + "\nRe-import the zkey with longer partial rescan\n" - + HelpExampleCli("z_importkey", "\"mykey\" yes 20000") + + + HelpExampleCli("z_importkey", "\"zkey\" yes 20000") + "\nAs a JSON-RPC call\n" - + HelpExampleRpc("z_importkey", "\"mykey\", \"no\"") + + HelpExampleRpc("z_importkey", "\"zkey\", \"no\"") ); LOCK2(cs_main, pwalletMain->cs_wallet); @@ -657,11 +691,13 @@ UniValue z_importviewingkey(const UniValue& params, bool fHelp) throw runtime_error( "z_importviewingkey \"vkey\" ( rescan startHeight )\n" "\nAdds a viewing key (as returned by z_exportviewingkey) to your wallet.\n" + "\nArguments:\n" - "1. \"vkey\" (string, required) The viewing key (see z_exportviewingkey)\n" - "2. rescan (string, optional, default=\"whenkeyisnew\") Rescan the wallet for transactions - can be \"yes\", \"no\" or \"whenkeyisnew\"\n" - "3. startHeight (numeric, optional, default=0) Block height to start rescan from\n" + "1. \"vkey\" (string, required) the viewing key (see z_exportviewingkey)\n" + "2. rescan (string, optional, default=\"whenkeyisnew\") rescan the wallet for transactions - can be \"yes\", \"no\" or \"whenkeyisnew\"\n" + "3. startHeight (numeric, optional, default=0) block height to start rescan from\n" "\nNote: This call can take minutes to complete if rescan is true.\n" + "\nExamples:\n" "\nImport a viewing key\n" + HelpExampleCli("z_importviewingkey", "\"vkey\"") + @@ -746,15 +782,18 @@ UniValue z_exportkey(const UniValue& params, bool fHelp) throw runtime_error( "z_exportkey \"zaddr\"\n" "\nReveals the zkey corresponding to 'zaddr'.\n" - "Then the z_importkey can be used with this output\n" + "Then the z_importkey can be used with this output.\n" + "\nArguments:\n" - "1. \"zaddr\" (string, required) The zaddr for the private key\n" + "1. \"zaddr\" (string, required) the zaddr for the private key\n" + "\nResult:\n" - "\"key\" (string) The private key\n" + "\"key\" (string) the private key\n" + "\nExamples:\n" + HelpExampleCli("z_exportkey", "\"myaddress\"") - + HelpExampleCli("z_importkey", "\"mykey\"") - + HelpExampleRpc("z_exportkey", "\"myaddress\"") + + HelpExampleCli("z_importkey", "\"zaddr\"") + + HelpExampleRpc("z_exportkey", "\"zaddr\"") ); LOCK2(cs_main, pwalletMain->cs_wallet); @@ -784,13 +823,15 @@ UniValue z_exportviewingkey(const UniValue& params, bool fHelp) "z_exportviewingkey \"zaddr\"\n" "\nReveals the viewing key corresponding to 'zaddr'.\n" "Then the z_importviewingkey can be used with this output\n" + "\nArguments:\n" - "1. \"zaddr\" (string, required) The zaddr for the viewing key\n" + "1. \"zaddr\" (string, required) the zaddr for the viewing key\n" "\nResult:\n" - "\"vkey\" (string) The viewing key\n" + "\"vkey\" (string) the viewing key\n" + "\nExamples:\n" - + HelpExampleCli("z_exportviewingkey", "\"myaddress\"") - + HelpExampleRpc("z_exportviewingkey", "\"myaddress\"") + + HelpExampleCli("z_exportviewingkey", "\"zaddr\"") + + HelpExampleRpc("z_exportviewingkey", "\"zaddr\"") ); LOCK2(cs_main, pwalletMain->cs_wallet); From a59525a20700f51fc213872128f0bb8408b4a6bc Mon Sep 17 00:00:00 2001 From: luisantoniocrag Date: Sat, 13 Mar 2021 18:51:16 -0600 Subject: [PATCH 09/33] Fix RPC rpcwallet call help messages --- src/wallet/rpcwallet.cpp | 728 ++++++++++++++++++++++++--------------- 1 file changed, 454 insertions(+), 274 deletions(-) diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 85f87d1a57..769f9fc1f6 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -116,10 +116,13 @@ UniValue getnewaddress(const UniValue& params, bool fHelp) throw runtime_error( "getnewaddress ( \"account\" )\n" "\nReturns a new Horizen address for receiving payments.\n" + "\nArguments:\n" - "1. \"account\" (string, optional) DEPRECATED. If provided, it MUST be set to the empty string \"\" to represent the default account. Passing any other string will result in an error.\n" + "1. \"account\" (string, optional) DEPRECATED. If provided, it MUST be set to the empty string \"\" to represent the default account. Passing any other string will result in an error\n" + "\nResult:\n" - "\"horizenaddress\" (string) The new Horizen address\n" + "\"horizenaddress\" (string) the new Horizen address\n" + "\nExamples:\n" + HelpExampleCli("getnewaddress", "") + HelpExampleRpc("getnewaddress", "") @@ -199,10 +202,13 @@ UniValue getaccountaddress(const UniValue& params, bool fHelp) throw runtime_error( "getaccountaddress \"account\"\n" "\nDEPRECATED. Returns the current Horizen address for receiving payments to this account.\n" + "\nArguments:\n" - "1. \"account\" (string, required) MUST be set to the empty string \"\" to represent the default account. Passing any other string will result in an error.\n" + "1. \"account\" (string, required) MUST be set to the empty string \"\" to represent the default account. Passing any other string will result in an error\n" + "\nResult:\n" - "\"horizenaddress\" (string) The account Horizen address\n" + "\"horizenaddress\" (string) the account Horizen address\n" + "\nExamples:\n" + HelpExampleCli("getaccountaddress", "") + HelpExampleCli("getaccountaddress", "\"\"") @@ -232,8 +238,10 @@ UniValue getrawchangeaddress(const UniValue& params, bool fHelp) "getrawchangeaddress\n" "\nReturns a new Horizen address, for receiving change.\n" "This is for use with raw transactions, NOT normal use.\n" + "\nResult:\n" - "\"address\" (string) The address\n" + "\"address\" (string) the address\n" + "\nExamples:\n" + HelpExampleCli("getrawchangeaddress", "") + HelpExampleRpc("getrawchangeaddress", "") @@ -266,9 +274,14 @@ UniValue setaccount(const UniValue& params, bool fHelp) throw runtime_error( "setaccount \"horizenaddress\" \"account\"\n" "\nDEPRECATED. Sets the account associated with the given address.\n" + "\nArguments:\n" - "1. \"horizenaddress\" (string, required) The Horizen address to be associated with an account.\n" - "2. \"account\" (string, required) MUST be set to the empty string \"\" to represent the default account. Passing any other string will result in an error.\n" + "1. \"horizenaddress\" (string, required) the Horizen address to be associated with an account\n" + "2. \"account\" (string, required) MUST be set to the empty string \"\" to represent the default account. Passing any other string will result in an error\n" + + "\nResult:\n" + "Nothing\n" + "\nExamples:\n" + HelpExampleCli("setaccount", "\"t14oHp2v54vfmdgQ3v3SNuQga8JKHTNi2a1\" \"tabby\"") + HelpExampleRpc("setaccount", "\"t14oHp2v54vfmdgQ3v3SNuQga8JKHTNi2a1\", \"tabby\"") @@ -312,13 +325,16 @@ UniValue getaccount(const UniValue& params, bool fHelp) throw runtime_error( "getaccount \"horizenaddress\"\n" "\nDEPRECATED. Returns the account associated with the given address.\n" + "\nArguments:\n" - "1. \"horizenaddress\" (string, required) The horizen address for account lookup.\n" + "1. \"horizenaddress\" (string, required) the horizen address for account lookup\n" + "\nResult:\n" "\"accountname\" (string) the account address\n" + "\nExamples:\n" - + HelpExampleCli("getaccount", "\"t14oHp2v54vfmdgQ3v3SNuQga8JKHTNi2a1\"") - + HelpExampleRpc("getaccount", "\"t14oHp2v54vfmdgQ3v3SNuQga8JKHTNi2a1\"") + + HelpExampleCli("getaccount", "\"horizenaddress\"") + + HelpExampleRpc("getaccount", "\"horizenaddress\"") ); LOCK2(cs_main, pwalletMain->cs_wallet); @@ -344,13 +360,16 @@ UniValue getaddressesbyaccount(const UniValue& params, bool fHelp) throw runtime_error( "getaddressesbyaccount \"account\"\n" "\nDEPRECATED. Returns the list of addresses for the given account.\n" + "\nArguments:\n" "1. \"account\" (string, required) MUST be set to the empty string \"\" to represent the default account. Passing any other string will result in an error.\n" + "\nResult:\n" "[ (json array of string)\n" " \"horizenaddress\" (string) a horizen address associated with the given account\n" " ,...\n" "]\n" + "\nExamples:\n" + HelpExampleCli("getaddressesbyaccount", "\"tabby\"") + HelpExampleRpc("getaddressesbyaccount", "\"tabby\"") @@ -380,12 +399,14 @@ UniValue listaddresses(const UniValue& params, bool fHelp) if (fHelp || params.size() > 1) throw runtime_error( "listaddresses\n" - "Returns the list of transparent addresses.\n" + "Returns the list of transparent addresses\n" + "\nResult:\n" "[ (json array of string)\n" " \"horizenaddress\" (string) a horizen address associated with the given account\n" " ,...\n" "]\n" + "\nExamples:\n" + HelpExampleCli("listaddresses", "") + HelpExampleRpc("listaddresses", "") @@ -445,18 +466,21 @@ UniValue sendtoaddress(const UniValue& params, bool fHelp) "sendtoaddress \"horizenaddress\" amount ( \"comment\" \"comment-to\" subtractfeefromamount )\n" "\nSend an amount to a given address. The amount is a real and is rounded to the nearest 0.00000001\n" + HelpRequiringPassphrase() + + "\nArguments:\n" - "1. \"horizenaddress\" (string, required) The horizen address to send to.\n" - "2. \"amount\" (numeric, required) The amount in btc to send. eg 0.1\n" - "3. \"comment\" (string, optional) A comment used to store what the transaction is for. \n" - " This is not part of the transaction, just kept in your wallet.\n" - "4. \"comment-to\" (string, optional) A comment to store the name of the person or organization \n" - " to which you're sending the transaction. This is not part of the \n" - " transaction, just kept in your wallet.\n" - "5. subtractfeefromamount (boolean, optional, default=false) The fee will be deducted from the amount being sent.\n" - " The recipient will receive less Horizen than you enter in the amount field.\n" + "1. \"horizenaddress\" (string, required) the horizen address to send to\n" + "2. \"amount\" (numeric, required) the amount in " CURRENCY_UNIT + "\n" + "3. \"comment\" (string, optional) a comment used to store what the transaction is for\n" + " this is not part of the transaction, just kept in your wallet\n" + "4. \"comment-to\" (string, optional) a comment to store the name of the person or organization\n" + " to which you're sending the transaction\n" + " this is not part of thetransaction, just kept in your wallet\n" + "5. subtractfeefromamount (boolean, optional, default=false) the fee will be deducted from the amount being sent\n" + " the recipient will receive less Horizen than you enter in the amount field\n" + "\nResult:\n" - "\"transactionid\" (string) The transaction id.\n" + "\"transactionid\" (string) the transaction id\n" + "\nExamples:\n" + HelpExampleCli("sendtoaddress", "\"znnwwojWQJp1ARgbi1dqYtmnNMfihmg8m1b\" 0.1") + HelpExampleCli("sendtoaddress", "\"znnwwojWQJp1ARgbi1dqYtmnNMfihmg8m1b\" 0.1 \"donation\" \"ZenCash outpost\"") @@ -504,18 +528,20 @@ UniValue listaddressgroupings(const UniValue& params, bool fHelp) "\nLists groups of addresses which have had their common ownership\n" "made public by common use as inputs or as the resulting change\n" "in past transactions\n" + "\nResult:\n" "[\n" " [\n" " [\n" - " \"horizenaddress\", (string) The horizen address\n" - " amount, (numeric) The amount in btc\n" - " \"account\" (string, optional) The account (DEPRECATED)\n" + " \"horizenaddress\", (string) the horizen address\n" + " amount, (numeric) the amount in " + CURRENCY_UNIT + "\n" + " \"account\" (string, optional) the account (DEPRECATED)\n" " ]\n" " ,...\n" " ]\n" " ,...\n" "]\n" + "\nExamples:\n" + HelpExampleCli("listaddressgroupings", "") + HelpExampleRpc("listaddressgroupings", "") @@ -554,11 +580,14 @@ UniValue signmessage(const UniValue& params, bool fHelp) "signmessage \"horizenaddress\" \"message\"\n" "\nSign a message with the private key of an address" + HelpRequiringPassphrase() + "\n" + "\nArguments:\n" - "1. \"horizenaddress\" (string, required) The horizen address to use for the private key.\n" - "2. \"message\" (string, required) The message to create a signature of.\n" + "1. \"horizenaddress\" (string, required) the horizen address to use for the private key\n" + "2. \"message\" (string, required) the message to create a signature of\n" + "\nResult:\n" - "\"signature\" (string) The signature of the message encoded in base 64\n" + "\"signature\" (string) the signature of the message encoded in base 64\n" + "\nExamples:\n" "\nUnlock the wallet for 30 seconds\n" + HelpExampleCli("walletpassphrase", "\"mypassphrase\" 30") + @@ -609,11 +638,14 @@ UniValue getreceivedbyaddress(const UniValue& params, bool fHelp) throw runtime_error( "getreceivedbyaddress \"horizenaddress\" ( minconf )\n" "\nReturns the total amount received by the given horizenaddress in transactions with at least minconf confirmations.\n" + "\nArguments:\n" - "1. \"horizenaddress\" (string, required) The horizen address for transactions.\n" - "2. minconf (numeric, optional, default=1) Only include transactions confirmed at least this many times.\n" + "1. \"horizenaddress\" (string, required) the horizen address for transactions\n" + "2. minconf (numeric, optional, default=1) only include transactions confirmed at least this many times\n" + "\nResult:\n" - "amount (numeric) The total amount in " + CURRENCY_UNIT + " received at this address.\n" + "amount (numeric) the total amount in " + CURRENCY_UNIT + " received at this address\n" + "\nExamples:\n" "\nThe amount from transactions with at least 1 confirmation\n" + HelpExampleCli("getreceivedbyaddress", "\"znnwwojWQJp1ARgbi1dqYtmnNMfihmg8m1b\"") + @@ -623,7 +655,7 @@ UniValue getreceivedbyaddress(const UniValue& params, bool fHelp) + HelpExampleCli("getreceivedbyaddress", "\"znnwwojWQJp1ARgbi1dqYtmnNMfihmg8m1b\" 6") + "\nAs a json rpc call\n" + HelpExampleRpc("getreceivedbyaddress", "\"znnwwojWQJp1ARgbi1dqYtmnNMfihmg8m1b\", 6") - ); + ); LOCK2(cs_main, pwalletMain->cs_wallet); @@ -675,11 +707,14 @@ UniValue getreceivedbyaccount(const UniValue& params, bool fHelp) throw runtime_error( "getreceivedbyaccount \"account\" ( minconf )\n" "\nDEPRECATED. Returns the total amount received by addresses with in transactions with at least [minconf] confirmations.\n" + "\nArguments:\n" - "1. \"account\" (string, required) MUST be set to the empty string \"\" to represent the default account. Passing any other string will result in an error.\n" - "2. minconf (numeric, optional, default=1) Only include transactions confirmed at least this many times.\n" + "1. \"account\" (string, required) MUST be set to the empty string \"\" to represent the default account. Passing any other string will result in an error\n" + "2. minconf (numeric, optional, default=1) only include transactions confirmed at least this many times\n" + "\nResult:\n" - "amount (numeric) The total amount in " + CURRENCY_UNIT + " received for this account.\n" + "amount (numeric) the total amount in " + CURRENCY_UNIT + " received for this account\n" + "\nExamples:\n" "\nAmount received by the default account with at least 1 confirmation\n" + HelpExampleCli("getreceivedbyaccount", "\"\"") + @@ -764,12 +799,15 @@ UniValue getbalance(const UniValue& params, bool fHelp) throw runtime_error( "getbalance ( \"account\" minconf includeWatchonly )\n" "\nReturns the server's total available balance.\n" + "\nArguments:\n" - "1. \"account\" (string, optional) DEPRECATED. If provided, it MUST be set to the empty string \"\" or to the string \"*\", either of which will give the total available balance. Passing any other string will result in an error.\n" - "2. minconf (numeric, optional, default=1) Only include transactions confirmed at least this many times.\n" - "3. includeWatchonly (bool, optional, default=false) Also include balance in watchonly addresses (see 'importaddress')\n" + "1. \"account\" (string, optional) DEPRECATED. If provided, it MUST be set to the empty string \"\" or to the string \"*\", either of which will give the total available balance. Passing any other string will result in an error\n" + "2. minconf (numeric, optional, default=1) only include transactions confirmed at least this many times\n" + "3. includeWatchonly (bool, optional, default=false) also include balance in watchonly addresses (see 'importaddress')\n" + "\nResult:\n" - "amount (numeric) The total amount in " + CURRENCY_UNIT + " received for this account.\n" + "amount (numeric) the total amount in " + CURRENCY_UNIT + " received for this account\n" + "\nExamples:\n" "\nThe total amount in the wallet\n" + HelpExampleCli("getbalance", "") + @@ -834,8 +872,16 @@ UniValue getunconfirmedbalance(const UniValue ¶ms, bool fHelp) if (fHelp || params.size() > 0) throw runtime_error( - "getunconfirmedbalance\n" - "Returns the server's total unconfirmed balance\n"); + "getunconfirmedbalance\n" + "Returns the server's total unconfirmed balance\n" + + "\nResult:\n" + "n (numeric) the server's total unconfirmed balance in " + CURRENCY_UNIT + "\n" + + "\nExamples:\n" + + HelpExampleCli("getunconfirmedbalance", "") + + HelpExampleRpc("getunconfirmedbalance", "") + ); LOCK2(cs_main, pwalletMain->cs_wallet); @@ -852,14 +898,17 @@ UniValue movecmd(const UniValue& params, bool fHelp) throw runtime_error( "move \"fromaccount\" \"toaccount\" amount ( minconf \"comment\" )\n" "\nDEPRECATED. Move a specified amount from one account in your wallet to another.\n" + "\nArguments:\n" - "1. \"fromaccount\" (string, required) MUST be set to the empty string \"\" to represent the default account. Passing any other string will result in an error.\n" - "2. \"toaccount\" (string, required) MUST be set to the empty string \"\" to represent the default account. Passing any other string will result in an error.\n" - "3. amount (numeric) Quantity of " + CURRENCY_UNIT + " to move between accounts.\n" - "4. minconf (numeric, optional, default=1) Only use funds with at least this many confirmations.\n" - "5. \"comment\" (string, optional) An optional comment, stored in the wallet only.\n" + "1. \"fromaccount\" (string, required) MUST be set to the empty string \"\" to represent the default account. Passing any other string will result in an error\n" + "2. \"toaccount\" (string, required) MUST be set to the empty string \"\" to represent the default account. Passing any other string will result in an error\n" + "3. amount (numeric) Quantity of " + CURRENCY_UNIT + " to move between accounts\n" + "4. minconf (numeric, optional, default=1) only use funds with at least this many confirmations\n" + "5. \"comment\" (string, optional) an optional comment, stored in the wallet only\n" + "\nResult:\n" - "true|false (boolean) true if successful.\n" + "true|false (boolean) true if successful\n" + "\nExamples:\n" "\nMove 0.01 " + CURRENCY_UNIT + " from the default account to the account named tabby\n" + HelpExampleCli("move", "\"\" \"tabby\" 0.01") + @@ -927,18 +976,21 @@ UniValue sendfrom(const UniValue& params, bool fHelp) "\nDEPRECATED (use sendtoaddress). Sent an amount from an account to a Horizen address.\n" "The amount is a real and is rounded to the nearest 0.00000001." + HelpRequiringPassphrase() + "\n" + "\nArguments:\n" - "1. \"fromaccount\" (string, required) MUST be set to the empty string \"\" to represent the default account. Passing any other string will result in an error.\n" - "2. \"tohorizenaddress\" (string, required) The horizen address to send funds to.\n" - "3. amount (numeric, required) The amount in btc. (transaction fee is added on top).\n" - "4. minconf (numeric, optional, default=1) Only use funds with at least this many confirmations.\n" - "5. \"comment\" (string, optional) A comment used to store what the transaction is for. \n" - " This is not part of the transaction, just kept in your wallet.\n" - "6. \"comment-to\" (string, optional) An optional comment to store the name of the person or organization \n" + "1. \"fromaccount\" (string, required) MUST be set to the empty string \"\" to represent the default account. Passing any other string will result in an error\n" + "2. \"tohorizenaddress\" (string, required) the horizen address to send funds to\n" + "3. amount (numeric, required) the amount in " + CURRENCY_UNIT + " (transaction fee is added on top)\n" + "4. minconf (numeric, optional, default=1) only use funds with at least this many confirmations\n" + "5. \"comment\" (string, optional) a comment used to store what the transaction is for.\n" + " This is not part of the transaction, just kept in your wallet\n" + "6. \"comment-to\" (string, optional) an optional comment to store the name of the person or organization \n" " to which you're sending the transaction. This is not part of the transaction, \n" - " it is just kept in your wallet.\n" + " it is just kept in your wallet\n" + "\nResult:\n" - "\"transactionid\" (string) The transaction id.\n" + "\"transactionid\" (string) the transaction id\n" + "\nExamples:\n" "\nSend 0.01 " + CURRENCY_UNIT + " from the default account to the address, must have at least 1 confirmation\n" + HelpExampleCli("sendfrom", "\"\" \"znnwwojWQJp1ARgbi1dqYtmnNMfihmg8m1b\" 0.01") + @@ -991,26 +1043,29 @@ UniValue sendmany(const UniValue& params, bool fHelp) "sendmany \"fromaccount\" {\"address\":amount,...} ( minconf \"comment\" [\"address\",...] )\n" "\nSend multiple times. Amounts are double-precision floating point numbers." + HelpRequiringPassphrase() + "\n" + "\nArguments:\n" - "1. \"fromaccount\" (string, required) MUST be set to the empty string \"\" to represent the default account. Passing any other string will result in an error.\n" - "2. \"amounts\" (string, required) A json object with addresses and amounts\n" + "1. \"fromaccount\" (string, required) MUST be set to the empty string \"\" to represent the default account. Passing any other string will result in an error\n" + "2. \"amounts\" (string, required) a json object with addresses and amounts\n" " {\n" - " \"address\":amount (numeric) The horizen address is the key, the numeric amount in btc is the value\n" + " \"address\":amount (numeric) the horizen address is the key, the numeric amount in btc is the value\n" " ,...\n" " }\n" - "3. minconf (numeric, optional, default=1) Only use the balance confirmed at least this many times.\n" - "4. \"comment\" (string, optional) A comment\n" - "5. subtractfeefromamount (string, optional) A json array with addresses.\n" - " The fee will be equally deducted from the amount of each selected address.\n" - " Those recipients will receive less Zen than you enter in their corresponding amount field.\n" - " If no addresses are specified here, the sender pays the fee.\n" + "3. minconf (numeric, optional, default=1) only use the balance confirmed at least this many times\n" + "4. \"comment\" (string, optional) a comment\n" + "5. subtractfeefromamount (string, optional) a json array with addresses\n" + " The fee will be equally deducted from the amount of each selected address\n" + " Those recipients will receive less Zen than you enter in their corresponding amount field\n" + " If no addresses are specified here, the sender pays the fee\n" " [\n" - " \"address\" (string) Subtract fee from this address\n" + " \"address\" (string) subtract fee from this address\n" " ,...\n" " ]\n" + "\nResult:\n" - "\"transactionid\" (string) The transaction id for the send. Only 1 transaction is created regardless of \n" - " the number of addresses.\n" + "\"transactionid\" (string) the transaction id for the send\n" + " Only 1 transaction is created regardless of the number of addresses\n" + "\nExamples:\n" "\nSend two amounts to two different addresses:\n" + HelpExampleCli("sendmany", "\"\" \"{\\\"znnwwojWQJp1ARgbi1dqYtmnNMfihmg8m1b\\\":0.01,\\\"znYHqyumkLY3zVwgaHq3sbtHXuP8GxsNws3\\\":0.02}\"") + @@ -1108,16 +1163,16 @@ UniValue addmultisigaddress(const UniValue& params, bool fHelp) "If 'account' is specified (DEPRECATED), assign address to that account.\n" "\nArguments:\n" - "1. nrequired (numeric, required) The number of required signatures out of the n keys or addresses.\n" - "2. \"keysobject\" (string, required) A json array of horizen addresses or hex-encoded public keys\n" + "1. nrequired (numeric, required) the number of required signatures out of the n keys or addresses\n" + "2. \"keysobject\" (string, required) a json array of horizen addresses or hex-encoded public keys\n" " [\n" " \"address\" (string) horizen address or hex-encoded public key\n" " ...,\n" " ]\n" - "3. \"account\" (string, optional) DEPRECATED. If provided, MUST be set to the empty string \"\" to represent the default account. Passing any other string will result in an error.\n" + "3. \"account\" (string, optional) DEPRECATED. If provided, MUST be set to the empty string \"\" to represent the default account. Passing any other string will result in an error\n" "\nResult:\n" - "\"horizenaddress\" (string) A horizen address associated with the keys.\n" + "\"horizenaddress\" (string) a horizen address associated with the keys\n" "\nExamples:\n" "\nAdd a multisig address from 2 addresses\n" @@ -1285,19 +1340,20 @@ UniValue listreceivedbyaddress(const UniValue& params, bool fHelp) throw runtime_error( "listreceivedbyaddress ( minconf includeempty includeWatchonly)\n" "\nList balances by receiving address.\n" + "\nArguments:\n" - "1. minconf (numeric, optional, default=1) The minimum number of confirmations before payments are included.\n" - "2. includeempty (numeric, optional, default=false) Whether to include addresses that haven't received any payments.\n" - "3. includeWatchonly (bool, optional, default=false) Whether to include watchonly addresses (see 'importaddress').\n" + "1. minconf (numeric, optional, default=1) the minimum number of confirmations before payments are included\n" + "2. includeempty (numeric, optional, default=false) whether to include addresses that haven't received any payments\n" + "3. includeWatchonly (bool, optional, default=false) whether to include watchonly addresses (see 'importaddress')\n" "\nResult:\n" "[\n" " {\n" - " \"involvesWatchonly\" : true, (bool) Only returned if imported addresses were involved in transaction\n" - " \"address\" : \"receivingaddress\", (string) The receiving address\n" - " \"account\" : \"accountname\", (string) DEPRECATED. The account of the receiving address. The default account is \"\".\n" - " \"amount\" : x.xxx, (numeric) The total amount in " + CURRENCY_UNIT + " received by the address\n" - " \"confirmations\" : n (numeric) The number of confirmations of the most recent transaction included\n" + " \"involvesWatchonly\": true, (bool) only returned if imported addresses were involved in transaction\n" + " \"address\": \"receivingaddress\", (string) the receiving address\n" + " \"account\": \"accountname\", (string) DEPRECATED. The account of the receiving address. The default account is \"\"\n" + " \"amount\": xxxx, (numeric) the total amount in " + CURRENCY_UNIT + " received by the address\n" + " \"confirmations\": n (numeric) the number of confirmations of the most recent transaction included\n" " }\n" " ,...\n" "]\n" @@ -1322,18 +1378,19 @@ UniValue listreceivedbyaccount(const UniValue& params, bool fHelp) throw runtime_error( "listreceivedbyaccount ( minconf includeempty includeWatchonly)\n" "\nDEPRECATED. List balances by account.\n" + "\nArguments:\n" - "1. minconf (numeric, optional, default=1) The minimum number of confirmations before payments are included.\n" - "2. includeempty (boolean, optional, default=false) Whether to include accounts that haven't received any payments.\n" - "3. includeWatchonly (bool, optional, default=false) Whether to include watchonly addresses (see 'importaddress').\n" + "1. minconf (numeric, optional, default=1) the minimum number of confirmations before payments are included\n" + "2. includeempty (boolean, optional, default=false) whether to include accounts that haven't received any payments\n" + "3. includeWatchonly (bool, optional, default=false) whether to include watchonly addresses (see 'importaddress')\n" "\nResult:\n" "[\n" " {\n" - " \"involvesWatchonly\" : true, (bool) Only returned if imported addresses were involved in transaction\n" - " \"account\" : \"accountname\", (string) The account name of the receiving account\n" - " \"amount\" : x.xxx, (numeric) The total amount received by addresses with this account\n" - " \"confirmations\" : n (numeric) The number of confirmations of the most recent transaction included\n" + " \"involvesWatchonly\" : true, (bool) only returned if imported addresses were involved in transaction\n" + " \"account\" : \"accountname\", (string) the account name of the receiving account\n" + " \"amount\" : x.xxx, (numeric) the total amount received by addresses with this account\n" + " \"confirmations\" : n (numeric) the number of confirmations of the most recent transaction included\n" " }\n" " ,...\n" "]\n" @@ -1455,44 +1512,46 @@ UniValue listtransactions(const UniValue& params, bool fHelp) throw runtime_error( "listtransactions ( \"account\" count from includeWatchonly)\n" "\nReturns up to 'count' most recent transactions skipping the first 'from' transactions for address 'address'.\n" + "\nArguments:\n" - "1. \"account\" (string, optional) DEPRECATED. The account name. Should be \"*\".\n" - "2. count (numeric, optional, default=10) The number of transactions to return\n" - "3. from (numeric, optional, default=0) The number of transactions to skip\n" - "4. includeWatchonly (bool, optional, default=false) Include transactions to watchonly addresses (see 'importaddress')\n" - "5. address (string, optional) Include only transactions involving this address\n" + "1. \"account\" (string, optional) DEPRECATED. the account name. Should be \"*\"\n" + "2. count (numeric, optional, default=10) the number of transactions to return\n" + "3. from (numeric, optional, default=0) the number of transactions to skip\n" + "4. includeWatchonly (bool, optional, default=false) include transactions to watchonly addresses (see 'importaddress')\n" + "5. address (string, optional) include only transactions involving this address\n" + "\nResult:\n" "[\n" " {\n" - " \"account\":\"accountname\", (string) DEPRECATED. The account name associated with the transaction. \n" - " It will be \"\" for the default account.\n" - " \"address\":\"horizenaddress\", (string) The horizen address of the transaction. Not present for \n" - " move transactions (category = move).\n" - " \"category\":\"send|receive|move\", (string) The transaction category. 'move' is a local (off blockchain)\n" + " \"account\": \"accountname\", (string) DEPRECATED. The account name associated with the transaction\n" + " It will be \"\" for the default account\n" + " \"address\": \"horizenaddress\", (string) the horizen address of the transaction. Not present for \n" + " move transactions (category = move\n" + " \"category\": \"send|receive|move\", (string) the transaction category. 'move' is a local (off blockchain)\n" " transaction between accounts, and not associated with an address,\n" - " transaction id or block. 'send' and 'receive' transactions are \n" + " transaction id or block. 'send' and 'receive' transactions are\n" " associated with an address, transaction id and block details\n" - " \"amount\": x.xxx, (numeric) The amount in " + CURRENCY_UNIT + ". This is negative for the 'send' category, and for the\n" - " 'move' category for moves outbound. It is positive for the 'receive' category,\n" - " and for the 'move' category for inbound funds.\n" - " \"vout\" : n, (numeric) the vout value\n" - " \"fee\": x.xxx, (numeric) The amount of the fee in " + CURRENCY_UNIT + ". This is negative and only available for the \n" - " 'send' category of transactions.\n" - " \"confirmations\": n, (numeric) The number of confirmations for the transaction. Available for 'send' and \n" - " 'receive' category of transactions.\n" - " \"blockhash\": \"hashvalue\", (string) The block hash containing the transaction. Available for 'send' and 'receive'\n" - " category of transactions.\n" - " \"blockindex\": n, (numeric) The block index containing the transaction. Available for 'send' and 'receive'\n" - " category of transactions.\n" - " \"txid\": \"transactionid\", (string) The transaction id. Available for 'send' and 'receive' category of transactions.\n" - " \"time\": xxx, (numeric) The transaction time in seconds since epoch (midnight Jan 1 1970 GMT).\n" - " \"timereceived\": xxx, (numeric) The time received in seconds since epoch (midnight Jan 1 1970 GMT). Available \n" - " for 'send' and 'receive' category of transactions.\n" - " \"comment\": \"...\", (string) If a comment is associated with the transaction.\n" - " \"otheraccount\": \"accountname\", (string) For the 'move' category of transactions, the account the funds came \n" - " from (for receiving funds, positive amounts), or went to (for sending funds,\n" - " negative amounts).\n" - " \"size\": n, (numeric) Transaction size in bytes\n" + " \"amount\": xxxx, (numeric) the amount in " + CURRENCY_UNIT + ". This is negative for the 'send' category, and for the\n" + " 'move' category for moves outbound. It is positive for the 'receive' category,\n" + " and for the 'move' category for inbound funds\n" + " \"vout\": n, (numeric) the vout value\n" + " \"fee\": xxxx, (numeric) the amount of the fee in " + CURRENCY_UNIT + ". This is negative and only available for the\n" + " 'send' category of transactions\n" + " \"confirmations\": n, (numeric) the number of confirmations for the transaction. Available for 'send' and\n" + " 'receive' category of transactions\n" + " \"blockhash\": \"hashvalue\", (string) the block hash containing the transaction. Available for 'send' and 'receive'\n" + " category of transactions\n" + " \"blockindex\": n, (numeric) the block index containing the transaction. Available for 'send' and 'receive'\n" + " category of transactions\n" + " \"txid\": \"transactionid\", (string) the transaction id. Available for 'send' and 'receive' category of transactions\n" + " \"time\": xxx, (numeric) the transaction time in seconds since epoch (midnight Jan 1 1970 GMT)\n" + " \"timereceived\": xxx, (numeric) the time received in seconds since epoch (midnight Jan 1 1970 GMT). Available\n" + " for 'send' and 'receive' category of transactions\n" + " \"comment\": \"...\", (string) if a comment is associated with the transaction\n" + " \"otheraccount\": \"accountname\", (string) for the 'move' category of transactions, the account the funds came \n" + " from (for receiving funds, positive amounts), or went to (for sending funds,\n" + " negative amounts)\n" + " \"size\": n, (numeric) transaction size in bytes\n" " }\n" "]\n" @@ -1601,14 +1660,17 @@ UniValue listaccounts(const UniValue& params, bool fHelp) throw runtime_error( "listaccounts ( minconf includeWatchonly)\n" "\nDEPRECATED. Returns Object that has account names as keys, account balances as values.\n" + "\nArguments:\n" - "1. minconf (numeric, optional, default=1) Only include transactions with at least this many confirmations\n" - "2. includeWatchonly (bool, optional, default=false) Include balances in watchonly addresses (see 'importaddress')\n" + "1. minconf (numeric, optional, default=1) only include transactions with at least this many confirmations\n" + "2. includeWatchonly (bool, optional, default=false) include balances in watchonly addresses (see 'importaddress')\n" + "\nResult:\n" "{ (json object where keys are account names, and values are numeric balances\n" - " \"account\": x.xxx, (numeric) The property name is the account name, and the value is the total balance for the account.\n" + " \"account\": xxxx, (numeric) the property name is the account name, and the value is the total balance for the account\n" " ...\n" "}\n" + "\nExamples:\n" "\nList account balances where there at least 1 confirmation\n" + HelpExampleCli("listaccounts", "") + @@ -1680,32 +1742,35 @@ UniValue listsinceblock(const UniValue& params, bool fHelp) throw runtime_error( "listsinceblock ( \"blockhash\" target-confirmations includeWatchonly)\n" "\nGet all transactions in blocks since block [blockhash], or all transactions if omitted\n" + "\nArguments:\n" - "1. \"blockhash\" (string, optional) The block hash to list transactions since\n" - "2. target-confirmations: (numeric, optional) The confirmations required, must be 1 or more\n" - "3. includeWatchonly: (bool, optional, default=false) Include transactions to watchonly addresses (see 'importaddress')" + "1. \"blockhash\" (string, optional) the block hash to list transactions since\n" + "2. target-confirmations: (numeric, optional) the confirmations required, must be 1 or more\n" + "3. includeWatchonly: (bool, optional, default=false) include transactions to watchonly addresses (see 'importaddress')" + "\nResult:\n" "{\n" " \"transactions\": [\n" - " \"account\":\"accountname\", (string) DEPRECATED. The account name associated with the transaction. Will be \"\" for the default account.\n" - " \"address\":\"horizenaddress\", (string) The horizen address of the transaction. Not present for move transactions (category = move).\n" - " \"category\":\"send|receive\", (string) The transaction category. 'send' has negative amounts, 'receive' has positive amounts.\n" - " \"amount\": x.xxx, (numeric) The amount in " + CURRENCY_UNIT + ". This is negative for the 'send' category, and for the 'move' category for moves \n" - " outbound. It is positive for the 'receive' category, and for the 'move' category for inbound funds.\n" - " \"vout\" : n, (numeric) the vout value\n" - " \"fee\": x.xxx, (numeric) The amount of the fee in " + CURRENCY_UNIT + ". This is negative and only available for the 'send' category of transactions.\n" - " \"confirmations\": n, (numeric) The number of confirmations for the transaction. Available for 'send' and 'receive' category of transactions.\n" - " \"blockhash\": \"hashvalue\", (string) The block hash containing the transaction. Available for 'send' and 'receive' category of transactions.\n" - " \"blockindex\": n, (numeric) The block index containing the transaction. Available for 'send' and 'receive' category of transactions.\n" - " \"blocktime\": xxx, (numeric) The block time in seconds since epoch (1 Jan 1970 GMT).\n" - " \"txid\": \"transactionid\", (string) The transaction id. Available for 'send' and 'receive' category of transactions.\n" - " \"time\": xxx, (numeric) The transaction time in seconds since epoch (Jan 1 1970 GMT).\n" - " \"timereceived\": xxx, (numeric) The time received in seconds since epoch (Jan 1 1970 GMT). Available for 'send' and 'receive' category of transactions.\n" - " \"comment\": \"...\", (string) If a comment is associated with the transaction.\n" - " \"to\": \"...\", (string) If a comment to is associated with the transaction.\n" + " \"account\":\"accountname\", (string) DEPRECATED. the account name associated with the transaction. Will be \"\" for the default account\n" + " \"address\":\"horizenaddress\", (string) the horizen address of the transaction. Not present for move transactions (category = move)\n" + " \"category\":\"send|receive\", (string) the transaction category. 'send' has negative amounts, 'receive' has positive amounts\n" + " \"amount\": xxxx, (numeric) the amount in " + CURRENCY_UNIT + ". This is negative for the 'send' category, and for the 'move' category for moves\n" + " outbound. It is positive for the 'receive' category, and for the 'move' category for inbound funds\n" + " \"vout\": n, (numeric) the vout value\n" + " \"fee\": xxxx, (numeric) the amount of the fee in " + CURRENCY_UNIT + ". This is negative and only available for the 'send' category of transactions\n" + " \"confirmations\": n, (numeric) the number of confirmations for the transaction. Available for 'send' and 'receive' category of transactions\n" + " \"blockhash\": \"hashvalue\", (string) the block hash containing the transaction. Available for 'send' and 'receive' category of transactions\n" + " \"blockindex\": n, (numeric) the block index containing the transaction. Available for 'send' and 'receive' category of transactions\n" + " \"blocktime\": xxx, (numeric) the block time in seconds since epoch (1 Jan 1970 GMT)\n" + " \"txid\": \"transactionid\", (string) the transaction id. Available for 'send' and 'receive' category of transactions\n" + " \"time\": xxx, (numeric) the transaction time in seconds since epoch (Jan 1 1970 GMT)\n" + " \"timereceived\": xxx, (numeric) the time received in seconds since epoch (Jan 1 1970 GMT). Available for 'send' and 'receive' category of transactions\n" + " \"comment\": \"...\", (string) if a comment is associated with the transaction\n" + " \"to\": \"...\", (string) if a comment to is associated with the transaction\n" " ],\n" - " \"lastblock\": \"lastblockhash\" (string) The hash of the last block\n" + " \"lastblock\": \"lastblockhash\" (string) the hash of the last block\n" "}\n" + "\nExamples:\n" + HelpExampleCli("listsinceblock", "") + HelpExampleCli("listsinceblock", "\"000000000000000bacf66f7497b7dc45ef753ee9a7d38571037cdb1a57f663ad\" 6") @@ -1771,41 +1836,43 @@ UniValue gettransaction(const UniValue& params, bool fHelp) throw runtime_error( "gettransaction \"txid\" ( includeWatchonly )\n" "\nGet detailed information about in-wallet transaction \n" + "\nArguments:\n" - "1. \"txid\" (string, required) The transaction id\n" - "2. \"includeWatchonly\" (bool, optional, default=false) Whether to include watchonly addresses in balance calculation and details[]\n" + "1. \"txid\" (string, required) the transaction id\n" + "2. \"includeWatchonly\" (bool, optional, default=false) whether to include watchonly addresses in balance calculation and details[]\n" + "\nResult:\n" "{\n" - " \"amount\" : x.xxx, (numeric) The transaction amount in " + CURRENCY_UNIT + "\n" - " \"confirmations\" : n, (numeric) The number of confirmations\n" - " \"blockhash\" : \"hash\", (string) The block hash\n" - " \"blockindex\" : xx, (numeric) The block index\n" - " \"blocktime\" : ttt, (numeric) The time in seconds since epoch (1 Jan 1970 GMT)\n" - " \"txid\" : \"transactionid\", (string) The transaction id.\n" - " \"time\" : ttt, (numeric) The transaction time in seconds since epoch (1 Jan 1970 GMT)\n" - " \"timereceived\" : ttt, (numeric) The time received in seconds since epoch (1 Jan 1970 GMT)\n" - " \"details\" : [\n" + " \"amount\": xxxx, (numeric) the transaction amount in " + CURRENCY_UNIT + "\n" + " \"confirmations\": n, (numeric) the number of confirmations\n" + " \"blockhash\": \"hash\", (string) the block hash\n" + " \"blockindex\": xx, (numeric) the block index\n" + " \"blocktime\": ttt, (numeric) the time in seconds since epoch (1 Jan 1970 GMT)\n" + " \"txid\": \"transactionid\", (string) the transaction id.\n" + " \"time\": ttt, (numeric) the transaction time in seconds since epoch (1 Jan 1970 GMT)\n" + " \"timereceived\": ttt, (numeric) the time received in seconds since epoch (1 Jan 1970 GMT)\n" + " \"details\": [ (array) details about in-wallet transaction\n" " {\n" - " \"account\" : \"accountname\", (string) DEPRECATED. The account name involved in the transaction, can be \"\" for the default account.\n" - " \"address\" : \"horizenaddress\", (string) The horizen address involved in the transaction\n" - " \"category\" : \"send|receive\", (string) The category, either 'send' or 'receive'\n" - " \"amount\" : x.xxx (numeric) The amount in " + CURRENCY_UNIT + "\n" - " \"vout\" : n, (numeric) the vout value\n" + " \"account\": \"accountname\", (string) DEPRECATED. The account name involved in the transaction, can be \"\" for the default account\n" + " \"address\": \"horizenaddress\", (string) the horizen address involved in the transaction\n" + " \"category\": \"send|receive\", (string) the category, either 'send' or 'receive'\n" + " \"amount\": xxxx (numeric) the amount in " + CURRENCY_UNIT + "\n" + " \"vout\": n, (numeric) the vout value\n" " }\n" " ,...\n" " ],\n" - " \"vjoinsplit\" : [\n" + " \"vjoinsplit\": [ (array)\n" " {\n" - " \"anchor\" : \"treestateref\", (string) Merkle root of note commitment tree\n" - " \"nullifiers\" : [ string, ... ] (string) Nullifiers of input notes\n" - " \"commitments\" : [ string, ... ] (string) Note commitments for note outputs\n" - " \"macs\" : [ string, ... ] (string) Message authentication tags\n" - " \"vpub_old\" : x.xxx (numeric) The amount removed from the transparent value pool\n" - " \"vpub_new\" : x.xxx, (numeric) The amount added to the transparent value pool\n" + " \"anchor\": \"treestateref\", (string) merkle root of note commitment tree\n" + " \"nullifiers\": [ string, ... ] (string) nullifiers of input notes\n" + " \"commitments\": [ string, ... ] (string) note commitments for note outputs\n" + " \"macs\": [ string, ... ] (string) message authentication tags\n" + " \"vpub_old\": xxxx (numeric) the amount removed from the transparent value pool\n" + " \"vpub_new\": xxxx, (numeric) the amount added to the transparent value pool\n" " }\n" " ,...\n" " ],\n" - " \"hex\" : \"data\" (string) Raw data for transaction\n" + " \"hex\": \"data\" (string) raw data for transaction\n" "}\n" "\nExamples:\n" @@ -1860,13 +1927,16 @@ UniValue backupwallet(const UniValue& params, bool fHelp) throw runtime_error( "backupwallet \"destination\"\n" "\nSafely copies wallet.dat to destination filename\n" + "\nArguments:\n" - "1. \"destination\" (string, required) The destination filename, saved in the directory set by -exportdir option.\n" + "1. \"destination\" (string, required) the destination filename, saved in the directory set by -exportdir option\n" + "\nResult:\n" - "\"path\" (string) The full path of the destination file\n" + "\"path\" (string) the full path of the destination file\n" + "\nExamples:\n" - + HelpExampleCli("backupwallet", "\"backupdata\"") - + HelpExampleRpc("backupwallet", "\"backupdata\"") + + HelpExampleCli("backupwallet", "\"destination\"") + + HelpExampleRpc("backupwallet", "\"destination\"") ); LOCK2(cs_main, pwalletMain->cs_wallet); @@ -1904,8 +1974,13 @@ UniValue keypoolrefill(const UniValue& params, bool fHelp) "keypoolrefill ( newsize )\n" "\nFills the keypool." + HelpRequiringPassphrase() + "\n" + "\nArguments\n" - "1. newsize (numeric, optional, default=100) The new keypool size\n" + "1. newsize (numeric, optional, default=100) the new keypool size\n" + + "\nResult:\n" + "Nothing\n" + "\nExamples:\n" + HelpExampleCli("keypoolrefill", "") + HelpExampleRpc("keypoolrefill", "") @@ -2107,8 +2182,13 @@ UniValue encryptwallet(const UniValue& params, bool fHelp) "Use the walletpassphrase call for this, and then walletlock call.\n" "If the wallet is already encrypted, use the walletpassphrasechange call.\n" "Note that this will shutdown the server.\n" + "\nArguments:\n" - "1. \"passphrase\" (string) The pass phrase to encrypt the wallet with. It must be at least 1 character, but should be long.\n" + "1. \"passphrase\" (string) The pass phrase to encrypt the wallet with. It must be at least 1 character, but should be long\n" + + "\nResponse:\n" + "Nothing if success this will shutdown the server" + "\nExamples:\n" "\nEncrypt you wallet\n" + HelpExampleCli("encryptwallet", "\"my pass phrase\"") + @@ -2167,19 +2247,20 @@ UniValue lockunspent(const UniValue& params, bool fHelp) "Locks are stored in memory only. Nodes start with zero locked outputs, and the locked output list\n" "is always cleared (by virtue of process exit) when a node stops or fails.\n" "Also see the listunspent call\n" + "\nArguments:\n" - "1. unlock (boolean, required) Whether to unlock (true) or lock (false) the specified transactions\n" - "2. \"transactions\" (string, required) A json array of objects. Each object the txid (string) vout (numeric)\n" - " [ (json array of json objects)\n" + "1. unlock (boolean, required) whether to unlock (true) or lock (false) the specified transactions\n" + "2. \"transactions\" (string, required) a json array of objects. Each object the txid (string) vout (numeric)\n" + " [ (json array of json objects)\n" " {\n" - " \"txid\":\"id\", (string) The transaction id\n" - " \"vout\": n (numeric) The output number\n" + " \"txid\":\"id\", (string) the transaction id\n" + " \"vout\": n (numeric) the output number\n" " }\n" " ,...\n" " ]\n" "\nResult:\n" - "true|false (boolean) Whether the command was successful or not\n" + "true|false (boolean) whether the command was successful or not\n" "\nExamples:\n" "\nList the unspent transactions\n" @@ -2247,14 +2328,16 @@ UniValue listlockunspent(const UniValue& params, bool fHelp) "listlockunspent\n" "\nReturns list of temporarily unspendable outputs.\n" "See the lockunspent call to lock and unlock transactions for spending.\n" + "\nResult:\n" "[\n" " {\n" - " \"txid\" : \"transactionid\", (string) The transaction id locked\n" - " \"vout\" : n (numeric) The vout value\n" + " \"txid\" : \"transactionid\", (string) the transaction id locked\n" + " \"vout\" : n (numeric) the vout value\n" " }\n" " ,...\n" "]\n" + "\nExamples:\n" "\nList the unspent transactions\n" + HelpExampleCli("listunspent", "") + @@ -2295,10 +2378,13 @@ UniValue settxfee(const UniValue& params, bool fHelp) throw runtime_error( "settxfee amount\n" "\nSet the transaction fee per kB.\n" + "\nArguments:\n" - "1. amount (numeric, required) The transaction fee in " + CURRENCY_UNIT + "/kB rounded to the nearest 0.00000001\n" - "\nResult\n" - "true|false (boolean) Returns true if successful\n" + "1. amount (numeric, required) the transaction fee in " + CURRENCY_UNIT + "/kB rounded to the nearest 0.00000001\n" + " + \nResult\n" + "true|false (boolean) returns true if successful\n" + "\nExamples:\n" + HelpExampleCli("settxfee", "0.00001") + HelpExampleRpc("settxfee", "0.00001") @@ -2322,6 +2408,7 @@ UniValue getwalletinfo(const UniValue& params, bool fHelp) throw runtime_error( "getwalletinfo\n" "Returns an object containing various wallet state info.\n" + "\nResult:\n" "{\n" " \"walletversion\": xxxxx, (numeric) the wallet version\n" @@ -2332,8 +2419,9 @@ UniValue getwalletinfo(const UniValue& params, bool fHelp) " \"keypoololdest\": xxxxxx, (numeric) the timestamp (seconds since GMT epoch) of the oldest pre-generated key in the key pool\n" " \"keypoolsize\": xxxx, (numeric) how many new keys are pre-generated\n" " \"unlocked_until\": ttt, (numeric) the timestamp in seconds since epoch (midnight Jan 1 1970 GMT) that the wallet is unlocked for transfers, or 0 if the wallet is locked\n" - " \"paytxfee\": x.xxxx, (numeric) the transaction fee configuration, set in " + CURRENCY_UNIT + "/kB\n" + " \"paytxfee\": xxxxx, (numeric) the transaction fee configuration, set in " + CURRENCY_UNIT + "/kB\n" "}\n" + "\nExamples:\n" + HelpExampleCli("getwalletinfo", "") + HelpExampleRpc("getwalletinfo", "") @@ -2391,27 +2479,27 @@ UniValue listunspent(const UniValue& params, bool fHelp) "\nReturns array of unspent transaction outputs\n" "with between minconf and maxconf (inclusive) confirmations.\n" "Optionally filter to only include txouts paid to specified addresses.\n" - "Results are an array of Objects, each of which has:\n" - "{txid, vout, scriptPubKey, amount, confirmations}\n" + "\nArguments:\n" - "1. minconf (numeric, optional, default=1) The minimum confirmations to filter\n" - "2. maxconf (numeric, optional, default=9999999) The maximum confirmations to filter\n" - "3. \"addresses\" (string) A json array of horizen addresses to filter\n" + "1. minconf (numeric, optional, default=1) the minimum confirmations to filter\n" + "2. maxconf (numeric, optional, default=9999999) the maximum confirmations to filter\n" + "3. \"addresses\" (string) a json array of horizen addresses to filter\n" " [\n" - " \"address\" (string) horizen address\n" + " \"address\" (string) horizen address\n" " ,...\n" " ]\n" + "\nResult\n" - "[ (array of json object)\n" + "[ (array of json object)\n" " {\n" - " \"txid\" : \"txid\", (string) the transaction id \n" - " \"vout\" : n, (numeric) the vout value\n" - " \"generated\" : true|false (boolean) true if txout is a coinbase transaction output\n" - " \"address\" : \"address\", (string) the horizen address\n" - " \"account\" : \"account\", (string) DEPRECATED. The associated account, or \"\" for the default account\n" - " \"scriptPubKey\" : \"key\", (string) the script key\n" - " \"amount\" : x.xxx, (numeric) the transaction amount in " + CURRENCY_UNIT + "\n" - " \"confirmations\" : n (numeric) The number of confirmations\n" + " \"txid\": \"txid\", (string) the transaction id\n" + " \"vout\": n, (numeric) the vout value\n" + " \"generated\": true|false (boolean) true if txout is a coinbase transaction output\n" + " \"address\": \"address\", (string) the horizen address\n" + " \"account\": \"account\", (string) DEPRECATED. The associated account, or \"\" for the default account\n" + " \"scriptPubKey\": \"key\", (string) the script key\n" + " \"amount\": xxxx, (numeric) the transaction amount in " + CURRENCY_UNIT + "\n" + " \"confirmations\": n (numeric) the number of confirmations\n" " }\n" " ,...\n" "]\n" @@ -2502,30 +2590,34 @@ UniValue fundrawtransaction(const UniValue& params, bool fHelp) if (fHelp || params.size() != 1) throw runtime_error( - "fundrawtransaction \"hexstring\"\n" - "\nAdd inputs to a transaction until it has enough in value to meet its out value.\n" - "This will not modify existing inputs, and will add one change output to the outputs.\n" - "Note that inputs which were signed may need to be resigned after completion since in/outputs have been added.\n" - "The inputs added will not be signed, use signrawtransaction for that.\n" - "\nArguments:\n" - "1. \"hexstring\" (string, required) The hex string of the raw transaction\n" - "\nResult:\n" - "{\n" - " \"hex\": \"value\", (string) The resulting raw transaction (hex-encoded string)\n" - " \"fee\": n, (numeric) The fee added to the transaction\n" - " \"changepos\": n (numeric) The position of the added change output, or -1\n" - "}\n" - "\"hex\" \n" - "\nExamples:\n" - "\nCreate a transaction with no inputs\n" - + HelpExampleCli("createrawtransaction", "\"[]\" \"{\\\"myaddress\\\":0.01}\"") + - "\nAdd sufficient unsigned inputs to meet the output value\n" - + HelpExampleCli("fundrawtransaction", "\"rawtransactionhex\"") + - "\nSign the transaction\n" - + HelpExampleCli("signrawtransaction", "\"fundedtransactionhex\"") + - "\nSend the transaction\n" - + HelpExampleCli("sendrawtransaction", "\"signedtransactionhex\"") - ); + "fundrawtransaction \"hexstring\"\n" + "\nAdd inputs to a transaction until it has enough in value to meet its out value.\n" + "This will not modify existing inputs, and will add one change output to the outputs.\n" + "Note that inputs which were signed may need to be resigned after completion since in/outputs have been added.\n" + "The inputs added will not be signed, use signrawtransaction for that.\n" + + "\nArguments:\n" + "1. \"hexstring\" (string, required) the hex string of the raw transaction\n" + + "\nResult:\n" + "{\n" + " \"hex\": \"value\", (string) the resulting raw transaction (hex-encoded string)\n" + " \"fee\": n, (numeric) the fee added to the transaction\n" + " \"changepos\": n (numeric) the position of the added change output, or -1\n" + "},\n" + + "\nExamples:\n" + "\nCreate a transaction with no inputs\n" + + HelpExampleCli("createrawtransaction", "\"[]\" \"{\\\"myaddress\\\":0.01}\"") + + "\nAdd sufficient unsigned inputs to meet the output value\n" + + HelpExampleCli("fundrawtransaction", "\"rawtransactionhex\"") + + "\nSign the transaction\n" + + HelpExampleCli("signrawtransaction", "\"fundedtransactionhex\"") + + "\nSend the transaction\n" + + HelpExampleCli("sendrawtransaction", "\"signedtransactionhex\"") + + "\nRpc example\n" + + HelpExampleRpc("fundrawtransaction", "\"rawtransactionhex\"") + ); RPCTypeCheck(params, boost::assign::list_of(UniValue::VSTR)); @@ -2554,9 +2646,8 @@ UniValue zc_sample_joinsplit(const UniValue& params, bool fHelp) if (fHelp) { throw runtime_error( "zcsamplejoinsplit\n" - "\n" "Perform a joinsplit and return the JSDescription.\n" - ); + ); } LOCK(cs_main); @@ -2581,7 +2672,7 @@ UniValue zc_sample_joinsplit(const UniValue& params, bool fHelp) CDataStream ss(SER_NETWORK, PROTOCOL_VERSION); auto os = WithTxVersion(&ss, shieldedTxVersion); - os << samplejoinsplit; + os << samplejoinsplit;| return HexStr(ss.begin(), ss.end()); } @@ -2598,7 +2689,28 @@ UniValue zc_benchmark(const UniValue& params, bool fHelp) "Runs a benchmark of the selected type samplecount times,\n" "returning the running times of each sample.\n" "\n" - "Output: [\n" + + "\nArguments:\n" + "1. benchmarktype (string, required) the benchmark type\n" + "2. samplecount (numeric, required) count times\n" + + "\nBenchmark types:\n" + "verifyjoinsplit\n" + "sleep\n" + "parameterloading\n" + "createjoinsplit\n" + "solveequihash\n" + "verifyequihash\n" + "validatelargetx\n" + "trydecryptnotes\n" + "incnotewitnesses\n" + "connectblockslow\n" + "sendtoaddress\n" + "loadwallet\n" + "listunspent\n" + + "\nResult:\n" + "[\n" " {\n" " \"runningtime\": runningtime\n" " },\n" @@ -2607,7 +2719,11 @@ UniValue zc_benchmark(const UniValue& params, bool fHelp) " }\n" " ...\n" "]\n" - ); + + "\nExamples:\n" + + HelpExampleCli("zcbenchmark", "\"benchmarktype\" 2") + + HelpExampleRpc("zcbenchmark", "\"benchmarktype\", 2") + ); } const int shieldedTxVersion = ForkManager::getInstance().getShieldedTxVersion(chainActive.Height()); @@ -2716,13 +2832,21 @@ UniValue zc_raw_receive(const UniValue& params, bool fHelp) "\n" "DEPRECATED. Decrypts encryptednote and checks if the coin commitments\n" "are in the blockchain as indicated by the \"exists\" result.\n" - "\n" - "Output: {\n" + + "\nArguments\n" + "1. \"zcsecretkey\" (string, required) hex secret key\n" + "1. \"encryptednote\" (string, required) the note to decode\n" + + "\nResult:\n" + "{\n" " \"amount\": value,\n" " \"note\": noteplaintext,\n" " \"exists\": exists\n" "}\n" - ); + + + HelpExampleCli("zcrawreceive", "\"zcsecretkey\" \"encryptednote\"") + + HelpExampleRpc("zcrawreceive", "\"zcsecretkey\", \"encryptednote\"") + ); } RPCTypeCheck(params, boost::assign::list_of(UniValue::VSTR)(UniValue::VSTR)); @@ -2794,25 +2918,30 @@ UniValue zc_raw_joinsplit(const UniValue& params, bool fHelp) if (fHelp || params.size() != 5) { throw runtime_error( "zcrawjoinsplit rawtx inputs outputs vpub_old vpub_new\n" - " inputs: a JSON object mapping {note: zcsecretkey, ...}\n" - " outputs: a JSON object mapping {zcaddr: value, ...}\n" - "\n" "DEPRECATED. Splices a joinsplit into rawtx. Inputs are unilaterally confidential.\n" "Outputs are confidential between sender/receiver. The vpub_old and\n" "vpub_new values are globally public and move transparent value into\n" "or out of the confidential value store, respectively.\n" + " inputs: a JSON object mapping {note: zcsecretkey, ...}\n" + " outputs: a JSON object mapping {zcaddr: value, ...}\n" "\n" "Note: The caller is responsible for delivering the output enc1 and\n" "enc2 to the appropriate recipients, as well as signing rawtxout and\n" "ensuring it is mined. (A future RPC call will deliver the confidential\n" "payments in-band on the blockchain.)\n" "\n" - "Output: {\n" + + + "\nResult:\n" + "{\n" " \"encryptednote1\": enc1,\n" " \"encryptednote2\": enc2,\n" " \"rawtxn\": rawtxout\n" "}\n" - ); + + + HelpExampleCli("zcrawjoinsplit", "\"inputs\" \"outputs\" \"rawtx\" \"vpub_old\" \"vpub_new\"") + + HelpExampleRpc("zcrawjoinsplit", "\"inputs\", \"outputs\", \"rawtx\", \"vpub_old\", \"vpub_new\"") + ); } LOCK(cs_main); @@ -2981,15 +3110,18 @@ UniValue zc_raw_keygen(const UniValue& params, bool fHelp) if (fHelp || params.size() != 0) { throw runtime_error( "zcrawkeygen\n" - "\n" "DEPRECATED. Generate a zcaddr which can send and receive confidential values.\n" - "\n" - "Output: {\n" + + "\nResult:\n" + "{\n" " \"zcaddress\": zcaddr,\n" " \"zcsecretkey\": zcsecretkey,\n" " \"zcviewingkey\": zcviewingkey,\n" "}\n" - ); + + + HelpExampleCli("zcrawkeygen", "") + + HelpExampleRpc("zcrawkeygen", "") + ); } auto k = SpendingKey::random(); @@ -3017,9 +3149,10 @@ UniValue z_getnewaddress(const UniValue& params, bool fHelp) throw runtime_error( "z_getnewaddress\n" "\nReturns a new zaddr for receiving payments.\n" - "\nArguments:\n" + "\nResult:\n" - "\"horizenaddress\" (string) The new zaddr\n" + "\"horizenaddress\" (string) the new zaddr\n" + "\nExamples:\n" + HelpExampleCli("z_getnewaddress", "") + HelpExampleRpc("z_getnewaddress", "") @@ -3044,13 +3177,16 @@ UniValue z_listaddresses(const UniValue& params, bool fHelp) throw runtime_error( "z_listaddresses ( includeWatchonly )\n" "\nReturns the list of zaddr belonging to the wallet.\n" + "\nArguments:\n" "1. includeWatchonly (bool, optional, default=false) Also include watchonly addresses (see 'z_importviewingkey')\n" + "\nResult:\n" "[ (json array of string)\n" " \"zaddr\" (string) a zaddr belonging to the wallet\n" " ,...\n" "]\n" + "\nExamples:\n" + HelpExampleCli("z_listaddresses", "") + HelpExampleRpc("z_listaddresses", "") @@ -3137,16 +3273,19 @@ UniValue z_listreceivedbyaddress(const UniValue& params, bool fHelp) if (fHelp || params.size()==0 || params.size() >2) throw runtime_error( "z_listreceivedbyaddress \"address\" ( minconf )\n" - "\nReturn a list of amounts received by a zaddr belonging to the node’s wallet.\n" + "\nReturn a list of amounts received by a zaddr belonging to the node’s wallet\n" + "\nArguments:\n" - "1. \"address\" (string) The private address.\n" - "2. minconf (numeric, optional, default=1) Only include transactions confirmed at least this many times.\n" + "1. \"address\" (string) the private address\n" + "2. minconf (numeric, optional, default=1) only include transactions confirmed at least this many times\n" + "\nResult:\n" "{\n" " \"txid\": xxxxx, (string) the transaction id\n" " \"amount\": xxxxx, (numeric) the amount of value in the note\n" " \"memo\": xxxxx, (string) hexademical string representation of memo field\n" "}\n" + "\nExamples:\n" + HelpExampleCli("z_listreceivedbyaddress", "\"ztfaW34Gj9FrnGUEf833ywDVL62NWXBM81u6EQnM6VR45eYnXhwztecW1SjxA7JrmAXKJhxhj3vDNEpVCQoSvVoSpmbhtjf\"") + HelpExampleRpc("z_listreceivedbyaddress", "\"ztfaW34Gj9FrnGUEf833ywDVL62NWXBM81u6EQnM6VR45eYnXhwztecW1SjxA7JrmAXKJhxhj3vDNEpVCQoSvVoSpmbhtjf\"") @@ -3204,11 +3343,14 @@ UniValue z_getbalance(const UniValue& params, bool fHelp) "\nReturns the balance of a taddr or zaddr belonging to the node’s wallet.\n" "\nCAUTION: If address is a watch-only zaddr, the returned balance may be larger than the actual balance," "\nbecause spends cannot be detected with incoming viewing keys.\n" + "\nArguments:\n" - "1. \"address\" (string) The selected address. It may be a transparent or private address.\n" - "2. minconf (numeric, optional, default=1) Only include transactions confirmed at least this many times.\n" + "1. \"address\" (string) the selected address, it may be a transparent or private address\n" + "2. minconf (numeric, optional, default=1) only include transactions confirmed at least this many times\n" + "\nResult:\n" - "amount (numeric) The total amount in " + CURRENCY_UNIT + " received for this address.\n" + "amount (numeric) the total amount in " + CURRENCY_UNIT + " received for this addresss\n" + "\nExamples:\n" "\nThe total amount received by address \"myaddress\"\n" + HelpExampleCli("z_getbalance", "\"myaddress\"") + @@ -3268,15 +3410,18 @@ UniValue z_gettotalbalance(const UniValue& params, bool fHelp) "\nReturn the total value of funds stored in the node’s wallet.\n" "\nCAUTION: If the wallet contains watch-only zaddrs, the returned private balance may be larger than the actual balance," "\nbecause spends cannot be detected with incoming viewing keys.\n" + "\nArguments:\n" - "1. minconf (numeric, optional, default=1) Only include private and transparent transactions confirmed at least this many times.\n" - "2. includeWatchonly (bool, optional, default=false) Also include balance in watchonly addresses (see 'importaddress' and 'z_importviewingkey')\n" + "1. minconf (numeric, optional, default=1) only include private and transparent transactions confirmed at least this many times\n" + "2. includeWatchonly (bool, optional, default=false) also include balance in watchonly addresses (see 'importaddress' and 'z_importviewingkey')\n" + "\nResult:\n" "{\n" " \"transparent\": xxxxx, (numeric) the total balance of transparent funds\n" " \"private\": xxxxx, (numeric) the total balance of private funds\n" " \"total\": xxxxx, (numeric) the total balance of both transparent and private funds\n" "}\n" + "\nExamples:\n" "\nThe total amount in the wallet\n" + HelpExampleCli("z_gettotalbalance", "") + @@ -3325,10 +3470,21 @@ UniValue z_getoperationresult(const UniValue& params, bool fHelp) "z_getoperationresult ([\"operationid\", ... ]) \n" "\nRetrieve the result and status of an operation which has finished, and then remove the operation from memory." + HelpRequiringPassphrase() + "\n" + "\nArguments:\n" - "1. \"operationid\" (array, optional) A list of operation ids we are interested in. If not provided, examine all operations known to the node.\n" + "1. \"operationid\" (array, optional) a list of operation ids we are interested in\n" + " if not provided, examine all operations known to the node\n" + "\nResult:\n" - "\" [object, ...]\" (array) A list of JSON objects\n" + "\" [\" (array) a list of JSON objects\n" + " {\n" + " \"status\": \"xxxx\", (string) status, can be \"success\", \"failed\", \"cancelled\"\n" + " result: {...} (object, optional) if the status is \"success\"\n" + " the exact form of the result object is dependent on the call itself\n" + " }\n" + " ,...\n" + " ]\n" + "\nExamples:\n" + HelpExampleCli("z_getoperationresult", "'[\"operationid\", ... ]'") + HelpExampleRpc("z_getoperationresult", "'[\"operationid\", ... ]'") @@ -3348,10 +3504,22 @@ UniValue z_getoperationstatus(const UniValue& params, bool fHelp) "z_getoperationstatus ([\"operationid\", ... ]) \n" "\nGet operation status and any associated result or error data. The operation will remain in memory." + HelpRequiringPassphrase() + "\n" + "\nArguments:\n" - "1. \"operationid\" (array, optional) A list of operation ids we are interested in. If not provided, examine all operations known to the node.\n" + "1. \"operationid\" (array, optional) a list of operation ids we are interested in\n" + " if not provided, examine all operations known to the node\n" + "\nResult:\n" - "\" [object, ...]\" (array) A list of JSON objects\n" + "\" [\" (array) a list of JSON objects\n" + " {\n" + " \"status\": \"xxxx\", (string) status, can be \"success\", \"failed\", \"cancelled\"\n" + " error: { (object, optional) if the status is \"failed\", the error object has key-value pairs (code-message)\n" + " \"code (numeric)\": \"message (string)\"\n" + " }\n" + " }\n" + " ,...\n" + " ]\n" + "\nExamples:\n" + HelpExampleCli("z_getoperationstatus", "'[\"operationid\", ... ]'") + HelpExampleRpc("z_getoperationstatus", "'[\"operationid\", ... ]'") @@ -3445,20 +3613,23 @@ UniValue z_sendmany(const UniValue& params, bool fHelp) "\nWhen sending coinbase UTXOs to a zaddr, change is not allowed. The entire value of the UTXO(s) must be consumed." + strprintf("\nCurrently, the maximum number of zaddr outputs is %d due to transaction size limits.\n", Z_SENDMANY_MAX_ZADDR_OUTPUTS(shieldedTxVersion)) + HelpRequiringPassphrase() + "\n" + "\nArguments:\n" - "1. \"fromaddress\" (string, required) The taddr or zaddr to send the funds from.\n" - "2. \"amounts\" (array, required) An array of json objects representing the amounts to send.\n" + "1. \"fromaddress\" (string, required) the taddr or zaddr to send the funds from\n" + "2. \"amounts\" (array, required) an array of json objects representing the amounts to send\n" " [{\n" - " \"address\":address (string, required) The address is a taddr or zaddr\n" - " \"amount\":amount (numeric, required) The numeric amount in " + CURRENCY_UNIT + " is the value\n" - " \"memo\":memo (string, optional) If the address is a zaddr, raw data represented in hexadecimal string format\n" + " \"address\":address (string, required) the address is a taddr or zaddr\n" + " \"amount\":amount (numeric, required) the numeric amount in " + CURRENCY_UNIT + " is the value\n" + " \"memo\":memo (string, optional) if the address is a zaddr, raw data represented in hexadecimal string format\n" " }, ... ]\n" - "3. minconf (numeric, optional, default=1) Only use funds confirmed at least this many times.\n" - "4. fee (numeric, optional, default=" - + strprintf("%s", FormatMoney(ASYNC_RPC_OPERATION_DEFAULT_MINERS_FEE)) + ") The fee amount to attach to this transaction.\n" - "5. sendChangeToSource (boolean, optional, default = false) If true and fromaddress is a taddress return the change to it\n" + "3. minconf (numeric, optional, default=1) only use funds confirmed at least this many times\n" + "4. fee (numeric, optional, default=" + + strprintf("%s", FormatMoney(ASYNC_RPC_OPERATION_DEFAULT_MINERS_FEE)) + ") the fee amount to attach to this transaction\n" + "5. sendChangeToSource (boolean, optional, default = false) if true and fromaddress is a taddress return the change to it\n" + "\nResult:\n" - "\"operationid\" (string) An operationid to pass to z_getoperationstatus to get the result of the operation.\n" + "\"operationid\" (string) an operationid to pass to z_getoperationstatus to get the result of the operation\n" + "\nExamples:\n" + HelpExampleCli("z_sendmany", "\"znnwwojWQJp1ARgbi1dqYtmnNMfihmg8m1b\" '[{\"address\": \"ztfaW34Gj9FrnGUEf833ywDVL62NWXBM81u6EQnM6VR45eYnXhwztecW1SjxA7JrmAXKJhxhj3vDNEpVCQoSvVoSpmbhtjf\" ,\"amount\": 5.0}]'") + HelpExampleRpc("z_sendmany", "\"znnwwojWQJp1ARgbi1dqYtmnNMfihmg8m1b\", [{\"address\": \"ztfaW34Gj9FrnGUEf833ywDVL62NWXBM81u6EQnM6VR45eYnXhwztecW1SjxA7JrmAXKJhxhj3vDNEpVCQoSvVoSpmbhtjf\" ,\"amount\": 5.0}]") @@ -3669,21 +3840,27 @@ UniValue z_shieldcoinbase(const UniValue& params, bool fHelp) "\nof uxtos. Any limit is constrained by the consensus rule defining a maximum transaction size of " + strprintf("%d bytes.", MAX_TX_SIZE) + HelpRequiringPassphrase() + "\n" + "\nArguments:\n" - "1. \"fromaddress\" (string, required) The address is a taddr or \"*\" for all taddrs belonging to the wallet.\n" - "2. \"toaddress\" (string, required) The address is a zaddr.\n" - "3. fee (numeric, optional, default=" + "1. \"fromaddress\" (string, required) the address is a taddr or \"*\" for all taddrs belonging to the wallet\n" + "2. \"toaddress\" (string, required) the address is a zaddr\n" + "3. fee (numeric, optional, default=" + strprintf("%s", FormatMoney(SHIELD_COINBASE_DEFAULT_MINERS_FEE)) + ") The fee amount to attach to this transaction.\n" "4. limit (numeric, optional, default=" - + strprintf("%d", SHIELD_COINBASE_DEFAULT_LIMIT) + ") Limit on the maximum number of utxos to shield. Set to 0 to use node option -mempooltxinputlimit.\n" + + strprintf("%d", SHIELD_COINBASE_DEFAULT_LIMIT) + ") Limit on the maximum number of utxos to shield. Set to 0 to use node option -mempooltxinputlimit\n" + "\nResult:\n" "{\n" - " \"operationid\": xxx (string) An operationid to pass to z_getoperationstatus to get the result of the operation.\n" - " \"shieldedUTXOs\": xxx (numeric) Number of coinbase utxos being shielded.\n" - " \"shieldedValue\": xxx (numeric) Value of coinbase utxos being shielded.\n" - " \"remainingUTXOs\": xxx (numeric) Number of coinbase utxos still available for shielding.\n" - " \"remainingValue\": xxx (numeric) Value of coinbase utxos still available for shielding.\n" + " \"operationid\": xxx (string) an operationid to pass to z_getoperationstatus to get the result of the operation.\n" + " \"shieldedUTXOs\": xxx (numeric) number of coinbase utxos being shielded.\n" + " \"shieldedValue\": xxx (numeric) value of coinbase utxos being shielded.\n" + " \"remainingUTXOs\": xxx (numeric) number of coinbase utxos still available for shielding.\n" + " \"remainingValue\": xxx (numeric) value of coinbase utxos still available for shielding.\n" "}\n" + + "\nExamples:\n" + + HelpExampleCli("z_shieldcoinbase", "\"taddr\" \"zaddr\"") + + HelpExampleRpc("z_shieldcoinbase", "\"taddr\", \"zaddr\"") ); LOCK2(cs_main, pwalletMain->cs_wallet); @@ -3845,13 +4022,16 @@ UniValue z_listoperationids(const UniValue& params, bool fHelp) throw runtime_error( "z_listoperationids\n" "\nReturns the list of operation ids currently known to the wallet.\n" + "\nArguments:\n" - "1. \"status\" (string, optional) Filter result by the operation's state state e.g. \"success\".\n" + "1. \"status\" (string, optional) filter result by the operation's state state e.g. \"success\"\n" + "\nResult:\n" "[ (json array of string)\n" - " \"operationid\" (string) an operation id belonging to the wallet\n" + " \"operationid\" (string) an operation id belonging to the wallet\n" " ,...\n" "]\n" + "\nExamples:\n" + HelpExampleCli("z_listoperationids", "") + HelpExampleRpc("z_listoperationids", "") From 3cc1873f718623e0eade132c834f119a4e537dbb Mon Sep 17 00:00:00 2001 From: luisantoniocrag Date: Sat, 13 Mar 2021 18:51:35 -0600 Subject: [PATCH 10/33] Fix misc rpc help messages --- src/rpc/misc.cpp | 84 +++++++++++++++++++++++++++--------------------- 1 file changed, 48 insertions(+), 36 deletions(-) diff --git a/src/rpc/misc.cpp b/src/rpc/misc.cpp index 0794d18456..c280a4e617 100644 --- a/src/rpc/misc.cpp +++ b/src/rpc/misc.cpp @@ -45,25 +45,27 @@ UniValue getinfo(const UniValue& params, bool fHelp) throw runtime_error( "getinfo\n" "Returns an object containing various state info.\n" + "\nResult:\n" "{\n" " \"version\": xxxxx, (numeric) the server version\n" " \"protocolversion\": xxxxx, (numeric) the latest supported protocol version\n" " \"walletversion\": xxxxx, (numeric) the wallet version\n" - " \"balance\": x.xxxxxxxx, (numeric) the total ZEN balance of the wallet\n" + " \"balance\": xxxxxxx, (numeric) the total balance of the wallet in " + CURRENCY_UNIT + "\n" " \"blocks\": xxxxxx, (numeric) the current number of blocks processed in the server\n" " \"timeoffset\": 0, (numeric) the time offset (deprecated; always 0)\n" - " \"connections\": xxx, (numeric) the number of connected peers\n" + " \"connections\": xxxxx, (numeric) the number of connected peers\n" " \"proxy\": \"host:port\", (string, optional) the proxy used by the server\n" - " \"difficulty\": x.xxxxx, (numeric) the current difficulty\n" + " \"difficulty\": xxxxxx, (numeric) the current difficulty\n" " \"testnet\": true|false, (boolean) if the server is using testnet or not\n" " \"keypoololdest\": xxxxxx, (numeric) the timestamp in seconds of the oldest pre-generated key in the key pool\n" " \"keypoolsize\": xxxx, (numeric) how many new keys are pre-generated\n" " \"unlocked_until\": ttt, (numeric, optional) the timestamp in seconds that the wallet is unlocked for transfers, or 0 if the wallet is locked\n" - " \"paytxfee\": x.xxxx, (numeric) the transaction fee set in " + CURRENCY_UNIT + "/kB\n" - " \"relayfee\": x.xxxx, (numeric) minimum relay fee for non-free transactions in " + CURRENCY_UNIT + "/kB\n" + " \"paytxfee\": xxxxx, (numeric) the transaction fee set in " + CURRENCY_UNIT + " /kB\n" + " \"relayfee\": xxxxx, (numeric) minimum relay fee for non-free transactions in " + CURRENCY_UNIT + " /kB\n" " \"errors\": \"...\" (string) any error messages\n" "}\n" + "\nExamples:\n" + HelpExampleCli("getinfo", "") + HelpExampleRpc("getinfo", "") @@ -153,20 +155,23 @@ UniValue validateaddress(const UniValue& params, bool fHelp) throw runtime_error( "validateaddress \"zenaddress\"\n" "\nVerify an ZEN address is valid.\n" + "\nArguments:\n" - "1. \"zenaddress\" (string, required) The ZEN address to validate\n" + "1. \"zenaddress\" (string, required) the ZEN address to validate\n" + "\nResult:\n" "{\n" - " \"isvalid\" : true|false, (boolean) if the address is valid or not. If not, this is the only property returned.\n" - " \"address\" : \"zenaddress\", (string) the ZEN address validated\n" - " \"scriptPubKey\" : \"hex\", (string) the hex encoded scriptPubKey generated by the address\n" - " \"ismine\" : true|false, (boolean) if the address is yours or not\n" - " \"iswatchonly\" : true|false, (boolean) if the address is set to watch only mode or not\n" - " \"isscript\" : true|false, (boolean) if the key is a script\n" - " \"pubkey\" : \"publickeyhex\", (string, optional) the hex value of the raw public key, only when the address is yours\n" - " \"iscompressed\" : true|false, (boolean, optional) if the address is compressed, only when the address is yours\n" - " \"account\" : \"account\" (string, optional) DEPRECATED. The account associated with the address, \"\" is the default account, only when the address is yours\n" + " \"isvalid\": true|false, (boolean) if the address is valid or not. If not, this is the only property returned\n" + " \"address\": \"zenaddress\", (string) the " + CURRENCY_UNIT + " address validated\n" + " \"scriptPubKey\": \"hex\", (string) the hex encoded scriptPubKey generated by the address\n" + " \"ismine\": true|false, (boolean) if the address is yours or not\n" + " \"iswatchonly\": true|false, (boolean) if the address is set to watch only mode or not\n" + " \"isscript\": true|false, (boolean) if the key is a script\n" + " \"pubkey\": \"publickeyhex\", (string, optional) the hex value of the raw public key, only when the address is yours\n" + " \"iscompressed\": true|false, (boolean, optional) if the address is compressed, only when the address is yours\n" + " \"account\": \"account\" (string, optional) DEPRECATED. the account associated with the address, \"\" is the default account, only when the address is yours\n" "}\n" + "\nExamples:\n" + HelpExampleCli("validateaddress", "\"zenaddress\"") + HelpExampleRpc("validateaddress", "\"zenaddress\"") @@ -217,17 +222,19 @@ UniValue z_validateaddress(const UniValue& params, bool fHelp) throw runtime_error( "z_validateaddress \"zaddr\"\n" "\nVerify an zaddress is valid.\n" + "\nArguments:\n" - "1. \"zaddr\" (string, required) The zaddress to validate\n" + "1. \"zaddr\" (string, required) the zaddress to validate\n" + "\nResult:\n" "{\n" - " \"isvalid\" : true|false, (boolean) if the address is valid or not. If not, this is the only property returned.\n" - " \"address\" : \"zaddr\", (string) the zaddress validated\n" - " \"payingkey\" : \"hex\", (string) the hex value of the paying key, a_pk\n" - " \"transmissionkey\" : \"hex\", (string) the hex value of the transmission key, pk_enc\n" - " \"ismine\" : true|false, (boolean) if the address is yours or not\n" - + " \"isvalid\": true|false, (boolean) if the address is valid or not. If not, this is the only property returned\n" + " \"address\": \"zaddr\", (string) the zaddress validated\n" + " \"payingkey\": \"hex\", (string) the hex value of the paying key, a_pk\n" + " \"transmissionkey\": \"hex\", (string) the hex value of the transmission key, pk_enc\n" + " \"ismine\": true|false (boolean) if the address is yours or not\n" "}\n" + "\nExamples:\n" + HelpExampleCli("z_validateaddress", "\"zaddr\"") + HelpExampleRpc("z_validateaddress", "\"zaddr\"") @@ -347,23 +354,22 @@ UniValue createmultisig(const UniValue& params, bool fHelp) "It returns a json object with the address and redeemScript.\n" "\nArguments:\n" - "1. nrequired (numeric, required) The number of required signatures out of the n keys or addresses.\n" - "2. \"keys\" (string, required) A json array of keys which are ZEN addresses or hex-encoded public keys\n" + "1. nrequired (numeric, required) the number of required signatures out of the n keys or addresses\n" + "2. \"keys\" (string, required) a json array of keys which are " + CURRENCY_UNIT + " addresses or hex-encoded public keys\n" " [\n" - " \"key\" (string) ZEN address or hex-encoded public key\n" + " \"key\" (string) " + CURRENCY_UNIT + " address or hex-encoded public key\n" " ,...\n" " ]\n" "\nResult:\n" "{\n" - " \"address\":\"multisigaddress\", (string) the value of the new multisig address.\n" - " \"redeemScript\":\"script\" (string) the string value of the hex-encoded redemption script.\n" + " \"address\": \"multisigaddress\", (string) the value of the new multisig address\n" + " \"redeemScript\": \"hex\" (string) the string value of the hex-encoded redemption script\n" "}\n" "\nExamples:\n" "\nCreate a multisig address from 2 addresses\n" - + HelpExampleCli("createmultisig", "2 \"[\\\"addr1\\\",\\\"addr2\\\"]\"") + - "\nAs a json rpc call\n" + + HelpExampleCli("createmultisig", "2 \"[\\\"addr1\\\",\\\"addr2\\\"]\"") + HelpExampleRpc("createmultisig", "2, \"[\\\"addr1\\\",\\\"addr2\\\"]\"") ; throw runtime_error(msg); @@ -387,12 +393,15 @@ UniValue verifymessage(const UniValue& params, bool fHelp) throw runtime_error( "verifymessage \"zenaddress\" \"signature\" \"message\"\n" "\nVerify a signed message\n" + "\nArguments:\n" - "1. \"zenaddress\" (string, required) The ZEN address to use for the signature.\n" - "2. \"signature\" (string, required) The signature provided by the signer in base 64 encoding (see signmessage).\n" - "3. \"message\" (string, required) The message that was signed.\n" + "1. \"zenaddress\" (string, required) the " + CURRENCY_UNIT + " address to use for the signature\n" + "2. \"signature\" (string, required) the signature provided by the signer in base 64 encoding (see signmessage)\n" + "3. \"message\" (string, required) the message that was signed\n" + "\nResult:\n" - "true|false (boolean) if the signature is verified or not.\n" + "true|false (boolean) if the signature is verified or not\n" + "\nExamples:\n" "\nUnlock the wallet for 30 seconds\n" + HelpExampleCli("walletpassphrase", "\"mypassphrase\" 30") + @@ -441,11 +450,14 @@ UniValue setmocktime(const UniValue& params, bool fHelp) throw runtime_error( "setmocktime timestamp\n" "\nSet the local time to given timestamp (-regtest only)\n" + "\nArguments:\n" - "1. timestamp (integer, required) Unix seconds-since-epoch timestamp\n" - " Pass 0 to go back to using the system time." + "1. timestamp (numeric, required) Unix seconds-since-epoch timestamp\n" + " pass 0 to go back to using the system tim." + "\nResult:\n" - " \n" + "Nothing\n" + "\nExamples:\n" + HelpExampleCli("setmocktime", "0") + HelpExampleRpc("setmocktime", "0") From ed5b21654fc76c4f8d32f3b027ba6d359e963e8b Mon Sep 17 00:00:00 2001 From: luisantoniocrag Date: Sat, 13 Mar 2021 19:04:09 -0600 Subject: [PATCH 11/33] Fix rpcwallet --- src/wallet/rpcwallet.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 769f9fc1f6..49013626b1 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -469,7 +469,7 @@ UniValue sendtoaddress(const UniValue& params, bool fHelp) "\nArguments:\n" "1. \"horizenaddress\" (string, required) the horizen address to send to\n" - "2. \"amount\" (numeric, required) the amount in " CURRENCY_UNIT + "\n" + "2. \"amount\" (numeric, required) the amount in " + CURRENCY_UNIT + "\n" "3. \"comment\" (string, optional) a comment used to store what the transaction is for\n" " this is not part of the transaction, just kept in your wallet\n" "4. \"comment-to\" (string, optional) a comment to store the name of the person or organization\n" @@ -2381,8 +2381,8 @@ UniValue settxfee(const UniValue& params, bool fHelp) "\nArguments:\n" "1. amount (numeric, required) the transaction fee in " + CURRENCY_UNIT + "/kB rounded to the nearest 0.00000001\n" - " - \nResult\n" + + "\nResult\n" "true|false (boolean) returns true if successful\n" "\nExamples:\n" @@ -2672,7 +2672,7 @@ UniValue zc_sample_joinsplit(const UniValue& params, bool fHelp) CDataStream ss(SER_NETWORK, PROTOCOL_VERSION); auto os = WithTxVersion(&ss, shieldedTxVersion); - os << samplejoinsplit;| + os << samplejoinsplit; return HexStr(ss.begin(), ss.end()); } From f833c5380baf907089eb3ef451cd3a15a3ac9022 Mon Sep 17 00:00:00 2001 From: luisantoniocrag <42625753+luisantoniocrag@users.noreply.github.com> Date: Mon, 10 May 2021 12:52:19 -0500 Subject: [PATCH 12/33] Update src/rpc/blockchain.cpp Co-authored-by: cronicc Update src/rpc/blockchain.cpp Co-authored-by: cronicc Update src/rpc/misc.cpp Co-authored-by: cronicc Update src/rpc/misc.cpp Co-authored-by: cronicc Update src/rpc/misc.cpp typo Co-authored-by: cronicc Update src/wallet/rpcdump.cpp Co-authored-by: cronicc Update src/rpc/blockchain.cpp Co-authored-by: cronicc Update src/rpc/blockchain.cpp Co-authored-by: cronicc Update src/rpc/mining.cpp Co-authored-by: cronicc Update src/rpc/rawtransaction.cpp Co-authored-by: cronicc Update src/rpc/rawtransaction.cpp Co-authored-by: cronicc Update src/rpc/net.cpp Co-authored-by: cronicc Update src/wallet/rpcwallet.cpp Co-authored-by: cronicc Update src/rpc/rawtransaction.cpp Co-authored-by: cronicc Update src/rpc/net.cpp Co-authored-by: cronicc Update src/rpc/rawtransaction.cpp Co-authored-by: cronicc Update src/rpc/net.cpp Co-authored-by: cronicc Update src/rpc/net.cpp Co-authored-by: cronicc Update src/rpc/rawtransaction.cpp Co-authored-by: cronicc Update RPC ports Fix /rpc/blockchain.cpp Co-authored-by: cronicc Fix src/rpc/net.cpp Co-authored-by: cronicc Fix some typos and small changes --- src/init.cpp | 2 +- src/rpc/blockchain.cpp | 16 ++++++++-------- src/rpc/mining.cpp | 4 ++-- src/rpc/misc.cpp | 6 +++--- src/rpc/net.cpp | 16 ++++++++-------- src/rpc/rawtransaction.cpp | 10 +++++----- src/rpc/server.cpp | 2 +- src/wallet/rpcdump.cpp | 2 +- src/wallet/rpcwallet.cpp | 4 ++-- 9 files changed, 31 insertions(+), 31 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index ddc3743984..b6abef2e72 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -551,7 +551,7 @@ std::string HelpMessage(HelpMessageMode mode) strUsage += HelpMessageOpt("-rpcbind=", _("Bind to given address to listen for JSON-RPC connections. Use [host]:port notation for IPv6. This option can be specified multiple times (default: bind to all interfaces)")); strUsage += HelpMessageOpt("-rpcuser=", _("Username for JSON-RPC connections")); strUsage += HelpMessageOpt("-rpcpassword=", _("Password for JSON-RPC connections")); - strUsage += HelpMessageOpt("-rpcport=", strprintf(_("Listen for JSON-RPC connections on (default: %u or testnet: %u)"), 8232, 18232)); + strUsage += HelpMessageOpt("-rpcport=", strprintf(_("Listen for JSON-RPC connections on (default: %u or testnet: %u)"), 8231, 18231)); strUsage += HelpMessageOpt("-rpcallowip=", _("Allow JSON-RPC connections from specified source. Valid for are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times")); strUsage += HelpMessageOpt("-rpcthreads=", strprintf(_("Set the number of threads to service RPC calls (default: %d)"), DEFAULT_HTTP_THREADS)); if (showDebug) { diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index 7691e18e3a..88efe97922 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -195,7 +195,7 @@ UniValue getbestblockhash(const UniValue& params, bool fHelp) if (fHelp || params.size() != 0) throw runtime_error( "getbestblockhash\n" - "\nReturns the hash of the best (most recent) block in the longest block chain.\n" + "\nReturns the hash of the best (most recent) block in the active block chain.\n" "\nResult\n" "\"hex\" (string) the block hash hex encoded\n" @@ -458,7 +458,7 @@ UniValue getblock(const UniValue& params, bool fHelp) "\nResult (for verbosity = 2):\n" "{\n" - " ..., same output as verbosity = 2\n" + " ..., same output as verbosity = 1\n" " \"tx\" : [ (array of Objects) the transactions in the format of the getrawtransaction RPC\n" " ,...\n" " ],\n" @@ -1129,13 +1129,13 @@ UniValue getblockfinalityindex(const UniValue& params, bool fHelp) if (fHelp || params.size() < 1 || params.size() > 2) throw runtime_error( "getblockfinalityindex \"hash\"\n" - "\nReturns the minimum number of consecutive blocks a miner should mine from now in order to revert the block of given hash\n" + "\nReturns the minimum number of consecutive blocks a miner would have to mine from now in order to revert the block of given hash\n" "\nArguments:\n" - "1. hash (string, required) the block hash" + "1. hash (string, required) the block hash\n" - "\"Result:\n" - "n (numeric) number of consecutive blocks a miner should mine from now in order to revert the block of given hash\n" + "\nResult:\n" + "n (numeric) number of consecutive blocks a miner would have to mine from now in order to revert the block of given hash\n" "\nExamples:\n" + HelpExampleCli("getblockfinalityindex", "\"hash\"") @@ -1212,8 +1212,8 @@ UniValue getglobaltips(const UniValue& params, bool fHelp) "[\"hash\" (string, block hash) ]\n" "\nExamples:\n" - + HelpExampleCli("getglobaltips", "\"hash\"") - + HelpExampleRpc("getglobaltips", "\"hash\"") + + HelpExampleCli("getglobaltips", "") + + HelpExampleRpc("getglobaltips", "") ); } LOCK(cs_main); diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp index d1f106e1b0..cb58be907a 100644 --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -896,8 +896,8 @@ UniValue getblocksubsidy(const UniValue& params, bool fHelp) "{\n" " \"miner\": xxxx, (numeric) the mining reward amount in " + CURRENCY_UNIT + "\n" " \"community\": xxxx, (numeric) the community fund amount in " + CURRENCY_UNIT + "\n" - " \"securenodes\": xxxx, (numeric) the securenodes fund amount in " + CURRENCY_UNIT + " (only if securenode HF fund is available)\n" - " \"supernodes\": xxxx (numeric) the supernodes fund amount in " + CURRENCY_UNIT + " (only if supernode HF fund is available)\n" + " \"securenodes\": xxxx, (numeric) the securenodes fund amount in " + CURRENCY_UNIT + "\n" + " \"supernodes\": xxxx (numeric) the supernodes fund amount in " + CURRENCY_UNIT + "\n" "}\n" "\nExamples:\n" diff --git a/src/rpc/misc.cpp b/src/rpc/misc.cpp index c280a4e617..0fdf766a40 100644 --- a/src/rpc/misc.cpp +++ b/src/rpc/misc.cpp @@ -154,7 +154,7 @@ UniValue validateaddress(const UniValue& params, bool fHelp) if (fHelp || params.size() != 1) throw runtime_error( "validateaddress \"zenaddress\"\n" - "\nVerify an ZEN address is valid.\n" + "\nReturn information about the given ZEN address.\n" "\nArguments:\n" "1. \"zenaddress\" (string, required) the ZEN address to validate\n" @@ -221,7 +221,7 @@ UniValue z_validateaddress(const UniValue& params, bool fHelp) if (fHelp || params.size() != 1) throw runtime_error( "z_validateaddress \"zaddr\"\n" - "\nVerify an zaddress is valid.\n" + "\nReturn information about the given zaddress.\n" "\nArguments:\n" "1. \"zaddr\" (string, required) the zaddress to validate\n" @@ -453,7 +453,7 @@ UniValue setmocktime(const UniValue& params, bool fHelp) "\nArguments:\n" "1. timestamp (numeric, required) Unix seconds-since-epoch timestamp\n" - " pass 0 to go back to using the system tim." + " pass 0 to go back to using the system time." "\nResult:\n" "Nothing\n" diff --git a/src/rpc/net.cpp b/src/rpc/net.cpp index 50ed9afefc..61a11e4896 100644 --- a/src/rpc/net.cpp +++ b/src/rpc/net.cpp @@ -88,7 +88,7 @@ UniValue getpeerinfo(const UniValue& params, bool fHelp) "getpeerinfo\n" "\nReturns data about each connected network node as a json array of objects.\n" - "\nbResult:\n" + "\nResult:\n" "[\n" " {\n" " \"id\": n, (numeric) peer index\n" @@ -96,7 +96,7 @@ UniValue getpeerinfo(const UniValue& params, bool fHelp) " \"addrlocal\": \"ip:port\", (string) local address\n" " \"services\":\"xxxxxxxxxxxxxxxx\", (string) the services offered\n" " \"tls_established\": true|false, (boolean) status of TLS connection\n" - " \"tls_verified\": true|false, (boolean) status of peer certificate. Will be true if a peer certificate can be verified with some trusted root certs \n" + " \"tls_verified\": true|false, (boolean) status of peer certificate. True if the chain of trust of a peer certificate can be verified using the OS certificate store\n" " \"lastsend\": ttt, (numeric) the time in seconds since epoch (Jan 1 1970 GMT) of the last send\n" " \"lastrecv\": ttt, (numeric) the time in seconds since epoch (Jan 1 1970 GMT) of the last receive\n" " \"bytessent\": n, (numeric) the total bytes sent\n" @@ -247,8 +247,8 @@ UniValue disconnectnode(const UniValue& params, bool fHelp) "Nothing\n" "\nExamples:\n" - + HelpExampleCli("disconnectnode", "\"192.168.0.6:8233\"") - + HelpExampleRpc("disconnectnode", "\"192.168.0.6:8233\"") + + HelpExampleCli("disconnectnode", "\"192.168.0.6:9033\"") + + HelpExampleRpc("disconnectnode", "\"192.168.0.6:9033\"") ); CNode* pNode = FindNode(params[0].get_str()); @@ -442,7 +442,7 @@ UniValue getnetworkinfo(const UniValue& params, bool fHelp) " \"timeoffset\": 0, (numeric) the time offset (deprecated; always 0)\n" " \"connections\": xxxxx, (numeric) the total number of open connections for the node\n" " \"tls_cert_verified\": true|flase, (boolean) true if the certificate of the current node is verified\n" - " \"networks\": [ (array) an array of objects describing IPV4, IPV6 and Onion network interface states\n" + " \"networks\": [ (array) an array of objects describing IPV4, IPV6 and Onion network status\n" " {\n" " \"name\": \"xxx\", (string) network (ipv4, ipv6 or onion)\n" " \"limited\": true|false, (boolean) is the network limited using -onlynet?\n" @@ -508,11 +508,11 @@ UniValue setban(const UniValue& params, bool fHelp) (strCommand != "add" && strCommand != "remove")) throw runtime_error( "setban \"ip(/netmask)\" \"add|remove\" (bantime) (absolute)\n" - "\nAttempts add or remove a IP/Subnet from the banned list.\n" + "\nAttempts to add or remove an IP/Subnet from the banned list.\n" "\nArguments:\n" - "1. \"ip(/netmask)\" (string, required) the IP/Subnet (see getpeerinfo for nodes ip) with a optional netmask (default is /32 = single ip)\n" - "2. \"command\" (string, required) 'add' to add a IP/Subnet to the list, 'remove' to remove a IP/Subnet from the list\n" + "1. \"ip(/netmask)\" (string, required) the IP/Subnet (see getpeerinfo for nodes ip) with an optional netmask (default is /32 = single ip)\n" + "2. \"command\" (string, required) 'add' to add an IP/Subnet to the list, 'remove' to remove an IP/Subnet from the list\n" "3. \"bantime\" (numeric, optional) time in seconds how long (or until when if [absolute] is set) the ip is banned (0 or empty means using the default time of 24h which can also be overwritten by the -bantime startup argument)\n" "4. \"absolute\" (boolean, optional) if set, the bantime must be a absolute timestamp in seconds since epoch (Jan 1 1970 GMT)\n" diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp index 43eae1549a..5234c4a11d 100644 --- a/src/rpc/rawtransaction.cpp +++ b/src/rpc/rawtransaction.cpp @@ -195,7 +195,7 @@ UniValue getrawtransaction(const UniValue& params, bool fHelp) " \"vin\": [ (array of json objects)\n" " {\n" " \"txid\": \"id\", (string) the transaction id\n" - " \"vout\": n, (numeric) the output number\n" + " \"vout\": n, (numeric) the output index\n" " \"scriptSig\": { (json object) the script\n" " \"asm\": \"asm\", (string) the asm\n" " \"hex\": \"hex\" (string) the hex\n" @@ -221,7 +221,7 @@ UniValue getrawtransaction(const UniValue& params, bool fHelp) " }\n" " ,...\n" " ],\n" - " \"vjoinsplit\" : [ (array of json objects, only for version >= 2)\n" + " \"vjoinsplit\" : [ (array of json objects, only for version 2 or -3)\n" " {\n" " \"vpub_old\": x.xxx, (numeric) public input value in " + CURRENCY_UNIT + "\n" " \"vpub_new\": x.xxx, (numeric) public output value in " + CURRENCY_UNIT + "\n" @@ -506,7 +506,7 @@ UniValue decoderawtransaction(const UniValue& params, bool fHelp) " \"vin\": [ (array of json objects)\n" " {\n" " \"txid\": \"id\", (string) the transaction id\n" - " \"vout\": n, (numeric) the output number\n" + " \"vout\": n, (numeric) the output index\n" " \"scriptSig\": { (json object) the script\n" " \"asm\": \"asm\", (string) the asm\n" " \"hex\": \"hex\" (string) the hex\n" @@ -532,7 +532,7 @@ UniValue decoderawtransaction(const UniValue& params, bool fHelp) " }\n" " ,...\n" " ],\n" - " \"vjoinsplit\": [ (array of json objects, only for version >= 2)\n" + " \"vjoinsplit\": [ (array of json objects, only for version 2 or -3)\n" " {\n" " \"vpub_old\": xxxx, (numeric) public input value in " + CURRENCY_UNIT + "\n" " \"vpub_new\": xxxx, (numeric) public output value in " + CURRENCY_UNIT + "\n" @@ -652,7 +652,7 @@ UniValue signrawtransaction(const UniValue& params, bool fHelp) "\nArguments:\n" "1. \"hexstring\" (string, required) the transaction hex string\n" - "2. \"prevtxs\" (string, optional) an json array of previous dependent transaction outputs\n" + "2. \"prevtxs\" (string, optional) a json array of previous dependent transaction outputs\n" " [ (json array of json objects, or 'null' if none provided)\n" " {\n" " \"txid\": \"id\", (string, required) the transaction id\n" diff --git a/src/rpc/server.cpp b/src/rpc/server.cpp index 3e33cd93b4..e9f05d7c15 100644 --- a/src/rpc/server.cpp +++ b/src/rpc/server.cpp @@ -610,7 +610,7 @@ std::string HelpExampleCli(const std::string& methodname, const std::string& arg std::string HelpExampleRpc(const std::string& methodname, const std::string& args) { return "> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", " - "\"method\": \"" + methodname + "\", \"params\": [" + args + "] }' -H 'content-type: text/plain;' http://127.0.0.1:8232/\n"; + "\"method\": \"" + methodname + "\", \"params\": [" + args + "] }' -H 'content-type: text/plain;' http://127.0.0.1:8231/\n"; } void RPCRegisterTimerInterface(RPCTimerInterface *iface) diff --git a/src/wallet/rpcdump.cpp b/src/wallet/rpcdump.cpp index 95acab4cfa..85f6c90645 100644 --- a/src/wallet/rpcdump.cpp +++ b/src/wallet/rpcdump.cpp @@ -792,7 +792,7 @@ UniValue z_exportkey(const UniValue& params, bool fHelp) "\nExamples:\n" + HelpExampleCli("z_exportkey", "\"myaddress\"") - + HelpExampleCli("z_importkey", "\"zaddr\"") + + HelpExampleCli("z_importkey", "\"zkey\"") + HelpExampleRpc("z_exportkey", "\"zaddr\"") ); diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 49013626b1..79e3e64f48 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -283,8 +283,8 @@ UniValue setaccount(const UniValue& params, bool fHelp) "Nothing\n" "\nExamples:\n" - + HelpExampleCli("setaccount", "\"t14oHp2v54vfmdgQ3v3SNuQga8JKHTNi2a1\" \"tabby\"") - + HelpExampleRpc("setaccount", "\"t14oHp2v54vfmdgQ3v3SNuQga8JKHTNi2a1\", \"tabby\"") + + HelpExampleCli("setaccount", "\"horizenaddress\" \"tabby\"") + + HelpExampleRpc("setaccount", "\"horizenaddress\", \"tabby\"") ); LOCK2(cs_main, pwalletMain->cs_wallet); From 728008a9b05269c2e338dfb33c11831aa24d32f6 Mon Sep 17 00:00:00 2001 From: cronicc Date: Thu, 10 Jun 2021 15:26:01 +0000 Subject: [PATCH 13/33] Change user agent in help messages from 'MagicBean' to 'zen' --- src/rpc/net.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rpc/net.cpp b/src/rpc/net.cpp index 61a11e4896..42590fd276 100644 --- a/src/rpc/net.cpp +++ b/src/rpc/net.cpp @@ -106,7 +106,7 @@ UniValue getpeerinfo(const UniValue& params, bool fHelp) " \"pingtime\": n, (numeric) ping time\n" " \"pingwait\": n, (numeric) ping wait\n" " \"version\": v, (numeric) the protocol version of the peer\n" - " \"subver\": \"/MagicBean:x.y.z[-v]/\", (string) the user agent of the peer\n" + " \"subver\": \"/zen:x.y.z[-v]/\", (string) the user agent of the peer\n" " \"inbound\": true|false, (boolean) inbound (true) or outbound (false)\n" " \"startingheight\": n, (numeric) the starting height (block) of the peer\n" " \"banscore\": n, (numeric) the ban score\n" @@ -436,7 +436,7 @@ UniValue getnetworkinfo(const UniValue& params, bool fHelp) "\nResult:\n" "{\n" " \"version\": xxxxx, (numeric) the version of the node as a numeric\n" - " \"subversion\": \"/MagicBean:x.y.z[-v]/\", (string) the subversion of the node, as advertised to peers\n" + " \"subversion\": \"/zen:x.y.z[-v]/\", (string) the subversion of the node, as advertised to peers\n" " \"protocolversion\": xxxxx, (numeric) the protocol version of the node\n" " \"localservices\": \"xxxxxxx\", (string) the services supported by the node, as advertised in its version message\n" " \"timeoffset\": 0, (numeric) the time offset (deprecated; always 0)\n" From ec9036965962a438849153bc562e0a3ba76fd300 Mon Sep 17 00:00:00 2001 From: cronicc Date: Tue, 8 Jun 2021 11:51:55 +0000 Subject: [PATCH 14/33] Add websocket-client python test dependency --- .../ci-horizen/dockerfiles/amd64/linux/ubuntu_bionic/Dockerfile | 2 +- .../ci-horizen/dockerfiles/amd64/linux/ubuntu_xenial/Dockerfile | 2 +- contrib/ci-horizen/scripts/common/setup_environment.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/ci-horizen/dockerfiles/amd64/linux/ubuntu_bionic/Dockerfile b/contrib/ci-horizen/dockerfiles/amd64/linux/ubuntu_bionic/Dockerfile index acc55e9efa..01668ff485 100644 --- a/contrib/ci-horizen/dockerfiles/amd64/linux/ubuntu_bionic/Dockerfile +++ b/contrib/ci-horizen/dockerfiles/amd64/linux/ubuntu_bionic/Dockerfile @@ -15,7 +15,7 @@ RUN set -euxo pipefail \ ca-certificates cmake curl dirmngr fakeroot git g++-multilib gnupg2 help2man libc6-dev libgomp1 \ libtool lintian m4 ncurses-dev pigz pkg-config pv python python-dev python-pip python-setuptools \ python-wheel python-wheel-common python-zmq unzip wget zlib1g-dev \ - && pip install b2==1.4.2 pyblake2 \ + && pip install b2==1.4.2 pyblake2 websocket-client2 \ && BASEURL="https://github.com/tianon/gosu/releases/download/" \ && GOSU_VERSION="1.11" \ && DPKG_ARCH="$(dpkg --print-architecture | awk -F- '{ print $NF }')" \ diff --git a/contrib/ci-horizen/dockerfiles/amd64/linux/ubuntu_xenial/Dockerfile b/contrib/ci-horizen/dockerfiles/amd64/linux/ubuntu_xenial/Dockerfile index c35596c950..97384f38f8 100644 --- a/contrib/ci-horizen/dockerfiles/amd64/linux/ubuntu_xenial/Dockerfile +++ b/contrib/ci-horizen/dockerfiles/amd64/linux/ubuntu_xenial/Dockerfile @@ -15,7 +15,7 @@ RUN set -euxo pipefail \ ca-certificates cmake curl dirmngr fakeroot git g++-multilib gnupg2 help2man libc6-dev libgomp1 \ libtool lintian m4 ncurses-dev pigz pkg-config pv python python-dev python-pip python-setuptools \ python-wheel python-wheel-common python-zmq unzip wget zlib1g-dev \ - && pip install b2==1.4.2 pyblake2 \ + && pip install b2==1.4.2 pyblake2 websocket-client2 \ && BASEURL="https://github.com/tianon/gosu/releases/download/" \ && GOSU_VERSION="1.11" \ && DPKG_ARCH="$(dpkg --print-architecture | awk -F- '{ print $NF }')" \ diff --git a/contrib/ci-horizen/scripts/common/setup_environment.sh b/contrib/ci-horizen/scripts/common/setup_environment.sh index 3f3dd3cc3c..a9d4277511 100755 --- a/contrib/ci-horizen/scripts/common/setup_environment.sh +++ b/contrib/ci-horizen/scripts/common/setup_environment.sh @@ -77,7 +77,7 @@ if [ "${TRAVIS_OS_NAME}" = "osx" ]; then NEED_B2_CREDS="true" fi if [ "${TRAVIS_BUILD_STAGE_NAME}" = "Test" ]; then - export PIP_INSTALL="${PIP_INSTALL} pyblake2 pyzmq" + export PIP_INSTALL="${PIP_INSTALL} pyblake2 pyzmq websocket-client2" export B2_DL_DECOMPRESS_FOLDER="${TRAVIS_BUILD_DIR}" export B2_DL_FILENAME="${TRAVIS_CPU_ARCH}-${TRAVIS_OS_NAME}-${TRAVIS_OSX_IMAGE}-${TRAVIS_BUILD_ID}-${TRAVIS_COMMIT}.tar.gz" mkdir -p "$HOME/ZcashParams" From f6bff59534c7fc43e0bb6e3720fc3ebb408726e8 Mon Sep 17 00:00:00 2001 From: cronicc Date: Tue, 8 Jun 2021 12:16:11 +0000 Subject: [PATCH 15/33] Update CI builder dockerfiles: * remove unused arm64 dockerfiles * replace ubuntu:xenial with ubuntu:focal * update gosu to 1.13 --- .../amd64/linux/ubuntu_bionic/Dockerfile | 6 +-- .../Dockerfile | 12 ++--- .../entrypoint.sh | 0 .../amd64/windows/ubuntu_bionic/Dockerfile | 6 +-- .../arm64/linux/ubuntu_bionic/Dockerfile | 53 ------------------- .../arm64/linux/ubuntu_bionic/entrypoint.sh | 39 -------------- .../arm64/linux/ubuntu_xenial/Dockerfile | 53 ------------------- .../arm64/linux/ubuntu_xenial/entrypoint.sh | 39 -------------- 8 files changed, 12 insertions(+), 196 deletions(-) rename contrib/ci-horizen/dockerfiles/amd64/linux/{ubuntu_xenial => ubuntu_focal}/Dockerfile (89%) rename contrib/ci-horizen/dockerfiles/amd64/linux/{ubuntu_xenial => ubuntu_focal}/entrypoint.sh (100%) delete mode 100644 contrib/ci-horizen/dockerfiles/arm64/linux/ubuntu_bionic/Dockerfile delete mode 100755 contrib/ci-horizen/dockerfiles/arm64/linux/ubuntu_bionic/entrypoint.sh delete mode 100644 contrib/ci-horizen/dockerfiles/arm64/linux/ubuntu_xenial/Dockerfile delete mode 100755 contrib/ci-horizen/dockerfiles/arm64/linux/ubuntu_xenial/entrypoint.sh diff --git a/contrib/ci-horizen/dockerfiles/amd64/linux/ubuntu_bionic/Dockerfile b/contrib/ci-horizen/dockerfiles/amd64/linux/ubuntu_bionic/Dockerfile index 01668ff485..864536ee89 100644 --- a/contrib/ci-horizen/dockerfiles/amd64/linux/ubuntu_bionic/Dockerfile +++ b/contrib/ci-horizen/dockerfiles/amd64/linux/ubuntu_bionic/Dockerfile @@ -7,17 +7,17 @@ COPY entrypoint.sh /usr/local/bin/entrypoint.sh SHELL ["/bin/bash", "-c"] RUN set -euxo pipefail \ - && DEBIAN_FRONTEND=noninteractive \ + && export DEBIAN_FRONTEND=noninteractive \ && apt-get update \ && apt-get -y --no-install-recommends install apt-utils \ && apt-get -y --no-install-recommends dist-upgrade \ && apt-get -y --no-install-recommends install aria2 autoconf automake bsdmainutils build-essential \ ca-certificates cmake curl dirmngr fakeroot git g++-multilib gnupg2 help2man libc6-dev libgomp1 \ - libtool lintian m4 ncurses-dev pigz pkg-config pv python python-dev python-pip python-setuptools \ + libtool lintian m4 ncurses-dev pigz pkg-config pv python-dev python-pip python-setuptools \ python-wheel python-wheel-common python-zmq unzip wget zlib1g-dev \ && pip install b2==1.4.2 pyblake2 websocket-client2 \ && BASEURL="https://github.com/tianon/gosu/releases/download/" \ - && GOSU_VERSION="1.11" \ + && GOSU_VERSION="1.13" \ && DPKG_ARCH="$(dpkg --print-architecture | awk -F- '{ print $NF }')" \ && curl -o /usr/local/bin/gosu -SL "${BASEURL}/${GOSU_VERSION}/gosu-${DPKG_ARCH}" \ && curl -o /usr/local/bin/gosu.asc -SL "${BASEURL}/${GOSU_VERSION}/gosu-${DPKG_ARCH}.asc" \ diff --git a/contrib/ci-horizen/dockerfiles/amd64/linux/ubuntu_xenial/Dockerfile b/contrib/ci-horizen/dockerfiles/amd64/linux/ubuntu_focal/Dockerfile similarity index 89% rename from contrib/ci-horizen/dockerfiles/amd64/linux/ubuntu_xenial/Dockerfile rename to contrib/ci-horizen/dockerfiles/amd64/linux/ubuntu_focal/Dockerfile index 97384f38f8..1b6cf5c7e4 100644 --- a/contrib/ci-horizen/dockerfiles/amd64/linux/ubuntu_xenial/Dockerfile +++ b/contrib/ci-horizen/dockerfiles/amd64/linux/ubuntu_focal/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:xenial +FROM ubuntu:focal MAINTAINER cronic@zensystem.io @@ -7,17 +7,17 @@ COPY entrypoint.sh /usr/local/bin/entrypoint.sh SHELL ["/bin/bash", "-c"] RUN set -euxo pipefail \ - && DEBIAN_FRONTEND=noninteractive \ + && export DEBIAN_FRONTEND=noninteractive \ && apt-get update \ && apt-get -y --no-install-recommends install apt-utils \ && apt-get -y --no-install-recommends dist-upgrade \ && apt-get -y --no-install-recommends install aria2 autoconf automake bsdmainutils build-essential \ ca-certificates cmake curl dirmngr fakeroot git g++-multilib gnupg2 help2man libc6-dev libgomp1 \ - libtool lintian m4 ncurses-dev pigz pkg-config pv python python-dev python-pip python-setuptools \ - python-wheel python-wheel-common python-zmq unzip wget zlib1g-dev \ - && pip install b2==1.4.2 pyblake2 websocket-client2 \ + libtool lintian m4 ncurses-dev pigz pkg-config pv python2-dev python-setuptools unzip wget zlib1g-dev \ + && curl -s https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2 \ + && pip2 install b2==1.4.2 pyblake2 pyzmq websocket-client2 \ && BASEURL="https://github.com/tianon/gosu/releases/download/" \ - && GOSU_VERSION="1.11" \ + && GOSU_VERSION="1.13" \ && DPKG_ARCH="$(dpkg --print-architecture | awk -F- '{ print $NF }')" \ && curl -o /usr/local/bin/gosu -SL "${BASEURL}/${GOSU_VERSION}/gosu-${DPKG_ARCH}" \ && curl -o /usr/local/bin/gosu.asc -SL "${BASEURL}/${GOSU_VERSION}/gosu-${DPKG_ARCH}.asc" \ diff --git a/contrib/ci-horizen/dockerfiles/amd64/linux/ubuntu_xenial/entrypoint.sh b/contrib/ci-horizen/dockerfiles/amd64/linux/ubuntu_focal/entrypoint.sh similarity index 100% rename from contrib/ci-horizen/dockerfiles/amd64/linux/ubuntu_xenial/entrypoint.sh rename to contrib/ci-horizen/dockerfiles/amd64/linux/ubuntu_focal/entrypoint.sh diff --git a/contrib/ci-horizen/dockerfiles/amd64/windows/ubuntu_bionic/Dockerfile b/contrib/ci-horizen/dockerfiles/amd64/windows/ubuntu_bionic/Dockerfile index 9a31cf0d1c..380e591983 100644 --- a/contrib/ci-horizen/dockerfiles/amd64/windows/ubuntu_bionic/Dockerfile +++ b/contrib/ci-horizen/dockerfiles/amd64/windows/ubuntu_bionic/Dockerfile @@ -7,17 +7,17 @@ COPY entrypoint.sh /usr/local/bin/entrypoint.sh SHELL ["/bin/bash", "-c"] RUN set -euxo pipefail \ - && DEBIAN_FRONTEND=noninteractive \ + && export DEBIAN_FRONTEND=noninteractive \ && apt-get update \ && apt-get -y --no-install-recommends install apt-utils \ && apt-get -y --no-install-recommends dist-upgrade \ && apt-get -y --no-install-recommends install aria2 autoconf automake bsdmainutils build-essential \ ca-certificates cmake curl dirmngr git g++-multilib gnupg2 help2man libc6-dev libgomp1 libtool \ - m4 mingw-w64 ncurses-dev pigz pkg-config pv python python-pip python-setuptools python-wheel \ + m4 mingw-w64 ncurses-dev pigz pkg-config pv python-minimal python-pip python-setuptools python-wheel \ python-wheel-common unzip wget zlib1g-dev \ && pip install b2==1.4.2 \ && BASEURL="https://github.com/tianon/gosu/releases/download/" \ - && GOSU_VERSION="1.11" \ + && GOSU_VERSION="1.13" \ && DPKG_ARCH="$(dpkg --print-architecture | awk -F- '{ print $NF }')" \ && curl -o /usr/local/bin/gosu -SL "${BASEURL}/${GOSU_VERSION}/gosu-${DPKG_ARCH}" \ && curl -o /usr/local/bin/gosu.asc -SL "${BASEURL}/${GOSU_VERSION}/gosu-${DPKG_ARCH}.asc" \ diff --git a/contrib/ci-horizen/dockerfiles/arm64/linux/ubuntu_bionic/Dockerfile b/contrib/ci-horizen/dockerfiles/arm64/linux/ubuntu_bionic/Dockerfile deleted file mode 100644 index 9102b15ae6..0000000000 --- a/contrib/ci-horizen/dockerfiles/arm64/linux/ubuntu_bionic/Dockerfile +++ /dev/null @@ -1,53 +0,0 @@ -FROM ubuntu:bionic - -MAINTAINER cronic@zensystem.io - -COPY entrypoint.sh /usr/local/bin/entrypoint.sh - -SHELL ["/bin/bash", "-c"] - -RUN set -euxo pipefail \ - && DEBIAN_FRONTEND=noninteractive \ - && apt-get update \ - && apt-get -y --no-install-recommends install apt-utils \ - && apt-get -y --no-install-recommends dist-upgrade \ - && apt-get -y --no-install-recommends install aria2 autoconf automake bsdmainutils build-essential \ - ca-certificates cmake curl dirmngr fakeroot git g++-multilib gnupg2 help2man libc6-dev libgomp1 \ - libtool lintian m4 ncurses-dev pigz pkg-config pv python python-dev python-pip python-setuptools \ - python-wheel python-wheel-common python-zmq unzip wget zlib1g-dev \ - && pip install b2==1.4.2 pyblake2 \ - && BASEURL="https://github.com/tianon/gosu/releases/download/" \ - && GOSU_VERSION="1.11" \ - && DPKG_ARCH="$(dpkg --print-architecture | awk -F- '{ print $NF }')" \ - && curl -o /usr/local/bin/gosu -SL "${BASEURL}/${GOSU_VERSION}/gosu-${DPKG_ARCH}" \ - && curl -o /usr/local/bin/gosu.asc -SL "${BASEURL}/${GOSU_VERSION}/gosu-${DPKG_ARCH}.asc" \ - && export GNUPGHOME="$(mktemp -d)" \ - && gpg2 --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 || \ - gpg2 --batch --keyserver hkp://ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 || \ - gpg2 --batch --keyserver pgp.mit.edu --recv-key B42F6819007F00F88E364FD4036A9C25BF357DD4 || \ - gpg2 --batch --keyserver keyserver.pgp.com --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 || \ - gpg2 --batch --keyserver pgp.key-server.io --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 \ - && gpg2 --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu \ - && rm -r "$GNUPGHOME" /usr/local/bin/gosu.asc \ - && chmod +x /usr/local/bin/gosu \ - && gosu nobody true \ - && BASEURL=$(curl -s https://api.github.com/repos/ipfs/go-ipfs/releases | grep browser_download_url | grep -v 'rc[0-9]/go' | awk 'FNR <= 1' | cut -d '"' -f 4 | sed 's:/[^/]*$::') \ - && IPFS_VERSION=$(echo -n $BASEURL | sed 's:.*/::') \ - && TMP="$(mktemp -d)" \ - && curl -SLo "$TMP/go-ipfs_${IPFS_VERSION}_linux-${DPKG_ARCH}.tar.gz" "${BASEURL}/go-ipfs_${IPFS_VERSION}_linux-${DPKG_ARCH}.tar.gz" \ - && curl -SLo "$TMP/go-ipfs_${IPFS_VERSION}_linux-${DPKG_ARCH}.tar.gz.sha512" "${BASEURL}/go-ipfs_${IPFS_VERSION}_linux-${DPKG_ARCH}.tar.gz.sha512" \ - && cd $TMP && sha512sum -c "go-ipfs_${IPFS_VERSION}_linux-${DPKG_ARCH}.tar.gz.sha512" && tar -xf "go-ipfs_${IPFS_VERSION}_linux-${DPKG_ARCH}.tar.gz" \ - && cd go-ipfs && ./install.sh && cd && rm -rf $TMP \ - && apt-get -y autoremove --purge \ - && apt-get -y autoclean \ - && apt-get clean \ - && rm -rf /var/cache/apt/archives/*.deb /var/lib/apt/lists/* /root/.cache /tmp/* \ - && chmod +x /usr/local/bin/entrypoint.sh - -VOLUME ["/mnt/.ccache"] - -VOLUME ["/mnt/.zcash-params"] - -VOLUME ["/mnt/build"] - -ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] diff --git a/contrib/ci-horizen/dockerfiles/arm64/linux/ubuntu_bionic/entrypoint.sh b/contrib/ci-horizen/dockerfiles/arm64/linux/ubuntu_bionic/entrypoint.sh deleted file mode 100755 index 27db4f28eb..0000000000 --- a/contrib/ci-horizen/dockerfiles/arm64/linux/ubuntu_bionic/entrypoint.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash -set -e - -# Add local zenbuilder user -# Either use LOCAL_USER_ID:LOCAL_GRP_ID if set via environment -# or fallback to 9001:9001 - -USER_ID=${LOCAL_USER_ID:-9001} -GRP_ID=${LOCAL_GRP_ID:-9001} - -getent group zenbuilder > /dev/null 2>&1 || groupadd -g $GRP_ID zenbuilder -id -u zenbuilder > /dev/null 2>&1 || useradd --shell /bin/bash -u $USER_ID -g $GRP_ID -o -c "" -m zenbuilder - -LOCAL_UID=$(id -u zenbuilder) -LOCAL_GID=$(getent group zenbuilder | cut -d ":" -f 3) - -if [ ! "$USER_ID" == "$LOCAL_UID" ] || [ ! "$GRP_ID" == "$LOCAL_GID" ]; then - echo "Warning: User zenbuilder with differing UID $LOCAL_UID/GID $LOCAL_GID already exists, most likely this container was started before with a different UID/GID. Re-create it to change UID/GID." -fi - -echo "Starting with UID/GID: $LOCAL_UID:$LOCAL_GID" - -export HOME=/home/zenbuilder - -# Mount host directories -for dir in .ccache .zcash-params build; do - if [ -d "/mnt/${dir}" ]; then - if [ ! -L "/home/zenbuilder/${dir}" ]; then - ln -sf "/mnt/${dir}" "/home/zenbuilder/${dir}" - fi - else - mkdir -p "/home/zenbuilder/${dir}" - fi -done - -# Fix ownership recursively -chown -RH zenbuilder:zenbuilder /home/zenbuilder - -exec /usr/local/bin/gosu zenbuilder "$@" diff --git a/contrib/ci-horizen/dockerfiles/arm64/linux/ubuntu_xenial/Dockerfile b/contrib/ci-horizen/dockerfiles/arm64/linux/ubuntu_xenial/Dockerfile deleted file mode 100644 index 6627d9401e..0000000000 --- a/contrib/ci-horizen/dockerfiles/arm64/linux/ubuntu_xenial/Dockerfile +++ /dev/null @@ -1,53 +0,0 @@ -FROM ubuntu:xenial - -MAINTAINER cronic@zensystem.io - -COPY entrypoint.sh /usr/local/bin/entrypoint.sh - -SHELL ["/bin/bash", "-c"] - -RUN set -euxo pipefail \ - && DEBIAN_FRONTEND=noninteractive \ - && apt-get update \ - && apt-get -y --no-install-recommends install apt-utils \ - && apt-get -y --no-install-recommends dist-upgrade \ - && apt-get -y --no-install-recommends install aria2 autoconf automake bsdmainutils build-essential \ - ca-certificates cmake curl dirmngr fakeroot git g++-multilib gnupg2 help2man libc6-dev libgomp1 \ - libtool lintian m4 ncurses-dev pigz pkg-config pv python python-dev python-pip python-setuptools \ - python-wheel python-wheel-common python-zmq unzip wget zlib1g-dev \ - && pip install b2==1.4.2 pyblake2 \ - && BASEURL="https://github.com/tianon/gosu/releases/download/" \ - && GOSU_VERSION="1.11" \ - && DPKG_ARCH="$(dpkg --print-architecture | awk -F- '{ print $NF }')" \ - && curl -o /usr/local/bin/gosu -SL "${BASEURL}/${GOSU_VERSION}/gosu-${DPKG_ARCH}" \ - && curl -o /usr/local/bin/gosu.asc -SL "${BASEURL}/${GOSU_VERSION}/gosu-${DPKG_ARCH}.asc" \ - && export GNUPGHOME="$(mktemp -d)" \ - && gpg2 --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 || \ - gpg2 --batch --keyserver hkp://ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 || \ - gpg2 --batch --keyserver pgp.mit.edu --recv-key B42F6819007F00F88E364FD4036A9C25BF357DD4 || \ - gpg2 --batch --keyserver keyserver.pgp.com --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 || \ - gpg2 --batch --keyserver pgp.key-server.io --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 \ - && gpg2 --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu \ - && rm -r "$GNUPGHOME" /usr/local/bin/gosu.asc \ - && chmod +x /usr/local/bin/gosu \ - && gosu nobody true \ - && BASEURL=$(curl -s https://api.github.com/repos/ipfs/go-ipfs/releases | grep browser_download_url | grep -v 'rc[0-9]/go' | awk 'FNR <= 1' | cut -d '"' -f 4 | sed 's:/[^/]*$::') \ - && IPFS_VERSION=$(echo -n $BASEURL | sed 's:.*/::') \ - && TMP="$(mktemp -d)" \ - && curl -SLo "$TMP/go-ipfs_${IPFS_VERSION}_linux-${DPKG_ARCH}.tar.gz" "${BASEURL}/go-ipfs_${IPFS_VERSION}_linux-${DPKG_ARCH}.tar.gz" \ - && curl -SLo "$TMP/go-ipfs_${IPFS_VERSION}_linux-${DPKG_ARCH}.tar.gz.sha512" "${BASEURL}/go-ipfs_${IPFS_VERSION}_linux-${DPKG_ARCH}.tar.gz.sha512" \ - && cd $TMP && sha512sum -c "go-ipfs_${IPFS_VERSION}_linux-${DPKG_ARCH}.tar.gz.sha512" && tar -xf "go-ipfs_${IPFS_VERSION}_linux-${DPKG_ARCH}.tar.gz" \ - && cd go-ipfs && ./install.sh && cd && rm -rf $TMP \ - && apt-get -y autoremove --purge \ - && apt-get -y autoclean \ - && apt-get clean \ - && rm -rf /var/cache/apt/archives/*.deb /var/lib/apt/lists/* /root/.cache /tmp/* \ - && chmod +x /usr/local/bin/entrypoint.sh - -VOLUME ["/mnt/.ccache"] - -VOLUME ["/mnt/.zcash-params"] - -VOLUME ["/mnt/build"] - -ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] diff --git a/contrib/ci-horizen/dockerfiles/arm64/linux/ubuntu_xenial/entrypoint.sh b/contrib/ci-horizen/dockerfiles/arm64/linux/ubuntu_xenial/entrypoint.sh deleted file mode 100755 index 27db4f28eb..0000000000 --- a/contrib/ci-horizen/dockerfiles/arm64/linux/ubuntu_xenial/entrypoint.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash -set -e - -# Add local zenbuilder user -# Either use LOCAL_USER_ID:LOCAL_GRP_ID if set via environment -# or fallback to 9001:9001 - -USER_ID=${LOCAL_USER_ID:-9001} -GRP_ID=${LOCAL_GRP_ID:-9001} - -getent group zenbuilder > /dev/null 2>&1 || groupadd -g $GRP_ID zenbuilder -id -u zenbuilder > /dev/null 2>&1 || useradd --shell /bin/bash -u $USER_ID -g $GRP_ID -o -c "" -m zenbuilder - -LOCAL_UID=$(id -u zenbuilder) -LOCAL_GID=$(getent group zenbuilder | cut -d ":" -f 3) - -if [ ! "$USER_ID" == "$LOCAL_UID" ] || [ ! "$GRP_ID" == "$LOCAL_GID" ]; then - echo "Warning: User zenbuilder with differing UID $LOCAL_UID/GID $LOCAL_GID already exists, most likely this container was started before with a different UID/GID. Re-create it to change UID/GID." -fi - -echo "Starting with UID/GID: $LOCAL_UID:$LOCAL_GID" - -export HOME=/home/zenbuilder - -# Mount host directories -for dir in .ccache .zcash-params build; do - if [ -d "/mnt/${dir}" ]; then - if [ ! -L "/home/zenbuilder/${dir}" ]; then - ln -sf "/mnt/${dir}" "/home/zenbuilder/${dir}" - fi - else - mkdir -p "/home/zenbuilder/${dir}" - fi -done - -# Fix ownership recursively -chown -RH zenbuilder:zenbuilder /home/zenbuilder - -exec /usr/local/bin/gosu zenbuilder "$@" From 7af88f504668b9d28fb951f4cabfa9d53206bcf3 Mon Sep 17 00:00:00 2001 From: cronicc Date: Tue, 8 Jun 2021 14:00:57 +0000 Subject: [PATCH 16/33] Replace xenial with focal builder in travis --- .travis.yml | 48 +++++++++---------- ...l.sh => build_amd64_linux_ubuntu_focal.sh} | 0 2 files changed, 24 insertions(+), 24 deletions(-) rename contrib/ci-horizen/scripts/build/{build_amd64_linux_ubuntu_xenial.sh => build_amd64_linux_ubuntu_focal.sh} (100%) diff --git a/.travis.yml b/.travis.yml index 04be0ff74a..0f71616a25 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ os: linux env: - DOCKER_ARCH=amd64 - DOCKER_TARGET_OS=linux - - DOCKER_FROM=ubuntu_xenial + - DOCKER_FROM=ubuntu_focal - DOCKER_IS_DEB=true - &docker_amd64_linux_ubuntu_bionic env: @@ -21,43 +21,43 @@ os: linux - DOCKER_TARGET_OS=windows - DOCKER_FROM=ubuntu_bionic - DOCKER_IS_DEB=true - - &docker_amd64_linux_ubuntu_xenial_unit-tests + - &docker_amd64_linux_ubuntu_focal_unit-tests env: - DOCKER_ARCH=amd64 - DOCKER_TARGET_OS=linux - - DOCKER_FROM=ubuntu_xenial + - DOCKER_FROM=ubuntu_focal - DOCKER_IS_DEB=true - TEST_CMD="./qa/zcash/full_test_suite.py" - TEST_ARGS="btest gtest sec-hard no-dot-so util-test secp256k1 libsnark univalue" - - &docker_amd64_linux_ubuntu_xenial_rpc-tests_1 + - &docker_amd64_linux_ubuntu_focal_rpc-tests_1 env: - DOCKER_ARCH=amd64 - DOCKER_TARGET_OS=linux - - DOCKER_FROM=ubuntu_xenial + - DOCKER_FROM=ubuntu_focal - DOCKER_IS_DEB=true - TEST_CMD="./qa/zcash/full_test_suite.py" - TEST_ARGS="rpc --rpc-extended --rpc-split=3:1" - - &docker_amd64_linux_ubuntu_xenial_rpc-tests_2 + - &docker_amd64_linux_ubuntu_focal_rpc-tests_2 env: - DOCKER_ARCH=amd64 - DOCKER_TARGET_OS=linux - - DOCKER_FROM=ubuntu_xenial + - DOCKER_FROM=ubuntu_focal - DOCKER_IS_DEB=true - TEST_CMD="./qa/zcash/full_test_suite.py" - TEST_ARGS="rpc --rpc-extended --rpc-split=3:2" - - &docker_amd64_linux_ubuntu_xenial_rpc-tests_3 + - &docker_amd64_linux_ubuntu_focal_rpc-tests_3 env: - DOCKER_ARCH=amd64 - DOCKER_TARGET_OS=linux - - DOCKER_FROM=ubuntu_xenial + - DOCKER_FROM=ubuntu_focal - DOCKER_IS_DEB=true - TEST_CMD="./qa/zcash/full_test_suite.py" - TEST_ARGS="rpc --rpc-extended --rpc-split=3:3" - - &docker_amd64_linux_ubuntu_xenial_test-fetch-params + - &docker_amd64_linux_ubuntu_focal_test-fetch-params env: - DOCKER_ARCH=amd64 - DOCKER_TARGET_OS=linux - - DOCKER_FROM=ubuntu_xenial + - DOCKER_FROM=ubuntu_focal - DOCKER_IS_DEB=true - TEST_CMD="./qa/zen/test-fetch-params.sh" - &docker_amd64_linux_ubuntu_bionic_unit-tests @@ -161,10 +161,10 @@ jobs: # build and push docker build/test dependency images - stage: Prepare <<: *prepare_docker_amd64 - <<: *docker_amd64_linux_ubuntu_xenial + <<: *docker_amd64_linux_ubuntu_bionic - stage: Prepare <<: *prepare_docker_amd64 - <<: *docker_amd64_linux_ubuntu_bionic + <<: *docker_amd64_linux_ubuntu_focal - stage: Prepare <<: *prepare_docker_amd64 <<: *docker_amd64_windows_ubuntu_bionic @@ -180,10 +180,10 @@ jobs: # Docker based builds - stage: Build <<: *build_docker_amd64 - <<: *docker_amd64_linux_ubuntu_xenial + <<: *docker_amd64_linux_ubuntu_bionic - stage: Build <<: *build_docker_amd64 - <<: *docker_amd64_linux_ubuntu_bionic + <<: *docker_amd64_linux_ubuntu_focal - stage: Build <<: *build_docker_amd64 <<: *docker_amd64_windows_ubuntu_bionic @@ -202,31 +202,31 @@ jobs: # Docker based tests - stage: Test <<: *test_docker_amd64 - <<: *docker_amd64_linux_ubuntu_xenial_unit-tests + <<: *docker_amd64_linux_ubuntu_bionic_unit-tests - stage: Test <<: *test_docker_amd64 - <<: *docker_amd64_linux_ubuntu_xenial_rpc-tests_1 + <<: *docker_amd64_linux_ubuntu_bionic_rpc-tests_1 - stage: Test <<: *test_docker_amd64 - <<: *docker_amd64_linux_ubuntu_xenial_rpc-tests_2 + <<: *docker_amd64_linux_ubuntu_bionic_rpc-tests_2 - stage: Test <<: *test_docker_amd64 - <<: *docker_amd64_linux_ubuntu_xenial_rpc-tests_3 + <<: *docker_amd64_linux_ubuntu_bionic_rpc-tests_3 - stage: Test <<: *test_docker_amd64 - <<: *docker_amd64_linux_ubuntu_xenial_test-fetch-params + <<: *docker_amd64_linux_ubuntu_focal_unit-tests - stage: Test <<: *test_docker_amd64 - <<: *docker_amd64_linux_ubuntu_bionic_unit-tests + <<: *docker_amd64_linux_ubuntu_focal_rpc-tests_1 - stage: Test <<: *test_docker_amd64 - <<: *docker_amd64_linux_ubuntu_bionic_rpc-tests_1 + <<: *docker_amd64_linux_ubuntu_focal_rpc-tests_2 - stage: Test <<: *test_docker_amd64 - <<: *docker_amd64_linux_ubuntu_bionic_rpc-tests_2 + <<: *docker_amd64_linux_ubuntu_focal_rpc-tests_3 - stage: Test <<: *test_docker_amd64 - <<: *docker_amd64_linux_ubuntu_bionic_rpc-tests_3 + <<: *docker_amd64_linux_ubuntu_focal_test-fetch-params # osx based tests - stage: Test <<: *test_osx_xcode9_4 diff --git a/contrib/ci-horizen/scripts/build/build_amd64_linux_ubuntu_xenial.sh b/contrib/ci-horizen/scripts/build/build_amd64_linux_ubuntu_focal.sh similarity index 100% rename from contrib/ci-horizen/scripts/build/build_amd64_linux_ubuntu_xenial.sh rename to contrib/ci-horizen/scripts/build/build_amd64_linux_ubuntu_focal.sh From a2e1d39caef45f8dbb7e51fafd97c997c1f57d32 Mon Sep 17 00:00:00 2001 From: cronicc Date: Tue, 8 Jun 2021 14:24:13 +0000 Subject: [PATCH 17/33] Use focal host os and x-large vm size in travis linux build/test stages --- .travis.yml | 10 +++++++--- contrib/ci-horizen/scripts/common/install.sh | 10 +++++++++- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0f71616a25..6bf5ff612f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -113,14 +113,16 @@ os: linux .com.github.horizenofficial.zen.job-definitions: - &prepare_docker_amd64 os: linux - dist: bionic + dist: focal cache: false script: - bash "${TRAVIS_BUILD_DIR}/contrib/ci-horizen/scripts/prepare/docker_image_build.sh" - bash "${TRAVIS_BUILD_DIR}/contrib/ci-horizen/scripts/prepare/docker_image_deploy.sh" - &build_docker_amd64 os: linux - dist: bionic + dist: focal + vm: + size: x-large cache: directories: - "$HOME/.ccache" @@ -130,7 +132,9 @@ os: linux - &test_docker_amd64 if: env(SKIP_TESTS) != true os: linux - dist: bionic + dist: focal + vm: + size: x-large cache: directories: - "$HOME/.zcash-params" diff --git a/contrib/ci-horizen/scripts/common/install.sh b/contrib/ci-horizen/scripts/common/install.sh index 4e00584e5b..3f1643f1c6 100755 --- a/contrib/ci-horizen/scripts/common/install.sh +++ b/contrib/ci-horizen/scripts/common/install.sh @@ -4,8 +4,9 @@ set -euo pipefail if [ "${TRAVIS_OS_NAME}" = "linux" ]; then if [ ! -z "${DOCKER_UPDATE_PACKAGES}" ]; then + curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - sudo add-apt-repository "deb [arch=${TRAVIS_CPU_ARCH}] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" - UPDATE_PACKAGES="${UPDATE_PACKAGES} ${DOCKER_UPDATE_PACKAGES}" + UPDATE_PACKAGES="${UPDATE_PACKAGES}" fi if [ ! -z "${PIP_UPDATE_PACKAGES}" ] && [ ! -z "${PIP_INSTALL}" ]; then UPDATE_PACKAGES="${UPDATE_PACKAGES} ${PIP_UPDATE_PACKAGES}" @@ -13,6 +14,13 @@ if [ "${TRAVIS_OS_NAME}" = "linux" ]; then sudo apt-get update sudo apt-get -y --no-install-recommends install ${UPDATE_PACKAGES} if [ ! -z "${DOCKER_UPDATE_PACKAGES}" ]; then + sudo systemctl stop containerd.service + sudo systemctl stop docker.service + sudo systemctl stop docker.socket + sudo apt-get purge containerd docker.io runc + sudo apt-get autoremove --purge + sudo rm -f /etc/default/docker + sudo apt-get -y --no-install-recommends -o Dpkg::Options::="--force-confnew" install ${DOCKER_UPDATE_PACKAGES} ls /proc/sys/fs/binfmt_misc/ if [ "${TRAVIS_CPU_ARCH}" = "amd64" ]; then docker run --rm --privileged multiarch/qemu-user-static --reset -p yes From fe715739ebe749e3e70295ea3d512c46979526f0 Mon Sep 17 00:00:00 2001 From: cronicc Date: Tue, 8 Jun 2021 16:03:03 +0000 Subject: [PATCH 18/33] Add some buildsystem information to entrypoint.sh --- .../amd64/linux/ubuntu_bionic/entrypoint.sh | 10 ++++++++-- .../dockerfiles/amd64/linux/ubuntu_focal/entrypoint.sh | 10 ++++++++-- .../amd64/windows/ubuntu_bionic/entrypoint.sh | 10 ++++++++-- 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/contrib/ci-horizen/dockerfiles/amd64/linux/ubuntu_bionic/entrypoint.sh b/contrib/ci-horizen/dockerfiles/amd64/linux/ubuntu_bionic/entrypoint.sh index 27db4f28eb..47e87deade 100755 --- a/contrib/ci-horizen/dockerfiles/amd64/linux/ubuntu_bionic/entrypoint.sh +++ b/contrib/ci-horizen/dockerfiles/amd64/linux/ubuntu_bionic/entrypoint.sh @@ -18,10 +18,16 @@ if [ ! "$USER_ID" == "$LOCAL_UID" ] || [ ! "$GRP_ID" == "$LOCAL_GID" ]; then echo "Warning: User zenbuilder with differing UID $LOCAL_UID/GID $LOCAL_GID already exists, most likely this container was started before with a different UID/GID. Re-create it to change UID/GID." fi -echo "Starting with UID/GID: $LOCAL_UID:$LOCAL_GID" - export HOME=/home/zenbuilder +gcc -v +echo +lscpu +echo +free -h +echo +echo "Username: zenbuilder, HOME: $HOME, UID: $LOCAL_UID, GID: $LOCAL_GID" + # Mount host directories for dir in .ccache .zcash-params build; do if [ -d "/mnt/${dir}" ]; then diff --git a/contrib/ci-horizen/dockerfiles/amd64/linux/ubuntu_focal/entrypoint.sh b/contrib/ci-horizen/dockerfiles/amd64/linux/ubuntu_focal/entrypoint.sh index 27db4f28eb..47e87deade 100755 --- a/contrib/ci-horizen/dockerfiles/amd64/linux/ubuntu_focal/entrypoint.sh +++ b/contrib/ci-horizen/dockerfiles/amd64/linux/ubuntu_focal/entrypoint.sh @@ -18,10 +18,16 @@ if [ ! "$USER_ID" == "$LOCAL_UID" ] || [ ! "$GRP_ID" == "$LOCAL_GID" ]; then echo "Warning: User zenbuilder with differing UID $LOCAL_UID/GID $LOCAL_GID already exists, most likely this container was started before with a different UID/GID. Re-create it to change UID/GID." fi -echo "Starting with UID/GID: $LOCAL_UID:$LOCAL_GID" - export HOME=/home/zenbuilder +gcc -v +echo +lscpu +echo +free -h +echo +echo "Username: zenbuilder, HOME: $HOME, UID: $LOCAL_UID, GID: $LOCAL_GID" + # Mount host directories for dir in .ccache .zcash-params build; do if [ -d "/mnt/${dir}" ]; then diff --git a/contrib/ci-horizen/dockerfiles/amd64/windows/ubuntu_bionic/entrypoint.sh b/contrib/ci-horizen/dockerfiles/amd64/windows/ubuntu_bionic/entrypoint.sh index 27db4f28eb..47e87deade 100755 --- a/contrib/ci-horizen/dockerfiles/amd64/windows/ubuntu_bionic/entrypoint.sh +++ b/contrib/ci-horizen/dockerfiles/amd64/windows/ubuntu_bionic/entrypoint.sh @@ -18,10 +18,16 @@ if [ ! "$USER_ID" == "$LOCAL_UID" ] || [ ! "$GRP_ID" == "$LOCAL_GID" ]; then echo "Warning: User zenbuilder with differing UID $LOCAL_UID/GID $LOCAL_GID already exists, most likely this container was started before with a different UID/GID. Re-create it to change UID/GID." fi -echo "Starting with UID/GID: $LOCAL_UID:$LOCAL_GID" - export HOME=/home/zenbuilder +gcc -v +echo +lscpu +echo +free -h +echo +echo "Username: zenbuilder, HOME: $HOME, UID: $LOCAL_UID, GID: $LOCAL_GID" + # Mount host directories for dir in .ccache .zcash-params build; do if [ -d "/mnt/${dir}" ]; then From b6bd1f854cf5012b3d08802719f778ca78a50f05 Mon Sep 17 00:00:00 2001 From: cronicc Date: Tue, 8 Jun 2021 18:39:47 +0000 Subject: [PATCH 19/33] More Test stage parallelization --- .travis.yml | 117 +++++++++++------- .../amd64/linux/ubuntu_bionic/Dockerfile | 2 +- .../amd64/linux/ubuntu_focal/Dockerfile | 2 +- .../amd64/windows/ubuntu_bionic/Dockerfile | 2 +- .../build/build_amd64_linux_ubuntu_bionic.sh | 2 +- .../build/build_amd64_linux_ubuntu_focal.sh | 2 +- .../build_amd64_windows_ubuntu_bionic.sh | 2 +- contrib/ci-horizen/scripts/test/run_test.sh | 2 +- 8 files changed, 82 insertions(+), 49 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6bf5ff612f..b453db0337 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,12 +3,6 @@ language: shell os: linux .com.github.horizenofficial.zen.env-definitions: - - &docker_amd64_linux_ubuntu_xenial - env: - - DOCKER_ARCH=amd64 - - DOCKER_TARGET_OS=linux - - DOCKER_FROM=ubuntu_focal - - DOCKER_IS_DEB=true - &docker_amd64_linux_ubuntu_bionic env: - DOCKER_ARCH=amd64 @@ -21,77 +15,99 @@ os: linux - DOCKER_TARGET_OS=windows - DOCKER_FROM=ubuntu_bionic - DOCKER_IS_DEB=true - - &docker_amd64_linux_ubuntu_focal_unit-tests + - &docker_amd64_linux_ubuntu_focal env: - DOCKER_ARCH=amd64 - DOCKER_TARGET_OS=linux - DOCKER_FROM=ubuntu_focal - DOCKER_IS_DEB=true + - &docker_amd64_linux_ubuntu_bionic_unit-tests + env: + - DOCKER_ARCH=amd64 + - DOCKER_TARGET_OS=linux + - DOCKER_FROM=ubuntu_bionic + - DOCKER_IS_DEB=true - TEST_CMD="./qa/zcash/full_test_suite.py" - TEST_ARGS="btest gtest sec-hard no-dot-so util-test secp256k1 libsnark univalue" - - &docker_amd64_linux_ubuntu_focal_rpc-tests_1 + - &docker_amd64_linux_ubuntu_bionic_rpc-tests_1 env: - DOCKER_ARCH=amd64 - DOCKER_TARGET_OS=linux - - DOCKER_FROM=ubuntu_focal + - DOCKER_FROM=ubuntu_bionic - DOCKER_IS_DEB=true - TEST_CMD="./qa/zcash/full_test_suite.py" - - TEST_ARGS="rpc --rpc-extended --rpc-split=3:1" - - &docker_amd64_linux_ubuntu_focal_rpc-tests_2 + - TEST_ARGS="rpc --rpc-extended --rpc-split=4:1" + - &docker_amd64_linux_ubuntu_bionic_rpc-tests_2 env: - DOCKER_ARCH=amd64 - DOCKER_TARGET_OS=linux - - DOCKER_FROM=ubuntu_focal + - DOCKER_FROM=ubuntu_bionic - DOCKER_IS_DEB=true - TEST_CMD="./qa/zcash/full_test_suite.py" - - TEST_ARGS="rpc --rpc-extended --rpc-split=3:2" - - &docker_amd64_linux_ubuntu_focal_rpc-tests_3 + - TEST_ARGS="rpc --rpc-extended --rpc-split=4:2" + - &docker_amd64_linux_ubuntu_bionic_rpc-tests_3 env: - DOCKER_ARCH=amd64 - DOCKER_TARGET_OS=linux - - DOCKER_FROM=ubuntu_focal + - DOCKER_FROM=ubuntu_bionic - DOCKER_IS_DEB=true - TEST_CMD="./qa/zcash/full_test_suite.py" - - TEST_ARGS="rpc --rpc-extended --rpc-split=3:3" - - &docker_amd64_linux_ubuntu_focal_test-fetch-params + - TEST_ARGS="rpc --rpc-extended --rpc-split=4:3" + - &docker_amd64_linux_ubuntu_bionic_rpc-tests_4 env: - DOCKER_ARCH=amd64 - DOCKER_TARGET_OS=linux - - DOCKER_FROM=ubuntu_focal + - DOCKER_FROM=ubuntu_bionic - DOCKER_IS_DEB=true - - TEST_CMD="./qa/zen/test-fetch-params.sh" - - &docker_amd64_linux_ubuntu_bionic_unit-tests + - TEST_CMD="./qa/zcash/full_test_suite.py" + - TEST_ARGS="rpc --rpc-extended --rpc-split=4:4" + - &docker_amd64_linux_ubuntu_bionic_test-fetch-params env: - DOCKER_ARCH=amd64 - DOCKER_TARGET_OS=linux - DOCKER_FROM=ubuntu_bionic - DOCKER_IS_DEB=true + - TEST_CMD="./qa/zen/test-fetch-params.sh" + - &docker_amd64_linux_ubuntu_focal_unit-tests + env: + - DOCKER_ARCH=amd64 + - DOCKER_TARGET_OS=linux + - DOCKER_FROM=ubuntu_focal + - DOCKER_IS_DEB=true - TEST_CMD="./qa/zcash/full_test_suite.py" - TEST_ARGS="btest gtest sec-hard no-dot-so util-test secp256k1 libsnark univalue" - - &docker_amd64_linux_ubuntu_bionic_rpc-tests_1 + - &docker_amd64_linux_ubuntu_focal_rpc-tests_1 env: - DOCKER_ARCH=amd64 - DOCKER_TARGET_OS=linux - - DOCKER_FROM=ubuntu_bionic + - DOCKER_FROM=ubuntu_focal - DOCKER_IS_DEB=true - TEST_CMD="./qa/zcash/full_test_suite.py" - - TEST_ARGS="rpc --rpc-extended --rpc-split=3:1" - - &docker_amd64_linux_ubuntu_bionic_rpc-tests_2 + - TEST_ARGS="rpc --rpc-extended --rpc-split=4:1" + - &docker_amd64_linux_ubuntu_focal_rpc-tests_2 env: - DOCKER_ARCH=amd64 - DOCKER_TARGET_OS=linux - - DOCKER_FROM=ubuntu_bionic + - DOCKER_FROM=ubuntu_focal - DOCKER_IS_DEB=true - TEST_CMD="./qa/zcash/full_test_suite.py" - - TEST_ARGS="rpc --rpc-extended --rpc-split=3:2" - - &docker_amd64_linux_ubuntu_bionic_rpc-tests_3 + - TEST_ARGS="rpc --rpc-extended --rpc-split=4:2" + - &docker_amd64_linux_ubuntu_focal_rpc-tests_3 env: - DOCKER_ARCH=amd64 - DOCKER_TARGET_OS=linux - - DOCKER_FROM=ubuntu_bionic + - DOCKER_FROM=ubuntu_focal - DOCKER_IS_DEB=true - TEST_CMD="./qa/zcash/full_test_suite.py" - - TEST_ARGS="rpc --rpc-extended --rpc-split=3:3" + - TEST_ARGS="rpc --rpc-extended --rpc-split=4:3" + - &docker_amd64_linux_ubuntu_focal_rpc-tests_4 + env: + - DOCKER_ARCH=amd64 + - DOCKER_TARGET_OS=linux + - DOCKER_FROM=ubuntu_focal + - DOCKER_IS_DEB=true + - TEST_CMD="./qa/zcash/full_test_suite.py" + - TEST_ARGS="rpc --rpc-extended --rpc-split=4:4" - &amd64_osx_xcode9_4_unit-tests env: - TEST_CMD="./qa/zcash/full_test_suite.py" @@ -118,7 +134,7 @@ os: linux script: - bash "${TRAVIS_BUILD_DIR}/contrib/ci-horizen/scripts/prepare/docker_image_build.sh" - bash "${TRAVIS_BUILD_DIR}/contrib/ci-horizen/scripts/prepare/docker_image_deploy.sh" - - &build_docker_amd64 + - &build_docker_amd64_x-large os: linux dist: focal vm: @@ -130,6 +146,17 @@ os: linux - bash -c "${TRAVIS_BUILD_DIR}/contrib/ci-horizen/scripts/build/build_${TRAVIS_CPU_ARCH}_${DOCKER_TARGET_OS}_${DOCKER_FROM}.sh" - bash -c "${TRAVIS_BUILD_DIR}/contrib/ci-horizen/scripts/common/push_archive.sh ${B2_UL_COMPRESS_FOLDER} ${B2_UL_FILENAME}" - &test_docker_amd64 + if: env(SKIP_TESTS) != true + os: linux + dist: focal + cache: + directories: + - "$HOME/.zcash-params" + script: + - bash -c "RENAME_FOLDER='true' RENAME_SUFFIX='_clean' ${TRAVIS_BUILD_DIR}/contrib/ci-horizen/scripts/common/get_archive.sh ${B2_DL_DECOMPRESS_FOLDER} ${B2_DL_FILENAME}" + - bash -c "${TRAVIS_BUILD_DIR}/contrib/ci-horizen/scripts/common/travis_stay_alive.sh" + - bash -c '${TRAVIS_BUILD_DIR}/contrib/ci-horizen/scripts/test/run_test.sh "${TEST_CMD}" "${TEST_ARGS}"' + - &test_docker_amd64_x-large if: env(SKIP_TESTS) != true os: linux dist: focal @@ -183,13 +210,13 @@ jobs: - bash -c "${TRAVIS_BUILD_DIR}/contrib/ci-horizen/scripts/common/push_archive.sh ${B2_UL_COMPRESS_FOLDER} ${B2_UL_FILENAME}" # Docker based builds - stage: Build - <<: *build_docker_amd64 + <<: *build_docker_amd64_x-large <<: *docker_amd64_linux_ubuntu_bionic - stage: Build - <<: *build_docker_amd64 + <<: *build_docker_amd64_x-large <<: *docker_amd64_linux_ubuntu_focal - stage: Build - <<: *build_docker_amd64 + <<: *build_docker_amd64_x-large <<: *docker_amd64_windows_ubuntu_bionic # osx build - stage: Build @@ -205,32 +232,38 @@ jobs: - bash -c "${TRAVIS_BUILD_DIR}/contrib/ci-horizen/scripts/common/push_archive.sh ${B2_UL_COMPRESS_FOLDER} ${B2_UL_FILENAME}" # Docker based tests - stage: Test - <<: *test_docker_amd64 + <<: *test_docker_amd64_x-large <<: *docker_amd64_linux_ubuntu_bionic_unit-tests - stage: Test - <<: *test_docker_amd64 + <<: *test_docker_amd64_x-large <<: *docker_amd64_linux_ubuntu_bionic_rpc-tests_1 - stage: Test - <<: *test_docker_amd64 + <<: *test_docker_amd64_x-large <<: *docker_amd64_linux_ubuntu_bionic_rpc-tests_2 - stage: Test - <<: *test_docker_amd64 + <<: *test_docker_amd64_x-large <<: *docker_amd64_linux_ubuntu_bionic_rpc-tests_3 + - stage: Test + <<: *test_docker_amd64_x-large + <<: *docker_amd64_linux_ubuntu_bionic_rpc-tests_4 - stage: Test <<: *test_docker_amd64 + <<: *docker_amd64_linux_ubuntu_bionic_test-fetch-params + - stage: Test + <<: *test_docker_amd64_x-large <<: *docker_amd64_linux_ubuntu_focal_unit-tests - stage: Test - <<: *test_docker_amd64 + <<: *test_docker_amd64_x-large <<: *docker_amd64_linux_ubuntu_focal_rpc-tests_1 - stage: Test - <<: *test_docker_amd64 + <<: *test_docker_amd64_x-large <<: *docker_amd64_linux_ubuntu_focal_rpc-tests_2 - stage: Test - <<: *test_docker_amd64 + <<: *test_docker_amd64_x-large <<: *docker_amd64_linux_ubuntu_focal_rpc-tests_3 - stage: Test - <<: *test_docker_amd64 - <<: *docker_amd64_linux_ubuntu_focal_test-fetch-params + <<: *test_docker_amd64_x-large + <<: *docker_amd64_linux_ubuntu_focal_rpc-tests_4 # osx based tests - stage: Test <<: *test_osx_xcode9_4 diff --git a/contrib/ci-horizen/dockerfiles/amd64/linux/ubuntu_bionic/Dockerfile b/contrib/ci-horizen/dockerfiles/amd64/linux/ubuntu_bionic/Dockerfile index 864536ee89..9c927ab0eb 100644 --- a/contrib/ci-horizen/dockerfiles/amd64/linux/ubuntu_bionic/Dockerfile +++ b/contrib/ci-horizen/dockerfiles/amd64/linux/ubuntu_bionic/Dockerfile @@ -14,7 +14,7 @@ RUN set -euxo pipefail \ && apt-get -y --no-install-recommends install aria2 autoconf automake bsdmainutils build-essential \ ca-certificates cmake curl dirmngr fakeroot git g++-multilib gnupg2 help2man libc6-dev libgomp1 \ libtool lintian m4 ncurses-dev pigz pkg-config pv python-dev python-pip python-setuptools \ - python-wheel python-wheel-common python-zmq unzip wget zlib1g-dev \ + python-wheel python-wheel-common python-zmq time unzip wget zlib1g-dev \ && pip install b2==1.4.2 pyblake2 websocket-client2 \ && BASEURL="https://github.com/tianon/gosu/releases/download/" \ && GOSU_VERSION="1.13" \ diff --git a/contrib/ci-horizen/dockerfiles/amd64/linux/ubuntu_focal/Dockerfile b/contrib/ci-horizen/dockerfiles/amd64/linux/ubuntu_focal/Dockerfile index 1b6cf5c7e4..c4a58dd593 100644 --- a/contrib/ci-horizen/dockerfiles/amd64/linux/ubuntu_focal/Dockerfile +++ b/contrib/ci-horizen/dockerfiles/amd64/linux/ubuntu_focal/Dockerfile @@ -13,7 +13,7 @@ RUN set -euxo pipefail \ && apt-get -y --no-install-recommends dist-upgrade \ && apt-get -y --no-install-recommends install aria2 autoconf automake bsdmainutils build-essential \ ca-certificates cmake curl dirmngr fakeroot git g++-multilib gnupg2 help2man libc6-dev libgomp1 \ - libtool lintian m4 ncurses-dev pigz pkg-config pv python2-dev python-setuptools unzip wget zlib1g-dev \ + libtool lintian m4 ncurses-dev pigz pkg-config pv python2-dev python-setuptools time unzip wget zlib1g-dev \ && curl -s https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2 \ && pip2 install b2==1.4.2 pyblake2 pyzmq websocket-client2 \ && BASEURL="https://github.com/tianon/gosu/releases/download/" \ diff --git a/contrib/ci-horizen/dockerfiles/amd64/windows/ubuntu_bionic/Dockerfile b/contrib/ci-horizen/dockerfiles/amd64/windows/ubuntu_bionic/Dockerfile index 380e591983..39d864bc03 100644 --- a/contrib/ci-horizen/dockerfiles/amd64/windows/ubuntu_bionic/Dockerfile +++ b/contrib/ci-horizen/dockerfiles/amd64/windows/ubuntu_bionic/Dockerfile @@ -14,7 +14,7 @@ RUN set -euxo pipefail \ && apt-get -y --no-install-recommends install aria2 autoconf automake bsdmainutils build-essential \ ca-certificates cmake curl dirmngr git g++-multilib gnupg2 help2man libc6-dev libgomp1 libtool \ m4 mingw-w64 ncurses-dev pigz pkg-config pv python-minimal python-pip python-setuptools python-wheel \ - python-wheel-common unzip wget zlib1g-dev \ + python-wheel-common time unzip wget zlib1g-dev \ && pip install b2==1.4.2 \ && BASEURL="https://github.com/tianon/gosu/releases/download/" \ && GOSU_VERSION="1.13" \ diff --git a/contrib/ci-horizen/scripts/build/build_amd64_linux_ubuntu_bionic.sh b/contrib/ci-horizen/scripts/build/build_amd64_linux_ubuntu_bionic.sh index f55ec5ae70..370d893f2c 100755 --- a/contrib/ci-horizen/scripts/build/build_amd64_linux_ubuntu_bionic.sh +++ b/contrib/ci-horizen/scripts/build/build_amd64_linux_ubuntu_bionic.sh @@ -5,4 +5,4 @@ set -euo pipefail docker run --rm -v "${TRAVIS_BUILD_DIR}:/mnt/build" -v "$HOME/.ccache:/mnt/.ccache" -e LOCAL_USER_ID="$(id -u)" \ -e LOCAL_GRP_ID="$(id -g)" --env-file <(env | grep 'DOCKER_') "${IMAGE_NAME}:${IMAGE_TAG}" \ bash -c 'set -xeuo pipefail && export HOST="$(gcc -dumpmachine)" && export MAKEFLAGS="-j $(($(nproc)+1))" \ - && cd "${DOCKER_HOME}" && time ./zcutil/build.sh $MAKEFLAGS' + && cd "${DOCKER_HOME}" && /usr/bin/time -v ./zcutil/build.sh $MAKEFLAGS' diff --git a/contrib/ci-horizen/scripts/build/build_amd64_linux_ubuntu_focal.sh b/contrib/ci-horizen/scripts/build/build_amd64_linux_ubuntu_focal.sh index f55ec5ae70..370d893f2c 100755 --- a/contrib/ci-horizen/scripts/build/build_amd64_linux_ubuntu_focal.sh +++ b/contrib/ci-horizen/scripts/build/build_amd64_linux_ubuntu_focal.sh @@ -5,4 +5,4 @@ set -euo pipefail docker run --rm -v "${TRAVIS_BUILD_DIR}:/mnt/build" -v "$HOME/.ccache:/mnt/.ccache" -e LOCAL_USER_ID="$(id -u)" \ -e LOCAL_GRP_ID="$(id -g)" --env-file <(env | grep 'DOCKER_') "${IMAGE_NAME}:${IMAGE_TAG}" \ bash -c 'set -xeuo pipefail && export HOST="$(gcc -dumpmachine)" && export MAKEFLAGS="-j $(($(nproc)+1))" \ - && cd "${DOCKER_HOME}" && time ./zcutil/build.sh $MAKEFLAGS' + && cd "${DOCKER_HOME}" && /usr/bin/time -v ./zcutil/build.sh $MAKEFLAGS' diff --git a/contrib/ci-horizen/scripts/build/build_amd64_windows_ubuntu_bionic.sh b/contrib/ci-horizen/scripts/build/build_amd64_windows_ubuntu_bionic.sh index d7bff2dc99..cea5b9a067 100755 --- a/contrib/ci-horizen/scripts/build/build_amd64_windows_ubuntu_bionic.sh +++ b/contrib/ci-horizen/scripts/build/build_amd64_windows_ubuntu_bionic.sh @@ -5,4 +5,4 @@ set -euo pipefail docker run --rm -v "${TRAVIS_BUILD_DIR}:/mnt/build" -v "$HOME/.ccache:/mnt/.ccache" -e LOCAL_USER_ID="$(id -u)" \ -e LOCAL_GRP_ID="$(id -g)" --env-file <(env | grep 'DOCKER_') "${IMAGE_NAME}:${IMAGE_TAG}" \ bash -c 'set -xeuo pipefail && export HOST=x86_64-w64-mingw32 && export MAKEFLAGS="-j $(($(nproc)+1))" \ - && cd "${DOCKER_HOME}" && time ./zcutil/build.sh $MAKEFLAGS' + && cd "${DOCKER_HOME}" && /usr/bin/time -v ./zcutil/build.sh $MAKEFLAGS' diff --git a/contrib/ci-horizen/scripts/test/run_test.sh b/contrib/ci-horizen/scripts/test/run_test.sh index 0f0bdc2ade..0ed6e5bc38 100755 --- a/contrib/ci-horizen/scripts/test/run_test.sh +++ b/contrib/ci-horizen/scripts/test/run_test.sh @@ -17,5 +17,5 @@ else -e LOCAL_USER_ID="$(id -u)" -e LOCAL_GRP_ID="$(id -g)" -e CMD -e ARGS \ --env-file <(env | grep 'DOCKER_\|B2_\|TEST_\|TRAVIS_') --network=dockerbridge "${IMAGE_NAME}:${IMAGE_TAG}" \ bash -c 'set -xeuo pipefail && export HOST=$(gcc -dumpmachine) \ - && export MAKEFLAGS="-j $(($(nproc)+1))" && cd "${DOCKER_HOME}" && ./zcutil/fetch-params.sh && time "${CMD}" ${ARGS}' + && export MAKEFLAGS="-j $(($(nproc)+1))" && cd "${DOCKER_HOME}" && ./zcutil/fetch-params.sh && /usr/bin/time -v "${CMD}" ${ARGS}' fi From 17573f2cd1ef11ef9a72a833a2048176b898c397 Mon Sep 17 00:00:00 2001 From: cronicc Date: Tue, 6 Jul 2021 11:33:05 +0000 Subject: [PATCH 20/33] Add more fallback gpg2 servers for key fetch to Dockerfiles --- .../dockerfiles/amd64/linux/ubuntu_bionic/Dockerfile | 4 +++- .../dockerfiles/amd64/linux/ubuntu_focal/Dockerfile | 4 +++- .../dockerfiles/amd64/windows/ubuntu_bionic/Dockerfile | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/contrib/ci-horizen/dockerfiles/amd64/linux/ubuntu_bionic/Dockerfile b/contrib/ci-horizen/dockerfiles/amd64/linux/ubuntu_bionic/Dockerfile index 9c927ab0eb..d8d28317c6 100644 --- a/contrib/ci-horizen/dockerfiles/amd64/linux/ubuntu_bionic/Dockerfile +++ b/contrib/ci-horizen/dockerfiles/amd64/linux/ubuntu_bionic/Dockerfile @@ -22,7 +22,9 @@ RUN set -euxo pipefail \ && curl -o /usr/local/bin/gosu -SL "${BASEURL}/${GOSU_VERSION}/gosu-${DPKG_ARCH}" \ && curl -o /usr/local/bin/gosu.asc -SL "${BASEURL}/${GOSU_VERSION}/gosu-${DPKG_ARCH}.asc" \ && export GNUPGHOME="$(mktemp -d)" \ - && ( gpg2 --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 || \ + && ( gpg2 --batch --keyserver hkps://keys.openpgp.org --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 || \ + gpg2 --batch --keyserver hkps://keyserver.ubuntu.com:443 --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 || \ + gpg2 --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 || \ gpg2 --batch --keyserver hkp://ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 || \ gpg2 --batch --keyserver pgp.mit.edu --recv-key B42F6819007F00F88E364FD4036A9C25BF357DD4 || \ gpg2 --batch --keyserver keyserver.pgp.com --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 || \ diff --git a/contrib/ci-horizen/dockerfiles/amd64/linux/ubuntu_focal/Dockerfile b/contrib/ci-horizen/dockerfiles/amd64/linux/ubuntu_focal/Dockerfile index c4a58dd593..0a71ac7c40 100644 --- a/contrib/ci-horizen/dockerfiles/amd64/linux/ubuntu_focal/Dockerfile +++ b/contrib/ci-horizen/dockerfiles/amd64/linux/ubuntu_focal/Dockerfile @@ -22,7 +22,9 @@ RUN set -euxo pipefail \ && curl -o /usr/local/bin/gosu -SL "${BASEURL}/${GOSU_VERSION}/gosu-${DPKG_ARCH}" \ && curl -o /usr/local/bin/gosu.asc -SL "${BASEURL}/${GOSU_VERSION}/gosu-${DPKG_ARCH}.asc" \ && export GNUPGHOME="$(mktemp -d)" \ - && ( gpg2 --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 || \ + && ( gpg2 --batch --keyserver hkps://keys.openpgp.org --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 || \ + gpg2 --batch --keyserver hkps://keyserver.ubuntu.com:443 --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 || \ + gpg2 --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 || \ gpg2 --batch --keyserver hkp://ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 || \ gpg2 --batch --keyserver pgp.mit.edu --recv-key B42F6819007F00F88E364FD4036A9C25BF357DD4 || \ gpg2 --batch --keyserver keyserver.pgp.com --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 || \ diff --git a/contrib/ci-horizen/dockerfiles/amd64/windows/ubuntu_bionic/Dockerfile b/contrib/ci-horizen/dockerfiles/amd64/windows/ubuntu_bionic/Dockerfile index 39d864bc03..22206b3b35 100644 --- a/contrib/ci-horizen/dockerfiles/amd64/windows/ubuntu_bionic/Dockerfile +++ b/contrib/ci-horizen/dockerfiles/amd64/windows/ubuntu_bionic/Dockerfile @@ -22,7 +22,9 @@ RUN set -euxo pipefail \ && curl -o /usr/local/bin/gosu -SL "${BASEURL}/${GOSU_VERSION}/gosu-${DPKG_ARCH}" \ && curl -o /usr/local/bin/gosu.asc -SL "${BASEURL}/${GOSU_VERSION}/gosu-${DPKG_ARCH}.asc" \ && export GNUPGHOME="$(mktemp -d)" \ - && ( gpg2 --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 || \ + && ( gpg2 --batch --keyserver hkps://keys.openpgp.org --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 || \ + gpg2 --batch --keyserver hkps://keyserver.ubuntu.com:443 --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 || \ + gpg2 --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 || \ gpg2 --batch --keyserver hkp://ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 || \ gpg2 --batch --keyserver pgp.mit.edu --recv-key B42F6819007F00F88E364FD4036A9C25BF357DD4 || \ gpg2 --batch --keyserver keyserver.pgp.com --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 || \ From 21a532166a0607769586a2df9a1ff6d74fbddf24 Mon Sep 17 00:00:00 2001 From: cronicc Date: Tue, 6 Jul 2021 12:35:25 +0000 Subject: [PATCH 21/33] Always login to hub.docker.com with read only account, even when only pulling --- contrib/ci-horizen/scripts/common/install.sh | 8 +++----- contrib/ci-horizen/scripts/common/setup_environment.sh | 8 ++++++++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/contrib/ci-horizen/scripts/common/install.sh b/contrib/ci-horizen/scripts/common/install.sh index 3f1643f1c6..8aefa0892d 100755 --- a/contrib/ci-horizen/scripts/common/install.sh +++ b/contrib/ci-horizen/scripts/common/install.sh @@ -3,17 +3,15 @@ set -euo pipefail if [ "${TRAVIS_OS_NAME}" = "linux" ]; then - if [ ! -z "${DOCKER_UPDATE_PACKAGES}" ]; then - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - - sudo add-apt-repository "deb [arch=${TRAVIS_CPU_ARCH}] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" - UPDATE_PACKAGES="${UPDATE_PACKAGES}" - fi if [ ! -z "${PIP_UPDATE_PACKAGES}" ] && [ ! -z "${PIP_INSTALL}" ]; then UPDATE_PACKAGES="${UPDATE_PACKAGES} ${PIP_UPDATE_PACKAGES}" fi sudo apt-get update sudo apt-get -y --no-install-recommends install ${UPDATE_PACKAGES} if [ ! -z "${DOCKER_UPDATE_PACKAGES}" ]; then + curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - + sudo add-apt-repository "deb [arch=${TRAVIS_CPU_ARCH}] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" + sudo apt-get update sudo systemctl stop containerd.service sudo systemctl stop docker.service sudo systemctl stop docker.socket diff --git a/contrib/ci-horizen/scripts/common/setup_environment.sh b/contrib/ci-horizen/scripts/common/setup_environment.sh index a9d4277511..50decde011 100755 --- a/contrib/ci-horizen/scripts/common/setup_environment.sh +++ b/contrib/ci-horizen/scripts/common/setup_environment.sh @@ -55,6 +55,8 @@ if [ "${TRAVIS_OS_NAME}" = "linux" ]; then NEED_GH_CREDS="true" NEED_PGP_SIGN_CREDS="true" fi + # due to new ratelimiting on hub.docker.com always login, we use a service account that has no push permissions + echo "$DOCKER_READONLY_PASSWORD" | docker login -u "$DOCKER_READONLY_USERNAME" --password-stdin fi if [ "${TRAVIS_OS_NAME}" = "osx" ]; then @@ -139,4 +141,10 @@ if [ "${NEED_PGP_SIGN_CREDS}" = "false" ]; then unset PGP_KEY_PASSWORD fi +# clear credentials after use +export DOCKER_READONLY_USERNAME="" +export DOCKER_READONLY_PASSWORD="" +unset DOCKER_READONLY_USERNAME +unset DOCKER_READONLY_PASSWORD + set +u From 4fd1efd72ca9bf903a37f22ac1362f6403c72e2f Mon Sep 17 00:00:00 2001 From: cronicc Date: Wed, 29 Sep 2021 10:41:37 +0000 Subject: [PATCH 22/33] Change interpreter to python2 --- src/test/bitcoin-util-test.py | 2 +- src/test/buildenv.py.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/bitcoin-util-test.py b/src/test/bitcoin-util-test.py index 20afb16a9e..9323614011 100755 --- a/src/test/bitcoin-util-test.py +++ b/src/test/bitcoin-util-test.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python2 # Copyright 2014 BitPay, Inc. # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. diff --git a/src/test/buildenv.py.in b/src/test/buildenv.py.in index 1618bdeb76..60fe5c2802 100644 --- a/src/test/buildenv.py.in +++ b/src/test/buildenv.py.in @@ -1,2 +1,2 @@ -#!/usr/bin/python +#!/usr/bin/env python2 exeext="@EXEEXT@" From 42648e80ad4803e92165b0acef09295a74f91260 Mon Sep 17 00:00:00 2001 From: cronicc Date: Thu, 30 Sep 2021 09:23:16 +0000 Subject: [PATCH 23/33] Update python interpreter workaround for MacOS tests --- contrib/ci-horizen/scripts/test/run_test.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/ci-horizen/scripts/test/run_test.sh b/contrib/ci-horizen/scripts/test/run_test.sh index 0ed6e5bc38..ecc95125f5 100755 --- a/contrib/ci-horizen/scripts/test/run_test.sh +++ b/contrib/ci-horizen/scripts/test/run_test.sh @@ -8,7 +8,7 @@ export ARGS="$2" if [ "${TRAVIS_OS_NAME}" = "osx" ]; then # workaround until https://github.com/zcash/zcash/pull/3538 is pulled in from upstream # or the work porting the test suite to python3 is pulled in - find "${TRAVIS_BUILD_DIR}/qa" -type f -name *.py | LC_ALL=C xargs sed -i '' 's/env python2/env python/' + find "${TRAVIS_BUILD_DIR}/qa" "${TRAVIS_BUILD_DIR}/src/test" -type f -name *.py | LC_ALL=C xargs sed -i '' 's/env python2/env python/' bash -c 'set -xeuo pipefail && export HOST=$(gcc -dumpmachine) && export MAKEFLAGS="-j $(($(nproc)+1))" \ && cd "${TRAVIS_BUILD_DIR}" && ./zcutil/fetch-params.sh && time "${CMD}" ${ARGS}' else @@ -17,5 +17,5 @@ else -e LOCAL_USER_ID="$(id -u)" -e LOCAL_GRP_ID="$(id -g)" -e CMD -e ARGS \ --env-file <(env | grep 'DOCKER_\|B2_\|TEST_\|TRAVIS_') --network=dockerbridge "${IMAGE_NAME}:${IMAGE_TAG}" \ bash -c 'set -xeuo pipefail && export HOST=$(gcc -dumpmachine) \ - && export MAKEFLAGS="-j $(($(nproc)+1))" && cd "${DOCKER_HOME}" && ./zcutil/fetch-params.sh && /usr/bin/time -v "${CMD}" ${ARGS}' + && export MAKEFLAGS="-j $(($(nproc)+1))" && cd "${DOCKER_HOME}" && ./zcutil/fetch-params.sh && time "${CMD}" ${ARGS}' fi From 6f267f7c24dfdf80839ab965c43e3542b6fcd89c Mon Sep 17 00:00:00 2001 From: cronicc Date: Mon, 4 Oct 2021 10:15:59 +0000 Subject: [PATCH 24/33] Set version 2.0.24 --- configure.ac | 2 +- src/clientversion.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index b39a269677..348e8cd112 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N) AC_PREREQ([2.60]) define(_CLIENT_VERSION_MAJOR, 2) define(_CLIENT_VERSION_MINOR, 0) -define(_CLIENT_VERSION_REVISION, 23) +define(_CLIENT_VERSION_REVISION, 24) define(_CLIENT_VERSION_BUILD, 50) define(_ZC_BUILD_VAL, m4_if(m4_eval(_CLIENT_VERSION_BUILD < 25), 1, m4_incr(_CLIENT_VERSION_BUILD), m4_eval(_CLIENT_VERSION_BUILD < 50), 1, m4_eval(_CLIENT_VERSION_BUILD - 24), m4_eval(_CLIENT_VERSION_BUILD == 50), 1, , m4_eval(_CLIENT_VERSION_BUILD - 50))) define(_CLIENT_VERSION_SUFFIX, m4_if(m4_eval(_CLIENT_VERSION_BUILD < 25), 1, _CLIENT_VERSION_REVISION-beta$1, m4_eval(_CLIENT_VERSION_BUILD < 50), 1, _CLIENT_VERSION_REVISION-rc$1, m4_eval(_CLIENT_VERSION_BUILD == 50), 1, _CLIENT_VERSION_REVISION, _CLIENT_VERSION_REVISION-$1))) diff --git a/src/clientversion.h b/src/clientversion.h index e8b6102ca3..29dbff9ac2 100644 --- a/src/clientversion.h +++ b/src/clientversion.h @@ -34,7 +34,7 @@ //! These need to be macros, as clientversion.cpp's and bitcoin*-res.rc's voodoo requires it #define CLIENT_VERSION_MAJOR 2 #define CLIENT_VERSION_MINOR 0 -#define CLIENT_VERSION_REVISION 23 +#define CLIENT_VERSION_REVISION 24 #define CLIENT_VERSION_BUILD 50 //! Set to true for release, false for prerelease or test build From 32be6389670c49d1f32b070f3842ada875ad65b9 Mon Sep 17 00:00:00 2001 From: cronicc Date: Mon, 4 Oct 2021 10:27:10 +0000 Subject: [PATCH 25/33] Add checkpoint blocks --- src/chainparams.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 4546dd9477..a3acec6c77 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -151,11 +151,12 @@ class CMainParams : public CChainParams { ( 671000, uint256S("0x00000000097174dacaf850075917d1a24145fce88a800881ece709bb8f8746cf")) ( 724100, uint256S("0x000000000ab34fd9c61be9f10a11a97f63a0f26c8f530e67a6397fb9934709dc")) ( 812000, uint256S("0x0000000000bccf70e0d2caa0473279decddb798f456d5a4bb399898e00eb4ce9")) - ( 902500, uint256S("0x0000000001258f2009278d042ed42dfd825de9a2bc31e410c0463bc8d6371ee4")), - 1616416937, // * UNIX timestamp of last checkpoint block - 20635475, // * total number of transactions between genesis and last checkpoint + ( 902500, uint256S("0x0000000001258f2009278d042ed42dfd825de9a2bc31e410c0463bc8d6371ee4")) + ( 1014400, uint256S("0x00000000001564ef09ddc49728c4c44701fd348c418ced0ee9f656660cc08e3a")), + 1633340596, // * UNIX timestamp of last checkpoint block + 24365699, // * total number of transactions between genesis and last checkpoint // (the tx=... number in the SetBestChain debug.log lines) - 13170 // * estimated number of transactions per day after checkpoint + 13836 // * estimated number of transactions per day after checkpoint // total number of tx / (checkpoint block height / (24 * 24)) }; @@ -249,11 +250,12 @@ class CTestNetParams : public CMainParams { (595000, uint256S("0x0000da85ddc79fdd297e996d6b6b887fc5b345619b7a6726c496941dcf830966")) (643000, uint256S("0x0000cabf39e3ac435d54b95c32e6173d6bb1b060066ecb7453d2146a0dd40947")) (729000, uint256S("0x00013f6d5315f29094287bf0981b177098c5d467422bc4ab7764f88f11333f5f")) - (816500, uint256S("0x0004c69745c68058fb35b2a8e090887500f71f7e107f0fd6f3e57d21afa5fe76")), - 1616382308, // * UNIX timestamp of last checkpoint block - 1642547, // * total number of transactions between genesis and last checkpoint + (816500, uint256S("0x0004c69745c68058fb35b2a8e090887500f71f7e107f0fd6f3e57d21afa5fe76")) + (926224, uint256S("0x0001bbe15a4dc7b4c580ba3211c0d074d5716a0eb924d228440f88e0dfc23248")), // last block before zendoo hard fork activation + 1632938878, // * UNIX timestamp of last checkpoint block + 1755729, // * total number of transactions between genesis and last checkpoint // (the tx=... number in the SetBestChain debug.log lines) - 1158 // total number of tx / (checkpoint block height / (24 * 24)) + 1091 // total number of tx / (checkpoint block height / (24 * 24)) }; // commented out - seems to make no sense but kept around for reference just in case From f32f62ce60953ca9c2ae9b0f8931c4a0902693be Mon Sep 17 00:00:00 2001 From: cronicc Date: Mon, 4 Oct 2021 10:27:54 +0000 Subject: [PATCH 26/33] Update version in readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8da25ad910..f69317fe37 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -Zen 2.0.23 +Zen 2.0.24 ============== What is Horizen? From d0f40cdc2a30ec2924a4194dfe0ad8dbc154a072 Mon Sep 17 00:00:00 2001 From: cronicc Date: Mon, 27 Sep 2021 09:58:37 +0000 Subject: [PATCH 27/33] Update Debian package info --- contrib/debian/changelog | 6 +++--- zcutil/build-debian-package.sh | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/contrib/debian/changelog b/contrib/debian/changelog index d59450f334..0522ac9781 100644 --- a/contrib/debian/changelog +++ b/contrib/debian/changelog @@ -1,5 +1,5 @@ -zen (2.0.15) stable; urgency=medium +zen (2.0.24) stable; urgency=medium - * 2.0.15 release. + * new release - -- Zen Blockchain Foundation Thu, 27 Sep 2018 23:00:00 +0200 + -- Zen Blockchain Foundation Mon, 04 Oct 2021 10:31:57 +0000 diff --git a/zcutil/build-debian-package.sh b/zcutil/build-debian-package.sh index bfa9722947..fd1ba4cd9a 100755 --- a/zcutil/build-debian-package.sh +++ b/zcutil/build-debian-package.sh @@ -46,7 +46,8 @@ cp $SRC_PATH/src/zend $DEB_BIN cp $SRC_PATH/src/zen-cli $DEB_BIN cp $SRC_PATH/zcutil/fetch-params.sh $DEB_BIN/zen-fetch-params # Copy docs -cp $SRC_PATH/doc/release-notes/release-notes-1.0.0.md $DEB_DOC/changelog +cp $SRC_PATH/doc/release-notes/release-notes-$(cut -d "-" -f 1-2 <<<${PACKAGE_VERSION})* $DEB_DOC/changelog || +cp "$(ls -v $SRC_PATH/doc/release-notes/release-notes-* | tail -n1)" $DEB_DOC/changelog cp $SRC_DEB/changelog $DEB_DOC/changelog.Debian cp $SRC_DEB/copyright $DEB_DOC cp -r $SRC_DEB/examples $DEB_DOC From c46809b30d5ac8c49ccd495407ba8c21adfff0a1 Mon Sep 17 00:00:00 2001 From: cronicc Date: Tue, 7 Sep 2021 11:54:31 +0000 Subject: [PATCH 28/33] Update OpenSSL to 1.1.1l --- depends/packages/openssl.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/depends/packages/openssl.mk b/depends/packages/openssl.mk index ad32c1eef0..325ebb7de3 100644 --- a/depends/packages/openssl.mk +++ b/depends/packages/openssl.mk @@ -1,8 +1,8 @@ package=openssl -$(package)_version=1.1.1k +$(package)_version=1.1.1l $(package)_download_path=https://www.openssl.org/source $(package)_file_name=$(package)-$($(package)_version).tar.gz -$(package)_sha256_hash=892a0875b9872acd04a9fde79b1f943075d5ea162415de3047c327df33fbaee5 +$(package)_sha256_hash=0b7a3e5e59c34827fe0c3a74b7ec8baef302b98fa80088d7f9153aa16fa76bd1 define $(package)_set_vars $(package)_config_env=AR="$($(package)_ar)" RANLIB="$($(package)_ranlib)" CC="$($(package)_cc)" From df6b74cdab481e87d3fe470161bd90b018473e17 Mon Sep 17 00:00:00 2001 From: cronicc Date: Mon, 4 Oct 2021 10:45:48 +0000 Subject: [PATCH 29/33] Set deprecation height 1047600/2021-12-1 --- src/deprecation.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/deprecation.h b/src/deprecation.h index 68b6d62767..ff846efcf6 100644 --- a/src/deprecation.h +++ b/src/deprecation.h @@ -5,8 +5,8 @@ #ifndef ZCASH_DEPRECATION_H #define ZCASH_DEPRECATION_H -static const int APPROX_RELEASE_HEIGHT = 906540; -static const int WEEKS_UNTIL_DEPRECATION = 30; +static const int APPROX_RELEASE_HEIGHT = 1019376; +static const int WEEKS_UNTIL_DEPRECATION = 7; static const int DEPRECATION_HEIGHT = APPROX_RELEASE_HEIGHT + (WEEKS_UNTIL_DEPRECATION * 7 * 24 * 24); // Number of blocks before deprecation to warn users From 01f45daf1d68db74c040d846bdf048859cfa5ea9 Mon Sep 17 00:00:00 2001 From: cronicc Date: Mon, 4 Oct 2021 12:17:54 +0000 Subject: [PATCH 30/33] Update manpages --- doc/man/zen-cli.1 | 6 +++--- doc/man/zen-tx.1 | 6 +++--- doc/man/zend.1 | 12 ++++++------ 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/doc/man/zen-cli.1 b/doc/man/zen-cli.1 index 94541641ed..86806ab9ed 100644 --- a/doc/man/zen-cli.1 +++ b/doc/man/zen-cli.1 @@ -1,9 +1,9 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.3. -.TH ZEN-CLI "1" "March 2021" "zen-cli v2.0.23" "User Commands" +.TH ZEN-CLI "1" "October 2021" "zen-cli v2.0.24" "User Commands" .SH NAME -zen-cli \- manual page for zen-cli v2.0.23 +zen-cli \- manual page for zen-cli v2.0.24 .SH DESCRIPTION -Horizen RPC client version v2.0.23 +Horizen RPC client version v2.0.24 .SS "Usage:" .TP zen\-cli [options] [params] diff --git a/doc/man/zen-tx.1 b/doc/man/zen-tx.1 index e3c4849608..5f3690f8d8 100644 --- a/doc/man/zen-tx.1 +++ b/doc/man/zen-tx.1 @@ -1,9 +1,9 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.3. -.TH ZEN-TX "1" "March 2021" "zen-tx v2.0.23" "User Commands" +.TH ZEN-TX "1" "October 2021" "zen-tx v2.0.24" "User Commands" .SH NAME -zen-tx \- manual page for zen-tx v2.0.23 +zen-tx \- manual page for zen-tx v2.0.24 .SH DESCRIPTION -Zencash zen\-tx utility version v2.0.23 +Zencash zen\-tx utility version v2.0.24 .SS "Usage:" .TP zen\-tx [options] [commands] diff --git a/doc/man/zend.1 b/doc/man/zend.1 index 9bde80f850..320b145235 100644 --- a/doc/man/zend.1 +++ b/doc/man/zend.1 @@ -1,9 +1,9 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.3. -.TH ZEND "1" "March 2021" "zend v2.0.23" "User Commands" +.TH ZEND "1" "October 2021" "zend v2.0.24" "User Commands" .SH NAME -zend \- manual page for zend v2.0.23 +zend \- manual page for zend v2.0.24 .SH DESCRIPTION -Zen Daemon version v2.0.23 +Zen Daemon version v2.0.24 .SS "Usage:" .TP zend [options] @@ -51,7 +51,7 @@ Specify data directory \fB\-disabledeprecation=\fR .IP Disable block\-height node deprecation and automatic shutdown (example: -\fB\-disabledeprecation\fR=\fI\,2\/\fR.0.23) +\fB\-disabledeprecation\fR=\fI\,2\/\fR.0.24) .HP \fB\-exportdir=\fR .IP @@ -503,8 +503,8 @@ Password for JSON\-RPC connections .HP \fB\-rpcport=\fR .IP -Listen for JSON\-RPC connections on (default: 8232 or testnet: -18232) +Listen for JSON\-RPC connections on (default: 8231 or testnet: +18231) .HP \fB\-rpcallowip=\fR .IP From d14f3669459110d01afc387cdbb0120724f28e30 Mon Sep 17 00:00:00 2001 From: cronicc Date: Mon, 4 Oct 2021 12:19:28 +0000 Subject: [PATCH 31/33] Update changelog --- doc/authors.md | 3 +- doc/release-notes/release-notes-2.0.24.md | 38 +++++++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 doc/release-notes/release-notes-2.0.24.md diff --git a/doc/authors.md b/doc/authors.md index fe653a49a7..e5b58a6639 100644 --- a/doc/authors.md +++ b/doc/authors.md @@ -5,8 +5,8 @@ Jack Grigg (773) Simon Liu (338) FranckDG (219) Sean Bowe (204) +cronicc (155) Daira Hopwood (142) -cronicc (136) Wladimir J. van der Laan (122) Nathan Wilcox (106) Jay Graber (75) @@ -23,6 +23,7 @@ Pieter Wuille (24) joshuayabut (20) nomnombtc (18) Paige Peterson (13) +luisantoniocrag (12) fanquake (12) Luke Dashjr (12) MarcoFalke (11) diff --git a/doc/release-notes/release-notes-2.0.24.md b/doc/release-notes/release-notes-2.0.24.md new file mode 100644 index 0000000000..38e116a617 --- /dev/null +++ b/doc/release-notes/release-notes-2.0.24.md @@ -0,0 +1,38 @@ +Changelog +========= + +cronicc (19): + Update about section in README.md + Change user agent in help messages from 'MagicBean' to 'zen' + Add websocket-client python test dependency + Update CI builder dockerfiles: + Replace xenial with focal builder in travis + Use focal host os and x-large vm size in travis linux build/test stages + Add some buildsystem information to entrypoint.sh + More Test stage parallelization + Add more fallback gpg2 servers for key fetch to Dockerfiles + Always login to hub.docker.com with read only account, even when only pulling + Change interpreter to python2 + Update python interpreter workaround for MacOS tests + Set version 2.0.24 + Add checkpoint blocks + Update version in readme + Update Debian package info + Update OpenSSL to 1.1.1l + Set deprecation height 1047600/2021-12-1 + Update manpages + +luisantoniocrag (12): + Fix RPC misc call help messages + Fix RPC blockchain call help messages + Fix RPC mining call help messages + Fix RPC net call help messages + Fix RPC rawtransaction call help messages + Fix RPC rpcdisclosure call help messages + Fix RPC server call help messages + Fix RPC rpcdump call help messages + Fix RPC rpcwallet call help messages + Fix misc rpc help messages + Fix rpcwallet + Update src/rpc/blockchain.cpp + From 7e75c2f2d910f7494e68aab6624b6571ac44f936 Mon Sep 17 00:00:00 2001 From: cronicc Date: Mon, 4 Oct 2021 17:53:03 +0000 Subject: [PATCH 32/33] Pull in patch fixing OpenSSL build error on older MacOS: https://github.com/openssl/openssl/commit/96ac8f13f4d0ee96baf5724d9f96c44c34b8606c --- depends/packages/openssl.mk | 4 +- ...allows-to-build-on-releases-before-Y.patch | 63 +++++++++++++++++++ 2 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 depends/patches/openssl/0001-Darwin-platform-allows-to-build-on-releases-before-Y.patch diff --git a/depends/packages/openssl.mk b/depends/packages/openssl.mk index 325ebb7de3..8fd854f433 100644 --- a/depends/packages/openssl.mk +++ b/depends/packages/openssl.mk @@ -3,6 +3,7 @@ $(package)_version=1.1.1l $(package)_download_path=https://www.openssl.org/source $(package)_file_name=$(package)-$($(package)_version).tar.gz $(package)_sha256_hash=0b7a3e5e59c34827fe0c3a74b7ec8baef302b98fa80088d7f9153aa16fa76bd1 +$(package)_patches=0001-Darwin-platform-allows-to-build-on-releases-before-Y.patch define $(package)_set_vars $(package)_config_env=AR="$($(package)_ar)" RANLIB="$($(package)_ranlib)" CC="$($(package)_cc)" @@ -93,7 +94,8 @@ endef define $(package)_preprocess_cmds sed -i.old 's/built on: $$$$date/built on: date not available/' util/mkbuildinf.pl && \ - sed -i.old "s|\"engines\", \"apps\", \"test\"|\"engines\"|" Configure + sed -i.old "s|\"engines\", \"apps\", \"test\"|\"engines\"|" Configure && \ + patch -p1 < $($(package)_patch_dir)/0001-Darwin-platform-allows-to-build-on-releases-before-Y.patch endef define $(package)_config_cmds diff --git a/depends/patches/openssl/0001-Darwin-platform-allows-to-build-on-releases-before-Y.patch b/depends/patches/openssl/0001-Darwin-platform-allows-to-build-on-releases-before-Y.patch new file mode 100644 index 0000000000..3fcee85a12 --- /dev/null +++ b/depends/patches/openssl/0001-Darwin-platform-allows-to-build-on-releases-before-Y.patch @@ -0,0 +1,63 @@ +From 96ac8f13f4d0ee96baf5724d9f96c44c34b8606c Mon Sep 17 00:00:00 2001 +From: David Carlier +Date: Tue, 24 Aug 2021 22:40:14 +0100 +Subject: [PATCH] Darwin platform allows to build on releases before + Yosemite/ios 8. + +issue #16407 #16408 + +Reviewed-by: Paul Dale +Reviewed-by: Tomas Mraz +(Merged from https://github.com/openssl/openssl/pull/16409) +--- + crypto/rand/rand_unix.c | 5 +---- + include/crypto/rand.h | 10 ++++++++++ + 2 files changed, 11 insertions(+), 4 deletions(-) + +diff --git a/crypto/rand/rand_unix.c b/crypto/rand/rand_unix.c +index 43f1069d15..0f4525106a 100644 +--- a/crypto/rand/rand_unix.c ++++ b/crypto/rand/rand_unix.c +@@ -34,9 +34,6 @@ + #if defined(__OpenBSD__) + # include + #endif +-#if defined(__APPLE__) +-# include +-#endif + + #if defined(OPENSSL_SYS_UNIX) || defined(__DJGPP__) + # include +@@ -381,7 +378,7 @@ static ssize_t syscall_random(void *buf, size_t buflen) + if (errno != ENOSYS) + return -1; + } +-# elif defined(__APPLE__) ++# elif defined(OPENSSL_APPLE_CRYPTO_RANDOM) + if (CCRandomGenerateBytes(buf, buflen) == kCCSuccess) + return (ssize_t)buflen; + +diff --git a/include/crypto/rand.h b/include/crypto/rand.h +index 5350d3a931..674f840fd1 100644 +--- a/include/crypto/rand.h ++++ b/include/crypto/rand.h +@@ -20,6 +20,16 @@ + + # include + ++# if defined(__APPLE__) && !defined(OPENSSL_NO_APPLE_CRYPTO_RANDOM) ++# include ++# if (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000) || \ ++ (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) ++# define OPENSSL_APPLE_CRYPTO_RANDOM 1 ++# include ++# include ++# endif ++# endif ++ + /* forward declaration */ + typedef struct rand_pool_st RAND_POOL; + +-- +2.31.1 + From a419d4d16ae37e54dadef9c90903597422226ff4 Mon Sep 17 00:00:00 2001 From: cronicc Date: Tue, 5 Oct 2021 09:26:46 +0000 Subject: [PATCH 33/33] Update release notes script authors header --- doc/authors.md | 4 ++-- doc/release-notes/release-notes-2.0.24.md | 4 +++- zcutil/release-notes.py | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/doc/authors.md b/doc/authors.md index e5b58a6639..209f671456 100644 --- a/doc/authors.md +++ b/doc/authors.md @@ -1,11 +1,11 @@ -Zcash Contributors +Horizen Contributors ================== Jack Grigg (773) Simon Liu (338) FranckDG (219) Sean Bowe (204) -cronicc (155) +cronicc (157) Daira Hopwood (142) Wladimir J. van der Laan (122) Nathan Wilcox (106) diff --git a/doc/release-notes/release-notes-2.0.24.md b/doc/release-notes/release-notes-2.0.24.md index 38e116a617..ec88feab22 100644 --- a/doc/release-notes/release-notes-2.0.24.md +++ b/doc/release-notes/release-notes-2.0.24.md @@ -1,7 +1,7 @@ Changelog ========= -cronicc (19): +cronicc (21): Update about section in README.md Change user agent in help messages from 'MagicBean' to 'zen' Add websocket-client python test dependency @@ -21,6 +21,8 @@ cronicc (19): Update OpenSSL to 1.1.1l Set deprecation height 1047600/2021-12-1 Update manpages + Update changelog + Pull in patch fixing OpenSSL build error on older MacOS: https://github.com/openssl/openssl/commit/96ac8f13f4d0ee96baf5724d9f96c44c34b8606c luisantoniocrag (12): Fix RPC misc call help messages diff --git a/zcutil/release-notes.py b/zcutil/release-notes.py index 01f658f07d..3e980fbdde 100755 --- a/zcutil/release-notes.py +++ b/zcutil/release-notes.py @@ -67,7 +67,7 @@ def document_authors(): print "Writing contributors documented in release-notes directory to authors.md." authors_file = os.path.join(doc_dir, 'authors.md') with open(authors_file, 'w') as f: - f.write('Zcash Contributors\n==================\n\n') + f.write('Horizen Contributors\n==================\n\n') total_contrib = {} for notes in os.listdir(os.path.join(doc_dir, 'release-notes')): # Commits are duplicated across beta, RC and final release notes,