Chia FullNode RPC 奇亚全节点

解翰采
2023-12-01

全节点RPC目录:

  1. 获取区块链状态 get_blockchain_state
  2. 获取区块 get_block
  3. 获取指定范围的区块 get_blocks
  4. 通过高度获取区块记录 get_block_record_by_height
  5. 通过哈希获取区块记录 get_block_record
  6. 获取指定范围的区块记录 get_block_records
  7. 获取未完成区块的记录列表 get_unfinished_block_headers
  8. 通过哈希获取区块空间 get_network_space
  9. 获取添加和删除的硬币记录 get_additions_and_removals
  10. 检索区块链的初始冻结期 get_initial_freeze_period
  11. 获取网络状态 get_network_info
  12. 获取硬币记录 get_coin_records_by_puzzle_hash
  13. 通过硬币名称获取硬币记录 get_coin_record_by_name
  14. 广播交易 push_tx
  15. 获取内存池子的交易ID列表 get_all_mempool_tx_ids
  16. 获取内存池的交易列表 get_all_mempool_items

获取区块链状态

请求地址: https://localhost:8555/get_blockchain_state

参数: {"":""}

执行:

curl --insecure --cert ~/.chia/mainnet/config/ssl/full_node/private_full_node.crt --key ~/.chia/mainnet/config/ssl/full_node/private_full_node.key -d '{"":""}' -H "Content-Type: application/json" -X POST https://localhost:8555/get_blockchain_state

返回参数说明:

blockchain_state 区块链状态
	difficulty 区块难度
	genesis_challenge_initialized 创世区块的初始化
	mempool_size 
	peak 
	space 预估网络空间大小
	sub_slot_iters VDF子项迭代数
	sync 同步状态
		sync_mode 同步模式
		sync_progress_height 当前同步高度
		sync_tip_height 同步目标高度
		synced 同步完成
success 请求是否成功

返回结果:

{
    "blockchain_state": {
        "difficulty": 10, 
        "genesis_challenge_initialized": true, 
        "mempool_size": 0, 
        "peak": {
            "challenge_block_info_hash": "0x86cfb602069dfc2b3d7ad184a6d0ec58ff3908761f25b6da43db4cb4a5c8ff84", 
            "challenge_vdf_output": {
                "data": "0x0300d1a95908c77edc9ac0e73d945c71f5e472cb330edef42aa7e16e1e5507af549f79ea86767276b028a07ef9eb8d2db867d96c423148db8de76f2c730c5d3451062b7f4dbd65fc079b9204f7f7ee9e499ca4164524f5550d0c9767d999628dab020706"
            }, 
            "deficit": 0, 
            "farmer_puzzle_hash": "0xc06509b61e53cfd7b2ae1c8861fc087799cd9b27798ac6a899ecc709c073d4e8", 
            "fees": 0, 
            "finished_challenge_slot_hashes": null, 
            "finished_infused_challenge_slot_hashes": null, 
            "finished_reward_slot_hashes": null, 
            "header_hash": "0xd55d486da11f2192cf21c849a8082cfed1d8d656994d5eb1cf5f587f766f814c", 
            "height": 42528, 
            "infused_challenge_vdf_output": {
                "data": "0x010043ccd629f65de3b82a0447cac2bb38f704f839949430c59c700baaf995e3aad73361808f6f528a7af1196fe5f873f7e98742fda0abede7a661eac9094de6b660d8e7285c4bd5f6f0faa2e6fecdb878bff5aa9e9c8bb40f1302cfe79a634fad0f0100"
            }, 
            "overflow": false, 
            "pool_puzzle_hash": "0xc06509b61e53cfd7b2ae1c8861fc087799cd9b27798ac6a899ecc709c073d4e8", 
            "prev_hash": "0x59c2df7c89df5477fdbc4b9e86ddfbde777b0b1bd817a6f66107c92bec9855e1", 
            "prev_transaction_block_hash": "0x90f198f76428862df560f9f6150e6275991f534b0672d873b7bcf9da599149df", 
            "prev_transaction_block_height": 42523, 
            "required_iters": 1265789, 
            "reward_claims_incorporated": [
                {
                    "amount": 1750000000000, 
                    "parent_coin_info": "0xccd5bb71183532bff220ba46c268991a0000000000000000000000000000a61b", 
                    "puzzle_hash": "0xb7afc69bc543e0a52fe7f81fa7f5bc4391396c4ac30f66cd9b981697f186e8bb"
                }, 
                {
                    "amount": 250000000000, 
                    "parent_coin_info": "0x3ff07eb358e8255a65c30a2dce0e5fbb0000000000000000000000000000a61b", 
                    "puzzle_hash": "0xb7afc69bc543e0a52fe7f81fa7f5bc4391396c4ac30f66cd9b981697f186e8bb"
                }, 
                {
                    "amount": 1750000000000, 
                    "parent_coin_info": "0xccd5bb71183532bff220ba46c268991a0000000000000000000000000000a61a", 
                    "puzzle_hash": "0x1d97e91874218994a19fb5bdee5c0049c27f7026eed72e9587bdeb7f20d5118a"
                }, 
                {
                    "amount": 250000000000, 
                    "parent_coin_info": "0x3ff07eb358e8255a65c30a2dce0e5fbb0000000000000000000000000000a61a", 
                    "puzzle_hash": "0x1d97e91874218994a19fb5bdee5c0049c27f7026eed72e9587bdeb7f20d5118a"
                }, 
                {
                    "amount": 1750000000000, 
                    "parent_coin_info": "0xccd5bb71183532bff220ba46c268991a0000000000000000000000000000a619", 
                    "puzzle_hash": "0xea4ac72758db26c0d584f44ab1a52959d6a841c1e9df1504f2a708d30dda4090"
                }, 
                {
                    "amount": 250000000000, 
                    "parent_coin_info": "0x3ff07eb358e8255a65c30a2dce0e5fbb0000000000000000000000000000a619", 
                    "puzzle_hash": "0xea4ac72758db26c0d584f44ab1a52959d6a841c1e9df1504f2a708d30dda4090"
                }, 
                {
                    "amount": 1750000000000, 
                    "parent_coin_info": "0xccd5bb71183532bff220ba46c268991a0000000000000000000000000000a618", 
                    "puzzle_hash": "0xa025baf5d9b876710908ca324955b755bd60fe710d03137d729a0b634dd2155b"
                }, 
                {
                    "amount": 250000000000, 
                    "parent_coin_info": "0x3ff07eb358e8255a65c30a2dce0e5fbb0000000000000000000000000000a618", 
                    "puzzle_hash": "0xa025baf5d9b876710908ca324955b755bd60fe710d03137d729a0b634dd2155b"
                }, 
                {
                    "amount": 1750000000000, 
                    "parent_coin_info": "0xccd5bb71183532bff220ba46c268991a0000000000000000000000000000a617", 
                    "puzzle_hash": "0x76db8f1bebe7f488bd7d34fbba13106bfb8da63a1548e813b83572ede4a5c16b"
                }, 
                {
                    "amount": 250000000000, 
                    "parent_coin_info": "0x3ff07eb358e8255a65c30a2dce0e5fbb0000000000000000000000000000a617", 
                    "puzzle_hash": "0x76db8f1bebe7f488bd7d34fbba13106bfb8da63a1548e813b83572ede4a5c16b"
                }
            ], 
            "reward_infusion_new_challenge": "0x123dec81754ff2afe8903fe8c1dcbf51430bd6688cd8e75961959289bbf76362", 
            "signage_point_index": 41, 
            "sub_epoch_summary_included": null, 
            "sub_slot_iters": 113246208, 
            "timestamp": 1616898129, 
            "total_iters": 137988886653, 
            "weight": 369944
        }, 
        "space": 172949204858750080, 
        "sub_slot_iters": 113246208, 
        "sync": {
            "sync_mode": false, 
            "sync_progress_height": 0, 
            "sync_tip_height": 0, 
            "synced": false
        }
    }, 
    "success": true
}

获取区块

请求地址: https://localhost:8555/get_block

参数: {"header_hash":"0xd780d22c7a87c9e01d98b49a0910f6701c3b95015741316b3fda042e5d7b81d2"}

参数说明:

