Chia RPC API手册

FullNode Api
get_blockchain_state/查询区块链状态 get_block/查询指定区块 get_blocks/查询指定高度区间的区块 get_block_record_by_height/查询指定高度的区块记录 get_block_record/查询指定哈希的区块记录 get_block_records/查询指定高度区间的区块记录 get_unfinished_block_headers/查询未完成区块 get_network_space/查询网络总空间 get_additions_and_removals/查询添加和删除记录 get_initial_freeze_period/查询初始冻结期 get_network_info/查询网络信息 get_coin_records_by_puzzle_hash/查询指定哈希的coin记录 get_coin_record_by_name/查询指定名称的coin记录 push_tx/提交交易 get_all_mempool_tx_ids/返回内存池全部交易ID get_all_mempool_items/返回内存池全部交易 get_mempool_item_by_tx_id/返回内存池指定交易
Wallet Api
log_in/登录钱包 get_public_keys/查询根公钥 get_private_key/查询根私钥 generate_mnemonic/生成助记词 add_key/添加私钥 delete_key/删除私钥 delete_all_keys/删除全部私钥 get_sync_status/查询钱包同步状态 get_height_info/查询钱包高度信息 farm_block/模拟耕种区块 get_initial_freeze_period/查询初始冻结周期 get_network_info/查询网络信息 get_wallets/查询私钥地址 create_new_wallet/创建新钱包 get_wallet_balance/查询钱包余额 get_transaction/查询指定交易记录 get_transactions/查询交易记录 get_next_address/返回下一个地址 send_transaction/发送交易 create_backup/创建钱包备份 get_transaction_count/查询钱包交易数量 get_farmed_amount/查询奖励信息
Harvester Api
get_plots/查询全部绘图 refresh_plots/刷新绘图 delete_plot/删除绘图 add_plot_directory/添加绘图目录 get_plot_directories/查询绘图目录 remove_plot_directory/删除绘图目录
Farmer Api
get_signage_point/查询指定的signage点 get_signage_points/查询signage点清单 get_reward_targets/查询耕种目标地址 set_reward_targets/设置耕种目标地址
公共Api
get_connections/查询连接节点 open_connection/连接节点 close_connection/断开节点连接 stop_node/终止节点运行
在线工具推荐: Three.js AI纹理开发包 - YOLO合成数据生成器 - GLTF/GLB在线编辑 - 3D模型格式在线转换 - 可编程3D场景编辑器

get_block_record_by_height

get_block_record_by_height调用返回指定高度的区块记录。

请求参数

  • height:要查询区块的高度

响应结果

get_block_record_by_height调用返回一个JSON对象,其block_record 字段为区块记录对象

示例代码

请求:

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": 0}' \
     -H "Content-Type: application/json" \
     -X POST https://localhost:8555/get_block_record_by_height

响应:

{
    "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
}