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场景编辑器

push_tx

push_tx调用将交易/消费包提交到内存池并上链,并返回一个结果表征 消费包是否成功打包进内存池。

请求参数

  • spend_bundle:要提交的消费包,JSON格式

返回结果

push_tx调用返回一个JSON对象,其status字段为SUCCESS时表示交易 成功打包进内存池。

示例代码

请求:

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": "SUCCESS", "success": true}