header_hash 头部哈希

执行:

curl --insecure --cert ~/.chia/mainnet/config/ssl/full_node/private_full_node.crt --key ~/.chia/mainnet/config/ssl/full_node/private_full_node.key -d '{"header_hash":"0xd780d22c7a87c9e01d98b49a0910f6701c3b95015741316b3fda042e5d7b81d2"}' -H "Content-Type: application/json" -X POST https://localhost:8555/get_block

返回参数说明:

block 区块信息
success 请求是否成功

返回结果:

{
    "block": {
        "challenge_chain_ip_proof": {
            "normalized_to_identity": true,
            "witness": "0x0100fd641357188b5e18f962148c1ceb8e0816c25c657cf0fd971c1a6ed528cea74529c585eef17df64fa2037b2ed1d3ba4035f7a6caad4e67ca7a41bed242e0e51ac603130ce5c7c6f5f3d22cad0d95403ab6619ef81076115248582f325bc90e0a0100",
            "witness_type": 0
        },
        "challenge_chain_sp_proof": {
            "normalized_to_identity": true,
            "witness": "0x030040c178e0d3470733621c74dde8614c0421d03ad2ce3bb7cad3616646e3762b35568fbae23139119f7affdc7201f45ee284cc76be6e341c795ccb5779cf102305a31bae2f870ea52c87fb0803a4493a2eb1a2cbbce7e467938cb73447edde2d1b0100",
            "witness_type": 0
        },
        "finished_sub_slots": [],
        "foliage": {
            "foliage_block_data": {
                "extension_data": "0x0000000000000000000000000000000000000000000000000000000003a2c7c9",
                "farmer_reward_puzzle_hash": "0x3d8765d3a597ec1d99663f6c9816d915b9f68613ac94009884c4addaefcce6af",
                "pool_signature": "0x95bc50737062a206ed36172634a2cebcb8cf045d044969baabb8504c99668d160635452c31389d16714d5bd61fc46b081975aca7f36a9aa8323ef38d5c751b13cc01cd7dc04d979ea0dd82ab8ef394d49998cf2865d4411d5a05bcf4bb8f2627",
                "pool_target": {
                    "max_height": 0,
                    "puzzle_hash": "0xd23da14695a188ae5708dd152263c4db883eb27edeb936178d4d988b8f3ce5fc"
                },
                "unfinished_reward_block_hash": "0x72befeb88e0b6612e0c5ddc94bf6b64bb2097579d418aede6d6006951720ddb3"
            },
            "foliage_block_data_signature": "0xaa11b01a2bc6bd1d6cdf030b9699aa1ee30a5d318f1fafc66489b1d41d096500f4aaddea9eed4f44e853ad9905d421660a216242c0d39b8fca8ac69964d78d701731940d30d6645320cfa570a1679f5308941093118ba94c279e7158c37f6d37",
            "foliage_transaction_block_hash": "0x8a32059ed30637d342ad40a7324fdbd14d4060eb91ba381480e52bb249e34648",
            "foliage_transaction_block_signature": "0xafe1dbb908edd6b466115fbd9755f86462a36d94da5b94aa00c9f7708b6f8c5df7b877e813f87c9bbbdef691845414da10449d51a6ac8ef86c5befb4511a2b7da4c82a38a9e14b3d94b96c7219ee5abd930ecee202ba697d6d27a6a7f914d999",
            "prev_block_hash": "0xccd5bb71183532bff220ba46c268991a3ff07eb358e8255a65c30a2dce0e5fbb",
            "reward_block_hash": "0xbdde7b5b2bc6025c07a9f5233d8eae167bea654146b272652262b362524c3e85"
        },
        "foliage_transaction_block": {
            "additions_root": "0x0000000000000000000000000000000000000000000000000000000000000000",
            "filter_hash": "0x6e340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d",
            "prev_transaction_block_hash": "0xccd5bb71183532bff220ba46c268991a3ff07eb358e8255a65c30a2dce0e5fbb",
            "removals_root": "0x0000000000000000000000000000000000000000000000000000000000000000",
            "timestamp": 1616162474,
            "transactions_info_hash": "0x4d65bf0d9286451647b8bff948b0e8cf7ad57125958eb84d4d32a7cfde441e03"
        },
        "infused_challenge_chain_ip_proof": null,
        "reward_chain_block": {
            "challenge_chain_ip_vdf": {
                "challenge": "0xccd5bb71183532bff220ba46c268991a3ff07eb358e8255a65c30a2dce0e5fbb",
                "number_of_iterations": 11798946,
                "output": {
                    "data": "0x0000dafd52467f3f66cf25c7de3e432188b9c3000b95a09170ace441a214cffc5fa65a39a66f11085fea9c7a121cf7f86a74142506b6d51d6036097bff862707185dbba577707c248f2fca5877337e56905879a2ee840d28860c50ebcacaaaf53a660100"
                }
            },
            "challenge_chain_sp_signature": "0x94ef18a3cb94e91b987eaab5e7d2ed33ca69598b2278c4bea87ac6ef0217842b9db79bb6906719f671971ab328d2a47709cea008e64e5099d563757b78c3ed8bb0f7757294eca643b08e7ab4410e5628037ddc4cf47f613fedfbfb97672d2b08",
            "challenge_chain_sp_vdf": {
                "challenge": "0xccd5bb71183532bff220ba46c268991a3ff07eb358e8255a65c30a2dce0e5fbb",
                "number_of_iterations": 4194304,
                "output": {
                    "data": "0x0300445cbcaa176166d9a50b9699e9394be46766c8f6494a1a9afd95bb5dc652ee42101278ad7358baf4ae727e4f5a6f732e3a8c26d9d11365081275a6d4b36dda63a905baffdaebab3311d8d6e2f356edf3bb1cf90e5654e688869d66d1c60676440100"
                }
            },
            "height": 0,
            "infused_challenge_chain_ip_vdf": null,
            "is_transaction_block": true,
            "pos_ss_cc_challenge_hash": "0xccd5bb71183532bff220ba46c268991a3ff07eb358e8255a65c30a2dce0e5fbb",
            "proof_of_space": {
                "challenge": "0xbd9c2a80bbb08c340c365a96af54d60319cc7695436e11b8b2a2f8cf147bc872",
                "plot_public_key": "0xa5288853edf400f6152f1e3c5fb9ee5055d4d9d02d79a35a00183b0064a8d9bb3571f04ee3cbc4432a7ce7413d5dacaa",
                "pool_contract_puzzle_hash": null,
                "pool_public_key": "0xa15afd4ef858cdc97769e61d79a0b03d5bf108d46f2bc47d7cd549ce43f350a121821a9834c0a68c267306718c2c2bf8",
                "proof": "0x8d7c7c7763847953a9b3e56d8145b8a712b2bc8116c0dfc2db7cbbf270ef253b8539877e992b32087f5a45c218acaf21a02d8ceded9d19fd67b74c6aa91a164e69d13ad99e0559ead07b7237809de00e8a412683e5acfa407675c09bac790d94ae40b5998c21f1522635dfaf235ad1b5853120f3876f6e0fab04d3945887063c78ab3e1babbd30da02a120f59511143411be53db3c8b40815ee8f82aee2863643540d524c8f7042cb4b63861da7f0e35e7ed41f97bd24b9d9294090bee1eb9a2410946048519772665a7f414f20776a5ca215d1af269e591e033e96c8611dda93a6e00d58929bd3a734f2886c273c55b70c2348689b19d5234d778a48620c79d",
                "size": 32
            },
            "reward_chain_ip_vdf": {
                "challenge": "0xccd5bb71183532bff220ba46c268991a3ff07eb358e8255a65c30a2dce0e5fbb",
                "number_of_iterations": 11798946,
                "output": {
                    "data": "0x0000dafd52467f3f66cf25c7de3e432188b9c3000b95a09170ace441a214cffc5fa65a39a66f11085fea9c7a121cf7f86a74142506b6d51d6036097bff862707185dbba577707c248f2fca5877337e56905879a2ee840d28860c50ebcacaaaf53a660100"
                }
            },
            "reward_chain_sp_signature": "0x94ef18a3cb94e91b987eaab5e7d2ed33ca69598b2278c4bea87ac6ef0217842b9db79bb6906719f671971ab328d2a47709cea008e64e5099d563757b78c3ed8bb0f7757294eca643b08e7ab4410e5628037ddc4cf47f613fedfbfb97672d2b08",
            "reward_chain_sp_vdf": {
                "challenge": "0xccd5bb71183532bff220ba46c268991a3ff07eb358e8255a65c30a2dce0e5fbb",
                "number_of_iterations": 4194304,
                "output": {
                    "data": "0x0300445cbcaa176166d9a50b9699e9394be46766c8f6494a1a9afd95bb5dc652ee42101278ad7358baf4ae727e4f5a6f732e3a8c26d9d11365081275a6d4b36dda63a905baffdaebab3311d8d6e2f356edf3bb1cf90e5654e688869d66d1c60676440100"
                }
            },
            "signage_point_index": 2,
            "total_iters": 11798946,
            "weight": 7
        },
        "reward_chain_ip_proof": {
            "normalized_to_identity": false,
            "witness": "0x0100069fef389d0cab01b732a1f9df5a613791a675c6d374a273815ac52456791f5b54990e239101092f8c9b1f10f00831b3081a8bacb4ed30a4f1a3b880985627231bde6dfab8a923543cf4a479c167a4efaa99bc757bed4ae8ce323ee425fd0a2301000000000000280230d9e99169933c68691769e36eafc2c5cd77643c5764ae881670d73ce5b6f354a5530100da6ad4bdeebea9ee562f5ecd75941b87b562ab3dfdb11f7ecc32a95da2b43860014153be21b70af27f78a24186be61eb7d3e1b8a45e4f7c92faa03d5427d432769726ffbad69c860cef51f0da30c18aa2b717612ea592de302be3278d950291b0100000000000078062c873f93d42f5aea24607ed244308cdbd7e7312bf6d0ed7d540d38ec6e643794862f0100e9794b47a84b25a60816aed4aef701c72188c5f7d5a44ed96a0e06a36b9a7915f3c38697fbb289a6fdafb2fa4c8169c4a7997f6a1b84a8f33219734cbeb50d2ef55570c7d06e3583acdbe993d8e521ce3211704eb316761ea8f94bb50cb9110a0100",
            "witness_type": 2
        },
        "reward_chain_sp_proof": {
            "normalized_to_identity": false,
            "witness": "0x0200b32e249915029b85ba7307fd4102d3352c52a30032d44639b2eb5d3a77497e269b9d9a9be91cd89d32a011a519c889a2f23ae1b08d56c99581afb57c29eed22a33ac88fd3f2075d7312ab4fe9b2ba3f7b714bc3b8d20ec0254d560819356eb40010000000000000e38a0a555927b04d5972453306cd46576785f0077db62f16adab830cd191ae3d1c63cf100000317fd6f5378f72c4ec504b2e460a9669de31dd1026e7dca756c67130a02a0ddf594a206ec70c9c6b06829608b3ccb1b3439a34ac99ac94eba7ef0730198387877ea6845834b56c13371c079b2201fd1e5e49cfe1fc716daeab329b55cbbb82c010000000000002aaaa8f5c834580070be7b0d3c5a49290b71ca8f8759d4beb423841c97f92b6b6409b02d030059b7199e86a68a9114d14ef44778600845068fe30d768acce03bfae6d0271a653f1317fe678e4e8546f76b2d9ce7cc52afdbd9fa6882ad916856f445e355937945ea840bd29058b8652404f8e5d3e13c78cfd2c5cd3fe9e6f404395d8e9b33800100",
            "witness_type": 2
        },
        "transactions_generator": null,
        "transactions_generator_ref_list": [],
        "transactions_info": {
            "aggregated_signature": "0xc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
            "cost": 0,
            "fees": 0,
            "generator_refs_root": "0x0101010101010101010101010101010101010101010101010101010101010101",
            "generator_root": "0x0000000000000000000000000000000000000000000000000000000000000000",
            "reward_claims_incorporated": []
        }
    },
    "success": true
}

