From 6680fec343cc0114f2666f2ab4773caec956ec3a Mon Sep 17 00:00:00 2001 From: Wayman Date: Wed, 27 Nov 2019 12:49:25 +0800 Subject: [PATCH 01/69] add qitmeer-wallet rpc reference --- .../tutorials/qitmeer-wallet-rpc/_index.md | 210 ++++++++++++++++++ 1 file changed, 210 insertions(+) create mode 100644 Document/content/tutorials/qitmeer-wallet-rpc/_index.md diff --git a/Document/content/tutorials/qitmeer-wallet-rpc/_index.md b/Document/content/tutorials/qitmeer-wallet-rpc/_index.md new file mode 100644 index 00000000..a5a6bfd6 --- /dev/null +++ b/Document/content/tutorials/qitmeer-wallet-rpc/_index.md @@ -0,0 +1,210 @@ +--- +title: Qitmeer-wallet RPC +weight: 1 +#pre: "1. " +# chapter: true +--- + +# Qitmeer-wallet RPC Reference + +Downlocad Qitmeer Wallet from [github.com/Qitmeer/qitmeer-wallet](https://github.com/Qitmeer/qitmeer-wallet) + +```sh +# run rpc or ul model will support rpc interface + +./qitmeer-wallet qc web +``` + +Useage: + +RPC interface URL http://127.0.0.1:38130/api + +```sh + +curl -k -u "user:password" -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"1.0","method":"wallet_createAccount","params":["account"],"id":1}' http://127.0.0.1:38130/api | jq +``` + + +# API List + +## 1. wallet_unlock {password} {second} +### info: 解锁钱包 +### args: +- password 钱包密码 +- second 解锁时间,单位秒 +### example: +```json +{"jsonrpc":"1.0","method":"wallet_unlock","params":["password",30],"id":1} +``` + +## 2. wallet_lock +### info:锁定钱包 +### example: +```json +{"jsonrpc":"1.0","method":"wallet_lock","params":[],"id":1} +``` + +## 3. wallet_getAccountsAndBalance +### info: 获取所有的账号和余额 +### example: +```json +{"jsonrpc":"1.0","method":"wallet_getAccountsAndBalance","params":[],"id":1} +``` +result: +```json +{ + "jsonrpc": "2.0", + "id": 1, + "result": { + "account": { + "TotalAmount": 0, + "SpendAmount": 0, + "UnspendAmount": 0, + "ConfirmAmount": 0 + }, + "default": { + "TotalAmount": 280000000000, + "SpendAmount": 0, + "UnspendAmount": 280000000000, + "ConfirmAmount": 0 + }, + "imported": { + "TotalAmount": 11172999678800, + "SpendAmount": 325000000000, + "UnspendAmount": 8754999678800, + "ConfirmAmount": 2418000000000 + } + } +} + +``` + +## 4. wallet_createAccount {accountName} +### info: 添加账户 +### args: +- accountName 新账户名 +### example: +```json +{"jsonrpc":"1.0","method":"wallet_createAccount","params":["accountName"],"id":1} +``` + +## 5. wallet_getAddressesByAccount {accountName} +### info: 获取账户所有的地址 +### args: +- accountName 账户名 +### example: +```json +{"jsonrpc":"1.0","method":"wallet_getAddressesByAccount","params":["default"],"id":1} +``` +result: +```json +{ + "jsonrpc": "2.0", + "id": 1, + "result": [ + "TmSbEJs3nDmy68Af7M4Rsuj4pyAwcAret5a", + "Tmbzp2af9Ereh2hRejcVH9mCQgYdY2GHCAa", + "TmZu8zU1i6xbZMpLQZLMAJsyWHanZXUZtiV" + ] +} +``` +## 6. wallet_createAddress {accountName} +### info: 创建地址 +### args: +- accountName 账户名 +### example: +```json +{"jsonrpc":"1.0","method":"wallet_createAddress","params":["default"],"id":1} +``` +result: +```json +{ + "jsonrpc": "2.0", + "id": 1, + "result": "TmhMzHPCH6F2k3WYQkyvjhwAXoZt7q8TFv9" +} +``` + +## 7. wallet_sendToAddressByAccount {fromAccount} {toAddr} {amount} {comment} {commentTo} +### info: 发送交易 +### args: +- fromAccount from account +- toAddr send to address +- amount send amount coin +- comment +- commentTo +### example: +```json +{"id":1574828051839,"method":"wallet_sendToAddressByAccount","params":["default","TmZu8zU1i6xbZMpLQZLMAJsyWHanZXUZtiV",800,"",""]} +``` +result: +```json +{ + "jsonrpc": "2.0", + "id": 1574828051839, + "result": "b1ff3645c374992313e66d504fdf4fd3f2006f9414b97a7e1f6382328cc74fb1" +} +``` + +## 8. wallet_getTxListByAddr {addr} {type} {page} {pageSize} +### info: 获取地址相关交易列表 +### args: +- addr +- type 0: in tx; 1: out tx; 2: all tx +- page +- pageSize +### example: +```json +{"id":1574750774018,"method":"wallet_getTxListByAddr","params":["TmhJcjphz3Y3jRysKT56JaH8m9pzAzsFMu7",2,-1,100]} +``` +result: +```json +{ + "jsonrpc": "2.0", + "id": 1574750774018, + "result": { + "Total": 1, + "Page": 1, + "PageSize": 1000000000, + "transactions": [ + { + "hex": "", + "txid": "47879fb9dea684e4ce6f24f30812d3832d11fee34400754c6d8b34cd7d7eba8f", + "txhash": "937de7e15ec48e9cd58d79c594e7395015d5c663924ab5af929a9ef5e5f2e446", + "size": 377, + "version": 1, + "locktime": 0, + "expire": 0, + "vin": [ + ... + ], + "vout": [ + ... + ], + "blockhash": "026c6c85a1ae0183fe2e8bfda3450b9990acf9b8c4af3e995f9e361c7bb3d4cd", + "confirmations": 0 + } + ] + } +} +``` + +## 9. wallet_importWifPrivKey {accountName} {privKey} {rescan} +### info: 导入地址私钥 +### args: +- accountName 导入账户,目前只支持imported +- privKey 私钥 +- rescan bool,是否重新扫描交易记录 +### example: +```json +{"id":1574750774018,"method":"wallet_importWifPrivKey","params":["imported","xxxxx",false]} +``` + +## 10. wallet_dumpPrivKey {addr} +### info: 导出地址私钥 +### args: +- addr 地址 +### example: +```json +{"id":1574829854509,"method":"wallet_dumpPrivKey","params":["Tmh3je9zbnHAvPfwwHhQsFSJmKkeRTtKqmV"]} +``` From fa8d098f3b8fb87d1b5bcec8a354d253f0dbaebb Mon Sep 17 00:00:00 2001 From: Alex Wu Date: Wed, 27 Nov 2019 13:05:36 +0800 Subject: [PATCH 02/69] update doc link for the qitmeer-wallet rpc guide --- Document/content/tutorials/_index.en.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Document/content/tutorials/_index.en.md b/Document/content/tutorials/_index.en.md index cff33dfb..0aa6b60a 100644 --- a/Document/content/tutorials/_index.en.md +++ b/Document/content/tutorials/_index.en.md @@ -17,4 +17,6 @@ weight: 3 - [Qitmeer Rpc Guide](./qitmeer-rpc) +- [Qitmeer Wallet Rpc Guide](./qitmeer-wallet-rpc) + - [Qitmeer JS Guide](./qitmeer-js) From 7acf29c3eb30a62b327532f0642d74825df73213 Mon Sep 17 00:00:00 2001 From: luoshan Date: Tue, 7 Jan 2020 19:00:40 +0800 Subject: [PATCH 03/69] update wallet-rpc Interface --- .../tutorials/qitmeer-wallet-rpc/_index.md | 88 ++++++++++++++++++- 1 file changed, 86 insertions(+), 2 deletions(-) diff --git a/Document/content/tutorials/qitmeer-wallet-rpc/_index.md b/Document/content/tutorials/qitmeer-wallet-rpc/_index.md index a5a6bfd6..5b77f412 100644 --- a/Document/content/tutorials/qitmeer-wallet-rpc/_index.md +++ b/Document/content/tutorials/qitmeer-wallet-rpc/_index.md @@ -190,7 +190,7 @@ result: ``` ## 9. wallet_importWifPrivKey {accountName} {privKey} {rescan} -### info: 导入地址私钥 +### info: 导入wif格式私钥 ### args: - accountName 导入账户,目前只支持imported - privKey 私钥 @@ -201,10 +201,94 @@ result: ``` ## 10. wallet_dumpPrivKey {addr} -### info: 导出地址私钥 +### info: 导出地址wif格式私钥 ### args: - addr 地址 ### example: ```json {"id":1574829854509,"method":"wallet_dumpPrivKey","params":["Tmh3je9zbnHAvPfwwHhQsFSJmKkeRTtKqmV"]} ``` + +## 11. ui_openWallet {pass} +### info: 打开钱包 +### args: +- pass 钱包密码 +### example: +```json +{"jsonrpc":"1.0","method":"ui_openWallet","params":["pass"],"id":1} +``` + +## 12. wallet_syncStats +### info: 查看当前钱包同步高度 +### args: +### example: +```json +{"jsonrpc":"1.0","method":"wallet_syncStats","params":[],"id":1} +``` +result: +```json +{ + "jsonrpc": "2.0", + "id": 1, + "result": { + "Height": 20460 + } +} +``` + +## 13. wallet_getUtxo {addr} +### info: 获取指定地址可用utxo +### args: +- addr 地址 +### example: +```json +{"jsonrpc":"1.0","method":"wallet_getUtxo","params":["TmgD1mu8zMMV9aWmJrXqQYnWRhR9SBfDZG6"],"id":1} +``` +result: +```json +{ + "jsonrpc": "2.0", + "id": 1, + "result": [{ + "Txid": "54c47af3a17201c64a8f3b27164d4e09e8e38e05501b16bfd4f001caeddfa86a", + "Index": 1, + "Amount": 699925600 + }] +} +``` + +## 14. wallet_importPrivKey {accountName} {privKey} {rescan} +### info: 导入私钥 +### args: +- accountName 导入账户,目前只支持imported +- privKey 私钥 +- rescan bool,是否重新扫描交易记录 +### example: +```json +{"jsonrpc":"1.0","method":"wallet_importPrivKey","params":["imported","xxxxxx",true],"id":1} +``` + + +## 15. wallet_getBalanceByAddr {addr} +### info: 获取地址余额 +### args: +- addr 地址 +### example: +```json +{"jsonrpc":"1.0","method":"wallet_getBalanceByAddr","params":["TmfDniZnvsjdH98GsH4aetL3XQKFUTWPp4e",1],"id":16} +``` +result: +```json +{ + "jsonrpc": "2.0", + "id": 16, + "result": { + "TotalAmount": 400000000, + "SpendAmount": 0, + "UnspendAmount": 400000000, + "ConfirmAmount": 0 + } +} +``` + + From 1b3dd9869117ec9a16c420431ace23182a936617 Mon Sep 17 00:00:00 2001 From: luoshan Date: Sun, 12 Jan 2020 20:25:33 +0800 Subject: [PATCH 04/69] add wallet_rpc wallet_sendToAddressBatch --- .../tutorials/qitmeer-wallet-rpc/_index.md | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/Document/content/tutorials/qitmeer-wallet-rpc/_index.md b/Document/content/tutorials/qitmeer-wallet-rpc/_index.md index 5b77f412..5a5625e1 100644 --- a/Document/content/tutorials/qitmeer-wallet-rpc/_index.md +++ b/Document/content/tutorials/qitmeer-wallet-rpc/_index.md @@ -291,4 +291,31 @@ result: } ``` +## 15. wallet_sendToAddressBatch {addr:amount} +### info: 单地址批量交易 +### args: +- addr 地址 +- amount 金额 +### example: +```json +{ + "id": 1578639635748, + "method": "wallet_sendToAddressBatch", + "params": [{ + "TmeUg4pxc14y64J5BQj4M7jKEryeYfJ4APh": 0.1, + "TmU3Xwo1rnh4hTKBwifDYAccDrF3kxXaEFe": 0.2, + "TmjbGfbcMN1nVVHdcvzmPA4ksKqGq4eEkXu": 0.3, + "TmmWRCMcRZ1ZGdQEw2BwZ3ibsobATw4KTrw": 0.4 + }] +} +``` +result: +```json +{ + "jsonrpc": "2.0", + "id": 1578639635748, + "result": "d7a7d24d47bb66ad3d3185764808af730c9a9dbb5970686cf6e5a1d5f249923c" +} +``` + From b9e95641be45cd5e14adb27446af748e083f2874 Mon Sep 17 00:00:00 2001 From: forchain Date: Sun, 16 Feb 2020 01:42:58 +0400 Subject: [PATCH 05/69] JSON RPC API --- .../content/JSON RPC API/block/_index.en.md | 584 ++++++++++++++++++ .../content/JSON RPC API/chain/_index.en.md | 168 +++++ .../content/JSON RPC API/miner/_index.en.md | 139 +++++ .../JSON RPC API/overview/_index.en.md | 0 .../JSON RPC API/transaction/_index.en.md | 102 +++ 5 files changed, 993 insertions(+) create mode 100644 Document/content/JSON RPC API/block/_index.en.md create mode 100644 Document/content/JSON RPC API/chain/_index.en.md create mode 100644 Document/content/JSON RPC API/miner/_index.en.md create mode 100644 Document/content/JSON RPC API/overview/_index.en.md create mode 100644 Document/content/JSON RPC API/transaction/_index.en.md diff --git a/Document/content/JSON RPC API/block/_index.en.md b/Document/content/JSON RPC API/block/_index.en.md new file mode 100644 index 00000000..67f53d4a --- /dev/null +++ b/Document/content/JSON RPC API/block/_index.en.md @@ -0,0 +1,584 @@ +--- +title: The `Block` Module +--- + +## JSON-RPC methods + +- [getBestBlockHash](#getBestBlockHash) +- [getBlock](#getBlock) +- [getBlockByID](#getBlockByID) +- [getBlockByOrder](#getBlockByOrder) +- [getBlockCount](#getBlockCount) +- [getBlockhash](#getBlockhash) +- [getBlockhashByRange](#getBlockhashByRange) +- [getBlockHeader](#getBlockHeader) +- [getBlockTotal](#getBlockTotal) +- [getBlockWeight](#getBlockWeight) +- [getCoinbase](#getCoinbase) +- [getMainChainHeight](#getMainChainHeight) +- [getOrphansTotal](#getOrphansTotal) +- [isBlue](#isBlue) +- [isCurrent](#isCurrent) +- [isOnMainChain](#isOnMainChain) +- [tips](#tips) + +## JSON-RPC API Reference + +### getBestBlockHash +Returns the hash of the of the best (most recent) block in the longest block chain. + +#### Parameters +None +#### Returns +##### `(string)` - best block hash + +#### Example + +##### Request +```bash +curl --data '{"method":"getBestBlockHash","params":[],"jsonrpc":"2.0","id":1}' -s -k -u "rpcuser:rpcpass" -H 'Content-Type: application/json' http://127.0.0.1:18131 +``` + +##### Response +```js +"000005c905e232a3320c35e38ec2a7f8f9d03e3cc28faef007cc46f273835f4b" +``` + +*** + +### getBlock +Returns information about a block given its hash. + +#### Parameters + +1. `hash: (string)` the hash of the block. +2. `verbose: (boolean, optional, default=false)` specifies the block is returned as a JSON object instead of hex-encoded string. +3. `inclTx: (boolean, optional, default=true)` whether or not include transactions. +4. `fullTx: (boolean, optional, default=true)` specifies that each transaction is returned as a JSON object . + +#### Returns +##### `(object,inclTx=false)` not show + - `hash, confirmations, version, parentsroot, difficulty, pow` + - reference [getBlockHeader](#getBlockHeader) + + + - `weight: (numeric)` the weight of the block. + - `height: (numeric)` the height of the block in the block DAG. + - `order: (numeric)` the global order of the block. + - `bits: (numeric)` the bits which represent the block difficulty. + - `timestamp: (string)` block created time (ISO 8601 format). + - `parents: (string)` blocks that are referenced from this block + - `children: (string)` blocks that reference to this block + +##### `(object, inclTx=true, fullTx=false)` show hash list of transactions + - all fields with inclTx=false + - `transactions: (array of string)` transaction hashes +##### `(object, inclTx=true, fullTx=true)` transaction details + - all fields with inclTx=false + - `transactions: (array of object)` transaction object + - `hex: (string)` hex-encoded transaction / hex-encoded bytes of the script. + - `txid: (string)` the hash of the transaction WITHOUT signature. + - `txhash: (string)` the hash of the transaction WITH signature. + - `size: (numeric)` transaction size. + - `version: (enum)` transaction version. + - `1` coinbase transaction + - `2` ordinary transaction + - `locktime: (numeric)` the transaction lock time, cannot be spent before lock time. + - `expire: (numeric)` expired block height, tx cannot be spent after it. + - `vin: (array of json objects)` the transaction inputs as json objects. + - `coinbase: (string)` the hex-encoded bytes of the signature script. + - `sequence: (numeric)` the script sequence number. + - `vout: (array of json objects)` the transaction outputs as json objects. + - `amount: (numeric)` the value in QIT. + - `scriptPubKey: (json object)` the public key script used to pay coins. + - `asm: (string)` disassembly of the script. + - `hex: (string)` hex-encoded bytes of the script. + - `reqSigs: (numeric)` the number of required signatures. + - `type: (string)` the type of the script (e.g. 'pubkeyhash'). + - `addresses: (json array of string)` the addresses associated with this output. + +#### Example + +##### Request +```bash + curl --data '{"method":"getBlock","params":["11dbd3e6202f41eba102277bdb65adff82899219a870295ed8424b7c035af0f3", true, true, false],"jsonrpc":"2.0","id":1}' -s -k -u "rpcuser:rpcpass" -H 'Content-Type: application/json' http://127.0.0.1:18131 |jq . +``` +##### Response +```js +{ + "hash": "11dbd3e6202f41eba102277bdb65adff82899219a870295ed8424b7c035af0f3", + "txsvalid": true, + "confirmations": 31785, + "version": 11, + "weight": 474, + "height": 1, + "txRoot": "7b73360b8099c1c4e91ab63ee71210202a802592491a90f0fd5c1275a5556d3d", + "order": 1, + "transactions": [ + { + "hex": "010000000152868a9025d93bfa3948f8396c4779f735dcae7940d9e648555349c854c85cf8ffffffffffffffff01007841cb020000001976a9143be2e1e7eaffe6ee4c90d5db043576df7f2e174b88ac00000000000000000144510852fdfc072182654d1430353537373030363739313934373737393431302465316438316561652d313263662d343932302d623735312d323833383336616333306265", + "txid": "7b73360b8099c1c4e91ab63ee71210202a802592491a90f0fd5c1275a5556d3d", + "txhash": "e67a6d03533120d6fb280620caadcf3a47dee028d8ede9dbb6eef91b06bb336d", + "size": 158, + "version": 1, + "locktime": 0, + "expire": 0, + "vin": [ + { + "coinbase": "510852fdfc072182654d1430353537373030363739313934373737393431302465316438316561652d313263662d343932302d623735312d323833383336616333306265", + "sequence": 4294967295 + } + ], + "vout": [ + { + "amount": 12000000000, + "scriptPubKey": { + "asm": "OP_DUP OP_HASH160 3be2e1e7eaffe6ee4c90d5db043576df7f2e174b OP_EQUALVERIFY OP_CHECKSIG", + "hex": "76a9143be2e1e7eaffe6ee4c90d5db043576df7f2e174b88ac", + "reqSigs": 1, + "type": "pubkeyhash", + "addresses": [ + "TmUQjNKPA3dLBB6ZfcKd4YSDThQ9Cqzmk5S" + ] + } + } + ], + "blockhash": "11dbd3e6202f41eba102277bdb65adff82899219a870295ed8424b7c035af0f3", + "confirmations": 31785 + } + ], + "stateRoot": "0000000000000000000000000000000000000000000000000000000000000000", + "bits": "2018000", + "difficulty": 33652736, + "pow": { + "pow_name": "cuckaroo", + "pow_type": 1, + "nonce": 526, + "proof_data": { + "edge_bits": 24, + "circle_nonces": "7a8e09004e040a00f6850e00582a1200d96613006fc91a000ca11c00f78124001b613600c266370037ef430073915000bbf85500b0795600691e5d00c7b35f0048bc670048897c00c50a7d006f22820038029100f4819a005864a6000aa9a600b5f0aa008169b200d1b4bb004cbfc100a32ac3001d6ac70045a1c900a95ecc002e55d70077ffd800a451d9007b38db00ab79e100dc14e600c5b6e9000efff0006821fa007650fb00" + } + }, + "timestamp": "2019-12-30T15:55:42+08:00", + "parentroot": "caf26cf7705c0917bfb157150ab29f196465daf83c8ac1c82553aa9f207bd584", + "parents": [ + "caf26cf7705c0917bfb157150ab29f196465daf83c8ac1c82553aa9f207bd584" + ], + "children": [ + "0ea57734fc4baeb7fb8669a7e52b948fb94277a3f0a08caaf25592c7fef7c965" + ] +} +``` + +*** + +### getBlockByID +Returns information about a block given its local resource ID. + +#### Parameters + +1. `block ID: (numeric, required)` the local resource ID of the block, resource ID doesn't reach consensus on the network, it is generated by each node when accepting a new block. +2. `verbose: (boolean, optional, default=false)` reference [getBlock](#getBlock). +3. `inclTx: (boolean, optional, default=true)` reference [getBlock](#getBlock). +4. `fullTx: (boolean, optional, default=true)` reference [getBlock](#getBlock). + +#### Returns +reference [getBlock](#getBlock) + +#### Example + +##### Request +```bash + curl --data '{"method":"getBlockByID","params":[2, true, true, false],"jsonrpc":"2.0","id":1}' -s -k -u "rpcuser:rpcpass" -H 'Content-Type: application/json' http://127.0.0.1:18131 |jq . +``` + +##### Response + +reference [getBlock](#getBlock) + +*** + +### getBlockByOrder +Returns information about a block given its global order. + +#### Parameters + +1. `block ID: (numeric, required)` the local resource ID of the block, resource ID doesn't reach consensus on the network, it is generated by each node when accepting a new block. +2. `verbose: (boolean, optional, default=false)` reference [getBlock](#getBlock). +3. `inclTx: (boolean, optional, default=true)` reference [getBlock](#getBlock). +4. `fullTx: (boolean, optional, default=true)` reference [getBlock](#getBlock). + +#### Returns +reference [getBlock](#getBlock) + +#### Example + +##### Request +```bash + curl --data '{"method":"getBlockByID","params":[2, true, true, false],"jsonrpc":"2.0","id":1}' -s -k -u "rpcuser:rpcpass" -H 'Content-Type: application/json' http://127.0.0.1:18131 |jq . +``` + +##### Response + +reference [getBlock](#getBlock) + +*** + +### getBlockCount +Returns the number of stable blocks . + +#### Parameters +None + +#### Returns +- `(numeric)` number of blocks, the network should have reached consensus on this number + +#### Example + +##### Request +```bash + curl --data '{"method":"getBlockCount","params":[],"jsonrpc":"2.0","id":1}' -s -k -u "rpcuser:rpcpass" -H 'Content-Type: application/json' http://127.0.0.1:18131 |jq . +``` + +##### Response +34787 + +*** + +### getBlockhash +Returns hash of the block at the given order. + +#### Parameters +1. block order (numeric, required) + +#### Returns +- `(string)` block hash + +#### Example + +##### Request +```bash + curl --data '{"method":"getBlockhash","params":[2],"jsonrpc":"2.0","id":1}' -s -k -u "rpcuser:rpcpass" -H 'Content-Type: application/json' http://127.0.0.1:18131 |jq . +``` + +##### Response +0ea57734fc4baeb7fb8669a7e52b948fb94277a3f0a08caaf25592c7fef7c965 + +*** + +### getBlockhashByRange +Returns hash of the block at the given order. + +#### Parameters +1. start order (numeric, required) +1. end order (numeric, required) + +#### Returns +- `(array of string)` list of block hashes + +#### Example + +##### Request +```bash + curl --data '{"method":"getBlockhashByRange","params":[1, 9],"jsonrpc":"2.0","id":1}' -s -k -u "rpcuser:rpcpass" -H 'Content-Type: application/json' http://127.0.0.1:18131 |jq . +``` + +##### Response +```js +[ + "11dbd3e6202f41eba102277bdb65adff82899219a870295ed8424b7c035af0f3", + "0ea57734fc4baeb7fb8669a7e52b948fb94277a3f0a08caaf25592c7fef7c965", + "03879bf60c08cca7885790661e0e96147fc0012428d6b326eb5ffb2eb0f3b073", + "18917e39ec36a68843024b9212934a3a8b23d3f5629987d0565fb74c7683f13b", + "0385e16851b36983a1110e8cbf9885005e76a38be0983a2520e72c06da98f590", + "030fcf757bef879016095dd6ef40503418758632d4817ef5a20fd7ab87c427c7", + "1f876a43c630c3f0e065668ff12b88a0403bd8f9aa790b39f6982428c7c46272", + "1cdcbe73bfc539086296df62a92cd027b89d01d370826b2ac763fc3997dc7e8a" +] +``` + +*** + +### GetBlockHeader +Returns hex-encoded bytes of the serialized block header. + +#### Parameters +1. `block hash: (string)` the hash of the block. +2. `verbose: (boolean)` specifies the block header is returned as a JSON object instead of a hex-encoded string. + +#### Returns +##### `(object)` deserialized block data +- hash: (string) the hash of the block (same as provided). +- confirmations: (numeric) the number of confirmations. +- version: (numeric) the block version. +- parentsroot: (string) The merkle root of the previous parent blocks (the dag layer) +- txRoot: (string) the root of the transaction trie of the block. +- stateRoot: (string) the root of the final state trie of the block. +- difficulty: (numeric) the proof-of-work difficulty as a multiple of the minimum difficulty. +- pow: (object) mining info + - pow_name: (string) mining algorithm name. + - *Options* + - blak2bd: double blak2b, CPU based + - cuckroo: ASIC proof, GPU based + - cucktoo: ASIC friendly, GPU based + - pow_type: (numeric) mining algorithm type. + - *Options* + - 0: blake2bd + - 1: cuckroo + - 2: cucktoo + - nonce: (numeric) - the block nonce. + - proof_data: (object) - cuckroo algorithm proof + - "edge_bits": (numeric) - number of edge bit, the bigger the harder + - "circle_nonces": (string) - circle nonces, raw proof data +- hash: (string) the hash of the block (same as provided). +- confirmations: (numeric) the number of confirmations. +- version: (numeric) the block version. + +- layer: (string) length of the longest path from genesis to this block +- time: (string) the block time in seconds since 1 Jan 1970 GMT. + +##### `(string)` hex-encoded bytes of the serialized block + +#### Example + +##### Request +```bash +curl --data '{"method":"getBlockHeader","params":["11dbd3e6202f41eba102277bdb65adff82899219a870295ed8424b7c035af0f3", true],"jsonrpc":"2.0","id":1}' -s -k -u "rpcuser:rpcpass" -H 'Content-Type: application/json' http://127.0.0.1:18131 |jq . +``` + +##### Response +```js +{ + "hash": "11dbd3e6202f41eba102277bdb65adff82899219a870295ed8424b7c035af0f3", + "confirmations": 32263, + "version": 11, + "parentroot": "caf26cf7705c0917bfb157150ab29f196465daf83c8ac1c82553aa9f207bd584", + "txRoot": "7b73360b8099c1c4e91ab63ee71210202a802592491a90f0fd5c1275a5556d3d", + "stateRoot": "0000000000000000000000000000000000000000000000000000000000000000", + "difficulty": 33652736, + "layer": 1, + "time": 1577692542, + "pow": { + "pow_name": "cuckaroo", + "pow_type": 1, + "nonce": 526, + "proof_data": { + "edge_bits": 24, + "circle_nonces": "7a8e09004e040a00f6850e00582a1200d96613006fc91a000ca11c00f78124001b613600c266370037ef430073915000bbf85500b0795600691e5d00c7b35f0048bc670048897c00c50a7d006f22820038029100f4819a005864a6000aa9a600b5f0aa008169b200d1b4bb004cbfc100a32ac3001d6ac70045a1c900a95ecc002e55d70077ffd800a451d9007b38db00ab79e100dc14e600c5b6e9000efff0006821fa007650fb00" + } + } +} +``` + +*** + +### GetBlockTotal +Return the total number blocks that this dag currently owned + +#### Parameters +None + +#### Returns +##### `(numeric)` total number + +#### Example + +##### Request +```bash +curl --data '{"method":"getBlockTotal","params":[],"jsonrpc":"2.0","id":1}' -s -k -u "rpcuser:rpcpass" -H 'Content-Type: application/json' http://127.0.0.1:18131 |jq . +``` + +##### Response +```js +34970 +``` + +*** + +### GetCoinbase +Return the coin base data of given block + +#### Parameters +1. `block hash: (string)` block hash +2. `verbose: (bool, default: false)` whether or not show mining info + +#### Returns +##### `(array of string, verbose=true)` + 1. `(hex string)` block height + 2. `(hex string)` nonce + 3. `(hex string)` custom data 1, filled by miner, ASCII string + 4. `(hex string)` custom data 2 + 5. ... + +##### `(array of string, verbose=false)` total number + 1. `(hex string)` custom data 1, filled by miner, ASCII string + 2. `(hex string)` custom data 2 + 3. ... + +#### Example + +##### Request +```bash +curl --data '{"method":"getCoinbase","params":[],"jsonrpc":"2.0","id":1}' -s -k -u "rpcuser:rpcpass" -H 'Content-Type: application/json' http://127.0.0.1:18131 |jq . +``` + +##### Response +```js +[ + "01", + "52fdfc072182654d", + "3035353737303036373931393437373739343130", # "05577006791947779410" + "65316438316561652d313263662d343932302d623735312d323833383336616333306265" # "e1d81eae-12cf-4920-b751-283836ac30be" +] +``` + +*** + +### getMainChainHeight +Return the current height of DAG main chain + +#### Parameters +None + +#### Returns +##### `(array of string, verbose=true)` + 1. `(hex string)` block height + 2. `(hex string)` nonce + 3. `(hex string)` custom data 1, filled by miner, ASCII string + 4. `(hex string)` custom data 2 + 5. ... + +##### `(array of string, verbose=false)` total number + 1. `(hex string)` custom data 1, filled by miner, ASCII string + 2. `(hex string)` custom data 2 + 3. ... + +#### Example + +##### Request +```bash +curl --data '{"method":"getMainChainHeight","params":[],"jsonrpc":"2.0","id":1}' -s -k -u "rpcuser:rpcpass" -H 'Content-Type: application/json' http://127.0.0.1:18131 |jq . +``` + +##### Response +```js +32522 +``` + +*** + +### GetOrphansTotal +Return the total of orphans. Orphans are blocks with parents missing. + +#### Parameters +None + +#### Returns +##### `(numeric)` number of orphans + +#### Example + +##### Request +```bash +curl --data '{"method":"getOrphansTotal","params":[],"jsonrpc":"2.0","id":1}' -s -k -u "rpcuser:rpcpass" -H 'Content-Type: application/json' http://127.0.0.1:18131 |jq . +``` + +##### Response +```js +0 +``` + +*** + +### isBlue +Return the color of give block. Once block confirmed by main block, it is colored in line with consensus algorithm + +#### Parameters +1. `hash (string)` block hash + +#### Returns +##### `block color: (numeric)` + - *Options* + - `0 ` red: malfunctioning block, no block reward + - `1 ` blue: honest block, reward granted + - `2 ` cannot confirm: wait for confirmation by main block + +#### Example + +##### Request +```bash +curl --data '{"method":"GetOrphansTotal","params":[],"jsonrpc":"2.0","id":1}' -s -k -u "rpcuser:rpcpass" -H 'Content-Type: application/json' http://127.0.0.1:18131 |jq . +``` + +##### Response +```js +0 +``` + +*** + +### isCurrent +Returns if we are synced with our peers + +#### Parameters +None + +#### Returns +##### `(bool)` whether or not synced + +#### Example + +##### Request +```bash +curl --data '{"method":"isCurrent","params":[],"jsonrpc":"2.0","id":1}' -s -k -u "rpcuser:rpcpass" -H 'Content-Type: application/json' http://127.0.0.1:18131 |jq . +``` + +##### Response +```js +true +``` + +*** +### isOnMainChain +Query whether or not a given block is on the main chain. + +#### Parameters +1. `hash (string)` block hash + +#### Returns +##### `(bool)` whether or not on the main chain + +#### Example + +##### Request +```bash +curl --data '{"method":"isOnMainChain","params":["11dbd3e6202f41eba102277bdb65adff82899219a870295ed8424b7c035af0f3"],"jsonrpc":"2.0","id":1}' -s -k -u "rpcuser:rpcpass" -H 'Content-Type: application/json' http://127.0.0.1:18131 |jq . +``` + +##### Response +```js +true +``` + +*** +### tips +None + +#### Parameters + +#### Returns +##### `(array of string)` list of tip hashes + +#### Example + +##### Request +```bash + curl --data '{"method":"tips","params":[],"jsonrpc":"2.0","id":1}' -s -k -u "rpcuser:rpcpass" -H 'Content-Type: application/json' http://127.0.0.1:18131 |jq . +``` + +##### Response +```js +[ + "00001a78e4405cf0b1eeebf4c707bbbeea3fbad53dd60718092b08c6fb1cb95f" +] +``` \ No newline at end of file diff --git a/Document/content/JSON RPC API/chain/_index.en.md b/Document/content/JSON RPC API/chain/_index.en.md new file mode 100644 index 00000000..1110b3b7 --- /dev/null +++ b/Document/content/JSON RPC API/chain/_index.en.md @@ -0,0 +1,168 @@ +--- +title: The `blockchain` Module +--- + +## JSON-RPC methods + +- [getNodeInfo](#getNodeInfo) +- [getPeerInfo](#getPeerInfo) + +## JSON-RPC API Reference + +### getNodeInfo +Return info of requested node + +#### Parameters + +None + +#### Returns + +- `result: object` + - `UUID: (string)` - unique ID + - `version: (numeric)` - The version of the node as a numeric. + - `buildversion: (string)` - build version + - `protocolversion: (numeric)` - The protocol version of the node. + - `totalsubsidy: (numeric)` - total subsidy to be mined + - `graphstate: (object)` - graph state of DAG + - `tips: (array)` - array of tips, no referenced blocks + - `mainorder: (string)` - order of main chain + - `mainheight: (numeric)` - height of main chain + - `layer: (numeric)` - max height of all blocks + - `timeoffset: (numeric)` - The node clock offset in seconds + - `connections: (numeric)` - number of connections + - `pow_diff: (object)` - difficulty of POW + - `blake2bd_diff: (numeric)` - difficulty of Blake2B, pure CPU mining + - `cuckaroo_diff: (numeric)` - difficulty of cuckaroo, anti-ASIC GPU mining + - `cuckatoo_diff: (numeric)` - difficulty of cuckatoo, ASIC friendly GPU mining + - `testnet: (boolean)` - launch test net + - `mixnet: (boolean)` - launch mix net + - `confirmations: (numeric)` - number of blocks to wait for safe confirmation + - `coinbasematurity: (numeric)` - number of blocks to wait for coinbase to be spent + - `error: (string)` - error message if happened + - `modules: (array)` - loaded modules; qitmeer, miner, test by default + +#### Example + +Request +```bash +curl --data '{"method":"getNodeInfo","params":[],"jsonrpc":"2.0","id":1}' -s -k -u "rpcuser:rpcpass" -H 'Content-Type: application/json' http://127.0.0.1:18131 | jq +``` + +Response +```js +{ + "UUID": "2e3dddbe-2646-4964-b4ad-5a9b9fd83010", + "version": 80500, + "buildversion": "0.8.5+dev-30736c5", + "protocolversion": 19, + "totalsubsidy": 343068000000000, + "graphstate": { + "tips": [ + "00004d5e83f46cf14de8e4a8c76cf6831d1a294654076eabda19bf939a1e5786 main" + ], + "mainorder": 28656, + "mainheight": 26284, + "layer": 26285 + }, + "timeoffset": 0, + "connections": 8, + "pow_diff": { + "blake2bd_diff": 1, + "cuckaroo_diff": 23554, + "cuckatoo_diff": 1 + }, + "testnet": true, + "mixnet": false, + "confirmations": 10, + "coinbasematurity": 720, + "errors": "", + "modules": [ + "qitmeer", + "miner", + "test" + ] + } + +``` + +*** + +### getPeerInfo + +Returns data about each connected network peer as an array of json objects. + +#### Parameters + +None + +#### Returns + +- `result: array` + - `uuid: (string)` - global peer ID + - `id: (numeric)` - local peer ID + - `addr: (string)` the ip address and port of the peer. + - `addrlocal: (string)` - local IP address and port bound to connect peer + - `services: (string)` the services supported by the peer. + - `relaytxes: (bool)` - if relay transactions + - `lastsend: (numeric)` - time the last message was sent in seconds since 1 Jan 1970 GMT. + - `lastrecv: (numeric)` - time the last message was received in seconds since 1 Jan 1970 GMT. + - `bytessent: (numeric)` - total bytes sent + - `bytesrecv: (numeric)` - total bytes received + - `conntime: (numeric)` - time the connection was made in seconds since 1 Jan 1970 GMT. + - `pingtime: (numeric)` number of microseconds the last ping took. + - `version: (numeric)` the protocol version of the peer. + - `subver: (string)` the user agent of the peer. + - `inbound: (boolean)` whether or not the peer is an inbound connection. + - `syncnode: (boolean)` whether or not the peer is the sync peer. + - `graphstate: (object)` - graph state of DAG + - `tips: (array)` - array of tips, no referenced blocks + - `mainorder: (string)` - order of main chain + - `mainheight: (numeric)` - height of main chain + - `layer: (numeric)` - max height of all blocks + +startingheight: (numeric) the latest block height the peer knew about when the connection was established. +currentheight: (numeric) the latest block height the peer is known to have relayed since connected. + + +#### Example + +Request +```bash +curl --data '{"method":"getPeerInfo","params":[],"jsonrpc":"2.0","id":1}' -s -k -u "rpcuser:rpcpass" -H 'Content-Type: application/json' http://127.0.0.1:18131 | jq +``` + +Response +```js +[ + { + "uuid": "3917cbb8-a910-4bf6-b82e-dd9f191f9c20", + "id": 218, + "addr": "104.224.174.141:18130", + "addrlocal": "192.168.50.170:58733", + "services": "00000009", + "relaytxes": true, + "lastsend": 1578465326, + "lastrecv": 1578465300, + "bytessent": 58077, + "bytesrecv": 39464, + "conntime": 1578462700, + "timeoffset": -291, + "pingtime": 218202, + "version": 19, + "subver": "qitmeer:0.8.5", + "inbound": false, + "banscore": 0, + "syncnode": false, + "graphstate": { + "tips": [ + "000060719d3b030a079daea3ae09f4317402df74af9a6520f9b54fa095cbd2fc main" + ], + "mainorder": 28867, + "mainheight": 26478, + "layer": 26479 + } + } +] + +``` diff --git a/Document/content/JSON RPC API/miner/_index.en.md b/Document/content/JSON RPC API/miner/_index.en.md new file mode 100644 index 00000000..1e7a4f48 --- /dev/null +++ b/Document/content/JSON RPC API/miner/_index.en.md @@ -0,0 +1,139 @@ +--- +title: The `Miner` Module +--- + +## JSON-RPC methods + +- [getBlockTemplate](#getBlockTemplate) +- [submitBlock](#submitBlock) + +## JSON-RPC API Reference + +### GetBlockTemplate +Gets a block template for use with mining software. + +#### Parameters +1. `capabilities: (array of enum)`: client side supported feature. Note: +coinbasetxn and coinbasevalue are mutually exclusive. + - *coinbasetxn* information for coinbase transaction, miningaddr is required in node config. + - *coinbasevalue* maximum allowable input to coinbase transaction + +#### Returns +##### `(object, capabilities=["coinbasetxn"])` +- `stateroot: (string)` the root of the final state trie of the block. +- `curtime: (numeric)` current timestamp in seconds since epoch (Jan 1 1970 GMT). +- `height: (numeric)` the height of the block in the block DAG. +- `blues: (numeric)` blue set size of block's past set, +- `previousblockhash: (string)` The merkle root of the previous parent blocks (the dag layer) +- `sigoplimit: (numeric)` limit of sigops in blocks +- `sizelimit: (numeric)` limit of block size +- `weightlimit: (numeric)` limit of block weight +- `parents: (array of object)` list of parent hashes + - `data: (string)` parent hash encoded in hexadecimal (byte-for-byte) + - `hash: (string)` parent hash encoded in little-endian hexadecimal +- `transactions: (array of object)` list of transaction + - `data: (string)` transaction data encoded in hexadecimal (byte-for-byte) + - `hash: (string)` hash encoded in little-endian hexadecimal (including witness data) + - `depends: (array of numeric)` transactions before this one (by 1-based index in 'transactions' list) that must be present in the final block if this one is + - `fee: (numeric)` difference in value between transaction inputs and outputs (in QITs); 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 + - `sigops: (numeric)` total SigOps cost, as counted for purposes of block limits; if key is not present, sigop cost is unknown and clients MUST NOT assume it is zero + - `weight: (numeric)` total transaction weight, as counted for purposes of block limits +- `version: (numeric)` The preferred block version +- `coinbaseaux: (object)` data that should be included in the coinbase's scriptSig content + - `flags: (string)` key name is to be ignored, and value included in scriptSig +- `coinbasevalue: (numeric)` maximum allowable input to coinbase transaction, including the generation award and transaction fees (in QITs) +- `longpollid: (string)` template ID, the format is "parent root - generate time" +- `pow_diff_reference: (object)` - mining difficulty + - `blake2bd_bits: (string)`: double blake2b compressed target of next block, + - `blake2bd_target: (string)`: double blake2b hash target of next block, + - `cuckaroo_min_diff: (numeric)`: cuckaroo min difficulty + - `cuckatoo_min_diff: (numeric)`: cuckatoo min difficulty +- `maxtime: (numeric)` The maximum timestamp appropriate for next block time in seconds since epoch (Jan 1 1970 GMT) +- `mintime: (numeric)` The minimum timestamp appropriate for next block time in seconds since epoch (Jan 1 1970 GMT) +- `mutable: (array of string)` list of ways the block template may be changed, including 'time', 'transactions/add', 'prevblock', "coinbase/append" +- `noncerange :(string)` A range of valid nonces +- `capabilities :(array of string)` list of capabilities, not implemented yet, only 'proposal' always listed + +##### `(object, capabilities=["coinbasevalue"])` - best block hash +almost identical to result of capabilities = coinbasevalue, just coinbasevalue and coinbaseaux substituted with coinbasetxn +- `coinbasetxn: (object)` information for coinbase transaction, data structure is identical to transactions field + +#### Example + +##### Request +```bash +curl --data '{"method":"getBestBlockHash","params":[],"jsonrpc":"2.0","id":1}' -s -k -u "rpcuser:rpcpass" -H 'Content-Type: application/json' http://127.0.0.1:18131 +``` + +##### Response +```js +{ + "stateroot": "0000000000000000000000000000000000000000000000000000000000000000", + "curtime": 1578717731, + "height": 34902, + "blues": 37478, + "previousblockhash": "000028f561e25022c4c0bbf1b08943da39ef1a134556c742a5b2c8accd3d3fd6", + "sigoplimit": 80000, + "sizelimit": 1048576, + "weightlimit": 4000000, + "parents": [ + { + "data": "d63f3dcdacc8b2a542c75645131aef39da4389b0f1bbc0c42250e261f5280000", + "hash": "000028f561e25022c4c0bbf1b08943da39ef1a134556c742a5b2c8accd3d3fd6" + } + ], + "transactions": [], + "version": 11, + "coinbasetxn": { + "data": "0100000001905e3ac0bc4050ce1ba4c4b4fc6cef8f2d6a8e1e3b49917ca65641b0feb21c20ffffffffffffffff01007841cb020000001976a914a6b8fe2348fad076b7fd1b34b7e5b35db96dc2a088ac0000000000000000011703568800082ad99948a98c989f092f7169746d6565722f", + "hash": "fcb7e486a557dbe69b8bd0bf2f5602fb8c22ee2ddc6ad4a5070a8c261f182ede", + "depends": [], + "fee": 0, + "sigops": 1, + "weight": 0 + }, + "longpollid": "000028f561e25022c4c0bbf1b08943da39ef1a134556c742a5b2c8accd3d3fd6-1578717731", + "pow_diff_reference": { + "blake2bd_bits": "1c1fffff", + "blake2bd_target": "000000001fffff00000000000000000000000000000000000000000000000000", + "cuckaroo_min_diff": 12718848, + "cuckatoo_min_diff": 1856 + }, + "maxtime": 1578724931, + "mintime": 1578717707, + "mutable": [ + "time", + "transactions/add", + "prevblock", + "coinbase/append" + ], + "noncerange": "00000000ffffffff", + "capabilities": [ + "proposal" + ] + } + +``` + +*** + +### SubmitBlock +Attempts to submit new block to network. + +#### Parameters +1. `hexBlock: (string)` hex-encoded block data to submit. Refer to https://github.com/qitmeer/qitmeer-miner to investigate how to construct a block + +#### Returns +##### `(string)` submit message + +#### Example + +##### Request +```bash +curl --data '{"method":"submitBlock","params":["0b0000009b324c447c093502bd2928251c7a76bd66fac662f4535130c512a52ff27c9ac291db77e47c8b7fb1199192e813698abd42ceae44c6f6cd7bb3bfee442b105079000000000000000000000000000000000000000000000000000000000000000000000000d998195eba6acfb00118539c0100c3b203006b871000627a170066122400e7a933007cfb3b00ed393d00b9a63e00fcad4d0083c954004b6c5c007ac77300db1b7a0025f27c00540e7d0015018300a40084000bc28900d0f38f002b8592007e759300195a9900a2529b002356a1004b86a2008affb300f5a3ba001b05bb00dc52bf006528c1008fa1c20058a4c8000ca3cc002ff1cc00e4e8d10052cfd400e063dd00612fdf007a7ee5001d93ea00c093fc00019b324c447c093502bd2928251c7a76bd66fac662f4535130c512a52ff27c9ac2010100000001b3e2498b9592e6871e1a02a23a32988495b0c3da449f1cb3f1389013d044713bffffffffffffffff01007841cb020000001976a914a6b8fe2348fad076b7fd1b34b7e5b35db96dc2a088ac000000000000000001455a08ec92282d01baa3be153131333933333038383330373933383831353235322435633739303233612d653130642d343631622d613438662d356563343961316233353330"],"jsonrpc":"2.0","id":1}' -s -k -u "test:test" -H 'Content-Type: application/json' http://127.0.0.1:38131 |jq . +``` + +##### Response +```js +"Block submitted accepted hash fcd2fe6a284e46d4fb7893e84bbcc58ca96e020be1e57b5c1b2c45929cca8dee, height 10, order 10 amount 12000000000" +``` \ No newline at end of file diff --git a/Document/content/JSON RPC API/overview/_index.en.md b/Document/content/JSON RPC API/overview/_index.en.md new file mode 100644 index 00000000..e69de29b diff --git a/Document/content/JSON RPC API/transaction/_index.en.md b/Document/content/JSON RPC API/transaction/_index.en.md new file mode 100644 index 00000000..f6f3d592 --- /dev/null +++ b/Document/content/JSON RPC API/transaction/_index.en.md @@ -0,0 +1,102 @@ +--- +title: The `Transaction` Module +--- + +## JSON-RPC methods + +- [CreateRawTransaction](#CreateRawTransaction) +- [DecodeRawTransaction](#DecodeRawTransaction) +- [GetRawTransactionByHash](#GetRawTransactionByHash) +- [GetUtxo](#GetUtxo) +- [SendRawTransaction](#SendRawTransaction) + +## JSON-RPC API Reference + +### CreateRawTransaction +Returns a new transaction spending the provided inputs and sending to the provided addresses.The transaction inputs are not signed in the created transaction. + +#### Parameters +1. `inputs: (array of object)` transaction inputs. + - `txid: (string)` The transaction id + - `vout: (numeric)` The output number +2. `amounts: (object)` addresses as keys and output amounts as values. +3. `lockTime: (numeric, optional, default=0)` Raw locktime. Non-0 value also locktime-activates inputs + +#### Returns +##### `(string)` hex-encoded bytes of the serialized transaction + +#### Example + +##### Request +```bash +curl --data '{"method":"createRawTransaction","params":[[{"Txid":"ddf99e004ed24d641ddc942272ed174b1c2ae0fb27cc0ed7e858e0a451e27633", "Vout":0}], {"RmG6xQsV7gnS4JZmoq5FgmyEbmUQRenrTCo":10000000000}],"jsonrpc":"2.0","id":1}' -s -k -u "test:test" -H 'Content-Type: application/json' http://127.0.0.1:1234 |jq . +``` + +##### Response +```js +"01000000013376e251a4e058e8d70ecc27fbe02a1c4b17ed722294dc1d644dd24e009ef9dd00000000ffffffff0100e40b54020000001976a9146bd68046854813036fa042958e7f5ca29606e8d088ac00000000000000000100" +``` + +*** + +### DecodeRawTransaction +Returns a JSON object representing the provided serialized, hex-encoded transaction. + +#### Parameters +1. `hexTx: (string)` serialized, hex-encoded transaction. + +#### Returns +##### `(object)` +- `txid: (string)` the transaction id. +- `txhash: (string)` the hash of the transaction. +- `locktime: (numeric)` the transaction lock time. +- `version: (numeric)` the block version. +- `vin: (array of objects, coinbase)` the transaction inputs . + - `coinbase: (string)` the hex-encoded bytes of the signature script. + - `sequence: (numeric)` the script sequence number. +- vin (array of objects, coinbase, non-coinbase) +(json object) +{"coinbase": "data", "sequence": n, ...} +- `vout: (array of objects)` the transaction outputs . + +#### Example + +##### Request +```bash +curl --data '{"method":"decodeRawTransaction","params":["01000000013376e251a4e058e8d70ecc27fbe02a1c4b17ed722294dc1d644dd24e009ef9dd00000000ffffffff0100e40b54020000001976a9146bd68046854813036fa042958e7f5ca29606e8d088ac00000000000000000100"],"jsonrpc":"2.0","id":1}' -s -k -u "test:test" -H 'Content-Type: application/json' http://127.0.0.1:1234 |jq . +``` + +##### Response +```js +{ + "txid": "0d21c787536b02e3df82bd72c8dceb525049013cb249eee1d73090183c9a8965", + "txhash": "b718e91241840992175195758628f3b6ec61019be0fa202d9b4b4652a6b96fd7", + "version": 1, + "locktime": 0, + "vin": [ + { + "txid": "ddf99e004ed24d641ddc942272ed174b1c2ae0fb27cc0ed7e858e0a451e27633", + "vout": 0, + "sequence": 4294967295, + "scriptSig": { + "asm": "", + "hex": "" + } + } + ], + "vout": [ + { + "amount": 10000000000, + "scriptPubKey": { + "asm": "OP_DUP OP_HASH160 6bd68046854813036fa042958e7f5ca29606e8d0 OP_EQUALVERIFY OP_CHECKSIG", + "hex": "76a9146bd68046854813036fa042958e7f5ca29606e8d088ac", + "reqSigs": 1, + "type": "pubkeyhash", + "addresses": [ + "RmG6xQsV7gnS4JZmoq5FgmyEbmUQRenrTCo" + ] + } + } + ] +} +``` \ No newline at end of file From 9b1ba3e4c8969e1c257a088de75314e2ae79feb4 Mon Sep 17 00:00:00 2001 From: Alex Wu Date: Wed, 1 Jul 2020 11:17:47 +0800 Subject: [PATCH 06/69] Update _index.md --- Document/content/tutorials/qitmeer-rpc/_index.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Document/content/tutorials/qitmeer-rpc/_index.md b/Document/content/tutorials/qitmeer-rpc/_index.md index 67f302a1..aff221b9 100644 --- a/Document/content/tutorials/qitmeer-rpc/_index.md +++ b/Document/content/tutorials/qitmeer-rpc/_index.md @@ -19,7 +19,7 @@ curl -k -u "admin:123" -X POST -H 'Content-Type: application/json' --data '{"jso ### 1. getBlockByOrder #### 函数名:getBlockByOrder {order} {fullTx} #### 说明: -- order:区块orderid,由于qitmeer采用DAG算法,区块的orderid会发生变动,该值并非是区块高度 +- order:区块order,qitmeer采用BlockDAG算法进行共识,对区块的先后顺序进行排序。order指区块序列的序号,一个从0开始增大的整数值。请注意order不是区块的高度。 - fullTx: true/false,该值一般为true, ``` @@ -89,10 +89,10 @@ curl -k -u "admin:123" -X POST -H 'Content-Type: application/json' --data '{"jso ``` -### 2.getBlockByID -#### 函数名:getBlockByID {blockid} {fullTx} +### 2.getBlockByNum +#### 函数名:getBlockByNum {number} {fullTx} #### 说明: -- blockid:所请求节点接收的区块顺序,节点内置id,与全网其他节点无关 +- number:number指按照当前节点所接受到的区块先后顺序,进行顺序的序号,一个从0开始向上增大的整数值。该序号(Num)与全网其他节点无关,即非BlockDAG共识结果的Block排序。 - fullTx:true/false,一般为true ### 3.getBlockCount @@ -220,4 +220,4 @@ getRawTransaction 000000e4c6b7f5b89827711d412957bfff5c51730df05c2eedd1352468313e sendRawTransaction 0100000001ff5d53a7070fa9f0a9d12af729d2cbaf355ef1173c106a84cf9ef3a46bff03b202000000ffffffff01005504790a0000001976a914627777996288556166614462639988446255776688ac000000000000000001000000000000000000000000ffffffff6b483045022100dced4d67dd74647d0036077ee5b435838934377b1d296dd9da852772911e3be2022063dd346bd812a894968b8acacead7e7beff48947657a82f1e8f9c38876d4c905012103aba0a09f5b44138a46a2e5d26b8659923d84c4ba9437e22c3828cac43d0edb49 true -``` \ No newline at end of file +``` From 98cecceaf0bb1b71e57b17409fb74a4ca1c4fa7f Mon Sep 17 00:00:00 2001 From: Alex Wu Date: Wed, 1 Jul 2020 11:21:36 +0800 Subject: [PATCH 07/69] Update _index.md --- .../content/tutorials/qitmeer-rpc/_index.md | 130 +++++++++--------- 1 file changed, 63 insertions(+), 67 deletions(-) diff --git a/Document/content/tutorials/qitmeer-rpc/_index.md b/Document/content/tutorials/qitmeer-rpc/_index.md index aff221b9..7b2cf0de 100644 --- a/Document/content/tutorials/qitmeer-rpc/_index.md +++ b/Document/content/tutorials/qitmeer-rpc/_index.md @@ -7,84 +7,80 @@ weight: 1 # Qitmeer RPC 说明 -## 以下rpc均可通过curl可进行调用 - -``` - -curl -k -u "admin:123" -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getPeerInfo","params":null,"id":1}' http://127.0.0.1:1234 | jq -``` - -[点击下载java版rpc调用示例](https://github.com/qitmeers/files/blob/master/rpcdemo-java.zip) - ### 1. getBlockByOrder #### 函数名:getBlockByOrder {order} {fullTx} #### 说明: - order:区块order,qitmeer采用BlockDAG算法进行共识,对区块的先后顺序进行排序。order指区块序列的序号,一个从0开始增大的整数值。请注意order不是区块的高度。 - fullTx: true/false,该值一般为true, +``` +curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getBlockByOrder","params":[1,true,true,true],"id":1}' https://127.0.0.1:18131 +``` + ``` { - "hash": "40f714e882292041d5a02bc5286fc465d04ae84e7a784debe8e93fef7f7e14f6", - "txsvalid": true, - "confirmations": 7784, - "version": 8, - "weight": 473, - "height": 11, - "txRoot": "e59a81ecd2d013adfb2c73068a672ef0805c0aa4877ef114b275829c863c5608", - "order": 11, - "transactions": [ + "hash": "0012c535ed43311b0670341fad3a489642c0bc6e6796f836aa6d235826fc9c66", + "txsvalid": true, + "confirmations": 20651, + "version": 12, + "weight": 433, + "height": 1, + "txRoot": "845738befb45db6872e37295b39837cd8dc98e77417754fd4ddab5ff169317be", + "order": 1, + "transactions": [ + { + "hex": "0c000000010a7ebb3e65b3be8a2e3425407e8e649c4bde818b7db70bdb3d4b8c3256745f37ffffffffffffffff01007841cb020000001976a91409eb5fc744c14c8cdd5a05b552c58c1fb6e7ebd088ac000000000000000072b6f25e01175108461004cbac974daf0c2f363636706f6f6c2e636e2f", + "txid": "845738befb45db6872e37295b39837cd8dc98e77417754fd4ddab5ff169317be", + "txhash": "93772af2957ecd066841fda4606bfa5e001ac151062c0b3ca7cfea60ec35e8b3", + "size": 117, + "version": 12, + "locktime": 0, + "timestamp": "2020-06-24T10:12:02+08:00", + "expire": 0, + "vin": [ { - "hex": "010000000139d821f342cd463794ea5a2ae70f1059124d6398caf4197d6dc13798574cdd42ffffffffffffffff010042dc06030000001976a914883e0d08cf453696b756baabadae1da8ab3f227888ac000000000000000001435b086c0dd1ff9a9c865213353934363631323534373532303130353833362430633136653839622d393438372d343865622d396536332d656130646430663735373236", - "txid": "e59a81ecd2d013adfb2c73068a672ef0805c0aa4877ef114b275829c863c5608", - "txhash": "aaf2a2357b41950f27403e6f5841cfcd894b80f18fc724a8d4155c7a4706066f", - "size": 157, - "version": 1, - "locktime": 0, - "expire": 0, - "vin": [ - { - "coinbase": "5b086c0dd1ff9a9c865213353934363631323534373532303130353833362430633136653839622d393438372d343865622d396536332d656130646430663735373236", - "sequence": 4294967295 - } - ], - "vout": [ - { - "amount": 13000000000, - "scriptPubKey": { - "asm": "OP_DUP OP_HASH160 883e0d08cf453696b756baabadae1da8ab3f2278 OP_EQUALVERIFY OP_CHECKSIG", - "hex": "76a914883e0d08cf453696b756baabadae1da8ab3f227888ac", - "reqSigs": 1, - "type": "pubkeyhash", - "addresses": [ - "TmbNTwPm9aTN7TtStnJjrcjsaRJWm4gt3Fs" - ] - } - } - ], - "blockhash": "40f714e882292041d5a02bc5286fc465d04ae84e7a784debe8e93fef7f7e14f6", - "confirmations": 7784 + "coinbase": "5108461004cbac974daf0c2f363636706f6f6c2e636e2f", + "sequence": 4294967295 } - ], - "stateRoot": "0000000000000000000000000000000000000000000000000000000000000000", - "bits": "1600000", - "difficulty": 23068672, - "pow": { - "pow_name": "cuckaroo", - "pow_type": 1, - "nonce": 3412159405, - "proof_data": { - "edge_bits": 24, - "circle_nonces": "81de0400ce680600790822004fe43f000f934200a9ac4500cd695800689a5e00c9566100a46670001d7c7100820276007c6c770089f47b0039847c0069327e0085647e00caa07e009a508c001082950052979a00c717a1005827ab00975faf004c93b5000852b600a3dfb600d8f0c500a6b0c60074cbcf007ec7d3003a23db0099bce000d752f20027bff2003492f50011a1f600bde2f700de98f900afc6f900932ffd00ed89fe00" + ], + "vout": [ + { + "amount": 12000000000, + "scriptPubKey": { + "asm": "OP_DUP OP_HASH160 09eb5fc744c14c8cdd5a05b552c58c1fb6e7ebd0 OP_EQUALVERIFY OP_CHECKSIG", + "hex": "76a91409eb5fc744c14c8cdd5a05b552c58c1fb6e7ebd088ac", + "reqSigs": 1, + "type": "pubkeyhash", + "addresses": [ + "TmPrXkjpjSUBiFG9RZKPjfdsAPbiaar94Ta" + ] + } } - }, - "timestamp": "2019-11-02T18:13:50+08:00", - "parentroot": "5f852ecc306c4ec7f792fbfb8f9d4b1e15b7c80cc4a4678f7ea28e1d3edb98f6", - "parents": [ - "5f852ecc306c4ec7f792fbfb8f9d4b1e15b7c80cc4a4678f7ea28e1d3edb98f6" - ], - "children": [ - "3df0e5bb739d7ac0e4d34f621514d485dff3a3c0be31c161cc891787172caade" - ] + ], + "blockhash": "0012c535ed43311b0670341fad3a489642c0bc6e6796f836aa6d235826fc9c66", + "confirmations": 20651 + } + ], + "stateRoot": "0000000000000000000000000000000000000000000000000000000000000000", + "bits": "34ad1ec", + "difficulty": 55235052, + "pow": { + "pow_name": "cuckaroom", + "pow_type": 3, + "nonce": 5, + "proof_data": { + "edge_bits": 29, + "circle_nonces": "fa50c20086aef40090ebab01295d5102697fcb0229e83b04b0ac4604fd9a6505118a6f05deb21206e88f9c07184fae075e218408884ed90bdfca630cf9e2a60c12fae80f909b831084669a109390e6105aa9c611aea1e71288408713c670641405f9a714abfcf81557ded81665b20f17a17370170628de17d4ccfb1755515618f5456918efd27918d4f4d218f91bb71954e3b11cb648ca1c9779541d51ee6b1ee12a711e0679131f" + } + }, + "timestamp": "2020-06-24T10:05:33+08:00", + "parentroot": "36988b21b970fe3cbc7381dec7760eea50bc869e3bfbc44856a402fac94d3a8a", + "parents": [ + "36988b21b970fe3cbc7381dec7760eea50bc869e3bfbc44856a402fac94d3a8a" + ], + "children": [ + "000de974590581de8294866535b3af182041a4cb29b71a7680b024e3bd7d12da" + ] } ``` From a596f2f0e85ff4086f5fa303587a34280bd409db Mon Sep 17 00:00:00 2001 From: Alex Wu Date: Wed, 1 Jul 2020 11:47:26 +0800 Subject: [PATCH 08/69] Update _index.md --- .../content/tutorials/qitmeer-rpc/_index.md | 69 +++++++++++++++++-- 1 file changed, 63 insertions(+), 6 deletions(-) diff --git a/Document/content/tutorials/qitmeer-rpc/_index.md b/Document/content/tutorials/qitmeer-rpc/_index.md index 7b2cf0de..9c42c84d 100644 --- a/Document/content/tutorials/qitmeer-rpc/_index.md +++ b/Document/content/tutorials/qitmeer-rpc/_index.md @@ -8,15 +8,18 @@ weight: 1 # Qitmeer RPC 说明 ### 1. getBlockByOrder -#### 函数名:getBlockByOrder {order} {fullTx} +#### 函数名:getBlockByOrder {order} {fullTx} #### 说明: - order:区块order,qitmeer采用BlockDAG算法进行共识,对区块的先后顺序进行排序。order指区块序列的序号,一个从0开始增大的整数值。请注意order不是区块的高度。 -- fullTx: true/false,该值一般为true, +- verbose: 是否显示详细信息,默认为false +- inclTx: 是否包含交易信息,默认为true +- fullTx:是否显示完整交易信息,默认为true +实例1: ``` -curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getBlockByOrder","params":[1,true,true,true],"id":1}' https://127.0.0.1:18131 +curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getBlockByOrder","params":[1,true],"id":1}' https://127.0.0.1:18131 ``` - +实例1输出: ``` { "hash": "0012c535ed43311b0670341fad3a489642c0bc6e6796f836aa6d235826fc9c66", @@ -85,11 +88,65 @@ curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"js ``` +实例2: +``` +curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getBlockByOrder","params":[1,false],"id":1}' https://127.0.0.1:18131 +``` +实例2输出: +``` +{ + "jsonrpc": "2.0", + "id": 1, + "result": "0c0000008a3a4dc9fa02a45648c4fb3b9e86bc50ea0e76c7de8173bc3cfe70b9218b9836be179316ffb5da4dfd547741778ec98dcd3798b39572e37268db45fbbe3857840000000000000000000000000000000000000000000000000000000000000000ecd14a03edb4f25e05000000031dfa50c20086aef40090ebab01295d5102697fcb0229e83b04b0ac4604fd9a6505118a6f05deb21206e88f9c07184fae075e218408884ed90bdfca630cf9e2a60c12fae80f909b831084669a109390e6105aa9c611aea1e71288408713c670641405f9a714abfcf81557ded81665b20f17a17370170628de17d4ccfb1755515618f5456918efd27918d4f4d218f91bb71954e3b11cb648ca1c9779541d51ee6b1ee12a711e0679131f018a3a4dc9fa02a45648c4fb3b9e86bc50ea0e76c7de8173bc3cfe70b9218b9836010c000000010a7ebb3e65b3be8a2e3425407e8e649c4bde818b7db70bdb3d4b8c3256745f37ffffffffffffffff01007841cb020000001976a91409eb5fc744c14c8cdd5a05b552c58c1fb6e7ebd088ac000000000000000072b6f25e01175108461004cbac974daf0c2f363636706f6f6c2e636e2f" +} +``` + +实例3: +``` +curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getBlockByOrder","params":[1,true,false],"id":1}' https://127.0.0.1:18131 +``` +实例3输出: +``` +{ + "jsonrpc": "2.0", + "id": 1, + "result": { + "hash": "0012c535ed43311b0670341fad3a489642c0bc6e6796f836aa6d235826fc9c66", + "txsvalid": true, + "confirmations": 20686, + "version": 12, + "weight": 433, + "height": 1, + "txRoot": "845738befb45db6872e37295b39837cd8dc98e77417754fd4ddab5ff169317be", + "order": 1, + "stateRoot": "0000000000000000000000000000000000000000000000000000000000000000", + "bits": "34ad1ec", + "difficulty": 55235052, + "pow": { + "pow_name": "cuckaroom", + "pow_type": 3, + "nonce": 5, + "proof_data": { + "edge_bits": 29, + "circle_nonces": "fa50c20086aef40090ebab01295d5102697fcb0229e83b04b0ac4604fd9a6505118a6f05deb21206e88f9c07184fae075e218408884ed90bdfca630cf9e2a60c12fae80f909b831084669a109390e6105aa9c611aea1e71288408713c670641405f9a714abfcf81557ded81665b20f17a17370170628de17d4ccfb1755515618f5456918efd27918d4f4d218f91bb71954e3b11cb648ca1c9779541d51ee6b1ee12a711e0679131f" + } + }, + "timestamp": "2020-06-24T10:05:33+08:00", + "parentroot": "36988b21b970fe3cbc7381dec7760eea50bc869e3bfbc44856a402fac94d3a8a", + "parents": [ + "36988b21b970fe3cbc7381dec7760eea50bc869e3bfbc44856a402fac94d3a8a" + ], + "children": [ + "000de974590581de8294866535b3af182041a4cb29b71a7680b024e3bd7d12da" + ] + } +} +``` + ### 2.getBlockByNum -#### 函数名:getBlockByNum {number} {fullTx} +#### 函数名:getBlockByNum {number} #### 说明: - number:number指按照当前节点所接受到的区块先后顺序,进行顺序的序号,一个从0开始向上增大的整数值。该序号(Num)与全网其他节点无关,即非BlockDAG共识结果的Block排序。 -- fullTx:true/false,一般为true ### 3.getBlockCount #### 函数名:getBlockCount From 2d8b073549866aa6477e620b0cb53fc1166bf75b Mon Sep 17 00:00:00 2001 From: Alex Wu Date: Wed, 1 Jul 2020 11:57:40 +0800 Subject: [PATCH 09/69] Update _index.md --- .../content/tutorials/qitmeer-rpc/_index.md | 164 ++++++++++++++---- 1 file changed, 126 insertions(+), 38 deletions(-) diff --git a/Document/content/tutorials/qitmeer-rpc/_index.md b/Document/content/tutorials/qitmeer-rpc/_index.md index 9c42c84d..74dba0d1 100644 --- a/Document/content/tutorials/qitmeer-rpc/_index.md +++ b/Document/content/tutorials/qitmeer-rpc/_index.md @@ -7,15 +7,15 @@ weight: 1 # Qitmeer RPC 说明 -### 1. getBlockByOrder -#### 函数名:getBlockByOrder {order} {fullTx} -#### 说明: +## getBlockByOrder +### 函数名:getBlockByOrder {order} {fullTx} +### 说明: - order:区块order,qitmeer采用BlockDAG算法进行共识,对区块的先后顺序进行排序。order指区块序列的序号,一个从0开始增大的整数值。请注意order不是区块的高度。 - verbose: 是否显示详细信息,默认为false - inclTx: 是否包含交易信息,默认为true - fullTx:是否显示完整交易信息,默认为true -实例1: +#### 实例1: ``` curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getBlockByOrder","params":[1,true],"id":1}' https://127.0.0.1:18131 ``` @@ -88,7 +88,7 @@ curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"js ``` -实例2: +#### 实例2: ``` curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getBlockByOrder","params":[1,false],"id":1}' https://127.0.0.1:18131 ``` @@ -101,7 +101,7 @@ curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"js } ``` -实例3: +#### 实例3: ``` curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getBlockByOrder","params":[1,true,false],"id":1}' https://127.0.0.1:18131 ``` @@ -143,27 +143,121 @@ curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"js } ``` -### 2.getBlockByNum -#### 函数名:getBlockByNum {number} -#### 说明: +## getBlockByNum +### 函数名:getBlockByNum {number} +### 说明: - number:number指按照当前节点所接受到的区块先后顺序,进行顺序的序号,一个从0开始向上增大的整数值。该序号(Num)与全网其他节点无关,即非BlockDAG共识结果的Block排序。 -### 3.getBlockCount -#### 函数名:getBlockCount -#### 说明:无参数,获取区块数量 +#### 实例1: -### 4.getMempool -#### 函数名:getMempool -#### 说明:无参数,获取交易池交易 +``` +$ curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getBlockByNum","params":[1,true],"id":1}' https://127.0.0.1:18131 +``` + +``` +{ + "jsonrpc": "2.0", + "id": 1, + "result": { + "hash": "83d98f64ff6517e5899a1c392d91c334ae77a8c7705cd3ca0b147a6470d8eb08", + "txsvalid": false, + "confirmations": 0, + "version": 12, + "weight": 443, + "height": 1, + "txRoot": "0cda5bc3744da7fcdd4a6dbbd72b24a58b9dcd927a171021646af87aa926315d", + "transactions": [ + { + "hex": "010000000114898f3cc6b4de34ca419365fee41fd78d74d71a70a98caa88e1260efb876a79ffffffffffffffff01007841cb020000001976a914499896c7814a6f49fa256bc5feaa5882a665339188ac000000000000000000000000012151080300009030da6dd9162f7777772e6d656572706f6f6c2e636f6d2f32303230", + "txid": "0cda5bc3744da7fcdd4a6dbbd72b24a58b9dcd927a171021646af87aa926315d", + "txhash": "0ac294d88ec9ab3f9cdfff2775d3c881a44cf4b73a1aaa2c2b57e58f055e3168", + "size": 127, + "version": 1, + "locktime": 0, + "expire": 0, + "vin": [ + { + "coinbase": "51080300009030da6dd9162f7777772e6d656572706f6f6c2e636f6d2f32303230", + "sequence": 4294967295 + } + ], + "vout": [ + { + "amount": 12000000000, + "scriptPubKey": { + "asm": "OP_DUP OP_HASH160 499896c7814a6f49fa256bc5feaa5882a6653391 OP_EQUALVERIFY OP_CHECKSIG", + "hex": "76a914499896c7814a6f49fa256bc5feaa5882a665339188ac", + "reqSigs": 1, + "type": "pubkeyhash", + "addresses": [ + "TmVfDq18VqSg735ko9aAo36tFwYww4PBGMC" + ] + } + } + ], + "blockhash": "83d98f64ff6517e5899a1c392d91c334ae77a8c7705cd3ca0b147a6470d8eb08", + "confirmations": 0 + } + ], + "stateRoot": "0000000000000000000000000000000000000000000000000000000000000000", + "bits": "1b00ffff", + "difficulty": 453050367, + "pow": { + "pow_name": "qitmeer_keccak256", + "pow_type": 6, + "nonce": 1067495060 + }, + "timestamp": "2020-06-24T10:06:46+08:00", + "parentroot": "36988b21b970fe3cbc7381dec7760eea50bc869e3bfbc44856a402fac94d3a8a", + "parents": [ + "36988b21b970fe3cbc7381dec7760eea50bc869e3bfbc44856a402fac94d3a8a" + ], + "children": [ + "null" + ] + } +} +``` -### 5.getPeerInfo -#### 函数名:getPeerInfo -#### 说明:无参数,取邻近节点信息 +## getBlockCount +### 函数名:getBlockCount +### 说明:无参数,获取区块数量 -### 6.getNodeInfo -#### 函数名:getNodeInfo -#### 说明:无参数,获取该节点信息 +``` +$ curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getBlockCount","params":[],"id":1}' https://127.0.0.1:18131 +``` + +``` +{ + "jsonrpc": "2.0", + "id": 1, + "result": 21177 +} +``` + +## getMempool +### 函数名:getMempool +### 说明:无参数,获取交易池交易 + +``` +``` +``` +``` + +## getPeerInfo +### 函数名:getPeerInfo +### 说明:无参数,取邻近节点信息 + + +## getNodeInfo +### 函数名:getNodeInfo +### 说明:无参数,获取该节点信息 + +#### 结果说明: + +- confirmations:代表区块中非coinbase输出可用的最小确认数,凡是区块confirmations确认数大于该值的区块中的非coinbase输出可进行交易 +- coinbasematurity:代表区块coinbase输出可以用的最小确认数,凡是区块confirmations确认数大于该值的区块中的coinbase输出可进行交易的第一个条件,第二个条件是必须是蓝色区块,见rpc isBule ``` @@ -200,26 +294,20 @@ curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"js } ``` -### 结果说明: - -- confirmations:代表区块中非coinbase输出可用的最小确认数,凡是区块confirmations确认数大于该值的区块中的非coinbase输出可进行交易 -- coinbasematurity:代表区块coinbase输出可以用的最小确认数,凡是区块confirmations确认数大于该值的区块中的coinbase输出可进行交易的第一个条件,第二个条件是必须是蓝色区块,见rpc isBule - -### 7.isBlue -#### 函数名:isBlue {blockhash} -#### 说明:通过节点判断该块是否为蓝色区块 - +# isBlue +### 函数名:isBlue {blockhash} +### 说明:通过节点判断该块是否为蓝色区块 - blockhash:需要查找额块hash -#### 结果说明: +### 结果说明: - 0:为红色区块,该块coinbase不能交易 - 1:为蓝色区块,该块的coinbase可以交易 - 2:还不能确定是蓝色或红色,待确认 -### 8.getRawTransaction -#### 函数名:getRawTransaction {txid} -#### 说明:通过txid获取交易 +## getRawTransaction +### 函数名:getRawTransaction {txid} +### 说明:通过txid获取交易 ``` @@ -260,14 +348,14 @@ getRawTransaction 000000e4c6b7f5b89827711d412957bfff5c51730df05c2eedd1352468313e ``` -### 9.sendRawTransaction -#### 函数名:sendRawTransaction {sign_raw_tx} {allow_high_fee} -#### 说明:发送交易 +## sendRawTransaction +### 函数名:sendRawTransaction {sign_raw_tx} {allow_high_fee} +### 说明:发送交易 - sign_raw_tx:签名后的交易 - allow_high_fee:允许的最大交易费 -### 例: +#### 实例: ``` From 9c7fa78e3c960fdf6ae9a6d588ab399948fcba7b Mon Sep 17 00:00:00 2001 From: Alex Wu Date: Wed, 1 Jul 2020 12:06:13 +0800 Subject: [PATCH 10/69] Update _index.md --- .../content/tutorials/qitmeer-rpc/_index.md | 249 +++++++++++++++++- 1 file changed, 248 insertions(+), 1 deletion(-) diff --git a/Document/content/tutorials/qitmeer-rpc/_index.md b/Document/content/tutorials/qitmeer-rpc/_index.md index 74dba0d1..ac26b929 100644 --- a/Document/content/tutorials/qitmeer-rpc/_index.md +++ b/Document/content/tutorials/qitmeer-rpc/_index.md @@ -238,17 +238,264 @@ $ curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{" ## getMempool ### 函数名:getMempool -### 说明:无参数,获取交易池交易 +### 说明: +- txType: 交易类型,目前只支持regular。 +- verbose:显示详细信息,目前只支持false。 +#### 实例 ``` +curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getMempool","params":["regular",false],"id":1}' https://127.0.0.1:18131 ``` +输出 ``` +{ + "jsonrpc": "2.0", + "id": 1, + "result": [ + "8df1c9019dd7110e9c3a421f62973ff245cbad435452808363ac291bf2265613" + ] +} ``` ## getPeerInfo ### 函数名:getPeerInfo ### 说明:无参数,取邻近节点信息 +#### 实例 +``` +curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getPeerInfo","params":[],"id":null}' https://127.0.0.1:18131 +``` + +输出: +``` +[ + { + "uuid": "f280f357-ee4a-4958-90bf-685d24129703", + "id": 5, + "addr": "103.1.154.227:18130", + "addrlocal": "10.198.1.66:56261", + "services": "00000009", + "relaytxes": true, + "lastsend": 1593576243, + "lastrecv": 1593576298, + "bytessent": 5029, + "bytesrecv": 7315, + "conntime": 1593575403, + "timeoffset": 0, + "pingtime": 371602, + "version": 20, + "subver": "qitmeer:0.9.0", + "inbound": false, + "banscore": 0, + "syncnode": false, + "graphstate": { + "tips": [ + "0002cf49681506f5b9915c4fa199e76abc8a7d7ade9cafbe1cd1f84ec89e0704 main" + ], + "mainorder": 21199, + "mainheight": 20730, + "layer": 20730 + } + }, + { + "uuid": "b0c3462f-328d-45ba-8e3f-490c205eec85", + "id": 6, + "addr": "47.103.61.128:18130", + "addrlocal": "10.198.1.66:56262", + "services": "00000009", + "relaytxes": true, + "lastsend": 1593576298, + "lastrecv": 1593576299, + "bytessent": 2941, + "bytesrecv": 16892, + "conntime": 1593575403, + "timeoffset": 0, + "pingtime": 871878, + "version": 20, + "subver": "qitmeer:0.9.0", + "inbound": false, + "banscore": 0, + "syncnode": false, + "graphstate": { + "tips": [ + "0002cf49681506f5b9915c4fa199e76abc8a7d7ade9cafbe1cd1f84ec89e0704 main" + ], + "mainorder": 21199, + "mainheight": 20730, + "layer": 20730 + } + }, + { + "uuid": "349a58ee-3537-4576-ba8a-925a27725070", + "id": 7, + "addr": "106.15.102.183:18130", + "addrlocal": "10.198.1.66:56284", + "services": "00000009", + "relaytxes": true, + "lastsend": 1593576254, + "lastrecv": 1593576298, + "bytessent": 1471, + "bytesrecv": 7965, + "conntime": 1593575414, + "timeoffset": 0, + "pingtime": 485255, + "version": 20, + "subver": "qitmeer:0.9.0", + "inbound": false, + "banscore": 0, + "syncnode": false, + "graphstate": { + "tips": [ + "0002cf49681506f5b9915c4fa199e76abc8a7d7ade9cafbe1cd1f84ec89e0704 main" + ], + "mainorder": 21199, + "mainheight": 20730, + "layer": 20730 + } + }, + { + "uuid": "400176fd-8155-405c-ae4f-032948581558", + "id": 8, + "addr": "148.70.34.136:18130", + "addrlocal": "10.198.1.66:56413", + "services": "00000009", + "relaytxes": true, + "lastsend": 1593576307, + "lastrecv": 1593576308, + "bytessent": 1757, + "bytesrecv": 11162, + "conntime": 1593575465, + "timeoffset": 0, + "pingtime": 830143, + "version": 20, + "subver": "qitmeer:0.9.0", + "inbound": false, + "banscore": 0, + "syncnode": false, + "graphstate": { + "tips": [ + "0002cf49681506f5b9915c4fa199e76abc8a7d7ade9cafbe1cd1f84ec89e0704 main" + ], + "mainorder": 21199, + "mainheight": 20730, + "layer": 20730 + } + }, + { + "uuid": "1df6c4ca-dae0-4632-bdb2-d9ef916b7580", + "id": 1, + "addr": "104.224.174.141:18130", + "addrlocal": "10.198.1.66:56182", + "services": "00000009", + "relaytxes": true, + "lastsend": 1593576333, + "lastrecv": 1593576333, + "bytessent": 4259, + "bytesrecv": 1214, + "conntime": 1593575373, + "timeoffset": 0, + "pingtime": 244235, + "version": 20, + "subver": "qitmeer:0.9.0", + "inbound": false, + "banscore": 0, + "syncnode": false, + "graphstate": { + "tips": [ + "3b3b4e71e7ab837635da8442afb98ba4092a2df62cf25e59a58bda518ce81fca main" + ], + "mainorder": 21065, + "mainheight": 20597, + "layer": 20597 + } + }, + { + "uuid": "a8383106-45dc-4028-ae04-74d25ad09f7d", + "id": 2, + "addr": "144.202.90.65:18130", + "addrlocal": "10.198.1.66:56177", + "services": "00000009", + "relaytxes": true, + "lastsend": 1593576333, + "lastrecv": 1593576333, + "bytessent": 5178, + "bytesrecv": 8411, + "conntime": 1593575373, + "timeoffset": 0, + "pingtime": 259579, + "version": 20, + "subver": "qitmeer:0.9.0", + "inbound": false, + "banscore": 0, + "syncnode": true, + "graphstate": { + "tips": [ + "0002cf49681506f5b9915c4fa199e76abc8a7d7ade9cafbe1cd1f84ec89e0704 main" + ], + "mainorder": 21199, + "mainheight": 20730, + "layer": 20730 + } + }, + { + "uuid": "277d5f3f-3af3-486e-92ca-8da59eaa6db9", + "id": 4, + "addr": "122.112.245.133:18130", + "addrlocal": "10.198.1.66:56180", + "services": "00000009", + "relaytxes": true, + "lastsend": 1593576333, + "lastrecv": 1593576334, + "bytessent": 1692, + "bytesrecv": 9459, + "conntime": 1593575373, + "timeoffset": 0, + "pingtime": 414095, + "version": 20, + "subver": "qitmeer:0.9.0", + "inbound": false, + "banscore": 0, + "syncnode": false, + "graphstate": { + "tips": [ + "0002cf49681506f5b9915c4fa199e76abc8a7d7ade9cafbe1cd1f84ec89e0704 main" + ], + "mainorder": 21199, + "mainheight": 20730, + "layer": 20730 + } + }, + { + "uuid": "38d8647f-371d-47c6-924b-ddfe32391a83", + "id": 3, + "addr": "103.29.70.78:18130", + "addrlocal": "10.198.1.66:56175", + "services": "00000009", + "relaytxes": true, + "lastsend": 1593576333, + "lastrecv": 1593576334, + "bytessent": 2421, + "bytesrecv": 6656, + "conntime": 1593575373, + "timeoffset": -1, + "pingtime": 345824, + "version": 21, + "subver": "qitmeer:0.9.1", + "inbound": false, + "banscore": 0, + "syncnode": false, + "graphstate": { + "tips": [ + "0002cf49681506f5b9915c4fa199e76abc8a7d7ade9cafbe1cd1f84ec89e0704 main" + ], + "mainorder": 21199, + "mainheight": 20730, + "layer": 20730 + } + } +] + +``` ## getNodeInfo ### 函数名:getNodeInfo From d306e214fdee13d6e657d933cc753905be4dc840 Mon Sep 17 00:00:00 2001 From: Alex Wu Date: Wed, 1 Jul 2020 12:24:52 +0800 Subject: [PATCH 11/69] Update _index.md --- .../content/tutorials/qitmeer-rpc/_index.md | 112 ++++++++++++------ 1 file changed, 76 insertions(+), 36 deletions(-) diff --git a/Document/content/tutorials/qitmeer-rpc/_index.md b/Document/content/tutorials/qitmeer-rpc/_index.md index ac26b929..62fb7168 100644 --- a/Document/content/tutorials/qitmeer-rpc/_index.md +++ b/Document/content/tutorials/qitmeer-rpc/_index.md @@ -147,13 +147,16 @@ curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"js ### 函数名:getBlockByNum {number} ### 说明: - number:number指按照当前节点所接受到的区块先后顺序,进行顺序的序号,一个从0开始向上增大的整数值。该序号(Num)与全网其他节点无关,即非BlockDAG共识结果的Block排序。 +- verbose: 是否显示详细信息,默认为false +- inclTx: 是否包含交易信息,默认为true +- fullTx:是否显示完整交易信息,默认为true -#### 实例1: +#### 实例: ``` $ curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getBlockByNum","params":[1,true],"id":1}' https://127.0.0.1:18131 ``` - +输出: ``` { "jsonrpc": "2.0", @@ -501,46 +504,57 @@ curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"js ### 函数名:getNodeInfo ### 说明:无参数,获取该节点信息 -#### 结果说明: - -- confirmations:代表区块中非coinbase输出可用的最小确认数,凡是区块confirmations确认数大于该值的区块中的非coinbase输出可进行交易 -- coinbasematurity:代表区块coinbase输出可以用的最小确认数,凡是区块confirmations确认数大于该值的区块中的coinbase输出可进行交易的第一个条件,第二个条件是必须是蓝色区块,见rpc isBule +#### 实例 +``` +curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getNodeInfo","params":[],"id":null}' https://127.0.0.1:18131 ``` +输出: +``` { - "UUID": "d66d8f6d-c5c8-422a-befe-aa0b7ec3c5f1", - "version": 70800, - "protocolversion": 12, - "totalsubsidy": 102856000000000, - "graphstate": { - "tips": [ - "078f9626c4fc6b18dfc6698bddbeb212808f148f31ac0aa777829b56e5469929" - ], - "mainorder": 7912, - "mainheight": 7816, - "layer": 7816 - }, - "timeoffset": 0, - "connections": 5, - "pow_diff": { - "blake2bd_diff": 5.200604516135472e+63, - "cuckaroo_diff": 0.14814815, - "cuckatoo_diff": 2.86419753 - }, - "testnet": true, - "mixnet": false, - "confirmations": 10, - "coinbasematurity": 720, - "errors": "", - "modules": [ - "qitmeer", - "miner", - "test" - ] + "UUID": "dc4dffc6-9c0c-417f-9cb2-a1fdc4877915", + "version": 90100, + "buildversion": "0.9.1+dev-7ae8c17", + "protocolversion": 21, + "totalsubsidy": 254484000000000, + "graphstate": { + "tips": [ + "00006869b1f1e29db24cc528a86370b4355f1dc6a618ac0549495679f0bc484b main" + ], + "mainorder": 21207, + "mainheight": 20738, + "layer": 20738 + }, + "timeoffset": 0, + "connections": 8, + "pow_diff": { + "blake2bd_diff": 1, + "cuckaroo_diff": 1, + "cuckatoo_diff": 1 + }, + "testnet": true, + "mixnet": false, + "confirmations": 10, + "coinbasematurity": 720, + "errors": "", + "modules": [ + "qitmeer", + "miner", + "test" + ] } - ``` + +#### 结果说明: +- confirmations:代表非coinbase交易的UXTO可以被花费的最小确认数,当前的共识的最小确认数为10个确认。 +- coinbasematurity:代表coinbase交易的UXTO可以被花费的最小确认数,当前的共识是720个确认。 +- 注:不论coinbase交易还是非coinbase交易,除了满足各自的最小确认条件外,还需要包含该交易的区块满足如下条件,才能满足该该交易的UTXO可花费: + - 1.)BlockDAG共识约束,即该区块为蓝色区块,详见见rpc isBule + - 2.)该区块为交易合法区块,即区块的`txsvalid`属性为true。详见rpc getBlockByOrder + + + # isBlue ### 函数名:isBlue {blockhash} ### 说明:通过节点判断该块是否为蓝色区块 @@ -551,6 +565,32 @@ curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"js - 1:为蓝色区块,该块的coinbase可以交易 - 2:还不能确定是蓝色或红色,待确认 +#### 实例1 +``` +$ curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"isBlue","params":["0003409cc9bcfc328630982797326e62135d6fc2431db7b85c2a0fe38ff5749c"],"id":1}' https://127.0.0.1:18131 +``` +``` +{ + "jsonrpc": "2.0", + "id": 1, + "result": 2 +} +``` +#### 实例2 + +``` +$ date +Wed Jul 1 12:23:39 CST 2020 +$ curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"isBlue","params": +``` +["0003409cc9bcfc328630982797326e62135d6fc2431db7b85c2a0fe38ff5749c"],"id":1}' https://127.0.0.1:18137|jq . +{ + "jsonrpc": "2.0", + "id": 1, + "result": 1 +} +``` + ## getRawTransaction ### 函数名:getRawTransaction {txid} From bc28ba5e9a6ef4b816ba1e1fb49b73eed07ed047 Mon Sep 17 00:00:00 2001 From: Alex Wu Date: Wed, 1 Jul 2020 12:27:08 +0800 Subject: [PATCH 12/69] Update _index.md --- Document/content/tutorials/qitmeer-rpc/_index.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Document/content/tutorials/qitmeer-rpc/_index.md b/Document/content/tutorials/qitmeer-rpc/_index.md index 62fb7168..2e2bb2f9 100644 --- a/Document/content/tutorials/qitmeer-rpc/_index.md +++ b/Document/content/tutorials/qitmeer-rpc/_index.md @@ -558,7 +558,7 @@ curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"js # isBlue ### 函数名:isBlue {blockhash} ### 说明:通过节点判断该块是否为蓝色区块 -- blockhash:需要查找额块hash +- blockhash:区块hash ### 结果说明: - 0:为红色区块,该块coinbase不能交易 @@ -577,13 +577,16 @@ $ curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{" } ``` #### 实例2 +可以观察到对于是否蓝色区块的判断,由2变为了1。由不能确认,变为的蓝色区块儿。 ``` $ date Wed Jul 1 12:23:39 CST 2020 $ curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"isBlue","params": +["0003409cc9bcfc328630982797326e62135d6fc2431db7b85c2a0fe38ff5749c"],"id":1}' https://127.0.0.1:18131 +``` + ``` -["0003409cc9bcfc328630982797326e62135d6fc2431db7b85c2a0fe38ff5749c"],"id":1}' https://127.0.0.1:18137|jq . { "jsonrpc": "2.0", "id": 1, From 54e57bce8745efbd9499d984986d942ee013b3fd Mon Sep 17 00:00:00 2001 From: Alex Wu Date: Wed, 1 Jul 2020 12:29:01 +0800 Subject: [PATCH 13/69] Update _index.md --- Document/content/tutorials/qitmeer-rpc/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Document/content/tutorials/qitmeer-rpc/_index.md b/Document/content/tutorials/qitmeer-rpc/_index.md index 2e2bb2f9..5f14ed81 100644 --- a/Document/content/tutorials/qitmeer-rpc/_index.md +++ b/Document/content/tutorials/qitmeer-rpc/_index.md @@ -577,7 +577,7 @@ $ curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{" } ``` #### 实例2 -可以观察到对于是否蓝色区块的判断,由2变为了1。由不能确认,变为的蓝色区块儿。 +可以观察到对于是否蓝色区块的判断结果,由2变为1。即由不能确认变为蓝色区块。 ``` $ date From 3f3d0c18c24071f18bcd6eb917a58f57c2490010 Mon Sep 17 00:00:00 2001 From: Alex Wu Date: Wed, 1 Jul 2020 12:52:40 +0800 Subject: [PATCH 14/69] Update _index.md --- .../content/tutorials/qitmeer-rpc/_index.md | 86 ++++++++++++------- 1 file changed, 53 insertions(+), 33 deletions(-) diff --git a/Document/content/tutorials/qitmeer-rpc/_index.md b/Document/content/tutorials/qitmeer-rpc/_index.md index 5f14ed81..9d0d4262 100644 --- a/Document/content/tutorials/qitmeer-rpc/_index.md +++ b/Document/content/tutorials/qitmeer-rpc/_index.md @@ -598,42 +598,62 @@ $ curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{" ## getRawTransaction ### 函数名:getRawTransaction {txid} ### 说明:通过txid获取交易 +- txid 交易id 为一个256位hash值。 +- verbose 是否显示详细信息,默认为false +#### 实例 +``` +curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getRawTransaction","params":["c259a4dfb7eaaae92ab246f14762541581671135cd6030ac29d8c34cf77e9f32",true],"id":1}' https://127.0.0.1:18131 +``` +输出 ``` - -getRawTransaction 000000e4c6b7f5b89827711d412957bfff5c51730df05c2eedd1352468313eca - - { - "hex": "0100000001cf6849e307726cfd51ad93b994c4dcdc390b782ad34cfafbcacf47f17c639606ffffffffffffffff010042dc06030000001976a914883e0d08cf453696b756baabadae1da8ab3f227888ac000000000000000001435c08d0b7b3581e39345913363432373832353337303636343531353533362431613037373964612d616466352d346365392d613962652d626238613732636639333232", - "txid": "df492c0f85fee7fd883c45dbb1bbbcec4bf2ea1e315f33aee0e27bddaede35c3", - "txhash": "26f8a70736ef23ac4ba57c91563360ba44ec8c0b448c2b20d05ad5387040acaa", - "size": 157, - "version": 1, - "locktime": 0, - "expire": 0, - "vin": [ - { - "coinbase": "5c08d0b7b3581e39345913363432373832353337303636343531353533362431613037373964612d616466352d346365392d613962652d626238613732636639333232", - "sequence": 4294967295 - } - ], - "vout": [ - { - "amount": 13000000000, - "scriptPubKey": { - "asm": "OP_DUP OP_HASH160 883e0d08cf453696b756baabadae1da8ab3f2278 OP_EQUALVERIFY OP_CHECKSIG", - "hex": "76a914883e0d08cf453696b756baabadae1da8ab3f227888ac", - "reqSigs": 1, - "type": "pubkeyhash", - "addresses": [ - "TmbNTwPm9aTN7TtStnJjrcjsaRJWm4gt3Fs" - ] - } - } - ], - "blockhash": "3df0e5bb739d7ac0e4d34f621514d485dff3a3c0be31c161cc891787172caade", - "confirmations": 7838 + "hex": "0100000001dc7d54db024a1ef06e38b85ab01af2d60043e3d36b5411691224c05dcf36f63c01000000ffffffff02659ca300000000001976a91406e2097d585337cdd10aefa09994b511127af0bb88acf0e8cd6f230200001976a914fe27c90d4ed4de3269c0bb9ae1d7639865e3bf2888ac00000000000000008015fc5e016b48304502210090910aa0190a6571319b0b638bfbb593582575703abdd4f1a7f0da2812cda7d102205dae6fee28396bfeb8f1b814884d8d03ab0dd9f30b171d906c24914ba2f85b1a012103cd4fa2ea2688ac9e0a62584635244f572d22c13730d5576722d6571aabfddca8", + "txid": "c259a4dfb7eaaae92ab246f14762541581671135cd6030ac29d8c34cf77e9f32", + "txhash": "9b603ba3b17fd8491749ac366a5064d8b7b70be02568e405406a9acd70e971a8", + "size": 235, + "version": 1, + "locktime": 0, + "timestamp": "2020-07-01T12:48:00+08:00", + "expire": 0, + "vin": [ + { + "txid": "3cf636cf5dc024126911546bd3e34300d6f21ab05ab8386ef01e4a02db547ddc", + "vout": 1, + "sequence": 4294967295, + "scriptSig": { + "asm": "304502210090910aa0190a6571319b0b638bfbb593582575703abdd4f1a7f0da2812cda7d102205dae6fee28396bfeb8f1b814884d8d03ab0dd9f30b171d906c24914ba2f85b1a01 03cd4fa2ea2688ac9e0a62584635244f572d22c13730d5576722d6571aabfddca8", + "hex": "48304502210090910aa0190a6571319b0b638bfbb593582575703abdd4f1a7f0da2812cda7d102205dae6fee28396bfeb8f1b814884d8d03ab0dd9f30b171d906c24914ba2f85b1a012103cd4fa2ea2688ac9e0a62584635244f572d22c13730d5576722d6571aabfddca8" + } + } + ], + "vout": [ + { + "amount": 10722405, + "scriptPubKey": { + "asm": "OP_DUP OP_HASH160 06e2097d585337cdd10aefa09994b511127af0bb OP_EQUALVERIFY OP_CHECKSIG", + "hex": "76a91406e2097d585337cdd10aefa09994b511127af0bb88ac", + "reqSigs": 1, + "type": "pubkeyhash", + "addresses": [ + "TmPaUYQuUtfCysrYVHc4AdhpVHxw7EskHTP" + ] + } + }, + { + "amount": 2351222876400, + "scriptPubKey": { + "asm": "OP_DUP OP_HASH160 fe27c90d4ed4de3269c0bb9ae1d7639865e3bf28 OP_EQUALVERIFY OP_CHECKSIG", + "hex": "76a914fe27c90d4ed4de3269c0bb9ae1d7639865e3bf2888ac", + "reqSigs": 1, + "type": "pubkeyhash", + "addresses": [ + "Tmn7vzzSrvAPNLtwpD5YjiWwVUBD74Hjdww" + ] + } + } + ], + "confirmations": 0 } ``` From 9a39901ff90004286b105cca2e0dda9b9ac233ab Mon Sep 17 00:00:00 2001 From: Alex Wu Date: Wed, 1 Jul 2020 13:21:28 +0800 Subject: [PATCH 15/69] Update _index.md --- Document/content/tutorials/qitmeer-rpc/_index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Document/content/tutorials/qitmeer-rpc/_index.md b/Document/content/tutorials/qitmeer-rpc/_index.md index 9d0d4262..098af479 100644 --- a/Document/content/tutorials/qitmeer-rpc/_index.md +++ b/Document/content/tutorials/qitmeer-rpc/_index.md @@ -10,7 +10,7 @@ weight: 1 ## getBlockByOrder ### 函数名:getBlockByOrder {order} {fullTx} ### 说明: -- order:区块order,qitmeer采用BlockDAG算法进行共识,对区块的先后顺序进行排序。order指区块序列的序号,一个从0开始增大的整数值。请注意order不是区块的高度。 +- order:区块order,qitmeer采用BlockDAG算法进行共识,对区块的先后顺序进行排序。order指区块序列的序号,是一个从0开始,按顺序连续递增的整数值。请注意order不是区块的高度。 - verbose: 是否显示详细信息,默认为false - inclTx: 是否包含交易信息,默认为true - fullTx:是否显示完整交易信息,默认为true @@ -146,7 +146,7 @@ curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"js ## getBlockByNum ### 函数名:getBlockByNum {number} ### 说明: -- number:number指按照当前节点所接受到的区块先后顺序,进行顺序的序号,一个从0开始向上增大的整数值。该序号(Num)与全网其他节点无关,即非BlockDAG共识结果的Block排序。 +- number:number指按照当前节点所观察到的区块所构造的本地DAG图的区块序号,是一个从0开始,按顺序递增的连续整数值。该序号(Num)与全网其他节点无关,即并非BlockDAG共识结果的Block排序,请注意该方法和`getBlockByOder`的区别。该方法只用于帮助二级应用构造特殊业务场景而存在,返回结构并非BlockDAG共识结果,使用时请注意。 - verbose: 是否显示详细信息,默认为false - inclTx: 是否包含交易信息,默认为true - fullTx:是否显示完整交易信息,默认为true From 0136b7b2285bb6b40ed88aba34ed7a1a1978e1a4 Mon Sep 17 00:00:00 2001 From: Alex Wu Date: Wed, 1 Jul 2020 15:38:18 +0800 Subject: [PATCH 16/69] Update _index.md --- .../content/tutorials/qitmeer-rpc/_index.md | 117 +++++++++++++++++- 1 file changed, 115 insertions(+), 2 deletions(-) diff --git a/Document/content/tutorials/qitmeer-rpc/_index.md b/Document/content/tutorials/qitmeer-rpc/_index.md index 098af479..93a942de 100644 --- a/Document/content/tutorials/qitmeer-rpc/_index.md +++ b/Document/content/tutorials/qitmeer-rpc/_index.md @@ -8,7 +8,7 @@ weight: 1 # Qitmeer RPC 说明 ## getBlockByOrder -### 函数名:getBlockByOrder {order} {fullTx} +### 函数名:getBlockByOrder {order} {verbose} {inclTx} {fullTx} ### 说明: - order:区块order,qitmeer采用BlockDAG算法进行共识,对区块的先后顺序进行排序。order指区块序列的序号,是一个从0开始,按顺序连续递增的整数值。请注意order不是区块的高度。 - verbose: 是否显示详细信息,默认为false @@ -144,7 +144,7 @@ curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"js ``` ## getBlockByNum -### 函数名:getBlockByNum {number} +### 函数名:getBlockByNum {number} {verbose} {inclTx} {fullTx} ### 说明: - number:number指按照当前节点所观察到的区块所构造的本地DAG图的区块序号,是一个从0开始,按顺序递增的连续整数值。该序号(Num)与全网其他节点无关,即并非BlockDAG共识结果的Block排序,请注意该方法和`getBlockByOder`的区别。该方法只用于帮助二级应用构造特殊业务场景而存在,返回结构并非BlockDAG共识结果,使用时请注意。 - verbose: 是否显示详细信息,默认为false @@ -222,6 +222,116 @@ $ curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{" } ``` +## getBlocK +### 函数名:getBlocK {blockhash} {verbose} {inclTx} {fullTx} +### 说明:根据区块hash获取区块 +- blockhash : 256位区块hash +- verbose: 是否显示详细信息,默认为false +- inclTx: 是否包含交易信息,默认为true +- fullTx:是否显示完整交易信息,默认为true + +#### 实例: +``` +curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getBlock","params":["98294db0634d5afed36554a60d4565a6507e3a78dfb8cc66cc08ba29f328c682",true,true,false],"id":1}' https://127.0.0.1:18131 +``` +输出 +``` +{ + "jsonrpc": "2.0", + "id": 1, + "result": { + "hash": "0002232d1b2da3609633f148d383d986678bb7d80a6c71212a90dc5ad220ded5", + "txsvalid": true, + "confirmations": 5, + "version": 12, + "weight": 435, + "height": 21128, + "txRoot": "39ff496a208b7cf8b701b24ea601244df174ceea3c9a7917be81464f30a8005a", + "order": 21599, + "transactions": [ + "39ff496a208b7cf8b701b24ea601244df174ceea3c9a7917be81464f30a8005a" + ], + "stateRoot": "0000000000000000000000000000000000000000000000000000000000000000", + "bits": "402854d", + "difficulty": 67274061, + "pow": { + "pow_name": "cuckaroom", + "pow_type": 3, + "nonce": 148224134, + "proof_data": { + "edge_bits": 29, + "circle_nonces": "78a152001480af0103ce31027bea3f02bccb5d02f47a4803126ece060ef4e806832c7c078b67f0075607050947014209569c9209387bbc0a34b6cf0a4c28c60bf3ef370c58ad030d7d010f0f652f1b117943d111374be01217341e13fef75f1301bb9b138e28a01364fc9214938acf14a27559150c54d117f4f8601852c7ed18874cf318037313196ffc4419f5e8bd1acc8fcc1b7656f31b26d64f1c3566821d18d9a71fa107b41f" + } + }, + "timestamp": "2020-07-01T15:19:28+08:00", + "parentroot": "4621ad5d3951114ca93b1f27b42f39c0f16557d2a1efb1e2c7e9ce8ba087bd1f", + "parents": [ + "4621ad5d3951114ca93b1f27b42f39c0f16557d2a1efb1e2c7e9ce8ba087bd1f" + ], + "children": [ + "f43a6e8e015c3ef9db792c801290a0219cf9a477559941fb3dd792df1fb5c7e4" + ] + } +} + + +``` + +## getBlocKV2 +### 函数名:getBlocK {blockhash} {verbose} {inclTx} {fullTx} +### 说明:根据区块hash获取区块 版本2 +- blockhash : 256位区块hash +- verbose: 是否显示详细信息,默认为false +- inclTx: 是否包含交易信息,默认为true +- fullTx:是否显示完整交易信息,默认为true + +V2版本RPC将交易手续费显示在单独的`transactionfee`属性中。而之前版本的交易手续费体现在coinbase的Amount中,和挖矿奖励合并显示。请注意,不论使用V1或者V2版本的API,只影响JSON数据的显示。内部的数据模型和共识模型是完全是一致的。 + +#### 实例 + +``` +curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getBlockV2","params":["98294db0634d5afed36554a60d4565a6507e3a78dfb8cc66cc08ba29f328c682",true,true,false],"id":1}' https://127.0.0.1:18131 +``` + +输出: +``` +{ + "jsonrpc": "2.0", + "id": 1, + "result": { + "hash": "98294db0634d5afed36554a60d4565a6507e3a78dfb8cc66cc08ba29f328c682", + "txsvalid": true, + "confirmations": 304, + "version": 12, + "weight": 682, + "height": 20831, + "txRoot": "040807f45457c94ed905bf72ed923154a5e951278e80a5c0eb2de0d7b269c5c1", + "order": 21300, + "transactions": [ + "5844ca2e091f8c2a770f4a0ff23318ae780b9e3a9b2076cc27b8c493dce30c03", + "c259a4dfb7eaaae92ab246f14762541581671135cd6030ac29d8c34cf77e9f32" + ], + "transactionfee": 32000, + "stateRoot": "0000000000000000000000000000000000000000000000000000000000000000", + "bits": "1a1c60ed", + "difficulty": 438067437, + "pow": { + "pow_name": "qitmeer_keccak256", + "pow_type": 6, + "nonce": 1457503796 + }, + "timestamp": "2020-07-01T12:48:52+08:00", + "parentroot": "000073e5c2787d1d2a04358c8b2fad422a602a38a6070570c2d8b724c054987f", + "parents": [ + "000073e5c2787d1d2a04358c8b2fad422a602a38a6070570c2d8b724c054987f" + ], + "children": [ + "00018c75188cc658705af615684b095bbc85a2dde6772e4bf3929b5d5505f5fb" + ] + } +} +``` + ## getBlockCount ### 函数名:getBlockCount @@ -239,6 +349,9 @@ $ curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{" } ``` + + + ## getMempool ### 函数名:getMempool ### 说明: From a89847e5861757b873e7386df19473075ecfb3e7 Mon Sep 17 00:00:00 2001 From: Alex Wu Date: Wed, 1 Jul 2020 15:41:00 +0800 Subject: [PATCH 17/69] Update _index.md --- .../content/tutorials/qitmeer-rpc/_index.md | 39 ++++++++----------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/Document/content/tutorials/qitmeer-rpc/_index.md b/Document/content/tutorials/qitmeer-rpc/_index.md index 93a942de..22f0ec0a 100644 --- a/Document/content/tutorials/qitmeer-rpc/_index.md +++ b/Document/content/tutorials/qitmeer-rpc/_index.md @@ -240,41 +240,36 @@ curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"js "jsonrpc": "2.0", "id": 1, "result": { - "hash": "0002232d1b2da3609633f148d383d986678bb7d80a6c71212a90dc5ad220ded5", + "hash": "98294db0634d5afed36554a60d4565a6507e3a78dfb8cc66cc08ba29f328c682", "txsvalid": true, - "confirmations": 5, + "confirmations": 338, "version": 12, - "weight": 435, - "height": 21128, - "txRoot": "39ff496a208b7cf8b701b24ea601244df174ceea3c9a7917be81464f30a8005a", - "order": 21599, + "weight": 682, + "height": 20831, + "txRoot": "040807f45457c94ed905bf72ed923154a5e951278e80a5c0eb2de0d7b269c5c1", + "order": 21300, "transactions": [ - "39ff496a208b7cf8b701b24ea601244df174ceea3c9a7917be81464f30a8005a" + "5844ca2e091f8c2a770f4a0ff23318ae780b9e3a9b2076cc27b8c493dce30c03", + "c259a4dfb7eaaae92ab246f14762541581671135cd6030ac29d8c34cf77e9f32" ], "stateRoot": "0000000000000000000000000000000000000000000000000000000000000000", - "bits": "402854d", - "difficulty": 67274061, + "bits": "1a1c60ed", + "difficulty": 438067437, "pow": { - "pow_name": "cuckaroom", - "pow_type": 3, - "nonce": 148224134, - "proof_data": { - "edge_bits": 29, - "circle_nonces": "78a152001480af0103ce31027bea3f02bccb5d02f47a4803126ece060ef4e806832c7c078b67f0075607050947014209569c9209387bbc0a34b6cf0a4c28c60bf3ef370c58ad030d7d010f0f652f1b117943d111374be01217341e13fef75f1301bb9b138e28a01364fc9214938acf14a27559150c54d117f4f8601852c7ed18874cf318037313196ffc4419f5e8bd1acc8fcc1b7656f31b26d64f1c3566821d18d9a71fa107b41f" - } + "pow_name": "qitmeer_keccak256", + "pow_type": 6, + "nonce": 1457503796 }, - "timestamp": "2020-07-01T15:19:28+08:00", - "parentroot": "4621ad5d3951114ca93b1f27b42f39c0f16557d2a1efb1e2c7e9ce8ba087bd1f", + "timestamp": "2020-07-01T12:48:52+08:00", + "parentroot": "000073e5c2787d1d2a04358c8b2fad422a602a38a6070570c2d8b724c054987f", "parents": [ - "4621ad5d3951114ca93b1f27b42f39c0f16557d2a1efb1e2c7e9ce8ba087bd1f" + "000073e5c2787d1d2a04358c8b2fad422a602a38a6070570c2d8b724c054987f" ], "children": [ - "f43a6e8e015c3ef9db792c801290a0219cf9a477559941fb3dd792df1fb5c7e4" + "00018c75188cc658705af615684b095bbc85a2dde6772e4bf3929b5d5505f5fb" ] } } - - ``` ## getBlocKV2 From dee72c46158139f9ac7cfc8036dc94cd097d282f Mon Sep 17 00:00:00 2001 From: Alex Wu Date: Wed, 1 Jul 2020 15:46:58 +0800 Subject: [PATCH 18/69] Update _index.md --- .../content/tutorials/qitmeer-rpc/_index.md | 42 ++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/Document/content/tutorials/qitmeer-rpc/_index.md b/Document/content/tutorials/qitmeer-rpc/_index.md index 22f0ec0a..76502500 100644 --- a/Document/content/tutorials/qitmeer-rpc/_index.md +++ b/Document/content/tutorials/qitmeer-rpc/_index.md @@ -332,10 +332,11 @@ curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"js ### 函数名:getBlockCount ### 说明:无参数,获取区块数量 +#### 实例 ``` $ curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getBlockCount","params":[],"id":1}' https://127.0.0.1:18131 ``` - +输出 ``` { "jsonrpc": "2.0", @@ -344,8 +345,47 @@ $ curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{" } ``` +## getBlockhashByRange +### 函数名 getBlockhashByRange {start} {end} +### 说明:获取在某区间order范围的一组Blockhash +- start 开始区块order +- end 结束区块order +#### 实例 +``` +curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getBlockhashByRange","params":[100,125],"id":null}' https://127.0.0.1:18131 +``` +输出: +``` +[ + "000c018b33589f2f731d9cfc26d5d329fefce1045b9d1e5b22e3e8e71760e0e7", + "68d1170256afeae9591bcb49c99734e582f59860d0917e449c03f08c269957a3", + "0010b1aef1910f1c5662e0991d8ba1d564e3df360c6235f6890486a35a4ca000", + "0013a4646accf2f11c96e59d51f07be4a510a0e9e12174fd569ae3744a38de24", + "0016242fcaf6effecf083aa2b7716f8825addb31530ce3141da7d50293f3dce2", + "00173736aba73591a7ce051c0a4e4605edcbafe48149849880d9b8c7781b538e", + "0007ae2245017244e3ca355bcbe2947f69ab1ab5c52112bff003842363298395", + "0016b7148e99c60cf74c96cdeffc8a966817f163013dc3fb89684946d7cbb7bc", + "000edcf8a5dad7cfdf25461359678421e51930614d73a965b8532bb608c00025", + "000ea156ad8ef5c90d0c5855a5352a9e156d8d778ee53daa5bb9145268b17693", + "2fa46ac8fa234ee5950d74fdaf0fd60d6fed406f1208d10ecff11026eaa45c86", + "000c5816df76fd7b6662cf2c9c57c87f050c1b101c5466a1fa6bbe5eebebbd22", + "178fc77f4af15e977861510c81f957b6518215ea483f847caa67e0daeb8ac0ce", + "0014fa7d8499812b5a7f404efa82b4959db5542bae55e60035cc0d5ae0ef29fa", + "0014c1c5b794c7fa91271841b6c4f63f6216529d7c9076e2e2f861e47bd31290", + "000207d33febab535405082c9bd78cd463048143429b404a120faa95b139d9b8", + "0628f63bf041cab884e55192a6bf6615c198390821542a1c3b53ad3fafc9bbd1", + "000cff170cde98b09f80c76109843d178f67dc7c64d25f6886f93ce0cd25fd7a", + "000b4c1f4a87f97b5ef7727f2fc4ffb9f5cf34b9c759e12dfb4954cfeb6f65fb", + "5d138960ca76057f379d8d6cb82bf6a93b7b2c63d1a4950d15305d12124f3b89", + "7d6d9140f516d9a12ca2109a89a17c777425b73596b9b4a7a4a4d4013da6ddec", + "2f3817197e885e805229c4be3cf94b9b7581b4e6975068e5583b8295b648d690", + "46e97b2fda23be092abd8c163c3d2f0a60018904484fd688918b7c5f257686e0", + "00015f28637b8442e2399924d0db703efebd33ab3176d4ccb7b762a28529087e", + "0011cc2a9cea757a2aaa235f27f41f00e3e2ed87282175fe76767c4f50b3aa05" +] +``` ## getMempool ### 函数名:getMempool From 509760a317c31a79e0cc2200b5aa4265c734b131 Mon Sep 17 00:00:00 2001 From: Alex Wu Date: Wed, 1 Jul 2020 15:59:48 +0800 Subject: [PATCH 19/69] Update _index.md --- .../content/tutorials/qitmeer-rpc/_index.md | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/Document/content/tutorials/qitmeer-rpc/_index.md b/Document/content/tutorials/qitmeer-rpc/_index.md index 76502500..84f62266 100644 --- a/Document/content/tutorials/qitmeer-rpc/_index.md +++ b/Document/content/tutorials/qitmeer-rpc/_index.md @@ -330,7 +330,7 @@ curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"js ## getBlockCount ### 函数名:getBlockCount -### 说明:无参数,获取区块数量 +### 说明:无参数,获取区块数量。 #### 实例 ``` @@ -345,6 +345,25 @@ $ curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{" } ``` +## getBlockBestHash +### 函数名:getBlockBestHash +### 说明:无参数,获取当前最大区块Order的区块hash +### 实例 + +``` +curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getBestBlockHash","params":[],"id":1}' https://127.0.0.1:18131 +``` +输出 +``` + +{ + "jsonrpc": "2.0", + "id": 1, + "result": "000044c83486609eee3c5bb46cd539eb022ea05ed86c40ef4e6710357f225ea3" +} +``` + + ## getBlockhashByRange ### 函数名 getBlockhashByRange {start} {end} ### 说明:获取在某区间order范围的一组Blockhash From 7aa741b13d337d0e1abde982638bca9b22731788 Mon Sep 17 00:00:00 2001 From: Alex Wu Date: Wed, 1 Jul 2020 16:19:53 +0800 Subject: [PATCH 20/69] Update _index.md --- .../content/tutorials/qitmeer-rpc/_index.md | 57 ++++++++++++++++++- 1 file changed, 56 insertions(+), 1 deletion(-) diff --git a/Document/content/tutorials/qitmeer-rpc/_index.md b/Document/content/tutorials/qitmeer-rpc/_index.md index 84f62266..ee9a227b 100644 --- a/Document/content/tutorials/qitmeer-rpc/_index.md +++ b/Document/content/tutorials/qitmeer-rpc/_index.md @@ -327,10 +327,48 @@ curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"js } ``` +## getBlockHeader +### 函数名:getBlockHeader +### 说明:无参数,当前已定序的区块数量。(注:该数量-1即为当前最大的Block order ) +- blockhash : 256位区块hash +- verbose :是否显示详细信息,默认为false + +#### 实例 +``` +$ curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getBlockHeader","params":["0011cc2a9cea757a2aaa235f27f41f00e3e2ed87282175fe76767c4f50b3aa05",true],"id":1}' https://127.0.0.1:18131 +``` +输出 +``` +{ + "jsonrpc": "2.0", + "id": 1, + "result": { + "hash": "0011cc2a9cea757a2aaa235f27f41f00e3e2ed87282175fe76767c4f50b3aa05", + "confirmations": 21145, + "version": 12, + "parentroot": "00015f28637b8442e2399924d0db703efebd33ab3176d4ccb7b762a28529087e", + "txRoot": "c564f2c2e6fd7b7db1d09272a607388861f2bfe34550d5f7176ed4652459bbd7", + "stateRoot": "0000000000000000000000000000000000000000000000000000000000000000", + "difficulty": 55235052, + "layer": 116, + "time": 1592967313, + "pow": { + "pow_name": "cuckaroom", + "pow_type": 3, + "nonce": 19, + "proof_data": { + "edge_bits": 29, + "circle_nonces": "2b1c9b002544650140638b036dd04804cbd65304c5963305f3184d055dca110674761d0646e81d0639683d06718d1007c85c150744b960089a99a40878dff708e06320097e0d67098fa51d0a4e7c5f0acc8ad30b1e2e4e0ce5c0990cd0fcb80e1013ba0e3b614d0f5ba19c0f4904b90f0c190f12d5869012f45b621415193315ec0727160314e417b51938185314c218281ce318ca84ec18dd1b001941b7d619a571881e6f4f831f" + } + } + } +} +``` + ## getBlockCount ### 函数名:getBlockCount -### 说明:无参数,获取区块数量。 +### 说明:无参数,当前已定序的区块数量。(注:该数量-1即为当前最大的Block order ) #### 实例 ``` @@ -345,6 +383,23 @@ $ curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{" } ``` +## getBlockTotal +### 函数名:getBlockTotal +### 说明:无参数,该节点所有已知的区块总数量。(注:该数量包含可能存在的当前还未被BlockDAG共识定序的区块 ) + +#### 实例 +``` +$ curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getBlockTotal","params":[],"id":1}' https://127.0.0.1:18131 +``` +输出 +``` +{ + "jsonrpc": "2.0", + "id": 1, + "result": 21177 +} +``` + ## getBlockBestHash ### 函数名:getBlockBestHash ### 说明:无参数,获取当前最大区块Order的区块hash From ab83fec050713f6ec882bae06410bf71522cfa13 Mon Sep 17 00:00:00 2001 From: Alex Wu Date: Wed, 1 Jul 2020 16:59:37 +0800 Subject: [PATCH 21/69] Update _index.md --- .../content/tutorials/qitmeer-rpc/_index.md | 60 +++++++++++++++++-- 1 file changed, 55 insertions(+), 5 deletions(-) diff --git a/Document/content/tutorials/qitmeer-rpc/_index.md b/Document/content/tutorials/qitmeer-rpc/_index.md index ee9a227b..054a7b8b 100644 --- a/Document/content/tutorials/qitmeer-rpc/_index.md +++ b/Document/content/tutorials/qitmeer-rpc/_index.md @@ -9,7 +9,7 @@ weight: 1 ## getBlockByOrder ### 函数名:getBlockByOrder {order} {verbose} {inclTx} {fullTx} -### 说明: +### 说明:返回指定Order的Block - order:区块order,qitmeer采用BlockDAG算法进行共识,对区块的先后顺序进行排序。order指区块序列的序号,是一个从0开始,按顺序连续递增的整数值。请注意order不是区块的高度。 - verbose: 是否显示详细信息,默认为false - inclTx: 是否包含交易信息,默认为true @@ -328,10 +328,12 @@ curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"js ``` ## getBlockHeader -### 函数名:getBlockHeader -### 说明:无参数,当前已定序的区块数量。(注:该数量-1即为当前最大的Block order ) +### 函数名:getBlockHeader {blockhash} {verbose} +### 说明:无参数,当前已定序的区块数量。 - blockhash : 256位区块hash - verbose :是否显示详细信息,默认为false +注:该数量-1即为当前最大的Block order + #### 实例 ``` @@ -368,7 +370,8 @@ $ curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{" ## getBlockCount ### 函数名:getBlockCount -### 说明:无参数,当前已定序的区块数量。(注:该数量-1即为当前最大的Block order ) +### 说明:无参数,当前已定序的区块数量。 +该数量-1即为当前最大的Block order #### 实例 ``` @@ -385,7 +388,8 @@ $ curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{" ## getBlockTotal ### 函数名:getBlockTotal -### 说明:无参数,该节点所有已知的区块总数量。(注:该数量包含可能存在的当前还未被BlockDAG共识定序的区块 ) +### 说明:无参数,该节点所有已知的区块总数量。 +该数量包含可能存在的当前还未被BlockDAG共识定序的区块 #### 实例 ``` @@ -461,6 +465,52 @@ curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"js ``` +## isOnMainChain +### 函数名 isOnMainChain {blockhash} +### 说明:判断该block是否在主链上 + +#### 实例 +``` +curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"isOnMainChain","params":["0011cc2a9cea757a2aaa235f27f41f00e3e2ed87282175fe76767c4f50b3aa05"],"id":1}' https://127.0.0.1:18131 +``` + +输出 +``` +{ + "jsonrpc": "2.0", + "id": 1, + "result": "true" +} +``` + +## getMainChainHeight +### 函数名 getMainChainHeight +### 说明:无参数,得到当前的主链高度。 + +#### 实例 +``` +$ curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getMainChainHeight","params":[],"id":1}' https://127.0.0.1:18131 +``` +输出 +``` +{ + "jsonrpc": "2.0", + "id": 1, + "result": "21275" +} +``` + + +## getOrphansTotal +### 函数名 getOrphansTotal +### 说明:无参数,得到当前节点的孤儿区块的数量。 +孤儿区块指 + +``` +curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getOrphansTotal","params":[],"id":null}' https://127.0.0.1:18136 +``` + + ## getMempool ### 函数名:getMempool ### 说明: From 10971d4e196e9ac50ce9cb5ff8e473b827c15a90 Mon Sep 17 00:00:00 2001 From: Alex Wu Date: Wed, 1 Jul 2020 17:01:37 +0800 Subject: [PATCH 22/69] Update _index.md --- Document/content/tutorials/qitmeer-rpc/_index.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Document/content/tutorials/qitmeer-rpc/_index.md b/Document/content/tutorials/qitmeer-rpc/_index.md index 054a7b8b..ee666125 100644 --- a/Document/content/tutorials/qitmeer-rpc/_index.md +++ b/Document/content/tutorials/qitmeer-rpc/_index.md @@ -504,10 +504,20 @@ $ curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{" ## getOrphansTotal ### 函数名 getOrphansTotal ### 说明:无参数,得到当前节点的孤儿区块的数量。 -孤儿区块指 +孤儿区块指当前未关联到DAG中的区块。 +#### 实例 +``` +curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getOrphansTotal","params":[],"id":null}' https://127.0.0.1:18131 +``` +输出 ``` -curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getOrphansTotal","params":[],"id":null}' https://127.0.0.1:18136 +{ + "jsonrpc": "2.0", + "id": null, + "result": 0 +} + ``` From 55a84545009038ca1dc159272b0cfe0c76b1ce71 Mon Sep 17 00:00:00 2001 From: Alex Wu Date: Wed, 1 Jul 2020 17:59:51 +0800 Subject: [PATCH 23/69] Update _index.md --- .../content/tutorials/qitmeer-rpc/_index.md | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Document/content/tutorials/qitmeer-rpc/_index.md b/Document/content/tutorials/qitmeer-rpc/_index.md index ee666125..15798abe 100644 --- a/Document/content/tutorials/qitmeer-rpc/_index.md +++ b/Document/content/tutorials/qitmeer-rpc/_index.md @@ -520,6 +520,27 @@ curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"js ``` +## getTips +### 函数名 getTips +### 说明:得到Tip Block列表 +Tips列表是当前节点的DAG图的Tips Block的hash列表 + +#### 实例 +``` +curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"tips","params":[],"id":null}' https://127.0.0.1:18131 +``` + +``` +{ + "jsonrpc": "2.0", + "id": null, + "result": [ + "83d98f64ff6517e5899a1c392d91c334ae77a8c7705cd3ca0b147a6470d8eb08", + "00001ae85f5c90cc2f1f9ae5b1ac148145555d884f2c7d986cb3df250c8c3ecc" + ] +} +``` + ## getMempool ### 函数名:getMempool From 25ac43fa789cac0ec8a7c9981ca1512306510020 Mon Sep 17 00:00:00 2001 From: Alex Wu Date: Wed, 1 Jul 2020 18:17:37 +0800 Subject: [PATCH 24/69] Update _index.md --- .../content/tutorials/qitmeer-rpc/_index.md | 38 ++++++++++++++++++- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/Document/content/tutorials/qitmeer-rpc/_index.md b/Document/content/tutorials/qitmeer-rpc/_index.md index 15798abe..6d03fdc2 100644 --- a/Document/content/tutorials/qitmeer-rpc/_index.md +++ b/Document/content/tutorials/qitmeer-rpc/_index.md @@ -543,7 +543,7 @@ curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"js ## getMempool -### 函数名:getMempool +### 函数名:getMempool {txtype} {verbose} ### 说明: - txType: 交易类型,目前只支持regular。 - verbose:显示详细信息,目前只支持false。 @@ -858,7 +858,7 @@ curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"js -# isBlue +## isBlue ### 函数名:isBlue {blockhash} ### 说明:通过节点判断该块是否为蓝色区块 - blockhash:区块hash @@ -898,6 +898,40 @@ $ curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{" ``` +## getFees +### 函数名:getFees {blockhash} +### 说明:得到区块的交易手续费 +- blockhash : 256位区块hash + +#### 实例1 +``` +curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getFees","params":["00001ae85f5c90cc2f1f9ae5b1ac148145555d884f2c7d986cb3df250c8c3ecc"],"id":1}' https://127.0.0.1:18131 + +``` + +输出 +``` +{ + "jsonrpc": "2.0", + "id": 1, + "result": 0 +} +``` + +#### 实例2 +``` +curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getFees","params":["0001e69751e25747286d905964ed3c838b63e185074405eb2a7121cf0a72e259"],"id":1}' https://127.0.0.1:18131 +``` + +输出 +``` +{ + "jsonrpc": "2.0", + "id": 1, + "result": 49000 +} +``` + ## getRawTransaction ### 函数名:getRawTransaction {txid} ### 说明:通过txid获取交易 From 26018412b9b131a9594198e4604bd6b3bd5b5747 Mon Sep 17 00:00:00 2001 From: Alex Wu Date: Wed, 1 Jul 2020 18:22:55 +0800 Subject: [PATCH 25/69] Update _index.md --- .../content/tutorials/qitmeer-rpc/_index.md | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/Document/content/tutorials/qitmeer-rpc/_index.md b/Document/content/tutorials/qitmeer-rpc/_index.md index 6d03fdc2..40b2c0cd 100644 --- a/Document/content/tutorials/qitmeer-rpc/_index.md +++ b/Document/content/tutorials/qitmeer-rpc/_index.md @@ -5,6 +5,32 @@ weight: 1 # chapter: true --- +Table of Contents +================= + + * [Qitmeer RPC 说明](#qitmeer-rpc-说明) + * [getBlockByOrder](#getblockbyorder) + * [getBlockByNum](#getblockbynum) + * [getBlocK](#getblock) + * [getBlocKV2](#getblockv2) + * [getBlockHeader](#getblockheader) + * [getBlockCount](#getblockcount) + * [getBlockTotal](#getblocktotal) + * [getBlockBestHash](#getblockbesthash) + * [getBlockhashByRange](#getblockhashbyrange) + * [isOnMainChain](#isonmainchain) + * [getMainChainHeight](#getmainchainheight) + * [getOrphansTotal](#getorphanstotal) + * [getTips](#gettips) + * [getMempool](#getmempool) + * [getPeerInfo](#getpeerinfo) + * [getNodeInfo](#getnodeinfo) + * [isBlue](#isblue) + * [getFees](#getfees) + * [getRawTransaction](#getrawtransaction) + * [sendRawTransaction](#sendrawtransaction) + + # Qitmeer RPC 说明 ## getBlockByOrder From 13b0ede2e91f4ac572eaa251cea07749fa863383 Mon Sep 17 00:00:00 2001 From: Alex Wu Date: Wed, 1 Jul 2020 18:23:58 +0800 Subject: [PATCH 26/69] Update _index.md --- Document/content/tutorials/qitmeer-rpc/_index.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Document/content/tutorials/qitmeer-rpc/_index.md b/Document/content/tutorials/qitmeer-rpc/_index.md index 40b2c0cd..3fb267d0 100644 --- a/Document/content/tutorials/qitmeer-rpc/_index.md +++ b/Document/content/tutorials/qitmeer-rpc/_index.md @@ -11,8 +11,8 @@ Table of Contents * [Qitmeer RPC 说明](#qitmeer-rpc-说明) * [getBlockByOrder](#getblockbyorder) * [getBlockByNum](#getblockbynum) - * [getBlocK](#getblock) - * [getBlocKV2](#getblockv2) + * [getBlock](#getblock) + * [getBlockV2](#getblockv2) * [getBlockHeader](#getblockheader) * [getBlockCount](#getblockcount) * [getBlockTotal](#getblocktotal) @@ -248,8 +248,8 @@ $ curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{" } ``` -## getBlocK -### 函数名:getBlocK {blockhash} {verbose} {inclTx} {fullTx} +## getBlock +### 函数名:getBlock {blockhash} {verbose} {inclTx} {fullTx} ### 说明:根据区块hash获取区块 - blockhash : 256位区块hash - verbose: 是否显示详细信息,默认为false @@ -298,9 +298,9 @@ curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"js } ``` -## getBlocKV2 -### 函数名:getBlocK {blockhash} {verbose} {inclTx} {fullTx} -### 说明:根据区块hash获取区块 版本2 +## getBlockV2 +### 函数名:getBlocKV2 {blockhash} {verbose} {inclTx} {fullTx} +### 说明:根据区块hash获取区块(版本2) - blockhash : 256位区块hash - verbose: 是否显示详细信息,默认为false - inclTx: 是否包含交易信息,默认为true From 84a893e4c4cad7259899f21e2da3c620e8e5763a Mon Sep 17 00:00:00 2001 From: Alex Wu Date: Thu, 2 Jul 2020 13:11:19 +0800 Subject: [PATCH 27/69] update & refactor the qitmeer json-rpc API doc --- Document/content/JSON RPC API/_index.cn.md | 29 + Document/content/JSON RPC API/_index.en.md | 5 + .../JSON RPC API/getBlock/_index.cn.md | 55 + .../getBlockBestHash/_index.cn.md | 25 + .../JSON RPC API/getBlockByNum/_index.cn.md | 85 ++ .../JSON RPC API/getBlockByOrder/_index.cn.md | 143 +++ .../JSON RPC API/getBlockCount/_index.cn.md | 23 + .../JSON RPC API/getBlockHeader/_index.cn.md | 45 + .../JSON RPC API/getBlockTotal/_index.cn.md | 23 + .../JSON RPC API/getBlockV2/_index.cn.md | 60 + .../getBlockhashByRange/_index.cn.md | 47 + .../content/JSON RPC API/getFees/_index.cn.md | 40 + .../getMainChainHeight/_index.cn.md | 24 + .../JSON RPC API/getMempool/_index.cn.md | 27 + .../JSON RPC API/getNodeInfo/_index.cn.md | 60 + .../JSON RPC API/getOrphansTotal/_index.cn.md | 24 + .../JSON RPC API/getPeerInfo/_index.cn.md | 245 ++++ .../getRawTransaction/_index.cn.md | 68 ++ .../content/JSON RPC API/getTips/_index.cn.md | 27 + .../content/JSON RPC API/isBlue/_index.cn.md | 46 + .../JSON RPC API/isOnMainChain/_index.cn.md | 23 + .../sendRawTransaction/_index.cn.md | 19 + Document/content/reference/_index.cn.md | 6 + Document/content/test/_index.ar.md | 286 ----- Document/content/test/_index.cn.md | 287 ----- Document/content/test/_index.en.md | 287 ----- .../content/tutorials/qitmeer-rpc/_index.md | 1037 ----------------- 27 files changed, 1149 insertions(+), 1897 deletions(-) create mode 100644 Document/content/JSON RPC API/_index.cn.md create mode 100644 Document/content/JSON RPC API/_index.en.md create mode 100644 Document/content/JSON RPC API/getBlock/_index.cn.md create mode 100644 Document/content/JSON RPC API/getBlockBestHash/_index.cn.md create mode 100644 Document/content/JSON RPC API/getBlockByNum/_index.cn.md create mode 100644 Document/content/JSON RPC API/getBlockByOrder/_index.cn.md create mode 100644 Document/content/JSON RPC API/getBlockCount/_index.cn.md create mode 100644 Document/content/JSON RPC API/getBlockHeader/_index.cn.md create mode 100644 Document/content/JSON RPC API/getBlockTotal/_index.cn.md create mode 100644 Document/content/JSON RPC API/getBlockV2/_index.cn.md create mode 100644 Document/content/JSON RPC API/getBlockhashByRange/_index.cn.md create mode 100644 Document/content/JSON RPC API/getFees/_index.cn.md create mode 100644 Document/content/JSON RPC API/getMainChainHeight/_index.cn.md create mode 100644 Document/content/JSON RPC API/getMempool/_index.cn.md create mode 100644 Document/content/JSON RPC API/getNodeInfo/_index.cn.md create mode 100644 Document/content/JSON RPC API/getOrphansTotal/_index.cn.md create mode 100644 Document/content/JSON RPC API/getPeerInfo/_index.cn.md create mode 100644 Document/content/JSON RPC API/getRawTransaction/_index.cn.md create mode 100644 Document/content/JSON RPC API/getTips/_index.cn.md create mode 100644 Document/content/JSON RPC API/isBlue/_index.cn.md create mode 100644 Document/content/JSON RPC API/isOnMainChain/_index.cn.md create mode 100644 Document/content/JSON RPC API/sendRawTransaction/_index.cn.md create mode 100644 Document/content/reference/_index.cn.md delete mode 100644 Document/content/test/_index.ar.md delete mode 100644 Document/content/test/_index.cn.md delete mode 100644 Document/content/test/_index.en.md delete mode 100644 Document/content/tutorials/qitmeer-rpc/_index.md diff --git a/Document/content/JSON RPC API/_index.cn.md b/Document/content/JSON RPC API/_index.cn.md new file mode 100644 index 00000000..edfb273b --- /dev/null +++ b/Document/content/JSON RPC API/_index.cn.md @@ -0,0 +1,29 @@ +--- +title: Qitmeer JSON RPC 说明 +weight: 1 +--- + + * [Qitmeer JSON RPC 命令列表](#qitmeer-json-rpc) + * [getBlockByOrder](getblockbyorder) + * [getBlockByNum](getblockbynum) + * [getBlock](getblock) + * [getBlockV2](getblockv2) + * [getBlockHeader](getblockheader) + * [getBlockCount](#getblockcount) + * [getBlockTotal](#getblocktotal) + * [getBlockBestHash](#getblockbesthash) + * [getBlockhashByRange](#getblockhashbyrange) + * [isOnMainChain](#isonmainchain) + * [getMainChainHeight](#getmainchainheight) + * [getOrphansTotal](#getorphanstotal) + * [getTips](#gettips) + * [getMempool](#getmempool) + * [getPeerInfo](#getpeerinfo) + * [getNodeInfo](#getnodeinfo) + * [isBlue](#isblue) + * [getFees](#getfees) + * [getRawTransaction](#getrawtransaction) + * [sendRawTransaction](#sendrawtransaction) + + + diff --git a/Document/content/JSON RPC API/_index.en.md b/Document/content/JSON RPC API/_index.en.md new file mode 100644 index 00000000..d264ebe9 --- /dev/null +++ b/Document/content/JSON RPC API/_index.en.md @@ -0,0 +1,5 @@ +--- +title: Qitmeer JSON RPC +weight: 1 +--- + diff --git a/Document/content/JSON RPC API/getBlock/_index.cn.md b/Document/content/JSON RPC API/getBlock/_index.cn.md new file mode 100644 index 00000000..326c770f --- /dev/null +++ b/Document/content/JSON RPC API/getBlock/_index.cn.md @@ -0,0 +1,55 @@ +--- +title: getBlock +weight: 1 +--- + +## getBlock +### 函数名:getBlock {blockhash} {verbose} {inclTx} {fullTx} +### 说明:根据区块hash获取区块 +- blockhash : 256位区块hash +- verbose: 是否显示详细信息,默认为false +- inclTx: 是否包含交易信息,默认为true +- fullTx:是否显示完整交易信息,默认为true + +#### 实例: +``` +curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getBlock","params":["98294db0634d5afed36554a60d4565a6507e3a78dfb8cc66cc08ba29f328c682",true,true,false],"id":1}' https://127.0.0.1:18131 +``` +输出 +``` +{ + "jsonrpc": "2.0", + "id": 1, + "result": { + "hash": "98294db0634d5afed36554a60d4565a6507e3a78dfb8cc66cc08ba29f328c682", + "txsvalid": true, + "confirmations": 338, + "version": 12, + "weight": 682, + "height": 20831, + "txRoot": "040807f45457c94ed905bf72ed923154a5e951278e80a5c0eb2de0d7b269c5c1", + "order": 21300, + "transactions": [ + "5844ca2e091f8c2a770f4a0ff23318ae780b9e3a9b2076cc27b8c493dce30c03", + "c259a4dfb7eaaae92ab246f14762541581671135cd6030ac29d8c34cf77e9f32" + ], + "stateRoot": "0000000000000000000000000000000000000000000000000000000000000000", + "bits": "1a1c60ed", + "difficulty": 438067437, + "pow": { + "pow_name": "qitmeer_keccak256", + "pow_type": 6, + "nonce": 1457503796 + }, + "timestamp": "2020-07-01T12:48:52+08:00", + "parentroot": "000073e5c2787d1d2a04358c8b2fad422a602a38a6070570c2d8b724c054987f", + "parents": [ + "000073e5c2787d1d2a04358c8b2fad422a602a38a6070570c2d8b724c054987f" + ], + "children": [ + "00018c75188cc658705af615684b095bbc85a2dde6772e4bf3929b5d5505f5fb" + ] + } +} +``` + diff --git a/Document/content/JSON RPC API/getBlockBestHash/_index.cn.md b/Document/content/JSON RPC API/getBlockBestHash/_index.cn.md new file mode 100644 index 00000000..db215f5a --- /dev/null +++ b/Document/content/JSON RPC API/getBlockBestHash/_index.cn.md @@ -0,0 +1,25 @@ +--- +title: getBlockBestHash +weight: 1 +--- + +## getBlockBestHash +### 函数名:getBlockBestHash +### 说明:无参数,获取当前最大区块Order的区块hash +### 实例 + +``` +curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getBestBlockHash","params":[],"id":1}' https://127.0.0.1:18131 +``` +输出 +``` + +{ + "jsonrpc": "2.0", + "id": 1, + "result": "000044c83486609eee3c5bb46cd539eb022ea05ed86c40ef4e6710357f225ea3" +} +``` + + + diff --git a/Document/content/JSON RPC API/getBlockByNum/_index.cn.md b/Document/content/JSON RPC API/getBlockByNum/_index.cn.md new file mode 100644 index 00000000..b1286159 --- /dev/null +++ b/Document/content/JSON RPC API/getBlockByNum/_index.cn.md @@ -0,0 +1,85 @@ +--- +title: getBlockByNum +weight: 1 +--- + +## getBlockByNum +### 函数名:getBlockByNum {number} {verbose} {inclTx} {fullTx} +### 说明: +- number:number指按照当前节点所观察到的区块所构造的本地DAG图的区块序号,是一个从0开始,按顺序递增的连续整数值。该序号(Num)与全网其他节点无关,即并非BlockDAG共识结果的Block排序,请注意该方法和`getBlockByOder`的区别。该方法只用于帮助二级应用构造特殊业务场景而存在,返回结构并非BlockDAG共识结果,使用时请注意。 +- verbose: 是否显示详细信息,默认为false +- inclTx: 是否包含交易信息,默认为true +- fullTx:是否显示完整交易信息,默认为true + +#### 实例: + +``` +$ curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getBlockByNum","params":[1,true],"id":1}' https://127.0.0.1:18131 +``` +输出: +``` +{ + "jsonrpc": "2.0", + "id": 1, + "result": { + "hash": "83d98f64ff6517e5899a1c392d91c334ae77a8c7705cd3ca0b147a6470d8eb08", + "txsvalid": false, + "confirmations": 0, + "version": 12, + "weight": 443, + "height": 1, + "txRoot": "0cda5bc3744da7fcdd4a6dbbd72b24a58b9dcd927a171021646af87aa926315d", + "transactions": [ + { + "hex": "010000000114898f3cc6b4de34ca419365fee41fd78d74d71a70a98caa88e1260efb876a79ffffffffffffffff01007841cb020000001976a914499896c7814a6f49fa256bc5feaa5882a665339188ac000000000000000000000000012151080300009030da6dd9162f7777772e6d656572706f6f6c2e636f6d2f32303230", + "txid": "0cda5bc3744da7fcdd4a6dbbd72b24a58b9dcd927a171021646af87aa926315d", + "txhash": "0ac294d88ec9ab3f9cdfff2775d3c881a44cf4b73a1aaa2c2b57e58f055e3168", + "size": 127, + "version": 1, + "locktime": 0, + "expire": 0, + "vin": [ + { + "coinbase": "51080300009030da6dd9162f7777772e6d656572706f6f6c2e636f6d2f32303230", + "sequence": 4294967295 + } + ], + "vout": [ + { + "amount": 12000000000, + "scriptPubKey": { + "asm": "OP_DUP OP_HASH160 499896c7814a6f49fa256bc5feaa5882a6653391 OP_EQUALVERIFY OP_CHECKSIG", + "hex": "76a914499896c7814a6f49fa256bc5feaa5882a665339188ac", + "reqSigs": 1, + "type": "pubkeyhash", + "addresses": [ + "TmVfDq18VqSg735ko9aAo36tFwYww4PBGMC" + ] + } + } + ], + "blockhash": "83d98f64ff6517e5899a1c392d91c334ae77a8c7705cd3ca0b147a6470d8eb08", + "confirmations": 0 + } + ], + "stateRoot": "0000000000000000000000000000000000000000000000000000000000000000", + "bits": "1b00ffff", + "difficulty": 453050367, + "pow": { + "pow_name": "qitmeer_keccak256", + "pow_type": 6, + "nonce": 1067495060 + }, + "timestamp": "2020-06-24T10:06:46+08:00", + "parentroot": "36988b21b970fe3cbc7381dec7760eea50bc869e3bfbc44856a402fac94d3a8a", + "parents": [ + "36988b21b970fe3cbc7381dec7760eea50bc869e3bfbc44856a402fac94d3a8a" + ], + "children": [ + "null" + ] + } +} +``` + + diff --git a/Document/content/JSON RPC API/getBlockByOrder/_index.cn.md b/Document/content/JSON RPC API/getBlockByOrder/_index.cn.md new file mode 100644 index 00000000..1ed128d9 --- /dev/null +++ b/Document/content/JSON RPC API/getBlockByOrder/_index.cn.md @@ -0,0 +1,143 @@ +--- +title: getBlockByOrder +weight: 1 +--- + +## getBlockByOrder +### 函数名:getBlockByOrder {order} {verbose} {inclTx} {fullTx} +### 说明:返回指定Order的Block +- order:区块order,qitmeer采用BlockDAG算法进行共识,对区块的先后顺序进行排序。order指区块序列的序号,是一个从0开始,按顺序连续递增的整数值。请注意order不是区块的高度。 +- verbose: 是否显示详细信息,默认为false +- inclTx: 是否包含交易信息,默认为true +- fullTx:是否显示完整交易信息,默认为true + +#### 实例1: +``` +curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getBlockByOrder","params":[1,true],"id":1}' https://127.0.0.1:18131 +``` +实例1输出: +``` +{ + "hash": "0012c535ed43311b0670341fad3a489642c0bc6e6796f836aa6d235826fc9c66", + "txsvalid": true, + "confirmations": 20651, + "version": 12, + "weight": 433, + "height": 1, + "txRoot": "845738befb45db6872e37295b39837cd8dc98e77417754fd4ddab5ff169317be", + "order": 1, + "transactions": [ + { + "hex": "0c000000010a7ebb3e65b3be8a2e3425407e8e649c4bde818b7db70bdb3d4b8c3256745f37ffffffffffffffff01007841cb020000001976a91409eb5fc744c14c8cdd5a05b552c58c1fb6e7ebd088ac000000000000000072b6f25e01175108461004cbac974daf0c2f363636706f6f6c2e636e2f", + "txid": "845738befb45db6872e37295b39837cd8dc98e77417754fd4ddab5ff169317be", + "txhash": "93772af2957ecd066841fda4606bfa5e001ac151062c0b3ca7cfea60ec35e8b3", + "size": 117, + "version": 12, + "locktime": 0, + "timestamp": "2020-06-24T10:12:02+08:00", + "expire": 0, + "vin": [ + { + "coinbase": "5108461004cbac974daf0c2f363636706f6f6c2e636e2f", + "sequence": 4294967295 + } + ], + "vout": [ + { + "amount": 12000000000, + "scriptPubKey": { + "asm": "OP_DUP OP_HASH160 09eb5fc744c14c8cdd5a05b552c58c1fb6e7ebd0 OP_EQUALVERIFY OP_CHECKSIG", + "hex": "76a91409eb5fc744c14c8cdd5a05b552c58c1fb6e7ebd088ac", + "reqSigs": 1, + "type": "pubkeyhash", + "addresses": [ + "TmPrXkjpjSUBiFG9RZKPjfdsAPbiaar94Ta" + ] + } + } + ], + "blockhash": "0012c535ed43311b0670341fad3a489642c0bc6e6796f836aa6d235826fc9c66", + "confirmations": 20651 + } + ], + "stateRoot": "0000000000000000000000000000000000000000000000000000000000000000", + "bits": "34ad1ec", + "difficulty": 55235052, + "pow": { + "pow_name": "cuckaroom", + "pow_type": 3, + "nonce": 5, + "proof_data": { + "edge_bits": 29, + "circle_nonces": "fa50c20086aef40090ebab01295d5102697fcb0229e83b04b0ac4604fd9a6505118a6f05deb21206e88f9c07184fae075e218408884ed90bdfca630cf9e2a60c12fae80f909b831084669a109390e6105aa9c611aea1e71288408713c670641405f9a714abfcf81557ded81665b20f17a17370170628de17d4ccfb1755515618f5456918efd27918d4f4d218f91bb71954e3b11cb648ca1c9779541d51ee6b1ee12a711e0679131f" + } + }, + "timestamp": "2020-06-24T10:05:33+08:00", + "parentroot": "36988b21b970fe3cbc7381dec7760eea50bc869e3bfbc44856a402fac94d3a8a", + "parents": [ + "36988b21b970fe3cbc7381dec7760eea50bc869e3bfbc44856a402fac94d3a8a" + ], + "children": [ + "000de974590581de8294866535b3af182041a4cb29b71a7680b024e3bd7d12da" + ] +} + +``` + +#### 实例2: +``` +curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getBlockByOrder","params":[1,false],"id":1}' https://127.0.0.1:18131 +``` +实例2输出: +``` +{ + "jsonrpc": "2.0", + "id": 1, + "result": "0c0000008a3a4dc9fa02a45648c4fb3b9e86bc50ea0e76c7de8173bc3cfe70b9218b9836be179316ffb5da4dfd547741778ec98dcd3798b39572e37268db45fbbe3857840000000000000000000000000000000000000000000000000000000000000000ecd14a03edb4f25e05000000031dfa50c20086aef40090ebab01295d5102697fcb0229e83b04b0ac4604fd9a6505118a6f05deb21206e88f9c07184fae075e218408884ed90bdfca630cf9e2a60c12fae80f909b831084669a109390e6105aa9c611aea1e71288408713c670641405f9a714abfcf81557ded81665b20f17a17370170628de17d4ccfb1755515618f5456918efd27918d4f4d218f91bb71954e3b11cb648ca1c9779541d51ee6b1ee12a711e0679131f018a3a4dc9fa02a45648c4fb3b9e86bc50ea0e76c7de8173bc3cfe70b9218b9836010c000000010a7ebb3e65b3be8a2e3425407e8e649c4bde818b7db70bdb3d4b8c3256745f37ffffffffffffffff01007841cb020000001976a91409eb5fc744c14c8cdd5a05b552c58c1fb6e7ebd088ac000000000000000072b6f25e01175108461004cbac974daf0c2f363636706f6f6c2e636e2f" +} +``` + +#### 实例3: +``` +curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getBlockByOrder","params":[1,true,false],"id":1}' https://127.0.0.1:18131 +``` +实例3输出: +``` +{ + "jsonrpc": "2.0", + "id": 1, + "result": { + "hash": "0012c535ed43311b0670341fad3a489642c0bc6e6796f836aa6d235826fc9c66", + "txsvalid": true, + "confirmations": 20686, + "version": 12, + "weight": 433, + "height": 1, + "txRoot": "845738befb45db6872e37295b39837cd8dc98e77417754fd4ddab5ff169317be", + "order": 1, + "stateRoot": "0000000000000000000000000000000000000000000000000000000000000000", + "bits": "34ad1ec", + "difficulty": 55235052, + "pow": { + "pow_name": "cuckaroom", + "pow_type": 3, + "nonce": 5, + "proof_data": { + "edge_bits": 29, + "circle_nonces": "fa50c20086aef40090ebab01295d5102697fcb0229e83b04b0ac4604fd9a6505118a6f05deb21206e88f9c07184fae075e218408884ed90bdfca630cf9e2a60c12fae80f909b831084669a109390e6105aa9c611aea1e71288408713c670641405f9a714abfcf81557ded81665b20f17a17370170628de17d4ccfb1755515618f5456918efd27918d4f4d218f91bb71954e3b11cb648ca1c9779541d51ee6b1ee12a711e0679131f" + } + }, + "timestamp": "2020-06-24T10:05:33+08:00", + "parentroot": "36988b21b970fe3cbc7381dec7760eea50bc869e3bfbc44856a402fac94d3a8a", + "parents": [ + "36988b21b970fe3cbc7381dec7760eea50bc869e3bfbc44856a402fac94d3a8a" + ], + "children": [ + "000de974590581de8294866535b3af182041a4cb29b71a7680b024e3bd7d12da" + ] + } +} +``` + + + diff --git a/Document/content/JSON RPC API/getBlockCount/_index.cn.md b/Document/content/JSON RPC API/getBlockCount/_index.cn.md new file mode 100644 index 00000000..ef2e945b --- /dev/null +++ b/Document/content/JSON RPC API/getBlockCount/_index.cn.md @@ -0,0 +1,23 @@ +--- +title: getBlockCount +weight: 1 +--- + +## getBlockCount +### 函数名:getBlockCount +### 说明:无参数,当前已定序的区块数量。 +该数量-1即为当前最大的Block order + +#### 实例 +``` +$ curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getBlockCount","params":[],"id":1}' https://127.0.0.1:18131 +``` +输出 +``` +{ + "jsonrpc": "2.0", + "id": 1, + "result": 21177 +} +``` + diff --git a/Document/content/JSON RPC API/getBlockHeader/_index.cn.md b/Document/content/JSON RPC API/getBlockHeader/_index.cn.md new file mode 100644 index 00000000..ab9e9520 --- /dev/null +++ b/Document/content/JSON RPC API/getBlockHeader/_index.cn.md @@ -0,0 +1,45 @@ +--- +title: getBlockHeader +weight: 1 +--- + +## getBlockHeader +### 函数名:getBlockHeader {blockhash} {verbose} +### 说明:无参数,当前已定序的区块数量。 +- blockhash : 256位区块hash +- verbose :是否显示详细信息,默认为false +注:该数量-1即为当前最大的Block order + + +#### 实例 +``` +$ curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getBlockHeader","params":["0011cc2a9cea757a2aaa235f27f41f00e3e2ed87282175fe76767c4f50b3aa05",true],"id":1}' https://127.0.0.1:18131 +``` +输出 +``` +{ + "jsonrpc": "2.0", + "id": 1, + "result": { + "hash": "0011cc2a9cea757a2aaa235f27f41f00e3e2ed87282175fe76767c4f50b3aa05", + "confirmations": 21145, + "version": 12, + "parentroot": "00015f28637b8442e2399924d0db703efebd33ab3176d4ccb7b762a28529087e", + "txRoot": "c564f2c2e6fd7b7db1d09272a607388861f2bfe34550d5f7176ed4652459bbd7", + "stateRoot": "0000000000000000000000000000000000000000000000000000000000000000", + "difficulty": 55235052, + "layer": 116, + "time": 1592967313, + "pow": { + "pow_name": "cuckaroom", + "pow_type": 3, + "nonce": 19, + "proof_data": { + "edge_bits": 29, + "circle_nonces": "2b1c9b002544650140638b036dd04804cbd65304c5963305f3184d055dca110674761d0646e81d0639683d06718d1007c85c150744b960089a99a40878dff708e06320097e0d67098fa51d0a4e7c5f0acc8ad30b1e2e4e0ce5c0990cd0fcb80e1013ba0e3b614d0f5ba19c0f4904b90f0c190f12d5869012f45b621415193315ec0727160314e417b51938185314c218281ce318ca84ec18dd1b001941b7d619a571881e6f4f831f" + } + } + } +} +``` + diff --git a/Document/content/JSON RPC API/getBlockTotal/_index.cn.md b/Document/content/JSON RPC API/getBlockTotal/_index.cn.md new file mode 100644 index 00000000..8f6b8590 --- /dev/null +++ b/Document/content/JSON RPC API/getBlockTotal/_index.cn.md @@ -0,0 +1,23 @@ +--- +title: getBlockTotal +weight: 1 +--- + +## getBlockTotal +### 函数名:getBlockTotal +### 说明:无参数,该节点所有已知的区块总数量。 +该数量包含可能存在的当前还未被BlockDAG共识定序的区块 + +#### 实例 +``` +$ curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getBlockTotal","params":[],"id":1}' https://127.0.0.1:18131 +``` +输出 +``` +{ + "jsonrpc": "2.0", + "id": 1, + "result": 21177 +} +``` + diff --git a/Document/content/JSON RPC API/getBlockV2/_index.cn.md b/Document/content/JSON RPC API/getBlockV2/_index.cn.md new file mode 100644 index 00000000..a38c4118 --- /dev/null +++ b/Document/content/JSON RPC API/getBlockV2/_index.cn.md @@ -0,0 +1,60 @@ +--- +title: getBlockV2 +weight: 1 +--- + +## getBlockV2 +### 函数名:getBlocKV2 {blockhash} {verbose} {inclTx} {fullTx} +### 说明:根据区块hash获取区块(版本2) +- blockhash : 256位区块hash +- verbose: 是否显示详细信息,默认为false +- inclTx: 是否包含交易信息,默认为true +- fullTx:是否显示完整交易信息,默认为true + +V2版本RPC将交易手续费显示在单独的`transactionfee`属性中。而之前版本的交易手续费体现在coinbase的Amount中,和挖矿奖励合并显示。请注意,不论使用V1或者V2版本的API,只影响JSON数据的显示。内部的数据模型和共识模型是完全是一致的。 + +#### 实例 + +``` +curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getBlockV2","params":["98294db0634d5afed36554a60d4565a6507e3a78dfb8cc66cc08ba29f328c682",true,true,false],"id":1}' https://127.0.0.1:18131 +``` + +输出: +``` +{ + "jsonrpc": "2.0", + "id": 1, + "result": { + "hash": "98294db0634d5afed36554a60d4565a6507e3a78dfb8cc66cc08ba29f328c682", + "txsvalid": true, + "confirmations": 304, + "version": 12, + "weight": 682, + "height": 20831, + "txRoot": "040807f45457c94ed905bf72ed923154a5e951278e80a5c0eb2de0d7b269c5c1", + "order": 21300, + "transactions": [ + "5844ca2e091f8c2a770f4a0ff23318ae780b9e3a9b2076cc27b8c493dce30c03", + "c259a4dfb7eaaae92ab246f14762541581671135cd6030ac29d8c34cf77e9f32" + ], + "transactionfee": 32000, + "stateRoot": "0000000000000000000000000000000000000000000000000000000000000000", + "bits": "1a1c60ed", + "difficulty": 438067437, + "pow": { + "pow_name": "qitmeer_keccak256", + "pow_type": 6, + "nonce": 1457503796 + }, + "timestamp": "2020-07-01T12:48:52+08:00", + "parentroot": "000073e5c2787d1d2a04358c8b2fad422a602a38a6070570c2d8b724c054987f", + "parents": [ + "000073e5c2787d1d2a04358c8b2fad422a602a38a6070570c2d8b724c054987f" + ], + "children": [ + "00018c75188cc658705af615684b095bbc85a2dde6772e4bf3929b5d5505f5fb" + ] + } +} +``` + diff --git a/Document/content/JSON RPC API/getBlockhashByRange/_index.cn.md b/Document/content/JSON RPC API/getBlockhashByRange/_index.cn.md new file mode 100644 index 00000000..d5e0e0c1 --- /dev/null +++ b/Document/content/JSON RPC API/getBlockhashByRange/_index.cn.md @@ -0,0 +1,47 @@ +--- +title: getBlockhashByRange +weight: 1 +--- + +## getBlockhashByRange +### 函数名 getBlockhashByRange {start} {end} +### 说明:获取在某区间order范围的一组Blockhash +- start 开始区块order +- end 结束区块order + +#### 实例 +``` +curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getBlockhashByRange","params":[100,125],"id":null}' https://127.0.0.1:18131 +``` +输出: +``` +[ + "000c018b33589f2f731d9cfc26d5d329fefce1045b9d1e5b22e3e8e71760e0e7", + "68d1170256afeae9591bcb49c99734e582f59860d0917e449c03f08c269957a3", + "0010b1aef1910f1c5662e0991d8ba1d564e3df360c6235f6890486a35a4ca000", + "0013a4646accf2f11c96e59d51f07be4a510a0e9e12174fd569ae3744a38de24", + "0016242fcaf6effecf083aa2b7716f8825addb31530ce3141da7d50293f3dce2", + "00173736aba73591a7ce051c0a4e4605edcbafe48149849880d9b8c7781b538e", + "0007ae2245017244e3ca355bcbe2947f69ab1ab5c52112bff003842363298395", + "0016b7148e99c60cf74c96cdeffc8a966817f163013dc3fb89684946d7cbb7bc", + "000edcf8a5dad7cfdf25461359678421e51930614d73a965b8532bb608c00025", + "000ea156ad8ef5c90d0c5855a5352a9e156d8d778ee53daa5bb9145268b17693", + "2fa46ac8fa234ee5950d74fdaf0fd60d6fed406f1208d10ecff11026eaa45c86", + "000c5816df76fd7b6662cf2c9c57c87f050c1b101c5466a1fa6bbe5eebebbd22", + "178fc77f4af15e977861510c81f957b6518215ea483f847caa67e0daeb8ac0ce", + "0014fa7d8499812b5a7f404efa82b4959db5542bae55e60035cc0d5ae0ef29fa", + "0014c1c5b794c7fa91271841b6c4f63f6216529d7c9076e2e2f861e47bd31290", + "000207d33febab535405082c9bd78cd463048143429b404a120faa95b139d9b8", + "0628f63bf041cab884e55192a6bf6615c198390821542a1c3b53ad3fafc9bbd1", + "000cff170cde98b09f80c76109843d178f67dc7c64d25f6886f93ce0cd25fd7a", + "000b4c1f4a87f97b5ef7727f2fc4ffb9f5cf34b9c759e12dfb4954cfeb6f65fb", + "5d138960ca76057f379d8d6cb82bf6a93b7b2c63d1a4950d15305d12124f3b89", + "7d6d9140f516d9a12ca2109a89a17c777425b73596b9b4a7a4a4d4013da6ddec", + "2f3817197e885e805229c4be3cf94b9b7581b4e6975068e5583b8295b648d690", + "46e97b2fda23be092abd8c163c3d2f0a60018904484fd688918b7c5f257686e0", + "00015f28637b8442e2399924d0db703efebd33ab3176d4ccb7b762a28529087e", + "0011cc2a9cea757a2aaa235f27f41f00e3e2ed87282175fe76767c4f50b3aa05" +] + +``` + diff --git a/Document/content/JSON RPC API/getFees/_index.cn.md b/Document/content/JSON RPC API/getFees/_index.cn.md new file mode 100644 index 00000000..5346469b --- /dev/null +++ b/Document/content/JSON RPC API/getFees/_index.cn.md @@ -0,0 +1,40 @@ +--- +title: getFees +weight: 1 +--- + + +## getFees +### 函数名:getFees {blockhash} +### 说明:得到区块的交易手续费 +- blockhash : 256位区块hash + +#### 实例1 +``` +curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getFees","params":["00001ae85f5c90cc2f1f9ae5b1ac148145555d884f2c7d986cb3df250c8c3ecc"],"id":1}' https://127.0.0.1:18131 + +``` + +输出 +``` +{ + "jsonrpc": "2.0", + "id": 1, + "result": 0 +} +``` + +#### 实例2 +``` +curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getFees","params":["0001e69751e25747286d905964ed3c838b63e185074405eb2a7121cf0a72e259"],"id":1}' https://127.0.0.1:18131 +``` + +输出 +``` +{ + "jsonrpc": "2.0", + "id": 1, + "result": 49000 +} +``` + diff --git a/Document/content/JSON RPC API/getMainChainHeight/_index.cn.md b/Document/content/JSON RPC API/getMainChainHeight/_index.cn.md new file mode 100644 index 00000000..9646864b --- /dev/null +++ b/Document/content/JSON RPC API/getMainChainHeight/_index.cn.md @@ -0,0 +1,24 @@ +--- +title: getMainChainHeight +weight: 1 +--- + + +## getMainChainHeight +### 函数名 getMainChainHeight +### 说明:无参数,得到当前的主链高度。 + +#### 实例 +``` +$ curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getMainChainHeight","params":[],"id":1}' https://127.0.0.1:18131 +``` +输出 +``` +{ + "jsonrpc": "2.0", + "id": 1, + "result": "21275" +} +``` + + diff --git a/Document/content/JSON RPC API/getMempool/_index.cn.md b/Document/content/JSON RPC API/getMempool/_index.cn.md new file mode 100644 index 00000000..e50975f0 --- /dev/null +++ b/Document/content/JSON RPC API/getMempool/_index.cn.md @@ -0,0 +1,27 @@ +--- +title: getMempool +weight: 1 +--- + +## getMempool +### 函数名:getMempool {txtype} {verbose} +### 说明: +- txType: 交易类型,目前只支持regular。 +- verbose:显示详细信息,目前只支持false。 + +#### 实例 +``` +curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getMempool","params":["regular",false],"id":1}' https://127.0.0.1:18131 +``` +输出 +``` +{ + "jsonrpc": "2.0", + "id": 1, + "result": [ + "8df1c9019dd7110e9c3a421f62973ff245cbad435452808363ac291bf2265613" + ] +} +``` + + diff --git a/Document/content/JSON RPC API/getNodeInfo/_index.cn.md b/Document/content/JSON RPC API/getNodeInfo/_index.cn.md new file mode 100644 index 00000000..b89a874d --- /dev/null +++ b/Document/content/JSON RPC API/getNodeInfo/_index.cn.md @@ -0,0 +1,60 @@ +--- +title: getNodeInfo +weight: 1 +--- + +## getNodeInfo +### 函数名:getNodeInfo +### 说明:无参数,获取该节点信息 + +#### 实例 + +``` +curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getNodeInfo","params":[],"id":null}' https://127.0.0.1:18131 +``` + +输出: +``` +{ + "UUID": "dc4dffc6-9c0c-417f-9cb2-a1fdc4877915", + "version": 90100, + "buildversion": "0.9.1+dev-7ae8c17", + "protocolversion": 21, + "totalsubsidy": 254484000000000, + "graphstate": { + "tips": [ + "00006869b1f1e29db24cc528a86370b4355f1dc6a618ac0549495679f0bc484b main" + ], + "mainorder": 21207, + "mainheight": 20738, + "layer": 20738 + }, + "timeoffset": 0, + "connections": 8, + "pow_diff": { + "blake2bd_diff": 1, + "cuckaroo_diff": 1, + "cuckatoo_diff": 1 + }, + "testnet": true, + "mixnet": false, + "confirmations": 10, + "coinbasematurity": 720, + "errors": "", + "modules": [ + "qitmeer", + "miner", + "test" + ] +} +``` + +#### 结果说明: +- confirmations:代表非coinbase交易的UXTO可以被花费的最小确认数,当前的共识的最小确认数为10个确认。 +- coinbasematurity:代表coinbase交易的UXTO可以被花费的最小确认数,当前的共识是720个确认。 +- 注:不论coinbase交易还是非coinbase交易,除了满足各自的最小确认条件外,还需要包含该交易的区块满足如下条件,才能满足该该交易的UTXO可花费: + - 1.)BlockDAG共识约束,即该区块为蓝色区块,详见见rpc isBule + - 2.)该区块为交易合法区块,即区块的`txsvalid`属性为true。详见rpc getBlockByOrder + + + diff --git a/Document/content/JSON RPC API/getOrphansTotal/_index.cn.md b/Document/content/JSON RPC API/getOrphansTotal/_index.cn.md new file mode 100644 index 00000000..bf9cf65c --- /dev/null +++ b/Document/content/JSON RPC API/getOrphansTotal/_index.cn.md @@ -0,0 +1,24 @@ +--- +title: getOrphansTotal +weight: 1 +--- + +## getOrphansTotal +### 函数名 getOrphansTotal +### 说明:无参数,得到当前节点的孤儿区块的数量。 +孤儿区块指当前未关联到DAG中的区块。 + +#### 实例 +``` +curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getOrphansTotal","params":[],"id":null}' https://127.0.0.1:18131 +``` +输出 +``` +{ + "jsonrpc": "2.0", + "id": null, + "result": 0 +} + +``` + diff --git a/Document/content/JSON RPC API/getPeerInfo/_index.cn.md b/Document/content/JSON RPC API/getPeerInfo/_index.cn.md new file mode 100644 index 00000000..90dd1d3d --- /dev/null +++ b/Document/content/JSON RPC API/getPeerInfo/_index.cn.md @@ -0,0 +1,245 @@ +--- +title: getPeerInfo +weight: 1 +--- + +## getPeerInfo +### 函数名:getPeerInfo +### 说明:无参数,取邻近节点信息 + +#### 实例 +``` +curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getPeerInfo","params":[],"id":null}' https://127.0.0.1:18131 +``` + +输出: +``` +[ + { + "uuid": "f280f357-ee4a-4958-90bf-685d24129703", + "id": 5, + "addr": "103.1.154.227:18130", + "addrlocal": "10.198.1.66:56261", + "services": "00000009", + "relaytxes": true, + "lastsend": 1593576243, + "lastrecv": 1593576298, + "bytessent": 5029, + "bytesrecv": 7315, + "conntime": 1593575403, + "timeoffset": 0, + "pingtime": 371602, + "version": 20, + "subver": "qitmeer:0.9.0", + "inbound": false, + "banscore": 0, + "syncnode": false, + "graphstate": { + "tips": [ + "0002cf49681506f5b9915c4fa199e76abc8a7d7ade9cafbe1cd1f84ec89e0704 main" + ], + "mainorder": 21199, + "mainheight": 20730, + "layer": 20730 + } + }, + { + "uuid": "b0c3462f-328d-45ba-8e3f-490c205eec85", + "id": 6, + "addr": "47.103.61.128:18130", + "addrlocal": "10.198.1.66:56262", + "services": "00000009", + "relaytxes": true, + "lastsend": 1593576298, + "lastrecv": 1593576299, + "bytessent": 2941, + "bytesrecv": 16892, + "conntime": 1593575403, + "timeoffset": 0, + "pingtime": 871878, + "version": 20, + "subver": "qitmeer:0.9.0", + "inbound": false, + "banscore": 0, + "syncnode": false, + "graphstate": { + "tips": [ + "0002cf49681506f5b9915c4fa199e76abc8a7d7ade9cafbe1cd1f84ec89e0704 main" + ], + "mainorder": 21199, + "mainheight": 20730, + "layer": 20730 + } + }, + { + "uuid": "349a58ee-3537-4576-ba8a-925a27725070", + "id": 7, + "addr": "106.15.102.183:18130", + "addrlocal": "10.198.1.66:56284", + "services": "00000009", + "relaytxes": true, + "lastsend": 1593576254, + "lastrecv": 1593576298, + "bytessent": 1471, + "bytesrecv": 7965, + "conntime": 1593575414, + "timeoffset": 0, + "pingtime": 485255, + "version": 20, + "subver": "qitmeer:0.9.0", + "inbound": false, + "banscore": 0, + "syncnode": false, + "graphstate": { + "tips": [ + "0002cf49681506f5b9915c4fa199e76abc8a7d7ade9cafbe1cd1f84ec89e0704 main" + ], + "mainorder": 21199, + "mainheight": 20730, + "layer": 20730 + } + }, + { + "uuid": "400176fd-8155-405c-ae4f-032948581558", + "id": 8, + "addr": "148.70.34.136:18130", + "addrlocal": "10.198.1.66:56413", + "services": "00000009", + "relaytxes": true, + "lastsend": 1593576307, + "lastrecv": 1593576308, + "bytessent": 1757, + "bytesrecv": 11162, + "conntime": 1593575465, + "timeoffset": 0, + "pingtime": 830143, + "version": 20, + "subver": "qitmeer:0.9.0", + "inbound": false, + "banscore": 0, + "syncnode": false, + "graphstate": { + "tips": [ + "0002cf49681506f5b9915c4fa199e76abc8a7d7ade9cafbe1cd1f84ec89e0704 main" + ], + "mainorder": 21199, + "mainheight": 20730, + "layer": 20730 + } + }, + { + "uuid": "1df6c4ca-dae0-4632-bdb2-d9ef916b7580", + "id": 1, + "addr": "104.224.174.141:18130", + "addrlocal": "10.198.1.66:56182", + "services": "00000009", + "relaytxes": true, + "lastsend": 1593576333, + "lastrecv": 1593576333, + "bytessent": 4259, + "bytesrecv": 1214, + "conntime": 1593575373, + "timeoffset": 0, + "pingtime": 244235, + "version": 20, + "subver": "qitmeer:0.9.0", + "inbound": false, + "banscore": 0, + "syncnode": false, + "graphstate": { + "tips": [ + "3b3b4e71e7ab837635da8442afb98ba4092a2df62cf25e59a58bda518ce81fca main" + ], + "mainorder": 21065, + "mainheight": 20597, + "layer": 20597 + } + }, + { + "uuid": "a8383106-45dc-4028-ae04-74d25ad09f7d", + "id": 2, + "addr": "144.202.90.65:18130", + "addrlocal": "10.198.1.66:56177", + "services": "00000009", + "relaytxes": true, + "lastsend": 1593576333, + "lastrecv": 1593576333, + "bytessent": 5178, + "bytesrecv": 8411, + "conntime": 1593575373, + "timeoffset": 0, + "pingtime": 259579, + "version": 20, + "subver": "qitmeer:0.9.0", + "inbound": false, + "banscore": 0, + "syncnode": true, + "graphstate": { + "tips": [ + "0002cf49681506f5b9915c4fa199e76abc8a7d7ade9cafbe1cd1f84ec89e0704 main" + ], + "mainorder": 21199, + "mainheight": 20730, + "layer": 20730 + } + }, + { + "uuid": "277d5f3f-3af3-486e-92ca-8da59eaa6db9", + "id": 4, + "addr": "122.112.245.133:18130", + "addrlocal": "10.198.1.66:56180", + "services": "00000009", + "relaytxes": true, + "lastsend": 1593576333, + "lastrecv": 1593576334, + "bytessent": 1692, + "bytesrecv": 9459, + "conntime": 1593575373, + "timeoffset": 0, + "pingtime": 414095, + "version": 20, + "subver": "qitmeer:0.9.0", + "inbound": false, + "banscore": 0, + "syncnode": false, + "graphstate": { + "tips": [ + "0002cf49681506f5b9915c4fa199e76abc8a7d7ade9cafbe1cd1f84ec89e0704 main" + ], + "mainorder": 21199, + "mainheight": 20730, + "layer": 20730 + } + }, + { + "uuid": "38d8647f-371d-47c6-924b-ddfe32391a83", + "id": 3, + "addr": "103.29.70.78:18130", + "addrlocal": "10.198.1.66:56175", + "services": "00000009", + "relaytxes": true, + "lastsend": 1593576333, + "lastrecv": 1593576334, + "bytessent": 2421, + "bytesrecv": 6656, + "conntime": 1593575373, + "timeoffset": -1, + "pingtime": 345824, + "version": 21, + "subver": "qitmeer:0.9.1", + "inbound": false, + "banscore": 0, + "syncnode": false, + "graphstate": { + "tips": [ + "0002cf49681506f5b9915c4fa199e76abc8a7d7ade9cafbe1cd1f84ec89e0704 main" + ], + "mainorder": 21199, + "mainheight": 20730, + "layer": 20730 + } + } +] + +``` + diff --git a/Document/content/JSON RPC API/getRawTransaction/_index.cn.md b/Document/content/JSON RPC API/getRawTransaction/_index.cn.md new file mode 100644 index 00000000..f4ba40d0 --- /dev/null +++ b/Document/content/JSON RPC API/getRawTransaction/_index.cn.md @@ -0,0 +1,68 @@ +--- +title: getRawTransaction +weight: 1 +--- + +## getRawTransaction +### 函数名:getRawTransaction {txid} +### 说明:通过txid获取交易 +- txid 交易id 为一个256位hash值。 +- verbose 是否显示详细信息,默认为false + +#### 实例 +``` +curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getRawTransaction","params":["c259a4dfb7eaaae92ab246f14762541581671135cd6030ac29d8c34cf77e9f32",true],"id":1}' https://127.0.0.1:18131 +``` +输出 +``` +{ + "hex": "0100000001dc7d54db024a1ef06e38b85ab01af2d60043e3d36b5411691224c05dcf36f63c01000000ffffffff02659ca300000000001976a91406e2097d585337cdd10aefa09994b511127af0bb88acf0e8cd6f230200001976a914fe27c90d4ed4de3269c0bb9ae1d7639865e3bf2888ac00000000000000008015fc5e016b48304502210090910aa0190a6571319b0b638bfbb593582575703abdd4f1a7f0da2812cda7d102205dae6fee28396bfeb8f1b814884d8d03ab0dd9f30b171d906c24914ba2f85b1a012103cd4fa2ea2688ac9e0a62584635244f572d22c13730d5576722d6571aabfddca8", + "txid": "c259a4dfb7eaaae92ab246f14762541581671135cd6030ac29d8c34cf77e9f32", + "txhash": "9b603ba3b17fd8491749ac366a5064d8b7b70be02568e405406a9acd70e971a8", + "size": 235, + "version": 1, + "locktime": 0, + "timestamp": "2020-07-01T12:48:00+08:00", + "expire": 0, + "vin": [ + { + "txid": "3cf636cf5dc024126911546bd3e34300d6f21ab05ab8386ef01e4a02db547ddc", + "vout": 1, + "sequence": 4294967295, + "scriptSig": { + "asm": "304502210090910aa0190a6571319b0b638bfbb593582575703abdd4f1a7f0da2812cda7d102205dae6fee28396bfeb8f1b814884d8d03ab0dd9f30b171d906c24914ba2f85b1a01 03cd4fa2ea2688ac9e0a62584635244f572d22c13730d5576722d6571aabfddca8", + "hex": "48304502210090910aa0190a6571319b0b638bfbb593582575703abdd4f1a7f0da2812cda7d102205dae6fee28396bfeb8f1b814884d8d03ab0dd9f30b171d906c24914ba2f85b1a012103cd4fa2ea2688ac9e0a62584635244f572d22c13730d5576722d6571aabfddca8" + } + } + ], + "vout": [ + { + "amount": 10722405, + "scriptPubKey": { + "asm": "OP_DUP OP_HASH160 06e2097d585337cdd10aefa09994b511127af0bb OP_EQUALVERIFY OP_CHECKSIG", + "hex": "76a91406e2097d585337cdd10aefa09994b511127af0bb88ac", + "reqSigs": 1, + "type": "pubkeyhash", + "addresses": [ + "TmPaUYQuUtfCysrYVHc4AdhpVHxw7EskHTP" + ] + } + }, + { + "amount": 2351222876400, + "scriptPubKey": { + "asm": "OP_DUP OP_HASH160 fe27c90d4ed4de3269c0bb9ae1d7639865e3bf28 OP_EQUALVERIFY OP_CHECKSIG", + "hex": "76a914fe27c90d4ed4de3269c0bb9ae1d7639865e3bf2888ac", + "reqSigs": 1, + "type": "pubkeyhash", + "addresses": [ + "Tmn7vzzSrvAPNLtwpD5YjiWwVUBD74Hjdww" + ] + } + } + ], + "confirmations": 0 +} + +``` + diff --git a/Document/content/JSON RPC API/getTips/_index.cn.md b/Document/content/JSON RPC API/getTips/_index.cn.md new file mode 100644 index 00000000..41e4e4ad --- /dev/null +++ b/Document/content/JSON RPC API/getTips/_index.cn.md @@ -0,0 +1,27 @@ +--- +title: getTips +weight: 1 +--- + +## getTips +### 函数名 getTips +### 说明:得到Tip Block列表 +Tips列表是当前节点的DAG图的Tips Block的hash列表 + +#### 实例 +``` +curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"tips","params":[],"id":null}' https://127.0.0.1:18131 +``` + +``` +{ + "jsonrpc": "2.0", + "id": null, + "result": [ + "83d98f64ff6517e5899a1c392d91c334ae77a8c7705cd3ca0b147a6470d8eb08", + "00001ae85f5c90cc2f1f9ae5b1ac148145555d884f2c7d986cb3df250c8c3ecc" + ] +} +``` + + diff --git a/Document/content/JSON RPC API/isBlue/_index.cn.md b/Document/content/JSON RPC API/isBlue/_index.cn.md new file mode 100644 index 00000000..d277ab79 --- /dev/null +++ b/Document/content/JSON RPC API/isBlue/_index.cn.md @@ -0,0 +1,46 @@ +--- +title: isBlue +weight: 1 +--- + + +## isBlue +### 函数名:isBlue {blockhash} +### 说明:通过节点判断该块是否为蓝色区块 +- blockhash:区块hash + +### 结果说明: +- 0:为红色区块,该块coinbase不能交易 +- 1:为蓝色区块,该块的coinbase可以交易 +- 2:还不能确定是蓝色或红色,待确认 + +#### 实例1 +``` +$ curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"isBlue","params":["0003409cc9bcfc328630982797326e62135d6fc2431db7b85c2a0fe38ff5749c"],"id":1}' https://127.0.0.1:18131 +``` +``` +{ + "jsonrpc": "2.0", + "id": 1, + "result": 2 +} +``` +#### 实例2 +可以观察到对于是否蓝色区块的判断结果,由2变为1。即由不能确认变为蓝色区块。 + +``` +$ date +Wed Jul 1 12:23:39 CST 2020 +$ curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"isBlue","params": +["0003409cc9bcfc328630982797326e62135d6fc2431db7b85c2a0fe38ff5749c"],"id":1}' https://127.0.0.1:18131 +``` + +``` +{ + "jsonrpc": "2.0", + "id": 1, + "result": 1 +} +``` + + diff --git a/Document/content/JSON RPC API/isOnMainChain/_index.cn.md b/Document/content/JSON RPC API/isOnMainChain/_index.cn.md new file mode 100644 index 00000000..ae30c03c --- /dev/null +++ b/Document/content/JSON RPC API/isOnMainChain/_index.cn.md @@ -0,0 +1,23 @@ +--- +title: isOnMainChain +weight: 1 +--- + +## isOnMainChain +### 函数名 isOnMainChain {blockhash} +### 说明:判断该block是否在主链上 + +#### 实例 +``` +curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"isOnMainChain","params":["0011cc2a9cea757a2aaa235f27f41f00e3e2ed87282175fe76767c4f50b3aa05"],"id":1}' https://127.0.0.1:18131 +``` + +输出 +``` +{ + "jsonrpc": "2.0", + "id": 1, + "result": "true" +} +``` + diff --git a/Document/content/JSON RPC API/sendRawTransaction/_index.cn.md b/Document/content/JSON RPC API/sendRawTransaction/_index.cn.md new file mode 100644 index 00000000..3f7b3544 --- /dev/null +++ b/Document/content/JSON RPC API/sendRawTransaction/_index.cn.md @@ -0,0 +1,19 @@ +--- +title: sendRawTransaction +weight: 1 +--- + +## sendRawTransaction +### 函数名:sendRawTransaction {sign_raw_tx} {allow_high_fee} +### 说明:发送交易 + +- sign_raw_tx:签名后的交易 +- allow_high_fee:允许的最大交易费 + +#### 实例: + +``` + +sendRawTransaction 0100000001ff5d53a7070fa9f0a9d12af729d2cbaf355ef1173c106a84cf9ef3a46bff03b202000000ffffffff01005504790a0000001976a914627777996288556166614462639988446255776688ac000000000000000001000000000000000000000000ffffffff6b483045022100dced4d67dd74647d0036077ee5b435838934377b1d296dd9da852772911e3be2022063dd346bd812a894968b8acacead7e7beff48947657a82f1e8f9c38876d4c905012103aba0a09f5b44138a46a2e5d26b8659923d84c4ba9437e22c3828cac43d0edb49 true + +``` diff --git a/Document/content/reference/_index.cn.md b/Document/content/reference/_index.cn.md new file mode 100644 index 00000000..acab8748 --- /dev/null +++ b/Document/content/reference/_index.cn.md @@ -0,0 +1,6 @@ +--- +title: "命令行参考" +weight: 4 +--- + + diff --git a/Document/content/test/_index.ar.md b/Document/content/test/_index.ar.md deleted file mode 100644 index 2174aa43..00000000 --- a/Document/content/test/_index.ar.md +++ /dev/null @@ -1,286 +0,0 @@ ---- -title: اختبار عرض الخط وتسليط الضوء على بناء الجملة -weight: 99 -# pre: "4. " -chapter: true -mathjax: true -markup: mmark ---- - -> To be, or not to be, Ay there's the point, To Die, to sleep, is that all? Aye all: No, to sleep, to dream, aye marry there it goes, For in that dream of death, when we awake, And borne before an everlasting Judge, From whence no passenger ever returned, The undiscovered country, at whose sight The happy smile, and the accursed damn'd. But for this, the joyful hope of this, Who'd bear the scorns and flattery of the world, Scorned by the right rich, the rich cursed of the poor? The widow being oppressed, the orphan wrong'd, The taste of hunger, or a tyrants reign, And thousand more calamities besides, To grunt and sweat under this weary life, When that he may his full Quietus make, With a bare bodkin, who would this endure, But for a hope of something after death? Which puzzles the brain, and doth confound the sense, Which makes us rather bear those evils we have, Than fly to others that we know not of. Aye that, O this conscience makes cowards of us all, Lady in thy orizons, be all my sins remembered. - -**"To be, or not to be"** is one of the most widely known and quoted lines in modern English, and the soliloquy has been referenced in innumerable works of theatre, literature and music. - -> 春眠不觉晓,处处闻啼鸟。 -> 夜来风雨声,花落知多少。 - -春眠不觉晓,处处闻啼鸟。 -夜来风雨声,花落知多少。 - -# 移舟泊烟渚# - -## 日暮客愁新## - -### 野旷天低树### - -#### 江清月近人#### - -##### 江清月近人##### - - -1. 独上高楼望尽天涯路。 -2. 衣带渐宽终不悔,为伊消得人憔悴。 -3. 众里寻他千百度,暮然回首,那人正在灯火阑珊处。 - -* 昔我往矣,杨柳依依。今我来思,雨雪霏霏。 -* 蒹葭(jiān jiā)苍苍,白露为霜。 所谓伊人,在水一方。 -* 彼采葛兮,一日不见,如三月兮。彼采萧兮,一日不见,如三秋兮。彼采艾兮,一日不见,如三岁兮。 - -# Test for headline h1 - -The quick brown fox jumps over the lazy dog - -## Test for headline h2 - -The quick brown fox jumps over the lazy dog - -### Test for headline h3 - -The quick brown fox jumps over the lazy dog - -#### Test for headline h4 - -The quick brown fox jumps over the lazy dog - -##### Test for headline h5 - -The quick brown fox jumps over the lazy dog - -## Test for Text highlight - -Note: github don't support `==hightlight==` markdown. we need to use a html 5 `` - -* 彼采葛兮,一日不见,如三月兮。 -* 彼采萧兮,一日不见,如三秋兮。 -* 彼采艾兮,一日不见,如三岁兮。 - -## Test for picture - -1. open `Keynote` or `Pages` (instructions same after this point) -2. Select a template. The background does not matter but white shows your work better -3. Drag or paste in your screenshot. Note: Using control+⌘+shift+4 you can send your screenshot directly to the clipboard. -4. Apply a drop shadow to your image -5. Select and copy just the image and paste it into your email or desired location. - -![My helpful screenshot](/images/showcase/screenshot.png) - -[ Stackexchange Question : Screenshot of selected area with shadow](http://apple.stackexchange.com/a/199248) - -### Add Shadow by using script - -```bash -#!/bin/bash - -convert "$1" -trim \( +clone -background grey25 -shadow 80x40+5+30 \) +swap -background transparent -layers merge +repage "$1-shadow.png" -``` -The best thing is transparent drop shadow around the window without the white border. - -The script from [here](https://github.com/StefanScherer/dotfiles/blob/master/bin/add-shadow) - -You might need to `brew install imagemagick` before using it. - -![Before add shadow](/images/showcase/add-shadow-before.png) -*fig.1 - Before adding the shadow* - - -![After add shadow](/images/showcase/add-shadow-after.png) -*fig.2 - 阴影效果添加之后* - -### Create favicon.ico - -``` -convert favicon.png -define icon:auto-resize=64,48,32,16 favicon.ico - -``` - -The code form [here](https://gist.github.com/pfig/1808188#gistcomment-1667360) - -## Test syntax highlighting - -### go - -```go -pckage main - -import ( - "fmt" - "time" -) - -func readword(ch chan string) { - fmt.Println("Type a word, then hit Enter.") - var word string - fmt.Scanf("%s", &word) - ch <- word -} - -func timeout(t chan bool) { - time.Sleep(5 * time.Second) - t <- true -} - -func main() { - t := make(chan bool) - go timeout(t) - - ch := make(chan string) - go readword(ch) - - select { - case word := <-ch: - fmt.Println("Received", word) - case <-t: - fmt.Println("Timeout.") - } -} -``` -### Bash - -```bash -[ -r ~/.profile ] && . ~/.profile # set up environment, once, Bourne-sh syntax only -if [ -n "$PS1" ] ; then # are we interactive? - [ -r ~/.bashrc ] && . ~/.bashrc # tty/prompt/function setup for interactive shells - [ -r ~/.bash_login ] && . ~/.bash_login # any at-login tasks for login shell only -fi # End of "if" block -``` - -### JavaScript - -```js -var counter = (function () { - var i = 0; // private property - - return { // public methods - get: function () { - alert(i); - }, - set: function (value) { - i = value; - }, - increment: function () { - alert(++i); - } - }; -})(); // module - -counter.get(); // shows 0 -counter.set(6); -counter.increment(); // shows 7 -counter.increment(); // shows 8 -``` - -### HTML - -```html - - - -MathJax TeX Test Page - - - - -When $a \ne 0$, there are two solutions to \(ax^2 + bx + c = 0\) and they are -$$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$ - - - -``` -### Scala - -```scala -var correct = 0 -var questions = 0 -var heads = 0 -var trials = 10000 - -// Let's run some trials -(1 to trials).foreach { trial => - // toss a fair coin - scala.util.Random.nextBoolean() match { - case true => // Heads was tossed. Wake on Monday. - // Sleeping Beauty always bet Heads was tossed; - // ... in this case, only once. - questions += 1 - correct += 1 - heads += 1 - case _ => // Tails was tossed. Wake on Monday and Tuesday. - // Sleeping Beauty always bet Heads was tossed; - // ... in this case, it will bet both on Monday - // and Tuesday. But it will fail! - questions += 2 - } -} - -println("Probability of SB being correct: " + correct.toDouble/questions) -println("Probability of Heads being tossed: " + heads.toDouble/trials) -``` - -Here's a sample run: - -``` -Probability of SB being correct: 0.33636242148870776 -Probability of Heads being tossed: 0.5034 -``` - -## Test for Tables - -| Lex noation | Set Theory Symbols | 概念 | -| --- | --- | --- | -| `\mid` | $$ \mid $$ | | -| `\lbrace` | $$ \lbrace \rbrace $$ | 也能用`\{\}` | -| `\in` | $$ a \in A $$ | a属于A element of| -| `\notin` | $$ a \notin A $$ | 不属于 | -| `\ni` | $$ \ni $$ | 也能用`\owns`| -| `\varnothing` | $$ \varnothing $$ | 空集 | -| `\subset` | $$ A \subset B $$ | A是B的子集 | -| `\subseteq` | $$ A \subseteq B $$ | A是B的子集(一般用这个)| -| `\subsetneq` | $$ A \subsetneq B $$ | A是B的真子集 proper subset | -| `\supset` | $$ B \supset A $$ | B包含A | -| `\supseteq` | $$ B \supseteq A $$ | B包含A(一般用这个)include| -| `\supsetneq` | $$ B \supsetneq A $$ | B真包含A | -| `\cap` | $$ A \cap B $$ | A与B的交集,A交B Intersection | -| `\cup` | $$ A \cup B $$ | A与B的并集,A并B Union| - - -## Test for MathJax (Tex/LaTeX) - -$$ \lbrace x \in X \mid x > \frac{1}{2} \rbrace $$ - -When $$a \ne 0$$ there are two solutions to $$ax^2 + bx + c = 0$$ and they are $$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$ - - -### A note for MathJax when using single $ - -When [using the single-dollar][1] delimiters, ”... the cost is $2.50 for the first one, and $2.00 for each additional one ...” would cause the phrase “2.50 for the first one, and” to be treated as mathematics since it falls between dollar signs. For this reason, if you want to use single-dollars for in-line math mode, you must enable that explicitly in your configuration: - -```html - - -``` - -[1]:http://docs.mathjax.org/en/latest/start.html#putting-mathematics-in-a-web-page - -There has been an extensive discussion on this topic, see more details [in this page](http://docs.mathjax.org/en/latest/). - - - diff --git a/Document/content/test/_index.cn.md b/Document/content/test/_index.cn.md deleted file mode 100644 index a1ac0895..00000000 --- a/Document/content/test/_index.cn.md +++ /dev/null @@ -1,287 +0,0 @@ ---- -title: 测试字体显示和 语法高亮 -weight: 99 -#pre: "4. " -chapter: true -mathjax: false -katex: true -markup: mmark ---- - -> To be, or not to be, Ay there's the point, To Die, to sleep, is that all? Aye all: No, to sleep, to dream, aye marry there it goes, For in that dream of death, when we awake, And borne before an everlasting Judge, From whence no passenger ever returned, The undiscovered country, at whose sight The happy smile, and the accursed damn'd. But for this, the joyful hope of this, Who'd bear the scorns and flattery of the world, Scorned by the right rich, the rich cursed of the poor? The widow being oppressed, the orphan wrong'd, The taste of hunger, or a tyrants reign, And thousand more calamities besides, To grunt and sweat under this weary life, When that he may his full Quietus make, With a bare bodkin, who would this endure, But for a hope of something after death? Which puzzles the brain, and doth confound the sense, Which makes us rather bear those evils we have, Than fly to others that we know not of. Aye that, O this conscience makes cowards of us all, Lady in thy orizons, be all my sins remembered. - -**"To be, or not to be"** is one of the most widely known and quoted lines in modern English, and the soliloquy has been referenced in innumerable works of theatre, literature and music. - -> 春眠不觉晓,处处闻啼鸟。 -> 夜来风雨声,花落知多少。 - -春眠不觉晓,处处闻啼鸟。 -夜来风雨声,花落知多少。 - -# 移舟泊烟渚# - -## 日暮客愁新## - -### 野旷天低树### - -#### 江清月近人#### - -##### 江清月近人##### - - -1. 独上高楼望尽天涯路。 -2. 衣带渐宽终不悔,为伊消得人憔悴。 -3. 众里寻他千百度,暮然回首,那人正在灯火阑珊处。 - -* 昔我往矣,杨柳依依。今我来思,雨雪霏霏。 -* 蒹葭(jiān jiā)苍苍,白露为霜。 所谓伊人,在水一方。 -* 彼采葛兮,一日不见,如三月兮。彼采萧兮,一日不见,如三秋兮。彼采艾兮,一日不见,如三岁兮。 - -# Test for headline h1 - -The quick brown fox jumps over the lazy dog - -## Test for headline h2 - -The quick brown fox jumps over the lazy dog - -### Test for headline h3 - -The quick brown fox jumps over the lazy dog - -#### Test for headline h4 - -The quick brown fox jumps over the lazy dog - -##### Test for headline h5 - -The quick brown fox jumps over the lazy dog - -## Test for Text highlight - -Note: github don't support `==hightlight==` markdown. we need to use a html 5 `` - -* 彼采葛兮,一日不见,如三月兮。 -* 彼采萧兮,一日不见,如三秋兮。 -* 彼采艾兮,一日不见,如三岁兮。 - -## Test for picture - -1. open `Keynote` or `Pages` (instructions same after this point) -2. Select a template. The background does not matter but white shows your work better -3. Drag or paste in your screenshot. Note: Using control+⌘+shift+4 you can send your screenshot directly to the clipboard. -4. Apply a drop shadow to your image -5. Select and copy just the image and paste it into your email or desired location. - -![My helpful screenshot](/images/showcase/screenshot.png) - -[ Stackexchange Question : Screenshot of selected area with shadow](http://apple.stackexchange.com/a/199248) - -### Add Shadow by using script - -```bash -#!/bin/bash - -convert "$1" -trim \( +clone -background grey25 -shadow 80x40+5+30 \) +swap -background transparent -layers merge +repage "$1-shadow.png" -``` -The best thing is transparent drop shadow around the window without the white border. - -The script from [here](https://github.com/StefanScherer/dotfiles/blob/master/bin/add-shadow) - -You might need to `brew install imagemagick` before using it. - -![Before add shadow](/images/showcase/add-shadow-before.png) -*fig.1 - Before adding the shadow* - - -![After add shadow](/images/showcase/add-shadow-after.png) -*fig.2 - 阴影效果添加之后* - -### Create favicon.ico - -``` -convert favicon.png -define icon:auto-resize=64,48,32,16 favicon.ico - -``` - -The code form [here](https://gist.github.com/pfig/1808188#gistcomment-1667360) - -## Test syntax highlighting - -### go - -```go -pckage main - -import ( - "fmt" - "time" -) - -func readword(ch chan string) { - fmt.Println("Type a word, then hit Enter.") - var word string - fmt.Scanf("%s", &word) - ch <- word -} - -func timeout(t chan bool) { - time.Sleep(5 * time.Second) - t <- true -} - -func main() { - t := make(chan bool) - go timeout(t) - - ch := make(chan string) - go readword(ch) - - select { - case word := <-ch: - fmt.Println("Received", word) - case <-t: - fmt.Println("Timeout.") - } -} -``` -### Bash - -```bash -[ -r ~/.profile ] && . ~/.profile # set up environment, once, Bourne-sh syntax only -if [ -n "$PS1" ] ; then # are we interactive? - [ -r ~/.bashrc ] && . ~/.bashrc # tty/prompt/function setup for interactive shells - [ -r ~/.bash_login ] && . ~/.bash_login # any at-login tasks for login shell only -fi # End of "if" block -``` - -### JavaScript - -```js -var counter = (function () { - var i = 0; // private property - - return { // public methods - get: function () { - alert(i); - }, - set: function (value) { - i = value; - }, - increment: function () { - alert(++i); - } - }; -})(); // module - -counter.get(); // shows 0 -counter.set(6); -counter.increment(); // shows 7 -counter.increment(); // shows 8 -``` - -### HTML - -```html - - - -MathJax TeX Test Page - - - - -When $a \ne 0$, there are two solutions to \(ax^2 + bx + c = 0\) and they are -$$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$ - - - -``` -### Scala - -```scala -var correct = 0 -var questions = 0 -var heads = 0 -var trials = 10000 - -// Let's run some trials -(1 to trials).foreach { trial => - // toss a fair coin - scala.util.Random.nextBoolean() match { - case true => // Heads was tossed. Wake on Monday. - // Sleeping Beauty always bet Heads was tossed; - // ... in this case, only once. - questions += 1 - correct += 1 - heads += 1 - case _ => // Tails was tossed. Wake on Monday and Tuesday. - // Sleeping Beauty always bet Heads was tossed; - // ... in this case, it will bet both on Monday - // and Tuesday. But it will fail! - questions += 2 - } -} - -println("Probability of SB being correct: " + correct.toDouble/questions) -println("Probability of Heads being tossed: " + heads.toDouble/trials) -``` - -Here's a sample run: - -``` -Probability of SB being correct: 0.33636242148870776 -Probability of Heads being tossed: 0.5034 -``` - -## Test for Tables - -| Lex noation | Set Theory Symbols | 概念 | -| --- | --- | --- | -| `\mid` | $$ \mid $$ | | -| `\lbrace` | $$ \lbrace \rbrace $$ | 也能用`\{\}` | -| `\in` | $$ a \in A $$ | a属于A element of| -| `\notin` | $$ a \notin A $$ | 不属于 | -| `\ni` | $$ \ni $$ | 也能用`\owns`| -| `\varnothing` | $$ \varnothing $$ | 空集 | -| `\subset` | $$ A \subset B $$ | A是B的子集 | -| `\subseteq` | $$ A \subseteq B $$ | A是B的子集(一般用这个)| -| `\subsetneq` | $$ A \subsetneq B $$ | A是B的真子集 proper subset | -| `\supset` | $$ B \supset A $$ | B包含A | -| `\supseteq` | $$ B \supseteq A $$ | B包含A(一般用这个)include| -| `\supsetneq` | $$ B \supsetneq A $$ | B真包含A | -| `\cap` | $$ A \cap B $$ | A与B的交集,A交B Intersection | -| `\cup` | $$ A \cup B $$ | A与B的并集,A并B Union| - - -## Test for MathJax (Tex/LaTeX) - -$$ \lbrace x \in X \mid x > \frac{1}{2} \rbrace $$ - -When $$a \ne 0$$ there are two solutions to $$ax^2 + bx + c = 0$$ and they are $$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$ - - -### A note for MathJax when using single $ - -When [using the single-dollar][1] delimiters, ”... the cost is $2.50 for the first one, and $2.00 for each additional one ...” would cause the phrase “2.50 for the first one, and” to be treated as mathematics since it falls between dollar signs. For this reason, if you want to use single-dollars for in-line math mode, you must enable that explicitly in your configuration: - -```html - - -``` - -[1]:http://docs.mathjax.org/en/latest/start.html#putting-mathematics-in-a-web-page - -There has been an extensive discussion on this topic, see more details [in this page](http://docs.mathjax.org/en/latest/). - - - diff --git a/Document/content/test/_index.en.md b/Document/content/test/_index.en.md deleted file mode 100644 index e84c6fd2..00000000 --- a/Document/content/test/_index.en.md +++ /dev/null @@ -1,287 +0,0 @@ ---- -title: Test fonts and syntax highlight -weight: 99 -# pre: "4. " -chapter: true -mathjax: false -katex: true -markup: "mmark" ---- - -> To be, or not to be, Ay there's the point, To Die, to sleep, is that all? Aye all: No, to sleep, to dream, aye marry there it goes, For in that dream of death, when we awake, And borne before an everlasting Judge, From whence no passenger ever returned, The undiscovered country, at whose sight The happy smile, and the accursed damn'd. But for this, the joyful hope of this, Who'd bear the scorns and flattery of the world, Scorned by the right rich, the rich cursed of the poor? The widow being oppressed, the orphan wrong'd, The taste of hunger, or a tyrants reign, And thousand more calamities besides, To grunt and sweat under this weary life, When that he may his full Quietus make, With a bare bodkin, who would this endure, But for a hope of something after death? Which puzzles the brain, and doth confound the sense, Which makes us rather bear those evils we have, Than fly to others that we know not of. Aye that, O this conscience makes cowards of us all, Lady in thy orizons, be all my sins remembered. - -**"To be, or not to be"** is one of the most widely known and quoted lines in modern English, and the soliloquy has been referenced in innumerable works of theatre, literature and music. - -> 春眠不觉晓,处处闻啼鸟。 -> 夜来风雨声,花落知多少。 - -春眠不觉晓,处处闻啼鸟。 -夜来风雨声,花落知多少。 - -# 移舟泊烟渚# - -## 日暮客愁新## - -### 野旷天低树### - -#### 江清月近人#### - -##### 江清月近人##### - - -1. 独上高楼望尽天涯路。 -2. 衣带渐宽终不悔,为伊消得人憔悴。 -3. 众里寻他千百度,暮然回首,那人正在灯火阑珊处。 - -* 昔我往矣,杨柳依依。今我来思,雨雪霏霏。 -* 蒹葭(jiān jiā)苍苍,白露为霜。 所谓伊人,在水一方。 -* 彼采葛兮,一日不见,如三月兮。彼采萧兮,一日不见,如三秋兮。彼采艾兮,一日不见,如三岁兮。 - -# Test for headline h1 - -The quick brown fox jumps over the lazy dog - -## Test for headline h2 - -The quick brown fox jumps over the lazy dog - -### Test for headline h3 - -The quick brown fox jumps over the lazy dog - -#### Test for headline h4 - -The quick brown fox jumps over the lazy dog - -##### Test for headline h5 - -The quick brown fox jumps over the lazy dog - -## Test for Text highlight - -Note: github don't support `==hightlight==` markdown. we need to use a html 5 `` - -* 彼采葛兮,一日不见,如三月兮。 -* 彼采萧兮,一日不见,如三秋兮。 -* 彼采艾兮,一日不见,如三岁兮。 - -## Test for picture - -1. open `Keynote` or `Pages` (instructions same after this point) -2. Select a template. The background does not matter but white shows your work better -3. Drag or paste in your screenshot. Note: Using control+⌘+shift+4 you can send your screenshot directly to the clipboard. -4. Apply a drop shadow to your image -5. Select and copy just the image and paste it into your email or desired location. - -![My helpful screenshot](/images/showcase/screenshot.png) - -[ Stackexchange Question : Screenshot of selected area with shadow](http://apple.stackexchange.com/a/199248) - -### Add Shadow by using script - -```bash -#!/bin/bash - -convert "$1" -trim \( +clone -background grey25 -shadow 80x40+5+30 \) +swap -background transparent -layers merge +repage "$1-shadow.png" -``` -The best thing is transparent drop shadow around the window without the white border. - -The script from [here](https://github.com/StefanScherer/dotfiles/blob/master/bin/add-shadow) - -You might need to `brew install imagemagick` before using it. - -![Before add shadow](/images/showcase/add-shadow-before.png) -*fig.1 - Before adding the shadow* - - -![After add shadow](/images/showcase/add-shadow-after.png) -*fig.2 - 阴影效果添加之后* - -### Create favicon.ico - -``` -convert favicon.png -define icon:auto-resize=64,48,32,16 favicon.ico - -``` - -The code form [here](https://gist.github.com/pfig/1808188#gistcomment-1667360) - -## Test syntax highlighting - -### go - -```go -pckage main - -import ( - "fmt" - "time" -) - -func readword(ch chan string) { - fmt.Println("Type a word, then hit Enter.") - var word string - fmt.Scanf("%s", &word) - ch <- word -} - -func timeout(t chan bool) { - time.Sleep(5 * time.Second) - t <- true -} - -func main() { - t := make(chan bool) - go timeout(t) - - ch := make(chan string) - go readword(ch) - - select { - case word := <-ch: - fmt.Println("Received", word) - case <-t: - fmt.Println("Timeout.") - } -} -``` -### Bash - -```bash -[ -r ~/.profile ] && . ~/.profile # set up environment, once, Bourne-sh syntax only -if [ -n "$PS1" ] ; then # are we interactive? - [ -r ~/.bashrc ] && . ~/.bashrc # tty/prompt/function setup for interactive shells - [ -r ~/.bash_login ] && . ~/.bash_login # any at-login tasks for login shell only -fi # End of "if" block -``` - -### JavaScript - -```js -var counter = (function () { - var i = 0; // private property - - return { // public methods - get: function () { - alert(i); - }, - set: function (value) { - i = value; - }, - increment: function () { - alert(++i); - } - }; -})(); // module - -counter.get(); // shows 0 -counter.set(6); -counter.increment(); // shows 7 -counter.increment(); // shows 8 -``` - -### HTML - -```html - - - -MathJax TeX Test Page - - - - -When $a \ne 0$, there are two solutions to \(ax^2 + bx + c = 0\) and they are -$$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$ - - - -``` -### Scala - -```scala -var correct = 0 -var questions = 0 -var heads = 0 -var trials = 10000 - -// Let's run some trials -(1 to trials).foreach { trial => - // toss a fair coin - scala.util.Random.nextBoolean() match { - case true => // Heads was tossed. Wake on Monday. - // Sleeping Beauty always bet Heads was tossed; - // ... in this case, only once. - questions += 1 - correct += 1 - heads += 1 - case _ => // Tails was tossed. Wake on Monday and Tuesday. - // Sleeping Beauty always bet Heads was tossed; - // ... in this case, it will bet both on Monday - // and Tuesday. But it will fail! - questions += 2 - } -} - -println("Probability of SB being correct: " + correct.toDouble/questions) -println("Probability of Heads being tossed: " + heads.toDouble/trials) -``` - -Here's a sample run: - -``` -Probability of SB being correct: 0.33636242148870776 -Probability of Heads being tossed: 0.5034 -``` - -## Test for Tables - -| Lex noation | Set Theory Symbols | 概念 | -| --- | --- | --- | -| `\mid` | $$ \mid $$ | | -| `\lbrace` | $$ \lbrace \rbrace $$ | 也能用`\{\}` | -| `\in` | $$ a \in A $$ | a属于A element of| -| `\notin` | $$ a \notin A $$ | 不属于 | -| `\ni` | $$ \ni $$ | 也能用`\owns`| -| `\varnothing` | $$ \varnothing $$ | 空集 | -| `\subset` | $$ A \subset B $$ | A是B的子集 | -| `\subseteq` | $$ A \subseteq B $$ | A是B的子集(一般用这个)| -| `\subsetneq` | $$ A \subsetneq B $$ | A是B的真子集 proper subset | -| `\supset` | $$ B \supset A $$ | B包含A | -| `\supseteq` | $$ B \supseteq A $$ | B包含A(一般用这个)include| -| `\supsetneq` | $$ B \supsetneq A $$ | B真包含A | -| `\cap` | $$ A \cap B $$ | A与B的交集,A交B Intersection | -| `\cup` | $$ A \cup B $$ | A与B的并集,A并B Union| - - -## Test for MathJax (Tex/LaTeX) - -$$ \lbrace x \in X \mid x > \frac{1}{2} \rbrace $$ - -When $$a \ne 0$$ there are two solutions to $$ax^2 + bx + c = 0$$ and they are $$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$ - - -### A note for MathJax when using single $ - -When [using the single-dollar][1] delimiters, ”... the cost is $2.50 for the first one, and $2.00 for each additional one ...” would cause the phrase “2.50 for the first one, and” to be treated as mathematics since it falls between dollar signs. For this reason, if you want to use single-dollars for in-line math mode, you must enable that explicitly in your configuration: - -```html - - -``` - -[1]:http://docs.mathjax.org/en/latest/start.html#putting-mathematics-in-a-web-page - -There has been an extensive discussion on this topic, see more details [in this page](http://docs.mathjax.org/en/latest/). - - - diff --git a/Document/content/tutorials/qitmeer-rpc/_index.md b/Document/content/tutorials/qitmeer-rpc/_index.md deleted file mode 100644 index 3fb267d0..00000000 --- a/Document/content/tutorials/qitmeer-rpc/_index.md +++ /dev/null @@ -1,1037 +0,0 @@ ---- -title: Qitmeer RPC -weight: 1 -#pre: "1. " -# chapter: true ---- - -Table of Contents -================= - - * [Qitmeer RPC 说明](#qitmeer-rpc-说明) - * [getBlockByOrder](#getblockbyorder) - * [getBlockByNum](#getblockbynum) - * [getBlock](#getblock) - * [getBlockV2](#getblockv2) - * [getBlockHeader](#getblockheader) - * [getBlockCount](#getblockcount) - * [getBlockTotal](#getblocktotal) - * [getBlockBestHash](#getblockbesthash) - * [getBlockhashByRange](#getblockhashbyrange) - * [isOnMainChain](#isonmainchain) - * [getMainChainHeight](#getmainchainheight) - * [getOrphansTotal](#getorphanstotal) - * [getTips](#gettips) - * [getMempool](#getmempool) - * [getPeerInfo](#getpeerinfo) - * [getNodeInfo](#getnodeinfo) - * [isBlue](#isblue) - * [getFees](#getfees) - * [getRawTransaction](#getrawtransaction) - * [sendRawTransaction](#sendrawtransaction) - - -# Qitmeer RPC 说明 - -## getBlockByOrder -### 函数名:getBlockByOrder {order} {verbose} {inclTx} {fullTx} -### 说明:返回指定Order的Block -- order:区块order,qitmeer采用BlockDAG算法进行共识,对区块的先后顺序进行排序。order指区块序列的序号,是一个从0开始,按顺序连续递增的整数值。请注意order不是区块的高度。 -- verbose: 是否显示详细信息,默认为false -- inclTx: 是否包含交易信息,默认为true -- fullTx:是否显示完整交易信息,默认为true - -#### 实例1: -``` -curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getBlockByOrder","params":[1,true],"id":1}' https://127.0.0.1:18131 -``` -实例1输出: -``` -{ - "hash": "0012c535ed43311b0670341fad3a489642c0bc6e6796f836aa6d235826fc9c66", - "txsvalid": true, - "confirmations": 20651, - "version": 12, - "weight": 433, - "height": 1, - "txRoot": "845738befb45db6872e37295b39837cd8dc98e77417754fd4ddab5ff169317be", - "order": 1, - "transactions": [ - { - "hex": "0c000000010a7ebb3e65b3be8a2e3425407e8e649c4bde818b7db70bdb3d4b8c3256745f37ffffffffffffffff01007841cb020000001976a91409eb5fc744c14c8cdd5a05b552c58c1fb6e7ebd088ac000000000000000072b6f25e01175108461004cbac974daf0c2f363636706f6f6c2e636e2f", - "txid": "845738befb45db6872e37295b39837cd8dc98e77417754fd4ddab5ff169317be", - "txhash": "93772af2957ecd066841fda4606bfa5e001ac151062c0b3ca7cfea60ec35e8b3", - "size": 117, - "version": 12, - "locktime": 0, - "timestamp": "2020-06-24T10:12:02+08:00", - "expire": 0, - "vin": [ - { - "coinbase": "5108461004cbac974daf0c2f363636706f6f6c2e636e2f", - "sequence": 4294967295 - } - ], - "vout": [ - { - "amount": 12000000000, - "scriptPubKey": { - "asm": "OP_DUP OP_HASH160 09eb5fc744c14c8cdd5a05b552c58c1fb6e7ebd0 OP_EQUALVERIFY OP_CHECKSIG", - "hex": "76a91409eb5fc744c14c8cdd5a05b552c58c1fb6e7ebd088ac", - "reqSigs": 1, - "type": "pubkeyhash", - "addresses": [ - "TmPrXkjpjSUBiFG9RZKPjfdsAPbiaar94Ta" - ] - } - } - ], - "blockhash": "0012c535ed43311b0670341fad3a489642c0bc6e6796f836aa6d235826fc9c66", - "confirmations": 20651 - } - ], - "stateRoot": "0000000000000000000000000000000000000000000000000000000000000000", - "bits": "34ad1ec", - "difficulty": 55235052, - "pow": { - "pow_name": "cuckaroom", - "pow_type": 3, - "nonce": 5, - "proof_data": { - "edge_bits": 29, - "circle_nonces": "fa50c20086aef40090ebab01295d5102697fcb0229e83b04b0ac4604fd9a6505118a6f05deb21206e88f9c07184fae075e218408884ed90bdfca630cf9e2a60c12fae80f909b831084669a109390e6105aa9c611aea1e71288408713c670641405f9a714abfcf81557ded81665b20f17a17370170628de17d4ccfb1755515618f5456918efd27918d4f4d218f91bb71954e3b11cb648ca1c9779541d51ee6b1ee12a711e0679131f" - } - }, - "timestamp": "2020-06-24T10:05:33+08:00", - "parentroot": "36988b21b970fe3cbc7381dec7760eea50bc869e3bfbc44856a402fac94d3a8a", - "parents": [ - "36988b21b970fe3cbc7381dec7760eea50bc869e3bfbc44856a402fac94d3a8a" - ], - "children": [ - "000de974590581de8294866535b3af182041a4cb29b71a7680b024e3bd7d12da" - ] -} - -``` - -#### 实例2: -``` -curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getBlockByOrder","params":[1,false],"id":1}' https://127.0.0.1:18131 -``` -实例2输出: -``` -{ - "jsonrpc": "2.0", - "id": 1, - "result": "0c0000008a3a4dc9fa02a45648c4fb3b9e86bc50ea0e76c7de8173bc3cfe70b9218b9836be179316ffb5da4dfd547741778ec98dcd3798b39572e37268db45fbbe3857840000000000000000000000000000000000000000000000000000000000000000ecd14a03edb4f25e05000000031dfa50c20086aef40090ebab01295d5102697fcb0229e83b04b0ac4604fd9a6505118a6f05deb21206e88f9c07184fae075e218408884ed90bdfca630cf9e2a60c12fae80f909b831084669a109390e6105aa9c611aea1e71288408713c670641405f9a714abfcf81557ded81665b20f17a17370170628de17d4ccfb1755515618f5456918efd27918d4f4d218f91bb71954e3b11cb648ca1c9779541d51ee6b1ee12a711e0679131f018a3a4dc9fa02a45648c4fb3b9e86bc50ea0e76c7de8173bc3cfe70b9218b9836010c000000010a7ebb3e65b3be8a2e3425407e8e649c4bde818b7db70bdb3d4b8c3256745f37ffffffffffffffff01007841cb020000001976a91409eb5fc744c14c8cdd5a05b552c58c1fb6e7ebd088ac000000000000000072b6f25e01175108461004cbac974daf0c2f363636706f6f6c2e636e2f" -} -``` - -#### 实例3: -``` -curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getBlockByOrder","params":[1,true,false],"id":1}' https://127.0.0.1:18131 -``` -实例3输出: -``` -{ - "jsonrpc": "2.0", - "id": 1, - "result": { - "hash": "0012c535ed43311b0670341fad3a489642c0bc6e6796f836aa6d235826fc9c66", - "txsvalid": true, - "confirmations": 20686, - "version": 12, - "weight": 433, - "height": 1, - "txRoot": "845738befb45db6872e37295b39837cd8dc98e77417754fd4ddab5ff169317be", - "order": 1, - "stateRoot": "0000000000000000000000000000000000000000000000000000000000000000", - "bits": "34ad1ec", - "difficulty": 55235052, - "pow": { - "pow_name": "cuckaroom", - "pow_type": 3, - "nonce": 5, - "proof_data": { - "edge_bits": 29, - "circle_nonces": "fa50c20086aef40090ebab01295d5102697fcb0229e83b04b0ac4604fd9a6505118a6f05deb21206e88f9c07184fae075e218408884ed90bdfca630cf9e2a60c12fae80f909b831084669a109390e6105aa9c611aea1e71288408713c670641405f9a714abfcf81557ded81665b20f17a17370170628de17d4ccfb1755515618f5456918efd27918d4f4d218f91bb71954e3b11cb648ca1c9779541d51ee6b1ee12a711e0679131f" - } - }, - "timestamp": "2020-06-24T10:05:33+08:00", - "parentroot": "36988b21b970fe3cbc7381dec7760eea50bc869e3bfbc44856a402fac94d3a8a", - "parents": [ - "36988b21b970fe3cbc7381dec7760eea50bc869e3bfbc44856a402fac94d3a8a" - ], - "children": [ - "000de974590581de8294866535b3af182041a4cb29b71a7680b024e3bd7d12da" - ] - } -} -``` - -## getBlockByNum -### 函数名:getBlockByNum {number} {verbose} {inclTx} {fullTx} -### 说明: -- number:number指按照当前节点所观察到的区块所构造的本地DAG图的区块序号,是一个从0开始,按顺序递增的连续整数值。该序号(Num)与全网其他节点无关,即并非BlockDAG共识结果的Block排序,请注意该方法和`getBlockByOder`的区别。该方法只用于帮助二级应用构造特殊业务场景而存在,返回结构并非BlockDAG共识结果,使用时请注意。 -- verbose: 是否显示详细信息,默认为false -- inclTx: 是否包含交易信息,默认为true -- fullTx:是否显示完整交易信息,默认为true - -#### 实例: - -``` -$ curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getBlockByNum","params":[1,true],"id":1}' https://127.0.0.1:18131 -``` -输出: -``` -{ - "jsonrpc": "2.0", - "id": 1, - "result": { - "hash": "83d98f64ff6517e5899a1c392d91c334ae77a8c7705cd3ca0b147a6470d8eb08", - "txsvalid": false, - "confirmations": 0, - "version": 12, - "weight": 443, - "height": 1, - "txRoot": "0cda5bc3744da7fcdd4a6dbbd72b24a58b9dcd927a171021646af87aa926315d", - "transactions": [ - { - "hex": "010000000114898f3cc6b4de34ca419365fee41fd78d74d71a70a98caa88e1260efb876a79ffffffffffffffff01007841cb020000001976a914499896c7814a6f49fa256bc5feaa5882a665339188ac000000000000000000000000012151080300009030da6dd9162f7777772e6d656572706f6f6c2e636f6d2f32303230", - "txid": "0cda5bc3744da7fcdd4a6dbbd72b24a58b9dcd927a171021646af87aa926315d", - "txhash": "0ac294d88ec9ab3f9cdfff2775d3c881a44cf4b73a1aaa2c2b57e58f055e3168", - "size": 127, - "version": 1, - "locktime": 0, - "expire": 0, - "vin": [ - { - "coinbase": "51080300009030da6dd9162f7777772e6d656572706f6f6c2e636f6d2f32303230", - "sequence": 4294967295 - } - ], - "vout": [ - { - "amount": 12000000000, - "scriptPubKey": { - "asm": "OP_DUP OP_HASH160 499896c7814a6f49fa256bc5feaa5882a6653391 OP_EQUALVERIFY OP_CHECKSIG", - "hex": "76a914499896c7814a6f49fa256bc5feaa5882a665339188ac", - "reqSigs": 1, - "type": "pubkeyhash", - "addresses": [ - "TmVfDq18VqSg735ko9aAo36tFwYww4PBGMC" - ] - } - } - ], - "blockhash": "83d98f64ff6517e5899a1c392d91c334ae77a8c7705cd3ca0b147a6470d8eb08", - "confirmations": 0 - } - ], - "stateRoot": "0000000000000000000000000000000000000000000000000000000000000000", - "bits": "1b00ffff", - "difficulty": 453050367, - "pow": { - "pow_name": "qitmeer_keccak256", - "pow_type": 6, - "nonce": 1067495060 - }, - "timestamp": "2020-06-24T10:06:46+08:00", - "parentroot": "36988b21b970fe3cbc7381dec7760eea50bc869e3bfbc44856a402fac94d3a8a", - "parents": [ - "36988b21b970fe3cbc7381dec7760eea50bc869e3bfbc44856a402fac94d3a8a" - ], - "children": [ - "null" - ] - } -} -``` - -## getBlock -### 函数名:getBlock {blockhash} {verbose} {inclTx} {fullTx} -### 说明:根据区块hash获取区块 -- blockhash : 256位区块hash -- verbose: 是否显示详细信息,默认为false -- inclTx: 是否包含交易信息,默认为true -- fullTx:是否显示完整交易信息,默认为true - -#### 实例: -``` -curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getBlock","params":["98294db0634d5afed36554a60d4565a6507e3a78dfb8cc66cc08ba29f328c682",true,true,false],"id":1}' https://127.0.0.1:18131 -``` -输出 -``` -{ - "jsonrpc": "2.0", - "id": 1, - "result": { - "hash": "98294db0634d5afed36554a60d4565a6507e3a78dfb8cc66cc08ba29f328c682", - "txsvalid": true, - "confirmations": 338, - "version": 12, - "weight": 682, - "height": 20831, - "txRoot": "040807f45457c94ed905bf72ed923154a5e951278e80a5c0eb2de0d7b269c5c1", - "order": 21300, - "transactions": [ - "5844ca2e091f8c2a770f4a0ff23318ae780b9e3a9b2076cc27b8c493dce30c03", - "c259a4dfb7eaaae92ab246f14762541581671135cd6030ac29d8c34cf77e9f32" - ], - "stateRoot": "0000000000000000000000000000000000000000000000000000000000000000", - "bits": "1a1c60ed", - "difficulty": 438067437, - "pow": { - "pow_name": "qitmeer_keccak256", - "pow_type": 6, - "nonce": 1457503796 - }, - "timestamp": "2020-07-01T12:48:52+08:00", - "parentroot": "000073e5c2787d1d2a04358c8b2fad422a602a38a6070570c2d8b724c054987f", - "parents": [ - "000073e5c2787d1d2a04358c8b2fad422a602a38a6070570c2d8b724c054987f" - ], - "children": [ - "00018c75188cc658705af615684b095bbc85a2dde6772e4bf3929b5d5505f5fb" - ] - } -} -``` - -## getBlockV2 -### 函数名:getBlocKV2 {blockhash} {verbose} {inclTx} {fullTx} -### 说明:根据区块hash获取区块(版本2) -- blockhash : 256位区块hash -- verbose: 是否显示详细信息,默认为false -- inclTx: 是否包含交易信息,默认为true -- fullTx:是否显示完整交易信息,默认为true - -V2版本RPC将交易手续费显示在单独的`transactionfee`属性中。而之前版本的交易手续费体现在coinbase的Amount中,和挖矿奖励合并显示。请注意,不论使用V1或者V2版本的API,只影响JSON数据的显示。内部的数据模型和共识模型是完全是一致的。 - -#### 实例 - -``` -curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getBlockV2","params":["98294db0634d5afed36554a60d4565a6507e3a78dfb8cc66cc08ba29f328c682",true,true,false],"id":1}' https://127.0.0.1:18131 -``` - -输出: -``` -{ - "jsonrpc": "2.0", - "id": 1, - "result": { - "hash": "98294db0634d5afed36554a60d4565a6507e3a78dfb8cc66cc08ba29f328c682", - "txsvalid": true, - "confirmations": 304, - "version": 12, - "weight": 682, - "height": 20831, - "txRoot": "040807f45457c94ed905bf72ed923154a5e951278e80a5c0eb2de0d7b269c5c1", - "order": 21300, - "transactions": [ - "5844ca2e091f8c2a770f4a0ff23318ae780b9e3a9b2076cc27b8c493dce30c03", - "c259a4dfb7eaaae92ab246f14762541581671135cd6030ac29d8c34cf77e9f32" - ], - "transactionfee": 32000, - "stateRoot": "0000000000000000000000000000000000000000000000000000000000000000", - "bits": "1a1c60ed", - "difficulty": 438067437, - "pow": { - "pow_name": "qitmeer_keccak256", - "pow_type": 6, - "nonce": 1457503796 - }, - "timestamp": "2020-07-01T12:48:52+08:00", - "parentroot": "000073e5c2787d1d2a04358c8b2fad422a602a38a6070570c2d8b724c054987f", - "parents": [ - "000073e5c2787d1d2a04358c8b2fad422a602a38a6070570c2d8b724c054987f" - ], - "children": [ - "00018c75188cc658705af615684b095bbc85a2dde6772e4bf3929b5d5505f5fb" - ] - } -} -``` - -## getBlockHeader -### 函数名:getBlockHeader {blockhash} {verbose} -### 说明:无参数,当前已定序的区块数量。 -- blockhash : 256位区块hash -- verbose :是否显示详细信息,默认为false -注:该数量-1即为当前最大的Block order - - -#### 实例 -``` -$ curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getBlockHeader","params":["0011cc2a9cea757a2aaa235f27f41f00e3e2ed87282175fe76767c4f50b3aa05",true],"id":1}' https://127.0.0.1:18131 -``` -输出 -``` -{ - "jsonrpc": "2.0", - "id": 1, - "result": { - "hash": "0011cc2a9cea757a2aaa235f27f41f00e3e2ed87282175fe76767c4f50b3aa05", - "confirmations": 21145, - "version": 12, - "parentroot": "00015f28637b8442e2399924d0db703efebd33ab3176d4ccb7b762a28529087e", - "txRoot": "c564f2c2e6fd7b7db1d09272a607388861f2bfe34550d5f7176ed4652459bbd7", - "stateRoot": "0000000000000000000000000000000000000000000000000000000000000000", - "difficulty": 55235052, - "layer": 116, - "time": 1592967313, - "pow": { - "pow_name": "cuckaroom", - "pow_type": 3, - "nonce": 19, - "proof_data": { - "edge_bits": 29, - "circle_nonces": "2b1c9b002544650140638b036dd04804cbd65304c5963305f3184d055dca110674761d0646e81d0639683d06718d1007c85c150744b960089a99a40878dff708e06320097e0d67098fa51d0a4e7c5f0acc8ad30b1e2e4e0ce5c0990cd0fcb80e1013ba0e3b614d0f5ba19c0f4904b90f0c190f12d5869012f45b621415193315ec0727160314e417b51938185314c218281ce318ca84ec18dd1b001941b7d619a571881e6f4f831f" - } - } - } -} -``` - - -## getBlockCount -### 函数名:getBlockCount -### 说明:无参数,当前已定序的区块数量。 -该数量-1即为当前最大的Block order - -#### 实例 -``` -$ curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getBlockCount","params":[],"id":1}' https://127.0.0.1:18131 -``` -输出 -``` -{ - "jsonrpc": "2.0", - "id": 1, - "result": 21177 -} -``` - -## getBlockTotal -### 函数名:getBlockTotal -### 说明:无参数,该节点所有已知的区块总数量。 -该数量包含可能存在的当前还未被BlockDAG共识定序的区块 - -#### 实例 -``` -$ curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getBlockTotal","params":[],"id":1}' https://127.0.0.1:18131 -``` -输出 -``` -{ - "jsonrpc": "2.0", - "id": 1, - "result": 21177 -} -``` - -## getBlockBestHash -### 函数名:getBlockBestHash -### 说明:无参数,获取当前最大区块Order的区块hash -### 实例 - -``` -curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getBestBlockHash","params":[],"id":1}' https://127.0.0.1:18131 -``` -输出 -``` - -{ - "jsonrpc": "2.0", - "id": 1, - "result": "000044c83486609eee3c5bb46cd539eb022ea05ed86c40ef4e6710357f225ea3" -} -``` - - -## getBlockhashByRange -### 函数名 getBlockhashByRange {start} {end} -### 说明:获取在某区间order范围的一组Blockhash -- start 开始区块order -- end 结束区块order - -#### 实例 -``` -curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getBlockhashByRange","params":[100,125],"id":null}' https://127.0.0.1:18131 -``` -输出: -``` -[ - "000c018b33589f2f731d9cfc26d5d329fefce1045b9d1e5b22e3e8e71760e0e7", - "68d1170256afeae9591bcb49c99734e582f59860d0917e449c03f08c269957a3", - "0010b1aef1910f1c5662e0991d8ba1d564e3df360c6235f6890486a35a4ca000", - "0013a4646accf2f11c96e59d51f07be4a510a0e9e12174fd569ae3744a38de24", - "0016242fcaf6effecf083aa2b7716f8825addb31530ce3141da7d50293f3dce2", - "00173736aba73591a7ce051c0a4e4605edcbafe48149849880d9b8c7781b538e", - "0007ae2245017244e3ca355bcbe2947f69ab1ab5c52112bff003842363298395", - "0016b7148e99c60cf74c96cdeffc8a966817f163013dc3fb89684946d7cbb7bc", - "000edcf8a5dad7cfdf25461359678421e51930614d73a965b8532bb608c00025", - "000ea156ad8ef5c90d0c5855a5352a9e156d8d778ee53daa5bb9145268b17693", - "2fa46ac8fa234ee5950d74fdaf0fd60d6fed406f1208d10ecff11026eaa45c86", - "000c5816df76fd7b6662cf2c9c57c87f050c1b101c5466a1fa6bbe5eebebbd22", - "178fc77f4af15e977861510c81f957b6518215ea483f847caa67e0daeb8ac0ce", - "0014fa7d8499812b5a7f404efa82b4959db5542bae55e60035cc0d5ae0ef29fa", - "0014c1c5b794c7fa91271841b6c4f63f6216529d7c9076e2e2f861e47bd31290", - "000207d33febab535405082c9bd78cd463048143429b404a120faa95b139d9b8", - "0628f63bf041cab884e55192a6bf6615c198390821542a1c3b53ad3fafc9bbd1", - "000cff170cde98b09f80c76109843d178f67dc7c64d25f6886f93ce0cd25fd7a", - "000b4c1f4a87f97b5ef7727f2fc4ffb9f5cf34b9c759e12dfb4954cfeb6f65fb", - "5d138960ca76057f379d8d6cb82bf6a93b7b2c63d1a4950d15305d12124f3b89", - "7d6d9140f516d9a12ca2109a89a17c777425b73596b9b4a7a4a4d4013da6ddec", - "2f3817197e885e805229c4be3cf94b9b7581b4e6975068e5583b8295b648d690", - "46e97b2fda23be092abd8c163c3d2f0a60018904484fd688918b7c5f257686e0", - "00015f28637b8442e2399924d0db703efebd33ab3176d4ccb7b762a28529087e", - "0011cc2a9cea757a2aaa235f27f41f00e3e2ed87282175fe76767c4f50b3aa05" -] - -``` - -## isOnMainChain -### 函数名 isOnMainChain {blockhash} -### 说明:判断该block是否在主链上 - -#### 实例 -``` -curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"isOnMainChain","params":["0011cc2a9cea757a2aaa235f27f41f00e3e2ed87282175fe76767c4f50b3aa05"],"id":1}' https://127.0.0.1:18131 -``` - -输出 -``` -{ - "jsonrpc": "2.0", - "id": 1, - "result": "true" -} -``` - -## getMainChainHeight -### 函数名 getMainChainHeight -### 说明:无参数,得到当前的主链高度。 - -#### 实例 -``` -$ curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getMainChainHeight","params":[],"id":1}' https://127.0.0.1:18131 -``` -输出 -``` -{ - "jsonrpc": "2.0", - "id": 1, - "result": "21275" -} -``` - - -## getOrphansTotal -### 函数名 getOrphansTotal -### 说明:无参数,得到当前节点的孤儿区块的数量。 -孤儿区块指当前未关联到DAG中的区块。 - -#### 实例 -``` -curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getOrphansTotal","params":[],"id":null}' https://127.0.0.1:18131 -``` -输出 -``` -{ - "jsonrpc": "2.0", - "id": null, - "result": 0 -} - -``` - -## getTips -### 函数名 getTips -### 说明:得到Tip Block列表 -Tips列表是当前节点的DAG图的Tips Block的hash列表 - -#### 实例 -``` -curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"tips","params":[],"id":null}' https://127.0.0.1:18131 -``` - -``` -{ - "jsonrpc": "2.0", - "id": null, - "result": [ - "83d98f64ff6517e5899a1c392d91c334ae77a8c7705cd3ca0b147a6470d8eb08", - "00001ae85f5c90cc2f1f9ae5b1ac148145555d884f2c7d986cb3df250c8c3ecc" - ] -} -``` - - -## getMempool -### 函数名:getMempool {txtype} {verbose} -### 说明: -- txType: 交易类型,目前只支持regular。 -- verbose:显示详细信息,目前只支持false。 - -#### 实例 -``` -curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getMempool","params":["regular",false],"id":1}' https://127.0.0.1:18131 -``` -输出 -``` -{ - "jsonrpc": "2.0", - "id": 1, - "result": [ - "8df1c9019dd7110e9c3a421f62973ff245cbad435452808363ac291bf2265613" - ] -} -``` - -## getPeerInfo -### 函数名:getPeerInfo -### 说明:无参数,取邻近节点信息 - -#### 实例 -``` -curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getPeerInfo","params":[],"id":null}' https://127.0.0.1:18131 -``` - -输出: -``` -[ - { - "uuid": "f280f357-ee4a-4958-90bf-685d24129703", - "id": 5, - "addr": "103.1.154.227:18130", - "addrlocal": "10.198.1.66:56261", - "services": "00000009", - "relaytxes": true, - "lastsend": 1593576243, - "lastrecv": 1593576298, - "bytessent": 5029, - "bytesrecv": 7315, - "conntime": 1593575403, - "timeoffset": 0, - "pingtime": 371602, - "version": 20, - "subver": "qitmeer:0.9.0", - "inbound": false, - "banscore": 0, - "syncnode": false, - "graphstate": { - "tips": [ - "0002cf49681506f5b9915c4fa199e76abc8a7d7ade9cafbe1cd1f84ec89e0704 main" - ], - "mainorder": 21199, - "mainheight": 20730, - "layer": 20730 - } - }, - { - "uuid": "b0c3462f-328d-45ba-8e3f-490c205eec85", - "id": 6, - "addr": "47.103.61.128:18130", - "addrlocal": "10.198.1.66:56262", - "services": "00000009", - "relaytxes": true, - "lastsend": 1593576298, - "lastrecv": 1593576299, - "bytessent": 2941, - "bytesrecv": 16892, - "conntime": 1593575403, - "timeoffset": 0, - "pingtime": 871878, - "version": 20, - "subver": "qitmeer:0.9.0", - "inbound": false, - "banscore": 0, - "syncnode": false, - "graphstate": { - "tips": [ - "0002cf49681506f5b9915c4fa199e76abc8a7d7ade9cafbe1cd1f84ec89e0704 main" - ], - "mainorder": 21199, - "mainheight": 20730, - "layer": 20730 - } - }, - { - "uuid": "349a58ee-3537-4576-ba8a-925a27725070", - "id": 7, - "addr": "106.15.102.183:18130", - "addrlocal": "10.198.1.66:56284", - "services": "00000009", - "relaytxes": true, - "lastsend": 1593576254, - "lastrecv": 1593576298, - "bytessent": 1471, - "bytesrecv": 7965, - "conntime": 1593575414, - "timeoffset": 0, - "pingtime": 485255, - "version": 20, - "subver": "qitmeer:0.9.0", - "inbound": false, - "banscore": 0, - "syncnode": false, - "graphstate": { - "tips": [ - "0002cf49681506f5b9915c4fa199e76abc8a7d7ade9cafbe1cd1f84ec89e0704 main" - ], - "mainorder": 21199, - "mainheight": 20730, - "layer": 20730 - } - }, - { - "uuid": "400176fd-8155-405c-ae4f-032948581558", - "id": 8, - "addr": "148.70.34.136:18130", - "addrlocal": "10.198.1.66:56413", - "services": "00000009", - "relaytxes": true, - "lastsend": 1593576307, - "lastrecv": 1593576308, - "bytessent": 1757, - "bytesrecv": 11162, - "conntime": 1593575465, - "timeoffset": 0, - "pingtime": 830143, - "version": 20, - "subver": "qitmeer:0.9.0", - "inbound": false, - "banscore": 0, - "syncnode": false, - "graphstate": { - "tips": [ - "0002cf49681506f5b9915c4fa199e76abc8a7d7ade9cafbe1cd1f84ec89e0704 main" - ], - "mainorder": 21199, - "mainheight": 20730, - "layer": 20730 - } - }, - { - "uuid": "1df6c4ca-dae0-4632-bdb2-d9ef916b7580", - "id": 1, - "addr": "104.224.174.141:18130", - "addrlocal": "10.198.1.66:56182", - "services": "00000009", - "relaytxes": true, - "lastsend": 1593576333, - "lastrecv": 1593576333, - "bytessent": 4259, - "bytesrecv": 1214, - "conntime": 1593575373, - "timeoffset": 0, - "pingtime": 244235, - "version": 20, - "subver": "qitmeer:0.9.0", - "inbound": false, - "banscore": 0, - "syncnode": false, - "graphstate": { - "tips": [ - "3b3b4e71e7ab837635da8442afb98ba4092a2df62cf25e59a58bda518ce81fca main" - ], - "mainorder": 21065, - "mainheight": 20597, - "layer": 20597 - } - }, - { - "uuid": "a8383106-45dc-4028-ae04-74d25ad09f7d", - "id": 2, - "addr": "144.202.90.65:18130", - "addrlocal": "10.198.1.66:56177", - "services": "00000009", - "relaytxes": true, - "lastsend": 1593576333, - "lastrecv": 1593576333, - "bytessent": 5178, - "bytesrecv": 8411, - "conntime": 1593575373, - "timeoffset": 0, - "pingtime": 259579, - "version": 20, - "subver": "qitmeer:0.9.0", - "inbound": false, - "banscore": 0, - "syncnode": true, - "graphstate": { - "tips": [ - "0002cf49681506f5b9915c4fa199e76abc8a7d7ade9cafbe1cd1f84ec89e0704 main" - ], - "mainorder": 21199, - "mainheight": 20730, - "layer": 20730 - } - }, - { - "uuid": "277d5f3f-3af3-486e-92ca-8da59eaa6db9", - "id": 4, - "addr": "122.112.245.133:18130", - "addrlocal": "10.198.1.66:56180", - "services": "00000009", - "relaytxes": true, - "lastsend": 1593576333, - "lastrecv": 1593576334, - "bytessent": 1692, - "bytesrecv": 9459, - "conntime": 1593575373, - "timeoffset": 0, - "pingtime": 414095, - "version": 20, - "subver": "qitmeer:0.9.0", - "inbound": false, - "banscore": 0, - "syncnode": false, - "graphstate": { - "tips": [ - "0002cf49681506f5b9915c4fa199e76abc8a7d7ade9cafbe1cd1f84ec89e0704 main" - ], - "mainorder": 21199, - "mainheight": 20730, - "layer": 20730 - } - }, - { - "uuid": "38d8647f-371d-47c6-924b-ddfe32391a83", - "id": 3, - "addr": "103.29.70.78:18130", - "addrlocal": "10.198.1.66:56175", - "services": "00000009", - "relaytxes": true, - "lastsend": 1593576333, - "lastrecv": 1593576334, - "bytessent": 2421, - "bytesrecv": 6656, - "conntime": 1593575373, - "timeoffset": -1, - "pingtime": 345824, - "version": 21, - "subver": "qitmeer:0.9.1", - "inbound": false, - "banscore": 0, - "syncnode": false, - "graphstate": { - "tips": [ - "0002cf49681506f5b9915c4fa199e76abc8a7d7ade9cafbe1cd1f84ec89e0704 main" - ], - "mainorder": 21199, - "mainheight": 20730, - "layer": 20730 - } - } -] - -``` - -## getNodeInfo -### 函数名:getNodeInfo -### 说明:无参数,获取该节点信息 - -#### 实例 - -``` -curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getNodeInfo","params":[],"id":null}' https://127.0.0.1:18131 -``` - -输出: -``` -{ - "UUID": "dc4dffc6-9c0c-417f-9cb2-a1fdc4877915", - "version": 90100, - "buildversion": "0.9.1+dev-7ae8c17", - "protocolversion": 21, - "totalsubsidy": 254484000000000, - "graphstate": { - "tips": [ - "00006869b1f1e29db24cc528a86370b4355f1dc6a618ac0549495679f0bc484b main" - ], - "mainorder": 21207, - "mainheight": 20738, - "layer": 20738 - }, - "timeoffset": 0, - "connections": 8, - "pow_diff": { - "blake2bd_diff": 1, - "cuckaroo_diff": 1, - "cuckatoo_diff": 1 - }, - "testnet": true, - "mixnet": false, - "confirmations": 10, - "coinbasematurity": 720, - "errors": "", - "modules": [ - "qitmeer", - "miner", - "test" - ] -} -``` - -#### 结果说明: -- confirmations:代表非coinbase交易的UXTO可以被花费的最小确认数,当前的共识的最小确认数为10个确认。 -- coinbasematurity:代表coinbase交易的UXTO可以被花费的最小确认数,当前的共识是720个确认。 -- 注:不论coinbase交易还是非coinbase交易,除了满足各自的最小确认条件外,还需要包含该交易的区块满足如下条件,才能满足该该交易的UTXO可花费: - - 1.)BlockDAG共识约束,即该区块为蓝色区块,详见见rpc isBule - - 2.)该区块为交易合法区块,即区块的`txsvalid`属性为true。详见rpc getBlockByOrder - - - -## isBlue -### 函数名:isBlue {blockhash} -### 说明:通过节点判断该块是否为蓝色区块 -- blockhash:区块hash - -### 结果说明: -- 0:为红色区块,该块coinbase不能交易 -- 1:为蓝色区块,该块的coinbase可以交易 -- 2:还不能确定是蓝色或红色,待确认 - -#### 实例1 -``` -$ curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"isBlue","params":["0003409cc9bcfc328630982797326e62135d6fc2431db7b85c2a0fe38ff5749c"],"id":1}' https://127.0.0.1:18131 -``` -``` -{ - "jsonrpc": "2.0", - "id": 1, - "result": 2 -} -``` -#### 实例2 -可以观察到对于是否蓝色区块的判断结果,由2变为1。即由不能确认变为蓝色区块。 - -``` -$ date -Wed Jul 1 12:23:39 CST 2020 -$ curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"isBlue","params": -["0003409cc9bcfc328630982797326e62135d6fc2431db7b85c2a0fe38ff5749c"],"id":1}' https://127.0.0.1:18131 -``` - -``` -{ - "jsonrpc": "2.0", - "id": 1, - "result": 1 -} -``` - - -## getFees -### 函数名:getFees {blockhash} -### 说明:得到区块的交易手续费 -- blockhash : 256位区块hash - -#### 实例1 -``` -curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getFees","params":["00001ae85f5c90cc2f1f9ae5b1ac148145555d884f2c7d986cb3df250c8c3ecc"],"id":1}' https://127.0.0.1:18131 - -``` - -输出 -``` -{ - "jsonrpc": "2.0", - "id": 1, - "result": 0 -} -``` - -#### 实例2 -``` -curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getFees","params":["0001e69751e25747286d905964ed3c838b63e185074405eb2a7121cf0a72e259"],"id":1}' https://127.0.0.1:18131 -``` - -输出 -``` -{ - "jsonrpc": "2.0", - "id": 1, - "result": 49000 -} -``` - -## getRawTransaction -### 函数名:getRawTransaction {txid} -### 说明:通过txid获取交易 -- txid 交易id 为一个256位hash值。 -- verbose 是否显示详细信息,默认为false - -#### 实例 -``` -curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getRawTransaction","params":["c259a4dfb7eaaae92ab246f14762541581671135cd6030ac29d8c34cf77e9f32",true],"id":1}' https://127.0.0.1:18131 -``` -输出 -``` -{ - "hex": "0100000001dc7d54db024a1ef06e38b85ab01af2d60043e3d36b5411691224c05dcf36f63c01000000ffffffff02659ca300000000001976a91406e2097d585337cdd10aefa09994b511127af0bb88acf0e8cd6f230200001976a914fe27c90d4ed4de3269c0bb9ae1d7639865e3bf2888ac00000000000000008015fc5e016b48304502210090910aa0190a6571319b0b638bfbb593582575703abdd4f1a7f0da2812cda7d102205dae6fee28396bfeb8f1b814884d8d03ab0dd9f30b171d906c24914ba2f85b1a012103cd4fa2ea2688ac9e0a62584635244f572d22c13730d5576722d6571aabfddca8", - "txid": "c259a4dfb7eaaae92ab246f14762541581671135cd6030ac29d8c34cf77e9f32", - "txhash": "9b603ba3b17fd8491749ac366a5064d8b7b70be02568e405406a9acd70e971a8", - "size": 235, - "version": 1, - "locktime": 0, - "timestamp": "2020-07-01T12:48:00+08:00", - "expire": 0, - "vin": [ - { - "txid": "3cf636cf5dc024126911546bd3e34300d6f21ab05ab8386ef01e4a02db547ddc", - "vout": 1, - "sequence": 4294967295, - "scriptSig": { - "asm": "304502210090910aa0190a6571319b0b638bfbb593582575703abdd4f1a7f0da2812cda7d102205dae6fee28396bfeb8f1b814884d8d03ab0dd9f30b171d906c24914ba2f85b1a01 03cd4fa2ea2688ac9e0a62584635244f572d22c13730d5576722d6571aabfddca8", - "hex": "48304502210090910aa0190a6571319b0b638bfbb593582575703abdd4f1a7f0da2812cda7d102205dae6fee28396bfeb8f1b814884d8d03ab0dd9f30b171d906c24914ba2f85b1a012103cd4fa2ea2688ac9e0a62584635244f572d22c13730d5576722d6571aabfddca8" - } - } - ], - "vout": [ - { - "amount": 10722405, - "scriptPubKey": { - "asm": "OP_DUP OP_HASH160 06e2097d585337cdd10aefa09994b511127af0bb OP_EQUALVERIFY OP_CHECKSIG", - "hex": "76a91406e2097d585337cdd10aefa09994b511127af0bb88ac", - "reqSigs": 1, - "type": "pubkeyhash", - "addresses": [ - "TmPaUYQuUtfCysrYVHc4AdhpVHxw7EskHTP" - ] - } - }, - { - "amount": 2351222876400, - "scriptPubKey": { - "asm": "OP_DUP OP_HASH160 fe27c90d4ed4de3269c0bb9ae1d7639865e3bf28 OP_EQUALVERIFY OP_CHECKSIG", - "hex": "76a914fe27c90d4ed4de3269c0bb9ae1d7639865e3bf2888ac", - "reqSigs": 1, - "type": "pubkeyhash", - "addresses": [ - "Tmn7vzzSrvAPNLtwpD5YjiWwVUBD74Hjdww" - ] - } - } - ], - "confirmations": 0 -} - -``` - -## sendRawTransaction -### 函数名:sendRawTransaction {sign_raw_tx} {allow_high_fee} -### 说明:发送交易 - -- sign_raw_tx:签名后的交易 -- allow_high_fee:允许的最大交易费 - -#### 实例: - -``` - -sendRawTransaction 0100000001ff5d53a7070fa9f0a9d12af729d2cbaf355ef1173c106a84cf9ef3a46bff03b202000000ffffffff01005504790a0000001976a914627777996288556166614462639988446255776688ac000000000000000001000000000000000000000000ffffffff6b483045022100dced4d67dd74647d0036077ee5b435838934377b1d296dd9da852772911e3be2022063dd346bd812a894968b8acacead7e7beff48947657a82f1e8f9c38876d4c905012103aba0a09f5b44138a46a2e5d26b8659923d84c4ba9437e22c3828cac43d0edb49 true - -``` From 80ade8e12dd96fea2b64185289af8acc9d53df52 Mon Sep 17 00:00:00 2001 From: Alex Wu Date: Thu, 2 Jul 2020 19:18:06 +0800 Subject: [PATCH 28/69] refactor qitmeer rpc doc --- Document/content/JSON RPC API/_index.cn.md | 43 +- Document/content/JSON RPC API/_index.en.md | 49 ++ .../content/JSON RPC API/block/_index.en.md | 584 ------------------ .../createRawTransaction/_index.en.md | 31 + .../_index.en.md | 44 +- .../_index.cn.md | 6 +- .../getBestBlockHash/_index.en.md | 27 + .../JSON RPC API/getBlock/_index.en.md | 130 ++++ .../JSON RPC API/getBlockByNum/_index.en.md | 32 + .../JSON RPC API/getBlockByOrder/_index.en.md | 29 + .../JSON RPC API/getBlockCount/_index.en.md | 24 + .../JSON RPC API/getBlockHeader/_index.en.md | 76 +++ .../{miner => getBlockTemplate}/_index.en.md | 32 +- .../JSON RPC API/getBlockTotal/_index.en.md | 26 + .../JSON RPC API/getBlockWeight/_index.en.md | 4 + .../JSON RPC API/getBlockhash/_index.en.md | 20 + .../getBlockhashByRange/_index.en.md | 36 ++ .../JSON RPC API/getCoinbase/_index.en.md | 42 ++ .../getMainChainHeight/_index.en.md | 36 ++ .../JSON RPC API/getNodeInfo/_index.en.md | 82 +++ .../JSON RPC API/getOrphansTotal/_index.en.md | 26 + .../{chain => getPeerInfo}/_index.en.md | 89 +-- .../getRawTransaction/_index.cn.md | 2 +- .../getRawTransactionByHash/_index.en.md | 4 + .../content/JSON RPC API/getUtxo/_index.en.md | 4 + .../content/JSON RPC API/isBlue/_index.en.md | 30 + .../JSON RPC API/isCurrent/_index.en.md | 26 + .../JSON RPC API/isOnMainChain/_index.en.md | 26 + .../JSON RPC API/overview/_index.en.md | 0 .../sendRawTransaction/_index.cn.md | 2 +- .../sendRawTransaction/_index.en.md | 4 + .../JSON RPC API/submitBlock/_index.en.md | 25 + .../content/JSON RPC API/tips/_index.en.md | 26 + Document/content/_index.cn.md | 6 +- 34 files changed, 854 insertions(+), 769 deletions(-) delete mode 100644 Document/content/JSON RPC API/block/_index.en.md create mode 100644 Document/content/JSON RPC API/createRawTransaction/_index.en.md rename Document/content/JSON RPC API/{transaction => decodeRawTransaction}/_index.en.md (57%) rename Document/content/JSON RPC API/{getBlockBestHash => getBestBlockHash}/_index.cn.md (83%) create mode 100644 Document/content/JSON RPC API/getBestBlockHash/_index.en.md create mode 100644 Document/content/JSON RPC API/getBlock/_index.en.md create mode 100644 Document/content/JSON RPC API/getBlockByNum/_index.en.md create mode 100644 Document/content/JSON RPC API/getBlockByOrder/_index.en.md create mode 100644 Document/content/JSON RPC API/getBlockCount/_index.en.md create mode 100644 Document/content/JSON RPC API/getBlockHeader/_index.en.md rename Document/content/JSON RPC API/{miner => getBlockTemplate}/_index.en.md (76%) create mode 100644 Document/content/JSON RPC API/getBlockTotal/_index.en.md create mode 100644 Document/content/JSON RPC API/getBlockWeight/_index.en.md create mode 100644 Document/content/JSON RPC API/getBlockhash/_index.en.md create mode 100644 Document/content/JSON RPC API/getBlockhashByRange/_index.en.md create mode 100644 Document/content/JSON RPC API/getCoinbase/_index.en.md create mode 100644 Document/content/JSON RPC API/getMainChainHeight/_index.en.md create mode 100644 Document/content/JSON RPC API/getNodeInfo/_index.en.md create mode 100644 Document/content/JSON RPC API/getOrphansTotal/_index.en.md rename Document/content/JSON RPC API/{chain => getPeerInfo}/_index.en.md (51%) create mode 100644 Document/content/JSON RPC API/getRawTransactionByHash/_index.en.md create mode 100644 Document/content/JSON RPC API/getUtxo/_index.en.md create mode 100644 Document/content/JSON RPC API/isBlue/_index.en.md create mode 100644 Document/content/JSON RPC API/isCurrent/_index.en.md create mode 100644 Document/content/JSON RPC API/isOnMainChain/_index.en.md delete mode 100644 Document/content/JSON RPC API/overview/_index.en.md create mode 100644 Document/content/JSON RPC API/sendRawTransaction/_index.en.md create mode 100644 Document/content/JSON RPC API/submitBlock/_index.en.md create mode 100644 Document/content/JSON RPC API/tips/_index.en.md diff --git a/Document/content/JSON RPC API/_index.cn.md b/Document/content/JSON RPC API/_index.cn.md index edfb273b..86a6eeea 100644 --- a/Document/content/JSON RPC API/_index.cn.md +++ b/Document/content/JSON RPC API/_index.cn.md @@ -3,27 +3,28 @@ title: Qitmeer JSON RPC 说明 weight: 1 --- - * [Qitmeer JSON RPC 命令列表](#qitmeer-json-rpc) - * [getBlockByOrder](getblockbyorder) - * [getBlockByNum](getblockbynum) - * [getBlock](getblock) - * [getBlockV2](getblockv2) - * [getBlockHeader](getblockheader) - * [getBlockCount](#getblockcount) - * [getBlockTotal](#getblocktotal) - * [getBlockBestHash](#getblockbesthash) - * [getBlockhashByRange](#getblockhashbyrange) - * [isOnMainChain](#isonmainchain) - * [getMainChainHeight](#getmainchainheight) - * [getOrphansTotal](#getorphanstotal) - * [getTips](#gettips) - * [getMempool](#getmempool) - * [getPeerInfo](#getpeerinfo) - * [getNodeInfo](#getnodeinfo) - * [isBlue](#isblue) - * [getFees](#getfees) - * [getRawTransaction](#getrawtransaction) - * [sendRawTransaction](#sendrawtransaction) +### Qitmeer JSON RPC 命令列表 + + - [getBlockByOrder](getblockbyorder) + - [getBlockByNum](getblockbynum) + - [getBlock](getblock) + - [getBlockV2](getblockv2) + - [getBlockHeader](getblockheader) + - [getBlockCount](#getblockcount) + - [getBlockTotal](#getblocktotal) + - [getBlockBestHash](#getblockbesthash) + - [getBlockhashByRange](#getblockhashbyrange) + - [isOnMainChain](#isonmainchain) + - [getMainChainHeight](#getmainchainheight) + - [getOrphansTotal](#getorphanstotal) + - [getTips](#gettips) + - [getMempool](#getmempool) + - [getPeerInfo](#getpeerinfo) + - [getNodeInfo](#getnodeinfo) + - [isBlue](#isblue) + - [getFees](#getfees) + - [getRawTransaction](#getrawtransaction) + - [sendRawTransaction](#sendrawtransaction) diff --git a/Document/content/JSON RPC API/_index.en.md b/Document/content/JSON RPC API/_index.en.md index d264ebe9..328b61d6 100644 --- a/Document/content/JSON RPC API/_index.en.md +++ b/Document/content/JSON RPC API/_index.en.md @@ -3,3 +3,52 @@ title: Qitmeer JSON RPC weight: 1 --- +### JSON-RPC API Reference + +#### Block +- [getBestBlockHash](getbestblockhash) +- [getBlock](getblock) +- [getBlockByNum](getblockbynum) +- [getBlockByOrder](getblockbyorder) +- [getBlockCount](getblockcount) +- [getBlockhash](getblockhash) +- [getBlockhashByRange](getblockhashbyrange) +- [getBlockHeader](getblockheader) +- [getBlockTotal](getblocktotal) +- [getBlockWeight](getblockweight) +- [getCoinbase](getcoinbase) +- [getMainChainHeight](getmainchainheight) +- [getOrphansTotal](getorphanstotal) +- [isBlue](isblue) +- [isCurrent](iscurrent) +- [isOnMainChain](isonmainchain) +- [tips](tips) + +#### Chain +- [getNodeInfo](getnodeinfo) +- [getPeerInfo](getpeerinfo) + + +#### Miner + +- [getBlockTemplate](getblocktemplate) +- [submitBlock](submitblock) + +#### Transaction + +- [createRawTransaction](createrawtransaction) +- [decodeRawTransaction](decoderawtransaction) +- [getRawTransactionByHash](getrawtransactionbyhash) +- [getUtxo](getutxo) +- [sendRawTransaction](sendrawtransaction) + + + + + + + + + + + diff --git a/Document/content/JSON RPC API/block/_index.en.md b/Document/content/JSON RPC API/block/_index.en.md deleted file mode 100644 index 67f53d4a..00000000 --- a/Document/content/JSON RPC API/block/_index.en.md +++ /dev/null @@ -1,584 +0,0 @@ ---- -title: The `Block` Module ---- - -## JSON-RPC methods - -- [getBestBlockHash](#getBestBlockHash) -- [getBlock](#getBlock) -- [getBlockByID](#getBlockByID) -- [getBlockByOrder](#getBlockByOrder) -- [getBlockCount](#getBlockCount) -- [getBlockhash](#getBlockhash) -- [getBlockhashByRange](#getBlockhashByRange) -- [getBlockHeader](#getBlockHeader) -- [getBlockTotal](#getBlockTotal) -- [getBlockWeight](#getBlockWeight) -- [getCoinbase](#getCoinbase) -- [getMainChainHeight](#getMainChainHeight) -- [getOrphansTotal](#getOrphansTotal) -- [isBlue](#isBlue) -- [isCurrent](#isCurrent) -- [isOnMainChain](#isOnMainChain) -- [tips](#tips) - -## JSON-RPC API Reference - -### getBestBlockHash -Returns the hash of the of the best (most recent) block in the longest block chain. - -#### Parameters -None -#### Returns -##### `(string)` - best block hash - -#### Example - -##### Request -```bash -curl --data '{"method":"getBestBlockHash","params":[],"jsonrpc":"2.0","id":1}' -s -k -u "rpcuser:rpcpass" -H 'Content-Type: application/json' http://127.0.0.1:18131 -``` - -##### Response -```js -"000005c905e232a3320c35e38ec2a7f8f9d03e3cc28faef007cc46f273835f4b" -``` - -*** - -### getBlock -Returns information about a block given its hash. - -#### Parameters - -1. `hash: (string)` the hash of the block. -2. `verbose: (boolean, optional, default=false)` specifies the block is returned as a JSON object instead of hex-encoded string. -3. `inclTx: (boolean, optional, default=true)` whether or not include transactions. -4. `fullTx: (boolean, optional, default=true)` specifies that each transaction is returned as a JSON object . - -#### Returns -##### `(object,inclTx=false)` not show - - `hash, confirmations, version, parentsroot, difficulty, pow` - - reference [getBlockHeader](#getBlockHeader) - - - - `weight: (numeric)` the weight of the block. - - `height: (numeric)` the height of the block in the block DAG. - - `order: (numeric)` the global order of the block. - - `bits: (numeric)` the bits which represent the block difficulty. - - `timestamp: (string)` block created time (ISO 8601 format). - - `parents: (string)` blocks that are referenced from this block - - `children: (string)` blocks that reference to this block - -##### `(object, inclTx=true, fullTx=false)` show hash list of transactions - - all fields with inclTx=false - - `transactions: (array of string)` transaction hashes -##### `(object, inclTx=true, fullTx=true)` transaction details - - all fields with inclTx=false - - `transactions: (array of object)` transaction object - - `hex: (string)` hex-encoded transaction / hex-encoded bytes of the script. - - `txid: (string)` the hash of the transaction WITHOUT signature. - - `txhash: (string)` the hash of the transaction WITH signature. - - `size: (numeric)` transaction size. - - `version: (enum)` transaction version. - - `1` coinbase transaction - - `2` ordinary transaction - - `locktime: (numeric)` the transaction lock time, cannot be spent before lock time. - - `expire: (numeric)` expired block height, tx cannot be spent after it. - - `vin: (array of json objects)` the transaction inputs as json objects. - - `coinbase: (string)` the hex-encoded bytes of the signature script. - - `sequence: (numeric)` the script sequence number. - - `vout: (array of json objects)` the transaction outputs as json objects. - - `amount: (numeric)` the value in QIT. - - `scriptPubKey: (json object)` the public key script used to pay coins. - - `asm: (string)` disassembly of the script. - - `hex: (string)` hex-encoded bytes of the script. - - `reqSigs: (numeric)` the number of required signatures. - - `type: (string)` the type of the script (e.g. 'pubkeyhash'). - - `addresses: (json array of string)` the addresses associated with this output. - -#### Example - -##### Request -```bash - curl --data '{"method":"getBlock","params":["11dbd3e6202f41eba102277bdb65adff82899219a870295ed8424b7c035af0f3", true, true, false],"jsonrpc":"2.0","id":1}' -s -k -u "rpcuser:rpcpass" -H 'Content-Type: application/json' http://127.0.0.1:18131 |jq . -``` -##### Response -```js -{ - "hash": "11dbd3e6202f41eba102277bdb65adff82899219a870295ed8424b7c035af0f3", - "txsvalid": true, - "confirmations": 31785, - "version": 11, - "weight": 474, - "height": 1, - "txRoot": "7b73360b8099c1c4e91ab63ee71210202a802592491a90f0fd5c1275a5556d3d", - "order": 1, - "transactions": [ - { - "hex": "010000000152868a9025d93bfa3948f8396c4779f735dcae7940d9e648555349c854c85cf8ffffffffffffffff01007841cb020000001976a9143be2e1e7eaffe6ee4c90d5db043576df7f2e174b88ac00000000000000000144510852fdfc072182654d1430353537373030363739313934373737393431302465316438316561652d313263662d343932302d623735312d323833383336616333306265", - "txid": "7b73360b8099c1c4e91ab63ee71210202a802592491a90f0fd5c1275a5556d3d", - "txhash": "e67a6d03533120d6fb280620caadcf3a47dee028d8ede9dbb6eef91b06bb336d", - "size": 158, - "version": 1, - "locktime": 0, - "expire": 0, - "vin": [ - { - "coinbase": "510852fdfc072182654d1430353537373030363739313934373737393431302465316438316561652d313263662d343932302d623735312d323833383336616333306265", - "sequence": 4294967295 - } - ], - "vout": [ - { - "amount": 12000000000, - "scriptPubKey": { - "asm": "OP_DUP OP_HASH160 3be2e1e7eaffe6ee4c90d5db043576df7f2e174b OP_EQUALVERIFY OP_CHECKSIG", - "hex": "76a9143be2e1e7eaffe6ee4c90d5db043576df7f2e174b88ac", - "reqSigs": 1, - "type": "pubkeyhash", - "addresses": [ - "TmUQjNKPA3dLBB6ZfcKd4YSDThQ9Cqzmk5S" - ] - } - } - ], - "blockhash": "11dbd3e6202f41eba102277bdb65adff82899219a870295ed8424b7c035af0f3", - "confirmations": 31785 - } - ], - "stateRoot": "0000000000000000000000000000000000000000000000000000000000000000", - "bits": "2018000", - "difficulty": 33652736, - "pow": { - "pow_name": "cuckaroo", - "pow_type": 1, - "nonce": 526, - "proof_data": { - "edge_bits": 24, - "circle_nonces": "7a8e09004e040a00f6850e00582a1200d96613006fc91a000ca11c00f78124001b613600c266370037ef430073915000bbf85500b0795600691e5d00c7b35f0048bc670048897c00c50a7d006f22820038029100f4819a005864a6000aa9a600b5f0aa008169b200d1b4bb004cbfc100a32ac3001d6ac70045a1c900a95ecc002e55d70077ffd800a451d9007b38db00ab79e100dc14e600c5b6e9000efff0006821fa007650fb00" - } - }, - "timestamp": "2019-12-30T15:55:42+08:00", - "parentroot": "caf26cf7705c0917bfb157150ab29f196465daf83c8ac1c82553aa9f207bd584", - "parents": [ - "caf26cf7705c0917bfb157150ab29f196465daf83c8ac1c82553aa9f207bd584" - ], - "children": [ - "0ea57734fc4baeb7fb8669a7e52b948fb94277a3f0a08caaf25592c7fef7c965" - ] -} -``` - -*** - -### getBlockByID -Returns information about a block given its local resource ID. - -#### Parameters - -1. `block ID: (numeric, required)` the local resource ID of the block, resource ID doesn't reach consensus on the network, it is generated by each node when accepting a new block. -2. `verbose: (boolean, optional, default=false)` reference [getBlock](#getBlock). -3. `inclTx: (boolean, optional, default=true)` reference [getBlock](#getBlock). -4. `fullTx: (boolean, optional, default=true)` reference [getBlock](#getBlock). - -#### Returns -reference [getBlock](#getBlock) - -#### Example - -##### Request -```bash - curl --data '{"method":"getBlockByID","params":[2, true, true, false],"jsonrpc":"2.0","id":1}' -s -k -u "rpcuser:rpcpass" -H 'Content-Type: application/json' http://127.0.0.1:18131 |jq . -``` - -##### Response - -reference [getBlock](#getBlock) - -*** - -### getBlockByOrder -Returns information about a block given its global order. - -#### Parameters - -1. `block ID: (numeric, required)` the local resource ID of the block, resource ID doesn't reach consensus on the network, it is generated by each node when accepting a new block. -2. `verbose: (boolean, optional, default=false)` reference [getBlock](#getBlock). -3. `inclTx: (boolean, optional, default=true)` reference [getBlock](#getBlock). -4. `fullTx: (boolean, optional, default=true)` reference [getBlock](#getBlock). - -#### Returns -reference [getBlock](#getBlock) - -#### Example - -##### Request -```bash - curl --data '{"method":"getBlockByID","params":[2, true, true, false],"jsonrpc":"2.0","id":1}' -s -k -u "rpcuser:rpcpass" -H 'Content-Type: application/json' http://127.0.0.1:18131 |jq . -``` - -##### Response - -reference [getBlock](#getBlock) - -*** - -### getBlockCount -Returns the number of stable blocks . - -#### Parameters -None - -#### Returns -- `(numeric)` number of blocks, the network should have reached consensus on this number - -#### Example - -##### Request -```bash - curl --data '{"method":"getBlockCount","params":[],"jsonrpc":"2.0","id":1}' -s -k -u "rpcuser:rpcpass" -H 'Content-Type: application/json' http://127.0.0.1:18131 |jq . -``` - -##### Response -34787 - -*** - -### getBlockhash -Returns hash of the block at the given order. - -#### Parameters -1. block order (numeric, required) - -#### Returns -- `(string)` block hash - -#### Example - -##### Request -```bash - curl --data '{"method":"getBlockhash","params":[2],"jsonrpc":"2.0","id":1}' -s -k -u "rpcuser:rpcpass" -H 'Content-Type: application/json' http://127.0.0.1:18131 |jq . -``` - -##### Response -0ea57734fc4baeb7fb8669a7e52b948fb94277a3f0a08caaf25592c7fef7c965 - -*** - -### getBlockhashByRange -Returns hash of the block at the given order. - -#### Parameters -1. start order (numeric, required) -1. end order (numeric, required) - -#### Returns -- `(array of string)` list of block hashes - -#### Example - -##### Request -```bash - curl --data '{"method":"getBlockhashByRange","params":[1, 9],"jsonrpc":"2.0","id":1}' -s -k -u "rpcuser:rpcpass" -H 'Content-Type: application/json' http://127.0.0.1:18131 |jq . -``` - -##### Response -```js -[ - "11dbd3e6202f41eba102277bdb65adff82899219a870295ed8424b7c035af0f3", - "0ea57734fc4baeb7fb8669a7e52b948fb94277a3f0a08caaf25592c7fef7c965", - "03879bf60c08cca7885790661e0e96147fc0012428d6b326eb5ffb2eb0f3b073", - "18917e39ec36a68843024b9212934a3a8b23d3f5629987d0565fb74c7683f13b", - "0385e16851b36983a1110e8cbf9885005e76a38be0983a2520e72c06da98f590", - "030fcf757bef879016095dd6ef40503418758632d4817ef5a20fd7ab87c427c7", - "1f876a43c630c3f0e065668ff12b88a0403bd8f9aa790b39f6982428c7c46272", - "1cdcbe73bfc539086296df62a92cd027b89d01d370826b2ac763fc3997dc7e8a" -] -``` - -*** - -### GetBlockHeader -Returns hex-encoded bytes of the serialized block header. - -#### Parameters -1. `block hash: (string)` the hash of the block. -2. `verbose: (boolean)` specifies the block header is returned as a JSON object instead of a hex-encoded string. - -#### Returns -##### `(object)` deserialized block data -- hash: (string) the hash of the block (same as provided). -- confirmations: (numeric) the number of confirmations. -- version: (numeric) the block version. -- parentsroot: (string) The merkle root of the previous parent blocks (the dag layer) -- txRoot: (string) the root of the transaction trie of the block. -- stateRoot: (string) the root of the final state trie of the block. -- difficulty: (numeric) the proof-of-work difficulty as a multiple of the minimum difficulty. -- pow: (object) mining info - - pow_name: (string) mining algorithm name. - - *Options* - - blak2bd: double blak2b, CPU based - - cuckroo: ASIC proof, GPU based - - cucktoo: ASIC friendly, GPU based - - pow_type: (numeric) mining algorithm type. - - *Options* - - 0: blake2bd - - 1: cuckroo - - 2: cucktoo - - nonce: (numeric) - the block nonce. - - proof_data: (object) - cuckroo algorithm proof - - "edge_bits": (numeric) - number of edge bit, the bigger the harder - - "circle_nonces": (string) - circle nonces, raw proof data -- hash: (string) the hash of the block (same as provided). -- confirmations: (numeric) the number of confirmations. -- version: (numeric) the block version. - -- layer: (string) length of the longest path from genesis to this block -- time: (string) the block time in seconds since 1 Jan 1970 GMT. - -##### `(string)` hex-encoded bytes of the serialized block - -#### Example - -##### Request -```bash -curl --data '{"method":"getBlockHeader","params":["11dbd3e6202f41eba102277bdb65adff82899219a870295ed8424b7c035af0f3", true],"jsonrpc":"2.0","id":1}' -s -k -u "rpcuser:rpcpass" -H 'Content-Type: application/json' http://127.0.0.1:18131 |jq . -``` - -##### Response -```js -{ - "hash": "11dbd3e6202f41eba102277bdb65adff82899219a870295ed8424b7c035af0f3", - "confirmations": 32263, - "version": 11, - "parentroot": "caf26cf7705c0917bfb157150ab29f196465daf83c8ac1c82553aa9f207bd584", - "txRoot": "7b73360b8099c1c4e91ab63ee71210202a802592491a90f0fd5c1275a5556d3d", - "stateRoot": "0000000000000000000000000000000000000000000000000000000000000000", - "difficulty": 33652736, - "layer": 1, - "time": 1577692542, - "pow": { - "pow_name": "cuckaroo", - "pow_type": 1, - "nonce": 526, - "proof_data": { - "edge_bits": 24, - "circle_nonces": "7a8e09004e040a00f6850e00582a1200d96613006fc91a000ca11c00f78124001b613600c266370037ef430073915000bbf85500b0795600691e5d00c7b35f0048bc670048897c00c50a7d006f22820038029100f4819a005864a6000aa9a600b5f0aa008169b200d1b4bb004cbfc100a32ac3001d6ac70045a1c900a95ecc002e55d70077ffd800a451d9007b38db00ab79e100dc14e600c5b6e9000efff0006821fa007650fb00" - } - } -} -``` - -*** - -### GetBlockTotal -Return the total number blocks that this dag currently owned - -#### Parameters -None - -#### Returns -##### `(numeric)` total number - -#### Example - -##### Request -```bash -curl --data '{"method":"getBlockTotal","params":[],"jsonrpc":"2.0","id":1}' -s -k -u "rpcuser:rpcpass" -H 'Content-Type: application/json' http://127.0.0.1:18131 |jq . -``` - -##### Response -```js -34970 -``` - -*** - -### GetCoinbase -Return the coin base data of given block - -#### Parameters -1. `block hash: (string)` block hash -2. `verbose: (bool, default: false)` whether or not show mining info - -#### Returns -##### `(array of string, verbose=true)` - 1. `(hex string)` block height - 2. `(hex string)` nonce - 3. `(hex string)` custom data 1, filled by miner, ASCII string - 4. `(hex string)` custom data 2 - 5. ... - -##### `(array of string, verbose=false)` total number - 1. `(hex string)` custom data 1, filled by miner, ASCII string - 2. `(hex string)` custom data 2 - 3. ... - -#### Example - -##### Request -```bash -curl --data '{"method":"getCoinbase","params":[],"jsonrpc":"2.0","id":1}' -s -k -u "rpcuser:rpcpass" -H 'Content-Type: application/json' http://127.0.0.1:18131 |jq . -``` - -##### Response -```js -[ - "01", - "52fdfc072182654d", - "3035353737303036373931393437373739343130", # "05577006791947779410" - "65316438316561652d313263662d343932302d623735312d323833383336616333306265" # "e1d81eae-12cf-4920-b751-283836ac30be" -] -``` - -*** - -### getMainChainHeight -Return the current height of DAG main chain - -#### Parameters -None - -#### Returns -##### `(array of string, verbose=true)` - 1. `(hex string)` block height - 2. `(hex string)` nonce - 3. `(hex string)` custom data 1, filled by miner, ASCII string - 4. `(hex string)` custom data 2 - 5. ... - -##### `(array of string, verbose=false)` total number - 1. `(hex string)` custom data 1, filled by miner, ASCII string - 2. `(hex string)` custom data 2 - 3. ... - -#### Example - -##### Request -```bash -curl --data '{"method":"getMainChainHeight","params":[],"jsonrpc":"2.0","id":1}' -s -k -u "rpcuser:rpcpass" -H 'Content-Type: application/json' http://127.0.0.1:18131 |jq . -``` - -##### Response -```js -32522 -``` - -*** - -### GetOrphansTotal -Return the total of orphans. Orphans are blocks with parents missing. - -#### Parameters -None - -#### Returns -##### `(numeric)` number of orphans - -#### Example - -##### Request -```bash -curl --data '{"method":"getOrphansTotal","params":[],"jsonrpc":"2.0","id":1}' -s -k -u "rpcuser:rpcpass" -H 'Content-Type: application/json' http://127.0.0.1:18131 |jq . -``` - -##### Response -```js -0 -``` - -*** - -### isBlue -Return the color of give block. Once block confirmed by main block, it is colored in line with consensus algorithm - -#### Parameters -1. `hash (string)` block hash - -#### Returns -##### `block color: (numeric)` - - *Options* - - `0 ` red: malfunctioning block, no block reward - - `1 ` blue: honest block, reward granted - - `2 ` cannot confirm: wait for confirmation by main block - -#### Example - -##### Request -```bash -curl --data '{"method":"GetOrphansTotal","params":[],"jsonrpc":"2.0","id":1}' -s -k -u "rpcuser:rpcpass" -H 'Content-Type: application/json' http://127.0.0.1:18131 |jq . -``` - -##### Response -```js -0 -``` - -*** - -### isCurrent -Returns if we are synced with our peers - -#### Parameters -None - -#### Returns -##### `(bool)` whether or not synced - -#### Example - -##### Request -```bash -curl --data '{"method":"isCurrent","params":[],"jsonrpc":"2.0","id":1}' -s -k -u "rpcuser:rpcpass" -H 'Content-Type: application/json' http://127.0.0.1:18131 |jq . -``` - -##### Response -```js -true -``` - -*** -### isOnMainChain -Query whether or not a given block is on the main chain. - -#### Parameters -1. `hash (string)` block hash - -#### Returns -##### `(bool)` whether or not on the main chain - -#### Example - -##### Request -```bash -curl --data '{"method":"isOnMainChain","params":["11dbd3e6202f41eba102277bdb65adff82899219a870295ed8424b7c035af0f3"],"jsonrpc":"2.0","id":1}' -s -k -u "rpcuser:rpcpass" -H 'Content-Type: application/json' http://127.0.0.1:18131 |jq . -``` - -##### Response -```js -true -``` - -*** -### tips -None - -#### Parameters - -#### Returns -##### `(array of string)` list of tip hashes - -#### Example - -##### Request -```bash - curl --data '{"method":"tips","params":[],"jsonrpc":"2.0","id":1}' -s -k -u "rpcuser:rpcpass" -H 'Content-Type: application/json' http://127.0.0.1:18131 |jq . -``` - -##### Response -```js -[ - "00001a78e4405cf0b1eeebf4c707bbbeea3fbad53dd60718092b08c6fb1cb95f" -] -``` \ No newline at end of file diff --git a/Document/content/JSON RPC API/createRawTransaction/_index.en.md b/Document/content/JSON RPC API/createRawTransaction/_index.en.md new file mode 100644 index 00000000..f7adf9f3 --- /dev/null +++ b/Document/content/JSON RPC API/createRawTransaction/_index.en.md @@ -0,0 +1,31 @@ +--- +title: createRawTransaction +weight: 3 +--- + +### createRawTransaction +Returns a new transaction spending the provided inputs and sending to the provided addresses.The transaction inputs are not signed in the created transaction. + +#### Parameters +1. `inputs: (array of object)` transaction inputs. + - `txid: (string)` The transaction id + - `vout: (numeric)` The output number +2. `amounts: (object)` addresses as keys and output amounts as values. +3. `lockTime: (numeric, optional, default=0)` Raw locktime. Non-0 value also locktime-activates inputs + +#### Returns +##### `(string)` hex-encoded bytes of the serialized transaction + +#### Example + +##### Request +```bash +curl --data '{"method":"createRawTransaction","params":[[{"Txid":"ddf99e004ed24d641ddc942272ed174b1c2ae0fb27cc0ed7e858e0a451e27633", "Vout":0}], {"RmG6xQsV7gnS4JZmoq5FgmyEbmUQRenrTCo":10000000000}],"jsonrpc":"2.0","id":1}' -s -k -u "test:test" -H 'Content-Type: application/json' http://127.0.0.1:1234 |jq . +``` + +##### Response +```js +"01000000013376e251a4e058e8d70ecc27fbe02a1c4b17ed722294dc1d644dd24e009ef9dd00000000ffffffff0100e40b54020000001976a9146bd68046854813036fa042958e7f5ca29606e8d088ac00000000000000000100" +``` + + diff --git a/Document/content/JSON RPC API/transaction/_index.en.md b/Document/content/JSON RPC API/decodeRawTransaction/_index.en.md similarity index 57% rename from Document/content/JSON RPC API/transaction/_index.en.md rename to Document/content/JSON RPC API/decodeRawTransaction/_index.en.md index f6f3d592..8e83619e 100644 --- a/Document/content/JSON RPC API/transaction/_index.en.md +++ b/Document/content/JSON RPC API/decodeRawTransaction/_index.en.md @@ -1,45 +1,9 @@ --- -title: The `Transaction` Module +title: decodeRawTransaction +weight: 3 --- -## JSON-RPC methods - -- [CreateRawTransaction](#CreateRawTransaction) -- [DecodeRawTransaction](#DecodeRawTransaction) -- [GetRawTransactionByHash](#GetRawTransactionByHash) -- [GetUtxo](#GetUtxo) -- [SendRawTransaction](#SendRawTransaction) - -## JSON-RPC API Reference - -### CreateRawTransaction -Returns a new transaction spending the provided inputs and sending to the provided addresses.The transaction inputs are not signed in the created transaction. - -#### Parameters -1. `inputs: (array of object)` transaction inputs. - - `txid: (string)` The transaction id - - `vout: (numeric)` The output number -2. `amounts: (object)` addresses as keys and output amounts as values. -3. `lockTime: (numeric, optional, default=0)` Raw locktime. Non-0 value also locktime-activates inputs - -#### Returns -##### `(string)` hex-encoded bytes of the serialized transaction - -#### Example - -##### Request -```bash -curl --data '{"method":"createRawTransaction","params":[[{"Txid":"ddf99e004ed24d641ddc942272ed174b1c2ae0fb27cc0ed7e858e0a451e27633", "Vout":0}], {"RmG6xQsV7gnS4JZmoq5FgmyEbmUQRenrTCo":10000000000}],"jsonrpc":"2.0","id":1}' -s -k -u "test:test" -H 'Content-Type: application/json' http://127.0.0.1:1234 |jq . -``` - -##### Response -```js -"01000000013376e251a4e058e8d70ecc27fbe02a1c4b17ed722294dc1d644dd24e009ef9dd00000000ffffffff0100e40b54020000001976a9146bd68046854813036fa042958e7f5ca29606e8d088ac00000000000000000100" -``` - -*** - -### DecodeRawTransaction +### decodeRawTransaction Returns a JSON object representing the provided serialized, hex-encoded transaction. #### Parameters @@ -99,4 +63,4 @@ curl --data '{"method":"decodeRawTransaction","params":["01000000013376e251a4e05 } ] } -``` \ No newline at end of file +``` diff --git a/Document/content/JSON RPC API/getBlockBestHash/_index.cn.md b/Document/content/JSON RPC API/getBestBlockHash/_index.cn.md similarity index 83% rename from Document/content/JSON RPC API/getBlockBestHash/_index.cn.md rename to Document/content/JSON RPC API/getBestBlockHash/_index.cn.md index db215f5a..ff78d27b 100644 --- a/Document/content/JSON RPC API/getBlockBestHash/_index.cn.md +++ b/Document/content/JSON RPC API/getBestBlockHash/_index.cn.md @@ -1,10 +1,10 @@ --- -title: getBlockBestHash +title: getBestBlockHash weight: 1 --- -## getBlockBestHash -### 函数名:getBlockBestHash +## getBestBlocktHash +### 函数名:getBestBlockHash ### 说明:无参数,获取当前最大区块Order的区块hash ### 实例 diff --git a/Document/content/JSON RPC API/getBestBlockHash/_index.en.md b/Document/content/JSON RPC API/getBestBlockHash/_index.en.md new file mode 100644 index 00000000..5b5102f3 --- /dev/null +++ b/Document/content/JSON RPC API/getBestBlockHash/_index.en.md @@ -0,0 +1,27 @@ +--- +title: getBestBlockHash +weight: 1 +--- + +### getBestBlockHash +Returns the hash of the of the best (most recent) block in the longest block chain. + +#### Parameters +None +#### Returns +##### `(string)` - best block hash + +#### Example + +##### Request +```bash +curl --data '{"method":"getBestBlockHash","params":[],"jsonrpc":"2.0","id":1}' -s -k -u "rpcuser:rpcpass" -H 'Content-Type: application/json' http://127.0.0.1:18131 +``` + +##### Response +```js +"000005c905e232a3320c35e38ec2a7f8f9d03e3cc28faef007cc46f273835f4b" +``` + + + diff --git a/Document/content/JSON RPC API/getBlock/_index.en.md b/Document/content/JSON RPC API/getBlock/_index.en.md new file mode 100644 index 00000000..d3058b1d --- /dev/null +++ b/Document/content/JSON RPC API/getBlock/_index.en.md @@ -0,0 +1,130 @@ +--- +title: getBlock +weight: 1 +--- + +### getBlock +Returns information about a block given its hash. + +#### Parameters + +1. `hash: (string)` the hash of the block. +2. `verbose: (boolean, optional, default=false)` specifies the block is returned as a JSON object instead of hex-encoded string. +3. `inclTx: (boolean, optional, default=true)` whether or not include transactions. +4. `fullTx: (boolean, optional, default=true)` specifies that each transaction is returned as a JSON object . + +#### Returns +##### `(object,inclTx=false)` not show + - `hash, confirmations, version, parentsroot, difficulty, pow` + - reference [getBlockHeader](#getBlockHeader) + + + - `weight: (numeric)` the weight of the block. + - `height: (numeric)` the height of the block in the block DAG. + - `order: (numeric)` the global order of the block. + - `bits: (numeric)` the bits which represent the block difficulty. + - `timestamp: (string)` block created time (ISO 8601 format). + - `parents: (string)` blocks that are referenced from this block + - `children: (string)` blocks that reference to this block + +##### `(object, inclTx=true, fullTx=false)` show hash list of transactions + - all fields with inclTx=false + - `transactions: (array of string)` transaction hashes +##### `(object, inclTx=true, fullTx=true)` transaction details + - all fields with inclTx=false + - `transactions: (array of object)` transaction object + - `hex: (string)` hex-encoded transaction / hex-encoded bytes of the script. + - `txid: (string)` the hash of the transaction WITHOUT signature. + - `txhash: (string)` the hash of the transaction WITH signature. + - `size: (numeric)` transaction size. + - `version: (enum)` transaction version. + - `1` coinbase transaction + - `2` ordinary transaction + - `locktime: (numeric)` the transaction lock time, cannot be spent before lock time. + - `expire: (numeric)` expired block height, tx cannot be spent after it. + - `vin: (array of json objects)` the transaction inputs as json objects. + - `coinbase: (string)` the hex-encoded bytes of the signature script. + - `sequence: (numeric)` the script sequence number. + - `vout: (array of json objects)` the transaction outputs as json objects. + - `amount: (numeric)` the value in QIT. + - `scriptPubKey: (json object)` the public key script used to pay coins. + - `asm: (string)` disassembly of the script. + - `hex: (string)` hex-encoded bytes of the script. + - `reqSigs: (numeric)` the number of required signatures. + - `type: (string)` the type of the script (e.g. 'pubkeyhash'). + - `addresses: (json array of string)` the addresses associated with this output. + +#### Example + +##### Request +```bash + curl --data '{"method":"getBlock","params":["11dbd3e6202f41eba102277bdb65adff82899219a870295ed8424b7c035af0f3", true, true, false],"jsonrpc":"2.0","id":1}' -s -k -u "rpcuser:rpcpass" -H 'Content-Type: application/json' http://127.0.0.1:18131 |jq . +``` +##### Response +```js +{ + "hash": "11dbd3e6202f41eba102277bdb65adff82899219a870295ed8424b7c035af0f3", + "txsvalid": true, + "confirmations": 31785, + "version": 11, + "weight": 474, + "height": 1, + "txRoot": "7b73360b8099c1c4e91ab63ee71210202a802592491a90f0fd5c1275a5556d3d", + "order": 1, + "transactions": [ + { + "hex": "010000000152868a9025d93bfa3948f8396c4779f735dcae7940d9e648555349c854c85cf8ffffffffffffffff01007841cb020000001976a9143be2e1e7eaffe6ee4c90d5db043576df7f2e174b88ac00000000000000000144510852fdfc072182654d1430353537373030363739313934373737393431302465316438316561652d313263662d343932302d623735312d323833383336616333306265", + "txid": "7b73360b8099c1c4e91ab63ee71210202a802592491a90f0fd5c1275a5556d3d", + "txhash": "e67a6d03533120d6fb280620caadcf3a47dee028d8ede9dbb6eef91b06bb336d", + "size": 158, + "version": 1, + "locktime": 0, + "expire": 0, + "vin": [ + { + "coinbase": "510852fdfc072182654d1430353537373030363739313934373737393431302465316438316561652d313263662d343932302d623735312d323833383336616333306265", + "sequence": 4294967295 + } + ], + "vout": [ + { + "amount": 12000000000, + "scriptPubKey": { + "asm": "OP_DUP OP_HASH160 3be2e1e7eaffe6ee4c90d5db043576df7f2e174b OP_EQUALVERIFY OP_CHECKSIG", + "hex": "76a9143be2e1e7eaffe6ee4c90d5db043576df7f2e174b88ac", + "reqSigs": 1, + "type": "pubkeyhash", + "addresses": [ + "TmUQjNKPA3dLBB6ZfcKd4YSDThQ9Cqzmk5S" + ] + } + } + ], + "blockhash": "11dbd3e6202f41eba102277bdb65adff82899219a870295ed8424b7c035af0f3", + "confirmations": 31785 + } + ], + "stateRoot": "0000000000000000000000000000000000000000000000000000000000000000", + "bits": "2018000", + "difficulty": 33652736, + "pow": { + "pow_name": "cuckaroo", + "pow_type": 1, + "nonce": 526, + "proof_data": { + "edge_bits": 24, + "circle_nonces": "7a8e09004e040a00f6850e00582a1200d96613006fc91a000ca11c00f78124001b613600c266370037ef430073915000bbf85500b0795600691e5d00c7b35f0048bc670048897c00c50a7d006f22820038029100f4819a005864a6000aa9a600b5f0aa008169b200d1b4bb004cbfc100a32ac3001d6ac70045a1c900a95ecc002e55d70077ffd800a451d9007b38db00ab79e100dc14e600c5b6e9000efff0006821fa007650fb00" + } + }, + "timestamp": "2019-12-30T15:55:42+08:00", + "parentroot": "caf26cf7705c0917bfb157150ab29f196465daf83c8ac1c82553aa9f207bd584", + "parents": [ + "caf26cf7705c0917bfb157150ab29f196465daf83c8ac1c82553aa9f207bd584" + ], + "children": [ + "0ea57734fc4baeb7fb8669a7e52b948fb94277a3f0a08caaf25592c7fef7c965" + ] +} +``` + + diff --git a/Document/content/JSON RPC API/getBlockByNum/_index.en.md b/Document/content/JSON RPC API/getBlockByNum/_index.en.md new file mode 100644 index 00000000..1a7f5e40 --- /dev/null +++ b/Document/content/JSON RPC API/getBlockByNum/_index.en.md @@ -0,0 +1,32 @@ +--- +title: getBlockByNum +weight: 1 +--- + +### getBlockByNum +Returns information about a block given its local resource number. + +#### Parameters + +1. `block Number: (numeric, required)` the local resource number of the block, resource number doesn't reach consensus on the network, it is generated by each node when accepting a new block. +2. `verbose: (boolean, optional, default=false)` reference [getBlock](#getBlock). +3. `inclTx: (boolean, optional, default=true)` reference [getBlock](#getBlock). +4. `fullTx: (boolean, optional, default=true)` reference [getBlock](#getBlock). + +#### Returns +reference [getBlock](../getblock) + +#### Example + +##### Request +```bash + curl --data '{"method":"getBlockByNum","params":[2, true, true, false],"jsonrpc":"2.0","id":1}' -s -k -u "rpcuser:rpcpass" -H 'Content-Type: application/json' http://127.0.0.1:18131 |jq . +``` + +##### Response + +reference [getBlock](../getblock) + + + + diff --git a/Document/content/JSON RPC API/getBlockByOrder/_index.en.md b/Document/content/JSON RPC API/getBlockByOrder/_index.en.md new file mode 100644 index 00000000..d3d8a5d7 --- /dev/null +++ b/Document/content/JSON RPC API/getBlockByOrder/_index.en.md @@ -0,0 +1,29 @@ +--- +title: getBlockByOrder +weight: 1 +--- + +### getBlockByOrder +Returns information about a block given its global order. + +#### Parameters + +1. `block ID: (numeric, required)` the local resource ID of the block, resource ID doesn't reach consensus on the network, it is generated by each node when accepting a new block. +2. `verbose: (boolean, optional, default=false)` reference [getBlock](#getBlock). +3. `inclTx: (boolean, optional, default=true)` reference [getBlock](#getBlock). +4. `fullTx: (boolean, optional, default=true)` reference [getBlock](#getBlock). + +#### Returns +reference [getBlock](../getblock) + +#### Example + +##### Request +```bash + curl --data '{"method":"getBlockByID","params":[2, true, true, false],"jsonrpc":"2.0","id":1}' -s -k -u "rpcuser:rpcpass" -H 'Content-Type: application/json' http://127.0.0.1:18131 |jq . +``` + +##### Response + +reference [getBlock](../getblock) + diff --git a/Document/content/JSON RPC API/getBlockCount/_index.en.md b/Document/content/JSON RPC API/getBlockCount/_index.en.md new file mode 100644 index 00000000..f9c0242f --- /dev/null +++ b/Document/content/JSON RPC API/getBlockCount/_index.en.md @@ -0,0 +1,24 @@ +--- +title: getBlockCount +weight: 1 +--- + +### getBlockCount +Returns the number of stable blocks . + +#### Parameters +None + +#### Returns +- `(numeric)` number of blocks, the network should have reached consensus on this number + +#### Example + +##### Request +```bash + curl --data '{"method":"getBlockCount","params":[],"jsonrpc":"2.0","id":1}' -s -k -u "rpcuser:rpcpass" -H 'Content-Type: application/json' http://127.0.0.1:18131 |jq . +``` + +##### Response +34787 + diff --git a/Document/content/JSON RPC API/getBlockHeader/_index.en.md b/Document/content/JSON RPC API/getBlockHeader/_index.en.md new file mode 100644 index 00000000..21ad2acf --- /dev/null +++ b/Document/content/JSON RPC API/getBlockHeader/_index.en.md @@ -0,0 +1,76 @@ +--- +title: getBlockHeader +weight: 1 +--- + +### GetBlockHeader +Returns hex-encoded bytes of the serialized block header. + +#### Parameters +1. `block hash: (string)` the hash of the block. +2. `verbose: (boolean)` specifies the block header is returned as a JSON object instead of a hex-encoded string. + +#### Returns +##### `(object)` deserialized block data +- hash: (string) the hash of the block (same as provided). +- confirmations: (numeric) the number of confirmations. +- version: (numeric) the block version. +- parentsroot: (string) The merkle root of the previous parent blocks (the dag layer) +- txRoot: (string) the root of the transaction trie of the block. +- stateRoot: (string) the root of the final state trie of the block. +- difficulty: (numeric) the proof-of-work difficulty as a multiple of the minimum difficulty. +- pow: (object) mining info + - pow_name: (string) mining algorithm name. + - *Options* + - blak2bd: double blak2b, CPU based + - cuckroo: ASIC proof, GPU based + - cucktoo: ASIC friendly, GPU based + - pow_type: (numeric) mining algorithm type. + - *Options* + - 0: blake2bd + - 1: cuckroo + - 2: cucktoo + - nonce: (numeric) - the block nonce. + - proof_data: (object) - cuckroo algorithm proof + - "edge_bits": (numeric) - number of edge bit, the bigger the harder + - "circle_nonces": (string) - circle nonces, raw proof data +- hash: (string) the hash of the block (same as provided). +- confirmations: (numeric) the number of confirmations. +- version: (numeric) the block version. + +- layer: (string) length of the longest path from genesis to this block +- time: (string) the block time in seconds since 1 Jan 1970 GMT. + +##### `(string)` hex-encoded bytes of the serialized block + +#### Example + +##### Request +```bash +curl --data '{"method":"getBlockHeader","params":["11dbd3e6202f41eba102277bdb65adff82899219a870295ed8424b7c035af0f3", true],"jsonrpc":"2.0","id":1}' -s -k -u "rpcuser:rpcpass" -H 'Content-Type: application/json' http://127.0.0.1:18131 |jq . +``` + +##### Response +```js +{ + "hash": "11dbd3e6202f41eba102277bdb65adff82899219a870295ed8424b7c035af0f3", + "confirmations": 32263, + "version": 11, + "parentroot": "caf26cf7705c0917bfb157150ab29f196465daf83c8ac1c82553aa9f207bd584", + "txRoot": "7b73360b8099c1c4e91ab63ee71210202a802592491a90f0fd5c1275a5556d3d", + "stateRoot": "0000000000000000000000000000000000000000000000000000000000000000", + "difficulty": 33652736, + "layer": 1, + "time": 1577692542, + "pow": { + "pow_name": "cuckaroo", + "pow_type": 1, + "nonce": 526, + "proof_data": { + "edge_bits": 24, + "circle_nonces": "7a8e09004e040a00f6850e00582a1200d96613006fc91a000ca11c00f78124001b613600c266370037ef430073915000bbf85500b0795600691e5d00c7b35f0048bc670048897c00c50a7d006f22820038029100f4819a005864a6000aa9a600b5f0aa008169b200d1b4bb004cbfc100a32ac3001d6ac70045a1c900a95ecc002e55d70077ffd800a451d9007b38db00ab79e100dc14e600c5b6e9000efff0006821fa007650fb00" + } + } +} +``` + diff --git a/Document/content/JSON RPC API/miner/_index.en.md b/Document/content/JSON RPC API/getBlockTemplate/_index.en.md similarity index 76% rename from Document/content/JSON RPC API/miner/_index.en.md rename to Document/content/JSON RPC API/getBlockTemplate/_index.en.md index 1e7a4f48..739a570c 100644 --- a/Document/content/JSON RPC API/miner/_index.en.md +++ b/Document/content/JSON RPC API/getBlockTemplate/_index.en.md @@ -1,14 +1,8 @@ --- -title: The `Miner` Module +title: getBlockTemplate +weight: 1 --- -## JSON-RPC methods - -- [getBlockTemplate](#getBlockTemplate) -- [submitBlock](#submitBlock) - -## JSON-RPC API Reference - ### GetBlockTemplate Gets a block template for use with mining software. @@ -115,25 +109,3 @@ curl --data '{"method":"getBestBlockHash","params":[],"jsonrpc":"2.0","id":1}' - ``` -*** - -### SubmitBlock -Attempts to submit new block to network. - -#### Parameters -1. `hexBlock: (string)` hex-encoded block data to submit. Refer to https://github.com/qitmeer/qitmeer-miner to investigate how to construct a block - -#### Returns -##### `(string)` submit message - -#### Example - -##### Request -```bash -curl --data '{"method":"submitBlock","params":["0b0000009b324c447c093502bd2928251c7a76bd66fac662f4535130c512a52ff27c9ac291db77e47c8b7fb1199192e813698abd42ceae44c6f6cd7bb3bfee442b105079000000000000000000000000000000000000000000000000000000000000000000000000d998195eba6acfb00118539c0100c3b203006b871000627a170066122400e7a933007cfb3b00ed393d00b9a63e00fcad4d0083c954004b6c5c007ac77300db1b7a0025f27c00540e7d0015018300a40084000bc28900d0f38f002b8592007e759300195a9900a2529b002356a1004b86a2008affb300f5a3ba001b05bb00dc52bf006528c1008fa1c20058a4c8000ca3cc002ff1cc00e4e8d10052cfd400e063dd00612fdf007a7ee5001d93ea00c093fc00019b324c447c093502bd2928251c7a76bd66fac662f4535130c512a52ff27c9ac2010100000001b3e2498b9592e6871e1a02a23a32988495b0c3da449f1cb3f1389013d044713bffffffffffffffff01007841cb020000001976a914a6b8fe2348fad076b7fd1b34b7e5b35db96dc2a088ac000000000000000001455a08ec92282d01baa3be153131333933333038383330373933383831353235322435633739303233612d653130642d343631622d613438662d356563343961316233353330"],"jsonrpc":"2.0","id":1}' -s -k -u "test:test" -H 'Content-Type: application/json' http://127.0.0.1:38131 |jq . -``` - -##### Response -```js -"Block submitted accepted hash fcd2fe6a284e46d4fb7893e84bbcc58ca96e020be1e57b5c1b2c45929cca8dee, height 10, order 10 amount 12000000000" -``` \ No newline at end of file diff --git a/Document/content/JSON RPC API/getBlockTotal/_index.en.md b/Document/content/JSON RPC API/getBlockTotal/_index.en.md new file mode 100644 index 00000000..e23714fa --- /dev/null +++ b/Document/content/JSON RPC API/getBlockTotal/_index.en.md @@ -0,0 +1,26 @@ +--- +title: getBlockTotal +weight: 1 +--- + +### GetBlockTotal +Return the total number blocks that this dag currently owned + +#### Parameters +None + +#### Returns +##### `(numeric)` total number + +#### Example + +##### Request +```bash +curl --data '{"method":"getBlockTotal","params":[],"jsonrpc":"2.0","id":1}' -s -k -u "rpcuser:rpcpass" -H 'Content-Type: application/json' http://127.0.0.1:18131 |jq . +``` + +##### Response +```js +34970 +``` + diff --git a/Document/content/JSON RPC API/getBlockWeight/_index.en.md b/Document/content/JSON RPC API/getBlockWeight/_index.en.md new file mode 100644 index 00000000..3fb7a2c8 --- /dev/null +++ b/Document/content/JSON RPC API/getBlockWeight/_index.en.md @@ -0,0 +1,4 @@ +--- +title: getBlockWeight +weight: 1 +--- diff --git a/Document/content/JSON RPC API/getBlockhash/_index.en.md b/Document/content/JSON RPC API/getBlockhash/_index.en.md new file mode 100644 index 00000000..5230b447 --- /dev/null +++ b/Document/content/JSON RPC API/getBlockhash/_index.en.md @@ -0,0 +1,20 @@ +--- +title: getBlockhash +weight: 1 +--- + +### getBlockhash +Returns hash of the block at the given order. + +#### Parameters +1. block order (numeric, required) + +#### Returns +- `(string)` block hash + +#### Example + +##### Request +```bash + curl --data '{"method":"getBlockhash","params":[2],"jsonrpc":"2.0","id":1}' -s -k -u "rpcuser:rpcpass" -H 'Content-Type: application/json' http://127.0.0.1:18131 |jq . +``` diff --git a/Document/content/JSON RPC API/getBlockhashByRange/_index.en.md b/Document/content/JSON RPC API/getBlockhashByRange/_index.en.md new file mode 100644 index 00000000..d2455e8e --- /dev/null +++ b/Document/content/JSON RPC API/getBlockhashByRange/_index.en.md @@ -0,0 +1,36 @@ +--- +title: getBlockhashByRange +weight: 1 +--- + +### getBlockhashByRange +Returns hash of the block at the given order. + +#### Parameters +1. start order (numeric, required) +1. end order (numeric, required) + +#### Returns +- `(array of string)` list of block hashes + +#### Example + +##### Request +```bash + curl --data '{"method":"getBlockhashByRange","params":[1, 9],"jsonrpc":"2.0","id":1}' -s -k -u "rpcuser:rpcpass" -H 'Content-Type: application/json' http://127.0.0.1:18131 |jq . +``` + +##### Response +```js +[ + "11dbd3e6202f41eba102277bdb65adff82899219a870295ed8424b7c035af0f3", + "0ea57734fc4baeb7fb8669a7e52b948fb94277a3f0a08caaf25592c7fef7c965", + "03879bf60c08cca7885790661e0e96147fc0012428d6b326eb5ffb2eb0f3b073", + "18917e39ec36a68843024b9212934a3a8b23d3f5629987d0565fb74c7683f13b", + "0385e16851b36983a1110e8cbf9885005e76a38be0983a2520e72c06da98f590", + "030fcf757bef879016095dd6ef40503418758632d4817ef5a20fd7ab87c427c7", + "1f876a43c630c3f0e065668ff12b88a0403bd8f9aa790b39f6982428c7c46272", + "1cdcbe73bfc539086296df62a92cd027b89d01d370826b2ac763fc3997dc7e8a" +] +``` + diff --git a/Document/content/JSON RPC API/getCoinbase/_index.en.md b/Document/content/JSON RPC API/getCoinbase/_index.en.md new file mode 100644 index 00000000..47e9cd3b --- /dev/null +++ b/Document/content/JSON RPC API/getCoinbase/_index.en.md @@ -0,0 +1,42 @@ +--- +title: getCoinbase +weight: 1 +--- + +### GetCoinbase +Return the coin base data of given block + +#### Parameters +1. `block hash: (string)` block hash +2. `verbose: (bool, default: false)` whether or not show mining info + +#### Returns +##### `(array of string, verbose=true)` + 1. `(hex string)` block height + 2. `(hex string)` nonce + 3. `(hex string)` custom data 1, filled by miner, ASCII string + 4. `(hex string)` custom data 2 + 5. ... + +##### `(array of string, verbose=false)` total number + 1. `(hex string)` custom data 1, filled by miner, ASCII string + 2. `(hex string)` custom data 2 + 3. ... + +#### Example + +##### Request +```bash +curl --data '{"method":"getCoinbase","params":[],"jsonrpc":"2.0","id":1}' -s -k -u "rpcuser:rpcpass" -H 'Content-Type: application/json' http://127.0.0.1:18131 |jq . +``` + +##### Response +```js +[ + "01", + "52fdfc072182654d", + "3035353737303036373931393437373739343130", # "05577006791947779410" + "65316438316561652d313263662d343932302d623735312d323833383336616333306265" # "e1d81eae-12cf-4920-b751-283836ac30be" +] +``` + diff --git a/Document/content/JSON RPC API/getMainChainHeight/_index.en.md b/Document/content/JSON RPC API/getMainChainHeight/_index.en.md new file mode 100644 index 00000000..5561e895 --- /dev/null +++ b/Document/content/JSON RPC API/getMainChainHeight/_index.en.md @@ -0,0 +1,36 @@ +--- +title: getMainChainHeight +weight: 1 +--- + +### getMainChainHeight +Return the current height of DAG main chain + +#### Parameters +None + +#### Returns +##### `(array of string, verbose=true)` + 1. `(hex string)` block height + 2. `(hex string)` nonce + 3. `(hex string)` custom data 1, filled by miner, ASCII string + 4. `(hex string)` custom data 2 + 5. ... + +##### `(array of string, verbose=false)` total number + 1. `(hex string)` custom data 1, filled by miner, ASCII string + 2. `(hex string)` custom data 2 + 3. ... + +#### Example + +##### Request +```bash +curl --data '{"method":"getMainChainHeight","params":[],"jsonrpc":"2.0","id":1}' -s -k -u "rpcuser:rpcpass" -H 'Content-Type: application/json' http://127.0.0.1:18131 |jq . +``` + +##### Response +```js +32522 +``` + diff --git a/Document/content/JSON RPC API/getNodeInfo/_index.en.md b/Document/content/JSON RPC API/getNodeInfo/_index.en.md new file mode 100644 index 00000000..e0b19a32 --- /dev/null +++ b/Document/content/JSON RPC API/getNodeInfo/_index.en.md @@ -0,0 +1,82 @@ +--- +title: getNodeInfo +weight: 1 +--- + +### getNodeInfo +Return info of requested node + +#### Parameters + +None + +#### Returns + +- `result: object` + - `UUID: (string)` - unique ID + - `version: (numeric)` - The version of the node as a numeric. + - `buildversion: (string)` - build version + - `protocolversion: (numeric)` - The protocol version of the node. + - `totalsubsidy: (numeric)` - total subsidy to be mined + - `graphstate: (object)` - graph state of DAG + - `tips: (array)` - array of tips, no referenced blocks + - `mainorder: (string)` - order of main chain + - `mainheight: (numeric)` - height of main chain + - `layer: (numeric)` - max height of all blocks + - `timeoffset: (numeric)` - The node clock offset in seconds + - `connections: (numeric)` - number of connections + - `pow_diff: (object)` - difficulty of POW + - `blake2bd_diff: (numeric)` - difficulty of Blake2B, pure CPU mining + - `cuckaroo_diff: (numeric)` - difficulty of cuckaroo, anti-ASIC GPU mining + - `cuckatoo_diff: (numeric)` - difficulty of cuckatoo, ASIC friendly GPU mining + - `testnet: (boolean)` - launch test net + - `mixnet: (boolean)` - launch mix net + - `confirmations: (numeric)` - number of blocks to wait for safe confirmation + - `coinbasematurity: (numeric)` - number of blocks to wait for coinbase to be spent + - `error: (string)` - error message if happened + - `modules: (array)` - loaded modules; qitmeer, miner, test by default + +#### Example + +Request +```bash +curl --data '{"method":"getNodeInfo","params":[],"jsonrpc":"2.0","id":1}' -s -k -u "rpcuser:rpcpass" -H 'Content-Type: application/json' http://127.0.0.1:18131 | jq +``` + +Response +```js +{ + "UUID": "2e3dddbe-2646-4964-b4ad-5a9b9fd83010", + "version": 80500, + "buildversion": "0.8.5+dev-30736c5", + "protocolversion": 19, + "totalsubsidy": 343068000000000, + "graphstate": { + "tips": [ + "00004d5e83f46cf14de8e4a8c76cf6831d1a294654076eabda19bf939a1e5786 main" + ], + "mainorder": 28656, + "mainheight": 26284, + "layer": 26285 + }, + "timeoffset": 0, + "connections": 8, + "pow_diff": { + "blake2bd_diff": 1, + "cuckaroo_diff": 23554, + "cuckatoo_diff": 1 + }, + "testnet": true, + "mixnet": false, + "confirmations": 10, + "coinbasematurity": 720, + "errors": "", + "modules": [ + "qitmeer", + "miner", + "test" + ] + } + +``` + diff --git a/Document/content/JSON RPC API/getOrphansTotal/_index.en.md b/Document/content/JSON RPC API/getOrphansTotal/_index.en.md new file mode 100644 index 00000000..e2e1ff96 --- /dev/null +++ b/Document/content/JSON RPC API/getOrphansTotal/_index.en.md @@ -0,0 +1,26 @@ +--- +title: getOrphansTotal +weight: 1 +--- + +### GetOrphansTotal +Return the total of orphans. Orphans are blocks with parents missing. + +#### Parameters +None + +#### Returns +##### `(numeric)` number of orphans + +#### Example + +##### Request +```bash +curl --data '{"method":"getOrphansTotal","params":[],"jsonrpc":"2.0","id":1}' -s -k -u "rpcuser:rpcpass" -H 'Content-Type: application/json' http://127.0.0.1:18131 |jq . +``` + +##### Response +```js +0 +``` + diff --git a/Document/content/JSON RPC API/chain/_index.en.md b/Document/content/JSON RPC API/getPeerInfo/_index.en.md similarity index 51% rename from Document/content/JSON RPC API/chain/_index.en.md rename to Document/content/JSON RPC API/getPeerInfo/_index.en.md index 1110b3b7..c5dc53d7 100644 --- a/Document/content/JSON RPC API/chain/_index.en.md +++ b/Document/content/JSON RPC API/getPeerInfo/_index.en.md @@ -1,93 +1,8 @@ --- -title: The `blockchain` Module +title: getPeerInfo +weight: 1 --- -## JSON-RPC methods - -- [getNodeInfo](#getNodeInfo) -- [getPeerInfo](#getPeerInfo) - -## JSON-RPC API Reference - -### getNodeInfo -Return info of requested node - -#### Parameters - -None - -#### Returns - -- `result: object` - - `UUID: (string)` - unique ID - - `version: (numeric)` - The version of the node as a numeric. - - `buildversion: (string)` - build version - - `protocolversion: (numeric)` - The protocol version of the node. - - `totalsubsidy: (numeric)` - total subsidy to be mined - - `graphstate: (object)` - graph state of DAG - - `tips: (array)` - array of tips, no referenced blocks - - `mainorder: (string)` - order of main chain - - `mainheight: (numeric)` - height of main chain - - `layer: (numeric)` - max height of all blocks - - `timeoffset: (numeric)` - The node clock offset in seconds - - `connections: (numeric)` - number of connections - - `pow_diff: (object)` - difficulty of POW - - `blake2bd_diff: (numeric)` - difficulty of Blake2B, pure CPU mining - - `cuckaroo_diff: (numeric)` - difficulty of cuckaroo, anti-ASIC GPU mining - - `cuckatoo_diff: (numeric)` - difficulty of cuckatoo, ASIC friendly GPU mining - - `testnet: (boolean)` - launch test net - - `mixnet: (boolean)` - launch mix net - - `confirmations: (numeric)` - number of blocks to wait for safe confirmation - - `coinbasematurity: (numeric)` - number of blocks to wait for coinbase to be spent - - `error: (string)` - error message if happened - - `modules: (array)` - loaded modules; qitmeer, miner, test by default - -#### Example - -Request -```bash -curl --data '{"method":"getNodeInfo","params":[],"jsonrpc":"2.0","id":1}' -s -k -u "rpcuser:rpcpass" -H 'Content-Type: application/json' http://127.0.0.1:18131 | jq -``` - -Response -```js -{ - "UUID": "2e3dddbe-2646-4964-b4ad-5a9b9fd83010", - "version": 80500, - "buildversion": "0.8.5+dev-30736c5", - "protocolversion": 19, - "totalsubsidy": 343068000000000, - "graphstate": { - "tips": [ - "00004d5e83f46cf14de8e4a8c76cf6831d1a294654076eabda19bf939a1e5786 main" - ], - "mainorder": 28656, - "mainheight": 26284, - "layer": 26285 - }, - "timeoffset": 0, - "connections": 8, - "pow_diff": { - "blake2bd_diff": 1, - "cuckaroo_diff": 23554, - "cuckatoo_diff": 1 - }, - "testnet": true, - "mixnet": false, - "confirmations": 10, - "coinbasematurity": 720, - "errors": "", - "modules": [ - "qitmeer", - "miner", - "test" - ] - } - -``` - -*** - ### getPeerInfo Returns data about each connected network peer as an array of json objects. diff --git a/Document/content/JSON RPC API/getRawTransaction/_index.cn.md b/Document/content/JSON RPC API/getRawTransaction/_index.cn.md index f4ba40d0..d1778362 100644 --- a/Document/content/JSON RPC API/getRawTransaction/_index.cn.md +++ b/Document/content/JSON RPC API/getRawTransaction/_index.cn.md @@ -1,6 +1,6 @@ --- title: getRawTransaction -weight: 1 +weight: 3 --- ## getRawTransaction diff --git a/Document/content/JSON RPC API/getRawTransactionByHash/_index.en.md b/Document/content/JSON RPC API/getRawTransactionByHash/_index.en.md new file mode 100644 index 00000000..a5bd5646 --- /dev/null +++ b/Document/content/JSON RPC API/getRawTransactionByHash/_index.en.md @@ -0,0 +1,4 @@ +--- +title: getRawTransactionByHash +weight: 3 +--- diff --git a/Document/content/JSON RPC API/getUtxo/_index.en.md b/Document/content/JSON RPC API/getUtxo/_index.en.md new file mode 100644 index 00000000..2fd22059 --- /dev/null +++ b/Document/content/JSON RPC API/getUtxo/_index.en.md @@ -0,0 +1,4 @@ +--- +title: getUtxo +weight: 1 +--- diff --git a/Document/content/JSON RPC API/isBlue/_index.en.md b/Document/content/JSON RPC API/isBlue/_index.en.md new file mode 100644 index 00000000..55b82564 --- /dev/null +++ b/Document/content/JSON RPC API/isBlue/_index.en.md @@ -0,0 +1,30 @@ +--- +title: isBlue +weight: 1 +--- + +### isBlue +Return the color of give block. Once block confirmed by main block, it is colored in line with consensus algorithm + +#### Parameters +1. `hash (string)` block hash + +#### Returns +##### `block color: (numeric)` + - *Options* + - `0 ` red: malfunctioning block, no block reward + - `1 ` blue: honest block, reward granted + - `2 ` cannot confirm: wait for confirmation by main block + +#### Example + +##### Request +```bash +curl --data '{"method":"GetOrphansTotal","params":[],"jsonrpc":"2.0","id":1}' -s -k -u "rpcuser:rpcpass" -H 'Content-Type: application/json' http://127.0.0.1:18131 |jq . +``` + +##### Response +```js +0 +``` + diff --git a/Document/content/JSON RPC API/isCurrent/_index.en.md b/Document/content/JSON RPC API/isCurrent/_index.en.md new file mode 100644 index 00000000..dfa204bb --- /dev/null +++ b/Document/content/JSON RPC API/isCurrent/_index.en.md @@ -0,0 +1,26 @@ +--- +title: isCurrent +weight: 1 +--- + +### isCurrent +Returns if we are synced with our peers + +#### Parameters +None + +#### Returns +##### `(bool)` whether or not synced + +#### Example + +##### Request +```bash +curl --data '{"method":"isCurrent","params":[],"jsonrpc":"2.0","id":1}' -s -k -u "rpcuser:rpcpass" -H 'Content-Type: application/json' http://127.0.0.1:18131 |jq . +``` + +##### Response +```js +true +``` + diff --git a/Document/content/JSON RPC API/isOnMainChain/_index.en.md b/Document/content/JSON RPC API/isOnMainChain/_index.en.md new file mode 100644 index 00000000..896307fb --- /dev/null +++ b/Document/content/JSON RPC API/isOnMainChain/_index.en.md @@ -0,0 +1,26 @@ +--- +title: isOnMainChain +weight: 1 +--- + +### isOnMainChain +Query whether or not a given block is on the main chain. + +#### Parameters +1. `hash (string)` block hash + +#### Returns +##### `(bool)` whether or not on the main chain + +#### Example + +##### Request +```bash +curl --data '{"method":"isOnMainChain","params":["11dbd3e6202f41eba102277bdb65adff82899219a870295ed8424b7c035af0f3"],"jsonrpc":"2.0","id":1}' -s -k -u "rpcuser:rpcpass" -H 'Content-Type: application/json' http://127.0.0.1:18131 |jq . +``` + +##### Response +```js +true +``` + diff --git a/Document/content/JSON RPC API/overview/_index.en.md b/Document/content/JSON RPC API/overview/_index.en.md deleted file mode 100644 index e69de29b..00000000 diff --git a/Document/content/JSON RPC API/sendRawTransaction/_index.cn.md b/Document/content/JSON RPC API/sendRawTransaction/_index.cn.md index 3f7b3544..f8b173ed 100644 --- a/Document/content/JSON RPC API/sendRawTransaction/_index.cn.md +++ b/Document/content/JSON RPC API/sendRawTransaction/_index.cn.md @@ -1,6 +1,6 @@ --- title: sendRawTransaction -weight: 1 +weight: 3 --- ## sendRawTransaction diff --git a/Document/content/JSON RPC API/sendRawTransaction/_index.en.md b/Document/content/JSON RPC API/sendRawTransaction/_index.en.md new file mode 100644 index 00000000..4b0fc344 --- /dev/null +++ b/Document/content/JSON RPC API/sendRawTransaction/_index.en.md @@ -0,0 +1,4 @@ +--- +title: sendRawTransaction +weight: 3 +--- diff --git a/Document/content/JSON RPC API/submitBlock/_index.en.md b/Document/content/JSON RPC API/submitBlock/_index.en.md new file mode 100644 index 00000000..4ef19145 --- /dev/null +++ b/Document/content/JSON RPC API/submitBlock/_index.en.md @@ -0,0 +1,25 @@ +--- +title: submitBlock +weight: 1 +--- + +### SubmitBlock +Attempts to submit new block to network. + +#### Parameters +1. `hexBlock: (string)` hex-encoded block data to submit. Refer to https://github.com/qitmeer/qitmeer-miner to investigate how to construct a block + +#### Returns +##### `(string)` submit message + +#### Example + +##### Request +```bash +curl --data '{"method":"submitBlock","params":["0b0000009b324c447c093502bd2928251c7a76bd66fac662f4535130c512a52ff27c9ac291db77e47c8b7fb1199192e813698abd42ceae44c6f6cd7bb3bfee442b105079000000000000000000000000000000000000000000000000000000000000000000000000d998195eba6acfb00118539c0100c3b203006b871000627a170066122400e7a933007cfb3b00ed393d00b9a63e00fcad4d0083c954004b6c5c007ac77300db1b7a0025f27c00540e7d0015018300a40084000bc28900d0f38f002b8592007e759300195a9900a2529b002356a1004b86a2008affb300f5a3ba001b05bb00dc52bf006528c1008fa1c20058a4c8000ca3cc002ff1cc00e4e8d10052cfd400e063dd00612fdf007a7ee5001d93ea00c093fc00019b324c447c093502bd2928251c7a76bd66fac662f4535130c512a52ff27c9ac2010100000001b3e2498b9592e6871e1a02a23a32988495b0c3da449f1cb3f1389013d044713bffffffffffffffff01007841cb020000001976a914a6b8fe2348fad076b7fd1b34b7e5b35db96dc2a088ac000000000000000001455a08ec92282d01baa3be153131333933333038383330373933383831353235322435633739303233612d653130642d343631622d613438662d356563343961316233353330"],"jsonrpc":"2.0","id":1}' -s -k -u "test:test" -H 'Content-Type: application/json' http://127.0.0.1:38131 |jq . +``` + +##### Response +```js +"Block submitted accepted hash fcd2fe6a284e46d4fb7893e84bbcc58ca96e020be1e57b5c1b2c45929cca8dee, height 10, order 10 amount 12000000000" +``` diff --git a/Document/content/JSON RPC API/tips/_index.en.md b/Document/content/JSON RPC API/tips/_index.en.md new file mode 100644 index 00000000..7368c5fd --- /dev/null +++ b/Document/content/JSON RPC API/tips/_index.en.md @@ -0,0 +1,26 @@ +--- +title: tips +weight: 1 +--- + +### tips +None + +#### Parameters + +#### Returns +##### `(array of string)` list of tip hashes + +#### Example + +##### Request +```bash + curl --data '{"method":"tips","params":[],"jsonrpc":"2.0","id":1}' -s -k -u "rpcuser:rpcpass" -H 'Content-Type: application/json' http://127.0.0.1:18131 |jq . +``` + +##### Response +```js +[ + "00001a78e4405cf0b1eeebf4c707bbbeea3fbad53dd60718092b08c6fb1cb95f" +] +``` diff --git a/Document/content/_index.cn.md b/Document/content/_index.cn.md index 4ad6c3a2..020bf51f 100644 --- a/Document/content/_index.cn.md +++ b/Document/content/_index.cn.md @@ -6,9 +6,11 @@ title: "Qitmeer 技术文档" ------------ -Qitmeer/Meer 文档,开发手册,指南以及教程 +Qitmeer 文档,开发手册,指南以及教程 #### 文档列表 - - [Qx Tools](./qxtools/) + - [Qitmeer JSON RPC 说明](./json-rpc-api) + - [命令行参考](./reference) + - [QX工具集](./reference/qxtools/) From 737ae2a585ad7b75721db9b7a1fd1e60aeab5bc2 Mon Sep 17 00:00:00 2001 From: Alex Wu Date: Thu, 2 Jul 2020 19:28:36 +0800 Subject: [PATCH 29/69] remove getblockweight doc, the method unused --- Document/content/JSON RPC API/_index.cn.md | 2 +- Document/content/JSON RPC API/_index.en.md | 3 +-- Document/content/JSON RPC API/getBlockWeight/_index.en.md | 4 ---- 3 files changed, 2 insertions(+), 7 deletions(-) delete mode 100644 Document/content/JSON RPC API/getBlockWeight/_index.en.md diff --git a/Document/content/JSON RPC API/_index.cn.md b/Document/content/JSON RPC API/_index.cn.md index 86a6eeea..0b290100 100644 --- a/Document/content/JSON RPC API/_index.cn.md +++ b/Document/content/JSON RPC API/_index.cn.md @@ -1,6 +1,6 @@ --- title: Qitmeer JSON RPC 说明 -weight: 1 +weight: 5 --- ### Qitmeer JSON RPC 命令列表 diff --git a/Document/content/JSON RPC API/_index.en.md b/Document/content/JSON RPC API/_index.en.md index 328b61d6..4fcad8e5 100644 --- a/Document/content/JSON RPC API/_index.en.md +++ b/Document/content/JSON RPC API/_index.en.md @@ -1,6 +1,6 @@ --- title: Qitmeer JSON RPC -weight: 1 +weight: 5 --- ### JSON-RPC API Reference @@ -15,7 +15,6 @@ weight: 1 - [getBlockhashByRange](getblockhashbyrange) - [getBlockHeader](getblockheader) - [getBlockTotal](getblocktotal) -- [getBlockWeight](getblockweight) - [getCoinbase](getcoinbase) - [getMainChainHeight](getmainchainheight) - [getOrphansTotal](getorphanstotal) diff --git a/Document/content/JSON RPC API/getBlockWeight/_index.en.md b/Document/content/JSON RPC API/getBlockWeight/_index.en.md deleted file mode 100644 index 3fb7a2c8..00000000 --- a/Document/content/JSON RPC API/getBlockWeight/_index.en.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -title: getBlockWeight -weight: 1 ---- From a9e1381b3edb76c887d599029bb092bc60f46719 Mon Sep 17 00:00:00 2001 From: Alex Wu Date: Thu, 2 Jul 2020 19:35:18 +0800 Subject: [PATCH 30/69] remove getRawTransactionByHash, no this method --- Document/content/JSON RPC API/_index.en.md | 2 +- Document/content/JSON RPC API/getRawTransaction/_index.md | 1 + .../content/JSON RPC API/getRawTransactionByHash/_index.en.md | 4 ---- 3 files changed, 2 insertions(+), 5 deletions(-) create mode 120000 Document/content/JSON RPC API/getRawTransaction/_index.md delete mode 100644 Document/content/JSON RPC API/getRawTransactionByHash/_index.en.md diff --git a/Document/content/JSON RPC API/_index.en.md b/Document/content/JSON RPC API/_index.en.md index 4fcad8e5..36c6489d 100644 --- a/Document/content/JSON RPC API/_index.en.md +++ b/Document/content/JSON RPC API/_index.en.md @@ -37,7 +37,7 @@ weight: 5 - [createRawTransaction](createrawtransaction) - [decodeRawTransaction](decoderawtransaction) -- [getRawTransactionByHash](getrawtransactionbyhash) +- [getRawTransaction](getrawtransaction) - [getUtxo](getutxo) - [sendRawTransaction](sendrawtransaction) diff --git a/Document/content/JSON RPC API/getRawTransaction/_index.md b/Document/content/JSON RPC API/getRawTransaction/_index.md new file mode 120000 index 00000000..9693f76b --- /dev/null +++ b/Document/content/JSON RPC API/getRawTransaction/_index.md @@ -0,0 +1 @@ +_index.cn.md \ No newline at end of file diff --git a/Document/content/JSON RPC API/getRawTransactionByHash/_index.en.md b/Document/content/JSON RPC API/getRawTransactionByHash/_index.en.md deleted file mode 100644 index a5bd5646..00000000 --- a/Document/content/JSON RPC API/getRawTransactionByHash/_index.en.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -title: getRawTransactionByHash -weight: 3 ---- From 2896f62c4c6614acb52bdf8acc6a69da4b7cae1b Mon Sep 17 00:00:00 2001 From: Outlier Date: Mon, 3 Aug 2020 13:13:05 +0800 Subject: [PATCH 31/69] Create greetings.yml --- .github/workflows/greetings.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .github/workflows/greetings.yml diff --git a/.github/workflows/greetings.yml b/.github/workflows/greetings.yml new file mode 100644 index 00000000..28ee6b2f --- /dev/null +++ b/.github/workflows/greetings.yml @@ -0,0 +1,13 @@ +name: Greetings + +on: [pull_request, issues] + +jobs: + greeting: + runs-on: ubuntu-latest + steps: + - uses: actions/first-interaction@v1 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + issue-message: 'Message that will be displayed on users'' first issue' + pr-message: 'Message that will be displayed on users'' first pr' From 1ec0084c139bb6d5c28fbc28bdb21665d37802a1 Mon Sep 17 00:00:00 2001 From: Outlier Date: Mon, 3 Aug 2020 22:19:56 +0800 Subject: [PATCH 32/69] Create greetings.yml --- .github/workflows/greetings.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .github/workflows/greetings.yml diff --git a/.github/workflows/greetings.yml b/.github/workflows/greetings.yml new file mode 100644 index 00000000..28ee6b2f --- /dev/null +++ b/.github/workflows/greetings.yml @@ -0,0 +1,13 @@ +name: Greetings + +on: [pull_request, issues] + +jobs: + greeting: + runs-on: ubuntu-latest + steps: + - uses: actions/first-interaction@v1 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + issue-message: 'Message that will be displayed on users'' first issue' + pr-message: 'Message that will be displayed on users'' first pr' From b95b2ac75d1936574616151d305a7085aff6f86a Mon Sep 17 00:00:00 2001 From: Outlier Date: Mon, 3 Aug 2020 22:41:36 +0800 Subject: [PATCH 33/69] Create gh-pages.yml --- .github/workflows/gh-pages.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/gh-pages.yml diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml new file mode 100644 index 00000000..f425bc49 --- /dev/null +++ b/.github/workflows/gh-pages.yml @@ -0,0 +1,31 @@ +name: github pages + +on: + push: + branches: + - main + +jobs: + deploy: + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + with: + submodules: true # Fetch Hugo themes (true OR recursive) + fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod + + - name: Setup Hugo + uses: peaceiris/actions-hugo@v2 + with: + hugo-version: '0.74.3' + + - name: Build + run: | + cd Document + hugo + + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./Document/public From 4de4c210e5649051c91f798e5dfb443a19dbd617 Mon Sep 17 00:00:00 2001 From: forchain Date: Mon, 3 Aug 2020 22:54:09 +0800 Subject: [PATCH 34/69] update wallet web command --- Document/content/tutorials/qitmeer-wallet-rpc/_index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Document/content/tutorials/qitmeer-wallet-rpc/_index.md b/Document/content/tutorials/qitmeer-wallet-rpc/_index.md index 5a5625e1..4d72fc49 100644 --- a/Document/content/tutorials/qitmeer-wallet-rpc/_index.md +++ b/Document/content/tutorials/qitmeer-wallet-rpc/_index.md @@ -12,7 +12,7 @@ Downlocad Qitmeer Wallet from [github.com/Qitmeer/qitmeer-wallet](https://github ```sh # run rpc or ul model will support rpc interface -./qitmeer-wallet qc web +./qitmeer-wallet web ``` Useage: From 870d7f5bd5d5d10ef135dcdd99416d8862fe9d0a Mon Sep 17 00:00:00 2001 From: Outlier Date: Mon, 3 Aug 2020 23:05:20 +0800 Subject: [PATCH 35/69] Create blank.yml --- .github/workflows/blank.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/blank.yml diff --git a/.github/workflows/blank.yml b/.github/workflows/blank.yml new file mode 100644 index 00000000..d6783e21 --- /dev/null +++ b/.github/workflows/blank.yml @@ -0,0 +1,33 @@ +# This is a basic workflow to help you get started with Actions + +name: CI + +# Controls when the action will run. Triggers the workflow on push or pull request +# events but only for the master branch +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + + # Runs a single command using the runners shell + - name: Run a one-line script + run: echo Hello, world! + + # Runs a set of commands using the runners shell + - name: Run a multi-line script + run: | + echo Add other actions to build, + echo test, and deploy your project. From 77253735a3deb52d0b4c725060422e8e1a882f40 Mon Sep 17 00:00:00 2001 From: Outlier Date: Mon, 3 Aug 2020 23:07:58 +0800 Subject: [PATCH 36/69] Update gh-pages.yml --- .github/workflows/gh-pages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index f425bc49..8485ba85 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -3,7 +3,7 @@ name: github pages on: push: branches: - - main + - master jobs: deploy: From 1787d6e864150fd380f6d012edce6075a1f9c922 Mon Sep 17 00:00:00 2001 From: Outlier Date: Mon, 3 Aug 2020 23:16:28 +0800 Subject: [PATCH 37/69] Delete greetings.yml --- .github/workflows/greetings.yml | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 .github/workflows/greetings.yml diff --git a/.github/workflows/greetings.yml b/.github/workflows/greetings.yml deleted file mode 100644 index 28ee6b2f..00000000 --- a/.github/workflows/greetings.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: Greetings - -on: [pull_request, issues] - -jobs: - greeting: - runs-on: ubuntu-latest - steps: - - uses: actions/first-interaction@v1 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - issue-message: 'Message that will be displayed on users'' first issue' - pr-message: 'Message that will be displayed on users'' first pr' From b2b3168f174e21c6b818f74da1a33c22c09e2619 Mon Sep 17 00:00:00 2001 From: Outlier Date: Mon, 3 Aug 2020 23:16:40 +0800 Subject: [PATCH 38/69] Delete blank.yml --- .github/workflows/blank.yml | 33 --------------------------------- 1 file changed, 33 deletions(-) delete mode 100644 .github/workflows/blank.yml diff --git a/.github/workflows/blank.yml b/.github/workflows/blank.yml deleted file mode 100644 index d6783e21..00000000 --- a/.github/workflows/blank.yml +++ /dev/null @@ -1,33 +0,0 @@ -# This is a basic workflow to help you get started with Actions - -name: CI - -# Controls when the action will run. Triggers the workflow on push or pull request -# events but only for the master branch -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - # This workflow contains a single job called "build" - build: - # The type of runner that the job will run on - runs-on: ubuntu-latest - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 - - # Runs a single command using the runners shell - - name: Run a one-line script - run: echo Hello, world! - - # Runs a set of commands using the runners shell - - name: Run a multi-line script - run: | - echo Add other actions to build, - echo test, and deploy your project. From 84ba28e59b4e2e64d028412444252bccd2bc9344 Mon Sep 17 00:00:00 2001 From: Outlier Date: Mon, 3 Aug 2020 23:19:51 +0800 Subject: [PATCH 39/69] Delete greetings.yml --- .github/workflows/greetings.yml | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 .github/workflows/greetings.yml diff --git a/.github/workflows/greetings.yml b/.github/workflows/greetings.yml deleted file mode 100644 index 28ee6b2f..00000000 --- a/.github/workflows/greetings.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: Greetings - -on: [pull_request, issues] - -jobs: - greeting: - runs-on: ubuntu-latest - steps: - - uses: actions/first-interaction@v1 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - issue-message: 'Message that will be displayed on users'' first issue' - pr-message: 'Message that will be displayed on users'' first pr' From 60aef86cb1b74f3e32b76fde89a1ca8f07adc040 Mon Sep 17 00:00:00 2001 From: forchain Date: Tue, 11 Aug 2020 13:11:38 +0800 Subject: [PATCH 40/69] update git ignore --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 6847397d..26724cae 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ Document/public/ -.DS_Store +.* From 0b9a4fdbb1485357526e380e3451c235d31792c9 Mon Sep 17 00:00:00 2001 From: forchain Date: Tue, 15 Sep 2020 18:17:31 +0800 Subject: [PATCH 41/69] split qitmeer-wallet --- .../content/Wallet JSON RPC API/_index.cn.md | 46 ++++++++++++++++ .../content/Wallet JSON RPC API/_index.en.md | 28 ++++++++++ .../createAccount/_index.md | 20 +++++++ .../createAddress/_index.md | 28 ++++++++++ .../Wallet JSON RPC API/dumpPrivKey/_index.md | 22 ++++++++ .../getAccountsAndBalance/_index.md | 45 ++++++++++++++++ .../getAddressesByAccount/_index.md | 32 +++++++++++ .../getBalanceByAddr/_index.md | 33 ++++++++++++ .../getTxListByAddr/_index.md | 54 +++++++++++++++++++ .../Wallet JSON RPC API/getUtxo/_index.md | 31 +++++++++++ .../importPrivKey/_index.md | 22 ++++++++ .../importWifPrivKey/_index.md | 10 ++++ .../Wallet JSON RPC API/lock/_index.md | 23 ++++++++ .../sendToAddressBatch/_index.md | 38 +++++++++++++ .../sendToAddressByAccount/_index.md | 32 +++++++++++ .../Wallet JSON RPC API/syncStats/_index.md | 29 ++++++++++ .../Wallet JSON RPC API/unlock/_index.cn.md | 21 ++++++++ .../Wallet JSON RPC API/unlock/_index.en.md | 22 ++++++++ .../tutorials/qitmeer-wallet-rpc/_index.md | 4 +- 19 files changed, 538 insertions(+), 2 deletions(-) create mode 100644 Document/content/Wallet JSON RPC API/_index.cn.md create mode 100644 Document/content/Wallet JSON RPC API/_index.en.md create mode 100644 Document/content/Wallet JSON RPC API/createAccount/_index.md create mode 100644 Document/content/Wallet JSON RPC API/createAddress/_index.md create mode 100644 Document/content/Wallet JSON RPC API/dumpPrivKey/_index.md create mode 100644 Document/content/Wallet JSON RPC API/getAccountsAndBalance/_index.md create mode 100644 Document/content/Wallet JSON RPC API/getAddressesByAccount/_index.md create mode 100644 Document/content/Wallet JSON RPC API/getBalanceByAddr/_index.md create mode 100644 Document/content/Wallet JSON RPC API/getTxListByAddr/_index.md create mode 100644 Document/content/Wallet JSON RPC API/getUtxo/_index.md create mode 100644 Document/content/Wallet JSON RPC API/importPrivKey/_index.md create mode 100644 Document/content/Wallet JSON RPC API/importWifPrivKey/_index.md create mode 100644 Document/content/Wallet JSON RPC API/lock/_index.md create mode 100644 Document/content/Wallet JSON RPC API/sendToAddressBatch/_index.md create mode 100644 Document/content/Wallet JSON RPC API/sendToAddressByAccount/_index.md create mode 100644 Document/content/Wallet JSON RPC API/syncStats/_index.md create mode 100644 Document/content/Wallet JSON RPC API/unlock/_index.cn.md create mode 100644 Document/content/Wallet JSON RPC API/unlock/_index.en.md diff --git a/Document/content/Wallet JSON RPC API/_index.cn.md b/Document/content/Wallet JSON RPC API/_index.cn.md new file mode 100644 index 00000000..64b5ae30 --- /dev/null +++ b/Document/content/Wallet JSON RPC API/_index.cn.md @@ -0,0 +1,46 @@ +--- +title: Qitmeer Wallet JSON RPC +weight: 6 +--- + +## Qitmeer Wallet JSON RPC 命令列表 + +### Wallet + - [unlock](unlock) + - [lock](lock) + - [getAccountsAndBalance](getAccountsAndBalance) + - [createAccount](createAccount) + - [getAddressesByAccount](getAddressesByAccount) + - [createAddress](createAddress) + - [sendToAddressByAccount](sendToAddressByAccount) + - [getTxListByAddr](getTxListByAddr) + - [importWifPrivKey](importWifPrivKey) + - [dumpPrivKey](dumpPrivKey) + - [syncStats](syncStats) + - [getUtxo](getUtxo) + - [importPrivKey](importPrivKey) + - [getBalanceByAddr](getBalanceByAddr) + - [sendToAddressBatch](sendToAddressBatch) + + +### UI + - [openWallet](openWallet) + +## Qitmeer-wallet RPC Reference + +Download Qitmeer Wallet from [github.com/Qitmeer/qitmeer-wallet](https://github.com/Qitmeer/qitmeer-wallet) + +```sh +# run rpc or ul model will support rpc interface + +./qitmeer-wallet web +``` + +Usage: + +RPC interface URL http://127.0.0.1:38130/api + +```sh + +curl -k -u "user:password" -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"1.0","method":"wallet_createAccount","params":["account"],"id":1}' http://127.0.0.1:38130/api | jq +``` diff --git a/Document/content/Wallet JSON RPC API/_index.en.md b/Document/content/Wallet JSON RPC API/_index.en.md new file mode 100644 index 00000000..f331bf62 --- /dev/null +++ b/Document/content/Wallet JSON RPC API/_index.en.md @@ -0,0 +1,28 @@ +--- +title: Qitmeer Wallet JSON RPC +weight: 6 +--- + +## Qitmeer Wallet JSON RPC Reference + +### Wallet + - [unlock](unlock) + - [lock](lock) + - [getAccountsAndBalance](getAccountsAndBalance) + - [createAccount](createAccount) + - [getAddressesByAccount](getAddressesByAccount) + - [createAddress](createAddress) + - [sendToAddressByAccount](sendToAddressByAccount) + - [getTxListByAddr](getTxListByAddr) + - [importWifPrivKey](importWifPrivKey) + - [dumpPrivKey](dumpPrivKey) + - [syncStats](syncStats) + - [getUtxo](getUtxo) + - [importPrivKey](importPrivKey) + - [getBalanceByAddr](getBalanceByAddr) + - [sendToAddressBatch](sendToAddressBatch) + + + +### UI + - [openWallet](openWallet) \ No newline at end of file diff --git a/Document/content/Wallet JSON RPC API/createAccount/_index.md b/Document/content/Wallet JSON RPC API/createAccount/_index.md new file mode 100644 index 00000000..cbd5f036 --- /dev/null +++ b/Document/content/Wallet JSON RPC API/createAccount/_index.md @@ -0,0 +1,20 @@ +--- +title: createAccount +weight: 3 +--- + +### wallet_createAccount +添加账户 + +#### Parameters +1. `accountName: (string)` 新账户名 + +#### Returns + + +#### Example +##### Request +```json +{"jsonrpc":"1.0","method":"wallet_createAccount","params":["accountName"],"id":1} +``` +##### Response diff --git a/Document/content/Wallet JSON RPC API/createAddress/_index.md b/Document/content/Wallet JSON RPC API/createAddress/_index.md new file mode 100644 index 00000000..01e6aefe --- /dev/null +++ b/Document/content/Wallet JSON RPC API/createAddress/_index.md @@ -0,0 +1,28 @@ +--- +title: wallet_createAddress +weight: 3 +--- + +### wallet_createAddress +创建地址 + +#### Parameters +1. `accountName: (string)` 账户名 + +#### Returns + + +#### Example +##### Request +```json +{"jsonrpc":"1.0","method":"wallet_createAddress","params":["default"],"id":1} +``` +##### Response + +```json +{ + "jsonrpc": "2.0", + "id": 1, + "result": "TmhMzHPCH6F2k3WYQkyvjhwAXoZt7q8TFv9" +} +``` diff --git a/Document/content/Wallet JSON RPC API/dumpPrivKey/_index.md b/Document/content/Wallet JSON RPC API/dumpPrivKey/_index.md new file mode 100644 index 00000000..7c20bc2b --- /dev/null +++ b/Document/content/Wallet JSON RPC API/dumpPrivKey/_index.md @@ -0,0 +1,22 @@ +--- +title: wallet_dumpPrivKey +weight: 3 +--- + +### wallet_dumpPrivKey +创建地址 + +#### Parameters +1. `addr: (string)` 地址 + + +#### Returns + + +#### Example +##### Request + +```json +{"id":1574829854509,"method":"wallet_dumpPrivKey","params":["Tmh3je9zbnHAvPfwwHhQsFSJmKkeRTtKqmV"]} +``` +##### Response diff --git a/Document/content/Wallet JSON RPC API/getAccountsAndBalance/_index.md b/Document/content/Wallet JSON RPC API/getAccountsAndBalance/_index.md new file mode 100644 index 00000000..092dba52 --- /dev/null +++ b/Document/content/Wallet JSON RPC API/getAccountsAndBalance/_index.md @@ -0,0 +1,45 @@ + +--- +title: getAccountsAndBalance +weight: 3 +--- + +### wallet_getAccountsAndBalance +获取所有的账号和余额 + +#### Parameters + +#### Returns + + +#### Example +##### Request +```json +{"jsonrpc":"1.0","method":"wallet_getAccountsAndBalance","params":[],"id":1 +``` +##### Response +```json +{ + "jsonrpc": "2.0", + "id": 1, + "result": { + "account": { + "TotalAmount": 0, + "SpendAmount": 0, + "UnspendAmount": 0, + "ConfirmAmount": 0 + }, + "default": { + "TotalAmount": 280000000000, + "SpendAmount": 0, + "UnspendAmount": 280000000000, + "ConfirmAmount": 0 + }, + "imported": { + "TotalAmount": 11172999678800, + "SpendAmount": 325000000000, + "UnspendAmount": 8754999678800, + "ConfirmAmount": 2418000000000 + } + } +} diff --git a/Document/content/Wallet JSON RPC API/getAddressesByAccount/_index.md b/Document/content/Wallet JSON RPC API/getAddressesByAccount/_index.md new file mode 100644 index 00000000..857f7b6f --- /dev/null +++ b/Document/content/Wallet JSON RPC API/getAddressesByAccount/_index.md @@ -0,0 +1,32 @@ + +--- +title: wallet_getAddressesByAccount +weight: 3 +--- + +### wallet_getAddressesByAccount +获取账户所有的地址 + +#### Parameters +1. `accountName: (string)` 账户名 + +#### Returns + + +#### Example +##### Request +```json +{"jsonrpc":"1.0","method":"wallet_getAddressesByAccount","params":["default"],"id":1} +``` +##### Response +```json +{ + "jsonrpc": "2.0", + "id": 1, + "result": [ + "TmSbEJs3nDmy68Af7M4Rsuj4pyAwcAret5a", + "Tmbzp2af9Ereh2hRejcVH9mCQgYdY2GHCAa", + "TmZu8zU1i6xbZMpLQZLMAJsyWHanZXUZtiV" + ] +} +``` \ No newline at end of file diff --git a/Document/content/Wallet JSON RPC API/getBalanceByAddr/_index.md b/Document/content/Wallet JSON RPC API/getBalanceByAddr/_index.md new file mode 100644 index 00000000..e9d4c8b2 --- /dev/null +++ b/Document/content/Wallet JSON RPC API/getBalanceByAddr/_index.md @@ -0,0 +1,33 @@ + +--- +title: wallet_getBalanceByAddr +weight: 3 +--- + +### wallet_getBalanceByAddr +获取地址余额 + +#### Parameters +1. `addr: (string)` 地址 + +#### Returns + + +#### Example +##### Request +```json +{"jsonrpc":"1.0","method":"wallet_getBalanceByAddr","params":["TmfDniZnvsjdH98GsH4aetL3XQKFUTWPp4e",1],"id":16} +``` +##### Response +```json +{ + "jsonrpc": "2.0", + "id": 16, + "result": { + "TotalAmount": 400000000, + "SpendAmount": 0, + "UnspendAmount": 400000000, + "ConfirmAmount": 0 + } +} +``` \ No newline at end of file diff --git a/Document/content/Wallet JSON RPC API/getTxListByAddr/_index.md b/Document/content/Wallet JSON RPC API/getTxListByAddr/_index.md new file mode 100644 index 00000000..b16c2d19 --- /dev/null +++ b/Document/content/Wallet JSON RPC API/getTxListByAddr/_index.md @@ -0,0 +1,54 @@ +--- +title: wallet_getTxListByAddr +weight: 3 +--- + +### wallet_getTxListByAddr +创建地址 + +#### Parameters +1. `addr: (string)` 地址 +1. `type: (number)` 0: in tx; 1: out tx; 2: all tx +1. `page : (number)` 页号 +1. `pageSize`: (string)` 页大小 + + +#### Returns + + +#### Example +##### Request +```json +{"id":1574750774018,"method":"wallet_getTxListByAddr","params":["TmhJcjphz3Y3jRysKT56JaH8m9pzAzsFMu7",2,-1,100]} +``` +##### Response + +```json +{ + "jsonrpc": "2.0", + "id": 1574750774018, + "result": { + "Total": 1, + "Page": 1, + "PageSize": 1000000000, + "transactions": [ + { + "hex": "", + "txid": "47879fb9dea684e4ce6f24f30812d3832d11fee34400754c6d8b34cd7d7eba8f", + "txhash": "937de7e15ec48e9cd58d79c594e7395015d5c663924ab5af929a9ef5e5f2e446", + "size": 377, + "version": 1, + "locktime": 0, + "expire": 0, + "vin": [ + ... + ], + "vout": [ + ... + ], + "blockhash": "026c6c85a1ae0183fe2e8bfda3450b9990acf9b8c4af3e995f9e361c7bb3d4cd", + "confirmations": 0 + } + ] + } +} \ No newline at end of file diff --git a/Document/content/Wallet JSON RPC API/getUtxo/_index.md b/Document/content/Wallet JSON RPC API/getUtxo/_index.md new file mode 100644 index 00000000..6f475833 --- /dev/null +++ b/Document/content/Wallet JSON RPC API/getUtxo/_index.md @@ -0,0 +1,31 @@ + +--- +title: wallet_getUtxo +weight: 3 +--- + +### wallet_getUtxo +获取指定地址可用 UTXO + +#### Parameters +1. `addr: (string)` 地址 + +#### Returns + +#### Example +##### Request +```json +{"jsonrpc":"1.0","method":"wallet_getUTXO","params":["TmgD1mu8zMMV9aWmJrXqQYnWRhR9SBfDZG6"],"id":1} +``` +##### Response +```json +{ + "jsonrpc": "2.0", + "id": 1, + "result": [{ + "Txid": "54c47af3a17201c64a8f3b27164d4e09e8e38e05501b16bfd4f001caeddfa86a", + "Index": 1, + "Amount": 699925600 + }] +}} +``` \ No newline at end of file diff --git a/Document/content/Wallet JSON RPC API/importPrivKey/_index.md b/Document/content/Wallet JSON RPC API/importPrivKey/_index.md new file mode 100644 index 00000000..e1fc59cc --- /dev/null +++ b/Document/content/Wallet JSON RPC API/importPrivKey/_index.md @@ -0,0 +1,22 @@ + +--- +title: wallet_importPrivKey +weight: 3 +--- + +### wallet_importPrivKey +导入私钥 + +#### Parameters +1. `accountName: (string)` 导入账户,目前只支持imported +2. `privKey: (string)` 私钥 +3. `rescan: (bool)` 是否重新扫描交易记录 + +#### Returns + +#### Example +##### Request +```json +{"jsonrpc":"1.0","method":"wallet_importPrivKey","params":["imported","xxxxxx",true],"id":1} +``` +##### Response diff --git a/Document/content/Wallet JSON RPC API/importWifPrivKey/_index.md b/Document/content/Wallet JSON RPC API/importWifPrivKey/_index.md new file mode 100644 index 00000000..7738a5f1 --- /dev/null +++ b/Document/content/Wallet JSON RPC API/importWifPrivKey/_index.md @@ -0,0 +1,10 @@ +## 9. wallet_importWifPrivKey {accountName} {privKey} {rescan} +### info: 导入wif格式私钥 +### args: +- accountName 导入账户,目前只支持imported +- privKey 私钥 +- rescan bool,是否重新扫描交易记录 +### example: +```json +{"id":1574750774018,"method":"wallet_importWifPrivKey","params":["imported","xxxxx",false]} +``` \ No newline at end of file diff --git a/Document/content/Wallet JSON RPC API/lock/_index.md b/Document/content/Wallet JSON RPC API/lock/_index.md new file mode 100644 index 00000000..91039b30 --- /dev/null +++ b/Document/content/Wallet JSON RPC API/lock/_index.md @@ -0,0 +1,23 @@ + +--- +title: unlock +weight: 3 +--- + +### wallet_lock +lock wallet + +#### Parameters +1. `password: (string)` wallet password +2. `second: (numeric)` unlock duration, unit second + +#### Returns + + +#### Example +##### Request +```json +{"jsonrpc":"1.0","method":"wallet_lock","params":[],"id":1} +``` +##### Response + diff --git a/Document/content/Wallet JSON RPC API/sendToAddressBatch/_index.md b/Document/content/Wallet JSON RPC API/sendToAddressBatch/_index.md new file mode 100644 index 00000000..9547ccfe --- /dev/null +++ b/Document/content/Wallet JSON RPC API/sendToAddressBatch/_index.md @@ -0,0 +1,38 @@ + +--- +title: wallet_sendToAddressBatch +weight: 3 +--- + +### wallet_sendToAddressBatch +单地址批量交易 + +#### Parameters +1. `addr: (string)` 地址 +1. `amount: (string)` 金额 + +#### Returns + + +#### Example +##### Request +```json +{ + "id": 1578639635748, + "method": "wallet_sendToAddressBatch", + "params": [{ + "TmeUg4pxc14y64J5BQj4M7jKEryeYfJ4APh": 0.1, + "TmU3Xwo1rnh4hTKBwifDYAccDrF3kxXaEFe": 0.2, + "TmjbGfbcMN1nVVHdcvzmPA4ksKqGq4eEkXu": 0.3, + "TmmWRCMcRZ1ZGdQEw2BwZ3ibsobATw4KTrw": 0.4 + }] +} +``` +##### Response +```json +{ + "jsonrpc": "2.0", + "id": 1578639635748, + "result": "d7a7d24d47bb66ad3d3185764808af730c9a9dbb5970686cf6e5a1d5f249923c" +} +``` \ No newline at end of file diff --git a/Document/content/Wallet JSON RPC API/sendToAddressByAccount/_index.md b/Document/content/Wallet JSON RPC API/sendToAddressByAccount/_index.md new file mode 100644 index 00000000..30e75e6c --- /dev/null +++ b/Document/content/Wallet JSON RPC API/sendToAddressByAccount/_index.md @@ -0,0 +1,32 @@ +--- +title: sendToAddressByAccount +weight: 3 +--- + +### wallet_sendToAddressByAccount +发送交易 + +#### Parameters +1. `fromAccount: (string)` from account +2. `toAccount: (string)` to address +3. `amount: (string)` send amount coin +4. `comment: (string)` +5. `commentTo: (string)` + +#### Returns + + +#### Example +##### Request +```json +{"id":1574828051839,"method":"wallet_sendToAddressByAccount","params":["default","TmZu8zU1i6xbZMpLQZLMAJsyWHanZXUZtiV",800,"",""]} +``` +##### Response + +```json +{ + "jsonrpc": "2.0", + "id": 1574828051839, + "result": "b1ff3645c374992313e66d504fdf4fd3f2006f9414b97a7e1f6382328cc74fb1" +} +``` diff --git a/Document/content/Wallet JSON RPC API/syncStats/_index.md b/Document/content/Wallet JSON RPC API/syncStats/_index.md new file mode 100644 index 00000000..e8b3dfbd --- /dev/null +++ b/Document/content/Wallet JSON RPC API/syncStats/_index.md @@ -0,0 +1,29 @@ + +--- +title: wallet_syncStats +weight: 3 +--- + +### wallet_syncStats +查看当前钱包同步高度 + +#### Parameters + +#### Returns + + +#### Example +##### Request +```json +{"jsonrpc":"1.0","method":"wallet_syncStats","params":[],"id":1} +``` +##### Response +```json +{ + "jsonrpc": "2.0", + "id": 1, + "result": { + "Height": 20460 + } +} +``` \ No newline at end of file diff --git a/Document/content/Wallet JSON RPC API/unlock/_index.cn.md b/Document/content/Wallet JSON RPC API/unlock/_index.cn.md new file mode 100644 index 00000000..7b24515d --- /dev/null +++ b/Document/content/Wallet JSON RPC API/unlock/_index.cn.md @@ -0,0 +1,21 @@ +--- +title: unlock +weight: 3 +--- + +### wallet_unlock +unlock wallet + +#### Parameters +1. `password: (string)` 钱包密码 +2. `second: (numeric)` 解锁时间,单位秒 + +#### Returns + + +#### Example +##### Request +```json +{"jsonrpc":"1.0","method":"wallet_unlock","params":["password",30],"id":1} +``` +##### Response diff --git a/Document/content/Wallet JSON RPC API/unlock/_index.en.md b/Document/content/Wallet JSON RPC API/unlock/_index.en.md new file mode 100644 index 00000000..053050b2 --- /dev/null +++ b/Document/content/Wallet JSON RPC API/unlock/_index.en.md @@ -0,0 +1,22 @@ +--- +title: unlock +weight: 3 +--- + +### wallet_unlock +unlock wallet + +#### Parameters +1. `password: (string)` wallet password +2. `second: (numeric)` unlock duration, unit second + +#### Returns + + +#### Example +##### Request +```json +{"jsonrpc":"1.0","method":"wallet_unlock","params":["password",30],"id":1} +``` +##### Response + diff --git a/Document/content/tutorials/qitmeer-wallet-rpc/_index.md b/Document/content/tutorials/qitmeer-wallet-rpc/_index.md index 4d72fc49..3d8c6d50 100644 --- a/Document/content/tutorials/qitmeer-wallet-rpc/_index.md +++ b/Document/content/tutorials/qitmeer-wallet-rpc/_index.md @@ -7,7 +7,7 @@ weight: 1 # Qitmeer-wallet RPC Reference -Downlocad Qitmeer Wallet from [github.com/Qitmeer/qitmeer-wallet](https://github.com/Qitmeer/qitmeer-wallet) +Download Qitmeer Wallet from [github.com/Qitmeer/qitmeer-wallet](https://github.com/Qitmeer/qitmeer-wallet) ```sh # run rpc or ul model will support rpc interface @@ -15,7 +15,7 @@ Downlocad Qitmeer Wallet from [github.com/Qitmeer/qitmeer-wallet](https://github ./qitmeer-wallet web ``` -Useage: +Usage: RPC interface URL http://127.0.0.1:38130/api From 627927eca8b7a79fc6dd35ebf526c0e04e6ae36b Mon Sep 17 00:00:00 2001 From: forchain Date: Fri, 18 Sep 2020 17:35:41 +0800 Subject: [PATCH 42/69] Qitmeer Wallet docs --- .../content/Wallet JSON RPC API/_index.cn.md | 46 ------------------- .../content/Wallet JSON RPC API/_index.en.md | 44 ++++++++++++++++-- .../Wallet JSON RPC API/lock/_index.md | 5 +- .../Wallet JSON RPC API/unlock/_index.cn.md | 21 --------- 4 files changed, 43 insertions(+), 73 deletions(-) delete mode 100644 Document/content/Wallet JSON RPC API/_index.cn.md delete mode 100644 Document/content/Wallet JSON RPC API/unlock/_index.cn.md diff --git a/Document/content/Wallet JSON RPC API/_index.cn.md b/Document/content/Wallet JSON RPC API/_index.cn.md deleted file mode 100644 index 64b5ae30..00000000 --- a/Document/content/Wallet JSON RPC API/_index.cn.md +++ /dev/null @@ -1,46 +0,0 @@ ---- -title: Qitmeer Wallet JSON RPC -weight: 6 ---- - -## Qitmeer Wallet JSON RPC 命令列表 - -### Wallet - - [unlock](unlock) - - [lock](lock) - - [getAccountsAndBalance](getAccountsAndBalance) - - [createAccount](createAccount) - - [getAddressesByAccount](getAddressesByAccount) - - [createAddress](createAddress) - - [sendToAddressByAccount](sendToAddressByAccount) - - [getTxListByAddr](getTxListByAddr) - - [importWifPrivKey](importWifPrivKey) - - [dumpPrivKey](dumpPrivKey) - - [syncStats](syncStats) - - [getUtxo](getUtxo) - - [importPrivKey](importPrivKey) - - [getBalanceByAddr](getBalanceByAddr) - - [sendToAddressBatch](sendToAddressBatch) - - -### UI - - [openWallet](openWallet) - -## Qitmeer-wallet RPC Reference - -Download Qitmeer Wallet from [github.com/Qitmeer/qitmeer-wallet](https://github.com/Qitmeer/qitmeer-wallet) - -```sh -# run rpc or ul model will support rpc interface - -./qitmeer-wallet web -``` - -Usage: - -RPC interface URL http://127.0.0.1:38130/api - -```sh - -curl -k -u "user:password" -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"1.0","method":"wallet_createAccount","params":["account"],"id":1}' http://127.0.0.1:38130/api | jq -``` diff --git a/Document/content/Wallet JSON RPC API/_index.en.md b/Document/content/Wallet JSON RPC API/_index.en.md index f331bf62..aaca08c6 100644 --- a/Document/content/Wallet JSON RPC API/_index.en.md +++ b/Document/content/Wallet JSON RPC API/_index.en.md @@ -3,7 +3,7 @@ title: Qitmeer Wallet JSON RPC weight: 6 --- -## Qitmeer Wallet JSON RPC Reference +## API List ### Wallet - [unlock](unlock) @@ -22,7 +22,45 @@ weight: 6 - [getBalanceByAddr](getBalanceByAddr) - [sendToAddressBatch](sendToAddressBatch) +### UI + - [openWallet](openWallet) +## Instruction +### Build +```shell +git clone https://github.com/qitmeer/qitmeer-wallet ~/github.com/qitmeer/qitmeer-wallet + cd ~/github.com/qitmeer/qitmeer-wallet +make build +``` -### UI - - [openWallet](openWallet) \ No newline at end of file +### Config +``` +vi config.toml + +# make sure ui=false + +``` + +### Run + +```sh +./qitmeer-wallet web +``` +### Call API + +#### Command +```shell +# by cURL +curl -k -u "${USER}:${PASSWORD}" -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"1.0","method":"${METHOD}","params":[${PARAMS}],"id":1}' ${API_URL} | jq +``` +#### Parameters +1. USER - rpcUser in the config +2. PASSWORD - rpcPass in the config +3. PASSWORD - listeners in the config +4. METHOD - RPC call name +5. PARAMS - RPC call parameters + +#### Example +```sh +curl -k -u "user:password" -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"1.0","method":"wallet_createAccount","params":["account"],"id":1}' http://127.0.0.1:38130/api | jq +``` \ No newline at end of file diff --git a/Document/content/Wallet JSON RPC API/lock/_index.md b/Document/content/Wallet JSON RPC API/lock/_index.md index 91039b30..e579b203 100644 --- a/Document/content/Wallet JSON RPC API/lock/_index.md +++ b/Document/content/Wallet JSON RPC API/lock/_index.md @@ -1,6 +1,6 @@ --- -title: unlock +title: lock weight: 3 --- @@ -19,5 +19,4 @@ lock wallet ```json {"jsonrpc":"1.0","method":"wallet_lock","params":[],"id":1} ``` -##### Response - +##### Response \ No newline at end of file diff --git a/Document/content/Wallet JSON RPC API/unlock/_index.cn.md b/Document/content/Wallet JSON RPC API/unlock/_index.cn.md deleted file mode 100644 index 7b24515d..00000000 --- a/Document/content/Wallet JSON RPC API/unlock/_index.cn.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -title: unlock -weight: 3 ---- - -### wallet_unlock -unlock wallet - -#### Parameters -1. `password: (string)` 钱包密码 -2. `second: (numeric)` 解锁时间,单位秒 - -#### Returns - - -#### Example -##### Request -```json -{"jsonrpc":"1.0","method":"wallet_unlock","params":["password",30],"id":1} -``` -##### Response From 02f21ed7ce90c48be469fa1695dbd9d4d34bc2bd Mon Sep 17 00:00:00 2001 From: forchain Date: Sat, 19 Sep 2020 11:46:20 +0800 Subject: [PATCH 43/69] add error code catalog --- .../Wallet JSON RPC API/API List/_index.en.md | 33 +++++++++ .../wallet_createAccount}/_index.md | 0 .../wallet_createAddress}/_index.md | 0 .../wallet_dumpPrivKey}/_index.md | 0 .../wallet_getAccountByAddress/_index.en.md | 4 ++ .../wallet_getAccountsAndBalance}/_index.md | 0 .../wallet_getAddressesByAccount}/_index.md | 0 .../wallet_getBalanceByAddr}/_index.md | 0 .../wallet_getBillByAddr/_index.en.md | 4 ++ .../wallet_getTxListByAddr}/_index.md | 0 .../wallet_getUtxo}/_index.md | 0 .../wallet_importPrivKey}/_index.md | 0 .../wallet_importWifPrivKey}/_index.md | 0 .../{lock => API List/wallet_lock}/_index.md | 0 .../wallet_sendToAddressBatch}/_index.md | 0 .../wallet_sendToAddressByAccount}/_index.md | 0 .../API List/wallet_sendToMany/_index.en.md | 4 ++ .../wallet_syncStats}/_index.md | 0 .../wallet_unlock}/_index.en.md | 0 .../Wallet JSON RPC API/Errors/_index.en.md | 4 ++ .../Instruction/_index.en.md | 43 ++++++++++++ .../content/Wallet JSON RPC API/_index.en.md | 68 ++----------------- 22 files changed, 97 insertions(+), 63 deletions(-) create mode 100644 Document/content/Wallet JSON RPC API/API List/_index.en.md rename Document/content/Wallet JSON RPC API/{createAccount => API List/wallet_createAccount}/_index.md (100%) rename Document/content/Wallet JSON RPC API/{createAddress => API List/wallet_createAddress}/_index.md (100%) rename Document/content/Wallet JSON RPC API/{dumpPrivKey => API List/wallet_dumpPrivKey}/_index.md (100%) create mode 100644 Document/content/Wallet JSON RPC API/API List/wallet_getAccountByAddress/_index.en.md rename Document/content/Wallet JSON RPC API/{getAccountsAndBalance => API List/wallet_getAccountsAndBalance}/_index.md (100%) rename Document/content/Wallet JSON RPC API/{getAddressesByAccount => API List/wallet_getAddressesByAccount}/_index.md (100%) rename Document/content/Wallet JSON RPC API/{getBalanceByAddr => API List/wallet_getBalanceByAddr}/_index.md (100%) create mode 100644 Document/content/Wallet JSON RPC API/API List/wallet_getBillByAddr/_index.en.md rename Document/content/Wallet JSON RPC API/{getTxListByAddr => API List/wallet_getTxListByAddr}/_index.md (100%) rename Document/content/Wallet JSON RPC API/{getUtxo => API List/wallet_getUtxo}/_index.md (100%) rename Document/content/Wallet JSON RPC API/{importPrivKey => API List/wallet_importPrivKey}/_index.md (100%) rename Document/content/Wallet JSON RPC API/{importWifPrivKey => API List/wallet_importWifPrivKey}/_index.md (100%) rename Document/content/Wallet JSON RPC API/{lock => API List/wallet_lock}/_index.md (100%) rename Document/content/Wallet JSON RPC API/{sendToAddressBatch => API List/wallet_sendToAddressBatch}/_index.md (100%) rename Document/content/Wallet JSON RPC API/{sendToAddressByAccount => API List/wallet_sendToAddressByAccount}/_index.md (100%) create mode 100644 Document/content/Wallet JSON RPC API/API List/wallet_sendToMany/_index.en.md rename Document/content/Wallet JSON RPC API/{syncStats => API List/wallet_syncStats}/_index.md (100%) rename Document/content/Wallet JSON RPC API/{unlock => API List/wallet_unlock}/_index.en.md (100%) create mode 100644 Document/content/Wallet JSON RPC API/Errors/_index.en.md create mode 100644 Document/content/Wallet JSON RPC API/Instruction/_index.en.md diff --git a/Document/content/Wallet JSON RPC API/API List/_index.en.md b/Document/content/Wallet JSON RPC API/API List/_index.en.md new file mode 100644 index 00000000..d47b20b9 --- /dev/null +++ b/Document/content/Wallet JSON RPC API/API List/_index.en.md @@ -0,0 +1,33 @@ +--- +title: API List +weight: 2 +--- + +## Wallet + - [createAccount](wallet_createAccount) + - [createAddress](wallet_createAddress) + - [importPrivKey](wallet_importPrivKey) + - [importWifPrivKey](wallet_importWifPrivKey) + - [dumpPrivKey](wallet_dumpPrivKey) + + - [sendToAddress](wallet_sendToAddress) + - [sendToAddressByAccount](wallet_sendToAddressByAccount) + - [sendToMany](wallet_sendToMany) + + - [getAccountByAddress](wallet_getAccountByAddress) + - [getAccountsAndBalance](wallet_getAccountsAndBalance) + - [getAddressesByAccount](wallet_getAddressesByAccount) + - [getBalanceByAccount](wallet_getBalanceByAccount) + - [getBalanceByAddr](wallet_getBalanceByAddr) + - [getBillByAddr](wallet_getBillByAddr) + - [getTxListByAddr](wallet_getTxListByAddr) + - [getUTXO](wallet_getUtxo) + + - [lock](wallet_lock) + - [syncStats](wallet_syncStats) + - [unlock](wallet_unlock) + +## UI + - [openWallet](ui_openWallet) + +## QitmeerD \ No newline at end of file diff --git a/Document/content/Wallet JSON RPC API/createAccount/_index.md b/Document/content/Wallet JSON RPC API/API List/wallet_createAccount/_index.md similarity index 100% rename from Document/content/Wallet JSON RPC API/createAccount/_index.md rename to Document/content/Wallet JSON RPC API/API List/wallet_createAccount/_index.md diff --git a/Document/content/Wallet JSON RPC API/createAddress/_index.md b/Document/content/Wallet JSON RPC API/API List/wallet_createAddress/_index.md similarity index 100% rename from Document/content/Wallet JSON RPC API/createAddress/_index.md rename to Document/content/Wallet JSON RPC API/API List/wallet_createAddress/_index.md diff --git a/Document/content/Wallet JSON RPC API/dumpPrivKey/_index.md b/Document/content/Wallet JSON RPC API/API List/wallet_dumpPrivKey/_index.md similarity index 100% rename from Document/content/Wallet JSON RPC API/dumpPrivKey/_index.md rename to Document/content/Wallet JSON RPC API/API List/wallet_dumpPrivKey/_index.md diff --git a/Document/content/Wallet JSON RPC API/API List/wallet_getAccountByAddress/_index.en.md b/Document/content/Wallet JSON RPC API/API List/wallet_getAccountByAddress/_index.en.md new file mode 100644 index 00000000..6264a211 --- /dev/null +++ b/Document/content/Wallet JSON RPC API/API List/wallet_getAccountByAddress/_index.en.md @@ -0,0 +1,4 @@ +--- +title: wallet_getAccountByAddress +weight: 3 +--- diff --git a/Document/content/Wallet JSON RPC API/getAccountsAndBalance/_index.md b/Document/content/Wallet JSON RPC API/API List/wallet_getAccountsAndBalance/_index.md similarity index 100% rename from Document/content/Wallet JSON RPC API/getAccountsAndBalance/_index.md rename to Document/content/Wallet JSON RPC API/API List/wallet_getAccountsAndBalance/_index.md diff --git a/Document/content/Wallet JSON RPC API/getAddressesByAccount/_index.md b/Document/content/Wallet JSON RPC API/API List/wallet_getAddressesByAccount/_index.md similarity index 100% rename from Document/content/Wallet JSON RPC API/getAddressesByAccount/_index.md rename to Document/content/Wallet JSON RPC API/API List/wallet_getAddressesByAccount/_index.md diff --git a/Document/content/Wallet JSON RPC API/getBalanceByAddr/_index.md b/Document/content/Wallet JSON RPC API/API List/wallet_getBalanceByAddr/_index.md similarity index 100% rename from Document/content/Wallet JSON RPC API/getBalanceByAddr/_index.md rename to Document/content/Wallet JSON RPC API/API List/wallet_getBalanceByAddr/_index.md diff --git a/Document/content/Wallet JSON RPC API/API List/wallet_getBillByAddr/_index.en.md b/Document/content/Wallet JSON RPC API/API List/wallet_getBillByAddr/_index.en.md new file mode 100644 index 00000000..c6dd81da --- /dev/null +++ b/Document/content/Wallet JSON RPC API/API List/wallet_getBillByAddr/_index.en.md @@ -0,0 +1,4 @@ +--- +title: wallet_getBillByAddr +weight: 3 +--- diff --git a/Document/content/Wallet JSON RPC API/getTxListByAddr/_index.md b/Document/content/Wallet JSON RPC API/API List/wallet_getTxListByAddr/_index.md similarity index 100% rename from Document/content/Wallet JSON RPC API/getTxListByAddr/_index.md rename to Document/content/Wallet JSON RPC API/API List/wallet_getTxListByAddr/_index.md diff --git a/Document/content/Wallet JSON RPC API/getUtxo/_index.md b/Document/content/Wallet JSON RPC API/API List/wallet_getUtxo/_index.md similarity index 100% rename from Document/content/Wallet JSON RPC API/getUtxo/_index.md rename to Document/content/Wallet JSON RPC API/API List/wallet_getUtxo/_index.md diff --git a/Document/content/Wallet JSON RPC API/importPrivKey/_index.md b/Document/content/Wallet JSON RPC API/API List/wallet_importPrivKey/_index.md similarity index 100% rename from Document/content/Wallet JSON RPC API/importPrivKey/_index.md rename to Document/content/Wallet JSON RPC API/API List/wallet_importPrivKey/_index.md diff --git a/Document/content/Wallet JSON RPC API/importWifPrivKey/_index.md b/Document/content/Wallet JSON RPC API/API List/wallet_importWifPrivKey/_index.md similarity index 100% rename from Document/content/Wallet JSON RPC API/importWifPrivKey/_index.md rename to Document/content/Wallet JSON RPC API/API List/wallet_importWifPrivKey/_index.md diff --git a/Document/content/Wallet JSON RPC API/lock/_index.md b/Document/content/Wallet JSON RPC API/API List/wallet_lock/_index.md similarity index 100% rename from Document/content/Wallet JSON RPC API/lock/_index.md rename to Document/content/Wallet JSON RPC API/API List/wallet_lock/_index.md diff --git a/Document/content/Wallet JSON RPC API/sendToAddressBatch/_index.md b/Document/content/Wallet JSON RPC API/API List/wallet_sendToAddressBatch/_index.md similarity index 100% rename from Document/content/Wallet JSON RPC API/sendToAddressBatch/_index.md rename to Document/content/Wallet JSON RPC API/API List/wallet_sendToAddressBatch/_index.md diff --git a/Document/content/Wallet JSON RPC API/sendToAddressByAccount/_index.md b/Document/content/Wallet JSON RPC API/API List/wallet_sendToAddressByAccount/_index.md similarity index 100% rename from Document/content/Wallet JSON RPC API/sendToAddressByAccount/_index.md rename to Document/content/Wallet JSON RPC API/API List/wallet_sendToAddressByAccount/_index.md diff --git a/Document/content/Wallet JSON RPC API/API List/wallet_sendToMany/_index.en.md b/Document/content/Wallet JSON RPC API/API List/wallet_sendToMany/_index.en.md new file mode 100644 index 00000000..4bcf193e --- /dev/null +++ b/Document/content/Wallet JSON RPC API/API List/wallet_sendToMany/_index.en.md @@ -0,0 +1,4 @@ +--- +title: wallet_sendToMany +weight: 3 +--- diff --git a/Document/content/Wallet JSON RPC API/syncStats/_index.md b/Document/content/Wallet JSON RPC API/API List/wallet_syncStats/_index.md similarity index 100% rename from Document/content/Wallet JSON RPC API/syncStats/_index.md rename to Document/content/Wallet JSON RPC API/API List/wallet_syncStats/_index.md diff --git a/Document/content/Wallet JSON RPC API/unlock/_index.en.md b/Document/content/Wallet JSON RPC API/API List/wallet_unlock/_index.en.md similarity index 100% rename from Document/content/Wallet JSON RPC API/unlock/_index.en.md rename to Document/content/Wallet JSON RPC API/API List/wallet_unlock/_index.en.md diff --git a/Document/content/Wallet JSON RPC API/Errors/_index.en.md b/Document/content/Wallet JSON RPC API/Errors/_index.en.md new file mode 100644 index 00000000..204c2495 --- /dev/null +++ b/Document/content/Wallet JSON RPC API/Errors/_index.en.md @@ -0,0 +1,4 @@ +--- +title: Errors +weight: 9 +--- \ No newline at end of file diff --git a/Document/content/Wallet JSON RPC API/Instruction/_index.en.md b/Document/content/Wallet JSON RPC API/Instruction/_index.en.md new file mode 100644 index 00000000..408888e9 --- /dev/null +++ b/Document/content/Wallet JSON RPC API/Instruction/_index.en.md @@ -0,0 +1,43 @@ +--- +title: Instruction +weight: 1 +--- + +## Build +```shell +git clone https://github.com/qitmeer/qitmeer-wallet ~/github.com/qitmeer/qitmeer-wallet + cd ~/github.com/qitmeer/qitmeer-wallet +make build +``` + +## Config +``` +vi config.toml + +# make sure ui=false + +``` + +## Run + +```sh +./qitmeer-wallet web +``` +## Call API + +### Command +```shell +# by cURL +curl -k -u "${USER}:${PASSWORD}" -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"1.0","method":"${METHOD}","params":[${PARAMS}],"id":1}' ${API_URL} | jq +``` +### Parameters +1. USER - rpcUser in the config +2. PASSWORD - rpcPass in the config +3. API_URL - listeners in the config +4. METHOD - RPC call name +5. PARAMS - RPC call parameters + +### Example +```sh +curl -k -u "user:password" -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"1.0","method":"wallet_createAccount","params":["account"],"id":1}' http://127.0.0.1:38130/api | jq +``` \ No newline at end of file diff --git a/Document/content/Wallet JSON RPC API/_index.en.md b/Document/content/Wallet JSON RPC API/_index.en.md index aaca08c6..f0f3a239 100644 --- a/Document/content/Wallet JSON RPC API/_index.en.md +++ b/Document/content/Wallet JSON RPC API/_index.en.md @@ -1,66 +1,8 @@ --- -title: Qitmeer Wallet JSON RPC -weight: 6 +title: Wallet JSON PRC +weight: 1 --- -## API List - -### Wallet - - [unlock](unlock) - - [lock](lock) - - [getAccountsAndBalance](getAccountsAndBalance) - - [createAccount](createAccount) - - [getAddressesByAccount](getAddressesByAccount) - - [createAddress](createAddress) - - [sendToAddressByAccount](sendToAddressByAccount) - - [getTxListByAddr](getTxListByAddr) - - [importWifPrivKey](importWifPrivKey) - - [dumpPrivKey](dumpPrivKey) - - [syncStats](syncStats) - - [getUtxo](getUtxo) - - [importPrivKey](importPrivKey) - - [getBalanceByAddr](getBalanceByAddr) - - [sendToAddressBatch](sendToAddressBatch) - -### UI - - [openWallet](openWallet) - -## Instruction -### Build -```shell -git clone https://github.com/qitmeer/qitmeer-wallet ~/github.com/qitmeer/qitmeer-wallet - cd ~/github.com/qitmeer/qitmeer-wallet -make build -``` - -### Config -``` -vi config.toml - -# make sure ui=false - -``` - -### Run - -```sh -./qitmeer-wallet web -``` -### Call API - -#### Command -```shell -# by cURL -curl -k -u "${USER}:${PASSWORD}" -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"1.0","method":"${METHOD}","params":[${PARAMS}],"id":1}' ${API_URL} | jq -``` -#### Parameters -1. USER - rpcUser in the config -2. PASSWORD - rpcPass in the config -3. PASSWORD - listeners in the config -4. METHOD - RPC call name -5. PARAMS - RPC call parameters - -#### Example -```sh -curl -k -u "user:password" -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"1.0","method":"wallet_createAccount","params":["account"],"id":1}' http://127.0.0.1:38130/api | jq -``` \ No newline at end of file + - [Instruction](./instruction/) + - [API List](./api-list/) + - [Errors](./errors/) \ No newline at end of file From bd7e4c88ef1d68158ae0157afe7129277cbd4334 Mon Sep 17 00:00:00 2001 From: forchain Date: Sat, 19 Sep 2020 14:03:42 +0800 Subject: [PATCH 44/69] add wallet server and qitmer server stuns --- .../Wallet JSON RPC API/API List/_index.en.md | 14 ++++++++++++-- .../API List/qitmeed_add/_index.en.md | 0 .../API List/qitmeed_del/_index.en.md | 5 +++++ .../API List/qitmeed_list/_index.en.md | 0 .../API List/qitmeed_status/_index.en.md | 5 +++++ .../API List/qitmeerd_reset/_index.en.md | 5 +++++ .../API List/qitmeerd_update/_index.en.md | 5 +++++ .../API List/ui_createWallet/_index.en.md | 5 +++++ .../API List/ui_makeSeed/_index.en.md | 5 +++++ .../API List/ui_openWallet/_index.en.md | 5 +++++ .../API List/ui_recoverWallet/_index.en.md | 5 +++++ .../API List/ui_walletStatus/_index.en.md | 5 +++++ 12 files changed, 57 insertions(+), 2 deletions(-) create mode 100644 Document/content/Wallet JSON RPC API/API List/qitmeed_add/_index.en.md create mode 100644 Document/content/Wallet JSON RPC API/API List/qitmeed_del/_index.en.md create mode 100644 Document/content/Wallet JSON RPC API/API List/qitmeed_list/_index.en.md create mode 100644 Document/content/Wallet JSON RPC API/API List/qitmeed_status/_index.en.md create mode 100644 Document/content/Wallet JSON RPC API/API List/qitmeerd_reset/_index.en.md create mode 100644 Document/content/Wallet JSON RPC API/API List/qitmeerd_update/_index.en.md create mode 100644 Document/content/Wallet JSON RPC API/API List/ui_createWallet/_index.en.md create mode 100644 Document/content/Wallet JSON RPC API/API List/ui_makeSeed/_index.en.md create mode 100644 Document/content/Wallet JSON RPC API/API List/ui_openWallet/_index.en.md create mode 100644 Document/content/Wallet JSON RPC API/API List/ui_recoverWallet/_index.en.md create mode 100644 Document/content/Wallet JSON RPC API/API List/ui_walletStatus/_index.en.md diff --git a/Document/content/Wallet JSON RPC API/API List/_index.en.md b/Document/content/Wallet JSON RPC API/API List/_index.en.md index d47b20b9..2e7c7baf 100644 --- a/Document/content/Wallet JSON RPC API/API List/_index.en.md +++ b/Document/content/Wallet JSON RPC API/API List/_index.en.md @@ -1,4 +1,4 @@ ---- + --- title: API List weight: 2 --- @@ -29,5 +29,15 @@ weight: 2 ## UI - [openWallet](ui_openWallet) + - [createWallet](ui_createWallet) + - [makeSeed](ui_makeSeed) + - [walletStatus](ui_walletStatus) + - [recoverWallet](ui_recoverWallet) -## QitmeerD \ No newline at end of file +## QitmeerD + - [add](qitmeed_add) + - [del](qitmeed_del) + - [list](qitmeed_list) + - [reset](qitmeerd_reset) + - [status](qitmeerd_status) + - [update](qitmeerd_update) \ No newline at end of file diff --git a/Document/content/Wallet JSON RPC API/API List/qitmeed_add/_index.en.md b/Document/content/Wallet JSON RPC API/API List/qitmeed_add/_index.en.md new file mode 100644 index 00000000..e69de29b diff --git a/Document/content/Wallet JSON RPC API/API List/qitmeed_del/_index.en.md b/Document/content/Wallet JSON RPC API/API List/qitmeed_del/_index.en.md new file mode 100644 index 00000000..1979bae9 --- /dev/null +++ b/Document/content/Wallet JSON RPC API/API List/qitmeed_del/_index.en.md @@ -0,0 +1,5 @@ + +--- +title: qitmeed_del +weight: 3 +--- diff --git a/Document/content/Wallet JSON RPC API/API List/qitmeed_list/_index.en.md b/Document/content/Wallet JSON RPC API/API List/qitmeed_list/_index.en.md new file mode 100644 index 00000000..e69de29b diff --git a/Document/content/Wallet JSON RPC API/API List/qitmeed_status/_index.en.md b/Document/content/Wallet JSON RPC API/API List/qitmeed_status/_index.en.md new file mode 100644 index 00000000..cf7cef8f --- /dev/null +++ b/Document/content/Wallet JSON RPC API/API List/qitmeed_status/_index.en.md @@ -0,0 +1,5 @@ + +--- +title: qitmeed_status +weight: 3 +--- diff --git a/Document/content/Wallet JSON RPC API/API List/qitmeerd_reset/_index.en.md b/Document/content/Wallet JSON RPC API/API List/qitmeerd_reset/_index.en.md new file mode 100644 index 00000000..e24f55e1 --- /dev/null +++ b/Document/content/Wallet JSON RPC API/API List/qitmeerd_reset/_index.en.md @@ -0,0 +1,5 @@ + +--- +title: qitmeerd_reset +weight: 3 +--- diff --git a/Document/content/Wallet JSON RPC API/API List/qitmeerd_update/_index.en.md b/Document/content/Wallet JSON RPC API/API List/qitmeerd_update/_index.en.md new file mode 100644 index 00000000..c5a3c63d --- /dev/null +++ b/Document/content/Wallet JSON RPC API/API List/qitmeerd_update/_index.en.md @@ -0,0 +1,5 @@ + +--- +title: qitmeerd_update +weight: 3 +--- diff --git a/Document/content/Wallet JSON RPC API/API List/ui_createWallet/_index.en.md b/Document/content/Wallet JSON RPC API/API List/ui_createWallet/_index.en.md new file mode 100644 index 00000000..fc1af360 --- /dev/null +++ b/Document/content/Wallet JSON RPC API/API List/ui_createWallet/_index.en.md @@ -0,0 +1,5 @@ + +--- +title: ui_createWallet +weight: 3 +--- diff --git a/Document/content/Wallet JSON RPC API/API List/ui_makeSeed/_index.en.md b/Document/content/Wallet JSON RPC API/API List/ui_makeSeed/_index.en.md new file mode 100644 index 00000000..01ec409c --- /dev/null +++ b/Document/content/Wallet JSON RPC API/API List/ui_makeSeed/_index.en.md @@ -0,0 +1,5 @@ + +--- +title: ui_makeSeed +weight: 3 +--- diff --git a/Document/content/Wallet JSON RPC API/API List/ui_openWallet/_index.en.md b/Document/content/Wallet JSON RPC API/API List/ui_openWallet/_index.en.md new file mode 100644 index 00000000..5081aae7 --- /dev/null +++ b/Document/content/Wallet JSON RPC API/API List/ui_openWallet/_index.en.md @@ -0,0 +1,5 @@ + +--- +title: ui_openWallet +weight: 3 +--- diff --git a/Document/content/Wallet JSON RPC API/API List/ui_recoverWallet/_index.en.md b/Document/content/Wallet JSON RPC API/API List/ui_recoverWallet/_index.en.md new file mode 100644 index 00000000..3952959c --- /dev/null +++ b/Document/content/Wallet JSON RPC API/API List/ui_recoverWallet/_index.en.md @@ -0,0 +1,5 @@ + +--- +title: ui_recoverWallet +weight: 3 +--- diff --git a/Document/content/Wallet JSON RPC API/API List/ui_walletStatus/_index.en.md b/Document/content/Wallet JSON RPC API/API List/ui_walletStatus/_index.en.md new file mode 100644 index 00000000..d819af83 --- /dev/null +++ b/Document/content/Wallet JSON RPC API/API List/ui_walletStatus/_index.en.md @@ -0,0 +1,5 @@ + +--- +title: ui_walletStatus +weight: 3 +--- From 0a32e271901906ec53bc6955bcbab46b5a583f46 Mon Sep 17 00:00:00 2001 From: forchain Date: Sun, 20 Sep 2020 15:58:58 +0800 Subject: [PATCH 45/69] wallet_createAccount, wallet_unlock --- .../Wallet JSON RPC API/API List/_index.en.md | 6 +-- .../wallet-create-account/_index.en.md | 33 ++++++++++++++++ .../API List/wallet-unlock/_index.en.md | 38 +++++++++++++++++++ .../API List/wallet_createAccount/_index.md | 20 ---------- .../API List/wallet_getTxListByAddr/_index.md | 4 +- .../API List/wallet_unlock/_index.en.md | 22 ----------- 6 files changed, 76 insertions(+), 47 deletions(-) create mode 100644 Document/content/Wallet JSON RPC API/API List/wallet-create-account/_index.en.md create mode 100644 Document/content/Wallet JSON RPC API/API List/wallet-unlock/_index.en.md delete mode 100644 Document/content/Wallet JSON RPC API/API List/wallet_createAccount/_index.md delete mode 100644 Document/content/Wallet JSON RPC API/API List/wallet_unlock/_index.en.md diff --git a/Document/content/Wallet JSON RPC API/API List/_index.en.md b/Document/content/Wallet JSON RPC API/API List/_index.en.md index 2e7c7baf..63d1a09d 100644 --- a/Document/content/Wallet JSON RPC API/API List/_index.en.md +++ b/Document/content/Wallet JSON RPC API/API List/_index.en.md @@ -1,10 +1,10 @@ - --- +--- title: API List weight: 2 --- ## Wallet - - [createAccount](wallet_createAccount) + - [createAccount](wallet-create-account) - [createAddress](wallet_createAddress) - [importPrivKey](wallet_importPrivKey) - [importWifPrivKey](wallet_importWifPrivKey) @@ -25,7 +25,7 @@ weight: 2 - [lock](wallet_lock) - [syncStats](wallet_syncStats) - - [unlock](wallet_unlock) + - [unlock](wallet-unlock) ## UI - [openWallet](ui_openWallet) diff --git a/Document/content/Wallet JSON RPC API/API List/wallet-create-account/_index.en.md b/Document/content/Wallet JSON RPC API/API List/wallet-create-account/_index.en.md new file mode 100644 index 00000000..a8636954 --- /dev/null +++ b/Document/content/Wallet JSON RPC API/API List/wallet-create-account/_index.en.md @@ -0,0 +1,33 @@ +--- +title: createAccount +weight: 3 +--- + +## wallet_createAccount + creates the next account and returns its account number. The + name must be unique to the account. In order to support automatic seed + restoring, new accounts may not be created when all of the previous 100 + accounts have no transaction history (this is a deviation from the BIP0044 + spec, which allows no unused account gaps). + +### Parameters +1. `name: (string)` account name + +### Returns +#### Success +`null` + +#### Error +`-32000 -13` Creating an account requires the wallet to be unlocked. Enter the wallet passphrase with walletpassphrase to unlock + +### Example +#### Request +```shell +curl -k -u "test:test" -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"1.0","method":"wallet_createAccount","params":["test_account"],"id":1}' http://127.0.0.1:8130/api +``` + +#### Response +```sh +{"jsonrpc":"2.0","id":1,"result":null} +``` + diff --git a/Document/content/Wallet JSON RPC API/API List/wallet-unlock/_index.en.md b/Document/content/Wallet JSON RPC API/API List/wallet-unlock/_index.en.md new file mode 100644 index 00000000..f20ba0c7 --- /dev/null +++ b/Document/content/Wallet JSON RPC API/API List/wallet-unlock/_index.en.md @@ -0,0 +1,38 @@ +--- +title: unlock +weight: 3 +--- + +## wallet_unlock + unlocks the wallet's address manager and relocks it after timeout has + expired. If the wallet is already unlocked and the new passphrase is + correct, the current timeout is replaced with the new one. The wallet will + be locked if the passphrase is incorrect or any other error occurs during the + unlock. + +### Parameters +1. `passphrase: (string)` wallet private password +2. `timeout: (numeric)` unlock duration, unit second + +### Returns +#### Success +```sh +null +``` + +#### Error + `-32000` invalid passphrase for master private key + + + +### Example +#### Request +```json +curl -k -u "test:test" -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"1.0","method":"wallet_unlock","params":["password", 999999999],"id":1}' http://127.0.0.1:8130/api + +``` +#### Response +```json +{"jsonrpc":"2.0","id":1,"result":null} +``` + diff --git a/Document/content/Wallet JSON RPC API/API List/wallet_createAccount/_index.md b/Document/content/Wallet JSON RPC API/API List/wallet_createAccount/_index.md deleted file mode 100644 index cbd5f036..00000000 --- a/Document/content/Wallet JSON RPC API/API List/wallet_createAccount/_index.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -title: createAccount -weight: 3 ---- - -### wallet_createAccount -添加账户 - -#### Parameters -1. `accountName: (string)` 新账户名 - -#### Returns - - -#### Example -##### Request -```json -{"jsonrpc":"1.0","method":"wallet_createAccount","params":["accountName"],"id":1} -``` -##### Response diff --git a/Document/content/Wallet JSON RPC API/API List/wallet_getTxListByAddr/_index.md b/Document/content/Wallet JSON RPC API/API List/wallet_getTxListByAddr/_index.md index b16c2d19..3500bc77 100644 --- a/Document/content/Wallet JSON RPC API/API List/wallet_getTxListByAddr/_index.md +++ b/Document/content/Wallet JSON RPC API/API List/wallet_getTxListByAddr/_index.md @@ -8,8 +8,8 @@ weight: 3 #### Parameters 1. `addr: (string)` 地址 -1. `type: (number)` 0: in tx; 1: out tx; 2: all tx -1. `page : (number)` 页号 +1. `type: (numeric)` 0: in tx; 1: out tx; 2: all tx +1. `page : (numeric)` 页号 1. `pageSize`: (string)` 页大小 diff --git a/Document/content/Wallet JSON RPC API/API List/wallet_unlock/_index.en.md b/Document/content/Wallet JSON RPC API/API List/wallet_unlock/_index.en.md deleted file mode 100644 index 053050b2..00000000 --- a/Document/content/Wallet JSON RPC API/API List/wallet_unlock/_index.en.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: unlock -weight: 3 ---- - -### wallet_unlock -unlock wallet - -#### Parameters -1. `password: (string)` wallet password -2. `second: (numeric)` unlock duration, unit second - -#### Returns - - -#### Example -##### Request -```json -{"jsonrpc":"1.0","method":"wallet_unlock","params":["password",30],"id":1} -``` -##### Response - From 0ec210b7543271fe08f763b4f1c54d248bcc1585 Mon Sep 17 00:00:00 2001 From: forchain Date: Sun, 20 Sep 2020 16:39:18 +0800 Subject: [PATCH 46/69] fix catelog --- .../Wallet JSON RPC API/API List/_index.en.md | 46 +++++++++---------- .../API List/qitmeed_add/_index.en.md | 19 ++++++++ .../API List/qitmeed_del/_index.en.md | 16 ++++++- .../API List/qitmeed_list/_index.en.md | 19 ++++++++ .../API List/qitmeed_status/_index.en.md | 5 -- .../API List/qitmeerd_status/_index.en.md | 19 ++++++++ .../_index.en.md | 4 +- .../wallet_getAccountsAndBalance/_index.md | 5 +- .../wallet_getBalanceByAccount/_index.md | 15 ++++++ .../wallet_importWifPrivKey/_index.md | 7 ++- .../API List/wallet_lock/_index.md | 5 +- .../API List/wallet_sendToAddress/_index.md | 16 +++++++ .../wallet_sendToAddressBatch/_index.md | 38 --------------- .../wallet_sendToAddressByAccount/_index.md | 2 +- .../_index.en.md | 4 +- .../Instruction/_index.en.md | 10 ++-- 16 files changed, 146 insertions(+), 84 deletions(-) delete mode 100644 Document/content/Wallet JSON RPC API/API List/qitmeed_status/_index.en.md create mode 100644 Document/content/Wallet JSON RPC API/API List/qitmeerd_status/_index.en.md rename Document/content/Wallet JSON RPC API/API List/{wallet-create-account => wallet_createAccount}/_index.en.md (95%) create mode 100644 Document/content/Wallet JSON RPC API/API List/wallet_getBalanceByAccount/_index.md create mode 100644 Document/content/Wallet JSON RPC API/API List/wallet_sendToAddress/_index.md delete mode 100644 Document/content/Wallet JSON RPC API/API List/wallet_sendToAddressBatch/_index.md rename Document/content/Wallet JSON RPC API/API List/{wallet-unlock => wallet_unlock}/_index.en.md (96%) diff --git a/Document/content/Wallet JSON RPC API/API List/_index.en.md b/Document/content/Wallet JSON RPC API/API List/_index.en.md index 63d1a09d..e4feb29f 100644 --- a/Document/content/Wallet JSON RPC API/API List/_index.en.md +++ b/Document/content/Wallet JSON RPC API/API List/_index.en.md @@ -4,35 +4,35 @@ weight: 2 --- ## Wallet - - [createAccount](wallet-create-account) - - [createAddress](wallet_createAddress) - - [importPrivKey](wallet_importPrivKey) - - [importWifPrivKey](wallet_importWifPrivKey) - - [dumpPrivKey](wallet_dumpPrivKey) + - [createAccount](wallet_createaccount) + - [createAddress](wallet_createaddress) + - [importPrivKey](wallet_importprivkey) + - [importWIFPrivKey](wallet_importwifprivkey) + - [dumpPrivKey](wallet_dumpprivkey) - - [sendToAddress](wallet_sendToAddress) - - [sendToAddressByAccount](wallet_sendToAddressByAccount) - - [sendToMany](wallet_sendToMany) + - [sendToAddress](wallet_sendtoaddress) + - [sendToAddressByAccount](wallet_sendtoaddressbyaccount) + - [sendToMany](wallet_sendtomany) - - [getAccountByAddress](wallet_getAccountByAddress) - - [getAccountsAndBalance](wallet_getAccountsAndBalance) - - [getAddressesByAccount](wallet_getAddressesByAccount) - - [getBalanceByAccount](wallet_getBalanceByAccount) - - [getBalanceByAddr](wallet_getBalanceByAddr) - - [getBillByAddr](wallet_getBillByAddr) - - [getTxListByAddr](wallet_getTxListByAddr) - - [getUTXO](wallet_getUtxo) + - [getAccountByAddress](wallet_getaccountbyaddress) + - [getAccountsAndBalance](wallet_getaccountsandbalance) + - [getAddressesByAccount](wallet_getaddressesbyaccount) + - [getBalanceByAccount](wallet_getbalancebyaccount) + - [getBalanceByAddr](wallet_getbalancebyaddr) + - [getBillByAddr](wallet_getbillbyaddr) + - [getTxListByAddr](wallet_gettxlistbyaddr) + - [getUTXO](wallet_getutxo) - [lock](wallet_lock) - - [syncStats](wallet_syncStats) - - [unlock](wallet-unlock) + - [syncStats](wallet_syncstats) + - [unlock](wallet_unlock) ## UI - - [openWallet](ui_openWallet) - - [createWallet](ui_createWallet) - - [makeSeed](ui_makeSeed) - - [walletStatus](ui_walletStatus) - - [recoverWallet](ui_recoverWallet) + - [openWallet](ui_openwallet) + - [createWallet](ui_createwallet) + - [makeSeed](ui_makeseed) + - [walletStatus](ui_walletstatus) + - [recoverWallet](ui_recoverwallet) ## QitmeerD - [add](qitmeed_add) diff --git a/Document/content/Wallet JSON RPC API/API List/qitmeed_add/_index.en.md b/Document/content/Wallet JSON RPC API/API List/qitmeed_add/_index.en.md index e69de29b..2fe7e757 100644 --- a/Document/content/Wallet JSON RPC API/API List/qitmeed_add/_index.en.md +++ b/Document/content/Wallet JSON RPC API/API List/qitmeed_add/_index.en.md @@ -0,0 +1,19 @@ +--- +title: qitmeed_add +weight: 3 +--- + +## Add + +### Parameters + +### Returns +#### Success + +#### Error + +### Example +#### Request + +#### Response + diff --git a/Document/content/Wallet JSON RPC API/API List/qitmeed_del/_index.en.md b/Document/content/Wallet JSON RPC API/API List/qitmeed_del/_index.en.md index 1979bae9..2dda161f 100644 --- a/Document/content/Wallet JSON RPC API/API List/qitmeed_del/_index.en.md +++ b/Document/content/Wallet JSON RPC API/API List/qitmeed_del/_index.en.md @@ -1,5 +1,19 @@ - --- title: qitmeed_del weight: 3 --- + +## Del + +### Parameters + +### Returns +#### Success + +#### Error + +### Example +#### Request + +#### Response + diff --git a/Document/content/Wallet JSON RPC API/API List/qitmeed_list/_index.en.md b/Document/content/Wallet JSON RPC API/API List/qitmeed_list/_index.en.md index e69de29b..e96abf7e 100644 --- a/Document/content/Wallet JSON RPC API/API List/qitmeed_list/_index.en.md +++ b/Document/content/Wallet JSON RPC API/API List/qitmeed_list/_index.en.md @@ -0,0 +1,19 @@ +--- +title: qitmeed_list +weight: 3 +--- + +## List + +### Parameters + +### Returns +#### Success + +#### Error + +### Example +#### Request + +#### Response + diff --git a/Document/content/Wallet JSON RPC API/API List/qitmeed_status/_index.en.md b/Document/content/Wallet JSON RPC API/API List/qitmeed_status/_index.en.md deleted file mode 100644 index cf7cef8f..00000000 --- a/Document/content/Wallet JSON RPC API/API List/qitmeed_status/_index.en.md +++ /dev/null @@ -1,5 +0,0 @@ - ---- -title: qitmeed_status -weight: 3 ---- diff --git a/Document/content/Wallet JSON RPC API/API List/qitmeerd_status/_index.en.md b/Document/content/Wallet JSON RPC API/API List/qitmeerd_status/_index.en.md new file mode 100644 index 00000000..c809130c --- /dev/null +++ b/Document/content/Wallet JSON RPC API/API List/qitmeerd_status/_index.en.md @@ -0,0 +1,19 @@ +--- +title: qitmeed_status +weight: 3 +--- + +## Status + +### Parameters + +### Returns +#### Success + +#### Error + +### Example +#### Request + +#### Response + diff --git a/Document/content/Wallet JSON RPC API/API List/wallet-create-account/_index.en.md b/Document/content/Wallet JSON RPC API/API List/wallet_createAccount/_index.en.md similarity index 95% rename from Document/content/Wallet JSON RPC API/API List/wallet-create-account/_index.en.md rename to Document/content/Wallet JSON RPC API/API List/wallet_createAccount/_index.en.md index a8636954..bb6e2f76 100644 --- a/Document/content/Wallet JSON RPC API/API List/wallet-create-account/_index.en.md +++ b/Document/content/Wallet JSON RPC API/API List/wallet_createAccount/_index.en.md @@ -1,9 +1,9 @@ --- -title: createAccount +title: wallet_createAccount weight: 3 --- -## wallet_createAccount +## CreateAccount creates the next account and returns its account number. The name must be unique to the account. In order to support automatic seed restoring, new accounts may not be created when all of the previous 100 diff --git a/Document/content/Wallet JSON RPC API/API List/wallet_getAccountsAndBalance/_index.md b/Document/content/Wallet JSON RPC API/API List/wallet_getAccountsAndBalance/_index.md index 092dba52..8dc91cf2 100644 --- a/Document/content/Wallet JSON RPC API/API List/wallet_getAccountsAndBalance/_index.md +++ b/Document/content/Wallet JSON RPC API/API List/wallet_getAccountsAndBalance/_index.md @@ -1,10 +1,9 @@ - --- -title: getAccountsAndBalance +title: wallet_getAccountsAndBalance weight: 3 --- -### wallet_getAccountsAndBalance +### wallet_getAccountsAndBalance 获取所有的账号和余额 #### Parameters diff --git a/Document/content/Wallet JSON RPC API/API List/wallet_getBalanceByAccount/_index.md b/Document/content/Wallet JSON RPC API/API List/wallet_getBalanceByAccount/_index.md new file mode 100644 index 00000000..5fe48beb --- /dev/null +++ b/Document/content/Wallet JSON RPC API/API List/wallet_getBalanceByAccount/_index.md @@ -0,0 +1,15 @@ +--- +title: wallet_getBalanceByAccount +weight: 3 +--- + +### wallet_getBalanceByAccount + +#### Parameters + +#### Returns + + +#### Example +##### Request +##### Response \ No newline at end of file diff --git a/Document/content/Wallet JSON RPC API/API List/wallet_importWifPrivKey/_index.md b/Document/content/Wallet JSON RPC API/API List/wallet_importWifPrivKey/_index.md index 7738a5f1..3023c6af 100644 --- a/Document/content/Wallet JSON RPC API/API List/wallet_importWifPrivKey/_index.md +++ b/Document/content/Wallet JSON RPC API/API List/wallet_importWifPrivKey/_index.md @@ -1,4 +1,9 @@ -## 9. wallet_importWifPrivKey {accountName} {privKey} {rescan} +--- +title: wallet_getAccountsAndBalance +weight: 3 +--- + +## wallet_importWifPrivKey ### info: 导入wif格式私钥 ### args: - accountName 导入账户,目前只支持imported diff --git a/Document/content/Wallet JSON RPC API/API List/wallet_lock/_index.md b/Document/content/Wallet JSON RPC API/API List/wallet_lock/_index.md index e579b203..74c788a6 100644 --- a/Document/content/Wallet JSON RPC API/API List/wallet_lock/_index.md +++ b/Document/content/Wallet JSON RPC API/API List/wallet_lock/_index.md @@ -1,10 +1,9 @@ - --- -title: lock +title: wallet_lock weight: 3 --- -### wallet_lock +### Lock lock wallet #### Parameters diff --git a/Document/content/Wallet JSON RPC API/API List/wallet_sendToAddress/_index.md b/Document/content/Wallet JSON RPC API/API List/wallet_sendToAddress/_index.md new file mode 100644 index 00000000..00670e74 --- /dev/null +++ b/Document/content/Wallet JSON RPC API/API List/wallet_sendToAddress/_index.md @@ -0,0 +1,16 @@ + +--- +title: wallet_sendToAddress +weight: 3 +--- + +### wallet_sendToAddress + +#### Parameters + +#### Returns + + +#### Example +##### Request +##### Response \ No newline at end of file diff --git a/Document/content/Wallet JSON RPC API/API List/wallet_sendToAddressBatch/_index.md b/Document/content/Wallet JSON RPC API/API List/wallet_sendToAddressBatch/_index.md deleted file mode 100644 index 9547ccfe..00000000 --- a/Document/content/Wallet JSON RPC API/API List/wallet_sendToAddressBatch/_index.md +++ /dev/null @@ -1,38 +0,0 @@ - ---- -title: wallet_sendToAddressBatch -weight: 3 ---- - -### wallet_sendToAddressBatch -单地址批量交易 - -#### Parameters -1. `addr: (string)` 地址 -1. `amount: (string)` 金额 - -#### Returns - - -#### Example -##### Request -```json -{ - "id": 1578639635748, - "method": "wallet_sendToAddressBatch", - "params": [{ - "TmeUg4pxc14y64J5BQj4M7jKEryeYfJ4APh": 0.1, - "TmU3Xwo1rnh4hTKBwifDYAccDrF3kxXaEFe": 0.2, - "TmjbGfbcMN1nVVHdcvzmPA4ksKqGq4eEkXu": 0.3, - "TmmWRCMcRZ1ZGdQEw2BwZ3ibsobATw4KTrw": 0.4 - }] -} -``` -##### Response -```json -{ - "jsonrpc": "2.0", - "id": 1578639635748, - "result": "d7a7d24d47bb66ad3d3185764808af730c9a9dbb5970686cf6e5a1d5f249923c" -} -``` \ No newline at end of file diff --git a/Document/content/Wallet JSON RPC API/API List/wallet_sendToAddressByAccount/_index.md b/Document/content/Wallet JSON RPC API/API List/wallet_sendToAddressByAccount/_index.md index 30e75e6c..b482e0a8 100644 --- a/Document/content/Wallet JSON RPC API/API List/wallet_sendToAddressByAccount/_index.md +++ b/Document/content/Wallet JSON RPC API/API List/wallet_sendToAddressByAccount/_index.md @@ -1,5 +1,5 @@ --- -title: sendToAddressByAccount +title: wallet_sendToAddressByAccount weight: 3 --- diff --git a/Document/content/Wallet JSON RPC API/API List/wallet-unlock/_index.en.md b/Document/content/Wallet JSON RPC API/API List/wallet_unlock/_index.en.md similarity index 96% rename from Document/content/Wallet JSON RPC API/API List/wallet-unlock/_index.en.md rename to Document/content/Wallet JSON RPC API/API List/wallet_unlock/_index.en.md index f20ba0c7..c1dd2b00 100644 --- a/Document/content/Wallet JSON RPC API/API List/wallet-unlock/_index.en.md +++ b/Document/content/Wallet JSON RPC API/API List/wallet_unlock/_index.en.md @@ -1,9 +1,9 @@ --- -title: unlock +title: wallet_unlock weight: 3 --- -## wallet_unlock +## Unlock unlocks the wallet's address manager and relocks it after timeout has expired. If the wallet is already unlocked and the new passphrase is correct, the current timeout is replaced with the new one. The wallet will diff --git a/Document/content/Wallet JSON RPC API/Instruction/_index.en.md b/Document/content/Wallet JSON RPC API/Instruction/_index.en.md index 408888e9..6398767c 100644 --- a/Document/content/Wallet JSON RPC API/Instruction/_index.en.md +++ b/Document/content/Wallet JSON RPC API/Instruction/_index.en.md @@ -31,11 +31,11 @@ vi config.toml curl -k -u "${USER}:${PASSWORD}" -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"1.0","method":"${METHOD}","params":[${PARAMS}],"id":1}' ${API_URL} | jq ``` ### Parameters -1. USER - rpcUser in the config -2. PASSWORD - rpcPass in the config -3. API_URL - listeners in the config -4. METHOD - RPC call name -5. PARAMS - RPC call parameters +1. `USER: (string)` rpcUser in the config +2. `PASSWORD: (string)` rpcPass in the config +3. `API_URL: (string)` listeners in the config +4. `METHOD: (string)` RPC call name +5. `PARAMS: (array)` RPC call parameters ### Example ```sh From 819bd2fd80775ff12437fa8f5e3111b906b418ce Mon Sep 17 00:00:00 2001 From: forchain Date: Mon, 21 Sep 2020 12:39:53 +0800 Subject: [PATCH 47/69] create account --- .../API List/wallet_createAddress/_index.md | 32 +++++++++++-------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/Document/content/Wallet JSON RPC API/API List/wallet_createAddress/_index.md b/Document/content/Wallet JSON RPC API/API List/wallet_createAddress/_index.md index 01e6aefe..804d6e92 100644 --- a/Document/content/Wallet JSON RPC API/API List/wallet_createAddress/_index.md +++ b/Document/content/Wallet JSON RPC API/API List/wallet_createAddress/_index.md @@ -3,26 +3,32 @@ title: wallet_createAddress weight: 3 --- -### wallet_createAddress -创建地址 +## CreateAddress +returns the next external chained address for a wallet. -#### Parameters -1. `accountName: (string)` 账户名 +### Parameters +1. `accountName: (string)` name of the account on which the address created -#### Returns +### Returns +### Success +new address (base58) +### Error +`-32000` account name '*test_account*' not found -#### Example -##### Request -```json -{"jsonrpc":"1.0","method":"wallet_createAddress","params":["default"],"id":1} + +### Example +#### Request +```sh +curl -k -u "test:test" -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"1.0","method":"wallet_createAddress","params":["test_account"],"id":1}' http://127.0.0.1:8130/api ``` -##### Response +#### Response ```json { - "jsonrpc": "2.0", - "id": 1, - "result": "TmhMzHPCH6F2k3WYQkyvjhwAXoZt7q8TFv9" + "jsonrpc": "2.0", + "id": 1, + "result": "Tmdy4W4FeDD2M8Tm8syZJmR2BPdug4Zeozj" } + ``` From 2f02338d67b7ec8b2da08a90f061ed9b7a025ac7 Mon Sep 17 00:00:00 2001 From: forchain Date: Mon, 21 Sep 2020 16:00:35 +0800 Subject: [PATCH 48/69] import private key --- .../API List/wallet_importPrivKey/_index.md | 30 +++++++++++-------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/Document/content/Wallet JSON RPC API/API List/wallet_importPrivKey/_index.md b/Document/content/Wallet JSON RPC API/API List/wallet_importPrivKey/_index.md index e1fc59cc..26e114f3 100644 --- a/Document/content/Wallet JSON RPC API/API List/wallet_importPrivKey/_index.md +++ b/Document/content/Wallet JSON RPC API/API List/wallet_importPrivKey/_index.md @@ -1,22 +1,28 @@ - --- title: wallet_importPrivKey weight: 3 --- -### wallet_importPrivKey -导入私钥 +## ImportPrivKey +imports a private key to the wallet and writes the new wallet to disk. + +### Parameters +1. `accountName: (string)` name of the imported account. MUST be: "imported" +2. `privKey: (hex string)` private key -#### Parameters -1. `accountName: (string)` 导入账户,目前只支持imported -2. `privKey: (string)` 私钥 -3. `rescan: (bool)` 是否重新扫描交易记录 +### Returns +#### Success +`null` -#### Returns +#### Error +`-32000 -4` imported addresses must belong to the imported account -#### Example -##### Request +### Example +#### Request +```sh +curl --location --request POST 'http://127.0.0.1:8130/api/' -u test:test -H 'Content-Type: application/json' -d '{"id":1, "jsonrpc":"2.0","method":"wallet_importPrivKey","params":["imported", "9999999999999999999999999999999999999999999999999999999999999999"]}' +``` +#### Response ```json -{"jsonrpc":"1.0","method":"wallet_importPrivKey","params":["imported","xxxxxx",true],"id":1} +{"jsonrpc":"2.0","id":1,"result":null} ``` -##### Response From ea1a93a11b0387517605d25f18cd960fef870c79 Mon Sep 17 00:00:00 2001 From: forchain Date: Mon, 21 Sep 2020 16:17:11 +0800 Subject: [PATCH 49/69] create wallet and imprt private key --- .../API List/ui_createWallet/_index.en.md | 27 ++++++++++++++++++- .../API List/wallet_importPrivKey/_index.md | 5 +++- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/Document/content/Wallet JSON RPC API/API List/ui_createWallet/_index.en.md b/Document/content/Wallet JSON RPC API/API List/ui_createWallet/_index.en.md index fc1af360..890ea119 100644 --- a/Document/content/Wallet JSON RPC API/API List/ui_createWallet/_index.en.md +++ b/Document/content/Wallet JSON RPC API/API List/ui_createWallet/_index.en.md @@ -1,5 +1,30 @@ - --- title: ui_createWallet weight: 3 --- + +## CreateWallet +create wallet by seed + +### Parameters +1. `name: (string)` account name + +### Returns +#### Success +`null` + +#### Error +`-32000` Creating an account requires the wallet to be unlocked. Enter the wallet passphrase with walletpassphrase to unlock + +### Example +#### Request +```shell +curl -k -u "test:test" -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"1.0","method":"wallet_createAccount","params":["test_account"],"id":1}' http://127.0.0.1:8130/api +``` + +#### Response +```sh +{"jsonrpc":"2.0","id":1,"result":null} +``` + + diff --git a/Document/content/Wallet JSON RPC API/API List/wallet_importPrivKey/_index.md b/Document/content/Wallet JSON RPC API/API List/wallet_importPrivKey/_index.md index 26e114f3..f47f2b85 100644 --- a/Document/content/Wallet JSON RPC API/API List/wallet_importPrivKey/_index.md +++ b/Document/content/Wallet JSON RPC API/API List/wallet_importPrivKey/_index.md @@ -6,9 +6,12 @@ weight: 3 ## ImportPrivKey imports a private key to the wallet and writes the new wallet to disk. +**Note**: this private key is in a hex string and you may generate it with `qx wiftopriv` tool from a WIF key, which should be compatible with BTC network (in contrast to dumpPrivKey and importWIFPrivKey, both are incompatible). You may export this WIF key from any wallet service that follows this rule, such as [KAHF](https://kahf.io) + ### Parameters 1. `accountName: (string)` name of the imported account. MUST be: "imported" -2. `privKey: (hex string)` private key +2. `privKey: (hex string)` private key. + ### Returns #### Success From 0c425f37cad9804e635cb0966137f70888bd2910 Mon Sep 17 00:00:00 2001 From: forchain Date: Mon, 12 Oct 2020 12:04:18 +0800 Subject: [PATCH 50/69] wallet_getBalanceByAddr --- .../API List/wallet_getBalanceByAddr/_index.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Document/content/Wallet JSON RPC API/API List/wallet_getBalanceByAddr/_index.md b/Document/content/Wallet JSON RPC API/API List/wallet_getBalanceByAddr/_index.md index e9d4c8b2..d4c5814b 100644 --- a/Document/content/Wallet JSON RPC API/API List/wallet_getBalanceByAddr/_index.md +++ b/Document/content/Wallet JSON RPC API/API List/wallet_getBalanceByAddr/_index.md @@ -5,12 +5,16 @@ weight: 3 --- ### wallet_getBalanceByAddr -获取地址余额 +Get balance by address #### Parameters -1. `addr: (string)` 地址 +1. `addr: (string)` address #### Returns +1. `TotalAmount: (numeric)` Total amount, spend amount+ spendable amount + frozen amount +2. `SpendAmount: (numeric)` spent amount, already confirmed +3. `UnspendAmount: (numeric)` spendable amount, not including frozen amount +4. `ConfirmAmount: (numeric)` frozen amount, waiting for conformation #### Example From fe8d4473666cfd130f0681275bb4420ff5295807 Mon Sep 17 00:00:00 2001 From: forchain Date: Mon, 12 Oct 2020 15:31:31 +0800 Subject: [PATCH 51/69] update getAccountByAddress, getBillByAddr, getTxListByAddr --- .../wallet_getAccountByAddress/_index.en.md | 28 ++++++ .../wallet_getAccountsAndBalance/_index.md | 63 ++++++++----- .../wallet_getBalanceByAccount/_index.md | 25 ++++- .../wallet_getBalanceByAddr/_index.md | 22 +++-- .../wallet_getBillByAddr/_index.en.md | 94 +++++++++++++++++++ .../API List/wallet_getTxListByAddr/_index.md | 16 ++-- .../wallet_importWifPrivKey/_index.md | 2 +- 7 files changed, 207 insertions(+), 43 deletions(-) diff --git a/Document/content/Wallet JSON RPC API/API List/wallet_getAccountByAddress/_index.en.md b/Document/content/Wallet JSON RPC API/API List/wallet_getAccountByAddress/_index.en.md index 6264a211..472bcb6e 100644 --- a/Document/content/Wallet JSON RPC API/API List/wallet_getAccountByAddress/_index.en.md +++ b/Document/content/Wallet JSON RPC API/API List/wallet_getAccountByAddress/_index.en.md @@ -2,3 +2,31 @@ title: wallet_getAccountByAddress weight: 3 --- + +### wallet_getAccountByAddress +Get owner account name of address + +#### Parameters +1. `addr: (string)` address + +#### Returns +1. `account name: (string)` owner account name + + +#### Example +##### Request +```sh + $ curl -sk -u "test:test" -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"1.0","method":"wallet_getAccountByAddress","params":["TmbC1Fx1UXNt7D6zpaj83UrAEW7MbcUWuQz"],"id":1}' http://127.0.0.1:8130/api |jq . + +``` +##### Response +```json + +{ + "jsonrpc": "2.0", + "id": 1, + "result": "test" +} + + +``` \ No newline at end of file diff --git a/Document/content/Wallet JSON RPC API/API List/wallet_getAccountsAndBalance/_index.md b/Document/content/Wallet JSON RPC API/API List/wallet_getAccountsAndBalance/_index.md index 8dc91cf2..840365c0 100644 --- a/Document/content/Wallet JSON RPC API/API List/wallet_getAccountsAndBalance/_index.md +++ b/Document/content/Wallet JSON RPC API/API List/wallet_getAccountsAndBalance/_index.md @@ -4,41 +4,56 @@ weight: 3 --- ### wallet_getAccountsAndBalance -获取所有的账号和余额 +list balance of all accounts #### Parameters +None #### Returns +`[account name]:(account)` +`account` +1. `TotalAmount: (numeric)` Total amount, spend amount+ spendable amount + frozen amount +2. `SpendAmount: (numeric)` spent amount, already confirmed +3. `UnspendAmount: (numeric)` spendable amount, not including frozen amount +4. `ConfirmAmount: (numeric)` frozen amount, waiting for conformation +... #### Example ##### Request -```json -{"jsonrpc":"1.0","method":"wallet_getAccountsAndBalance","params":[],"id":1 +```sh + $ curl -sk -u "test:test" -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"1.0","method":"wallet_getAccountsAndBalance","params":[],"id":1}' http://127.0.0.1:8130/api |jq . ``` ##### Response ```json { - "jsonrpc": "2.0", - "id": 1, - "result": { - "account": { - "TotalAmount": 0, - "SpendAmount": 0, - "UnspendAmount": 0, - "ConfirmAmount": 0 - }, - "default": { - "TotalAmount": 280000000000, - "SpendAmount": 0, - "UnspendAmount": 280000000000, - "ConfirmAmount": 0 - }, - "imported": { - "TotalAmount": 11172999678800, - "SpendAmount": 325000000000, - "UnspendAmount": 8754999678800, - "ConfirmAmount": 2418000000000 - } + "jsonrpc": "2.0", + "id": 1, + "result": { + "default": { + "TotalAmount": 0, + "SpendAmount": 0, + "UnspendAmount": 0, + "ConfirmAmount": 0 + }, + "imported": { + "TotalAmount": 676444792042, + "SpendAmount": 1366909827084, + "UnspendAmount": 676444792042, + "ConfirmAmount": 0 + }, + "test": { + "TotalAmount": 900000000, + "SpendAmount": 0, + "UnspendAmount": 900000000, + "ConfirmAmount": 0 + }, + "test_account": { + "TotalAmount": 0, + "SpendAmount": 0, + "UnspendAmount": 0, + "ConfirmAmount": 0 } + } } + diff --git a/Document/content/Wallet JSON RPC API/API List/wallet_getBalanceByAccount/_index.md b/Document/content/Wallet JSON RPC API/API List/wallet_getBalanceByAccount/_index.md index 5fe48beb..ab8ac8d1 100644 --- a/Document/content/Wallet JSON RPC API/API List/wallet_getBalanceByAccount/_index.md +++ b/Document/content/Wallet JSON RPC API/API List/wallet_getBalanceByAccount/_index.md @@ -4,12 +4,33 @@ weight: 3 --- ### wallet_getBalanceByAccount +Get balance by account #### Parameters +1. `account: (string)` account name #### Returns - +1. `TotalAmount: (numeric)` Total amount, spend amount+ spendable amount + frozen amount +2. `SpendAmount: (numeric)` spent amount, already confirmed +3. `UnspendAmount: (numeric)` spendable amount, not including frozen amount +4. `ConfirmAmount: (numeric)` frozen amount, waiting for conformation #### Example ##### Request -##### Response \ No newline at end of file +```sh + $ curl -sk -u "test:test" -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"1.0","method":"wallet_getBalanceByAccount","params":["test"],"id":1}' http://127.0.0.1:8130/api |jq . +``` +##### Response +```json +{ + "jsonrpc": "2.0", + "id": 1, + "result": { + "TotalAmount": 900000000, + "SpendAmount": 0, + "UnspendAmount": 900000000, + "ConfirmAmount": 0 + } +} + +``` \ No newline at end of file diff --git a/Document/content/Wallet JSON RPC API/API List/wallet_getBalanceByAddr/_index.md b/Document/content/Wallet JSON RPC API/API List/wallet_getBalanceByAddr/_index.md index d4c5814b..5fc3bd00 100644 --- a/Document/content/Wallet JSON RPC API/API List/wallet_getBalanceByAddr/_index.md +++ b/Document/content/Wallet JSON RPC API/API List/wallet_getBalanceByAddr/_index.md @@ -19,19 +19,21 @@ Get balance by address #### Example ##### Request -```json -{"jsonrpc":"1.0","method":"wallet_getBalanceByAddr","params":["TmfDniZnvsjdH98GsH4aetL3XQKFUTWPp4e",1],"id":16} +```sh +$ curl -k -u "test:test" -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"1.0","method":"wallet_getBalanceByAddr","params":["TmbC1Fx1UXNt7D6zpaj83UrAEW7MbcUWuQz"],"id":1}' http://127.0.0.1:8130/api + ``` ##### Response ```json { - "jsonrpc": "2.0", - "id": 16, - "result": { - "TotalAmount": 400000000, - "SpendAmount": 0, - "UnspendAmount": 400000000, - "ConfirmAmount": 0 - } + "jsonrpc": "2.0", + "id": 1, + "result": { + "TotalAmount": 900000000, + "SpendAmount": 0, + "UnspendAmount": 900000000, + "ConfirmAmount": 0 + } } + ``` \ No newline at end of file diff --git a/Document/content/Wallet JSON RPC API/API List/wallet_getBillByAddr/_index.en.md b/Document/content/Wallet JSON RPC API/API List/wallet_getBillByAddr/_index.en.md index c6dd81da..4965af79 100644 --- a/Document/content/Wallet JSON RPC API/API List/wallet_getBillByAddr/_index.en.md +++ b/Document/content/Wallet JSON RPC API/API List/wallet_getBillByAddr/_index.en.md @@ -2,3 +2,97 @@ title: wallet_getBillByAddr weight: 3 --- + +### wallet_getBillByAddr +request the bill of a specific address, a bill is the log of payments, which are the effects that a transaction makes on a specific address a payment can affect only ONE address + +#### Parameters +1. `addr: (string)` address +2. `filter: (numeric)` filter + * `0` received payments + * `1` sent payments + * `2` all payments +3. `page: (numeric)` page number + * `0` all pages +4. `page size: (numeric, 10)` page size + * `0` use default page size 10 + +#### Returns +`transactions: (array of TRANSACTION)` + +##### TRANSACTION +`hex: (hex string)` raw transaction +`txid: (hex string)` transaction ID +`txhash: (hex string)` transaction hash (differs from txid for witness transactions) +`size: (numeric)` size in byte +`version: (numeric)` version, used to check if protocol matches + +#### Example +##### Request +```sh +$ curl -sk -u "test:test" -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"1.0","method":"wallet_getTxListByAddr","params":["TmbC1Fx1UXNt7D6zpaj83UrAEW7MbcUWuQz", 2, 0, 0 ],"id":1}' http://127.0.0.1:8130/api |jq . + +``` +##### Response +```json +{ + "jsonrpc": "2.0", + "id": 1, + "result": { + "total": 1, + "page": 0, + "page_size": 0, + "transactions": [ + { + "hex": "0100000001b5c641e5b4d91a235a61aebe2417b2d9c57283a65517f5b764ce4ff03b086c0683010000ffffffff0200e9a435000000001976a91486439eb19afe8c091a01cbb3813b052f7fa3a08b88acdadf42069f0000001976a914a6b8fe2348fad076b7fd1b34b7e5b35db96dc2a088ac0000000000000000e33ffd5e016a473044022057ec222a8f2f1c7b0cc44d8c375a73bd0bab7816bfe263a527a0cce22c6e2aa8022078c4dfc7fd715732f2b54f7c2a3928bc247bdc2cf65537983c6cc5eaf1827185012103dc8928f91de8af790e7845d30b3b12871f4db39f35ffecfe3f10a1e3e648dc19", + "txid": "7a927f4c349e5c304e70febd0e6b31dde6037912513cdc22e20a5d3a9f68bb49", + "txhash": "6a6dd7bcbd472912654a794ba46c82ce775271a40621fc91ad176069ae638c43", + "size": 234, + "version": 1, + "locktime": 0, + "timestamp": "2020-07-02T06:01:07+04:00", + "expire": 0, + "vin": [ + { + "txid": "066c083bf04fce64b7f51755a68372c5d9b21724beae615a231ad9b4e541c6b5", + "vout": 387, + "sequence": 4294967295, + "scriptSig": { + "asm": "3044022057ec222a8f2f1c7b0cc44d8c375a73bd0bab7816bfe263a527a0cce22c6e2aa8022078c4dfc7fd715732f2b54f7c2a3928bc247bdc2cf65537983c6cc5eaf182718501 03dc8928f91de8af790e7845d30b3b12871f4db39f35ffecfe3f10a1e3e648dc19", + "hex": "473044022057ec222a8f2f1c7b0cc44d8c375a73bd0bab7816bfe263a527a0cce22c6e2aa8022078c4dfc7fd715732f2b54f7c2a3928bc247bdc2cf65537983c6cc5eaf1827185012103dc8928f91de8af790e7845d30b3b12871f4db39f35ffecfe3f10a1e3e648dc19" + } + } + ], + "vout": [ + { + "amount": 900000000, + "scriptPubKey": { + "asm": "OP_DUP OP_HASH160 86439eb19afe8c091a01cbb3813b052f7fa3a08b OP_EQUALVERIFY OP_CHECKSIG", + "hex": "76a91486439eb19afe8c091a01cbb3813b052f7fa3a08b88ac", + "reqSigs": 1, + "type": "pubkeyhash", + "addresses": [ + "TmbC1Fx1UXNt7D6zpaj83UrAEW7MbcUWuQz" + ] + } + }, + { + "amount": 683004846042, + "scriptPubKey": { + "asm": "OP_DUP OP_HASH160 a6b8fe2348fad076b7fd1b34b7e5b35db96dc2a0 OP_EQUALVERIFY OP_CHECKSIG", + "hex": "76a914a6b8fe2348fad076b7fd1b34b7e5b35db96dc2a088ac", + "reqSigs": 1, + "type": "pubkeyhash", + "addresses": [ + "Tme9dVJ4GeWRninBygrA6oDwCAGYbBvNxY7" + ] + } + } + ], + "blockhash": "e2ec97db55cff510e30f104e27c9fb687ef7c846fb025dcc1e08b671ee1a2f34", + "confirmations": 1141 + } + ] + } +} +``` \ No newline at end of file diff --git a/Document/content/Wallet JSON RPC API/API List/wallet_getTxListByAddr/_index.md b/Document/content/Wallet JSON RPC API/API List/wallet_getTxListByAddr/_index.md index 3500bc77..a066b9a2 100644 --- a/Document/content/Wallet JSON RPC API/API List/wallet_getTxListByAddr/_index.md +++ b/Document/content/Wallet JSON RPC API/API List/wallet_getTxListByAddr/_index.md @@ -4,14 +4,18 @@ weight: 3 --- ### wallet_getTxListByAddr -创建地址 +get transactions affecting specific address, one transaction could affect MULTIPLE addresses #### Parameters -1. `addr: (string)` 地址 -1. `type: (numeric)` 0: in tx; 1: out tx; 2: all tx -1. `page : (numeric)` 页号 -1. `pageSize`: (string)` 页大小 - +1. `addr: (string)` address +2. `filter: (numeric)` filter + * `0` received payments + * `1` sent payments + * `2` all payments +3. `page: (numeric)` page number + * `0` all pages +4. `page size: (numeric, 10)` page size + * `0` use default page size 10 #### Returns diff --git a/Document/content/Wallet JSON RPC API/API List/wallet_importWifPrivKey/_index.md b/Document/content/Wallet JSON RPC API/API List/wallet_importWifPrivKey/_index.md index 3023c6af..c139443a 100644 --- a/Document/content/Wallet JSON RPC API/API List/wallet_importWifPrivKey/_index.md +++ b/Document/content/Wallet JSON RPC API/API List/wallet_importWifPrivKey/_index.md @@ -1,5 +1,5 @@ --- -title: wallet_getAccountsAndBalance +title: wallet_importWifPrivKey weight: 3 --- From aa4fda5d5ad27a17ac87425e440c8e8054b51a44 Mon Sep 17 00:00:00 2001 From: forchain Date: Fri, 16 Oct 2020 12:49:36 +0800 Subject: [PATCH 52/69] wallet_sendToAddress --- .../API List/wallet_sendToAddress/_index.md | 35 +++++++++++++++---- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/Document/content/Wallet JSON RPC API/API List/wallet_sendToAddress/_index.md b/Document/content/Wallet JSON RPC API/API List/wallet_sendToAddress/_index.md index 00670e74..9da85716 100644 --- a/Document/content/Wallet JSON RPC API/API List/wallet_sendToAddress/_index.md +++ b/Document/content/Wallet JSON RPC API/API List/wallet_sendToAddress/_index.md @@ -1,16 +1,37 @@ - --- title: wallet_sendToAddress weight: 3 --- -### wallet_sendToAddress +## wallet_sendToAddress +sends the passed amount to the given address. + +**NOTE:** This function requires to the wallet to be unlocked. See [wallet_unlock](../wallet_unlock/) + +### Parameters +`address: (hex string)` the given address +`amount: (numeric)` passed amount + +### Returns +#### Success +`TxID: (hex string)` the TxID for the created transaction -#### Parameters +#### Error + `-32000` + `-13` Enter the wallet passphrase with walletpassphrase first -#### Returns +### Example +#### Request +```sh +$ curl -sk -u "test:test" -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"1.0","method":"wallet_sendToAddress","params":["Tmdcmmo7JqxxwHy6r46Sx2ZRbVF2dSjG9mm", 1 ],"id":1}' http://127.0.0.1:8130/api |jq . +``` -#### Example -##### Request -##### Response \ No newline at end of file +#### Response +```json +{ + "jsonrpc": "2.0", + "id": 1, + "result": "86140f1fa1e7d95707ec7e61748b91838e24a00ca8803f299c7caca591ff1af4" +} +``` \ No newline at end of file From 489728cfa443b2fb869fe8e410355f9100733330 Mon Sep 17 00:00:00 2001 From: forchain Date: Fri, 16 Oct 2020 13:15:05 +0800 Subject: [PATCH 53/69] wallet_sendToMany --- .../API List/wallet_sendToMany/_index.en.md | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/Document/content/Wallet JSON RPC API/API List/wallet_sendToMany/_index.en.md b/Document/content/Wallet JSON RPC API/API List/wallet_sendToMany/_index.en.md index 4bcf193e..0cef17c2 100644 --- a/Document/content/Wallet JSON RPC API/API List/wallet_sendToMany/_index.en.md +++ b/Document/content/Wallet JSON RPC API/API List/wallet_sendToMany/_index.en.md @@ -2,3 +2,37 @@ title: wallet_sendToMany weight: 3 --- + +## wallet_sendToMany +sends multiple amounts to multiple addresses using the provided account as a source of funds in a single transaction. Only funds with the default number of minimum confirmations will be used. + +**NOTE:** This function requires to the wallet to be unlocked. See the +WalletPassphrase function for more details. + +### Parameters +`addAmounts: (map[address:string]amount:numeric)` address to amount pairs + +### Returns +#### Success +`TxID: (hex string)` the TxID for the created transaction + +#### Error + `-32000` + `-13` Enter the wallet passphrase with walletpassphrase first + + +### Example +#### Request +```sh +$ curl -sk -u "test:test" -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"1.0","method":"wallet_sendToMany","params":[{"TmVLfSPy3NZY1uDjJka92hqpPJR9k2XztQb":0.9, "TmR1kwdfb6pyQRNoJJMU2M62qEqJzqXPNBw":0.99} ],"id":1}' http://127.0.0.1:8130/api |jq . + +``` + +#### Response +```json +{ + "jsonrpc": "2.0", + "id": 1, + "result": "75ea0ca21e7626941574df0d0d64e69793e806216d34cfd8400ef09249fc44c7" +} +``` \ No newline at end of file From a84b24a36d69be1f8fcc1d2b186a37ed8cad5d5e Mon Sep 17 00:00:00 2001 From: forchain Date: Fri, 16 Oct 2020 13:48:03 +0800 Subject: [PATCH 54/69] wallet_sendToAddressByAccount --- .../wallet_sendToAddressByAccount/_index.md | 44 ++++++++++++------- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/Document/content/Wallet JSON RPC API/API List/wallet_sendToAddressByAccount/_index.md b/Document/content/Wallet JSON RPC API/API List/wallet_sendToAddressByAccount/_index.md index b482e0a8..36b10e0e 100644 --- a/Document/content/Wallet JSON RPC API/API List/wallet_sendToAddressByAccount/_index.md +++ b/Document/content/Wallet JSON RPC API/API List/wallet_sendToAddressByAccount/_index.md @@ -3,30 +3,40 @@ title: wallet_sendToAddressByAccount weight: 3 --- -### wallet_sendToAddressByAccount -发送交易 +## wallet_sendToAddressByAccount +send passed amount using specific account -#### Parameters -1. `fromAccount: (string)` from account -2. `toAccount: (string)` to address -3. `amount: (string)` send amount coin -4. `comment: (string)` -5. `commentTo: (string)` -#### Returns +**NOTE:** This function requires to the wallet to be unlocked. See the +WalletPassphrase function for more details. +### Parameters +1. `accountName: (string)` from account +2. `addressStr: (string)` to address +3. `amount: (numeric)` send amount coin +4. `comment: (string)` not used, reserved for future use +5. `commentTo: (string)` not used, reserved for future use -#### Example -##### Request -```json -{"id":1574828051839,"method":"wallet_sendToAddressByAccount","params":["default","TmZu8zU1i6xbZMpLQZLMAJsyWHanZXUZtiV",800,"",""]} +### Returns +#### Success +`TxID: (hex string)` the TxID for the created transaction + +#### Error + `-32000` + `-13` Enter the wallet passphrase with walletpassphrase first + + +### Example +#### Request +```sh +$ curl -sk -u "test:test" -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"1.0","method":"wallet_sendToAddressByAccount","params":["test", "Tmb1dCAB8ixNC6d2VtdCYZuhXBVPbnRVi7y", 0.999, "", ""],"id":1}' http://127.0.0.1:8130/api |jq . ``` -##### Response +#### Response ```json { - "jsonrpc": "2.0", - "id": 1574828051839, - "result": "b1ff3645c374992313e66d504fdf4fd3f2006f9414b97a7e1f6382328cc74fb1" + "jsonrpc": "2.0", + "id": 1, + "result": "cfd933e4590a3cfbcf94e9220c77834fe8a869414c51e3bd0ce5af23592e80f9" } ``` From 7aab4b6e8e4155f47a888d1173dd9c5637060189 Mon Sep 17 00:00:00 2001 From: forchain Date: Sun, 18 Oct 2020 13:16:54 +0800 Subject: [PATCH 55/69] getTx, getUTxo, sendToAddress, sendToAddressByAccount, sendToMany --- .../API List/wallet_getTx/_index.md | 75 +++++++++++++++++++ .../API List/wallet_getUtxo/_index.md | 45 ++++++----- .../API List/wallet_sendToAddress/_index.md | 8 +- .../wallet_sendToAddressByAccount/_index.md | 12 +-- .../API List/wallet_sendToMany/_index.en.md | 5 +- 5 files changed, 116 insertions(+), 29 deletions(-) create mode 100644 Document/content/Wallet JSON RPC API/API List/wallet_getTx/_index.md diff --git a/Document/content/Wallet JSON RPC API/API List/wallet_getTx/_index.md b/Document/content/Wallet JSON RPC API/API List/wallet_getTx/_index.md new file mode 100644 index 00000000..fdb2be2e --- /dev/null +++ b/Document/content/Wallet JSON RPC API/API List/wallet_getTx/_index.md @@ -0,0 +1,75 @@ +--- +title: wallet_getTx +weight: 3 +--- + +## wallet_getTx +get transaction by ID + +### Parameters +1. `txID: (hex string)` transaction ID + +### Returns + +### Example +#### Request +```sh +$ curl -sk -u "test:test" -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"1.0","method":"wallet_getTx","params":["86140f1fa1e7d95707ec7e61748b91838e24a00ca8803f299c7caca591ff1af4"],"id":1}' http://127.0.0.1:8130/api |jq . +``` + +#### Response +```json +{ + "jsonrpc": "2.0", + "id": 1, + "result": { + "hex": "010000000149bb689f3a5d0ae222dc3c51127903e6dd316b0ebdfe704e305c9e344c7f927a00000000ffffffff0200e1f505000000001976a914a0e30372347bc1e945f5086b7bbeaa38d912dcfe88aca888ae2f000000001976a91486439eb19afe8c091a01cbb3813b052f7fa3a08b88ac00000000000000008215895f016a473044022038fc5c5fef1a7a3bb0117b53556137c75dd9f4970387f2fc2c28c65d30655cea022077eeb7f1a105d9b9353517dc19c6af9ae953a875986bbbe7f5e69cfb3f8a78b2012102e8d120c3c729e636fe2909b02c65c025cb7f3f57d9891f4f566dd4724e82eb92", + "txid": "86140f1fa1e7d95707ec7e61748b91838e24a00ca8803f299c7caca591ff1af4", + "txhash": "9f3b9d8bf6f893c3b66ef5cd09d73ef3551b93c87d706bedda6ba4a104d469e0", + "size": 234, + "version": 1, + "locktime": 0, + "timestamp": "2020-10-16T11:37:38+08:00", + "expire": 0, + "vin": [ + { + "txid": "7a927f4c349e5c304e70febd0e6b31dde6037912513cdc22e20a5d3a9f68bb49", + "vout": 0, + "sequence": 4294967295, + "scriptSig": { + "asm": "3044022038fc5c5fef1a7a3bb0117b53556137c75dd9f4970387f2fc2c28c65d30655cea022077eeb7f1a105d9b9353517dc19c6af9ae953a875986bbbe7f5e69cfb3f8a78b201 02e8d120c3c729e636fe2909b02c65c025cb7f3f57d9891f4f566dd4724e82eb92", + "hex": "473044022038fc5c5fef1a7a3bb0117b53556137c75dd9f4970387f2fc2c28c65d30655cea022077eeb7f1a105d9b9353517dc19c6af9ae953a875986bbbe7f5e69cfb3f8a78b2012102e8d120c3c729e636fe2909b02c65c025cb7f3f57d9891f4f566dd4724e82eb92" + } + } + ], + "vout": [ + { + "amount": 100000000, + "scriptPubKey": { + "asm": "OP_DUP OP_HASH160 a0e30372347bc1e945f5086b7bbeaa38d912dcfe OP_EQUALVERIFY OP_CHECKSIG", + "hex": "76a914a0e30372347bc1e945f5086b7bbeaa38d912dcfe88ac", + "reqSigs": 1, + "type": "pubkeyhash", + "addresses": [ + "Tmdcmmo7JqxxwHy6r46Sx2ZRbVF2dSjG9mm" + ] + } + }, + { + "amount": 799967400, + "scriptPubKey": { + "asm": "OP_DUP OP_HASH160 86439eb19afe8c091a01cbb3813b052f7fa3a08b OP_EQUALVERIFY OP_CHECKSIG", + "hex": "76a91486439eb19afe8c091a01cbb3813b052f7fa3a08b88ac", + "reqSigs": 1, + "type": "pubkeyhash", + "addresses": [ + "TmbC1Fx1UXNt7D6zpaj83UrAEW7MbcUWuQz" + ] + } + } + ], + "blockhash": "2a215f23d2d4269ee235d730049cbdd18721de11b58e56fe29859f77f64ef82c", + "confirmations": 12 + } +} +``` \ No newline at end of file diff --git a/Document/content/Wallet JSON RPC API/API List/wallet_getUtxo/_index.md b/Document/content/Wallet JSON RPC API/API List/wallet_getUtxo/_index.md index 6f475833..a30db982 100644 --- a/Document/content/Wallet JSON RPC API/API List/wallet_getUtxo/_index.md +++ b/Document/content/Wallet JSON RPC API/API List/wallet_getUtxo/_index.md @@ -1,31 +1,38 @@ - --- title: wallet_getUtxo weight: 3 --- -### wallet_getUtxo -获取指定地址可用 UTXO +## wallet_getUtxo +get UTXOs of specific address -#### Parameters -1. `addr: (string)` 地址 +### Parameters +1. `addr: (string)` address -#### Returns +### Returns + +### Example +#### Request +```sh +$ curl -sk -u "test:test" -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"1.0","method":"wallet_getUTxo","params":["Tme9dVJ4GeWRninBygrA6oDwCAGYbBvNxY7"],"id":1}' http://127.0.0.1:8130/api |jq . -#### Example -##### Request -```json -{"jsonrpc":"1.0","method":"wallet_getUTXO","params":["TmgD1mu8zMMV9aWmJrXqQYnWRhR9SBfDZG6"],"id":1} ``` -##### Response +#### Response ```json { - "jsonrpc": "2.0", - "id": 1, - "result": [{ - "Txid": "54c47af3a17201c64a8f3b27164d4e09e8e38e05501b16bfd4f001caeddfa86a", - "Index": 1, - "Amount": 699925600 - }] -}} + "jsonrpc": "2.0", + "id": 1, + "result": [ + { + "TxId": "6838ccafe8747007e9dcb918852833d5867ca4cdf5e48e2c419c0ff61927403b", + "Index": 0, + "Amount": 100000000 + }, + { + "TxId": "83f481422d30ad3587afa78c36e1a2d29a28813528ad24f347c5845c32148ade", + "Index": 1, + "Amount": 676344792042 + } + ] +} ``` \ No newline at end of file diff --git a/Document/content/Wallet JSON RPC API/API List/wallet_sendToAddress/_index.md b/Document/content/Wallet JSON RPC API/API List/wallet_sendToAddress/_index.md index 9da85716..c405417b 100644 --- a/Document/content/Wallet JSON RPC API/API List/wallet_sendToAddress/_index.md +++ b/Document/content/Wallet JSON RPC API/API List/wallet_sendToAddress/_index.md @@ -6,11 +6,13 @@ weight: 3 ## wallet_sendToAddress sends the passed amount to the given address. -**NOTE:** This function requires to the wallet to be unlocked. See [wallet_unlock](../wallet_unlock/) +### NOTE +* This function requires to the wallet to be unlocked. See [wallet_unlock](../wallet_unlock/) +* The amount cannot exceed 21,000,000 ### Parameters -`address: (hex string)` the given address -`amount: (numeric)` passed amount +1. `address: (hex string)` the given address +2. `amount: (numeric)` passed amount ### Returns #### Success diff --git a/Document/content/Wallet JSON RPC API/API List/wallet_sendToAddressByAccount/_index.md b/Document/content/Wallet JSON RPC API/API List/wallet_sendToAddressByAccount/_index.md index 36b10e0e..c4704c6a 100644 --- a/Document/content/Wallet JSON RPC API/API List/wallet_sendToAddressByAccount/_index.md +++ b/Document/content/Wallet JSON RPC API/API List/wallet_sendToAddressByAccount/_index.md @@ -6,9 +6,9 @@ weight: 3 ## wallet_sendToAddressByAccount send passed amount using specific account - -**NOTE:** This function requires to the wallet to be unlocked. See the -WalletPassphrase function for more details. +### NOTE +* This function requires to the wallet to be unlocked. See [wallet_unlock](../wallet_unlock/) +* The amount cannot exceed 21,000,000 ### Parameters 1. `accountName: (string)` from account @@ -22,8 +22,10 @@ WalletPassphrase function for more details. `TxID: (hex string)` the TxID for the created transaction #### Error - `-32000` - `-13` Enter the wallet passphrase with walletpassphrase first +`-32000` +1. `-13` Enter the wallet passphrase with walletpassphrase first +2. `-32603` transaction output amount exceeds maximum value +3. `-32603` balance is not enough,please deduct the service charge ### Example diff --git a/Document/content/Wallet JSON RPC API/API List/wallet_sendToMany/_index.en.md b/Document/content/Wallet JSON RPC API/API List/wallet_sendToMany/_index.en.md index 0cef17c2..f53faf85 100644 --- a/Document/content/Wallet JSON RPC API/API List/wallet_sendToMany/_index.en.md +++ b/Document/content/Wallet JSON RPC API/API List/wallet_sendToMany/_index.en.md @@ -6,8 +6,9 @@ weight: 3 ## wallet_sendToMany sends multiple amounts to multiple addresses using the provided account as a source of funds in a single transaction. Only funds with the default number of minimum confirmations will be used. -**NOTE:** This function requires to the wallet to be unlocked. See the -WalletPassphrase function for more details. +### NOTE +* This function requires to the wallet to be unlocked. See [wallet_unlock](../wallet_unlock/) +* The amount cannot exceed 21,000,000 ### Parameters `addAmounts: (map[address:string]amount:numeric)` address to amount pairs From 533b92e9c0012dbd6c5ab8987b5b9a637296f29c Mon Sep 17 00:00:00 2001 From: Alex Wu Date: Thu, 3 Dec 2020 09:17:57 +0800 Subject: [PATCH 56/69] Update _index.en.md --- .../tutorials/qitmeer-installation/_index.en.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Document/content/tutorials/qitmeer-installation/_index.en.md b/Document/content/tutorials/qitmeer-installation/_index.en.md index b5ac7a0e..141274d9 100644 --- a/Document/content/tutorials/qitmeer-installation/_index.en.md +++ b/Document/content/tutorials/qitmeer-installation/_index.en.md @@ -69,8 +69,11 @@ git clone https://github.com/Qitmeer/qitmeer ~//github.com/Qitmeer/qitmeer ```shell cd ~//github.com/Qitmeer/qitmeer git pull -go build +make +Done building. + qitmeer version 0.9.2+dev-7478571 (Go version go1.15.5)) +Run "./build/bin/qitmeer" to launch. + # once needs cleaning data or problems happened, please uncomment this line to clean data -# ./qitmeer --testnet -L -./qitmeer --testnet --notls --rpcuser=test --rpcpass=test -``` \ No newline at end of file +./build/bin/qitmeer --testnet --notls --rpcuser=test --rpcpass=test +``` From 3bcdbf31f495573a957ae84686d095f9b80d8075 Mon Sep 17 00:00:00 2001 From: forchain Date: Thu, 3 Dec 2020 22:30:00 +0800 Subject: [PATCH 57/69] make seed --- .../API List/ui_makeSeed/_index.en.md | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/Document/content/Wallet JSON RPC API/API List/ui_makeSeed/_index.en.md b/Document/content/Wallet JSON RPC API/API List/ui_makeSeed/_index.en.md index 01ec409c..03cbdd0f 100644 --- a/Document/content/Wallet JSON RPC API/API List/ui_makeSeed/_index.en.md +++ b/Document/content/Wallet JSON RPC API/API List/ui_makeSeed/_index.en.md @@ -3,3 +3,34 @@ title: ui_makeSeed weight: 3 --- + +## MakeSeed + make wallet HD seed and mnemonic + +### Parameters + +### Returns +#### Success +1. `seed: (hex string)` a cryptographically secure random seed +2. `mnemonic: (array of string)` the mnemonic words for the given seed + + +### Example +#### Request +```sh +curl -sku "test:test" -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"1.0","method":"ui_makeSeed","params":[],"id":1}' http://127.0.0.1:8130/api | jq +``` +#### Response +```json +{ + "jsonrpc": "2.0", + "id": 1, + "result": { + "seed": "0d82f3214e900c039c8e05c04bef5f22bdf5804344e69e8f7426e90fabb0eb178a8c4f99850c77be09f609b7145799fb0772c1c0c1087acd55868240755a437a", + "mnemonic": "river immense robust crucial patrol kingdom trick enter jacket similar feed pitch juice focus ramp merry occur blast pepper case gentle left sea margin" + } +} + +``` + + From a0e5abe7940557876b6f95e1b921f728f7986b64 Mon Sep 17 00:00:00 2001 From: forchain Date: Thu, 3 Dec 2020 22:38:25 +0800 Subject: [PATCH 58/69] wallet status --- .../API List/ui_walletStatus/_index.en.md | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/Document/content/Wallet JSON RPC API/API List/ui_walletStatus/_index.en.md b/Document/content/Wallet JSON RPC API/API List/ui_walletStatus/_index.en.md index d819af83..d75638d8 100644 --- a/Document/content/Wallet JSON RPC API/API List/ui_walletStatus/_index.en.md +++ b/Document/content/Wallet JSON RPC API/API List/ui_walletStatus/_index.en.md @@ -3,3 +3,37 @@ title: ui_walletStatus weight: 3 --- + +## WalletStatus + wallet info + +### Parameters + +### Returns +#### Success +1. `status: (string)` + 1. err - error happened + 2. nil - wallet not exists + 3. closed - wallet closed + 4. lock - wallet locked + 5. unlock - wallet unlocked + + +### Example +#### Request +```sh +curl -sku "test:test" -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"1.0","method":"ui_walletStatus","params":[],"id":1}' http://127.0.0.1:8130/api | jq + +``` +#### Response +```json +{ + "jsonrpc": "2.0", + "id": 1, + "result": { + "stats": "lock" + } +} +``` + + From a283b8e11177f9fc2e0927cd8079c115be8c0fc5 Mon Sep 17 00:00:00 2001 From: forchain Date: Fri, 4 Dec 2020 10:19:16 +0800 Subject: [PATCH 59/69] create wallet, recover wallet --- .../API List/ui_createWallet/_index.en.md | 15 +++++--- .../API List/ui_recoverWallet/_index.en.md | 36 ++++++++++++++++++- 2 files changed, 46 insertions(+), 5 deletions(-) diff --git a/Document/content/Wallet JSON RPC API/API List/ui_createWallet/_index.en.md b/Document/content/Wallet JSON RPC API/API List/ui_createWallet/_index.en.md index 890ea119..bc99c8f5 100644 --- a/Document/content/Wallet JSON RPC API/API List/ui_createWallet/_index.en.md +++ b/Document/content/Wallet JSON RPC API/API List/ui_createWallet/_index.en.md @@ -7,24 +7,31 @@ weight: 3 create wallet by seed ### Parameters -1. `name: (string)` account name +1. `seed: (string)` seed +2. `walletPass: (string)` wallet password +3. `unlockPass: (string)` unlock password ### Returns #### Success `null` #### Error -`-32000` Creating an account requires the wallet to be unlocked. Enter the wallet passphrase with walletpassphrase to unlock +`-32000` wallet exist ### Example #### Request ```shell -curl -k -u "test:test" -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"1.0","method":"wallet_createAccount","params":["test_account"],"id":1}' http://127.0.0.1:8130/api + curl -sku "test:test" -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"1.0","method":"ui_createWallet","params":["0d82f3214e900c039c8e05c04bef5f22bdf5804344e69e8f7426e90fabb0eb178a8c4f99850c77be09f609b7145799fb0772c1c0c1087acd55868240755a437a", "walletPass", "unlockPass"],"id":1}' http://127.0.0.1:8130/api | jq ``` #### Response ```sh -{"jsonrpc":"2.0","id":1,"result":null} +{ + "jsonrpc": "2.0", + "id": 1, + "result": null +} + ``` diff --git a/Document/content/Wallet JSON RPC API/API List/ui_recoverWallet/_index.en.md b/Document/content/Wallet JSON RPC API/API List/ui_recoverWallet/_index.en.md index 3952959c..f41d3d3a 100644 --- a/Document/content/Wallet JSON RPC API/API List/ui_recoverWallet/_index.en.md +++ b/Document/content/Wallet JSON RPC API/API List/ui_recoverWallet/_index.en.md @@ -1,5 +1,39 @@ - --- title: ui_recoverWallet weight: 3 --- + +## RecoverWallet + Recover Wallet wallet by mnemonic + +### Parameters +1. `mnemonic: (hex string)` the mnemonic words +2. `walletPass: (string)` wallet password +3. `unlockPass: (string)` unlock password + +### Returns +#### Success +`null` + +#### Error +`-32000` + 1. seed hex err: Invalid menomic + 2. wallet exist + +### Example +#### Request +```sh +curl -sku "test:test" -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"1.0","method":"ui_recoverWallet","params":["river immense robust crucial patrol kingdom trick enter jacket similar feed pitch juice focus ramp merry occur blast pepper case gentle left sea margin", "walletPass", "unlockPass"],"id":1}' http://127.0.0.1:8130/api | jq + +``` +#### Response +```json +{ + "jsonrpc": "2.0", + "id": 1, + "result": null +} + +``` + + From a31b5ab5cd37c5f2132c2b49ef56209d13617f8e Mon Sep 17 00:00:00 2001 From: forchain Date: Fri, 4 Dec 2020 11:55:00 +0800 Subject: [PATCH 60/69] restructure wallet API --- Document/content/JSON RPC API/_index.en.md | 1 + .../Wallet JSON RPC API/API List/_index.en.md | 43 ------------------- .../API List/qitmeerd_reset/_index.en.md | 5 --- .../API List/qitmeerd_update/_index.en.md | 5 --- .../API List/ui_openWallet/_index.en.md | 5 --- .../Wallet JSON RPC API/Errors/_index.en.md | 4 -- .../Wallet JSON RPC API/QitmeerD/_index.en.md | 15 +++++++ .../qitmeed_add => QitmeerD/add}/_index.en.md | 2 +- .../qitmeed_del => QitmeerD/del}/_index.en.md | 2 +- .../list}/_index.en.md | 2 +- .../QitmeerD/reset/_index.en.md | 5 +++ .../status}/_index.en.md | 2 +- .../QitmeerD/update/_index.en.md | 5 +++ .../Wallet JSON RPC API/UI/_index.en.md | 23 ++++++++++ .../createWallet}/_index.en.md | 4 +- .../ui_makeSeed => UI/makeSeed}/_index.en.md | 4 +- .../recoverWallet}/_index.en.md | 4 +- .../walletStatus}/_index.en.md | 4 +- .../Wallet JSON RPC API/Wallet/_index.en.md | 32 ++++++++++++++ .../createAccount}/_index.en.md | 4 +- .../createAddress}/_index.md | 4 +- .../dumpPrivKey}/_index.md | 2 +- .../getAccountByAddress}/_index.en.md | 2 +- .../getAccountsAndBalance}/_index.md | 2 +- .../getAddressesByAccount}/_index.md | 2 +- .../getBalanceByAccount}/_index.md | 2 +- .../getBalanceByAddr}/_index.md | 2 +- .../getBillByAddr}/_index.en.md | 2 +- .../wallet_getTx => Wallet/getTx}/_index.md | 2 +- .../getTxListByAddr}/_index.md | 2 +- .../getUTXO}/_index.md | 2 +- .../importPrivKey}/_index.md | 4 +- .../importWifPrivKey}/_index.md | 2 +- .../wallet_lock => Wallet/lock}/_index.md | 4 +- .../sendToAddress}/_index.md | 2 +- .../sendToAddressByAccount}/_index.md | 2 +- .../sendToMany}/_index.en.md | 2 +- .../syncStats}/_index.md | 2 +- .../unlock}/_index.en.md | 2 +- .../content/Wallet JSON RPC API/_index.en.md | 6 ++- 40 files changed, 121 insertions(+), 100 deletions(-) delete mode 100644 Document/content/Wallet JSON RPC API/API List/_index.en.md delete mode 100644 Document/content/Wallet JSON RPC API/API List/qitmeerd_reset/_index.en.md delete mode 100644 Document/content/Wallet JSON RPC API/API List/qitmeerd_update/_index.en.md delete mode 100644 Document/content/Wallet JSON RPC API/API List/ui_openWallet/_index.en.md delete mode 100644 Document/content/Wallet JSON RPC API/Errors/_index.en.md create mode 100644 Document/content/Wallet JSON RPC API/QitmeerD/_index.en.md rename Document/content/Wallet JSON RPC API/{API List/qitmeed_add => QitmeerD/add}/_index.en.md (86%) rename Document/content/Wallet JSON RPC API/{API List/qitmeed_del => QitmeerD/del}/_index.en.md (86%) rename Document/content/Wallet JSON RPC API/{API List/qitmeed_list => QitmeerD/list}/_index.en.md (86%) create mode 100644 Document/content/Wallet JSON RPC API/QitmeerD/reset/_index.en.md rename Document/content/Wallet JSON RPC API/{API List/qitmeerd_status => QitmeerD/status}/_index.en.md (85%) create mode 100644 Document/content/Wallet JSON RPC API/QitmeerD/update/_index.en.md create mode 100644 Document/content/Wallet JSON RPC API/UI/_index.en.md rename Document/content/Wallet JSON RPC API/{API List/ui_createWallet => UI/createWallet}/_index.en.md (94%) rename Document/content/Wallet JSON RPC API/{API List/ui_makeSeed => UI/makeSeed}/_index.en.md (96%) rename Document/content/Wallet JSON RPC API/{API List/ui_recoverWallet => UI/recoverWallet}/_index.en.md (95%) rename Document/content/Wallet JSON RPC API/{API List/ui_walletStatus => UI/walletStatus}/_index.en.md (97%) create mode 100644 Document/content/Wallet JSON RPC API/Wallet/_index.en.md rename Document/content/Wallet JSON RPC API/{API List/wallet_createAccount => Wallet/createAccount}/_index.en.md (95%) rename Document/content/Wallet JSON RPC API/{API List/wallet_createAddress => Wallet/createAddress}/_index.md (92%) rename Document/content/Wallet JSON RPC API/{API List/wallet_dumpPrivKey => Wallet/dumpPrivKey}/_index.md (91%) rename Document/content/Wallet JSON RPC API/{API List/wallet_getAccountByAddress => Wallet/getAccountByAddress}/_index.en.md (94%) rename Document/content/Wallet JSON RPC API/{API List/wallet_getAccountsAndBalance => Wallet/getAccountsAndBalance}/_index.md (97%) rename Document/content/Wallet JSON RPC API/{API List/wallet_getAddressesByAccount => Wallet/getAddressesByAccount}/_index.md (93%) rename Document/content/Wallet JSON RPC API/{API List/wallet_getBalanceByAccount => Wallet/getBalanceByAccount}/_index.md (96%) rename Document/content/Wallet JSON RPC API/{API List/wallet_getBalanceByAddr => Wallet/getBalanceByAddr}/_index.md (96%) rename Document/content/Wallet JSON RPC API/{API List/wallet_getBillByAddr => Wallet/getBillByAddr}/_index.en.md (99%) rename Document/content/Wallet JSON RPC API/{API List/wallet_getTx => Wallet/getTx}/_index.md (99%) rename Document/content/Wallet JSON RPC API/{API List/wallet_getTxListByAddr => Wallet/getTxListByAddr}/_index.md (97%) rename Document/content/Wallet JSON RPC API/{API List/wallet_getUtxo => Wallet/getUTXO}/_index.md (97%) rename Document/content/Wallet JSON RPC API/{API List/wallet_importPrivKey => Wallet/importPrivKey}/_index.md (95%) rename Document/content/Wallet JSON RPC API/{API List/wallet_importWifPrivKey => Wallet/importWifPrivKey}/_index.md (91%) rename Document/content/Wallet JSON RPC API/{API List/wallet_lock => Wallet/lock}/_index.md (90%) rename Document/content/Wallet JSON RPC API/{API List/wallet_sendToAddress => Wallet/sendToAddress}/_index.md (96%) rename Document/content/Wallet JSON RPC API/{API List/wallet_sendToAddressByAccount => Wallet/sendToAddressByAccount}/_index.md (97%) rename Document/content/Wallet JSON RPC API/{API List/wallet_sendToMany => Wallet/sendToMany}/_index.en.md (97%) rename Document/content/Wallet JSON RPC API/{API List/wallet_syncStats => Wallet/syncStats}/_index.md (92%) rename Document/content/Wallet JSON RPC API/{API List/wallet_unlock => Wallet/unlock}/_index.en.md (97%) diff --git a/Document/content/JSON RPC API/_index.en.md b/Document/content/JSON RPC API/_index.en.md index 36c6489d..9886fd8f 100644 --- a/Document/content/JSON RPC API/_index.en.md +++ b/Document/content/JSON RPC API/_index.en.md @@ -40,6 +40,7 @@ weight: 5 - [getRawTransaction](getrawtransaction) - [getUtxo](getutxo) - [sendRawTransaction](sendrawtransaction) +- [txSign](txSign) diff --git a/Document/content/Wallet JSON RPC API/API List/_index.en.md b/Document/content/Wallet JSON RPC API/API List/_index.en.md deleted file mode 100644 index e4feb29f..00000000 --- a/Document/content/Wallet JSON RPC API/API List/_index.en.md +++ /dev/null @@ -1,43 +0,0 @@ ---- -title: API List -weight: 2 ---- - -## Wallet - - [createAccount](wallet_createaccount) - - [createAddress](wallet_createaddress) - - [importPrivKey](wallet_importprivkey) - - [importWIFPrivKey](wallet_importwifprivkey) - - [dumpPrivKey](wallet_dumpprivkey) - - - [sendToAddress](wallet_sendtoaddress) - - [sendToAddressByAccount](wallet_sendtoaddressbyaccount) - - [sendToMany](wallet_sendtomany) - - - [getAccountByAddress](wallet_getaccountbyaddress) - - [getAccountsAndBalance](wallet_getaccountsandbalance) - - [getAddressesByAccount](wallet_getaddressesbyaccount) - - [getBalanceByAccount](wallet_getbalancebyaccount) - - [getBalanceByAddr](wallet_getbalancebyaddr) - - [getBillByAddr](wallet_getbillbyaddr) - - [getTxListByAddr](wallet_gettxlistbyaddr) - - [getUTXO](wallet_getutxo) - - - [lock](wallet_lock) - - [syncStats](wallet_syncstats) - - [unlock](wallet_unlock) - -## UI - - [openWallet](ui_openwallet) - - [createWallet](ui_createwallet) - - [makeSeed](ui_makeseed) - - [walletStatus](ui_walletstatus) - - [recoverWallet](ui_recoverwallet) - -## QitmeerD - - [add](qitmeed_add) - - [del](qitmeed_del) - - [list](qitmeed_list) - - [reset](qitmeerd_reset) - - [status](qitmeerd_status) - - [update](qitmeerd_update) \ No newline at end of file diff --git a/Document/content/Wallet JSON RPC API/API List/qitmeerd_reset/_index.en.md b/Document/content/Wallet JSON RPC API/API List/qitmeerd_reset/_index.en.md deleted file mode 100644 index e24f55e1..00000000 --- a/Document/content/Wallet JSON RPC API/API List/qitmeerd_reset/_index.en.md +++ /dev/null @@ -1,5 +0,0 @@ - ---- -title: qitmeerd_reset -weight: 3 ---- diff --git a/Document/content/Wallet JSON RPC API/API List/qitmeerd_update/_index.en.md b/Document/content/Wallet JSON RPC API/API List/qitmeerd_update/_index.en.md deleted file mode 100644 index c5a3c63d..00000000 --- a/Document/content/Wallet JSON RPC API/API List/qitmeerd_update/_index.en.md +++ /dev/null @@ -1,5 +0,0 @@ - ---- -title: qitmeerd_update -weight: 3 ---- diff --git a/Document/content/Wallet JSON RPC API/API List/ui_openWallet/_index.en.md b/Document/content/Wallet JSON RPC API/API List/ui_openWallet/_index.en.md deleted file mode 100644 index 5081aae7..00000000 --- a/Document/content/Wallet JSON RPC API/API List/ui_openWallet/_index.en.md +++ /dev/null @@ -1,5 +0,0 @@ - ---- -title: ui_openWallet -weight: 3 ---- diff --git a/Document/content/Wallet JSON RPC API/Errors/_index.en.md b/Document/content/Wallet JSON RPC API/Errors/_index.en.md deleted file mode 100644 index 204c2495..00000000 --- a/Document/content/Wallet JSON RPC API/Errors/_index.en.md +++ /dev/null @@ -1,4 +0,0 @@ ---- -title: Errors -weight: 9 ---- \ No newline at end of file diff --git a/Document/content/Wallet JSON RPC API/QitmeerD/_index.en.md b/Document/content/Wallet JSON RPC API/QitmeerD/_index.en.md new file mode 100644 index 00000000..73c3f2f4 --- /dev/null +++ b/Document/content/Wallet JSON RPC API/QitmeerD/_index.en.md @@ -0,0 +1,15 @@ +--- +title: QitmeerD API +weight: 2 +--- + +## Overview +API for qitmeer daemon + +## QitmeerD + - [add](add) + - [del](del) + - [list](list) + - [reset](reset) + - [status](status) + - [update](update) \ No newline at end of file diff --git a/Document/content/Wallet JSON RPC API/API List/qitmeed_add/_index.en.md b/Document/content/Wallet JSON RPC API/QitmeerD/add/_index.en.md similarity index 86% rename from Document/content/Wallet JSON RPC API/API List/qitmeed_add/_index.en.md rename to Document/content/Wallet JSON RPC API/QitmeerD/add/_index.en.md index 2fe7e757..1580ecea 100644 --- a/Document/content/Wallet JSON RPC API/API List/qitmeed_add/_index.en.md +++ b/Document/content/Wallet JSON RPC API/QitmeerD/add/_index.en.md @@ -1,5 +1,5 @@ --- -title: qitmeed_add +title: add weight: 3 --- diff --git a/Document/content/Wallet JSON RPC API/API List/qitmeed_del/_index.en.md b/Document/content/Wallet JSON RPC API/QitmeerD/del/_index.en.md similarity index 86% rename from Document/content/Wallet JSON RPC API/API List/qitmeed_del/_index.en.md rename to Document/content/Wallet JSON RPC API/QitmeerD/del/_index.en.md index 2dda161f..c34cbef5 100644 --- a/Document/content/Wallet JSON RPC API/API List/qitmeed_del/_index.en.md +++ b/Document/content/Wallet JSON RPC API/QitmeerD/del/_index.en.md @@ -1,5 +1,5 @@ --- -title: qitmeed_del +title: del weight: 3 --- diff --git a/Document/content/Wallet JSON RPC API/API List/qitmeed_list/_index.en.md b/Document/content/Wallet JSON RPC API/QitmeerD/list/_index.en.md similarity index 86% rename from Document/content/Wallet JSON RPC API/API List/qitmeed_list/_index.en.md rename to Document/content/Wallet JSON RPC API/QitmeerD/list/_index.en.md index e96abf7e..2fa53f4c 100644 --- a/Document/content/Wallet JSON RPC API/API List/qitmeed_list/_index.en.md +++ b/Document/content/Wallet JSON RPC API/QitmeerD/list/_index.en.md @@ -1,5 +1,5 @@ --- -title: qitmeed_list +title: list weight: 3 --- diff --git a/Document/content/Wallet JSON RPC API/QitmeerD/reset/_index.en.md b/Document/content/Wallet JSON RPC API/QitmeerD/reset/_index.en.md new file mode 100644 index 00000000..f1cc31a7 --- /dev/null +++ b/Document/content/Wallet JSON RPC API/QitmeerD/reset/_index.en.md @@ -0,0 +1,5 @@ + +--- +title: reset +weight: 3 +--- diff --git a/Document/content/Wallet JSON RPC API/API List/qitmeerd_status/_index.en.md b/Document/content/Wallet JSON RPC API/QitmeerD/status/_index.en.md similarity index 85% rename from Document/content/Wallet JSON RPC API/API List/qitmeerd_status/_index.en.md rename to Document/content/Wallet JSON RPC API/QitmeerD/status/_index.en.md index c809130c..57985bf9 100644 --- a/Document/content/Wallet JSON RPC API/API List/qitmeerd_status/_index.en.md +++ b/Document/content/Wallet JSON RPC API/QitmeerD/status/_index.en.md @@ -1,5 +1,5 @@ --- -title: qitmeed_status +title: status weight: 3 --- diff --git a/Document/content/Wallet JSON RPC API/QitmeerD/update/_index.en.md b/Document/content/Wallet JSON RPC API/QitmeerD/update/_index.en.md new file mode 100644 index 00000000..ee1aa473 --- /dev/null +++ b/Document/content/Wallet JSON RPC API/QitmeerD/update/_index.en.md @@ -0,0 +1,5 @@ + +--- +title: update +weight: 3 +--- diff --git a/Document/content/Wallet JSON RPC API/UI/_index.en.md b/Document/content/Wallet JSON RPC API/UI/_index.en.md new file mode 100644 index 00000000..aebec853 --- /dev/null +++ b/Document/content/Wallet JSON RPC API/UI/_index.en.md @@ -0,0 +1,23 @@ +--- +title: UI API +weight: 2 +--- + +## Overview +Web UI API + +### Note +required `ui` config enabled + +```sh +ui=true +``` + + + + +## UI + - [createWallet](createwallet) + - [makeSeed](makeseed) + - [walletStatus](walletstatus) + - [recoverWallet](recoverwallet) \ No newline at end of file diff --git a/Document/content/Wallet JSON RPC API/API List/ui_createWallet/_index.en.md b/Document/content/Wallet JSON RPC API/UI/createWallet/_index.en.md similarity index 94% rename from Document/content/Wallet JSON RPC API/API List/ui_createWallet/_index.en.md rename to Document/content/Wallet JSON RPC API/UI/createWallet/_index.en.md index bc99c8f5..e7287b63 100644 --- a/Document/content/Wallet JSON RPC API/API List/ui_createWallet/_index.en.md +++ b/Document/content/Wallet JSON RPC API/UI/createWallet/_index.en.md @@ -1,9 +1,9 @@ --- -title: ui_createWallet +title: createWallet weight: 3 --- -## CreateWallet +## ui_createWallet create wallet by seed ### Parameters diff --git a/Document/content/Wallet JSON RPC API/API List/ui_makeSeed/_index.en.md b/Document/content/Wallet JSON RPC API/UI/makeSeed/_index.en.md similarity index 96% rename from Document/content/Wallet JSON RPC API/API List/ui_makeSeed/_index.en.md rename to Document/content/Wallet JSON RPC API/UI/makeSeed/_index.en.md index 03cbdd0f..110e6516 100644 --- a/Document/content/Wallet JSON RPC API/API List/ui_makeSeed/_index.en.md +++ b/Document/content/Wallet JSON RPC API/UI/makeSeed/_index.en.md @@ -1,10 +1,10 @@ --- -title: ui_makeSeed +title: makeSeed weight: 3 --- -## MakeSeed +## ui_makeSeed make wallet HD seed and mnemonic ### Parameters diff --git a/Document/content/Wallet JSON RPC API/API List/ui_recoverWallet/_index.en.md b/Document/content/Wallet JSON RPC API/UI/recoverWallet/_index.en.md similarity index 95% rename from Document/content/Wallet JSON RPC API/API List/ui_recoverWallet/_index.en.md rename to Document/content/Wallet JSON RPC API/UI/recoverWallet/_index.en.md index f41d3d3a..3230375b 100644 --- a/Document/content/Wallet JSON RPC API/API List/ui_recoverWallet/_index.en.md +++ b/Document/content/Wallet JSON RPC API/UI/recoverWallet/_index.en.md @@ -1,9 +1,9 @@ --- -title: ui_recoverWallet +title: recoverWallet weight: 3 --- -## RecoverWallet +## ui_recoverWallet Recover Wallet wallet by mnemonic ### Parameters diff --git a/Document/content/Wallet JSON RPC API/API List/ui_walletStatus/_index.en.md b/Document/content/Wallet JSON RPC API/UI/walletStatus/_index.en.md similarity index 97% rename from Document/content/Wallet JSON RPC API/API List/ui_walletStatus/_index.en.md rename to Document/content/Wallet JSON RPC API/UI/walletStatus/_index.en.md index d75638d8..222f1a87 100644 --- a/Document/content/Wallet JSON RPC API/API List/ui_walletStatus/_index.en.md +++ b/Document/content/Wallet JSON RPC API/UI/walletStatus/_index.en.md @@ -1,10 +1,10 @@ --- -title: ui_walletStatus +title: walletStatus weight: 3 --- -## WalletStatus +## ui_walletStatus wallet info ### Parameters diff --git a/Document/content/Wallet JSON RPC API/Wallet/_index.en.md b/Document/content/Wallet JSON RPC API/Wallet/_index.en.md new file mode 100644 index 00000000..9be6ce70 --- /dev/null +++ b/Document/content/Wallet JSON RPC API/Wallet/_index.en.md @@ -0,0 +1,32 @@ + +--- +title: Wallet API +weight: 2 +--- + +## Overview +wallet services + +## Wallet + - [createAccount](createaccount) + - [createAddress](createaddress) + - [importPrivKey](importprivkey) + - [importWIFPrivKey](importwifprivkey) + - [dumpPrivKey](dumpprivkey) + + - [sendToAddress](sendtoaddress) + - [sendToAddressByAccount](sendtoaddressbyaccount) + - [sendToMany](sendtomany) + + - [getAccountByAddress](getaccountbyaddress) + - [getAccountsAndBalance](getaccountsandbalance) + - [getAddressesByAccount](getaddressesbyaccount) + - [getBalanceByAccount](getbalancebyaccount) + - [getBalanceByAddr](getbalancebyaddr) + - [getBillByAddr](getbillbyaddr) + - [getTxListByAddr](gettxlistbyaddr) + - [getUTXO](getutxo) + + - [lock](lock) + - [syncStats](syncstats) + - [unlock](unlock) \ No newline at end of file diff --git a/Document/content/Wallet JSON RPC API/API List/wallet_createAccount/_index.en.md b/Document/content/Wallet JSON RPC API/Wallet/createAccount/_index.en.md similarity index 95% rename from Document/content/Wallet JSON RPC API/API List/wallet_createAccount/_index.en.md rename to Document/content/Wallet JSON RPC API/Wallet/createAccount/_index.en.md index bb6e2f76..1ee70fd5 100644 --- a/Document/content/Wallet JSON RPC API/API List/wallet_createAccount/_index.en.md +++ b/Document/content/Wallet JSON RPC API/Wallet/createAccount/_index.en.md @@ -1,9 +1,9 @@ --- -title: wallet_createAccount +title: createAccount weight: 3 --- -## CreateAccount +## ui_createAccount creates the next account and returns its account number. The name must be unique to the account. In order to support automatic seed restoring, new accounts may not be created when all of the previous 100 diff --git a/Document/content/Wallet JSON RPC API/API List/wallet_createAddress/_index.md b/Document/content/Wallet JSON RPC API/Wallet/createAddress/_index.md similarity index 92% rename from Document/content/Wallet JSON RPC API/API List/wallet_createAddress/_index.md rename to Document/content/Wallet JSON RPC API/Wallet/createAddress/_index.md index 804d6e92..5ec84b83 100644 --- a/Document/content/Wallet JSON RPC API/API List/wallet_createAddress/_index.md +++ b/Document/content/Wallet JSON RPC API/Wallet/createAddress/_index.md @@ -1,9 +1,9 @@ --- -title: wallet_createAddress +title: createAddress weight: 3 --- -## CreateAddress +## ui_createAddress returns the next external chained address for a wallet. ### Parameters diff --git a/Document/content/Wallet JSON RPC API/API List/wallet_dumpPrivKey/_index.md b/Document/content/Wallet JSON RPC API/Wallet/dumpPrivKey/_index.md similarity index 91% rename from Document/content/Wallet JSON RPC API/API List/wallet_dumpPrivKey/_index.md rename to Document/content/Wallet JSON RPC API/Wallet/dumpPrivKey/_index.md index 7c20bc2b..726d0018 100644 --- a/Document/content/Wallet JSON RPC API/API List/wallet_dumpPrivKey/_index.md +++ b/Document/content/Wallet JSON RPC API/Wallet/dumpPrivKey/_index.md @@ -1,5 +1,5 @@ --- -title: wallet_dumpPrivKey +title: dumpPrivKey weight: 3 --- diff --git a/Document/content/Wallet JSON RPC API/API List/wallet_getAccountByAddress/_index.en.md b/Document/content/Wallet JSON RPC API/Wallet/getAccountByAddress/_index.en.md similarity index 94% rename from Document/content/Wallet JSON RPC API/API List/wallet_getAccountByAddress/_index.en.md rename to Document/content/Wallet JSON RPC API/Wallet/getAccountByAddress/_index.en.md index 472bcb6e..35ec2de2 100644 --- a/Document/content/Wallet JSON RPC API/API List/wallet_getAccountByAddress/_index.en.md +++ b/Document/content/Wallet JSON RPC API/Wallet/getAccountByAddress/_index.en.md @@ -1,5 +1,5 @@ --- -title: wallet_getAccountByAddress +title: getAccountByAddress weight: 3 --- diff --git a/Document/content/Wallet JSON RPC API/API List/wallet_getAccountsAndBalance/_index.md b/Document/content/Wallet JSON RPC API/Wallet/getAccountsAndBalance/_index.md similarity index 97% rename from Document/content/Wallet JSON RPC API/API List/wallet_getAccountsAndBalance/_index.md rename to Document/content/Wallet JSON RPC API/Wallet/getAccountsAndBalance/_index.md index 840365c0..50300407 100644 --- a/Document/content/Wallet JSON RPC API/API List/wallet_getAccountsAndBalance/_index.md +++ b/Document/content/Wallet JSON RPC API/Wallet/getAccountsAndBalance/_index.md @@ -1,5 +1,5 @@ --- -title: wallet_getAccountsAndBalance +title: getAccountsAndBalance weight: 3 --- diff --git a/Document/content/Wallet JSON RPC API/API List/wallet_getAddressesByAccount/_index.md b/Document/content/Wallet JSON RPC API/Wallet/getAddressesByAccount/_index.md similarity index 93% rename from Document/content/Wallet JSON RPC API/API List/wallet_getAddressesByAccount/_index.md rename to Document/content/Wallet JSON RPC API/Wallet/getAddressesByAccount/_index.md index 857f7b6f..2fca448b 100644 --- a/Document/content/Wallet JSON RPC API/API List/wallet_getAddressesByAccount/_index.md +++ b/Document/content/Wallet JSON RPC API/Wallet/getAddressesByAccount/_index.md @@ -1,6 +1,6 @@ --- -title: wallet_getAddressesByAccount +title: getAddressesByAccount weight: 3 --- diff --git a/Document/content/Wallet JSON RPC API/API List/wallet_getBalanceByAccount/_index.md b/Document/content/Wallet JSON RPC API/Wallet/getBalanceByAccount/_index.md similarity index 96% rename from Document/content/Wallet JSON RPC API/API List/wallet_getBalanceByAccount/_index.md rename to Document/content/Wallet JSON RPC API/Wallet/getBalanceByAccount/_index.md index ab8ac8d1..eaa4e63a 100644 --- a/Document/content/Wallet JSON RPC API/API List/wallet_getBalanceByAccount/_index.md +++ b/Document/content/Wallet JSON RPC API/Wallet/getBalanceByAccount/_index.md @@ -1,5 +1,5 @@ --- -title: wallet_getBalanceByAccount +title: getBalanceByAccount weight: 3 --- diff --git a/Document/content/Wallet JSON RPC API/API List/wallet_getBalanceByAddr/_index.md b/Document/content/Wallet JSON RPC API/Wallet/getBalanceByAddr/_index.md similarity index 96% rename from Document/content/Wallet JSON RPC API/API List/wallet_getBalanceByAddr/_index.md rename to Document/content/Wallet JSON RPC API/Wallet/getBalanceByAddr/_index.md index 5fc3bd00..8abd9aef 100644 --- a/Document/content/Wallet JSON RPC API/API List/wallet_getBalanceByAddr/_index.md +++ b/Document/content/Wallet JSON RPC API/Wallet/getBalanceByAddr/_index.md @@ -1,6 +1,6 @@ --- -title: wallet_getBalanceByAddr +title: getBalanceByAddr weight: 3 --- diff --git a/Document/content/Wallet JSON RPC API/API List/wallet_getBillByAddr/_index.en.md b/Document/content/Wallet JSON RPC API/Wallet/getBillByAddr/_index.en.md similarity index 99% rename from Document/content/Wallet JSON RPC API/API List/wallet_getBillByAddr/_index.en.md rename to Document/content/Wallet JSON RPC API/Wallet/getBillByAddr/_index.en.md index 4965af79..72b1548b 100644 --- a/Document/content/Wallet JSON RPC API/API List/wallet_getBillByAddr/_index.en.md +++ b/Document/content/Wallet JSON RPC API/Wallet/getBillByAddr/_index.en.md @@ -1,5 +1,5 @@ --- -title: wallet_getBillByAddr +title: getBillByAddr weight: 3 --- diff --git a/Document/content/Wallet JSON RPC API/API List/wallet_getTx/_index.md b/Document/content/Wallet JSON RPC API/Wallet/getTx/_index.md similarity index 99% rename from Document/content/Wallet JSON RPC API/API List/wallet_getTx/_index.md rename to Document/content/Wallet JSON RPC API/Wallet/getTx/_index.md index fdb2be2e..5e9afd8f 100644 --- a/Document/content/Wallet JSON RPC API/API List/wallet_getTx/_index.md +++ b/Document/content/Wallet JSON RPC API/Wallet/getTx/_index.md @@ -1,5 +1,5 @@ --- -title: wallet_getTx +title: getTx weight: 3 --- diff --git a/Document/content/Wallet JSON RPC API/API List/wallet_getTxListByAddr/_index.md b/Document/content/Wallet JSON RPC API/Wallet/getTxListByAddr/_index.md similarity index 97% rename from Document/content/Wallet JSON RPC API/API List/wallet_getTxListByAddr/_index.md rename to Document/content/Wallet JSON RPC API/Wallet/getTxListByAddr/_index.md index a066b9a2..8162f856 100644 --- a/Document/content/Wallet JSON RPC API/API List/wallet_getTxListByAddr/_index.md +++ b/Document/content/Wallet JSON RPC API/Wallet/getTxListByAddr/_index.md @@ -1,5 +1,5 @@ --- -title: wallet_getTxListByAddr +title: getTxListByAddr weight: 3 --- diff --git a/Document/content/Wallet JSON RPC API/API List/wallet_getUtxo/_index.md b/Document/content/Wallet JSON RPC API/Wallet/getUTXO/_index.md similarity index 97% rename from Document/content/Wallet JSON RPC API/API List/wallet_getUtxo/_index.md rename to Document/content/Wallet JSON RPC API/Wallet/getUTXO/_index.md index a30db982..098c221e 100644 --- a/Document/content/Wallet JSON RPC API/API List/wallet_getUtxo/_index.md +++ b/Document/content/Wallet JSON RPC API/Wallet/getUTXO/_index.md @@ -1,5 +1,5 @@ --- -title: wallet_getUtxo +title: getUtxo weight: 3 --- diff --git a/Document/content/Wallet JSON RPC API/API List/wallet_importPrivKey/_index.md b/Document/content/Wallet JSON RPC API/Wallet/importPrivKey/_index.md similarity index 95% rename from Document/content/Wallet JSON RPC API/API List/wallet_importPrivKey/_index.md rename to Document/content/Wallet JSON RPC API/Wallet/importPrivKey/_index.md index f47f2b85..03076375 100644 --- a/Document/content/Wallet JSON RPC API/API List/wallet_importPrivKey/_index.md +++ b/Document/content/Wallet JSON RPC API/Wallet/importPrivKey/_index.md @@ -1,9 +1,9 @@ --- -title: wallet_importPrivKey +title: importPrivKey weight: 3 --- -## ImportPrivKey +## ui_importPrivKey imports a private key to the wallet and writes the new wallet to disk. **Note**: this private key is in a hex string and you may generate it with `qx wiftopriv` tool from a WIF key, which should be compatible with BTC network (in contrast to dumpPrivKey and importWIFPrivKey, both are incompatible). You may export this WIF key from any wallet service that follows this rule, such as [KAHF](https://kahf.io) diff --git a/Document/content/Wallet JSON RPC API/API List/wallet_importWifPrivKey/_index.md b/Document/content/Wallet JSON RPC API/Wallet/importWifPrivKey/_index.md similarity index 91% rename from Document/content/Wallet JSON RPC API/API List/wallet_importWifPrivKey/_index.md rename to Document/content/Wallet JSON RPC API/Wallet/importWifPrivKey/_index.md index c139443a..6db17c7b 100644 --- a/Document/content/Wallet JSON RPC API/API List/wallet_importWifPrivKey/_index.md +++ b/Document/content/Wallet JSON RPC API/Wallet/importWifPrivKey/_index.md @@ -1,5 +1,5 @@ --- -title: wallet_importWifPrivKey +title: importWifPrivKey weight: 3 --- diff --git a/Document/content/Wallet JSON RPC API/API List/wallet_lock/_index.md b/Document/content/Wallet JSON RPC API/Wallet/lock/_index.md similarity index 90% rename from Document/content/Wallet JSON RPC API/API List/wallet_lock/_index.md rename to Document/content/Wallet JSON RPC API/Wallet/lock/_index.md index 74c788a6..17a12597 100644 --- a/Document/content/Wallet JSON RPC API/API List/wallet_lock/_index.md +++ b/Document/content/Wallet JSON RPC API/Wallet/lock/_index.md @@ -1,9 +1,9 @@ --- -title: wallet_lock +title: lock weight: 3 --- -### Lock +### ui_lock lock wallet #### Parameters diff --git a/Document/content/Wallet JSON RPC API/API List/wallet_sendToAddress/_index.md b/Document/content/Wallet JSON RPC API/Wallet/sendToAddress/_index.md similarity index 96% rename from Document/content/Wallet JSON RPC API/API List/wallet_sendToAddress/_index.md rename to Document/content/Wallet JSON RPC API/Wallet/sendToAddress/_index.md index c405417b..8ad2504f 100644 --- a/Document/content/Wallet JSON RPC API/API List/wallet_sendToAddress/_index.md +++ b/Document/content/Wallet JSON RPC API/Wallet/sendToAddress/_index.md @@ -1,5 +1,5 @@ --- -title: wallet_sendToAddress +title: sendToAddress weight: 3 --- diff --git a/Document/content/Wallet JSON RPC API/API List/wallet_sendToAddressByAccount/_index.md b/Document/content/Wallet JSON RPC API/Wallet/sendToAddressByAccount/_index.md similarity index 97% rename from Document/content/Wallet JSON RPC API/API List/wallet_sendToAddressByAccount/_index.md rename to Document/content/Wallet JSON RPC API/Wallet/sendToAddressByAccount/_index.md index c4704c6a..9339cc02 100644 --- a/Document/content/Wallet JSON RPC API/API List/wallet_sendToAddressByAccount/_index.md +++ b/Document/content/Wallet JSON RPC API/Wallet/sendToAddressByAccount/_index.md @@ -1,5 +1,5 @@ --- -title: wallet_sendToAddressByAccount +title: sendToAddressByAccount weight: 3 --- diff --git a/Document/content/Wallet JSON RPC API/API List/wallet_sendToMany/_index.en.md b/Document/content/Wallet JSON RPC API/Wallet/sendToMany/_index.en.md similarity index 97% rename from Document/content/Wallet JSON RPC API/API List/wallet_sendToMany/_index.en.md rename to Document/content/Wallet JSON RPC API/Wallet/sendToMany/_index.en.md index f53faf85..5abb0ece 100644 --- a/Document/content/Wallet JSON RPC API/API List/wallet_sendToMany/_index.en.md +++ b/Document/content/Wallet JSON RPC API/Wallet/sendToMany/_index.en.md @@ -1,5 +1,5 @@ --- -title: wallet_sendToMany +title: sendToMany weight: 3 --- diff --git a/Document/content/Wallet JSON RPC API/API List/wallet_syncStats/_index.md b/Document/content/Wallet JSON RPC API/Wallet/syncStats/_index.md similarity index 92% rename from Document/content/Wallet JSON RPC API/API List/wallet_syncStats/_index.md rename to Document/content/Wallet JSON RPC API/Wallet/syncStats/_index.md index e8b3dfbd..d1c35427 100644 --- a/Document/content/Wallet JSON RPC API/API List/wallet_syncStats/_index.md +++ b/Document/content/Wallet JSON RPC API/Wallet/syncStats/_index.md @@ -1,6 +1,6 @@ --- -title: wallet_syncStats +title: syncStats weight: 3 --- diff --git a/Document/content/Wallet JSON RPC API/API List/wallet_unlock/_index.en.md b/Document/content/Wallet JSON RPC API/Wallet/unlock/_index.en.md similarity index 97% rename from Document/content/Wallet JSON RPC API/API List/wallet_unlock/_index.en.md rename to Document/content/Wallet JSON RPC API/Wallet/unlock/_index.en.md index c1dd2b00..484f900a 100644 --- a/Document/content/Wallet JSON RPC API/API List/wallet_unlock/_index.en.md +++ b/Document/content/Wallet JSON RPC API/Wallet/unlock/_index.en.md @@ -1,5 +1,5 @@ --- -title: wallet_unlock +title: unlock weight: 3 --- diff --git a/Document/content/Wallet JSON RPC API/_index.en.md b/Document/content/Wallet JSON RPC API/_index.en.md index f0f3a239..e7a43156 100644 --- a/Document/content/Wallet JSON RPC API/_index.en.md +++ b/Document/content/Wallet JSON RPC API/_index.en.md @@ -4,5 +4,7 @@ weight: 1 --- - [Instruction](./instruction/) - - [API List](./api-list/) - - [Errors](./errors/) \ No newline at end of file + - API List + - [Wallet](./wallet/) + - [UI](./ui/) + - [QitmeerD](./qitmeerd/) \ No newline at end of file From b1c0844bad4730964d526626c8cd3677722b9791 Mon Sep 17 00:00:00 2001 From: forchain Date: Sat, 5 Dec 2020 10:22:14 +0800 Subject: [PATCH 61/69] fix name --- .../Wallet JSON RPC API/Wallet/createAccount/_index.en.md | 2 +- .../content/Wallet JSON RPC API/Wallet/createAddress/_index.md | 2 +- Document/content/Wallet JSON RPC API/Wallet/unlock/_index.en.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Document/content/Wallet JSON RPC API/Wallet/createAccount/_index.en.md b/Document/content/Wallet JSON RPC API/Wallet/createAccount/_index.en.md index 1ee70fd5..a8636954 100644 --- a/Document/content/Wallet JSON RPC API/Wallet/createAccount/_index.en.md +++ b/Document/content/Wallet JSON RPC API/Wallet/createAccount/_index.en.md @@ -3,7 +3,7 @@ title: createAccount weight: 3 --- -## ui_createAccount +## wallet_createAccount creates the next account and returns its account number. The name must be unique to the account. In order to support automatic seed restoring, new accounts may not be created when all of the previous 100 diff --git a/Document/content/Wallet JSON RPC API/Wallet/createAddress/_index.md b/Document/content/Wallet JSON RPC API/Wallet/createAddress/_index.md index 5ec84b83..bbb0ba50 100644 --- a/Document/content/Wallet JSON RPC API/Wallet/createAddress/_index.md +++ b/Document/content/Wallet JSON RPC API/Wallet/createAddress/_index.md @@ -3,7 +3,7 @@ title: createAddress weight: 3 --- -## ui_createAddress +## wallet_createAddress returns the next external chained address for a wallet. ### Parameters diff --git a/Document/content/Wallet JSON RPC API/Wallet/unlock/_index.en.md b/Document/content/Wallet JSON RPC API/Wallet/unlock/_index.en.md index 484f900a..f20ba0c7 100644 --- a/Document/content/Wallet JSON RPC API/Wallet/unlock/_index.en.md +++ b/Document/content/Wallet JSON RPC API/Wallet/unlock/_index.en.md @@ -3,7 +3,7 @@ title: unlock weight: 3 --- -## Unlock +## wallet_unlock unlocks the wallet's address manager and relocks it after timeout has expired. If the wallet is already unlocked and the new passphrase is correct, the current timeout is replaced with the new one. The wallet will From 70e3f26022796e9ca324c1dd502d98d7b9c0ff3c Mon Sep 17 00:00:00 2001 From: forchain Date: Sat, 5 Dec 2020 16:44:43 +0800 Subject: [PATCH 62/69] send transaction --- Document/content/JSON RPC API/_index.en.md | 2 +- .../createRawTransaction/_index.en.md | 11 ++- .../getRawTransaction/_index.cn.md | 31 ++++--- .../{_index.md => _index.en.md} | 0 .../content/JSON RPC API/getUtxo/_index.en.md | 88 ++++++++++++++++++- .../sendRawTransaction/_index.cn.md | 52 +++++++++-- .../sendRawTransaction/_index.en.md | 53 +++++++++++ .../content/JSON RPC API/txSign/_index.en.md | 38 ++++++++ .../dumpPrivKey/{_index.md => _index.cn.md} | 3 +- .../Wallet/dumpPrivKey/_index.en.md | 22 +++++ 10 files changed, 277 insertions(+), 23 deletions(-) rename Document/content/JSON RPC API/getRawTransaction/{_index.md => _index.en.md} (100%) create mode 100644 Document/content/JSON RPC API/txSign/_index.en.md rename Document/content/Wallet JSON RPC API/Wallet/dumpPrivKey/{_index.md => _index.cn.md} (92%) create mode 100644 Document/content/Wallet JSON RPC API/Wallet/dumpPrivKey/_index.en.md diff --git a/Document/content/JSON RPC API/_index.en.md b/Document/content/JSON RPC API/_index.en.md index 9886fd8f..cf21bdd8 100644 --- a/Document/content/JSON RPC API/_index.en.md +++ b/Document/content/JSON RPC API/_index.en.md @@ -40,7 +40,7 @@ weight: 5 - [getRawTransaction](getrawtransaction) - [getUtxo](getutxo) - [sendRawTransaction](sendrawtransaction) -- [txSign](txSign) +- [txSign](txsign) diff --git a/Document/content/JSON RPC API/createRawTransaction/_index.en.md b/Document/content/JSON RPC API/createRawTransaction/_index.en.md index f7adf9f3..c52bf936 100644 --- a/Document/content/JSON RPC API/createRawTransaction/_index.en.md +++ b/Document/content/JSON RPC API/createRawTransaction/_index.en.md @@ -20,12 +20,19 @@ Returns a new transaction spending the provided inputs and sending to the provid ##### Request ```bash -curl --data '{"method":"createRawTransaction","params":[[{"Txid":"ddf99e004ed24d641ddc942272ed174b1c2ae0fb27cc0ed7e858e0a451e27633", "Vout":0}], {"RmG6xQsV7gnS4JZmoq5FgmyEbmUQRenrTCo":10000000000}],"jsonrpc":"2.0","id":1}' -s -k -u "test:test" -H 'Content-Type: application/json' http://127.0.0.1:1234 |jq . + + curl -sku "test:test" -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"createRawTransaction","params":[ [{"Txid":"cfd933e4590a3cfbcf94e9220c77834fe8a869414c51e3bd0ce5af23592e80f9", "Vout":1}], {"Tme9dVJ4GeWRninBygrA6oDwCAGYbBvNxY7":90000000}],"id":1}' http://127.0.0.1:18131 | jq + ``` ##### Response ```js -"01000000013376e251a4e058e8d70ecc27fbe02a1c4b17ed722294dc1d644dd24e009ef9dd00000000ffffffff0100e40b54020000001976a9146bd68046854813036fa042958e7f5ca29606e8d088ac00000000000000000100" +{ + "jsonrpc": "2.0", + "id": 1, + "result": "0100000001f9802e5923afe50cbde3514c4169a8e84f83770c22e994cffb3c0a59e433d9cf01000000ffffffff01804a5d05000000001976a914a6b8fe2348fad076b7fd1b34b7e5b35db96dc2a088ac00000000000000001141cb5f0100" +} + ``` diff --git a/Document/content/JSON RPC API/getRawTransaction/_index.cn.md b/Document/content/JSON RPC API/getRawTransaction/_index.cn.md index d1778362..57097a55 100644 --- a/Document/content/JSON RPC API/getRawTransaction/_index.cn.md +++ b/Document/content/JSON RPC API/getRawTransaction/_index.cn.md @@ -1,20 +1,31 @@ ---- -title: getRawTransaction +--- + title: getRawTransaction weight: 3 --- ## getRawTransaction -### 函数名:getRawTransaction {txid} -### 说明:通过txid获取交易 -- txid 交易id 为一个256位hash值。 -- verbose 是否显示详细信息,默认为false +get raw transaction by ID -#### 实例 -``` +### Parameters +1. `txid: (hex string)` 256-bit transaction ID +2. `verbose: (bool , default=false)` When the verbose flag isn't set, simply return the serialized transaction as a hex-encoded string. + +### Returns +#### verbose = true +`rawTx: (hex string)` + +#### verbose = false +`Tx: (object)` + +### Example +#### Request + +```sh curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getRawTransaction","params":["c259a4dfb7eaaae92ab246f14762541581671135cd6030ac29d8c34cf77e9f32",true],"id":1}' https://127.0.0.1:18131 + ``` -输出 -``` +#### Response +```json { "hex": "0100000001dc7d54db024a1ef06e38b85ab01af2d60043e3d36b5411691224c05dcf36f63c01000000ffffffff02659ca300000000001976a91406e2097d585337cdd10aefa09994b511127af0bb88acf0e8cd6f230200001976a914fe27c90d4ed4de3269c0bb9ae1d7639865e3bf2888ac00000000000000008015fc5e016b48304502210090910aa0190a6571319b0b638bfbb593582575703abdd4f1a7f0da2812cda7d102205dae6fee28396bfeb8f1b814884d8d03ab0dd9f30b171d906c24914ba2f85b1a012103cd4fa2ea2688ac9e0a62584635244f572d22c13730d5576722d6571aabfddca8", "txid": "c259a4dfb7eaaae92ab246f14762541581671135cd6030ac29d8c34cf77e9f32", diff --git a/Document/content/JSON RPC API/getRawTransaction/_index.md b/Document/content/JSON RPC API/getRawTransaction/_index.en.md similarity index 100% rename from Document/content/JSON RPC API/getRawTransaction/_index.md rename to Document/content/JSON RPC API/getRawTransaction/_index.en.md diff --git a/Document/content/JSON RPC API/getUtxo/_index.en.md b/Document/content/JSON RPC API/getUtxo/_index.en.md index 2fd22059..a3d1d924 100644 --- a/Document/content/JSON RPC API/getUtxo/_index.en.md +++ b/Document/content/JSON RPC API/getUtxo/_index.en.md @@ -1,4 +1,90 @@ --- -title: getUtxo +title: getUTXO weight: 1 --- + +## getUTXO +Returns information about an unspent transaction output + +### Parameters +1. `txid (string, required)` The hash of the transaction +2. `vout (numeric, required)` The index of the output +3. `includemempool (boolean, optional, default=true)` Include the mempool when true + +### Returns +```json +{ + "bestblock": "value", (string) The block hash that contains the transaction output + "confirmations": n, (numeric) The number of confirmations + "amount": n.nnn, (numeric) The transaction amount + "scriptPubKey": { (object) The public key script used to pay coins as a JSON object + "asm": "value", (string) Disassembly of the script + "hex": "value", (string) Hex-encoded bytes of the script + "reqSigs": n, (numeric) The number of required signatures + "type": "value", (string) The type of the script (e.g. 'pubkeyhash') + "addresses": ["value",...], (array of string) The qitmeer addresses associated with this script + }, + "coinbase": true|false, (boolean) Whether or not the transaction is a coinbase +} +``` + +### Example +#### Request + +```sh +curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getRawTransaction","params":["c259a4dfb7eaaae92ab246f14762541581671135cd6030ac29d8c34cf77e9f32",true],"id":1}' https://127.0.0.1:18131 + +``` +#### Response +```json +{ + "hex": "0100000001dc7d54db024a1ef06e38b85ab01af2d60043e3d36b5411691224c05dcf36f63c01000000ffffffff02659ca300000000001976a91406e2097d585337cdd10aefa09994b511127af0bb88acf0e8cd6f230200001976a914fe27c90d4ed4de3269c0bb9ae1d7639865e3bf2888ac00000000000000008015fc5e016b48304502210090910aa0190a6571319b0b638bfbb593582575703abdd4f1a7f0da2812cda7d102205dae6fee28396bfeb8f1b814884d8d03ab0dd9f30b171d906c24914ba2f85b1a012103cd4fa2ea2688ac9e0a62584635244f572d22c13730d5576722d6571aabfddca8", + "txid": "c259a4dfb7eaaae92ab246f14762541581671135cd6030ac29d8c34cf77e9f32", + "txhash": "9b603ba3b17fd8491749ac366a5064d8b7b70be02568e405406a9acd70e971a8", + "size": 235, + "version": 1, + "locktime": 0, + "timestamp": "2020-07-01T12:48:00+08:00", + "expire": 0, + "vin": [ + { + "txid": "3cf636cf5dc024126911546bd3e34300d6f21ab05ab8386ef01e4a02db547ddc", + "vout": 1, + "sequence": 4294967295, + "scriptSig": { + "asm": "304502210090910aa0190a6571319b0b638bfbb593582575703abdd4f1a7f0da2812cda7d102205dae6fee28396bfeb8f1b814884d8d03ab0dd9f30b171d906c24914ba2f85b1a01 03cd4fa2ea2688ac9e0a62584635244f572d22c13730d5576722d6571aabfddca8", + "hex": "48304502210090910aa0190a6571319b0b638bfbb593582575703abdd4f1a7f0da2812cda7d102205dae6fee28396bfeb8f1b814884d8d03ab0dd9f30b171d906c24914ba2f85b1a012103cd4fa2ea2688ac9e0a62584635244f572d22c13730d5576722d6571aabfddca8" + } + } + ], + "vout": [ + { + "amount": 10722405, + "scriptPubKey": { + "asm": "OP_DUP OP_HASH160 06e2097d585337cdd10aefa09994b511127af0bb OP_EQUALVERIFY OP_CHECKSIG", + "hex": "76a91406e2097d585337cdd10aefa09994b511127af0bb88ac", + "reqSigs": 1, + "type": "pubkeyhash", + "addresses": [ + "TmPaUYQuUtfCysrYVHc4AdhpVHxw7EskHTP" + ] + } + }, + { + "amount": 2351222876400, + "scriptPubKey": { + "asm": "OP_DUP OP_HASH160 fe27c90d4ed4de3269c0bb9ae1d7639865e3bf28 OP_EQUALVERIFY OP_CHECKSIG", + "hex": "76a914fe27c90d4ed4de3269c0bb9ae1d7639865e3bf2888ac", + "reqSigs": 1, + "type": "pubkeyhash", + "addresses": [ + "Tmn7vzzSrvAPNLtwpD5YjiWwVUBD74Hjdww" + ] + } + } + ], + "confirmations": 0 +} + +``` + diff --git a/Document/content/JSON RPC API/sendRawTransaction/_index.cn.md b/Document/content/JSON RPC API/sendRawTransaction/_index.cn.md index f8b173ed..61b7857d 100644 --- a/Document/content/JSON RPC API/sendRawTransaction/_index.cn.md +++ b/Document/content/JSON RPC API/sendRawTransaction/_index.cn.md @@ -3,17 +3,55 @@ title: sendRawTransaction weight: 3 --- -## sendRawTransaction -### 函数名:sendRawTransaction {sign_raw_tx} {allow_high_fee} -### 说明:发送交易 +### sendRawTransaction +发送交易 -- sign_raw_tx:签名后的交易 -- allow_high_fee:允许的最大交易费 +#### 参数 +1. `hexTx: (hex string)` 已签名的交易十进制数据 +2. `allowHighFees: (bool, default=false)` 是否允许高额交易费 -#### 实例: +#### 返回 +##### `(hex string)` + +#### 错误 + +1. 签名错误 + * 示例 +```json +{ + "code": -32000, + "message": "Rule Error : Rejected transaction c69ea9d7457379984d5a0af0568f296289ec791bbd522d2f6057924ed12b8089: failed to validate input c69ea9d7457379984d5a0af0568f296289ec791bbd522d2f6057924ed12b8089:0 which references output {cfd933e4590a3cfbcf94e9220c77834fe8a869414c51e3bd0ce5af23592e80f9 0} - verify failed (input script bytes 47304402203aa2f8bcfac55e76b84320a119dcd73955e2c644abe590b8ce99abaf7bf51f5902205e973da66669d80009d6f5d848dd0bed50abf1b69acd43eda02bdb6cfdd0157f012102e8d120c3c729e636fe2909b02c65c025cb7f3f57d9891f4f566dd4724e82eb92, prev output script bytes 76a914844d0a82845bccd469afc5cb78d8ffaa3142edea88ac)" +} + +``` + +2. exceed high fee + * 示例 +```json + { + "code": -32000, + "message": "Deserialization Error : rejected: failed to process transaction 0766b6dfd578952f52842cc4fb72f95f40258ee8aadff41897567a82c2b92e71: transaction 0766b6dfd578952f52842cc4fb72f95f40258ee8aadff41897567a82c2b92e71 has 420995400 fee which is above the allowHighFee check threshold amount of 20100000 (= 201 byte * 10000 AtomMEER/kB * 10000)" + } + +``` + + +#### 示例 + +##### 请求 +```bash +curl -sku "test:test" -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"1.0","method":"sendRawTransaction","params":["0100000001f9802e5923afe50cbde3514c4169a8e84f83770c22e994cffb3c0a59e433d9cf01000000ffffffff01804a5d05000000001976a914a6b8fe2348fad076b7fd1b34b7e5b35db96dc2a088ac00000000000000001141cb5f016b483045022100b8ab0acf7f282e167669e3f20920c81b06554bc1fd5b41c4dd44ab4f3319a92f02200b664f920c77a7d8ac695380c22ec3131e2bd8f27617f84883fe9cf6d6bea0a1012102e8d120c3c729e636fe2909b02c65c025cb7f3f57d9891f4f566dd4724e82eb92", true],"id":1}' http://127.0.0.1:18131 | jq ``` -sendRawTransaction 0100000001ff5d53a7070fa9f0a9d12af729d2cbaf355ef1173c106a84cf9ef3a46bff03b202000000ffffffff01005504790a0000001976a914627777996288556166614462639988446255776688ac000000000000000001000000000000000000000000ffffffff6b483045022100dced4d67dd74647d0036077ee5b435838934377b1d296dd9da852772911e3be2022063dd346bd812a894968b8acacead7e7beff48947657a82f1e8f9c38876d4c905012103aba0a09f5b44138a46a2e5d26b8659923d84c4ba9437e22c3828cac43d0edb49 true +##### 返回 +```js +{ + "jsonrpc": "2.0", + "id": 1, + "result": "0766b6dfd578952f52842cc4fb72f95f40258ee8aadff41897567a82c2b92e71" +} + ``` + diff --git a/Document/content/JSON RPC API/sendRawTransaction/_index.en.md b/Document/content/JSON RPC API/sendRawTransaction/_index.en.md index 4b0fc344..4aa8b42f 100644 --- a/Document/content/JSON RPC API/sendRawTransaction/_index.en.md +++ b/Document/content/JSON RPC API/sendRawTransaction/_index.en.md @@ -2,3 +2,56 @@ title: sendRawTransaction weight: 3 --- + +### sendRawTransaction +send raw transactions + +#### Parameters +1. `hexTx: (hex string)` hex string of signed transaction +2. `allowHighFees: (bool, default=false)` if allows high fee + +#### Returns +##### `(hex string)` + +#### Errors + +1. Signature failed + * Example +```json +{ + "code": -32000, + "message": "Rule Error : Rejected transaction c69ea9d7457379984d5a0af0568f296289ec791bbd522d2f6057924ed12b8089: failed to validate input c69ea9d7457379984d5a0af0568f296289ec791bbd522d2f6057924ed12b8089:0 which references output {cfd933e4590a3cfbcf94e9220c77834fe8a869414c51e3bd0ce5af23592e80f9 0} - verify failed (input script bytes 47304402203aa2f8bcfac55e76b84320a119dcd73955e2c644abe590b8ce99abaf7bf51f5902205e973da66669d80009d6f5d848dd0bed50abf1b69acd43eda02bdb6cfdd0157f012102e8d120c3c729e636fe2909b02c65c025cb7f3f57d9891f4f566dd4724e82eb92, prev output script bytes 76a914844d0a82845bccd469afc5cb78d8ffaa3142edea88ac)" +} + +``` + +2. exceed high fee + * example +```json + { + "code": -32000, + "message": "Deserialization Error : rejected: failed to process transaction 0766b6dfd578952f52842cc4fb72f95f40258ee8aadff41897567a82c2b92e71: transaction 0766b6dfd578952f52842cc4fb72f95f40258ee8aadff41897567a82c2b92e71 has 420995400 fee which is above the allowHighFee check threshold amount of 20100000 (= 201 byte * 10000 AtomMEER/kB * 10000)" + } + +``` + + +#### Example + +##### Request +```bash +curl -sku "test:test" -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"1.0","method":"sendRawTransaction","params":["0100000001f9802e5923afe50cbde3514c4169a8e84f83770c22e994cffb3c0a59e433d9cf01000000ffffffff01804a5d05000000001976a914a6b8fe2348fad076b7fd1b34b7e5b35db96dc2a088ac00000000000000001141cb5f016b483045022100b8ab0acf7f282e167669e3f20920c81b06554bc1fd5b41c4dd44ab4f3319a92f02200b664f920c77a7d8ac695380c22ec3131e2bd8f27617f84883fe9cf6d6bea0a1012102e8d120c3c729e636fe2909b02c65c025cb7f3f57d9891f4f566dd4724e82eb92", true],"id":1}' http://127.0.0.1:18131 | jq + +``` + +##### Response +```js +{ + "jsonrpc": "2.0", + "id": 1, + "result": "0766b6dfd578952f52842cc4fb72f95f40258ee8aadff41897567a82c2b92e71" +} + + +``` + diff --git a/Document/content/JSON RPC API/txSign/_index.en.md b/Document/content/JSON RPC API/txSign/_index.en.md new file mode 100644 index 00000000..4c9dd39b --- /dev/null +++ b/Document/content/JSON RPC API/txSign/_index.en.md @@ -0,0 +1,38 @@ + +--- +title: txSign +weight: 1 +--- + +### test_txSign +sign raw transactions + +#### Prerequisite +test module enabled +```sh +modules=test +``` + + +#### Parameters +1. `privkeyStr: (hex string)` private key +2. `rawTxStr: (hex string)` raw transaction + +#### Returns +##### `(array of string)` list of tip hashes + +#### Example + +##### Request +```bash +curl -sku "test:test" -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"1.0","method":"test_txSign","params":["ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "0100000001f9802e5923afe50cbde3514c4169a8e84f83770c22e994cffb3c0a59e433d9cf01000000ffffffff01804a5d05000000001976a914a6b8fe2348fad076b7fd1b34b7e5b35db96dc2a088ac00000000000000001141cb5f0100"],"id":1}' http://127.0.0.1:18131 | jq +``` + +##### Response +```js +{ + "jsonrpc": "2.0", + "id": 1, + "result": "0100000001f9802e5923afe50cbde3514c4169a8e84f83770c22e994cffb3c0a59e433d9cf01000000ffffffff01804a5d05000000001976a914a6b8fe2348fad076b7fd1b34b7e5b35db96dc2a088ac00000000000000001141cb5f016b483045022100b8ab0acf7f282e167669e3f20920c81b06554bc1fd5b41c4dd44ab4f3319a92f02200b664f920c77a7d8ac695380c22ec3131e2bd8f27617f84883fe9cf6d6bea0a1012102e8d120c3c729e636fe2909b02c65c025cb7f3f57d9891f4f566dd4724e82eb92" +} +``` diff --git a/Document/content/Wallet JSON RPC API/Wallet/dumpPrivKey/_index.md b/Document/content/Wallet JSON RPC API/Wallet/dumpPrivKey/_index.cn.md similarity index 92% rename from Document/content/Wallet JSON RPC API/Wallet/dumpPrivKey/_index.md rename to Document/content/Wallet JSON RPC API/Wallet/dumpPrivKey/_index.cn.md index 726d0018..32dc0608 100644 --- a/Document/content/Wallet JSON RPC API/Wallet/dumpPrivKey/_index.md +++ b/Document/content/Wallet JSON RPC API/Wallet/dumpPrivKey/_index.cn.md @@ -4,12 +4,11 @@ weight: 3 --- ### wallet_dumpPrivKey -创建地址 +导出地址的私钥 #### Parameters 1. `addr: (string)` 地址 - #### Returns diff --git a/Document/content/Wallet JSON RPC API/Wallet/dumpPrivKey/_index.en.md b/Document/content/Wallet JSON RPC API/Wallet/dumpPrivKey/_index.en.md new file mode 100644 index 00000000..e7bac810 --- /dev/null +++ b/Document/content/Wallet JSON RPC API/Wallet/dumpPrivKey/_index.en.md @@ -0,0 +1,22 @@ +--- +title: dumpPrivKey +weight: 3 +--- + +### wallet_dumpPrivKey +dump a single address private key + +#### Parameters +1. `addr: (string)` address + + +#### Returns + + +#### Example +##### Request + +```json +{"id":1574829854509,"method":"wallet_dumpPrivKey","params":["Tmh3je9zbnHAvPfwwHhQsFSJmKkeRTtKqmV"]} +``` +##### Response From bf7ae8bf68994427ce2c36d7e843109a84ad887b Mon Sep 17 00:00:00 2001 From: Outlier <22833166+forchain@users.noreply.github.com> Date: Tue, 12 Jan 2021 21:08:09 +0800 Subject: [PATCH 63/69] unlock indefinitely --- .../content/Wallet JSON RPC API/Wallet/unlock/_index.en.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Document/content/Wallet JSON RPC API/Wallet/unlock/_index.en.md b/Document/content/Wallet JSON RPC API/Wallet/unlock/_index.en.md index f20ba0c7..ecdc3957 100644 --- a/Document/content/Wallet JSON RPC API/Wallet/unlock/_index.en.md +++ b/Document/content/Wallet JSON RPC API/Wallet/unlock/_index.en.md @@ -12,7 +12,9 @@ weight: 3 ### Parameters 1. `passphrase: (string)` wallet private password -2. `timeout: (numeric)` unlock duration, unit second +2. `timeout: (numeric)` + - `negative` unlock indefinitely + - `postive` unlock duration, unit second ### Returns #### Success From 881465c07919638a410b0282130e19e12560d0c6 Mon Sep 17 00:00:00 2001 From: forchain Date: Tue, 23 Mar 2021 07:22:49 +0800 Subject: [PATCH 64/69] update getUtxo --- .../content/JSON RPC API/getUtxo/_index.en.md | 65 ++++++------------- 1 file changed, 19 insertions(+), 46 deletions(-) diff --git a/Document/content/JSON RPC API/getUtxo/_index.en.md b/Document/content/JSON RPC API/getUtxo/_index.en.md index a3d1d924..7e8aca1a 100644 --- a/Document/content/JSON RPC API/getUtxo/_index.en.md +++ b/Document/content/JSON RPC API/getUtxo/_index.en.md @@ -32,58 +32,31 @@ Returns information about an unspent transaction output #### Request ```sh -curl -s -k -u test:test -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getRawTransaction","params":["c259a4dfb7eaaae92ab246f14762541581671135cd6030ac29d8c34cf77e9f32",true],"id":1}' https://127.0.0.1:18131 + curl -sku "test:test" -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"getUtxo","params": ["cfd933e4590a3cfbcf94e9220c77834fe8a869414c51e3bd0ce5af23592e80f9", 0],"id":1}' http://127.0.0.1:18131 | jq + ``` #### Response ```json { - "hex": "0100000001dc7d54db024a1ef06e38b85ab01af2d60043e3d36b5411691224c05dcf36f63c01000000ffffffff02659ca300000000001976a91406e2097d585337cdd10aefa09994b511127af0bb88acf0e8cd6f230200001976a914fe27c90d4ed4de3269c0bb9ae1d7639865e3bf2888ac00000000000000008015fc5e016b48304502210090910aa0190a6571319b0b638bfbb593582575703abdd4f1a7f0da2812cda7d102205dae6fee28396bfeb8f1b814884d8d03ab0dd9f30b171d906c24914ba2f85b1a012103cd4fa2ea2688ac9e0a62584635244f572d22c13730d5576722d6571aabfddca8", - "txid": "c259a4dfb7eaaae92ab246f14762541581671135cd6030ac29d8c34cf77e9f32", - "txhash": "9b603ba3b17fd8491749ac366a5064d8b7b70be02568e405406a9acd70e971a8", - "size": 235, - "version": 1, - "locktime": 0, - "timestamp": "2020-07-01T12:48:00+08:00", - "expire": 0, - "vin": [ - { - "txid": "3cf636cf5dc024126911546bd3e34300d6f21ab05ab8386ef01e4a02db547ddc", - "vout": 1, - "sequence": 4294967295, - "scriptSig": { - "asm": "304502210090910aa0190a6571319b0b638bfbb593582575703abdd4f1a7f0da2812cda7d102205dae6fee28396bfeb8f1b814884d8d03ab0dd9f30b171d906c24914ba2f85b1a01 03cd4fa2ea2688ac9e0a62584635244f572d22c13730d5576722d6571aabfddca8", - "hex": "48304502210090910aa0190a6571319b0b638bfbb593582575703abdd4f1a7f0da2812cda7d102205dae6fee28396bfeb8f1b814884d8d03ab0dd9f30b171d906c24914ba2f85b1a012103cd4fa2ea2688ac9e0a62584635244f572d22c13730d5576722d6571aabfddca8" - } - } - ], - "vout": [ - { - "amount": 10722405, - "scriptPubKey": { - "asm": "OP_DUP OP_HASH160 06e2097d585337cdd10aefa09994b511127af0bb OP_EQUALVERIFY OP_CHECKSIG", - "hex": "76a91406e2097d585337cdd10aefa09994b511127af0bb88ac", - "reqSigs": 1, - "type": "pubkeyhash", - "addresses": [ - "TmPaUYQuUtfCysrYVHc4AdhpVHxw7EskHTP" - ] - } + "jsonrpc": "2.0", + "id": 1, + "result": { + "bestblock": "6161b884e8ceaab14f23906a6ad3b86598dfaecbd805507ae4af302b85a95b10", + "confirmations": 143935, + "amount": 0.999326, + "scriptPubKey": { + "asm": "OP_DUP OP_HASH160 844d0a82845bccd469afc5cb78d8ffaa3142edea OP_EQUALVERIFY OP_CHECKSIG", + "hex": "76a914844d0a82845bccd469afc5cb78d8ffaa3142edea88ac", + "reqSigs": 1, + "type": "pubkeyhash", + "addresses": [ + "Tmb1dCAB8ixNC6d2VtdCYZuhXBVPbnRVi7y" + ] }, - { - "amount": 2351222876400, - "scriptPubKey": { - "asm": "OP_DUP OP_HASH160 fe27c90d4ed4de3269c0bb9ae1d7639865e3bf28 OP_EQUALVERIFY OP_CHECKSIG", - "hex": "76a914fe27c90d4ed4de3269c0bb9ae1d7639865e3bf2888ac", - "reqSigs": 1, - "type": "pubkeyhash", - "addresses": [ - "Tmn7vzzSrvAPNLtwpD5YjiWwVUBD74Hjdww" - ] - } - } - ], - "confirmations": 0 + "version": 0, + "coinbase": false + } } ``` From f769a6129e8c7a64b008178a5e77f269505bf21b Mon Sep 17 00:00:00 2001 From: forchain Date: Tue, 23 Mar 2021 12:01:20 +0800 Subject: [PATCH 65/69] swap memory --- .../_index.en.md | 4 +- Document/content/tutorials/_index.en.md | 2 + .../tutorials/swap-memory/_index.en.md | 78 +++++++++++++++++++ 3 files changed, 82 insertions(+), 2 deletions(-) rename Document/content/faqs/{qitmeer-token-issurance => qitmeer-token-issuance}/_index.en.md (61%) create mode 100644 Document/content/tutorials/swap-memory/_index.en.md diff --git a/Document/content/faqs/qitmeer-token-issurance/_index.en.md b/Document/content/faqs/qitmeer-token-issuance/_index.en.md similarity index 61% rename from Document/content/faqs/qitmeer-token-issurance/_index.en.md rename to Document/content/faqs/qitmeer-token-issuance/_index.en.md index a32cb5a5..8dd1beb4 100644 --- a/Document/content/faqs/qitmeer-token-issurance/_index.en.md +++ b/Document/content/faqs/qitmeer-token-issuance/_index.en.md @@ -1,8 +1,8 @@ --- -title: Qitmeer Token Issurance +title: Qitmeer Token Issuance weight: 5 #pre: "1. " # chapter: true --- -Qitmeer assets issurance componet, OP_TOKEN, is based on UTXO (Unspent Transaction Output) transaction model, to support massive islamic economic liquidity. OP_TOKEN ensures assets backed by native currency and requires authority-owned licenses to publish assets, which is designed for sharia consideration scenarios. \ No newline at end of file +Qitmeer assets issuance component, OP_TOKEN, is based on UTXO (Unspent Transaction Output) transaction model, to support massive islamic economic liquidity. OP_TOKEN ensures assets backed by native currency and requires authority-owned licenses to publish assets, preventive from . \ No newline at end of file diff --git a/Document/content/tutorials/_index.en.md b/Document/content/tutorials/_index.en.md index 0aa6b60a..ded72a54 100644 --- a/Document/content/tutorials/_index.en.md +++ b/Document/content/tutorials/_index.en.md @@ -20,3 +20,5 @@ weight: 3 - [Qitmeer Wallet Rpc Guide](./qitmeer-wallet-rpc) - [Qitmeer JS Guide](./qitmeer-js) + +- [Mount Swap Memory](./swap-memory) \ No newline at end of file diff --git a/Document/content/tutorials/swap-memory/_index.en.md b/Document/content/tutorials/swap-memory/_index.en.md new file mode 100644 index 00000000..057af61c --- /dev/null +++ b/Document/content/tutorials/swap-memory/_index.en.md @@ -0,0 +1,78 @@ +--- +title: Swap Memory +weight: 1 +#pre: "1. " +# chapter: true +--- + +This tutorial instructs qitmeer node maintainers to mount swap memory to solve the Out of Memory problem. + +## Problem Description +Qitmeer's recommended memory perquisite is 2GB, 1 GB at minimum. Even though memory has satisfied the recommended requirement, it is still possible that Qitmeer gets killed by system due to peak usage of memory, called Out of Memory exception. + +```sh +2021-03-23|07:45:22.110 [INFO ] Processed 211 blocks in the last 10s (217 transactions, order 283091, 2020-09-27 15:05:08 +0800 CST) module=blkmanager +[1] 196072 killed ./build/bin/qitmeer + +``` + +You may confirm this exception by the command: + +> Note: assume OS is Ubuntu + +```sh +dmesg -T| grep -E -i -B100 'killed process' +``` +If you find similar output as follows, then that maybe the case +```sh +[Tue Mar 9 11:34:26 2021] Out of memory: Killed process 140587 (qitmeer) total-vm:1403144kB, +anon-rss:675828kB, file-rss:0kB, shmem-rss:0kB, UID:1001 pgtables:1532kB oom_score_adj:0 +``` + +## Solution +### What is Swap Memory +OS could transfer inactive memory into hard disk to make room for active processes, called memory swapping. Although this mechanism would reduce the overall performance of machines due to high swapping cost between physical memory and virtual memory (hard disk), it brings stronger stability. + +## How to mount swap memory +> Note: Ensure you have root permission + +1. create folder for swap file + +```bash +root@Qit:/home/tony$ cd / +root@Qit:/$ mkdir swap +root@Qit:/$ cd swap/ +``` + +2. create a 2GB swap file +```bash +root@Qit:/swap$ dd if=/dev/zero of=SWAPFILE bs=1024 count=2097152 +2097152+0 records in +2097152+0 records out +2147483648 bytes (2.1 GB, 2.0 GiB) copied, 14.838 s, 145 MB/s +``` + +3. convert into swap format +```sh +root@Qit:/swap$ mkswap SWAPFILE 2097152 +mkswap: SWAPFILE: insecure permissions 0644, 0600 suggested. +Setting up swapspace version 1, size = 2 GiB (2147479552 bytes) +no label, UUID=06ee7e99-ab8f-4378-b0d0-3f5477bd1090 +``` + +4. format swap file +```sh +root@Qit:/swap$ swapon SWAPFILE +swapon: /swap/SWAPFILE: insecure permissions 0644, 0600 suggested. +``` +check swap file usage +```sh +root@Qit:/swap$ free + total used free shared buff/cache available +Mem: 980192 271480 63400 2676 645312 545572 +Swap: 2097148 0 2097148 +``` +5. auto mount swap file on booting +```sh +root@Qit:~$ echo "/swap/SWAPFILE swap swap defaults 0 0" >> /etc/fstab +``` \ No newline at end of file From c95c4e4e08c88114730be66f7c66836a19e80dae Mon Sep 17 00:00:00 2001 From: forchain Date: Tue, 23 Mar 2021 12:07:07 +0800 Subject: [PATCH 66/69] fix issuance desc. --- Document/content/faqs/qitmeer-token-issuance/_index.en.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Document/content/faqs/qitmeer-token-issuance/_index.en.md b/Document/content/faqs/qitmeer-token-issuance/_index.en.md index 8dd1beb4..6cc2a000 100644 --- a/Document/content/faqs/qitmeer-token-issuance/_index.en.md +++ b/Document/content/faqs/qitmeer-token-issuance/_index.en.md @@ -5,4 +5,4 @@ weight: 5 # chapter: true --- -Qitmeer assets issuance component, OP_TOKEN, is based on UTXO (Unspent Transaction Output) transaction model, to support massive islamic economic liquidity. OP_TOKEN ensures assets backed by native currency and requires authority-owned licenses to publish assets, preventive from . \ No newline at end of file +Qitmeer assets issuance component, OP_TOKEN, is based on UTXO (Unspent Transaction Output) transaction model, to support massive islamic economic liquidity. OP_TOKEN ensures assets backed by native currency and requires authority-owned licenses to publish assets, prevented from scammer assets. \ No newline at end of file From eb84cecd94863ca95c587507c304efcc2f732b8a Mon Sep 17 00:00:00 2001 From: Alex Wu Date: Wed, 11 Aug 2021 12:59:13 +0800 Subject: [PATCH 67/69] Update _index.en.md update `getNodeInfo` document --- .../JSON RPC API/getNodeInfo/_index.en.md | 57 ++++++++++--------- 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/Document/content/JSON RPC API/getNodeInfo/_index.en.md b/Document/content/JSON RPC API/getNodeInfo/_index.en.md index e0b19a32..47d0cac9 100644 --- a/Document/content/JSON RPC API/getNodeInfo/_index.en.md +++ b/Document/content/JSON RPC API/getNodeInfo/_index.en.md @@ -13,7 +13,7 @@ None #### Returns - `result: object` - - `UUID: (string)` - unique ID + - `ID: (string)` - mutipleaddress ID - `version: (numeric)` - The version of the node as a numeric. - `buildversion: (string)` - build version - `protocolversion: (numeric)` - The protocol version of the node. @@ -26,57 +26,58 @@ None - `timeoffset: (numeric)` - The node clock offset in seconds - `connections: (numeric)` - number of connections - `pow_diff: (object)` - difficulty of POW - - `blake2bd_diff: (numeric)` - difficulty of Blake2B, pure CPU mining - - `cuckaroo_diff: (numeric)` - difficulty of cuckaroo, anti-ASIC GPU mining - - `cuckatoo_diff: (numeric)` - difficulty of cuckatoo, ASIC friendly GPU mining - - `testnet: (boolean)` - launch test net - - `mixnet: (boolean)` - launch mix net + - `current_diff: (numeric)` - current difficulty - `confirmations: (numeric)` - number of blocks to wait for safe confirmation - `coinbasematurity: (numeric)` - number of blocks to wait for coinbase to be spent - - `error: (string)` - error message if happened - `modules: (array)` - loaded modules; qitmeer, miner, test by default + - `network: (string)` - current network + - `connections: (numeric)` - current connections #### Example Request ```bash -curl --data '{"method":"getNodeInfo","params":[],"jsonrpc":"2.0","id":1}' -s -k -u "rpcuser:rpcpass" -H 'Content-Type: application/json' http://127.0.0.1:18131 | jq +curl --data '{"method":"getNodeInfo","params":[],"jsonrpc":"2.0","id":1}' -s -k -u "rpcuser:rpcpass" -H 'Content-Type: application/json' https://127.0.0.1:18131 | jq ``` Response ```js { - "UUID": "2e3dddbe-2646-4964-b4ad-5a9b9fd83010", - "version": 80500, - "buildversion": "0.8.5+dev-30736c5", - "protocolversion": 19, - "totalsubsidy": 343068000000000, + "jsonrpc": "2.0", + "id": 1, + "result": { + "ID": "16Uiu2HAmJq8eGgj7aUE9DANQUssg6b4T1jRJDq4tvwKjnCZKk1cE", + "address": [ + "/ip4/10.0.0.6/tcp/18150/p2p/16Uiu2HAmJq8eGgj7aUE9DANQUssg6b4T1jRJDq4tvwKjnCZKk1cE", + ], + "version": 100300, + "buildversion": "0.10.3+dev-1742484", + "protocolversion": 33, + "totalsubsidy": 991716000000000, "graphstate": { "tips": [ - "00004d5e83f46cf14de8e4a8c76cf6831d1a294654076eabda19bf939a1e5786 main" + "e6787427f5f4704eed0651181c4f3341fb1acaf1cbc63b215865da22ea6442b6 main", + "3b7b986370bc4cf5d6c14102ef2c198ff23e1e5b8e883208a0c1c8440e9f04f9" ], - "mainorder": 28656, - "mainheight": 26284, - "layer": 26285 + "mainorder": 114143, + "mainheight": 48694, + "layer": 49908 }, - "timeoffset": 0, - "connections": 8, + "timeoffset": -1, "pow_diff": { - "blake2bd_diff": 1, - "cuckaroo_diff": 23554, - "cuckatoo_diff": 1 + "current_diff": 2933.93160025 }, - "testnet": true, - "mixnet": false, "confirmations": 10, "coinbasematurity": 720, - "errors": "", "modules": [ "qitmeer", "miner", - "test" - ] + "test", + "log" + ], + "network": "testnet", + "connections": 21 } - +} ``` From ec57bdaa403a1ab03452437b3d04a2b6507edf5c Mon Sep 17 00:00:00 2001 From: SecorD0 Date: Sat, 14 Aug 2021 00:47:17 +0300 Subject: [PATCH 68/69] There are the typos --- Document/content/intro/_index.en.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Document/content/intro/_index.en.md b/Document/content/intro/_index.en.md index dd05447e..7ade478f 100644 --- a/Document/content/intro/_index.en.md +++ b/Document/content/intro/_index.en.md @@ -22,10 +22,10 @@ Qitmeer use SPECTRE as its fundamental Consensus protocol. SPECTRE is a fast\-co Qitmeer Consensus is compliant with Classical Blockchain Setting - it could enter and leave network freely by Proof-of-Work, and the collaboration model of DAG ledger guarantees that miners gain rewards consistent with their devotion, 50\% faulty tolerance as secure as bitcoin, robust scalability that is only subject to physical network limit. The mining algorithm is also a vital source of fairness other than consensus algorithm per se. Cuckoo Ring is a graph theory based proof-of-work mining algorithm and is practically ASIC resistant due to memory-hard calculation. -#### Qitmeer token & Isamlic financial ecosystem +#### Qitmeer token & Islamic financial ecosystem Qitmeer originates a UTXO-based unique token insurance scheme, which has effectively answered two main concerns: Intrinsic Value and Assets Authentication. Issuing a certain amount of assets must consume a certain amount of the native currency; moreover, entities must be warranted a license to issue assets. -Qitmeer devises a family of specifications and protocols to embrace the whole Isamlic financial ecosystem, such as wallet and miners. As for interoperability, Qitmeer calls for utilizing cross-chain protocols to integrate various cryptocurrencies and offer reliable off-chain smart contract services. +Qitmeer devises a family of specifications and protocols to embrace the whole Islamic financial ecosystem, such as wallet and miners. As for interoperability, Qitmeer calls for utilizing cross-chain protocols to integrate various cryptocurrencies and offer reliable off-chain smart contract services. -#### [Qitmeer mining difficulty adjustment](./qitmeer-difficulty-description) \ No newline at end of file +#### [Qitmeer mining difficulty adjustment](./qitmeer-difficulty-description) From dd6b56f3816081757fec743922adfbe11afda089 Mon Sep 17 00:00:00 2001 From: bCoder778 Date: Tue, 12 Oct 2021 15:14:10 +0800 Subject: [PATCH 69/69] modify wallet api parmas --- .../Wallet/getAccountsAndBalance/_index.md | 7 +++++-- .../Wallet/getBalanceByAccount/_index.md | 4 +++- .../Wallet JSON RPC API/Wallet/getBalanceByAddr/_index.md | 4 +++- .../Wallet JSON RPC API/Wallet/sendToAddress/_index.md | 2 +- .../Wallet/sendToAddressByAccount/_index.md | 2 +- .../Wallet JSON RPC API/Wallet/sendToMany/_index.en.md | 2 +- 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/Document/content/Wallet JSON RPC API/Wallet/getAccountsAndBalance/_index.md b/Document/content/Wallet JSON RPC API/Wallet/getAccountsAndBalance/_index.md index 50300407..7fdf5c30 100644 --- a/Document/content/Wallet JSON RPC API/Wallet/getAccountsAndBalance/_index.md +++ b/Document/content/Wallet JSON RPC API/Wallet/getAccountsAndBalance/_index.md @@ -17,12 +17,13 @@ None 2. `SpendAmount: (numeric)` spent amount, already confirmed 3. `UnspendAmount: (numeric)` spendable amount, not including frozen amount 4. `ConfirmAmount: (numeric)` frozen amount, waiting for conformation -... +5. `LockAmount: (numeric)` locked amount, waiting for unlock +. #### Example ##### Request ```sh - $ curl -sk -u "test:test" -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"1.0","method":"wallet_getAccountsAndBalance","params":[],"id":1}' http://127.0.0.1:8130/api |jq . + $ curl -sk -u "test:test" -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"1.0","method":"wallet_getAccountsAndBalance","params":["MEER"],"id":1}' http://127.0.0.1:8130/api |jq . ``` ##### Response ```json @@ -32,12 +33,14 @@ None "result": { "default": { "TotalAmount": 0, + "LockAmount": 0, "SpendAmount": 0, "UnspendAmount": 0, "ConfirmAmount": 0 }, "imported": { "TotalAmount": 676444792042, + "LockAmount": 0, "SpendAmount": 1366909827084, "UnspendAmount": 676444792042, "ConfirmAmount": 0 diff --git a/Document/content/Wallet JSON RPC API/Wallet/getBalanceByAccount/_index.md b/Document/content/Wallet JSON RPC API/Wallet/getBalanceByAccount/_index.md index eaa4e63a..3b73265f 100644 --- a/Document/content/Wallet JSON RPC API/Wallet/getBalanceByAccount/_index.md +++ b/Document/content/Wallet JSON RPC API/Wallet/getBalanceByAccount/_index.md @@ -14,11 +14,12 @@ Get balance by account 2. `SpendAmount: (numeric)` spent amount, already confirmed 3. `UnspendAmount: (numeric)` spendable amount, not including frozen amount 4. `ConfirmAmount: (numeric)` frozen amount, waiting for conformation +5. `LockAmount: (numeric)` locked amount, waiting for unlock #### Example ##### Request ```sh - $ curl -sk -u "test:test" -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"1.0","method":"wallet_getBalanceByAccount","params":["test"],"id":1}' http://127.0.0.1:8130/api |jq . + $ curl -sk -u "test:test" -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"1.0","method":"wallet_getBalanceByAccount","params":["test", "MEER"],"id":1}' http://127.0.0.1:8130/api |jq . ``` ##### Response ```json @@ -28,6 +29,7 @@ Get balance by account "result": { "TotalAmount": 900000000, "SpendAmount": 0, + "LockAmount": 0, "UnspendAmount": 900000000, "ConfirmAmount": 0 } diff --git a/Document/content/Wallet JSON RPC API/Wallet/getBalanceByAddr/_index.md b/Document/content/Wallet JSON RPC API/Wallet/getBalanceByAddr/_index.md index 8abd9aef..5d337085 100644 --- a/Document/content/Wallet JSON RPC API/Wallet/getBalanceByAddr/_index.md +++ b/Document/content/Wallet JSON RPC API/Wallet/getBalanceByAddr/_index.md @@ -15,12 +15,13 @@ Get balance by address 2. `SpendAmount: (numeric)` spent amount, already confirmed 3. `UnspendAmount: (numeric)` spendable amount, not including frozen amount 4. `ConfirmAmount: (numeric)` frozen amount, waiting for conformation +5. `LockAmount: (numeric)` locked amount, waiting for unlock #### Example ##### Request ```sh -$ curl -k -u "test:test" -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"1.0","method":"wallet_getBalanceByAddr","params":["TmbC1Fx1UXNt7D6zpaj83UrAEW7MbcUWuQz"],"id":1}' http://127.0.0.1:8130/api +$ curl -k -u "test:test" -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"1.0","method":"wallet_getBalanceByAddr","params":["TmbC1Fx1UXNt7D6zpaj83UrAEW7MbcUWuQz", "MEER"],"id":1}' http://127.0.0.1:8130/api ``` ##### Response @@ -31,6 +32,7 @@ $ curl -k -u "test:test" -X POST -H 'Content-Type: application/json' --data '{"j "result": { "TotalAmount": 900000000, "SpendAmount": 0, + "LockAmount": 0, "UnspendAmount": 900000000, "ConfirmAmount": 0 } diff --git a/Document/content/Wallet JSON RPC API/Wallet/sendToAddress/_index.md b/Document/content/Wallet JSON RPC API/Wallet/sendToAddress/_index.md index 8ad2504f..7a0b2deb 100644 --- a/Document/content/Wallet JSON RPC API/Wallet/sendToAddress/_index.md +++ b/Document/content/Wallet JSON RPC API/Wallet/sendToAddress/_index.md @@ -26,7 +26,7 @@ sends the passed amount to the given address. ### Example #### Request ```sh -$ curl -sk -u "test:test" -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"1.0","method":"wallet_sendToAddress","params":["Tmdcmmo7JqxxwHy6r46Sx2ZRbVF2dSjG9mm", 1 ],"id":1}' http://127.0.0.1:8130/api |jq . +$ curl -sk -u "test:test" -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"1.0","method":"wallet_sendToAddress","params":["Tmdcmmo7JqxxwHy6r46Sx2ZRbVF2dSjG9mm", 1 , "MEER"],"id":1}' http://127.0.0.1:8130/api |jq . ``` #### Response diff --git a/Document/content/Wallet JSON RPC API/Wallet/sendToAddressByAccount/_index.md b/Document/content/Wallet JSON RPC API/Wallet/sendToAddressByAccount/_index.md index 9339cc02..915e37c9 100644 --- a/Document/content/Wallet JSON RPC API/Wallet/sendToAddressByAccount/_index.md +++ b/Document/content/Wallet JSON RPC API/Wallet/sendToAddressByAccount/_index.md @@ -31,7 +31,7 @@ send passed amount using specific account ### Example #### Request ```sh -$ curl -sk -u "test:test" -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"1.0","method":"wallet_sendToAddressByAccount","params":["test", "Tmb1dCAB8ixNC6d2VtdCYZuhXBVPbnRVi7y", 0.999, "", ""],"id":1}' http://127.0.0.1:8130/api |jq . +$ curl -sk -u "test:test" -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"1.0","method":"wallet_sendToAddressByAccount","params":["test", "Tmb1dCAB8ixNC6d2VtdCYZuhXBVPbnRVi7y", 0.999, "MEER", "", ""],"id":1}' http://127.0.0.1:8130/api |jq . ``` #### Response diff --git a/Document/content/Wallet JSON RPC API/Wallet/sendToMany/_index.en.md b/Document/content/Wallet JSON RPC API/Wallet/sendToMany/_index.en.md index 5abb0ece..ab08dd0f 100644 --- a/Document/content/Wallet JSON RPC API/Wallet/sendToMany/_index.en.md +++ b/Document/content/Wallet JSON RPC API/Wallet/sendToMany/_index.en.md @@ -25,7 +25,7 @@ sends multiple amounts to multiple addresses using the provided account as a sou ### Example #### Request ```sh -$ curl -sk -u "test:test" -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"1.0","method":"wallet_sendToMany","params":[{"TmVLfSPy3NZY1uDjJka92hqpPJR9k2XztQb":0.9, "TmR1kwdfb6pyQRNoJJMU2M62qEqJzqXPNBw":0.99} ],"id":1}' http://127.0.0.1:8130/api |jq . +$ curl -sk -u "test:test" -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"1.0","method":"wallet_sendToMany","params":[{"TmVLfSPy3NZY1uDjJka92hqpPJR9k2XztQb":0.9, "TmR1kwdfb6pyQRNoJJMU2M62qEqJzqXPNBw":0.99}, "MEER" ],"id":1}' http://127.0.0.1:8130/api |jq . ```