From 25d1c2ae1319d0a084eddbed39dcaf140c47a7ff Mon Sep 17 00:00:00 2001 From: ClydeWallace22 <48610606+BrandtH22@users.noreply.github.com> Date: Tue, 2 Apr 2024 14:49:48 -0600 Subject: [PATCH] include mdx block for full node rpcs --- docs/rpc-reference/full-node.md | 130 +++++++++++++++++++++++++++++++- 1 file changed, 127 insertions(+), 3 deletions(-) diff --git a/docs/rpc-reference/full-node.md b/docs/rpc-reference/full-node.md index 727d5846f4..ea0af9a717 100644 --- a/docs/rpc-reference/full-node.md +++ b/docs/rpc-reference/full-node.md @@ -66,12 +66,15 @@ for spent coins, use the [get_puzzle_and_solution](#get_puzzle_and_solution) API
Example -```json -chia rpc full_node get_additions_and_removals '{"header_hash": "0xfb7891e9a4a9ca6f8a633e0632d82c2502f425526754f71aee5a55d6ad3933d8"}' -``` +````mdx-code-block + ```json + chia rpc full_node get_additions_and_removals '{"header_hash": "0xfb7891e9a4a9ca6f8a633e0632d82c2502f425526754f71aee5a55d6ad3933d8"}' + ``` +```` Response: +````mdx-code-block ```json { "additions": [ @@ -321,6 +324,7 @@ Response: "success": true } ``` +````
@@ -344,18 +348,22 @@ Request Parameters: None
Example +````mdx-code-block ```json chia rpc full_node get_aggsig_additional_data ``` +```` Response: +````mdx-code-block ```json { "additional_data": "ccd5bb71183532bff220ba46c268991a3ff07eb358e8255a65c30a2dce0e5fbb", "success": true } ``` +````
@@ -379,12 +387,15 @@ Request Parameters: None
Example +````mdx-code-block ```json chia rpc full_node get_all_mempool_items ``` +```` Response: +````mdx-code-block ```json { "mempool_items": { @@ -743,6 +754,7 @@ Response: "success": true } ``` +````
@@ -766,12 +778,15 @@ Request Parameters: None
Example +````mdx-code-block ```json chia rpc full_node get_all_mempool_tx_ids ``` +```` Response: +````mdx-code-block ```json { "success": true, @@ -784,6 +799,7 @@ Response: ] } ``` +````
@@ -813,12 +829,15 @@ Request Parameters: Note that some blocks (such as the one from this example) are not transaction blocks: +````mdx-code-block ```json chia rpc full_node get_block '{"header_hash":"0xf42b4e77315d79ddfb3d64becb21e26ebff5408bda4d1b7c3782fd04f49ec0bb"}' ``` +```` Response: +````mdx-code-block ```json { "block": { @@ -896,6 +915,7 @@ Response: "success": true } ``` +```` @@ -919,12 +939,15 @@ Request Parameters: None
Example +````mdx-code-block ```json chia rpc full_node get_blockchain_state ``` +```` Response: +````mdx-code-block ```json { "blockchain_state": { @@ -1013,6 +1036,7 @@ Response: "success": true } ``` +````
@@ -1049,12 +1073,15 @@ Request Parameters:
Example +````mdx-code-block ```json chia rpc full_node get_blocks '{"start": 100, "end": 102, "exclude_header_hash": true}' ``` +```` Response: +````mdx-code-block ```json { "blocks": [ @@ -1291,6 +1318,7 @@ Response: "success": true } ``` +````
@@ -1320,12 +1348,15 @@ Request Parameters: None
Example +````mdx-code-block ```json chia rpc full_node get_block_count_metrics ``` +```` Response: +````mdx-code-block ```json { "metrics": { @@ -1336,6 +1367,7 @@ Response: "success": true } ``` +````
@@ -1363,12 +1395,15 @@ Request Parameters:
Example +````mdx-code-block ```json chia rpc full_node get_block_record '{"header_hash": "0x3723909a7374c4c88cf00ab9b15365f4988f5bdb2d51bac23f6af939fe40f56c"}' ``` +```` Response: +````mdx-code-block ```json { "block_record": { @@ -1416,6 +1451,7 @@ Response: "success": true } ``` +````
@@ -1446,12 +1482,15 @@ Request Parameters: Get two block records (`3 300 000` and `3 300 001`): +````mdx-code-block ```json chia rpc full_node get_block_records '{"start": 3300000, "end": 3300002}' ``` +```` Response: +````mdx-code-block ```json { "block_records": [ @@ -1582,6 +1621,7 @@ Response: "success": true } ``` +```` @@ -1615,12 +1655,15 @@ Note that not all blocks will have all fields set here (depending on transaction
Example +````mdx-code-block ```json chia rpc full_node get_block_record_by_height '{"height": 3000000}' ``` +```` Response: +````mdx-code-block ```json { "block_record": { @@ -1688,6 +1731,7 @@ Response: "success": true } ``` +````
@@ -1721,12 +1765,15 @@ Keep in mind that most blocks do not contain any transactions. These blocks will
Example +````mdx-code-block ```json chia rpc full_node get_block_spends '{"header_hash": "0x65b9e51000d4ab6996b98bf27c1ccd4b0861a5e3b2e8acdb14f45d1680e5e484"}' ``` +```` Response: +````mdx-code-block ```json { "block_spends": [ @@ -1995,6 +2042,7 @@ Response: "success": true } ``` +````
@@ -2028,12 +2076,15 @@ Keep in mind that most blocks do not contain any transactions. These blocks will
Example +````mdx-code-block ```json chia rpc full_node get_block_spends_with_conditions '{"header_hash": "0x0e2adf947b9165298bfb297c5142e9b5ad75ae922052bc95d5ab1b19f2824797"}' ``` +```` Response: +````mdx-code-block ```json { "block_spends_with_conditions": [ @@ -2111,6 +2162,7 @@ Response: "success": true } ``` +````
@@ -2141,12 +2193,15 @@ Request Parameters:
Example +````mdx-code-block ```json chia rpc full_node get_coin_records_by_hint '{"start_height": 400000, "end_height": 1900000, "include_spent_coins": true, "hint": "0x6916079cc35f377e96fa34af87d14f58ce1f08d864f93e89bbdd04a26f591540"}' ``` +```` Response: +````mdx-code-block ```json { "coin_records": [ @@ -2178,6 +2233,7 @@ Response: "success": true } ``` +````
@@ -2208,12 +2264,15 @@ Request Parameters:
Example +````mdx-code-block ```json chia rpc full_node get_coin_records_by_names '{"start_height": 400000, "end_height": 1900000, "include_spent_coins": true, "names":["0x83103a520d363d9356d2bba5be786f56ca83cdccdaad1f7db74cabe3a6ec6195", "0x3a071ea8bb51d724bf3841fae40370ff18fe1e71a890b731ed1e67f026550995"]}' ``` +```` Response: +````mdx-code-block ```json { "coin_records": [ @@ -2245,6 +2304,7 @@ Response: "success": true } ``` +````
@@ -2275,12 +2335,15 @@ Request Parameters:
Example +````mdx-code-block ```json chia rpc full_node get_coin_records_by_parent_ids '{"start_height":4, "end_height": 1900000, "include_spent_coins": true, "parent_ids": ["0x83103a520d363d9356d2bba5be786f56ca83cdccdaad1f7db74cabe3a6ec6195", "0xccd5bb71183532bff220ba46c268991a00000000000000000000000000000061"]}' ``` +```` Response: +````mdx-code-block ```json { "coin_records": [ @@ -2324,6 +2387,7 @@ Response: "success": true } ``` +````
@@ -2354,12 +2418,15 @@ Request Parameters:
Example +````mdx-code-block ```json chia rpc full_node get_coin_records_by_puzzle_hash '{"puzzle_hash": "0x6bde1e0c6f9d3b93dc5e7e878723257ede573deeed59e3b4a90f5c86de1a0bd3", "start_height": 3343000, "end_height": 3343335, "include_spent_coins": true}' ``` +```` Response: +````mdx-code-block ```json { "coin_records": [ @@ -2427,6 +2494,7 @@ Response: "success": true } ``` +````
@@ -2457,12 +2525,15 @@ Request Parameters:
Example +````mdx-code-block ```json chia rpc full_node get_coin_records_by_puzzle_hashes '{"puzzle_hashes": ["0x6bde1e0c6f9d3b93dc5e7e878723257ede573deeed59e3b4a90f5c86de1a0bd3", "0x71c79abd24b6cf63a92a5d8d1ca88014fd3b39cb3c300876370aac477a13b598"], "start_height": 3343293, "end_height": 3343380, "include_spent_coins": false}' ``` +```` Response: +````mdx-code-block ```json { "coin_records": [ @@ -2506,6 +2577,7 @@ Response: "success": true } ``` +````
@@ -2539,12 +2611,15 @@ The `name` (coin ID) can be obtained by hashing the Coin object: `sha256(parent
Example +````mdx-code-block ```json chia rpc full_node get_coin_record_by_name '{"name": "0x7a639649fa2b6b4233cab7bf98b3da01be182afba622eb377011ac0940cd83c8"}' ``` +```` Response: +````mdx-code-block ```json { "coin_record": { @@ -2562,6 +2637,7 @@ Response: "success": true } ``` +````
@@ -2602,12 +2678,15 @@ Obtain a fee estimate for a spendbundle with a CLVM cost of 20 million. Targeted Note that this example was completed at a time when the mempool was not busy, so the fee estimates are all `0`. +````mdx-code-block ```json chia rpc full_node get_fee_estimate '{"cost":20000000, "target_times": [60, 300, 600]}' ``` +```` Response: +````mdx-code-block ```json { "current_fee_rate": 0.0342163071650677, @@ -2628,6 +2707,7 @@ Response: "target_times": [60, 300, 600] } ``` +```` @@ -2657,12 +2737,15 @@ Request Parameters: Start by obtaining all of the mempool tx IDs: +````mdx-code-block ```json chia rpc full_node get_all_mempool_tx_ids ``` +```` Response: +````mdx-code-block ```json { "success": true, @@ -2680,15 +2763,19 @@ Response: ] } ``` +```` Next, obtain a mempool item for one of the IDs: +````mdx-code-block ```json chia rpc full_node get_mempool_item_by_tx_id '{"tx_id": "0x709a278da6d8093b0063c90061c18eb74eb8d49677166dc239455eeaaa9d4315"}' ``` +```` Response: +````mdx-code-block ```json { "mempool_item": { @@ -2794,6 +2881,7 @@ Response: "success": true } ``` +```` @@ -2821,12 +2909,15 @@ Request Parameters:
Example +````mdx-code-block ```json chia rpc full_node get_mempool_items_by_coin_name '{"coin_name": "0xfceac40f1cfe41cc7f0be5f80b9dc1be5d28475a6e8cb3d89a78f0baaee7065a"}' ``` +```` Response: +````mdx-code-block ```json { "mempool_items": [ @@ -2916,6 +3007,7 @@ Response: "success": true } ``` +````
@@ -2939,12 +3031,15 @@ Request Parameters: None
Example +````mdx-code-block ```json chia rpc full_node get_network_info ``` +```` Response: +````mdx-code-block ```json { "network_name": "mainnet", @@ -2952,6 +3047,7 @@ Response: "success": true } ``` +````
@@ -2980,18 +3076,22 @@ Request Parameters:
Example +````mdx-code-block ```json chia rpc full_node get_network_space '{"older_block_header_hash": "023cbcdc3cb97e5ddeb6fe40a6a28b303255bb821090b237d00dd77c9dfefb7a", "newer_block_header_hash": "6c26e4a79b437de1272942a7c4c78e1af3a71741f1244b14320279c7084cf3c8"}' ``` +```` Response: +````mdx-code-block ```json { "space": 26915196432975761408, "success": true } ``` +```` The result is the average network space (in bytes) from the blocks starting with `older_block_header_hash` and ending with `newer_block_header_hash`. @@ -3033,12 +3133,15 @@ By definition, coins that are unspent do not have their original puzzle or solut
Example +````mdx-code-block ```json chia rpc full_node get_puzzle_and_solution '{"coin_id": "0x985221340d70b38cee51d35fdbb64c333e15e7c27133e962d39237672985fdc9", "height": 3343255}' ``` +```` Response: +````mdx-code-block ```json { "coin_solution": { @@ -3053,6 +3156,7 @@ Response: "success": true } ``` +````
@@ -3087,12 +3191,15 @@ Request Parameters:
Example +````mdx-code-block ```json chia rpc full_node get_recent_signage_point_or_eos '{"challenge_hash": "0xc97facdb04807e595f46f76961febeea245c044d35152e4397e5c4878d5bce37"}' ``` +```` Response: +````mdx-code-block ```json { "eos": { @@ -3153,6 +3260,7 @@ Response: "time_received": 1678155344.7621934 } ``` +````
@@ -3176,12 +3284,15 @@ Request Parameters: None
Example +````mdx-code-block ```json chia rpc full_node get_routes ``` +```` Response: +````mdx-code-block ```json { "routes": [ @@ -3223,6 +3334,7 @@ Response: "success": true } ``` +````
@@ -3254,12 +3366,15 @@ blocks after it.
Example +````mdx-code-block ```json chia rpc full_node get_unfinished_block_headers ``` +```` Response: +````mdx-code-block ```json { "headers": [ @@ -3471,6 +3586,7 @@ Response: "success": true } ``` +````
@@ -3500,17 +3616,21 @@ This RPC returns `200` if successful. It is lightweight and can be queried often
Example +````mdx-code-block ```json chia rpc full_node healthz ``` +```` Response: +````mdx-code-block ```json { "success": true } ``` +````
@@ -3539,6 +3659,7 @@ Request Parameters:
Example +````mdx-code-block ```json chia rpc full_node push_tx '{ @@ -3558,12 +3679,15 @@ chia rpc full_node push_tx } }' ``` +```` Response: +````mdx-code-block ```json { "status": "SUCCESS", "success": true } ``` +````