获取范围内区块信息

请求地址: https://localhost:8555/get_blocks

参数:

{
    "start": 1,
    "end": 10,
    "exclude_header_hash": "0xd780d22c7a87c9e01d98b49a0910f6701c3b95015741316b3fda042e5d7b81d2"
}

参数说明

start 开始高度
end 结束高度
exclude_header_hash 排除的哈希

执行:

curl --insecure --cert ~/.chia/mainnet/config/ssl/full_node/private_full_node.crt --key ~/.chia/mainnet/config/ssl/full_node/private_full_node.key -d '{"start": 1,"end": 2}' -H "Content-Type: application/json" -X POST https://localhost:8555/get_blocks

返回参数说明:

blocks 区块数组
success 请求是否成功

返回结果:

{
    "blocks": [
        {
            "challenge_chain_ip_proof": {
                "normalized_to_identity": true,
                "witness": "0x010054ce54c653f8bc9fb543587d29727d642f977a6ab4ec0f19a58a3f9c60a129e9cc558b98f5dd4c1f05627522ecf6147feab2a862ee64e90aa3814e2670c0a301e30c387610cb152ec812d28ba4ecf6e5781cabe2fe99b463c1d75e8a9e286a050402",
                "witness_type": 0
            },
            "challenge_chain_sp_proof": {
                "normalized_to_identity": true,
                "witness": "0x020040d0c714f686e5cfc71740c34c3184f749ab3a8e8b23f637a7f975711b0c8eba2b42a0888cecb4804420011ad567fbb92e71764a2f8f22ab78d5cf489e50976c7b63f86b8265fdadd5b778633dc25bfec8694cf4747080be61565d91d79097090100",
                "witness_type": 0
            },
            "finished_sub_slots": [],
            "foliage": {
                "foliage_block_data": {
                    "extension_data": "0x0000000000000000000000000000000000000000000000000000000003a2c7c9",
                    "farmer_reward_puzzle_hash": "0xf55e4a65688e32445b7825ebee3421dba900909e1e8d36b61ac680c6ff8498c1",
                    "pool_signature": "0x8111f64dae435a1cb25731812eda173032b10d3f3e1a1f755da020e0f123cc1ca354cdd4f32b8e5f31308bd7533575b71966c560dcbd980a62bc412a35ed459009ddab1adc29fd4eb9eb6ee40f3f9a7cff63a387bc5a98f0df15f24e3b5e1145",
                    "pool_target": {
                        "max_height": 0,
                        "puzzle_hash": "0xf55e4a65688e32445b7825ebee3421dba900909e1e8d36b61ac680c6ff8498c1"
                    },
                    "unfinished_reward_block_hash": "0x2c7bace13b922ae8693f872acfe55bd8289d5c86a82f50bb392b94e57989945a"
                },
                "foliage_block_data_signature": "0xa2f736866285f760eae3350ac0bf00796a9ee91be1cd048bdce4a5a682b82756e99efec479012d3570b9eda2478b3c400128c3842ee41e3f016fc8cea133bea099a3086b3397165beb5cfb778cb2d4f6d1888967344c5068a0dd8b503a844224",
                "foliage_transaction_block_hash": "0x0ce9181e401038ea634d3274e260194ac18cf8d500a7d78718c1ba7bc5a5eef2",
                "foliage_transaction_block_signature": "0x964ccde89d6f2c3369c57f25e74088dd9ca97f62092df896718872a366e0446c88c412c859bbbfa11199888008fcc4dd19514e13f3eb8cf90d8cc19631240050e7f69e58939de49348eff26cafe14e6318f8c84f9da393bf91005cf6a06e53f7",
                "prev_block_hash": "0xd780d22c7a87c9e01d98b49a0910f6701c3b95015741316b3fda042e5d7b81d2",
                "reward_block_hash": "0xdc1ae60401c470cc59d1875aab8298b053da8c9e93ac1a1a88b8cb354f7a6bc0"
            },
            "foliage_transaction_block": {
                "additions_root": "0xc6e5bf817741cfd3ed46e6444e4ff208a8572997f3facc7ba36653251b860e42",
                "filter_hash": "0x6e1df917e15728c5c6952a146cd53d01837070b116955885aed40aaa9cb2c791",
                "prev_transaction_block_hash": "0xd780d22c7a87c9e01d98b49a0910f6701c3b95015741316b3fda042e5d7b81d2",
                "removals_root": "0x0000000000000000000000000000000000000000000000000000000000000000",
                "timestamp": 1616162525,
                "transactions_info_hash": "0xdd5e642b2e1c2cc40316360dd2b636f6853af4781a03354b2cad04a90ebac7ab"
            },
            "infused_challenge_chain_ip_proof": {
                "normalized_to_identity": false,
                "witness": "0x0000ff08ba57f4c3a23664c9d2eb74d5c9ab5d6c5d4f2f1114b4cca332d38bba6932d977ad1114a3e43574283cb5aec1b809418c2c5f6677e5440cb5ebb7e64ed51188ab7314749d3cf645fb32472e0f8d6bc882a144a1c858add7b245f305760830010000000000001f7ee4abecfc8d6bdad098e506d290b98679bafa52023c97eb3d801806931045f6f70893010037aeeb3d8de790c5ae9309481e7948fe6738983bdbb5896d11f92e6407d4276e450a5187ba20ff8346a84b055737d11f8d99c54305054b8f2ccb043f4c30891f688e6720c449b7d27b7c6c87b1d2135ee3540b1c5c2c1e0dd9705e4cdcee4f4c010000000000005e7cace34286b8e38e7b74aabade713b08db92326bfb7a98ed0a605ffa3e0a5853f63769030073a11fc71eaa8796da31dd464988081e5b1d3c9bc25829cefa3af42b2639297e2cc6eda1473eda02aad9d688afde353767066e1be6834abb5a3c93849158a4433acb2f32990e4a2f8bf092ad747f3376b76316cc07e2d0fa081054caa9a4262f0100",
                "witness_type": 2
            },
            "reward_chain_block": {
                "challenge_chain_ip_vdf": {
                    "challenge": "0xccd5bb71183532bff220ba46c268991a3ff07eb358e8255a65c30a2dce0e5fbb",
                    "number_of_iterations": 21087534,
                    "output": {
                        "data": "0x0300acde9e01267bdeeaab2d8d56563c831c594206a537e76e3420fdf5fe538c48baa098fe00bec76a88059b9a143f150f6a53c64c1f50dbc0763e3f9762e7529808b17946ee1c53784e4c1361e6ddb8c77403d2bd3f95b4f6b1ac4de68560a7bc0d0200"
                    }
                },
                "challenge_chain_sp_signature": "0xaa2bf54dcca544abd6032bd58f1a2d536778d08e878af3020f38aef9748236ee05a35e69fc620bd89e9f243f64415654046944da463c88a1d3caf08906574af35a455f68754f1d1178ceae9d034ba40983968a00c0728abd90cf3b195b9d282d",
                "challenge_chain_sp_vdf": {
                    "challenge": "0xccd5bb71183532bff220ba46c268991a3ff07eb358e8255a65c30a2dce0e5fbb",
                    "number_of_iterations": 14680064,
                    "output": {
                        "data": "0x0200d0860fd74bee67370d4fc2052583621244039ee860f44285cfe7d4331ec600deb2ad8775db51ee59485e2c9e1be0868ed52db2511d95663a1f13cabd9bcef93a77725fdc0e645f6d5c73657d3c0f70179d76b7a7d3f84195a010a53518e226080100"
                    }
                },
                "height": 1,
                "infused_challenge_chain_ip_vdf": {
                    "challenge": "0x45e3beae0441bab860109a977c94d9d8accb1927d7ad6e70faf84d18b9b96aaa",
                    "number_of_iterations": 9288588,
                    "output": {
                        "data": "0x03009234229b9b02119b34afb811537d2410e64c55cf7931d35bc46c5225319c332c80257f57cf732108f9896572196b9bbe10010d9897ce3d8109de6a3a8de2f90617802df029dabdcc42820f885a4ded4b77471a60c6ab8be114147ad29674770a0d02"
                    }
                },
                "is_transaction_block": true,
                "pos_ss_cc_challenge_hash": "0xccd5bb71183532bff220ba46c268991a3ff07eb358e8255a65c30a2dce0e5fbb",
                "proof_of_space": {
                    "challenge": "0x3cad4e5f2eee1deaf2ac96dbb50dde02b9f8a859a5b37c41dc79cf7b06e85542",
                    "plot_public_key": "0x873a3be5f22f8e65d8a71bdc08ad95e6893ecc804c2440aee81752127a0669f9cc1b233fd30ed1231c758bd1bab16fa9",
                    "pool_contract_puzzle_hash": null,
                    "pool_public_key": "0x901f147e465de399feb6f631eaa0af05a482596d5c20de416a29105ee622596eb8e55925f6b33c07f2803053eea30bb8",
                    "proof": "0x5142b78559d8c35251cadd3e5d335194fdf0370b6ef7b93a29a198bc74d15ee612ec557f7b3f404004fe9b7da8dce021adc66fd031e4c7e31fd8063f7c953ee73a5b717b62f609015f991722b2aa4636528f65799becb26f2381466ac116daf0a1c90e9ab73bfd3e7fa53f1a8a6555878cfe5a71d4fa22eb3ad48a2698b1ea47c3421684ba60fef5fba8fd8623af9e5514435224c4857768ea1683958ee5f4daa3f07386eac820ad7e6145024edb82864adacdf5b8a6bf975f76ea4669d3e4ca5ad81304286a41ae695f6d72115fe4ecd59f0f0a66348828b5216c00466e91cbe3c8e7bd739101aa563a5b377ea5a2559dcc23d18c57fda9c80f8201947a837c",
                    "size": 32
                },
                "reward_chain_ip_vdf": {
                    "challenge": "0xbdde7b5b2bc6025c07a9f5233d8eae167bea654146b272652262b362524c3e85",
                    "number_of_iterations": 9288588,
                    "output": {
                        "data": "0x0100c360714e76eb1b729cf49124e7dfe96642311e3833925c6a98eb72d31e6e65a73c15e8566c6a80e9a292117ad444e27cac74f1b6b61cb8281f8dd634706a9e0ea98a6cbaa44a82acc586c24544f9ae1188de74c93cf54dca6e34eca0c7a541190200"
                    }
                },
                "reward_chain_sp_signature": "0xa55506e4fc8b8f751eb4261912a0ddd946038eb9cdea9043054976dde7a116fc78e322b195fa483fd50924dd3520adaf19095676ac727260c96e3edc9eb8b1e2ecd0693a2d2cf92bd1c01fcd7d8a95eac6c27ef02acafd5d7f78f13f917fe22d",
                "reward_chain_sp_vdf": {
                    "challenge": "0xbdde7b5b2bc6025c07a9f5233d8eae167bea654146b272652262b362524c3e85",
                    "number_of_iterations": 2881118,
                    "output": {
                        "data": "0x0200d3596bf88f59c4cfb6fb457d36317ca42da69a3d0b0475853e5f35545e64b10edf77d51ee14f85458eefd223ef0fb1d08e8ba1b53db410ad31f7f695669fc83625055b374346e7a73b233673db0ace9266d136a796e6a3bc583fde730fb737200200"
                    }
                },
                "signage_point_index": 7,
                "total_iters": 21087534,
                "weight": 14
            },
            "reward_chain_ip_proof": {
                "normalized_to_identity": false,
                "witness": "0x020013bbc95536b115e7ad1c952fb0602bed80d7a540e3fc540a9d777b067bc49fa5e6a29f87c8d226a00b5484b1b73487001ad994bb75c1d5f560a1cca84337093515d917b7412fad1b2e388bfb06360c16ea5cec3a48121f291dbcfce2a29eec43010000000000001f7ee4c885537618717395b7b378eead35126134390261ca5fe406251ab07bf3f6094c410000800445406206413f5be8168504a3f02e1d191e3537ce586ce3d8a59a4a471fef0ba3474e56159a8347be49aa5587dcb319ec1b503679f83778dae32b36eb185b6b7e2b0f24bcefa604c7d8d22a37b3438aea86b4b0b0739d0dd4e54752c72b24010000000000005e7cac89fb11bce9922ee90189ebc0effb1c1cb35fee522f86f582c3b5bdd46af406620500000d1c9170ad2e9989a0d985877881a7f0e3479a6f39e7bf35f64eadebc0edb81d471c95a73f39d2af83b48474e0eee114e8e580db9721e1f92a0a4587ca62ea42b5477c0f54a4a27c237545de0e609cdee9218f62e832cd2095c00d366a80ac140100",
                "witness_type": 2
            },
            "reward_chain_sp_proof": {
                "normalized_to_identity": false,
                "witness": "0x0300adad0003f534674efa9e64f86cd7f46c7e9b37ea2f8b32b6a30b1ded9fd3ee849b9a130081ec2f844b0993675b885c4e15b50abba662b32a5e2a42e166fd5818defe17feaca57440e3cdcca8546c5ee2188d7824bd2a7e70d454765f2f344f1e0100000000000009c4c8803619bcb99f696f764f4f81b33da3faaa29a152f943dcc3d29757a3a78d0d06c90300f9b169922dcf8e759e30682a1467a6436ad5fcb789ff7aec707222105193c7df447a05a1ebd541eba3981946e34ff6c291d0bdeafd1644e58efcec333ba9dc29b28503cea85df42798edcb83d2691530c2b50fa8ef7a8b641658dc8087e2de29010000000000001d4ebcba6e75b2f926bf80114530c333b16e7875965b598bca89fbc23b6130ce0ced3ed9020057a412b1bc60404c9938bb9e4201ce6647ee099851b114a8dec89d0a4dead376e761c36d2610ae3c73aef5702ecbd5c924b9dff2694b78a1b1a3d53b71dacc07e3fc53baf780a19427601b3e8fea1d7db9acbd07b723fa7858d2de33418117140200",
                "witness_type": 2
            },
            "transactions_generator": null,
            "transactions_generator_ref_list": [],
            "transactions_info": {
                "aggregated_signature": "0xc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
                "cost": 0,
                "fees": 0,
                "generator_refs_root": "0x0101010101010101010101010101010101010101010101010101010101010101",
                "generator_root": "0x0000000000000000000000000000000000000000000000000000000000000000",
                "reward_claims_incorporated": [
                    {
                        "amount": 18375000000000000000,
                        "parent_coin_info": "0xccd5bb71183532bff220ba46c268991a00000000000000000000000000000000",
                        "puzzle_hash": "0xd23da14695a188ae5708dd152263c4db883eb27edeb936178d4d988b8f3ce5fc"
                    },
                    {
                        "amount": 2625000000000000000,
                        "parent_coin_info": "0x3ff07eb358e8255a65c30a2dce0e5fbb00000000000000000000000000000000",
                        "puzzle_hash": "0x3d8765d3a597ec1d99663f6c9816d915b9f68613ac94009884c4addaefcce6af"
                    }
                ]
            }
        }
    ],
    "success": true
}

