diff --git a/docs/build/clients/daemon-rpc-api/_category_.json b/docs/build/clients/daemon-rpc-api/_category_.json index f02f0e3..981a672 100644 --- a/docs/build/clients/daemon-rpc-api/_category_.json +++ b/docs/build/clients/daemon-rpc-api/_category_.json @@ -1,4 +1,4 @@ { "label": "Dameon RPC API", - "position": 1 + "position": 3 } diff --git a/docs/build/clients/daemon-rpc-api/methods/getblockcount.md b/docs/build/clients/daemon-rpc-api/getblockcount.md similarity index 81% rename from docs/build/clients/daemon-rpc-api/methods/getblockcount.md rename to docs/build/clients/daemon-rpc-api/getblockcount.md index 04fb4eb..eb01e76 100644 --- a/docs/build/clients/daemon-rpc-api/methods/getblockcount.md +++ b/docs/build/clients/daemon-rpc-api/getblockcount.md @@ -1,3 +1,5 @@ +Retrieves the current number of blocks in the longest chain known to this node + ### Request ```json diff --git a/docs/build/clients/daemon-rpc-api/getblocktemplate.md b/docs/build/clients/daemon-rpc-api/getblocktemplate.md new file mode 100644 index 0000000..c9086a9 --- /dev/null +++ b/docs/build/clients/daemon-rpc-api/getblocktemplate.md @@ -0,0 +1,53 @@ +Creates a template for the next block + +### Request + +```json +{ + "jsonrpc": "2.0", + "id": 0, + "method": "getblocktemplate", + "params": { + "wallet_address": "ZxDbSpgDzyaMecaMUi6orsLimz3M8ptCzYzEuboTdYmwai8xhyATWnkHCt26Ts2kT75ajPGgmDAWR6xdpVBto8Vz1dmQJp8AJ", + "extra_text": "", + "pos_block": false, + "stakeholder_address": "", + "pos_amount": 2, + "pos_index": 1 + } +} +``` + +### Body parameters + +- wallet_address - miner's address for receiving newly generated coins +- extra_text - additional text included into miner transaction. Cannot exceed 255 bytes. +- pos_block - specify type of block template to be created: PoS (true) or PoW (false). Default: false. +- stakeholder_address - specify miner's address to which the stake coins used in PoS block generation will be returned. +- pos_amount - amount of an output used as a stake. +- pos_index - global index of an output used as a stake. + +### Response + +```json +{ + "id": 0, + "jsonrpc": "2.0", + "result": { + "blocktemplate_blob": "020000000000000000c0ca345270aba4a14d8aa121bce0e520922e9408617b3fe7d538119dc5501d8200af8ea3a306000101009a8881010180a094a58d1d03c877d75e0c47484beac7fa33cf844230dbfdc5319a1b96ecd6540d23b4e16e1e000416ccff48a0e1aadf652945377b9a22eee97c2b7c0e051afb354425b4cc50451b1215000b0277610ea4888101000000", + "difficulty": "7192110102967", + "height": 2114586, + "prev_hash": "c0ca345270aba4a14d8aa121bce0e520922e9408617b3fe7d538119dc5501d82", + "seed": "ef86c183c51ed4fb2d1a7eec0a752fb2eeb1731d33ae58cb9bfe54880af23e7b", + "status": "OK" + } +} +``` + +### Response parameters + +- blocktemplate_blob- hex-encoded serialized block template. +- difficulty - difficulty for the block template. +- height - height corresponding to the block template. +- prev_hash - previous block hash. +- seed - ethash epoch seed (for mining purposes). diff --git a/docs/build/clients/daemon-rpc-api/getlastblockheader.md b/docs/build/clients/daemon-rpc-api/getlastblockheader.md new file mode 100644 index 0000000..7e7a6ed --- /dev/null +++ b/docs/build/clients/daemon-rpc-api/getlastblockheader.md @@ -0,0 +1,65 @@ +Returns the header of the last block in the blockchain. + +### Request + +```json +{ + "jsonrpc": "2.0", + "id": 0, + "method": "getlastblockheader", + "params": { + "depth": 1, + "difficulty": 1, + "hash": "", + "prev_hash": "", + "height": 1, + "major_version": 2, + "minor_version": 2, + "nonce": 1, + "orphan_status": true, + "reward": 1, + "timestamp": 1 + } +} +``` + +--- + +### Response + +```json +{ + "id": 0, + "jsonrpc": "2.0", + "result": { + "block_header": { + "depth": 0, + "difficulty": "7420770173471", + "hash": "5aaa041b0b0f805638a252a6646cfed727c119f38081fda99ceb06cafc00dd7c", + "height": 2114944, + "major_version": 2, + "minor_version": 0, + "nonce": 3074457348328269179, + "orphan_status": false, + "prev_hash": "15e89f8d63b814391d58a103a5314b3d37817e263201d92ab413ee680ea45a95", + "reward": 1000000000000, + "timestamp": 1684610354 + }, + "status": "OK" + } +} +``` + +### Response information + +- depth - unsigned int; distance in blocks from the blockchain top. Always zero for this call. +- difficulty - unsigned int; block difficulty. +- hash - string; block identifier. +- height - unsigned int; block height. +- major_version - unsigned int; major version of a block. +- minor_version - unsigned int; minor version of a block. +- nonce - unsigned int; block nonce. +- orphan_status - boolean; is this block orphan or not? Always false for this call. +- prev_hash - +- reward - unsigned int; how much money this block has generated. +- timestamp - unsigned int; block timestamp. diff --git a/docs/build/clients/daemon-rpc-api/methods/_category_.json b/docs/build/clients/daemon-rpc-api/methods/_category_.json deleted file mode 100644 index fcab66e..0000000 --- a/docs/build/clients/daemon-rpc-api/methods/_category_.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "label": "HTTP Methods", - "position": 3 -} diff --git a/docs/build/clients/daemon-rpc-api/on_getblockhash.md b/docs/build/clients/daemon-rpc-api/on_getblockhash.md new file mode 100644 index 0000000..034d9f7 --- /dev/null +++ b/docs/build/clients/daemon-rpc-api/on_getblockhash.md @@ -0,0 +1,24 @@ +Obtains block hash by given block height + +### Request + +```json +{ + "jsonrpc": "2.0", + "id": 0, + "method": "on_getblockhash", + "params": [2111] +} +``` + +--- + +### Response + +```json +{ + "id": "0", + "jsonrpc": "2.0", + "result": "68b3bcf941431fe76420059ce3104bb34ee122a49d0b541af1041ab06e0015bb" +} +``` diff --git a/docs/build/clients/daemon-rpc-api/submitblock.md b/docs/build/clients/daemon-rpc-api/submitblock.md new file mode 100644 index 0000000..2629211 --- /dev/null +++ b/docs/build/clients/daemon-rpc-api/submitblock.md @@ -0,0 +1,38 @@ +Submits the given block, i.e., adds it to the local blockchain and broadcasts it to the network + +### Request + +```json +{ + "jsonrpc": "2.0", + "id": 0, + "method": "submitblock", + "params": { + "blocks_blob": [ + "03000000000000000082c9bcdac5235a4e99e3862875a3e27137e623bd63f94ba66f7841ba22baa6e300c4a5d9a30600020100b8560416ab8369d10446e568bb09e692f88406547ea58e2feb8ea63f24be11d0b1cc8f0715000b0207f30ec25602264191c581563790e0df16ad75a42102d43428f6012fb460840980f29ddda9940bafe8d36221a9f8b86b492ba34127637f5dbd5679165ba2e899ad2a0c9cc33f95416228327e1739264d2f5cfe3dcb7541d9d688e9e5e6c9880a20eae15106772d74c32d3eaafafc623bf483e858d42e8bf4ec7df064ada2e34934469cff6b6268db894cb01aebc2a00026bd94233b6997d82f0bb10c816c71fa5dd617422bbb36fd0456fb8ea7499a97790de72a34afbf045859a1f12017ba2e3b87f3dd386ffdb8793b93982f2bba9544ea02c54f6c6a668610cb505a30e1fc8e9ee0088b8c1fecb800e34f1f3f88829374c32d3eaafafc623bf483e858d42e8bf4ec7df064ada2e34934469cff6b6268232da30f20273b5f000000032e002f07f77dc653e37b3a38a6e53fbfcbe47cefd7e27d5130dbfdc6be972a5162577ac6d822a876cd674a8df26781ec5c7a72f05f4fa20d8b83bcbee1107beeaceb926a8490a1953610ec9f25f5f0829001d816ab7e4db77277492f5ce0862b0d6f3bbd0b9d9829eb95103dbe45a00885dd2d920a0936bf584846e160852304a79911fd9fdb7e5da94a5b1c4f43d32199e7b74cce272098f47db56fb3536045a097ed72916646c916a1c14364a8358cee02d483d17b36bc6f412abf8d7382c9c31fa757e8b3e063533b5308eae4daf691ed0f0b437cd95816ba869cd7980daf0e2272fa07d2ced19035c4caaa974606e14235d003aae6ae6dcc570ba8e53500b96e2abc3c82eeda787fcd791364f822e5b353956a06eeb4635b995ce0843c0172fb61416d8a440c4113b3a4a66d4808262c27b9fa1585f99bb41e6ad663a676e67f225cbd39cbb2925428999ee766609c65345b6c1fd6bcf2357eeea2be20b14b4b7956cb7cb176c55de60bfc1927e67ef581d82cd140dedf5659a3512d59cf9fa5ba66c7a7f26b4a65d1a999f3f315ec14a47cfd785357273166558b04dea07ac96101e2036d9f81018f818810ca0faacc205ea939e409f79c80b7ad44ffa624315dcc4be7a85f97402c336c65e9130b134dfa32248f41e0d829e71a138a966f6e60b323872b9a8e5b82ed84b93d20155b32bc716f79d70aa22ba1514674dbef464029ca0854ca74b997a1ed8fda26be726f052fb6ca68ccc44b24da7ca0dbde4b3846a61d86521ef167f5d3f550fd30bb207499670e2c6ca8fdee61fcb9e045de76130465cd7d96590c85ca7ee534f729661a10fe268c8e481c115276d637a0e8655905c490360fa73286412d241b640bd586199a9fdf5f771faa61499751ab34fd3101028c788f39b8dcc1dcb263b31acf33d3af868530c6dc891a808a8066f48aa1c4652962f6b67e389e20e82ed3580643a46e737b27031d2b6a91e19abbf77eba400b021f8570961711802534d6d30a697d971124a3a1b50bc529f34210be08ee6203041eda2f0be95c7c1a77a7a8a00d5b1262296553f80fbfd8fa0fd6d54c6327250e02f5b9cc5104c7c4ce33698b1925fa03b60bb45a89d2be4bd57dec396f8e461806aecedd7e3f0c2216fb14026e05f8696232248e52b587aab8c40fa6c78174da04c2a65a9c02836303e5c3e983d1aaa98ba5e188f5ca3ff824902eda5d567bfe033035b18fb2e9a7171f7f4bf66ab9d637a16b07ac87c0b65ca1b9d89448cdf3ea0db71b06c3422729b7f1538d62b00af94144ebbdb01c90acdf898a4d753767460f00" + ] + } +} +``` + +### Body parameters + +- blocks_blob - array of a single string; block's blob. + +--- + +### Response + +```json +{ + "id": "0", + "jsonrpc": "2.0", + "result": { + "status": "OK" + } +} +``` + +### Response information + +- status - describes if the rpc call was successful diff --git a/docs/build/clients/daemon-rpc-api/how-to-call-api.md b/docs/build/clients/how-to-call-api.md similarity index 100% rename from docs/build/clients/daemon-rpc-api/how-to-call-api.md rename to docs/build/clients/how-to-call-api.md diff --git a/docs/build/clients/daemon-rpc-api/overview.md b/docs/build/clients/overview.md similarity index 100% rename from docs/build/clients/daemon-rpc-api/overview.md rename to docs/build/clients/overview.md diff --git a/docs/build/clients/wallet-rpc-api/_category_.json b/docs/build/clients/wallet-rpc-api/_category_.json new file mode 100644 index 0000000..9947c26 --- /dev/null +++ b/docs/build/clients/wallet-rpc-api/_category_.json @@ -0,0 +1,4 @@ +{ + "label": "Wallet RPC API", + "position": 4 +} diff --git a/docs/build/clients/wallet-rpc-api/getbalance.md b/docs/build/clients/wallet-rpc-api/getbalance.md new file mode 100644 index 0000000..538003d --- /dev/null +++ b/docs/build/clients/wallet-rpc-api/getbalance.md @@ -0,0 +1,31 @@ +Retrieves current wallet balance: total and unlocked. + +### Request + +```json +{ + "jsonrpc": "2.0", + "id": 0, + "method": "getbalance" +} +``` + +--- + +### Response + +```json +{ + "id": 0, + "jsonrpc": "2.0", + "result": { + "balance": 50000000033, + "unlocked_balance": 50000000033 + } +} +``` + +### Response information + +- balance - unsigned integer; total fund, that the wallet has (unlocked and locked coins). +- unlocked_balance - unsigned integer; unlocked funds, i.e. coins that are stored deep enough in the blockchain to be considered relatively safe to spend. Only this many coins are immediately spendable. Unlocked_balance is always less or equal to balance.