Skip to content

Diskcoin API

headers设置Content-Type=application/json,采用Basic Auth Username, Password 是rpc 设置的账户密码 所有接口都是post方式

Blockchain

getbestblockhash

获取当前最新区块的hash值 - 请求: { "jsonrpc": "1.0", "id": "1", "method": "getbestblockhash", "params": [] } - 响应: { "result": "6c8bc8835df00bc0e961960f984904d5b5a537e3f388860aef2da4567c486ce2", "error": null, "id": "1" }

getblock "hash" (verbose) (listtransactions)

根据区块的hash或者高度获取区块的相关信息 - 参数: - hash:区块的hash值或者高度 - verbose:可选参数,默认为true,表示json对象,false则是十六进制编码数据 - listtransactions:可选参数,默认为true,会列举所有的交易ID,false则只统计数量 - 请求: { "jsonrpc": "1.0", "id": "1", "method": "getblock", "params": ["6e46a54a4ddcb2640796787570f97210daf1f896a38693ecd6c67d49bfb61619", true, true] } - 响应: { "result": { "hash": "6e46a54a4ddcb2640796787570f97210daf1f896a38693ecd6c67d49bfb61619", "confirmations": 408, "size": 291, "height": 975, "version": 536870912, "versionHex": "20000000", "merkleroot": "0325ca3c4a8fd25d4224b38bbdfb6ca0c15fd63feeac0a051acbaef6e69f5308", "tx": [ "0325ca3c4a8fd25d4224b38bbdfb6ca0c15fd63feeac0a051acbaef6e69f5308" ], "time": 1563185010, "mediantime": 1563184690, "nonce": 2190714007139005, "bits": "1d0fffff", "difficulty": 0.06249910592947572, "chainwork": "00000000000000000000000000000000000000000000000000000000000163fe", "basetarget": 39608397, "ploterid": 10924919180736888, "deadline": 92, "generatesignature": "385a13e649ae45161ae8f7c1f6ebd42eb16a74cb42957c35e0c9bde20983e771", "previousblockhash": "c1b84132c7dee0abe58dbacc44067f81bc12a85b4d24b6834df00f4417d6ccba", "nextblockhash": "874094a541eef686f640de285fd823981f8171f3bfd8636bfdaad8d018ae6870" }, "error": null, "id": "1" }

getblockchaininfo

获取当前区块链的状态信息 - 请求: { "jsonrpc": "1.0", "id": "1", "method": "getblockchaininfo", "params": [] } - 响应: { "result": { "chain": "test", "blocks": 975, "headers": 975, "bestblockhash": "6e46a54a4ddcb2640796787570f97210daf1f896a38693ecd6c67d49bfb61619", "difficulty": 0.06249910592947572, "mediantime": 1563184690, "verificationprogress": 1, "initialblockdownload": false, "chainwork": "00000000000000000000000000000000000000000000000000000000000163fe", "pruned": false, "netbasetarget": 0, "netcooperation": 0 }, "error": null, "id": "1" }

getblockcount

获取当前区块的最新高度 - 请求: { "jsonrpc": "1.0", "id": "1", "method": "getblockcount", "params": [] } - 响应: { "result": 1359, "error": null, "id": "1" }

getblockhash index

根据区块的高度获取区块的hash - 请求参数: - index:必须,区块高度 - 请求: { "jsonrpc": "1.0", "id": "1", "method": "getblockhash", "params": [975] } - 响应: { "result": "6e46a54a4ddcb2640796787570f97210daf1f896a38693ecd6c67d49bfb61619", "error": null, "id": "1" }

getblockheader "hash" (verbose)

根据区块的hash获取区块的相关信息 - 参数: - hash:区块的hash值 - verbose:可选参数,默认为true,表示json对象,false则是十六进制编码数据 - 请求: { "jsonrpc": "1.0", "id": "1", "method": "getblockheader", "params": ["6e46a54a4ddcb2640796787570f97210daf1f896a38693ecd6c67d49bfb61619"] } - 响应: { "result": { "hash": "6e46a54a4ddcb2640796787570f97210daf1f896a38693ecd6c67d49bfb61619", "confirmations": 394, "height": 975, "version": 536870912, "versionHex": "20000000", "merkleroot": "0325ca3c4a8fd25d4224b38bbdfb6ca0c15fd63feeac0a051acbaef6e69f5308", "time": 1563185010, "mediantime": 1563184690, "nonce": 2190714007139005, "bits": "1d0fffff", "difficulty": 0.06249910592947572, "chainwork": "00000000000000000000000000000000000000000000000000000000000163fe", "previousblockhash": "c1b84132c7dee0abe58dbacc44067f81bc12a85b4d24b6834df00f4417d6ccba", "nextblockhash": "874094a541eef686f640de285fd823981f8171f3bfd8636bfdaad8d018ae6870" }, "error": null, "id": "1" }

getchaintips

返回当前区块链的头部信息 - 请求: { "jsonrpc": "1.0", "id": "1", "method": "getchaintips", "params": [] } - 响应: { "result": [ { "height": 2125, "chainwork": "00000000000000000000000000000000000000000000000000000000000ecaab", "hash": "545df67716580a55342cd62af44c287b48d0cac0b07c87f22048c709b8b5b9ee", "branchlen": 0, "status": "active" }, { "height": 1851, "chainwork": "00000000000000000000000000000000000000000000000000000000000ab89f", "hash": "6fc247f32d6c381cb81f26301955775e475e945b060631868693cf8e019ebe59", "branchlen": 1, "status": "valid-fork" }, { "height": 1610, "chainwork": "000000000000000000000000000000000000000000000000000000000007d88f", "hash": "89e0b2597fbc790e1565a4f91408a5907865465ecc21273e8aae26ad16cabec1", "branchlen": 1, "status": "valid-fork" } ], "error": null, "id": "1" }

getmempoolancestors txid (verbose)

如果txidmempool中,则返回所有in-mempool祖先 - 请求参数: - txid (string, required) The transaction id (must be in mempool) - verbose (boolean, optional, default=false) True for a json object, false for array of transaction ids - 请求: { "jsonrpc": "1.0", "id": "1", "method": "getmempoolancestors", "params": ["7b100c6083f8e6250f9dbc3585653b903cbae81dd7d0012b0be30bc8b3912570"] } - 响应: { "result": [], "error": null, "id": "1" }

getmempooldescendants txid (verbose)

如果txidmempool中,则返回所有in-mempool后代。 - 请求参数: - txid (string, required) The transaction id (must be in mempool) - verbose (boolean, optional, default=false) True for a json object, false for array of transaction ids - 请求: { "jsonrpc": "1.0", "id": "1", "method": "getmempooldescendants", "params": ["7b100c6083f8e6250f9dbc3585653b903cbae81dd7d0012b0be30bc8b3912570"] } - 响应: { "result": [], "error": null, "id": "1" }

getmempoolentry txid

返回内存池中的交易详情 - 请求参数: - txid (string, required) The transaction id (must be in mempool) - 请求: { "jsonrpc": "1.0", "id": "1", "method": "getmempoolentry", "params": ["7b100c6083f8e6250f9dbc3585653b903cbae81dd7d0012b0be30bc8b3912570"] } - 响应: { "result": { "size": 1431, "fee": 0.0002864, "modifiedfee": 0.0002864, "time": 1563346805, "height": 2125, "startingpriority": 11508630237.67279, "currentpriority": 11508630237.67279, "descendantcount": 1, "descendantsize": 1431, "descendantfees": 28640, "ancestorcount": 1, "ancestorsize": 1431, "ancestorfees": 28640, "depends": [], "spentby": [] }, "error": null, "id": "1" }

getmempoolinfo

获取状态为activeTX memory pool的详细信息 - 请求: { "jsonrpc": "1.0", "id": "1", "method": "getmempoolinfo", "params": [] } - 响应: { "result": { "size": 2, "bytes": 1622, "usage": 4352, "maxmempool": 300000000, "mempoolminfee": 0, "tps": 0.02 }, "error": null, "id": "1" }

getorphanpoolinfo

获取状态为activeTX orphan pool的详细信息 - 请求: { "jsonrpc": "1.0", "id": "1", "method": "getorphanpoolinfo", "params": [] } - 响应: { "result": { "size": 0, "bytes": 0 }, "error": null, "id": "1" }

getrawmempool (verbose)

返回所有在memory pool的交易ID - 请求参数: - verbose:可选参数,默认为false,返回交易ID的数组形式,否则为json格式 Optional parameter, default is false, returns an array of transaction IDs, otherwise in json format - 请求: { "jsonrpc": "1.0", "id": "1", "method": "getrawmempool", "params": [true] } - 响应: { "result": { "53fac9b470e646c472948721552214b27bc75e9a0e19265acb5b53d8c7d51c0f": { "size": 191, "fee": 0.0000382, "modifiedfee": 0.0000382, "time": 1563346822, "height": 2125, "startingpriority": 1739081549.897436, "currentpriority": 1739081549.897436, "descendantcount": 1, "descendantsize": 191, "descendantfees": 3820, "ancestorcount": 1, "ancestorsize": 191, "ancestorfees": 3820, "depends": [], "spentby": [] }, "7b100c6083f8e6250f9dbc3585653b903cbae81dd7d0012b0be30bc8b3912570": { "size": 1431, "fee": 0.0002864, "modifiedfee": 0.0002864, "time": 1563346805, "height": 2125, "startingpriority": 11508630237.67279, "currentpriority": 11508630237.67279, "descendantcount": 1, "descendantsize": 1431, "descendantfees": 28640, "ancestorcount": 1, "ancestorsize": 1431, "ancestorfees": 28640, "depends": [], "spentby": [] } }, "error": null, "id": "1" }

getraworphanpool

返回所有在orphan pool的交易ID - 请求: { "jsonrpc": "1.0", "id": "1", "method": "getraworphanpool", "params": [] } - 响应: { "result": [], "error": null, "id": "1" }

gettxout "txid" n (includemempool)

返回交易的输出信息 - 请求参数: - txid (string, required) The transaction id - n (numeric, required) vout number - include_mempool (boolean, optional) Whether to include the mempool - 请求: { "jsonrpc": "1.0", "id": "1", "method": "gettxout", "params": ["0325ca3c4a8fd25d4224b38bbdfb6ca0c15fd63feeac0a051acbaef6e69f5308", 1] } - 响应: { "result": { "bestblock": "0dd6ce2f9aeae64e0f30b723664724a09706fb31c58d254485e2b7f34a9a7454", "confirmations": 409, "value": 8, "scriptPubKey": { "asm": "0347542a5f9a5f70f0c0b3e19139079ed24111ffd5d690e8e44a140bc9e493684d OP_CHECKSIG", "hex": "210347542a5f9a5f70f0c0b3e19139079ed24111ffd5d690e8e44a140bc9e493684dac", "reqSigs": 1, "type": "pubkey", "addresses": [ "1JZYyGKe8THWpXE93vMGwjuvRcYgQd2ZAH" ] }, "coinbase": true }, "error": null, "id": "1" }

gettxoutproof ["txid",...] (blockhash)

根据交易ID返回十六进制的证据 - 请求参数: - txids (string) A json array of txids to filter - blockhash (string, optional) If specified, looks for txid in the block with this hash - 请求: { "jsonrpc": "1.0", "id": "1", "method": "gettxoutproof", "params": [["0325ca3c4a8fd25d4224b38bbdfb6ca0c15fd63feeac0a051acbaef6e69f5308"], "6e46a54a4ddcb2640796787570f97210daf1f896a38693ecd6c67d49bfb61619"] } - 响应: { "result": "00000020baccd617440ff04d83b6244d5ba812bc817f0644ccba8de5abe0dec73241b8c108539fe6f6aecb1a050aacee3fd65fc1a06cfbbd8bb324425dd28f4a3cca2503724f2c5dffff0f1dbd32335a71c807004d605c020000000078b9f7f627d026005c00000000000000385a13e649ae45161ae8f7c1f6ebd42eb16a74cb42957c35e0c9bde20983e771010000000108539fe6f6aecb1a050aacee3fd65fc1a06cfbbd8bb324425dd28f4a3cca25030101", "error": null, "id": "1" }

gettxoutproofs ["txid",...] (blockhash)