通过高度获取区块记录

请求地址: https://localhost:8555/get_block_record_by_height

参数: {"height":1}

参数说明

height 要查询的区块高度

执行:

curl --insecure --cert ~/.chia/mainnet/config/ssl/full_node/private_full_node.crt --key ~/.chia/mainnet/config/ssl/full_node/private_full_node.key -d '{"height":1}' -H "Content-Type: application/json" -X POST https://localhost:8555/get_block_record_by_height

返回参数说明:

block_record 区块记录
success 请求是否成功

返回结果:

{
    "block_record": {
        "challenge_block_info_hash": "0x65091ea043f78199e5ccfc0c4a2b30a933750a01765eaeeddd14e9f14b6c15a2",
        "challenge_vdf_output": {
            "data": "0x0300acde9e01267bdeeaab2d8d56563c831c594206a537e76e3420fdf5fe538c48baa098fe00bec76a88059b9a143f150f6a53c64c1f50dbc0763e3f9762e7529808b17946ee1c53784e4c1361e6ddb8c77403d2bd3f95b4f6b1ac4de68560a7bc0d0200"
        },
        "deficit": 14,
        "farmer_puzzle_hash": "0xf55e4a65688e32445b7825ebee3421dba900909e1e8d36b61ac680c6ff8498c1",
        "fees": 0,
        "finished_challenge_slot_hashes": null,
        "finished_infused_challenge_slot_hashes": null,
        "finished_reward_slot_hashes": null,
        "header_hash": "0x7357071bb77de2e98b9b1daf6b87f67dd8481fa144bcc03d331dba8664fc04f9",
        "height": 1,
        "infused_challenge_vdf_output": {
            "data": "0x03009234229b9b02119b34afb811537d2410e64c55cf7931d35bc46c5225319c332c80257f57cf732108f9896572196b9bbe10010d9897ce3d8109de6a3a8de2f90617802df029dabdcc42820f885a4ded4b77471a60c6ab8be114147ad29674770a0d02"
        },
        "overflow": false,
        "pool_puzzle_hash": "0xf55e4a65688e32445b7825ebee3421dba900909e1e8d36b61ac680c6ff8498c1",
        "prev_hash": "0xd780d22c7a87c9e01d98b49a0910f6701c3b95015741316b3fda042e5d7b81d2",
        "prev_transaction_block_hash": "0xd780d22c7a87c9e01d98b49a0910f6701c3b95015741316b3fda042e5d7b81d2",
        "prev_transaction_block_height": 0,
        "required_iters": 116014,
        "reward_claims_incorporated": [
            {
                "amount": 18375000000000000000,
                "parent_coin_info": "0xccd5bb71183532bff220ba46c268991a00000000000000000000000000000000",
                "puzzle_hash": "0xd23da14695a188ae5708dd152263c4db883eb27edeb936178d4d988b8f3ce5fc"
            },
            {
                "amount": 2625000000000000000,
                "parent_coin_info": "0x3ff07eb358e8255a65c30a2dce0e5fbb00000000000000000000000000000000",
                "puzzle_hash": "0x3d8765d3a597ec1d99663f6c9816d915b9f68613ac94009884c4addaefcce6af"
            }
        ],
        "reward_infusion_new_challenge": "0xdc1ae60401c470cc59d1875aab8298b053da8c9e93ac1a1a88b8cb354f7a6bc0",
        "signage_point_index": 7,
        "sub_epoch_summary_included": null,
        "sub_slot_iters": 134217728,
        "timestamp": 1616162525,
        "total_iters": 21087534,
        "weight": 14
    },
    "success": true
}

