Simulator RPC Reference
Intro
The simulator gives you complete control of a private Chia blockchain, including the ability to advance and revert blocks as needed.
This page includes a comprehensive list of Chia's Remote Procedure Calls for using the simulator.
For more info, see the following:
Note about Windows command escaping
This document will use Linux/MacOS RPC syntax. When running rpc commands on Windows, you'll need to escape all quotes with backslashes.
For example, here is a typical RPC command on Linux and MacOS:
chia rpc wallet create_new_wallet '{"wallet_type": "nft_wallet"}'
To run the same command on Windows, you need to escape the quotes, so it looks like this (the braces have been removed to support the formatting for this page. You still need to use them in your actual commands.):
chia rpc wallet create_new_wallet '{\"wallet_type\": \"nft_wallet\"}'
Reference
farm_block
Functionality: Farm one or more blocks. Can ensure farming a transaction block if required
Usage: chia rpc full_node [OPTIONS] farm_block [REQUEST]
Options:
Short Command | Long Command | Type | Required | Description |
---|---|---|---|---|
-j | --json-file | TEXT | False | Instead of REQUEST, provide a json file containing the request data |
-h | --help | None | False | Show a help message and exit |
Request Parameters:
Parameter | Required | Description |
---|---|---|
address | True | The address to use to farm the block |
guarantee_tx_block | False | Set to True to farm a transaction block (ie, farm new blocks until a tx block is farmed); set to False to farm the next block, which could also be a transaction block, but is not guaranteed (Default: False ) |
blocks | False | Number of blocks to farm. If guarantee_tx_block is True , then each block will be a transaction block (Default: 1) |
Example 1
Farm a single block:
chia rpc full_node farm_block '{"address": "txch1v3wjjapxvepyadvr2wgp7272md84lv6kmaxyxm4lq5le2jcc90zqkxhgv6"}'
Response:
{
"new_peak_height": 21,
"success": true
}
Example 2
Farm three transaction blocks:
chia rpc full_node farm_block '{"address": "txch1v3wjjapxvepyadvr2wgp7272md84lv6kmaxyxm4lq5le2jcc90zqkxhgv6", "guarantee_tx_block": "True", "blocks": 3}'
Response:
{
"new_peak_height": 24,
"success": true
}
get_all_blocks
Functionality: Return a list of all blocks in the blockhain
Usage: chia rpc full_node [OPTIONS] get_all_blocks [REQUEST]
Options:
Short Command | Long Command | Type | Required | Description |
---|---|---|---|---|
-j | --json-file | TEXT | False | Instead of REQUEST, provide a json file containing the request data |
-h | --help | None | False | Show a help message and exit |
Request Parameters: None
Example
chia rpc full_node get_all_blocks
Response (abbreviated):
{
"blocks": [
{
"challenge_chain_ip_proof": {
"normalized_to_identity": false,
"witness": "0x04000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"witness_type": 0
},
"challenge_chain_sp_proof": {
"normalized_to_identity": false,
"witness": "0x02004c00010100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"witness_type": 0
},
"finished_sub_slots":
{
"challenge_chain": {
"challenge_chain_end_of_slot_vdf": {
"challenge": "0xeb8c4d20b322be8d9fddbf9412016bdffe9a2901d7edb0e364e94266d0e095f7",
"number_of_iterations": 1024,
"output": {
"data": "0x00006100050100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
}
},
"infused_challenge_chain_sub_slot_hash": null,
"new_difficulty": null,
"new_sub_slot_iters": null,
"subepoch_summary_hash": null
},
"infused_challenge_chain": null,
"proofs": {
"challenge_chain_slot_proof": {
"normalized_to_identity": false,
"witness": "0x00003d00020100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"witness_type": 0
},
"infused_challenge_chain_slot_proof": null,
"reward_chain_slot_proof": {
"normalized_to_identity": false,
"witness": "0x00003d00020100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"witness_type": 0
}
},
"reward_chain": {
"challenge_chain_sub_slot_hash": "0xe44e06ed13eb06c7c2f0218945b7c62e785d6482c27ebbe69aab499ae199258c",
"deficit": 12,
"end_of_slot_vdf": {
"challenge": "0xeb8c4d20b322be8d9fddbf9412016bdffe9a2901d7edb0e364e94266d0e095f7",
"number_of_iterations": 1024,
"output": {
"data": "0x00006100050100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
}
},
"infused_challenge_chain_sub_slot_hash": null
}
},
...
...
"reward_claims_incorporated": [
{
"amount": 1750000000000,
"parent_coin_info": "0xeb8c4d20b322be8d9fddbf9412016bdf00000000000000000000000000000011",
"puzzle_hash": "0x5fb3e0ccc23760a7f917a81e7872cc921f9ddbc86582dfb4f64eee66fad5e740"
},
{
"amount": 250000000000,
"parent_coin_info": "0xfe9a2901d7edb0e364e94266d0e095f700000000000000000000000000000011",
"puzzle_hash": "0x5fb3e0ccc23760a7f917a81e7872cc921f9ddbc86582dfb4f64eee66fad5e740"
}
]
}
}
],
"success": true
}