根据交易ID返回十六进制的证据,交易ID和证据一一对应 - 请求参数: - txids (string) A json array of txids to filter - blockhash (string, optional) If specified, looks for txid in the block with this hash - 请求: { "jsonrpc": "1.0", "id": "1", "method": "gettxoutproofs", "params": [["0325ca3c4a8fd25d4224b38bbdfb6ca0c15fd63feeac0a051acbaef6e69f5308"], "6e46a54a4ddcb2640796787570f97210daf1f896a38693ecd6c67d49bfb61619"] } - 响应: { "result": { "0325ca3c4a8fd25d4224b38bbdfb6ca0c15fd63feeac0a051acbaef6e69f5308": "00000020baccd617440ff04d83b6244d5ba812bc817f0644ccba8de5abe0dec73241b8c108539fe6f6aecb1a050aacee3fd65fc1a06cfbbd8bb324425dd28f4a3cca2503724f2c5dffff0f1dbd32335a71c807004d605c020000000078b9f7f627d026005c00000000000000385a13e649ae45161ae8f7c1f6ebd42eb16a74cb42957c35e0c9bde20983e771010000000108539fe6f6aecb1a050aacee3fd65fc1a06cfbbd8bb324425dd28f4a3cca25030101" }, "error": null, "id": "1" }

gettxoutsetinfo

返回当前所有未花费的输出统计信息 - 请求: { "jsonrpc": "1.0", "id": "1", "method": "gettxoutsetinfo", "params": [] } - 响应: { "result": { "height": 1386, "bestblock": "787462676f41dbd1aced66d6292904a9b662b42df6a16c7faeff1de2e2d4b764", "transactions": 1404, "txouts": 2770, "hash_serialized_2": "bf48323c671476821ec28408f0a5a1778aa38fd296feb7de4d1451290200c42e", "disk_size": 0, "total_amount": 27720 }, "error": null, "id": "1" }

verifychain (checklevel numblocks)

验证区块链数据库 - 请求参数: - checklevel:可选参数,范围0-4,默认为3 - numblocks:可选参数,需要check的区块数目,默认为6个,如果设置为0则代表所有 - 请求: { "jsonrpc": "1.0", "id": "1", "method": "verifychain", "params": [] } - 响应: 返回值为true|false { "result": true, "error": null, "id": "1" }

verifytxoutproof "proof"

验证区块中交易的证据 - 请求参数: - proof:十六进制的证据(gettxoutproof产生) - 请求: { "jsonrpc": "1.0", "id": "1", "method": "verifytxoutproof", "params": ["00000020baccd617440ff04d83b6244d5ba812bc817f0644ccba8de5abe0dec73241b8c108539fe6f6aecb1a050aacee3fd65fc1a06cfbbd8bb324425dd28f4a3cca2503724f2c5dffff0f1dbd32335a71c807004d605c020000000078b9f7f627d026005c00000000000000385a13e649ae45161ae8f7c1f6ebd42eb16a74cb42957c35e0c9bde20983e771010000000108539fe6f6aecb1a050aacee3fd65fc1a06cfbbd8bb324425dd28f4a3cca25030101"] } - 响应: 返回值为对应的交易ID,或者为空 { "result": [ "0325ca3c4a8fd25d4224b38bbdfb6ca0c15fd63feeac0a051acbaef6e69f5308" ], "error": null, "id": "1" }

Control

getinfo

获取钱包信息 - 请求: { "jsonrpc": "1.0", "id": "1", "method": "getinfo", "params": [] } - 响应: { "result": { "version": 1060000, "protocolversion": 80003, "walletversion": 60000, "balance": 0.5, "blocks": 2133, "timeoffset": 0, "connections": 5, "proxy": "", "difficulty": 0.06249910592947572, "testnet": false, "keypoololdest": 1563271172, "keypoolsize": 10001, "unlocked_until": 0, "paytxfee": 0, "relayfee": 0.00001, "status": "ready", "errors": "", "fork": "diskcoin" }, "error": null, "id": "1" }

help ("command")

查看某个命令的帮助信息 - 请求: { "jsonrpc": "1.0", "id": "1", "method": "help", "params": ["createrawtransaction"] } - 响应: { "result": "createrawtransaction [{\"txid\":\"id\",\"vout\":n},...] {\"address\":amount,\"data\":\"hex\",...} ( locktime )\n\nCreate a transaction spending the given inputs and creating new outputs.\nOutputs can be addresses or data.\nReturns hex-encoded raw transaction.\nNote that the transaction's inputs are not signed, and\nit is not stored in the wallet or transmitted to the network.\n\nArguments:\n1. \"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 \"vout\":n, (numeric, required) The output number\n \"sequence\":n (numeric, optional) The sequence number\n }\n ,...\n ]\n2. \"outputs\" (string, required) a json object with outputs\n {\n \"address\": x.xxx (numeric or string, required) The key is the diskcoin address, the numeric value (can be string) is the BCH amount\n \"data\": \"hex\", (string, required) The key is \"data\", the value is hex encoded data\n ...\n }\n3. locktime (numeric, optional, default=0) Raw locktime. Non-0 value also locktime-activates inputs\n\nResult:\n\"transaction\" (string) hex string of the transaction\n\nExamples\n> diskcoin-cli createrawtransaction \"[{\\\"txid\\\":\\\"myid\\\",\\\"vout\\\":0}]\" \"{\\\"address\\\":0.01}\"\n> diskcoin-cli createrawtransaction \"[{\\\"txid\\\":\\\"myid\\\",\\\"vout\\\":0}]\" \"{\\\"data\\\":\\\"00010203\\\"}\"\n> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"createrawtransaction\", \"params\": [\"[{\\\"txid\\\":\\\"myid\\\",\\\"vout\\\":0}]\", \"{\\\"address\\\":0.01}\"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/\n> curl --user myusername --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"createrawtransaction\", \"params\": [\"[{\\\"txid\\\":\\\"myid\\\",\\\"vout\\\":0}]\", \"{\\\"data\\\":\\\"00010203\\\"}\"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/\n", "error": null, "id": "1" }

stop

停止diskcoin服务 - 请求: { "jsonrpc": "1.0", "id": "1", "method": "stop", "params": [] } - 响应: { "result": "diskcoin server stopping", "error": null, "id": "1" }

Electrum

getelectruminfo

获取electrum服务器的状态 - 请求: { "jsonrpc": "1.0", "id": "1", "method": "getelectruminfo", "params": [] } - 响应: { "result": null, "error": { "code": -1, "message": "Electrum server is disabled" }, "id": "1" }

Generating

getgenerate

查询服务器是否设置为挖矿模式 - 请求: { "jsonrpc": "1.0", "id": "1", "method": "getgenerate", "params": [] } - 响应: { "result": true, "error": null, "id": "1" }

setgenerate generate (genproclimit)

  • 请求参数:
  • generate:必须,true表示打开,false表示关闭
  • genproclimit:可选参数,设置处理器的限制数,-1表示无限制
  • 请求: { "jsonrpc": "1.0", "id": "1", "method": "setgenerate", "params": [true, 10] }
  • 响应: { "result": null, "error": null, "id": "1" }

Mining

addblackplotterid plotterId

将某个plotter id加入黑名单 - 请求参数: - plotterId:必须,Plotter ID
- 请求:

  • 响应:

getMiningInfo

获取目前的挖矿信息 - 请求: { "jsonrpc": "1.0", "id": "1", "method": "getMiningInfo", "params": [] } - 响应: { "result": { "height": 1524, "baseTarget": "43806524", "generationSignature": "5205f3dc6741413c3a555380a581479886cf94afe4d81a1ff1a3842fc6e1af36", "targetDeadline": 4294967295 }, "error": null, "id": "1" }

getblocktemplate ("jsonrequestobject")

  • 请求参数:
  • jsonrequestobject:可选参数
  • 请求:
  • 响应:

getblockversion

获取挖矿时的区块版本 - 请求: { "jsonrpc": "1.0", "id": "1", "method": "getblockversion", "params": [] } - 响应: 返回值为版本号 { "result": 536870912, "error": null, "id": "1" }

getminercomment

  • 请求: { "jsonrpc": "1.0", "id": "1", "method": "getminercomment", "params": [] }
  • 响应: { "result": "", "error": null, "id": "1" }

getmininginfo

获取挖矿的相关信息 - 请求: { "jsonrpc": "1.0", "id": "1", "method": "getmininginfo", "params": [] } - 响应: { "result": { "blocks": 1528, "currentblocksize": 1145, "currentblocktx": 0, "difficulty": 0.06249910592947572, "errors": "", "genproclimit": 10, "networkhashps": 4.29681593952207, "pooledtx": 0, "testnet": false, "chain": "test", "generate": true }, "error": null, "id": "1" }

getminingmaxblock

获取挖矿区块的最大字节数 - 请求: { "jsonrpc": "1.0", "id": "1", "method": "getminingmaxblock", "params": [] } - 响应: { "result": 8000000, "error": null, "id": "1" }

getnetworkhashps (blocks height)

基于最近的n个区块来估算每秒的network hashes - 请求参数: - blocks:可选参数,默认为120,表示区块的数目,-1则表示取自上次难度改变以来的区块 - height:可选参数,默认为-1,表示在指定高度的时间点进行计算 - 请求: { "jsonrpc": "1.0", "id": "1", "method": "getnetworkhashps", "params": [] } - 响应: { "result": 4.262611464968153, "error": null, "id": "1" }

prioritisetransaction

增加或减少交易的优先级 - 请求参数: - txid:必须,交易ID - priority delta:必须,需要增加或者减少的优先级 - height:必须,fee value - 请求: { "jsonrpc": "1.0", "id": "1", "method": "prioritisetransaction", "params": ["0325ca3c4a8fd25d4224b38bbdfb6ca0c15fd63feeac0a051acbaef6e69f5308", 0.0, 10000] } - 响应: { "result": true, "error": null, "id": "1" }

setblockversion blockVersionNumber

设置区块的版本号 - 请求参数: - blockVersionNumber:必须,版本号(integer, hex integer, 'BIP109', 'BASE' or 'default') - 请求: { "jsonrpc": "1.0", "id": "1", "method": "setblockversion", "params": ["BASE"] } - 响应: { "result": null, "error": null, "id": "1" }

setminercomment

getminercomment对应 - 请求: { "jsonrpc": "1.0", "id": "1", "method": "setminercomment", "params": ["diskcoin is fundamentally emergent consensus"] } - 响应: { "result": null, "error": null, "id": "1" }

setminingmaxblock blocksize

设置可生产的最大区块值 - 请求参数: - blocksize:必须,区块的最大字节数 - 请求: { "jsonrpc": "1.0", "id": "1", "method": "setminingmaxblock", "params": [8000000] } - 响应: { "result": null, "error": null, "id": "1" }

submitNonce nonce plotterId (height)

  • 请求参数:
  • nonce:必须
  • plotterId:必须,Plotter ID
  • height:可选,目标高度,默认为当前挖矿高度
  • 请求:
  • 响应:

submitblock "hexdata" ("jsonparametersobject")

Attempts to submit new block to network. The ‘jsonparametersobject’ parameter is currently ignored. - 请求参数: - “hexdata” (string, required) the hex-encoded block data to submit - “parameters” (string, optional) object of optional parameters - 请求:

  • 响应:

submitminingsolution "Mining-Candidate data" ("jsonparametersobject")

  • 请求参数:
  • Mining-Candidate data:必须,需要提交的挖矿答案
  • jsonparametersobject:可选
  • 请求:
  • 响应:

validateblocktemplate "hexdata"

  • 请求参数:
  • hexdata:必须,待验证的十六进制区块数据
  • 请求:
  • 响应:

Network

addnode "node" "add|remove|onetry"

添加或者删除节点到addnode列表 - 请求参数: - node (string, required) The node (see getpeerinfo for nodes) - 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 - 请求: { "jsonrpc": "1.0", "id": "1", "method": "addnode", "params": ["121.28.160.158:63335", "add"] } - 响应: { "result": null, "error": null, "id": "1" }

clearbanned

清除所有被禁的IP - 请求: { "jsonrpc": "1.0", "id": "1", "method": "clearbanned", "params": [] } - 响应: { "result": null, "error": null, "id": "1" }

listbanned

列举所有被禁的IP/子网 - 请求: { "jsonrpc": "1.0", "id": "1", "method": "listbanned", "params": [] } - 响应: { "result": [ { "address": "124.236.118.112/32", "banned_until": 1563394173, "ban_created": 1563307773, "ban_reason": "node misbehaving" }, { "address": "205.185.120.91/32", "banned_until": 1563377778, "ban_created": 1563291378, "ban_reason": "node misbehaving" } ], "error": null, "id": "1" }

clearblockstats

  • 请求: { "jsonrpc": "1.0", "id": "1", "method": "clearblockstats", "params": [] }
  • 响应: { "result": null, "error": null, "id": "1" }

disconnectnode "node"

断开某个节点的连接 - 请求参数: - node:必须,节点信息 - 请求: { "jsonrpc": "1.0", "id": "1", "method": "disconnectnode", "params": ["121.28.160.158:63335"] } - 响应: { "result": null, "error": null, "id": "1" }

expedited block|tx "node IP addr" on|off

  • 请求参数:
  • block | tx:必须,需要加速的区块或者交易
  • node ip addr:必须,节点信息
  • on | off:必须,打开或者关闭加速服务
  • 请求: { "jsonrpc": "1.0", "id": "1", "method": "expedited", "params": ["block", "121.28.160.158:63335", "on"] }
  • 响应: { "result": null, "error": null, "id": "1" }

getconnectioncount

获取与其他节点的连接数 - 请求: { "jsonrpc": "1.0", "id": "1", "method": "getconnectioncount", "params": [] } - 响应: { "result": 6, "error": null, "id": "1" }

getexcessiveblock

setexcessiveblock对应 - 请求: { "jsonrpc": "1.0", "id": "1", "method": "getexcessiveblock", "params": [] } - 响应: { "result": { "excessiveBlockSize": 32000000, "excessiveAcceptDepth": 12 }, "error": null, "id": "1" }

getnettotals

返回网络流量统计信息 - 请求: { "jsonrpc": "1.0", "id": "1", "method": "getnettotals", "params": [] } - 响应: { "result": { "totalbytesrecv": 6421953, "totalbytessent": 138173, "timemillis": 1563266107979, "uploadtarget": { "timeframe": 86400, "target": 0, "target_reached": false, "serve_historical_blocks": true, "bytes_left_in_cycle": 0, "time_left_in_cycle": 0 } }, "error": null, "id": "1" }

getnetworkinfo

返回节点的网络连接信息 - 请求: { "jsonrpc": "1.0", "id": "1", "method": "getnetworkinfo", "params": [] } - 响应: { "result": { "version": 1060000, "subversion": "/BUCash:1.6.0(EB32; AD12)/", "protocolversion": 80003, "localservices": "0000000000000075", "timeoffset": 0, "connections": 6, "networks": [ { "name": "ipv4", "limited": false, "reachable": true, "proxy": "", "proxy_randomize_credentials": false }, { "name": "ipv6", "limited": false, "reachable": true, "proxy": "", "proxy_randomize_credentials": false }, { "name": "onion", "limited": true, "reachable": false, "proxy": "", "proxy_randomize_credentials": false } ], "relayfee": 0.00001, "minlimitertxfee": "1.0000", "maxlimitertxfee": "1.0000", "localaddresses": [], "thinblockstats": { "enabled": true, "summary": "0 inbound and 0 outbound thin blocks have saved 0.00B of bandwidth", "mempool_limiter": "Thinblock mempool limiting has saved 0.00B of bandwidth", "inbound_percent": "Compression for 0 Inbound thinblocks (last 24hrs): 0.0%", "outbound_percent": "Compression for 0 Outbound thinblocks (last 24hrs): 0.0%", "response_time": "Response time (last 24hrs) AVG:0.00, 95th pcntl:0.00", "validation_time": "Validation time (last 24hrs) AVG:0.00, 95th pcntl:0.00", "outbound_bloom_filters": "Outbound bloom filter size (last 24hrs) AVG: 0.00B", "inbound_bloom_filters": "Inbound bloom filter size (last 24hrs) AVG: 0.00B", "thin_block_size": "Thinblock size (last 24hrs) AVG: 0.00B", "thin_full_tx": "Thinblock full transactions size (last 24hrs) AVG: 0.00B", "rerequested": "Tx re-request rate (last 24hrs): 0.0% Total re-requests:0" }, "compactblockstats": { "enabled": true, "summary": "0 inbound and 0 outbound compactblocks have saved 0.00B of bandwidth", "mempool_limiter": "CompactBlock mempool limiting has saved 0.00B of bandwidth", "inbound_percent": "Compression for 0 Inbound compactblocks (last 24hrs): 0.0%", "outbound_percent": "Compression for 0 Outbound compactblocks (last 24hrs): 0.0%", "response_time": "Response time (last 24hrs) AVG:0.00, 95th pcntl:0.00", "validation_time": "Validation time (last 24hrs) AVG:0.00, 95th pcntl:0.00", "compact_block_size": "CompactBlock size (last 24hrs) AVG: 0.00B", "compact_full_tx": "compactblock full transactions size (last 24hrs) AVG: 0.00B", "rerequested": "Tx re-request rate (last 24hrs): 0.0% Total re-requests:0" }, "grapheneblockstats": { "enabled": true, "summary": "0 inbound and 0 outbound graphene blocks have saved 0.00B of bandwidth with 0 local decode failures", "inbound_percent": "Compression for 0 Inbound graphene blocks (last 24hrs): 0.0%", "outbound_percent": "Compression for 0 Outbound graphene blocks (last 24hrs): 0.0%", "response_time": "Response time (last 24hrs) AVG:0.11, 95th pcntl:0.19", "validation_time": "Validation time (last 24hrs) AVG:0.00, 95th pcntl:0.00", "filter": "Bloom filter size (last 24hrs) AVG: 0.00B", "iblt": "IBLT size (last 24hrs) AVG: 0.00B", "rank": "Rank size (last 24hrs) AVG: 0.00B", "graphene_block_size": "Graphene block size (last 24hrs) AVG: 0.00B", "graphene_additional_tx_size": "Graphene size additional txs (last 24hrs) AVG: 0.00B", "rerequested": "Tx re-request rate (last 24hrs): 0.0% Total re-requests:0" }, "warnings": "" }, "error": null, "id": "1" }

getpeerinfo [peer IP address]

  • 请求参数:
  • peer IP address:可选,没有指定则返回所有连接的网络节点信息
  • 请求: { "jsonrpc": "1.0", "id": "1", "method": "getpeerinfo", "params": [] }
  • 响应: { "result": [ { "id": 10, "addr": "194.33.38.214:63335", "addrlocal": "218.77.106.151:37951", "services": "0000000000000075", "relaytxes": true, "lastsend": 1563266273, "lastrecv": 1563266273, "bytessent": 11059, "bytesrecv": 8935, "conntime": 1563260353, "timeoffset": 0, "pingtime": 0.292815, "minping": 0.177829, "version": 80003, "subver": "/BUCash:1.6.0(EB32; AD12)/", "inbound": false, "startingheight": 1514, "banscore": 0, "synced_headers": 1554, "synced_blocks": 1553, "inflight": [], "whitelisted": false, "xversion_map": { "0000000000020001": "04", "0000000000020002": "01", "0000000000020000": "fd67f7", "0000000000020005": "00", "0000000000020003": "02", "0000000000020004": "00" } }, { "id": 13, "addr": "121.28.160.158:63335", "addrlocal": "218.77.106.151:21360", "services": "0000000000000075", "relaytxes": true, "lastsend": 1563266225, "lastrecv": 1563266273, "bytessent": 8259, "bytesrecv": 12048, "conntime": 1563260360, "timeoffset": 0, "pingtime": 0.039879, "minping": 0.036661, "version": 80003, "subver": "/BUCash:1.6.0(EB32; AD12)/", "inbound": false, "startingheight": 1514, "banscore": 0, "synced_headers": 1554, "synced_blocks": 1553, "inflight": [], "whitelisted": false, "xversion_map": { "0000000000020002": "01", "0000000000020001": "04", "0000000000020005": "00", "0000000000020000": "fd67f7", "0000000000020004": "00", "0000000000020003": "02" } }, { "id": 14, "addr": "205.185.120.91:63335", "addrlocal": "218.77.106.151:38220", "services": "0000000000000075", "relaytxes": true, "lastsend": 1563266273, "lastrecv": 1563266273, "bytessent": 10564, "bytesrecv": 10712, "conntime": 1563260379, "timeoffset": 0, "pingtime": 0.191049, "minping": 0.182475, "version": 80003, "subver": "/BUCash:1.6.0(EB32; AD12)/", "inbound": false, "startingheight": 1514, "banscore": 0, "synced_headers": 1554, "synced_blocks": 1552, "inflight": [], "whitelisted": false, "xversion_map": { "0000000000020000": "fd67f7", "0000000000020002": "01", "0000000000020001": "04", "0000000000020004": "00", "0000000000020003": "02", "0000000000020005": "00" } }, { "id": 15, "addr": "124.236.118.112:63335", "addrlocal": "218.77.106.151:21148", "services": "0000000000000075", "relaytxes": true, "lastsend": 1563266202, "lastrecv": 1563266273, "bytessent": 9153, "bytesrecv": 9889, "conntime": 1563260381, "timeoffset": 0, "pingtime": 0.042974, "minping": 0.040235, "version": 80003, "subver": "/BUCash:1.6.0(EB32; AD12)/", "inbound": false, "startingheight": 1514, "banscore": 0, "synced_headers": 1554, "synced_blocks": 1553, "inflight": [], "whitelisted": false, "xversion_map": { "0000000000020001": "04", "0000000000020000": "fd67f7", "0000000000020005": "00", "0000000000020004": "00", "0000000000020002": "01", "0000000000020003": "02" } }, { "id": 16, "addr": "47.91.209.206:63335", "addrlocal": "218.77.106.151:21130", "services": "0000000000000075", "relaytxes": true, "lastsend": 1563266264, "lastrecv": 1563266273, "bytessent": 5845, "bytesrecv": 14727, "conntime": 1563260383, "timeoffset": 0, "pingtime": 0.039151, "minping": 0.038024, "version": 80003, "subver": "/BUCash:1.6.0(EB32; AD12)/", "inbound": false, "startingheight": 1514, "banscore": 0, "synced_headers": 1554, "synced_blocks": 1553, "inflight": [], "whitelisted": false, "xversion_map": { "0000000000020000": "fd67f7", "0000000000020002": "01", "0000000000020001": "04", "0000000000020005": "00", "0000000000020003": "02", "0000000000020004": "00" } }, { "id": 27, "addr": "27.102.134.181:63335", "addrlocal": "218.77.106.151:26893", "services": "0000000000000075", "relaytxes": true, "lastsend": 1563266273, "lastrecv": 1563266273, "bytessent": 3987, "bytesrecv": 8615, "conntime": 1563263917, "timeoffset": 0, "pingtime": 0.068714, "minping": 0.067235, "version": 80003, "subver": "/BUCash:1.6.0(EB32; AD12)/", "inbound": false, "startingheight": 1536, "banscore": 0, "synced_headers": 1554, "synced_blocks": 1553, "inflight": [], "whitelisted": false, "xversion_map": { "0000000000020000": "fd67f7", "0000000000020001": "04", "0000000000020003": "02", "0000000000020002": "01", "0000000000020005": "00", "0000000000020004": "00" } } ], "error": null, "id": "1" }

gettrafficshaping

获取网络发送和接收的带宽设置信息,单位为kb/s - 请求: { "jsonrpc": "1.0", "id": "1", "method": "gettrafficshaping", "params": [] } - 响应: { "result": { "recvBurst": 10000, "recvAve": 1024 }, "error": null, "id": "1" }

ping

发送ping到所有其他节点来测试时间 - 请求: { "jsonrpc": "1.0", "id": "1", "method": "ping", "params": [] } - 响应: { "result": null, "error": null, "id": "1" }

pushtx "node"

推送未确认的交易到某个节点 - 请求参数: - node:必须,节点信息 - 请求: { "jsonrpc": "1.0", "id": "1", "method": "pushtx", "params": ["124.236.118.112:63335"] } - 响应: { "result": null, "error": null, "id": "1" }

setban "ip(/netmask)" "add|remove" (bantime) (absolute)

从禁止列表添加或者删除节点 - 请求参数: - ip(/netmask):必须,IP信息 - command:必须,add|remove表示添加或删除 - bantime:可选参数,禁止的时间(秒为单位) - absolute:可选参数,true|false,如果设置了,则bantime必须是个绝对时间戳 - 请求: { "jsonrpc": "1.0", "id": "1", "method": "setban", "params": ["192.168.0.6", "add", 86400] } - 响应: { "result": null, "error": null, "id": "1" }

setexcessiveblock blockSize acceptDepth

getexcessiveblock对应 - 请求参数: - blockSize:必须,待验证的十六进制区块数据 - acceptDepth:必须,待验证的十六进制区块数据 - 请求: { "jsonrpc": "1.0", "id": "1", "method": "setexcessiveblock", "params": [320000000, 10] } - 响应: { "result": "Excessive Block set to 320000000 bytes. Accept Depth set to 10 blocks.", "error": null, "id": "1" }

settrafficshaping "send|receive" "burstKB" "averageKB"

gettrafficshaping对应,设置网络发送和接收的带宽设置信息,单位为kb/s
- 请求参数: - send|receive:必须,发送还是接收带宽 - burst:burst size - average: 平均吞吐量 - 请求: { "jsonrpc": "1.0", "id": "1", "method": "settrafficshaping", "params": ["receive", 10000, 1024] } - 响应: { "result": null, "error": null, "id": "1" }

Rawtransactions

createrawtransaction [{"txid":"id","vout":n},...] {"address":amount,"data":"hex",...} (locktime)

创建待发送交易 - 请求参数: - transactions:必须,交易信息,结构如下: [ "txid": "id", "vout": n, "sequence": n ] - outputs:必须,输入结构: { "address": x.xxx, "data": "hex", ... } - 请求:

  • 响应:

decoderawtransaction "hexstring"

  • 请求参数:
  • hexstring:必须,交易的十六进制数据
  • 请求
  • 响应

decodescript "hex"

  • 请求参数:
  • hex:必须,十六进制的加密script
  • 请求:
  • 响应:

enqueuerawtransaction "hexstring" (options)

  • 请求参数:
  • hexstring:必须,交易的十六进制数据
  • options:可选参数
  • 请求:
  • 响应:

fundrawtransaction "hexstring" includeWatching

  • 请求参数:
  • hexstring:必须,交易的十六进制数据
  • includeWatching:可选参数,默认为false
  • 请求:
  • 响应:

getrawblocktransactions

  • 请求:
  • 响应:

getrawtransaction "txid" (verbose "blockhash")

获取交易的具体信息 - 请求参数: - txid:必须,交易ID - verbose:可选参数,默认为false,返回为string,否认则是json对象 - blockhash:可选参数,指定查找的区块 - 请求: { "jsonrpc": "1.0", "id": "1", "method": "getrawtransaction", "params": ["7b100c6083f8e6250f9dbc3585653b903cbae81dd7d0012b0be30bc8b3912570", true] } - 响应: { "result": { "txid": "7b100c6083f8e6250f9dbc3585653b903cbae81dd7d0012b0be30bc8b3912570", "size": 1431, "version": 1, "locktime": 2125, "vin": [ { "txid": "22431db4891113f329ba9220198a939a15ff6e75a07dfeba7a0f9ee26626b27f", "vout": 1, "scriptSig": { "asm": "30440220108ff7250b765dc3dd7468b3f4c9a42b86eb5c75fbc0c6eb1e4679bef7d64b590220686efd5868ded0e6ac24a712d86f09e4af9d8be0f82fe8f8a4032ae2d7e70f57[ALL|FORKID]", "hex": "4730440220108ff7250b765dc3dd7468b3f4c9a42b86eb5c75fbc0c6eb1e4679bef7d64b590220686efd5868ded0e6ac24a712d86f09e4af9d8be0f82fe8f8a4032ae2d7e70f5741" }, "sequence": 4294967294 }, { "txid": "46dab0ef38ff8b8f8a075a7c18bd038ec55676b7b50bdb6e95eb9cdb3af80cb0", "vout": 2, "scriptSig": { "asm": "3044022051dae81547873cb1876d15a5d66ccd60ab84c90fd88c31ff9e0edb09b5aa7be302202ee792428449d5840030174ea129e0e59b8b24e56d2a3f79843f690d8e0a18e9[ALL|FORKID] 02811486c03f3a99c5820b43039f72f9e1b728b45c611b860cd994de3c9100ae69", "hex": "473044022051dae81547873cb1876d15a5d66ccd60ab84c90fd88c31ff9e0edb09b5aa7be302202ee792428449d5840030174ea129e0e59b8b24e56d2a3f79843f690d8e0a18e9412102811486c03f3a99c5820b43039f72f9e1b728b45c611b860cd994de3c9100ae69" }, "sequence": 4294967294 }, { "txid": "82f042d7f3c92a2430e3f32571984124c0422de9842d1c58c0ca6402fe51579e", "vout": 0, "scriptSig": { "asm": "3045022100b9bc48c74b076e143d25b2d364a47a07f7171a60cfe442162fd85b89ccb138b602203e2ac4e9bce5f0bb73fdf7ce8138b6b5e953e97cc2b0ca40a0330f9a9bacd3e2[ALL|FORKID] 02811486c03f3a99c5820b43039f72f9e1b728b45c611b860cd994de3c9100ae69", "hex": "483045022100b9bc48c74b076e143d25b2d364a47a07f7171a60cfe442162fd85b89ccb138b602203e2ac4e9bce5f0bb73fdf7ce8138b6b5e953e97cc2b0ca40a0330f9a9bacd3e2412102811486c03f3a99c5820b43039f72f9e1b728b45c611b860cd994de3c9100ae69" }, "sequence": 4294967294 }, { "txid": "82f042d7f3c92a2430e3f32571984124c0422de9842d1c58c0ca6402fe51579e", "vout": 1, "scriptSig": { "asm": "0 30440220768d5388432dd32f047a66778636621dab1da754b2a5ec186356395147f8787f02206682ee90b13362ba4aa5ca37d4aed98f9475093e52318f681b2a804bc81da015[ALL|FORKID] 30440220526ba2d31d9a7f2aaa6a4f989c756301a16d05bfd755457b9de9b31cca5ba6710220169447a3b46c440eb264a3d685caa1b26ccbfc12975685b93d6909969f2cfa0a[ALL|FORKID] 52210210efa95a1cf54fa8719fd9bed4038ecfbd93890bd2b078475ef312dd0c66965821034bcc067f778129a9140a12c9d17c72b733dc3577e9e99a821746972c9b481ed82102811486c03f3a99c5820b43039f72f9e1b728b45c611b860cd994de3c9100ae6953ae", "hex": "004730440220768d5388432dd32f047a66778636621dab1da754b2a5ec186356395147f8787f02206682ee90b13362ba4aa5ca37d4aed98f9475093e52318f681b2a804bc81da015414730440220526ba2d31d9a7f2aaa6a4f989c756301a16d05bfd755457b9de9b31cca5ba6710220169447a3b46c440eb264a3d685caa1b26ccbfc12975685b93d6909969f2cfa0a414c6952210210efa95a1cf54fa8719fd9bed4038ecfbd93890bd2b078475ef312dd0c66965821034bcc067f778129a9140a12c9d17c72b733dc3577e9e99a821746972c9b481ed82102811486c03f3a99c5820b43039f72f9e1b728b45c611b860cd994de3c9100ae6953ae" }, "sequence": 4294967294 }, { "txid": "2009b1f8c23da950b0a9e57641046ce7902f9bf81a7c9fdf0f00f84d43b2904d", "vout": 0, "scriptSig": { "asm": "304402207306ea279c3ddd7c772fdbb59ac347be022d17a44969ea6b232004ec5d8c130602201515e418716103d533833b9d60845fd25ea98ebb6bbde8fa55e3e89d19d8befb[ALL|FORKID] 0348e7a0d3ca54077fc46df4642a03153d6677231fbd01fb5f6543b678cbd16c6c", "hex": "47304402207306ea279c3ddd7c772fdbb59ac347be022d17a44969ea6b232004ec5d8c130602201515e418716103d533833b9d60845fd25ea98ebb6bbde8fa55e3e89d19d8befb41210348e7a0d3ca54077fc46df4642a03153d6677231fbd01fb5f6543b678cbd16c6c" }, "sequence": 4294967294 }, { "txid": "be099aa6f0f5f1d5e01832d58db1c2a6b612acb0d5e64cf51072b0f0e7c4fc69", "vout": 1, "scriptSig": { "asm": "304402207f84d16e1786e0a8b38ebd08276653f37de1c1fdfdeb53c45346db59482b1b7e02203e4a757313d7dd18e65be28d32ff94cc135c2cda450f141e2b45a97904f230c8[ALL|FORKID]", "hex": "47304402207f84d16e1786e0a8b38ebd08276653f37de1c1fdfdeb53c45346db59482b1b7e02203e4a757313d7dd18e65be28d32ff94cc135c2cda450f141e2b45a97904f230c841" }, "sequence": 4294967294 }, { "txid": "274ba89adb21f06fec21f44e946979f439f74a53e59f9aed96172efd67a9ab47", "vout": 1, "scriptSig": { "asm": "3045022100cf4c90d9596acdf88c4f3a0c4cefc7d1ab95da780f00616286203ebcc59552bc02201b6f95d3d41d9a85e1873940a3cd7e105df5428cbc7fab505d8889ef505da1a7[ALL|FORKID]", "hex": "483045022100cf4c90d9596acdf88c4f3a0c4cefc7d1ab95da780f00616286203ebcc59552bc02201b6f95d3d41d9a85e1873940a3cd7e105df5428cbc7fab505d8889ef505da1a741" }, "sequence": 4294967294 }, { "txid": "f45a7538fc071c84c70d4a7e0d220a3e4b62fcdf4fe8822e5c5ca7ed0a8b4700", "vout": 1, "scriptSig": { "asm": "3044022058748083d042e8eba80002e0eba186934db13748eb5a79d42090c8075e06dad502202d02807c6f1d617be4255cf98fda98375e0f11826d0fc4559700058949944e3a[ALL|FORKID]", "hex": "473044022058748083d042e8eba80002e0eba186934db13748eb5a79d42090c8075e06dad502202d02807c6f1d617be4255cf98fda98375e0f11826d0fc4559700058949944e3a41" }, "sequence": 4294967294 }, { "txid": "d1f6185e2793abf916ad86cd4b16fc4d1f0b961a1f70b18cfbca2af21aeb5d48", "vout": 1, "scriptSig": { "asm": "3044022014b5e094560582787b4304b97d530bae895a0a1e7f52692097bae09be4b4a33802202edc06060221a8f7b4e93865329d0acee35e6bbb1175b428024480e2468981ed[ALL|FORKID]", "hex": "473044022014b5e094560582787b4304b97d530bae895a0a1e7f52692097bae09be4b4a33802202edc06060221a8f7b4e93865329d0acee35e6bbb1175b428024480e2468981ed41" }, "sequence": 4294967294 } ], "vout": [ { "value": 50, "n": 0, "scriptPubKey": { "asm": "OP_DUP OP_HASH160 e156d8f45865a44cc689b4ac5b63d0534be15f21 OP_EQUALVERIFY OP_CHECKSIG", "hex": "76a914e156d8f45865a44cc689b4ac5b63d0534be15f2188ac", "reqSigs": 1, "type": "pubkeyhash", "addresses": [ "1MYV5RxyXiPDR7vtdVhUKBXcVzwx5sFoMP" ] } }, { "value": 0.00000546, "n": 1, "scriptPubKey": { "asm": "OP_DUP OP_HASH160 e156d8f45865a44cc689b4ac5b63d0534be15f21 OP_EQUALVERIFY OP_CHECKSIG", "hex": "76a914e156d8f45865a44cc689b4ac5b63d0534be15f2188ac", "reqSigs": 1, "type": "pubkeyhash", "addresses": [ "1MYV5RxyXiPDR7vtdVhUKBXcVzwx5sFoMP" ] } }, { "value": 0.17420841, "n": 2, "scriptPubKey": { "asm": "OP_DUP OP_HASH160 e156d8f45865a44cc689b4ac5b63d0534be15f21 OP_EQUALVERIFY OP_CHECKSIG", "hex": "76a914e156d8f45865a44cc689b4ac5b63d0534be15f2188ac", "reqSigs": 1, "type": "pubkeyhash", "addresses": [ "1MYV5RxyXiPDR7vtdVhUKBXcVzwx5sFoMP" ] } }, { "value": 0, "n": 3, "scriptPubKey": { "asm": "OP_RETURN 64636f70010001", "hex": "6a0764636f70010001", "type": "nulldata" } } ], "blockhash": "5c46d6c84f11fa3730ae82497ae1e26a230f99e561b231a0b3ee4ef0921599f2", "confirmations": 31, "time": 1563347295, "blocktime": 1563347295, "hex": "01000000097fb22666e29e0f7abafe7da0756eff159a938a192092ba29f3131189b41d432201000000484730440220108ff7250b765dc3dd7468b3f4c9a42b86eb5c75fbc0c6eb1e4679bef7d64b590220686efd5868ded0e6ac24a712d86f09e4af9d8be0f82fe8f8a4032ae2d7e70f5741feffffffb00cf83adb9ceb956edb0bb5b77656c58e03bd187c5a078a8f8bff38efb0da46020000006a473044022051dae81547873cb1876d15a5d66ccd60ab84c90fd88c31ff9e0edb09b5aa7be302202ee792428449d5840030174ea129e0e59b8b24e56d2a3f79843f690d8e0a18e9412102811486c03f3a99c5820b43039f72f9e1b728b45c611b860cd994de3c9100ae69feffffff9e5751fe0264cac0581c2d84e92d42c02441987125f3e330242ac9f3d742f082000000006b483045022100b9bc48c74b076e143d25b2d364a47a07f7171a60cfe442162fd85b89ccb138b602203e2ac4e9bce5f0bb73fdf7ce8138b6b5e953e97cc2b0ca40a0330f9a9bacd3e2412102811486c03f3a99c5820b43039f72f9e1b728b45c611b860cd994de3c9100ae69feffffff9e5751fe0264cac0581c2d84e92d42c02441987125f3e330242ac9f3d742f08201000000fc004730440220768d5388432dd32f047a66778636621dab1da754b2a5ec186356395147f8787f02206682ee90b13362ba4aa5ca37d4aed98f9475093e52318f681b2a804bc81da015414730440220526ba2d31d9a7f2aaa6a4f989c756301a16d05bfd755457b9de9b31cca5ba6710220169447a3b46c440eb264a3d685caa1b26ccbfc12975685b93d6909969f2cfa0a414c6952210210efa95a1cf54fa8719fd9bed4038ecfbd93890bd2b078475ef312dd0c66965821034bcc067f778129a9140a12c9d17c72b733dc3577e9e99a821746972c9b481ed82102811486c03f3a99c5820b43039f72f9e1b728b45c611b860cd994de3c9100ae6953aefeffffff4d90b2434df8000fdf9f7c1af89b2f90e76c044176e5a9b050a93dc2f8b10920000000006a47304402207306ea279c3ddd7c772fdbb59ac347be022d17a44969ea6b232004ec5d8c130602201515e418716103d533833b9d60845fd25ea98ebb6bbde8fa55e3e89d19d8befb41210348e7a0d3ca54077fc46df4642a03153d6677231fbd01fb5f6543b678cbd16c6cfeffffff69fcc4e7f0b07210f54ce6d5b0ac12b6a6c2b18dd53218e0d5f1f5f0a69a09be010000004847304402207f84d16e1786e0a8b38ebd08276653f37de1c1fdfdeb53c45346db59482b1b7e02203e4a757313d7dd18e65be28d32ff94cc135c2cda450f141e2b45a97904f230c841feffffff47aba967fd2e1796ed9a9fe5534af739f47969944ef421ec6ff021db9aa84b270100000049483045022100cf4c90d9596acdf88c4f3a0c4cefc7d1ab95da780f00616286203ebcc59552bc02201b6f95d3d41d9a85e1873940a3cd7e105df5428cbc7fab505d8889ef505da1a741feffffff00478b0aeda75c5c2e82e84fdffc624b3e0a220d7e4a0dc7841c07fc38755af40100000048473044022058748083d042e8eba80002e0eba186934db13748eb5a79d42090c8075e06dad502202d02807c6f1d617be4255cf98fda98375e0f11826d0fc4559700058949944e3a41feffffff485deb1af22acafb8cb1701f1a960b1f4dfc164bcd86ad16f9ab93275e18f6d10100000048473044022014b5e094560582787b4304b97d530bae895a0a1e7f52692097bae09be4b4a33802202edc06060221a8f7b4e93865329d0acee35e6bbb1175b428024480e2468981ed41feffffff0400f2052a010000001976a914e156d8f45865a44cc689b4ac5b63d0534be15f2188ac22020000000000001976a914e156d8f45865a44cc689b4ac5b63d0534be15f2188ac29d20901000000001976a914e156d8f45865a44cc689b4ac5b63d0534be15f2188ac0000000000000000096a0764636f700100014d080000" }, "error": null, "id": "1" }

getrawtransactionssince

  • 请求参数:
  • -v|--verbose:可选参数,默认为false
  • hashblock:必须,区块的hash
  • count:可选参数,默认为1
  • protocol_id:可选参数
  • 请求: { "jsonrpc": "1.0", "id": "1", "method": "getrawtransactionssince", "params": ["-v", "79973d51e6004582cc27f34f2ca8354bd5236f8c8322cfad65a760ace04dbc51", 10] }
  • 响应: { "result": { "79973d51e6004582cc27f34f2ca8354bd5236f8c8322cfad65a760ace04dbc51": { "d1f9f973d501e0cbe7cc6c5f1a1ca948403bd7f7688678010696f8f15578568e": { "hex": "01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff1402710804f0edb8300b2f454233322f414431322fffffffff02008c86470000000017a914ae6b7287280d25f76c43dab1350b94b6163b63ee870008af2f00000000232103937c40db665c816e18cb5e18d151fa7f1ddbbcea511c8bfb7b37b399417ededaac00000000", "txid": "d1f9f973d501e0cbe7cc6c5f1a1ca948403bd7f7688678010696f8f15578568e", "size": 147, "version": 1, "locktime": 0, "vin": [ { "coinbase": "02710804f0edb8300b2f454233322f414431322f", "sequence": 4294967295 } ], "vout": [ { "value": 12, "n": 0, "scriptPubKey": { "asm": "OP_HASH160 ae6b7287280d25f76c43dab1350b94b6163b63ee OP_EQUAL", "hex": "a914ae6b7287280d25f76c43dab1350b94b6163b63ee87", "reqSigs": 1, "type": "scripthash", "addresses": [ "3HbGDVmFcxCQJGUVQH46fbrwJEk8VBDBU3" ] } }, { "value": 8, "n": 1, "scriptPubKey": { "asm": "03937c40db665c816e18cb5e18d151fa7f1ddbbcea511c8bfb7b37b399417ededa OP_CHECKSIG", "hex": "2103937c40db665c816e18cb5e18d151fa7f1ddbbcea511c8bfb7b37b399417ededaac", "reqSigs": 1, "type": "pubkey", "addresses": [ "125iwSheqz1JUmpUVcb53oPD6sjcMkYWVG" ] } } ], "blockhash": "79973d51e6004582cc27f34f2ca8354bd5236f8c8322cfad65a760ace04dbc51", "confirmations": 3, "time": 1563351698, "blocktime": 1563351698 } }, "164eb4fd56acbe411e1ea1208e4b64f5717c012313e451b1496f8d51356de9c8": { "8b3745c5625b1158ddb2dfa3db20451e1be6dcbbacca17b84f706df9b8d09770": { "hex": "01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff15027208058a26b9f7170b2f454233322f414431322fffffffff02008c86470000000017a914ae6b7287280d25f76c43dab1350b94b6163b63ee870008af2f000000002321037ab83fe7aa473dbeefe2eeb26509cdbb84b5022156956c28a5bab9162160e038ac00000000", "txid": "8b3745c5625b1158ddb2dfa3db20451e1be6dcbbacca17b84f706df9b8d09770", "size": 148, "version": 1, "locktime": 0, "vin": [ { "coinbase": "027208058a26b9f7170b2f454233322f414431322f", "sequence": 4294967295 } ], "vout": [ { "value": 12, "n": 0, "scriptPubKey": { "asm": "OP_HASH160 ae6b7287280d25f76c43dab1350b94b6163b63ee OP_EQUAL", "hex": "a914ae6b7287280d25f76c43dab1350b94b6163b63ee87", "reqSigs": 1, "type": "scripthash", "addresses": [ "3HbGDVmFcxCQJGUVQH46fbrwJEk8VBDBU3" ] } }, { "value": 8, "n": 1, "scriptPubKey": { "asm": "037ab83fe7aa473dbeefe2eeb26509cdbb84b5022156956c28a5bab9162160e038 OP_CHECKSIG", "hex": "21037ab83fe7aa473dbeefe2eeb26509cdbb84b5022156956c28a5bab9162160e038ac", "reqSigs": 1, "type": "pubkey", "addresses": [ "13xYunxKZcKjtyCsWazm7Z29zL5VmVz2fZ" ] } } ], "blockhash": "164eb4fd56acbe411e1ea1208e4b64f5717c012313e451b1496f8d51356de9c8", "confirmations": 2, "time": 1563351788, "blocktime": 1563351788 } }, "17ee4f522c7d9f0029bb6f5fd770c349861220d310d2af2c7d6683f58ee934b7": { "0e76389c0e16a8c0fdf5ec74e275cd782dbc7b5e5d61552e0c53e8f1bb6054e9": { "hex": "01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff1802730808a1aec8fe4da5e0f90b2f454233322f414431322fffffffff02008c86470000000017a914ae6b7287280d25f76c43dab1350b94b6163b63ee870008af2f00000000232103d06612bab362b6ba3d1d891c1a58425fb38d77397a749489fc53d72d9cd8d0f6ac00000000", "txid": "0e76389c0e16a8c0fdf5ec74e275cd782dbc7b5e5d61552e0c53e8f1bb6054e9", "size": 151, "version": 1, "locktime": 0, "vin": [ { "coinbase": "02730808a1aec8fe4da5e0f90b2f454233322f414431322f", "sequence": 4294967295 } ], "vout": [ { "value": 12, "n": 0, "scriptPubKey": { "asm": "OP_HASH160 ae6b7287280d25f76c43dab1350b94b6163b63ee OP_EQUAL", "hex": "a914ae6b7287280d25f76c43dab1350b94b6163b63ee87", "reqSigs": 1, "type": "scripthash", "addresses": [ "3HbGDVmFcxCQJGUVQH46fbrwJEk8VBDBU3" ] } }, { "value": 8, "n": 1, "scriptPubKey": { "asm": "03d06612bab362b6ba3d1d891c1a58425fb38d77397a749489fc53d72d9cd8d0f6 OP_CHECKSIG", "hex": "2103d06612bab362b6ba3d1d891c1a58425fb38d77397a749489fc53d72d9cd8d0f6ac", "reqSigs": 1, "type": "pubkey", "addresses": [ "1LJ9EiaopwLVcvXMzV7DddeJQ7FyarDrFg" ] } } ], "blockhash": "17ee4f522c7d9f0029bb6f5fd770c349861220d310d2af2c7d6683f58ee934b7", "confirmations": 1, "time": 1563351840, "blocktime": 1563351840 } } }, "error": null, "id": "1" }

sendrawtransaction "hexstring" (allowhighfees, allownonstandard)

将交易提交给本地节点和网络。 - 请求参数: - hexstring (string, required) The hex string of the raw transaction) - allowhighfees (boolean, optional, default=false) Allow high fees - allownonstandard:可选参数,默认为default ('standard', 'nonstandard', 'default') - 请求:

  • 响应:

signrawtransaction "hexstring" ([{"txid":"id","vout":n,"scriptPubKey":"hex","redeemScript":"hex"},...] ["privatekey1",...] sighashtype)

Sign inputs for raw transaction (serialized, hex-encoded). The second optional argument (may be null) is an array of previous transaction outputs that this transaction depends on but may not yet be in the block chain. The third optional argument (may be null) is an array of base58-encoded private keys that, if given, will be the only keys used to sign the transaction. - 请求参数: - hexstring (string, required) The transaction hex string - prevtxs (string, optional) An json array of previous dependent transaction outputs [ { "txid": "id", "vout": n, "scriptPubKey": "hex", "redeemScript": "hex", "amount": value }, ... ] - privkeys (string, optional) A json array of base58-encoded private keys for signing [ “privatekey” (string) private key in base58-encoding ,… ] - sighashtype (string, optional, default=ALL) The signature hash type. Must be one of: “ALL” “NONE” “SINGLE” “ALL|ANYONECANPAY” “NONE|ANYONECANPAY” “SINGLE|ANYONECANPAY”

  • 请求:
  • 响应:

Util

createmultisig nrequired ["key",...]

创建一个需要m个密钥的n个签名的多签名地址 它返回一个具有地址和redeemScript的json对象 - 请求参数: - nrequired (numeric, required) The number of required signatures out of the n keys or addresses. - keys (string, required) A json array of keys which are qtum addresses or hex-encoded public keys - 请求: { "jsonrpc":"1.0", "id":"1", "method":"createmultisig", "params":[3,["0210efa95a1cf54fa8719fd9bed4038ecfbd93890bd2b078475ef312dd0c669658","034bcc067f778129a9140a12c9d17c72b733dc3577e9e99a821746972c9b481ed8","02811486c03f3a99c5820b43039f72f9e1b728b45c611b860cd994de3c9100ae69"]] } - 响应: { "result": { "address": "3LBb4FzY4UosrKkhcbbY2bVbvcbaKN9pGs", "redeemScript": "53210210efa95a1cf54fa8719fd9bed4038ecfbd93890bd2b078475ef312dd0c66965821034bcc067f778129a9140a12c9d17c72b733dc3577e9e99a821746972c9b481ed82102811486c03f3a99c5820b43039f72f9e1b728b45c611b860cd994de3c9100ae6953ae" }, "error": null, "id": "1" }

estimatefee nblocks

交易费用的估算,单位为每KB - nblocks (numeric, required) - 请求: { "jsonrpc": "1.0", "id": "1", "method": "estimatefee", "params": [6] } - 响应: { "result": -1, "error": null, "id": "1" }

get

获取配置信息,默认获取所有,也可指定具体配置 configuration - 请求: { "jsonrpc": "1.0", "id": "1", "method": "get", "params": [] } - 响应: { "result": { "blockchain.checkScriptDays": 30, "consensus.enableCanonicalTxOrder": false, "consensus.forkMay2019Time": 0, "consensus.maxScriptOps": 201, "consensus.svForkNov2018Time": 0, "maxlimitertxfee": 1, "mining.blockSize": 8000000, "mining.coinbaseReserve": 1000, "mining.comment": "diskcoin is fundamentally emergent consensus", "mining.dataCarrierSize": 223, "mining.excessiveSigopsPerMb": 20000, "mining.unsafeGetBlockTemplate": false, "mining.vote": "", "minlimitertxfee": 1, "net.blockDownloadWindow": 0, "net.blockRetryInterval": 5000000, "net.dustThreshold": 546, "net.excessiveAcceptDepth": 12, "net.excessiveBlock": 32000000, "net.excessiveSigopsPerMb": 20000, "net.excessiveTx": 1000000, "net.grapheneFastFilterCompatibility": 0, "net.grapheneMaxVersionSupported": 4, "net.grapheneMinVersionSupported": 0, "net.ignoreTimeouts": false, "net.magic": 0, "net.maxBlocksInTransitPerPeer": 0, "net.maxConnections": 125, "net.maxOutboundConnections": 16, "net.minXthinNodes": 8, "net.msgHandlerThreads": 2, "net.subversionOverride": "", "net.txAdmissionThreads": 2, "net.txRetryInterval": 5000000, "prune.pruneInterval": 100, "reindex.typicalBlockSize": 200000, "wallet.maxTxFee": 10000000 }, "error": null, "id": "1" }

getaddressforms "address"

  • 请求参数:
  • address:必须,地址信息
  • 请求 : { "jsonrpc": "1.0", "id": "1", "method": "getaddressforms", "params": ["1BVz4apEjytvTKCHUU9TANQye1m7MCqZsy"] }
  • 响应: { "result": { "legacy": "1BVz4apEjytvTKCHUU9TANQye1m7MCqZsy", "diskcoin": "disc:qpejezvuxwer2j7cy36cudalegqv4ea7vuxysq5gtj", "bitpay": "CSxsddAJd2sTMT6iADUNjt31G8yXEnNK3k" }, "error": null, "id": "1" }

getstat

  • 请求参数:
  • statistic:必须,需要获取的某个具体统计信息(用getstatlist命令获取)
  • -v|--verbose:可选参数,是否全部详细信息
  • series:可选参数("total", "now","all", "sec10", "min5", "hourly", "daily","monthly")
  • count:可选参数,返回的个数
  • 请求: { "jsonrpc": "1.0", "id": "1", "method": "getstat", "params": ["memPool/size"] }
  • 响应: { "result": [ { "total": 1272 } ], "error": null, "id": "1" }

getstatlist

返回该节点上所有可用的统计信息 - 请求: { "jsonrpc": "1.0", "id": "1", "method": "getstatlist", "params": [] } - 响应: { "result": [ "blockValidationTime", "memPool/size", "memPool/txAdded", "net/recv/msg/Xb", "net/recv/msg/Xt", "net/recv/msg/addr", "net/recv/msg/blacklist", "net/recv/msg/block", "net/recv/msg/blocktxn", "net/recv/msg/buverack", "net/recv/msg/buversion", "net/recv/msg/cmpctblock", "net/recv/msg/filteradd", "net/recv/msg/filterclear", "net/recv/msg/filterload", "net/recv/msg/filtersizext", "net/recv/msg/get_grblk", "net/recv/msg/get_grblktx", "net/recv/msg/get_thin", "net/recv/msg/get_xblocktx", "net/recv/msg/get_xthin", "net/recv/msg/getaddr", "net/recv/msg/getblocks", "net/recv/msg/getblocktxn", "net/recv/msg/getdata", "net/recv/msg/getheaders", "net/recv/msg/grblk", "net/recv/msg/grblktx", "net/recv/msg/headers", "net/recv/msg/inv", "net/recv/msg/mempool", "net/recv/msg/merkleblock", "net/recv/msg/notfound", "net/recv/msg/ping", "net/recv/msg/pong", "net/recv/msg/reject", "net/recv/msg/req_xpedited", "net/recv/msg/sendcmpct", "net/recv/msg/sendheaders", "net/recv/msg/thinblock", "net/recv/msg/tx", "net/recv/msg/verack", "net/recv/msg/version", "net/recv/msg/xblocktx", "net/recv/msg/xthinblock", "net/recv/msg/xupdate", "net/recv/msg/xverack", "net/recv/msg/xversion", "net/recv/total", "net/send/msg/Xb", "net/send/msg/Xt", "net/send/msg/addr", "net/send/msg/blacklist", "net/send/msg/block", "net/send/msg/blocktxn", "net/send/msg/buverack", "net/send/msg/buversion", "net/send/msg/cmpctblock", "net/send/msg/filteradd", "net/send/msg/filterclear", "net/send/msg/filterload", "net/send/msg/filtersizext", "net/send/msg/get_grblk", "net/send/msg/get_grblktx", "net/send/msg/get_thin", "net/send/msg/get_xblocktx", "net/send/msg/get_xthin", "net/send/msg/getaddr", "net/send/msg/getblocks", "net/send/msg/getblocktxn", "net/send/msg/getdata", "net/send/msg/getheaders", "net/send/msg/grblk", "net/send/msg/grblktx", "net/send/msg/headers", "net/send/msg/inv", "net/send/msg/mempool", "net/send/msg/merkleblock", "net/send/msg/notfound", "net/send/msg/ping", "net/send/msg/pong", "net/send/msg/reject", "net/send/msg/req_xpedited", "net/send/msg/sendcmpct", "net/send/msg/sendheaders", "net/send/msg/thinblock", "net/send/msg/tx", "net/send/msg/verack", "net/send/msg/version", "net/send/msg/xblocktx", "net/send/msg/xthinblock", "net/send/msg/xupdate", "net/send/msg/xverack", "net/send/msg/xversion", "net/send/total", "node/ip121.28.160.158p63335/blocksSent", "node/ip121.28.160.158p63335/bytesReceived", "node/ip121.28.160.158p63335/bytesSent", "node/ip121.28.160.158p63335/firstBlock", "node/ip121.28.160.158p63335/firstTx", "node/ip121.28.160.158p63335/recvGap", "node/ip121.28.160.158p63335/sendGap", "node/ip121.28.160.158p63335/txLatency", "node/ip121.28.160.158p63335/txsSent", "node/ip124.236.118.112p63335/blocksSent", "node/ip124.236.118.112p63335/bytesReceived", "node/ip124.236.118.112p63335/bytesSent", "node/ip124.236.118.112p63335/firstBlock", "node/ip124.236.118.112p63335/firstTx", "node/ip124.236.118.112p63335/recvGap", "node/ip124.236.118.112p63335/sendGap", "node/ip124.236.118.112p63335/txLatency", "node/ip124.236.118.112p63335/txsSent", "node/ip127.0.0.1p0/blocksSent", "node/ip127.0.0.1p0/bytesReceived", "node/ip127.0.0.1p0/bytesSent", "node/ip127.0.0.1p0/firstBlock", "node/ip127.0.0.1p0/firstTx", "node/ip127.0.0.1p0/recvGap", "node/ip127.0.0.1p0/sendGap", "node/ip127.0.0.1p0/txLatency", "node/ip127.0.0.1p0/txsSent", "node/ip194.33.38.214p63335/blocksSent", "node/ip194.33.38.214p63335/bytesReceived", "node/ip194.33.38.214p63335/bytesSent", "node/ip194.33.38.214p63335/firstBlock", "node/ip194.33.38.214p63335/firstTx", "node/ip194.33.38.214p63335/recvGap", "node/ip194.33.38.214p63335/sendGap", "node/ip194.33.38.214p63335/txLatency", "node/ip194.33.38.214p63335/txsSent", "node/ip205.185.120.91p63335/blocksSent", "node/ip205.185.120.91p63335/bytesReceived", "node/ip205.185.120.91p63335/bytesSent", "node/ip205.185.120.91p63335/firstBlock", "node/ip205.185.120.91p63335/firstTx", "node/ip205.185.120.91p63335/recvGap", "node/ip205.185.120.91p63335/sendGap", "node/ip205.185.120.91p63335/txLatency", "node/ip205.185.120.91p63335/txsSent", "node/ip27.102.134.180p63335/blocksSent", "node/ip27.102.134.180p63335/bytesReceived", "node/ip27.102.134.180p63335/bytesSent", "node/ip27.102.134.180p63335/firstBlock", "node/ip27.102.134.180p63335/firstTx", "node/ip27.102.134.180p63335/recvGap", "node/ip27.102.134.180p63335/sendGap", "node/ip27.102.134.180p63335/txLatency", "node/ip27.102.134.180p63335/txsSent", "node/ip27.102.134.181p63335/blocksSent", "node/ip27.102.134.181p63335/bytesReceived", "node/ip27.102.134.181p63335/bytesSent", "node/ip27.102.134.181p63335/firstBlock", "node/ip27.102.134.181p63335/firstTx", "node/ip27.102.134.181p63335/recvGap", "node/ip27.102.134.181p63335/sendGap", "node/ip27.102.134.181p63335/txLatency", "node/ip27.102.134.181p63335/txsSent", "node/ip47.91.209.206p63335/blocksSent", "node/ip47.91.209.206p63335/bytesReceived", "node/ip47.91.209.206p63335/bytesSent", "node/ip47.91.209.206p63335/firstBlock", "node/ip47.91.209.206p63335/firstTx", "node/ip47.91.209.206p63335/recvGap", "node/ip47.91.209.206p63335/sendGap", "node/ip47.91.209.206p63335/txLatency", "node/ip47.91.209.206p63335/txsSent", "reqMgr/dropped", "reqMgr/inFlight", "reqMgr/pending", "reqMgr/received", "reqMgr/rejected", "txValidationTime" ], "error": null, "id": "1" }

log "category|all" "on|off"

  • 请求参数:
  • category|all:所有或者某个category
  • on|off
  • 请求: { "jsonrpc": "1.0", "id": "1", "method": "log", "params": ["NET", "off"] }
  • 响应: { "result": "", "error": null, "id": "1" }

logline 'string'

  • 请求参数:
  • string:必须,日志信息
  • 请求: { "jsonrpc": "1.0", "id": "1", "method": "logline", "params": ["this is a test"] }
  • 响应: { "result": null, "error": null, "id": "1" }

set

get方法对应,设置配置信息 - 请求参数: - <configuration setting name>=<value>:必须,配置和值的键值对 - 请求: { "jsonrpc": "1.0", "id": "1", "method": "set", "params": ["blockchain.checkScriptDays=20", "consensus.maxScriptOps=202"] } - 响应: { "result": null, "error": null, "id": "1" }

validateaddress "diskcoinaddress"

返回diskcoin地址相应的信息 - 请求参数: - diskcoinaddress:必须,待验证的diskcoin地址 - 请求: { "jsonrpc": "1.0", "id": "1", "method": "validateaddress", "params": ["1BVz4apEjytvTKCHUU9TANQye1m7MCqZsy"] } - 响应: { "result": { "isvalid": true, "address": "1BVz4apEjytvTKCHUU9TANQye1m7MCqZsy", "scriptPubKey": "76a914732c899c33b2354bd824758e37bfca00cae7be6788ac", "ismine": true, "iswatchonly": false, "isscript": false, "pubkey": "03bbcab6f50f0010db37e2d1a74ef6807f722b59c8e62736df1d47b06b5f30393c", "iscompressed": true, "account": "" }, "error": null, "id": "1" }

validatechainhistory [hash]

  • 请求参数:
  • hash:必须,区块的hash值
  • 请求: { "jsonrpc": "1.0", "id": "1", "method": "validatechainhistory", "params": ["6e46a54a4ddcb2640796787570f97210daf1f896a38693ecd6c67d49bfb61619"] }
  • 响应: { "result": "Chain is ok", "error": null, "id": "1" }

verifymessage "diskcoinaddress" "signature" "message"

验证一个已签名的信息,由signmessage生成 - 请求参数: - diskcoinaddress:必须,Diskcoin地址 - signature:必须,签名 - message:必须,待签名的信息 - 请求: { "jsonrpc": "1.0", "id": "1", "method": "verifymessage", "params": ["1BVz4apEjytvTKCHUU9TANQye1m7MCqZsy", "IOMuqLnoFIVWUF94WaAKexX7lj6y09TxmJ09AMgKCsumYJiCK4psvegPIHZJWDKhPAzSTCoj/FkhdA0PN7GptJ8=", "my message"] } - 响应: { "result": true, "error": null, "id": "1" }

Wallet

abandontransaction "txid"

将钱包中的交易标记为abandoned,怎么查找符合条件的交易 - 请求参数: - txid:必须,交易ID - 请求:

  • 响应:

addmultisigaddress nrequired ["key",...] ("account")

  • 请求参数:
  • nrequired:必须,签名个数
  • keysboject:必须,diskcoin地址或者公钥 [ "address", ... ]
  • account:可选参数
  • 请求:
  • 响应:

backupwallet "destination"

备份钱包 - 请求参数: - destination:必须,目的文件夹或者文件 - 请求: { "jsonrpc": "1.0", "id": "1", "method": "backupwallet", "params": ["backup.dat"] } - 响应: 会在对应的路径下生成backup.data文件 { "result": null, "error": null, "id": "1" }

dumpprivkey "diskcoinaddress"

返回地址对应的私钥 - 请求参数: - diskcoinaddress:必须,私钥对应的Diskcoin地址 - 请求: { "jsonrpc": "1.0", "id": "1", "method": "dumpprivkey", "params": ["1BVz4apEjytvTKCHUU9TANQye1m7MCqZsy"] } - 响应: 返回为私钥值 { "result": "L2gBf1aQTmTBWDm2372tXHuPnEuAyS3G5bL1X7mWQgNTdhNpLr6B", "error": null, "id": "1" }

dumpwallet "filename"

  • 请求参数:
  • filename:必须,文件路径
  • 请求: { "jsonrpc": "1.0", "id": "1", "method": "dumpwallet", "params": ["test"] }
  • 响应: 会在对应的路径下生成test文件 { "result": null, "error": null, "id": "1" }

encryptwallet "passphrase"

用指定的密码加密钱包,该命令会关闭钱包服务 - 请求参数: - passphrase:必须,加密钱包的密钥 - 请求: { "jsonrpc": "1.0", "id": "1", "method": "encryptwallet", "params": ["my pass phrase"] } - 响应: { "result": "wallet encrypted; diskcoin server stopping, restart to run with encrypted wallet. The keypool has been flushed and a new HD seed was generated (if you are using HD). You need to make a new backup.", "error": null, "id": "1" }

getaccount "diskcoinaddress"

返回给定地址绑定的账户 - 请求参数: - diskcoinaddress:必须,diskcoin地址 - 请求: { "jsonrpc": "1.0", "id": "1", "method": "getaccount", "params": ["1BVz4apEjytvTKCHUU9TANQye1m7MCqZsy"] } - 响应: { "result": "", "error": null, "id": "1" }

getaccountaddress "account"

获取账户的当前收款地址 - 请求参数: - account:必须,账户名,可设置为""来表示默认账户 - 请求: { "jsonrpc": "1.0", "id": "1", "method": "getaccountaddress", "params": [""] } - 响应: { "result": "1BVz4apEjytvTKCHUU9TANQye1m7MCqZsy", "error": null, "id": "1" }

getaddressesbyaccount "account"

获取账户下所有的地址 - 请求参数: - account:必须,账户名 - 请求: { "jsonrpc": "1.0", "id": "1", "method": "getaddressesbyaccount", "params": [""] } - 响应: 返回和账户相关的diskcoin地址的列表 { "result": [ "1DU8fmXyrbTtRjxKvKu63nDL1hLZH5bRin", "1BVz4apEjytvTKCHUU9TANQye1m7MCqZsy", "1PdPq6rXijjDtHdPyewcdi6aVvQDteCPto", "1BdpB1ptShqGwGuyn3BJ9Dy4ixoWRpwoqy" ], "error": null, "id": "1" }

getbalance ("account" minconf includeWatchonly)

获取账户的余额 - 请求参数: - account:可选参数,选择的账户,"*"表示整个钱包,""表示默认账户 - minconf:可选参数,默认为1,需要满足的确认次数 - includeWatchonly:可选参数,默认为false - 请求: { "jsonrpc": "1.0", "id": "1", "method": "getbalance", "params": ["*", 5] } - 响应: { "result": 0.5, "error": null, "id": "1" }

getnewaddress ("account")

给账户生产一个新的收款地址 - 请求参数: - account:可选参数,默认账户为"" - 请求: { "jsonrpc": "1.0", "id": "1", "method": "getnewaddress", "params": [] } - 响应: { "result": "1DU8fmXyrbTtRjxKvKu63nDL1hLZH5bRin", "error": null, "id": "1" }

getrawchangeaddress

返回一个新的地址,用于raw transactions,不常用 - 请求: { "jsonrpc": "1.0", "id": "1", "method": "getrawchangeaddress", "params": [] } - 响应e: { "result": "12hSQ349p3yU1gaFqch1t8pazNbJzJaM2f", "error": null, "id": "1" }

getreceivedbyaccount "account" (minconf)

  • 请求参数:
  • account:必须,默认为""
  • minconf:可选参数,默认为1,交易的确认次数
  • 请求: { "jsonrpc": "1.0", "id": "1", "method": "getreceivedbyaccount", "params": [""] }
  • 响应: { "result": 0.5, "error": null, "id": "1" }

getreceivedbyaddress "diskcoinaddress" (minconf)

  • 请求参数:
  • diskcoinaddress:必须,交易的Diskcoin地址
  • minconf:可选参数,默认为1,交易的确认次数
  • 请求: { "jsonrpc": "1.0", "id": "1", "method": "getreceivedbyaddress", "params": ["1PdPq6rXijjDtHdPyewcdi6aVvQDteCPto"] }
  • 响应: { "result": 0, "error": null, "id": "1" }

gettransaction "txid" (includeWatchonly)

获取钱包中某个交易的详细信息 - 请求参数: - txid:必须,交易ID - includeWatchonly:可选参数,默认为false
- 请求: { "jsonrpc": "1.0", "id": "1", "method": "gettransaction", "params": ["53fac9b470e646c472948721552214b27bc75e9a0e19265acb5b53d8c7d51c0f"] } - 响应: { "result": { "satoshi": 50000000, "amount": 0.5, "confirmations": 62, "blockhash": "5c46d6c84f11fa3730ae82497ae1e26a230f99e561b231a0b3ee4ef0921599f2", "blockindex": 2, "blocktime": 1563347295, "txid": "53fac9b470e646c472948721552214b27bc75e9a0e19265acb5b53d8c7d51c0f", "walletconflicts": [], "time": 1563346822, "timereceived": 1563346822, "details": [ { "account": "", "address": "1BVz4apEjytvTKCHUU9TANQye1m7MCqZsy", "category": "receive", "satoshi": 50000000, "amount": 0.5, "label": "", "vout": 1 } ], "hex": "0100000001a8b39257eb3fd0ca72675693b137699f26b9dcdf947b77f43ac84c354feeec71010000004847304402200b8862001cf3d0b9b8e259b28a027c4f680f09f88e87d287b74716cd0a535244022035b35d054300ce19a031d35e36dee9a7c78da13193255096ff320c362dde273941feffffff029756a633000000001976a914e156d8f45865a44cc689b4ac5b63d0534be15f2188ac80f0fa02000000001976a914732c899c33b2354bd824758e37bfca00cae7be6788ac4d080000" }, "error": null, "id": "1" }

getunconfirmedbalance

获取服务器的所有未确认的余额 - 请求: { "jsonrpc": "1.0", "id": "1", "method": "getunconfirmedbalance", "params": [] } - 响应: { "result": 0.5, "error": null, "id": "1" }

getwalletinfo

获取钱包的一些状态信息 - 请求: { "jsonrpc": "1.0", "id": "1", "method": "getwalletinfo", "params": [] } - 响应: { "result": { "walletversion": 60000, "balance": 0, "unconfirmed_balance": 0.5, "immature_balance": 0, "txcount": 1, "keypoololdest": 1563271172, "keypoolsize": 10001, "unlocked_until": 0, "paytxfee": 0 }, "error": null, "id": "1" }

importaddress "address" ("label" rescan p2sh)

  • 请求参数:
  • address:必须,十六进制的script或者地址
  • lable:可选参数,默认为""
  • rescan:可选参数,默认为true,是否扫描钱包的交易
  • p2sh:可选参数,默认为false,是否添加P2SH
  • 请求:
  • 响应:

importaddresses [rescan | no-rescan] "address"...

  • 请求参数:
  • address:必须
  • rescan|no-rescan:可选参数
  • 请求:
  • 响应:

importprivatekeys [rescan | no-rescan] "diskcoinprivatekey"...

添加私钥到钱包中 - 请求参数: - rescan|no-rescan:可选参数,默认为rescan - diskcoinprivatekey:必须,私钥 (参考dumpprivkey) - 请求: { "jsonrpc": "1.0", "id": "1", "method": "importprivatekeys", "params": ["no-rescan", "L2gBf1aQTmTBWDm2372tXHuPnEuAyS3G5bL1X7mWQgNTdhNpLr6B"] } - 响应: { "result": null, "error": null, "id": "1" }

importprivkey "diskcoinprivkey" ("label" rescan)

  • 请求参数:
  • diskcoinprivatekey:必须,私钥 (参考dumpprivkey)
  • label:可选参数,默认为""
  • rescan:可选参数,默认为true
  • 请求: { "jsonrpc": "1.0", "id": "1", "method": "importprivkey", "params": ["L2gBf1aQTmTBWDm2372tXHuPnEuAyS3G5bL1X7mWQgNTdhNpLr6B", "my label", false] }
  • 响应: { "result": null, "error": null, "id": "1" }

importpubkey "pubkey" ("label" rescan)

  • 请求参数:
  • pubkey公钥
  • label:可选参数,默认为""
  • rescan:可选参数,默认为true
  • 请求:
  • 响应:

importwallet "filename"

  • 请求参数:
  • filename:必须,钱包文件
  • 请求: { "jsonrpc": "1.0", "id": "1", "method": "importwallet", "params": ["test"] }
  • 响应: { "result": null, "error": null, "id": "1" }

keypoolrefill (newsize)

  • 请求参数:
  • newsize:可选参数,默认100,新的keypool size
  • 请求: { "jsonrpc": "1.0", "id": "1", "method": "keypoolrefill", "params": [10000] }
  • 响应: { "result": null, "error": null, "id": "1" }

listaccounts (minconf includeWatchonly)

列举所有的账户信息 - 请求参数: - minconf:可选参数,默认为1,确认次数达到该值的交易 - includeWatchonly:可选参数,默认为false - 请求: { "jsonrpc": "1.0", "id": "1", "method": "listaccounts", "params": [] } - 响应: { "result": { "": 0, "my label": 0.5 }, "error": null, "id": "1" }

listaddressgroupings

  • 请求: { "jsonrpc": "1.0", "id": "1", "method": "listaddressgroupings", "params": [] }
  • 响应: { "result": [ [ [ "1BVz4apEjytvTKCHUU9TANQye1m7MCqZsy", 0.5, "my label" ] ] ], "error": null, "id": "1" }

validatechainhistory

  • 请求参数:
  • hash:必须,区块的hash值
  • 请求: { "jsonrpc": "1.0", "id": "1", "method": "validatechainhistory", "params": [] }
  • 响应: { "result": "Chain is ok", "error": null, "id": "1" }

listlockunspent

  • 请求: { "jsonrpc": "1.0", "id": "1", "method": "listlockunspent", "params": [] }
  • 响应: { "result": [], "error": null, "id": "1" }

listminedblock (minconf maxconf ["address",...])

  • 请求参数:
  • minconf:可选参数,默认为1
  • maxconf:可选参数,默认为9999999
  • addresses:地址列表
  • 请求: { "jsonrpc": "1.0", "id": "1", "method": "listminedblock", "params": [1, 5] }
  • 响应: { "result": [], "error": null, "id": "1" }

liststakein ( inconf maxconf ["address",...]

  • 请求参数:
  • minconf:可选参数,默认为1
  • maxconf:可选参数,默认为
  • addresses:地址列表
  • 请求: { "jsonrpc": "1.0", "id": "1", "method": "liststakein", "params": [1, 9999, ["1BVz4apEjytvTKCHUU9TANQye1m7MCqZsy"]] }
  • 响应: { "result": [], "error": null, "id": "1" }

liststakeout ( inconf maxconf ["address",...]

  • 请求参数:
  • minconf:可选参数,默认为1
  • maxconf:可选参数,默认为9999999
  • addresses:地址列表
  • 请求: { "jsonrpc": "1.0", "id": "1", "method": "liststakeout", "params": [1, 9999, ["1BVz4apEjytvTKCHUU9TANQye1m7MCqZsy"]] }
  • 响应: { "result": [], "error": null, "id": "1" }

listreceivedbyaccount (minconf includeempty includeWatchonly)

  • 请求参数:
  • minconf:可选参数,默认为1
  • includeempty:可选参数,默认为false,是否包含没有任何收款的账户
  • includeWatchonly:可选参数,默认为false,是否包含watchonly地址(参考importaddress
  • 请求: { "jsonrpc": "1.0", "id": "1", "method": "listreceivedbyaccount", "params": [1, true] }
  • 响应: { "result": [ { "account": "", "satoshi": 0, "amount": 0, "confirmations": 0 }, { "account": "my label", "satoshi": 50000000, "amount": 0.5, "confirmations": 66 } ], "error": null, "id": "1" }

listreceivedbyaddress (minconf includeempty includeWatchonly)

  • 请求参数:
  • minconf:可选参数,默认为1
  • includeempty:可选参数,默认为false,是否包含没有任何收款的账户
  • includeWatchonly:可选参数,默认为false,是否包含watchonly地址(参考importaddress
  • 请求: { "jsonrpc": "1.0", "id": "1", "method": "listreceivedbyaddress", "params": [1, true] }
  • 响应: { "result": [ { "address": "1DU8fmXyrbTtRjxKvKu63nDL1hLZH5bRin", "account": "", "satoshi": 0, "amount": 0, "confirmations": 0, "label": "", "txids": [] }, { "address": "1BVz4apEjytvTKCHUU9TANQye1m7MCqZsy", "account": "my label", "satoshi": 50000000, "amount": 0.5, "confirmations": 66, "label": "my label", "txids": [ "53fac9b470e646c472948721552214b27bc75e9a0e19265acb5b53d8c7d51c0f" ] }, { "address": "1PdPq6rXijjDtHdPyewcdi6aVvQDteCPto", "account": "", "satoshi": 0, "amount": 0, "confirmations": 0, "label": "", "txids": [] }, { "address": "1BdpB1ptShqGwGuyn3BJ9Dy4ixoWRpwoqy", "account": "", "satoshi": 0, "amount": 0, "confirmations": 0, "label": "", "txids": [] } ], "error": null, "id": "1" }

listsinceblock ("blockhash" target-confirmations includeWatchonly)

  • 请求参数:
  • blockhash:可选参数,区块hash
  • target-confirmations:可选参数,确认数,大于等于1
  • includeWatchonly:可选参数,默认为false,是否包含watchonly地址(参考importaddress
  • 请求: { "jsonrpc": "1.0", "id": "1", "method": "listsinceblock", "params": [] }
  • 响应: { "result": { "transactions": [ { "account": "my label", "address": "1BVz4apEjytvTKCHUU9TANQye1m7MCqZsy", "category": "receive", "satoshi": 50000000, "amount": 0.5, "label": "my label", "vout": 1, "confirmations": 66, "blockhash": "5c46d6c84f11fa3730ae82497ae1e26a230f99e561b231a0b3ee4ef0921599f2", "blockindex": 2, "blocktime": 1563347295, "txid": "53fac9b470e646c472948721552214b27bc75e9a0e19265acb5b53d8c7d51c0f", "walletconflicts": [], "time": 1563346822, "timereceived": 1563346822 } ], "lastblock": "6e6d1c2b0539650d9937691d8dd431c65595a4d7c3229b4f47dd4f786defe3f5" }, "error": null, "id": "1" }

listtransactions ("account" count from includeWatchonly)

列举账户的交易信息 - 请求参数: - account:可选参数,账户名,必须为"*" - count:可选参数,默认为10,交易的数量 - from:可选参数,默认为0,需要略过的交易数 - includeWatchonly:可选参数,默认为false,是否包含watchonly地址(参考importaddress) - 请求: { "jsonrpc": "1.0", "id": "1", "method": "listtransactions", "params": ["*", 10] } - 响应: { "result": [ { "account": "my label", "address": "1BVz4apEjytvTKCHUU9TANQye1m7MCqZsy", "category": "receive", "satoshi": 50000000, "amount": 0.5, "label": "my label", "vout": 1, "confirmations": 66, "blockhash": "5c46d6c84f11fa3730ae82497ae1e26a230f99e561b231a0b3ee4ef0921599f2", "blockindex": 2, "blocktime": 1563347295, "txid": "53fac9b470e646c472948721552214b27bc75e9a0e19265acb5b53d8c7d51c0f", "walletconflicts": [], "time": 1563346822, "timereceived": 1563346822 } ], "error": null, "id": "1" }

listtransactionsfrom ("account" count from includeWatchonly)

列举账户的交易信息 - 请求参数: - account:可选参数,账户名,必须为"*" - count:可选参数,默认为10,交易的数量 - from:可选参数,默认为0,需要略过的交易数 - includeWatchonly:可选参数,默认为false,是否包含watchonly地址(参考importaddress) - 请求: { "jsonrpc": "1.0", "id": "1", "method": "listtransactionsfrom", "params": ["*", 10, 0] } - 响应: { "result": [ { "account": "my label", "address": "1BVz4apEjytvTKCHUU9TANQye1m7MCqZsy", "category": "receive", "satoshi": 50000000, "amount": 0.5, "label": "my label", "vout": 1, "confirmations": 66, "blockhash": "5c46d6c84f11fa3730ae82497ae1e26a230f99e561b231a0b3ee4ef0921599f2", "blockindex": 2, "blocktime": 1563347295, "txid": "53fac9b470e646c472948721552214b27bc75e9a0e19265acb5b53d8c7d51c0f", "walletconflicts": [], "time": 1563346822, "timereceived": 1563346822 } ], "error": null, "id": "1" }

listunspent (minconf maxconf ["address",...])

  • 请求参数:
  • minconf:可选参数,默认为1
  • maxconf:可选参数,默认为9999999
  • addresses:地址列表
  • 请求: { "jsonrpc": "1.0", "id": "1", "method": "listunspent", "params": [] }
  • 响应: { "result": [ { "txid": "53fac9b470e646c472948721552214b27bc75e9a0e19265acb5b53d8c7d51c0f", "vout": 1, "address": "1BVz4apEjytvTKCHUU9TANQye1m7MCqZsy", "account": "my label", "scriptPubKey": "76a914732c899c33b2354bd824758e37bfca00cae7be6788ac", "satoshi": 50000000, "amount": 0.5, "confirmations": 66, "spendable": true } ], "error": null, "id": "1" }

lockunspent unlock [{"txid":"txid","vout":n},...]

  • 请求参数:
  • unlock:必须,true表示解锁,false表示加锁
  • transactions:必须,结构如下: [ { "txid": "id", "vout": n }, ... ]
  • 请求:
  • 响应:

move "fromaccount" "toaccount" amount (minconf "comment")

在账户之间转移货币 - 请求参数: - fromaccount:必须,源账户 - toaccount:必须,目的账户 - amount:移动的数量 - minconf:可选参数,默认为1,确认数 - comment:可选参数,评论信息 - 请求: { "jsonrpc": "1.0", "id": "1", "method": "move", "params": ["my label", "", 0.1, 1, "my label转移0.1到默认账户"] } - 响应: { "result": true, "error": null, "id": "1" }

staketo "diskcoinaddress" amount

抵押到指定地址 - 请求参数: - diskcoinaddress:必须,Diskcoin地址 - amount:必须,抵押的数量 - 请求: { "jsonrpc": "1.0", "id": "1", "method": "staketo", "params": ["1BVz4apEjytvTKCHUU9TANQye1m7MCqZsy", 0.1] } - 响应: 返回值为交易ID { "result": "522fa001190e4d5cdec0f3bead4dd0987dc5b80481b4d24585f99538115177e9", "error": null, "id": "1" }

removeprunedfunds "txid"

从钱包中删除某个交易 - 请求参数: - txid:必须,交易ID
- 请求: { "jsonrpc": "1.0", "id": "1", "method": "removeprunedfunds", "params": ["522fa001190e4d5cdec0f3bead4dd0987dc5b80481b4d24585f99538115177e9"] } - 响应: { "result": null, "error": null, "id": "1" }

sendfrom "fromaccount" "todiskcoinaddress" amount (minconf "comment" "comment-to")

从账户发送币到指定地址,需要用walletpassphrase设置passphrase - 请求参数: - fromaccount:必须,源账户 - todiskcoinaddress:必须,目的地址 - amount:必须,发送的数量 - minconf:可选参数,默认为1,确认数 - comment:可选参数,评论,不是交易的一部分,仅仅存在于钱包中 - comment-to:可选参数,保存发送交易的对象的姓名或者组织名 - 请求:

  • 响应:

sendmany "fromaccount" {"address":amount,...} (minconf "comment" ["address",...])

  • 请求参数:
  • fromaccount:必须,源账户
  • amount:必须,目的地址以及数量 { "address": amount, ... }
  • minconf:可选参数,默认为1,余额必须要满足的确认数
  • comment:可选参数,评论,不是交易的一部分,仅仅存在于钱包中
  • subtractfeefromamount:可选参数,地址列表
  • 请求:
  • 响应:

sendtoaddress "diskcoinaddress" amount ("comment" "comment-to" subtractfeefromamount)

  • 请求参数:
  • diskcoinaddress:必须,目的地址
  • amount:必须,需要发送的数量
  • comment:可选参数,评论,不是交易的一部分,仅仅存在于钱包中
  • comment-to:可选参数,保存发送交易的对象的姓名或者组织名
  • subtractfeefromamount:可选参数,默认为false
  • 请求:
  • 响应:

setaccount "diskcoinaddress" "account"

将账户与地址关联 - 请求参数: - diskcoinaddress:必须,Diskcoin地址 - account:必须,待关联的账户 - 请求: { "jsonrpc": "1.0", "id": "1", "method": "setaccount", "params": ["1BdpB1ptShqGwGuyn3BJ9Dy4ixoWRpwoqy", ""] } - 响应: { "result": null, "error": null, "id": "1" }

settxfee amount

设置交易费 - 请求参数: - amount:必须,交易费 - 请求: { "jsonrpc": "1.0", "id": "1", "method": "settxfee", "params": [0.1] } - 响应: { "result": true, "error": null, "id": "1" }

signdata "diskcoinaddress" "msgFormat" "message"

  • 请求参数:
  • diskcoinaddress:必须,Diskcoin地址
  • msgFormat:必须,为stringhex或者hash
  • message:必须,创建签名用的信息
  • verbose:可选参数,返回其他的一些附加信息
  • 请求: { "jsonrpc": "1.0", "id": "1", "method": "signdata", "params": ["1BdpB1ptShqGwGuyn3BJ9Dy4ixoWRpwoqy", "string", "my message", "verbose"] }
  • 响应: 返回值为签名信息 { "result": { "msghash": "ab1bdba540c9da66a96c42de0ab6a3466601145ba8eb216c7e7d76750fe338ea", "signature": "3045022100F26EFF47D090F956E1CC5A112702F358D1BF2EAD0FCCD978EA44A643E9D08BBF0220460CA6A6FB265009A4A2F5A4B97361FACB9226EDDEC4DC67EA5B8DE220385DBA", "pubkeyhash": "c54707cb3102df4c7a5345530fcfe70d379ca774", "pubkey": "03D8B4CE80F25A9EB8BF94D6CB49F017E9ED66D0C70E0486E134D0ED0C81B0EC9F" }, "error": null, "id": "1" }

signmessage "diskcoinaddress" "message"

用地址的私钥给信息签名,需要用walletpassphrase设置passphrase - 请求参数: - diskcoinaddress:必须,diskcoin地址 - message:必须,创建签名用的信息 - 请求: { "jsonrpc": "1.0", "id": "1", "method": "signmessage", "params": ["1BVz4apEjytvTKCHUU9TANQye1m7MCqZsy", "my message"] } - 响应: 返回值为信息的签名 { "result": "IOMuqLnoFIVWUF94WaAKexX7lj6y09TxmJ09AMgKCsumYJiCK4psvegPIHZJWDKhPAzSTCoj/FkhdA0PN7GptJ8=", "error": null, "id": "1" }

unstakee txid

解除抵押,stake命令返回值为txid - 请求参数: - txid:必须,交易ID - 请求: { "jsonrpc": "1.0", "id": "1", "method": "unstake", "params": ["522fa001190e4d5cdec0f3bead4dd0987dc5b80481b4d24585f99538115177e9"] } - 响应: 返回值为交易ID { "result": "fca427c96520435f4c9340b7bb116fd9e75bd91627a15c48246d80e187347fcc", "error": null, "id": "1" }

walletlock

从内存中删除密钥,锁定钱包。如果后续有方法调用需要解锁,则需要先调用walletpassphrase方法 - 请求: { "jsonrpc": "1.0", "id": "1", "method": "walletlock", "params": [] } - 响应: { "result": null, "error": null, "id": "1" }

walletpassphrase "passphrase" timeout

将钱包密钥存储在内存中,并设置存活时间。这是进行跟私钥有关的交易时的前置条件。 - 请求参数: - passphrase:必须,钱包的passphrase - timeout:必须,密钥在内存中存活的时间 - 请求: { "jsonrpc": "1.0", "id": "1", "method": "walletpassphrase", "params": ["my pass phrase", 120] } - 响应: { "result": null, "error": null, "id": "1" }

walletpassphrasechange "oldpassphrase" "newpassphrase"

  • 请求参数:
  • oldpassphrase:必须,当前passphrase
  • newpassphrase:必须,新的passphrase
  • 请求: { "jsonrpc": "1.0", "id": "1", "method": "walletpassphrasechange", "params": ["my pass phrase", "new pass phrase"] }
  • 响应: { "result": null, "error": null, "id": "1" }