通过哈希获取区块记录

请求地址: https://localhost:8555/get_block_record

参数: {"header_hash": "0xd780d22c7a87c9e01d98b49a0910f6701c3b95015741316b3fda042e5d7b81d2"]}

参数说明

header_hash 哈希

执行:

curl --insecure --cert ~/.chia/mainnet/config/ssl/full_node/private_full_node.crt --key ~/.chia/mainnet/config/ssl/full_node/private_full_node.key -d '{"header_hash": "0xd780d22c7a87c9e01d98b49a0910f6701c3b95015741316b3fda042e5d7b81d2"}' -H "Content-Type: application/json" -X POST https://localhost:8555/get_block_record

返回参数说明:

block_record 区块记录
success 请求是否成功

返回结果:

{
    "block_record": {
        "challenge_block_info_hash": "0x45e3beae0441bab860109a977c94d9d8accb1927d7ad6e70faf84d18b9b96aaa",
        "challenge_vdf_output": {
            "data": "0x0000dafd52467f3f66cf25c7de3e432188b9c3000b95a09170ace441a214cffc5fa65a39a66f11085fea9c7a121cf7f86a74142506b6d51d6036097bff862707185dbba577707c248f2fca5877337e56905879a2ee840d28860c50ebcacaaaf53a660100"
        },
        "deficit": 15,
        "farmer_puzzle_hash": "0x3d8765d3a597ec1d99663f6c9816d915b9f68613ac94009884c4addaefcce6af",
        "fees": 0,
        "finished_challenge_slot_hashes": [
            "0xccd5bb71183532bff220ba46c268991a3ff07eb358e8255a65c30a2dce0e5fbb"
        ],
        "finished_infused_challenge_slot_hashes": null,
        "finished_reward_slot_hashes": [
            "0xccd5bb71183532bff220ba46c268991a3ff07eb358e8255a65c30a2dce0e5fbb"
        ],
        "header_hash": "0xd780d22c7a87c9e01d98b49a0910f6701c3b95015741316b3fda042e5d7b81d2",
        "height": 0,
        "infused_challenge_vdf_output": null,
        "overflow": false,
        "pool_puzzle_hash": "0xd23da14695a188ae5708dd152263c4db883eb27edeb936178d4d988b8f3ce5fc",
        "prev_hash": "0xccd5bb71183532bff220ba46c268991a3ff07eb358e8255a65c30a2dce0e5fbb",
        "prev_transaction_block_hash": "0xccd5bb71183532bff220ba46c268991a3ff07eb358e8255a65c30a2dce0e5fbb",
        "prev_transaction_block_height": 0,
        "required_iters": 1313186,
        "reward_claims_incorporated": [],
        "reward_infusion_new_challenge": "0xbdde7b5b2bc6025c07a9f5233d8eae167bea654146b272652262b362524c3e85",
        "signage_point_index": 2,
        "sub_epoch_summary_included": null,
        "sub_slot_iters": 134217728,
        "timestamp": 1616162474,
        "total_iters": 11798946,
        "weight": 7
    },
    "success": true
}

