Full Node RPC
The full node RPC API is exposed by the full node, by default on port 8555. This port must not be exposed publicly for security concerns.
A synced full node is required for running the RPCs in this document.
The coinset CLI tool is also capable of returning results equivalent to most of these RPCs. It queries a remote full node that is fast and reliable.
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 full_node get_block '{"header_hash":"0xf42b4e77315d79ddfb3d64becb21e26ebff5408bda4d1b7c3782fd04f49ec0bb"}'
To run the same command on Windows, you need to escape the quotes with backslashes. In other words, add a \ before each double quote, such that:
`"header_hash"` becomes `\"header_hash\"`
get_additions_and_removals
Functionality: Retrieves the additions and removals (state transitions) for a certain block. Returns coin records for each addition and removal
Usage: chia rpc full_node [OPTIONS] get_additions_and_removals [REQUEST]
Options:
Short Command | Long Command | Type | Required | Description |
---|---|---|---|---|
-j | --json-file | FILENAME | False | Optionally instead of REQUEST you can provide a json file containing the request data |
-h | --help | None | False | Show a help message and exit |
Request Parameters:
Flag | Type | Required | Description |
---|---|---|---|
header_hash | HEX STRING | True | The header hash of the block |
Blocks that are not transaction blocks will have empty removal and addition lists. To get the actual puzzles and solutions for spent coins, use the get_puzzle_and_solution API.
Example
chia rpc full_node get_additions_and_removals '{"header_hash": "0xfb7891e9a4a9ca6f8a633e0632d82c2502f425526754f71aee5a55d6ad3933d8"}'
Response:
{
"additions": [
{
"coin": {
"amount": 1750000000000,
"parent_coin_info": "0x9558e5246519b184da7bd9d7bfb528680309352f8658941bfd9452f38d976294",
"puzzle_hash": "0x2f2c9ba1b2315d413a92b5f034fa03282ccba1767fd9ae7b14d942b969ed5d57"
},
"coinbase": false,
"confirmed_block_index": 3339504,
"spent": false,
"spent_block_index": 0,
"timestamp": 1678082304
},
{
"coin": {
"amount": 1,
"parent_coin_info": "0x9558e5246519b184da7bd9d7bfb528680309352f8658941bfd9452f38d976294",
"puzzle_hash": "0xbcf5ca4509bcd430a3366c6b261e09b9def74ee7c5a4a3388a56ae9380099bfc"
},
"coinbase": false,
"confirmed_block_index": 3339504,
"spent": false,
"spent_block_index": 0,
"timestamp": 1678082304
},
{
"coin": {
"amount": 82488030982,
"parent_coin_info": "0x7a639649fa2b6b4233cab7bf98b3da01be182afba622eb377011ac0940cd83c8",
"puzzle_hash": "0x5cfe0cf4c19ca813a05c642915bd68a5e99baee39033d0c6d70774296397e249"
},
"coinbase": false,
"confirmed_block_index": 3339504,
"spent": false,
"spent_block_index": 0,
"timestamp": 1678082304
},
{
"coin": {
"amount": 1,
"parent_coin_info": "0x7a639649fa2b6b4233cab7bf98b3da01be182afba622eb377011ac0940cd83c8",
"puzzle_hash": "0xb5db5e9e2b807d276cfeeed124e2629e1c9ee90cabc209a7469ef13545d120ad"
},
"coinbase": false,
"confirmed_block_index": 3339504,
"spent": false,
"spent_block_index": 0,
"timestamp": 1678082304
},
{
"coin": {
"amount": 1,
"parent_coin_info": "0xadc1a21da474f751a3235f45ae17a2a97ad28cc8c475842a876685d3cd0419ea",
"puzzle_hash": "0xfd41971c8c4cb5b662f7a1aa49790fa110a0b99f9ada4bb6276a23670cdbb4aa"
},
"coinbase": false,
"confirmed_block_index": 3339504,
"spent": false,
"spent_block_index": 0,
"timestamp": 1678082304
},
{
"coin": {
"amount": 1750000000000,
"parent_coin_info": "0xadc1a21da474f751a3235f45ae17a2a97ad28cc8c475842a876685d3cd0419ea",
"puzzle_hash": "0x2f2c9ba1b2315d413a92b5f034fa03282ccba1767fd9ae7b14d942b969ed5d57"
},
"coinbase": false,
"confirmed_block_index": 3339504,
"spent": false,
"spent_block_index": 0,
"timestamp": 1678082304
},
{
"coin": {
"amount": 82487941066,
"parent_coin_info": "0x727961c5d7febde6ea775bd98aca7461f9c6150599bf726a8ccb5f61e86b1f53",
"puzzle_hash": "0xe0ce2b64138107f8371f83aaef3dabf81c19227268ddc2a8c1238adcb7244794"
},
"coinbase": false,
"confirmed_block_index": 3339504,
"spent": false,
"spent_block_index": 0,
"timestamp": 1678082304
},
{
"coin": {
"amount": 1,
"parent_coin_info": "0x727961c5d7febde6ea775bd98aca7461f9c6150599bf726a8ccb5f61e86b1f53",
"puzzle_hash": "0xb5db5e9e2b807d276cfeeed124e2629e1c9ee90cabc209a7469ef13545d120ad"
},
"coinbase": false,
"confirmed_block_index": 3339504,
"spent": false,
"spent_block_index": 0,
"timestamp": 1678082304
},
{
"coin": {
"amount": 1750000000000,
"parent_coin_info": "0xccd5bb71183532bff220ba46c268991a0000000000000000000000000032f4ec",
"puzzle_hash": "0x907491ca39c35bc1f9a6eda33f7c0f97a9f583975088dad7216f1edd79f522ae"
},
"coinbase": true,
"confirmed_block_index": 3339504,
"spent": false,
"spent_block_index": 0,
"timestamp": 1678082304
},
{
"coin": {
"amount": 250000000000,
"parent_coin_info": "0x3ff07eb358e8255a65c30a2dce0e5fbb0000000000000000000000000032f4ec",
"puzzle_hash": "0x907491ca39c35bc1f9a6eda33f7c0f97a9f583975088dad7216f1edd79f522ae"
},
"coinbase": true,
"confirmed_block_index": 3339504,
"spent": false,
"spent_block_index": 0,
"timestamp": 1678082304
},
{
"coin": {
"amount": 1750000000000,
"parent_coin_info": "0xccd5bb71183532bff220ba46c268991a0000000000000000000000000032f4ea",
"puzzle_hash": "0x6529ccb5c37da2c32b5e0984043969e84254dcccf70459c137f9661f06388e8c"
},
"coinbase": true,
"confirmed_block_index": 3339504,
"spent": false,
"spent_block_index": 0,
"timestamp": 1678082304
},
{
"coin": {
"amount": 250000000000,
"parent_coin_info": "0x3ff07eb358e8255a65c30a2dce0e5fbb0000000000000000000000000032f4eb",
"puzzle_hash": "0x454ead2a2dd42ee0d4c66dff83e1df3d769770010b4890b44883dcad2276aa19"
},
"coinbase": true,
"confirmed_block_index": 3339504,
"spent": false,
"spent_block_index": 0,
"timestamp": 1678082304
},
{
"coin": {
"amount": 250000000000,
"parent_coin_info": "0x3ff07eb358e8255a65c30a2dce0e5fbb0000000000000000000000000032f4ea",
"puzzle_hash": "0x10926349cdd6b3bad8cc66073f52530cd89a237f932c4b5f737f8fe1aa3ec173"
},
"coinbase": true,
"confirmed_block_index": 3339504,
"spent": false,
"spent_block_index": 0,
"timestamp": 1678082304
},
{
"coin": {
"amount": 1750000000000,
"parent_coin_info": "0xccd5bb71183532bff220ba46c268991a0000000000000000000000000032f4eb",
"puzzle_hash": "0xca240d0ec25d7cadbe0c920e95e6b8011da2e86aaca2959a8bd8fbec97684ddc"
},
"coinbase": true,
"confirmed_block_index": 3339504,
"spent": false,
"spent_block_index": 0,
"timestamp": 1678082304
}
],
"removals": [
{
"coin": {
"amount": 1,
"parent_coin_info": "0x5112208f031c9c158f3e25f91fe1cd2593251c713393329f53d4f7a438512622",
"puzzle_hash": "0xbcf5ca4509bcd430a3366c6b261e09b9def74ee7c5a4a3388a56ae9380099bfc"
},
"coinbase": false,
"confirmed_block_index": 3161234,
"spent": true,
"spent_block_index": 3339504,
"timestamp": 1674748162
},
{
"coin": {
"amount": 1,
"parent_coin_info": "0x5b778e06d75e13265e66169372c4272b1c97eae44ffb72fbe957957b0c341819",
"puzzle_hash": "0xfd41971c8c4cb5b662f7a1aa49790fa110a0b99f9ada4bb6276a23670cdbb4aa"
},
"coinbase": false,
"confirmed_block_index": 3269008,
"spent": true,
"spent_block_index": 3339504,
"timestamp": 1676766135
},
{
"coin": {
"amount": 82487942067,
"parent_coin_info": "0x4c2710fe1401ab8aa1c88d5dd1720dafaac3ffa68c54a67423b5f8e6471278c1",
"puzzle_hash": "0xa500c99239723e078089cfa2f64aa1bb2140b503cb4e940fedeb7b6313096e1c"
},
"coinbase": false,
"confirmed_block_index": 3339361,
"spent": true,
"spent_block_index": 3339504,
"timestamp": 1678079546
},
{
"coin": {
"amount": 82488031983,
"parent_coin_info": "0xfdc7526bfc5107e000b4f710c8c5944f11f4e7ce9711c522b6040bc473266313",
"puzzle_hash": "0x5198fccb3ca8f14c32a5f05ac50c98209defd2d3ed3ee2a17789a9f6fd7d433b"
},
"coinbase": false,
"confirmed_block_index": 3339400,
"spent": true,
"spent_block_index": 3339504,
"timestamp": 1678080343
},
{
"coin": {
"amount": 1750000000000,
"parent_coin_info": "0xccd5bb71183532bff220ba46c268991a0000000000000000000000000032f4d1",
"puzzle_hash": "0x275544ef0d40a516979d208ac215b306eefddb9675d0bdd08336f06d90f99444"
},
"coinbase": true,
"confirmed_block_index": 3339476,
"spent": true,
"spent_block_index": 3339504,
"timestamp": 1678081696
},
{
"coin": {
"amount": 1750000000000,
"parent_coin_info": "0xccd5bb71183532bff220ba46c268991a0000000000000000000000000032f4d0",
"puzzle_hash": "0x3ef5a53f9b70a309e1778635d9841c1dbdc9eeaf18e963e619327cf92843879b"
},
"coinbase": true,
"confirmed_block_index": 3339476,
"spent": true,
"spent_block_index": 3339504,
"timestamp": 1678081696
}
],
"success": true
}
get_aggsig_additional_data
Functionality: Returns the additional data used for AGG_SIG
conditions for the current network
Usage: chia rpc full_node [OPTIONS] get_aggsig_additional_data [REQUEST]
Options:
Short Command | Long Command | Type | Required | Description |
---|---|---|---|---|
-j | --json-file | FILENAME | False | Optionally instead of REQUEST you can 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_aggsig_additional_data
Response:
{
"additional_data": "ccd5bb71183532bff220ba46c268991a3ff07eb358e8255a65c30a2dce0e5fbb",
"success": true
}