获取范围区块记录

请求地址: https://localhost:8555/get_block_records

参数: {"start": 1,"end": 2}

参数说明

{
    "start": 1,
    "end": 2
}

执行:

curl --insecure --cert ~/.chia/mainnet/config/ssl/full_node/private_full_node.crt --key ~/.chia/mainnet/config/ssl/full_node/private_full_node.key -d '{"start": 1,"end": 2}' -H "Content-Type: application/json" -X POST https://localhost:8555/get_block_records

返回参数说明:

block_records 区块记录数组
success 请求是否成功

返回结果:

{
    "block_records": [
        {
            "challenge_block_info_hash": "0x65091ea043f78199e5ccfc0c4a2b30a933750a01765eaeeddd14e9f14b6c15a2",
            "challenge_vdf_output": {
                "data": "0x0300acde9e01267bdeeaab2d8d56563c831c594206a537e76e3420fdf5fe538c48baa098fe00bec76a88059b9a143f150f6a53c64c1f50dbc0763e3f9762e7529808b17946ee1c53784e4c1361e6ddb8c77403d2bd3f95b4f6b1ac4de68560a7bc0d0200"
            },
            "deficit": 14,
            "farmer_puzzle_hash": "0xf55e4a65688e32445b7825ebee3421dba900909e1e8d36b61ac680c6ff8498c1",
            "fees": 0,
            "finished_challenge_slot_hashes": null,
            "finished_infused_challenge_slot_hashes": null,
            "finished_reward_slot_hashes": null,
            "header_hash": "0x7357071bb77de2e98b9b1daf6b87f67dd8481fa144bcc03d331dba8664fc04f9",
            "height": 1,
            "infused_challenge_vdf_output": {
                "data": "0x03009234229b9b02119b34afb811537d2410e64c55cf7931d35bc46c5225319c332c80257f57cf732108f9896572196b9bbe10010d9897ce3d8109de6a3a8de2f90617802df029dabdcc42820f885a4ded4b77471a60c6ab8be114147ad29674770a0d02"
            },
            "overflow": false,
            "pool_puzzle_hash": "0xf55e4a65688e32445b7825ebee3421dba900909e1e8d36b61ac680c6ff8498c1",
            "prev_hash": "0xd780d22c7a87c9e01d98b49a0910f6701c3b95015741316b3fda042e5d7b81d2",
            "prev_transaction_block_hash": "0xd780d22c7a87c9e01d98b49a0910f6701c3b95015741316b3fda042e5d7b81d2",
            "prev_transaction_block_height": 0,
            "required_iters": 116014,
            "reward_claims_incorporated": [
                {
                    "amount": 18375000000000000000,
                    "parent_coin_info": "0xccd5bb71183532bff220ba46c268991a00000000000000000000000000000000",
                    "puzzle_hash": "0xd23da14695a188ae5708dd152263c4db883eb27edeb936178d4d988b8f3ce5fc"
                },
                {
                    "amount": 2625000000000000000,
                    "parent_coin_info": "0x3ff07eb358e8255a65c30a2dce0e5fbb00000000000000000000000000000000",
                    "puzzle_hash": "0x3d8765d3a597ec1d99663f6c9816d915b9f68613ac94009884c4addaefcce6af"
                }
            ],
            "reward_infusion_new_challenge": "0xdc1ae60401c470cc59d1875aab8298b053da8c9e93ac1a1a88b8cb354f7a6bc0",
            "signage_point_index": 7,
            "sub_epoch_summary_included": null,
            "sub_slot_iters": 134217728,
            "timestamp": 1616162525,
            "total_iters": 21087534,
            "weight": 14
        }
    ],
    "success": true
}

获取未完成区块的记录列表

请求地址: https://localhost:8555/get_unfinished_block_headers

参数: {"":""}

执行:

curl --insecure --cert ~/.chia/mainnet/config/ssl/full_node/private_full_node.crt --key ~/.chia/mainnet/config/ssl/full_node/private_full_node.key -d '{"":""}' -H "Content-Type: application/json" -X POST https://localhost:8555/get_unfinished_block_headers

返回参数说明:

headers 未完成的区块记录头
success 请求是否成功

返回结果:

{
    "headers": [],
    "success": true
}

通过哈希获取区块空间

请求地址: https://localhost:8555/get_network_space

参数: {"older_block_header_hash": "0xd780d22c7a87c9e01d98b49a0910f6701c3b95015741316b3fda042e5d7b81d2","newer_block_header_hash": "0x5f29ff00348e1eff3748e95c055f6f30a838ca2168ba294d944dd0e3909b79b4"}

参数说明

older_block_header_hash 开始头哈希
newer_block_header_hash 结束头哈希

执行:

curl --insecure --cert ~/.chia/mainnet/config/ssl/full_node/private_full_node.crt --key ~/.chia/mainnet/config/ssl/full_node/private_full_node.key -d '{"older_block_header_hash": "0xd780d22c7a87c9e01d98b49a0910f6701c3b95015741316b3fda042e5d7b81d2","newer_block_header_hash": "0x5f29ff00348e1eff3748e95c055f6f30a838ca2168ba294d944dd0e3909b79b4"}' -H "Content-Type: application/json" -X POST https://localhost:8555/get_network_space

返回参数说明:

space 空间大小
success 请求是否成功

返回结果:

{    "space": 112853139277681424,    "success": true}

获取添加和删除的硬币记录

检索特定块的添加和删除(状态转换)。返回每次添加和删除的硬币记录。

请求地址: https://localhost:8555/get_additions_and_removals

参数: {"header_hash":"0x5f29ff00348e1eff3748e95c055f6f30a838ca2168ba294d944dd0e3909b79b4"}

参数说明

header_hash

执行:

curl --insecure --cert ~/.chia/mainnet/config/ssl/full_node/private_full_node.crt --key ~/.chia/mainnet/config/ssl/full_node/private_full_node.key -d '{"header_hash":"0x5f29ff00348e1eff3748e95c055f6f30a838ca2168ba294d944dd0e3909b79b4"}' -H "Content-Type: application/json" -X POST https://localhost:8555/get_additions_and_removals

返回参数说明:

additions 添加记录removals 删除记录success 请求是否成功

返回结果:

{    "additions": [],    "removals": [],    "success": true}

检索区块链的初始冻结期

请求地址: https://localhost:8555/get_initial_freeze_period

参数: {"":""}

执行:

curl --insecure --cert ~/.chia/mainnet/config/ssl/full_node/private_full_node.crt --key ~/.chia/mainnet/config/ssl/full_node/private_full_node.key -d '{"":""}' -H "Content-Type: application/json" -X POST https://localhost:8555/get_initial_freeze_period

返回参数说明:

INITIAL_FREEZE_END_TIMESTAMP 初始冻结结束时间戳success 请求是否成功

返回结果:

{    "INITIAL_FREEZE_END_TIMESTAMP": 1620061200,    "success": true}

获取网络状态

请求地址: https://localhost:8555/get_network_info

参数: {"":""}

执行:

curl --insecure --cert ~/.chia/mainnet/config/ssl/full_node/private_full_node.crt --key ~/.chia/mainnet/config/ssl/full_node/private_full_node.key -d '{"":""}' -H "Content-Type: application/json" -X POST https://localhost:8555/get_network_info

返回参数说明:

network_name 网络名称
network_prefix 网络前缀
success 请求是否成功

返回结果:

{    "network_name": "mainnet",    "network_prefix": "xch",    "success": true}

获取硬币记录

通过拼图散列获得硬币记录

请求地址: https://localhost:8555/get_coin_records_by_puzzle_hash

参数: {"":""}

参数说明

puzzle_hash 要搜索的拼图哈希
start_height (可选择的)确认搜索起始高度
end_height (可选择的) 搜索确认结束高度
include_spent_coins 是否也包括用过的硬币,而不仅仅是未用完的

执行:

curl --insecure --cert ~/.chia/mainnet/config/ssl/full_node/private_full_node.crt --key ~/.chia/mainnet/config/ssl/full_node/private_full_node.key -d '{"":""}' -H "Content-Type: application/json" -X POST https://localhost:8555/get_coin_records_by_puzzle_hash

返回参数说明:

coin_records 硬币记录
success 请求是否成功

返回结果:

{    "coin_records": [        {            "coin": {                "amount": 100,                "parent_coin_info": "0x1bd17ade486df21453d84a0c88f25115b0a592bbc07882a4614380c8f87824ad",                "puzzle_hash": "0x442bebd99ab69f4fd16955c8c0604bcf80ae07fb4dc2372b29a527c2bfe3a7c4"            },            "coinbase": false,            "confirmed_block_index": 342095,            "spent": false,            "spent_block_index": 0,            "timestamp": 1622082062        },        {            "coin": {                "amount": 50,                "parent_coin_info": "0x5abdf789648e3e7d97fc688899ca9eec448581669f68ab02442e4d9e5c4ef8bc",                "puzzle_hash": "0x442bebd99ab69f4fd16955c8c0604bcf80ae07fb4dc2372b29a527c2bfe3a7c4"            },            "coinbase": false,            "confirmed_block_index": 342029,            "spent": false,            "spent_block_index": 0,            "timestamp": 1622080745        }    ],    "success": true}

通过硬币名称获取硬币记录

请求地址: https://localhost:8555/get_coin_record_by_name

参数: {"name": "0xe025257d5d7f3a10d9a47da5c87befb2fdc40523f08a85c9702ee0405b35c8eb"}

参数说明

name 硬币的名称(十六进制)

执行:

curl --insecure --cert ~/.chia/mainnet/config/ssl/full_node/private_full_node.crt --key ~/.chia/mainnet/config/ssl/full_node/private_full_node.key -d '{"name": "0xe025257d5d7f3a10d9a47da5c87befb2fdc40523f08a85c9702ee0405b35c8eb"}' -H "Content-Type: application/json" -X POST https://localhost:8555/get_coin_record_by_name

返回参数说明:

success 请求是否成功

返回结果:

{    "coin_record": {        "coin": {            "amount": 100,            "parent_coin_info": "0x4a862f1894e6b272e438341f0e8779e099ae22f6b90152dc9cb92b5894f6c9d0",            "puzzle_hash": "0x0fe8431c2f2c8fda25698aa9f0a11b8036b857eb48612f661b803b8922f69125"        },        "coinbase": false,        "confirmed_block_index": 339372,        "spent": true,        "spent_block_index": 342362,        "timestamp": 1622033571    },    "success": true}

广播交易

将交易/支出捆绑推送到内存池和区块链,返回是否已将支出捆绑包成功包含到内存池中

请求地址: https://localhost:8555/push_tx

参数:

{    "spend_bundle": {        "aggregated_signature": "0xa5e5ea1f5ae2335a72fe0a7ed7ca39e8f142e2e1f6e37a348482290e88eb9cea2d973acf6145e34d0afeee7ba22f99850641e21a549b2c092bb49aa393acd938825bccca9413c1a268ba44367bc8433cd0fc0eb82e87bebe23817aa695bdb566",        "coin_solutions": [            {                "coin": {                    "amount": 1750000000000,                    "parent_coin_info": "0xccd5bb71183532bff220ba46c268991a00000000000000000000000000004082",                    "puzzle_hash": "0x94c6db00186900418ef7c1f05e127ee1a647cbe6e514ec3bc57acb7bbe6dfb10"                },                "puzzle_reveal": "0xff02ffff01ff02ffff01ff02ffff03ff0bffff01ff02ffff03ffff09ff05ffff1dff0bffff1effff0bff0bffff02ff06ffff04ff02ffff04ff17ff8080808080808080ffff01ff02ff17ff2f80ffff01ff088080ff0180ffff01ff04ffff04ff04ffff04ff05ffff04ffff02ff06ffff04ff02ffff04ff17ff80808080ff80808080ffff02ff17ff2f808080ff0180ffff04ffff01ff32ff02ffff03ffff07ff0580ffff01ff0bffff0102ffff02ff06ffff04ff02ffff04ff09ff80808080ffff02ff06ffff04ff02ffff04ff0dff8080808080ffff01ff0bffff0101ff058080ff0180ff018080ffff04ffff01b0aec9c2e5984fe928406abca942d55ec6b56340af8315bfefa55889dbaade669b9fd3f330af2af44c2a0626d383e64757ff018080",                "solution": "0xff80ffff01ffff33ffa03fa549a708302b401c45cf387f8f03b4f76b7c9eabf567bea974f61dedf721e0ff840098968080ffff33ffa055b9fe4c9ce0cef8ad574bf5a9158dc0db7848b96be1a98ab2806d8f0a376a08ff860197738845808080ff8080"            }        ]    }

参数说明


执行:

curl --insecure --cert ~/.chia/mainnet/config/ssl/full_node/private_full_node.crt --key ~/.chia/mainnet/config/ssl/full_node/private_full_node.key -d '{        "spend_bundle": {            "aggregated_signature": "0xa5e5ea1f5ae2335a72fe0a7ed7ca39e8f142e2e1f6e37a348482290e88eb9cea2d973acf6145e34d0afeee7ba22f99850641e21a549b2c092bb49aa393acd938825bccca9413c1a268ba44367bc8433cd0fc0eb82e87bebe23817aa695bdb566",            "coin_solutions": [                {                    "coin": {                        "amount": 1750000000000,                        "parent_coin_info": "0xccd5bb71183532bff220ba46c268991a00000000000000000000000000004082",                        "puzzle_hash": "0x94c6db00186900418ef7c1f05e127ee1a647cbe6e514ec3bc57acb7bbe6dfb10"                    },                    "puzzle_reveal": "0xff02ffff01ff02ffff01ff02ffff03ff0bffff01ff02ffff03ffff09ff05ffff1dff0bffff1effff0bff0bffff02ff06ffff04ff02ffff04ff17ff8080808080808080ffff01ff02ff17ff2f80ffff01ff088080ff0180ffff01ff04ffff04ff04ffff04ff05ffff04ffff02ff06ffff04ff02ffff04ff17ff80808080ff80808080ffff02ff17ff2f808080ff0180ffff04ffff01ff32ff02ffff03ffff07ff0580ffff01ff0bffff0102ffff02ff06ffff04ff02ffff04ff09ff80808080ffff02ff06ffff04ff02ffff04ff0dff8080808080ffff01ff0bffff0101ff058080ff0180ff018080ffff04ffff01b0aec9c2e5984fe928406abca942d55ec6b56340af8315bfefa55889dbaade669b9fd3f330af2af44c2a0626d383e64757ff018080",                    "solution": "0xff80ffff01ffff33ffa03fa549a708302b401c45cf387f8f03b4f76b7c9eabf567bea974f61dedf721e0ff840098968080ffff33ffa055b9fe4c9ce0cef8ad574bf5a9158dc0db7848b96be1a98ab2806d8f0a376a08ff860197738845808080ff8080"                }            ]        }}' -H "Content-Type: application/json" -X POST https://localhost:8555/push_tx

返回参数说明:

status 广播状态
error 错误信息
success 请求是否成功

返回结果:

{	"status": "SUCCESS", 	"success": true}

获取内存池子的交易ID列表

请求地址: https://localhost:8555/get_all_mempool_tx_ids

参数: {"":""}

执行:

curl --insecure --cert ~/.chia/mainnet/config/ssl/full_node/private_full_node.crt --key ~/.chia/mainnet/config/ssl/full_node/private_full_node.key -d '{"":""}' -H "Content-Type: application/json" -X POST https://localhost:8555/get_all_mempool_tx_ids

返回参数说明:

tx_ids 交易id列表
success 请求是否成功

返回结果:

{    "success": true,    "tx_ids": [        "0x9450cb0f8914037c7783519ee24f1db3a232be4f4555c2b7c6427a4e2f16bdac"    ]}

获取内存池的交易列表

请求地址: https://localhost:8555/get_all_mempool_items

参数: {"":""}

执行:

curl --insecure --cert ~/.chia/mainnet/config/ssl/full_node/private_full_node.crt --key ~/.chia/mainnet/config/ssl/full_node/private_full_node.key -d '{"":""}' -H "Content-Type: application/json" -X POST https://localhost:8555/get_all_mempool_items

返回参数说明:

success 请求是否成功

返回结果:

{    "mempool_items": {        "2972c7a0696e09218bd906012b4f976ee4c197eeac5ed73bad24edde527dd60a": {            "additions": [                {                    "amount": 1000000,                    "parent_coin_info": "0xe6568c9f6a76ca8abcb87afeedb2d004f02ec0c03ca7edec802fb1e15ca30810",                    "puzzle_hash": "0x10a4575028532c80361bcdd06b7d4261d9a042bdde586987036e4bba54ff2066"                },                {                    "amount": 2933413153,                    "parent_coin_info": "0xe6568c9f6a76ca8abcb87afeedb2d004f02ec0c03ca7edec802fb1e15ca30810",                    "puzzle_hash": "0x5bbcc227542b24f24ab10756ee475e322dbd8fe9ac6a7ee463abcc80e90418db"                }            ],            "cost": 11034044,            "fee": 10000,            "npc_result": {                "clvm_cost": 426044,                "error": null,                "npc_list": [                    {                        "coin_name": "0xe6568c9f6a76ca8abcb87afeedb2d004f02ec0c03ca7edec802fb1e15ca30810",                        "conditions": [                            [                                "0x32",                                [                                    {                                        "opcode": "AGG_SIG_ME",                                        "vars": [                                            "0x96c62063a7ad033601003b7be05237e17cc8aed7416bdf0440af0a2b6f266a3de051f529134e36209a81afd5d657f9b2",                                            "0x9e347ad4a8146a42f616572a3713569228c9e05dc8adef661c6d04a448f4a972"                                        ]                                    }                                ]                            ],                            [                                "0x33",                                [                                    {                                        "opcode": "CREATE_COIN",                                        "vars": [                                            "0x10a4575028532c80361bcdd06b7d4261d9a042bdde586987036e4bba54ff2066",                                            "0x0f4240"                                        ]                                    },                                    {                                        "opcode": "CREATE_COIN",                                        "vars": [                                            "0x5bbcc227542b24f24ab10756ee475e322dbd8fe9ac6a7ee463abcc80e90418db",                                            "0x00aed85521"                                        ]                                    }                                ]                            ],                            [                                "0x34",                                [                                    {                                        "opcode": "RESERVE_FEE",                                        "vars": [                                            "0x2710"                                        ]                                    }                                ]                            ],                            [                                "0x3c",                                [                                    {                                        "opcode": "CREATE_COIN_ANNOUNCEMENT",                                        "vars": [                                            "0xe6d11bb5c8062241c62cf4da719e67304ee6ec8a8428a1bf9902764bf1c30d98"                                        ]                                    }                                ]                            ]                        ],                        "puzzle_hash": "0x463b8d0af9c193fd3dcedb7797314dc61f1e849150407fd4f6996163c1f85f14"                    }                ]            },            "program": "0xff01ffffffa0c67f1595df0b70bfbdcc7e1a3b5401fa939439abfd4fe40d055f7154c79b955bffff02ffff01ff02ffff01ff02ffff03ff0bffff01ff02ffff03ffff09ff05ffff1dff0bffff1effff0bff0bffff02ff06ffff04ff02ffff04ff17ff8080808080808080ffff01ff02ff17ff2f80ffff01ff088080ff0180ffff01ff04ffff04ff04ffff04ff05ffff04ffff02ff06ffff04ff02ffff04ff17ff80808080ff80808080ffff02ff17ff2f808080ff0180ffff04ffff01ff32ff02ffff03ffff07ff0580ffff01ff0bffff0102ffff02ff06ffff04ff02ffff04ff09ff80808080ffff02ff06ffff04ff02ffff04ff0dff8080808080ffff01ff0bffff0101ff058080ff0180ff018080ffff04ffff01b096c62063a7ad033601003b7be05237e17cc8aed7416bdf0440af0a2b6f266a3de051f529134e36209a81afd5d657f9b2ff018080ff8500aee7be71ffff80ffff01ffff33ffa010a4575028532c80361bcdd06b7d4261d9a042bdde586987036e4bba54ff2066ff830f424080ffff33ffa05bbcc227542b24f24ab10756ee475e322dbd8fe9ac6a7ee463abcc80e90418dbff8500aed8552180ffff34ff82271080ffff3cffa0e6d11bb5c8062241c62cf4da719e67304ee6ec8a8428a1bf9902764bf1c30d988080ff8080808080",            "removals": [                {                    "amount": 2934423153,                    "parent_coin_info": "0xc67f1595df0b70bfbdcc7e1a3b5401fa939439abfd4fe40d055f7154c79b955b",                    "puzzle_hash": "0x463b8d0af9c193fd3dcedb7797314dc61f1e849150407fd4f6996163c1f85f14"                }            ],            "spend_bundle": {                "aggregated_signature": "0x8d27a2cd0615ccb50fdc6889dfe156b0350a31cb7f9d6d007f759a435d925170d011f9a93948c3e00e2d2da86776e78705359692ddc71728d35cf61071d84a19c2d49c0f09e61516590a507845297021ef674e87f431fd3156b21a8e6e30165f",                "coin_solutions": [                    {                        "coin": {                            "amount": 2934423153,                            "parent_coin_info": "0xc67f1595df0b70bfbdcc7e1a3b5401fa939439abfd4fe40d055f7154c79b955b",                            "puzzle_hash": "0x463b8d0af9c193fd3dcedb7797314dc61f1e849150407fd4f6996163c1f85f14"                        },                        "puzzle_reveal": "0xff02ffff01ff02ffff01ff02ffff03ff0bffff01ff02ffff03ffff09ff05ffff1dff0bffff1effff0bff0bffff02ff06ffff04ff02ffff04ff17ff8080808080808080ffff01ff02ff17ff2f80ffff01ff088080ff0180ffff01ff04ffff04ff04ffff04ff05ffff04ffff02ff06ffff04ff02ffff04ff17ff80808080ff80808080ffff02ff17ff2f808080ff0180ffff04ffff01ff32ff02ffff03ffff07ff0580ffff01ff0bffff0102ffff02ff06ffff04ff02ffff04ff09ff80808080ffff02ff06ffff04ff02ffff04ff0dff8080808080ffff01ff0bffff0101ff058080ff0180ff018080ffff04ffff01b096c62063a7ad033601003b7be05237e17cc8aed7416bdf0440af0a2b6f266a3de051f529134e36209a81afd5d657f9b2ff018080",                        "solution": "0xff80ffff01ffff33ffa010a4575028532c80361bcdd06b7d4261d9a042bdde586987036e4bba54ff2066ff830f424080ffff33ffa05bbcc227542b24f24ab10756ee475e322dbd8fe9ac6a7ee463abcc80e90418dbff8500aed8552180ffff34ff82271080ffff3cffa0e6d11bb5c8062241c62cf4da719e67304ee6ec8a8428a1bf9902764bf1c30d988080ff8080"                    }                ]            },            "spend_bundle_name": "0x2972c7a0696e09218bd906012b4f976ee4c197eeac5ed73bad24edde527dd60a"        }     },    "success": true}

更多全节点RPC例子

根据管理官方资料整理,其中可能存在纰漏,欢迎指正

 类似资料: