From 2ad01288be429569a0b0f425479ae97045abee18 Mon Sep 17 00:00:00 2001 From: Alexandra Tran Date: Thu, 17 Aug 2023 14:21:06 -0700 Subject: [PATCH 1/3] doc new debug methods Signed-off-by: Alexandra Tran --- docs/public-networks/reference/api/index.md | 79 +++++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/docs/public-networks/reference/api/index.md b/docs/public-networks/reference/api/index.md index 3ad4000a0e4..1e84b83e096 100644 --- a/docs/public-networks/reference/api/index.md +++ b/docs/public-networks/reference/api/index.md @@ -976,6 +976,85 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"debug_getRawHeader","params":["0 +### `debug_getRawReceipts` + +Returns the [RLP encoding](https://ethereum.org/en/developers/docs/data-structures-and-encoding/rlp/) +of the transaction receipts of the specified block. + +#### Parameters + +`blockNumber`: _string_ - integer representing a block number or one of the string tags `latest`, +`earliest`, or `pending`, as described in [block parameter](../../how-to/use-besu-api/json-rpc.md#block-parameter) + +#### Returns + +`result`: _object_ - array of RLP-encoded [transaction receipts](objects.md#transaction-receipt-object) + + + +# curl HTTP request + +```bash +curl -X POST --data '{"jsonrpc":"2.0","method":"debug_getRawReceipts","params":["0x32026E"],"id":1}' http://127.0.0.1:8545 +``` + +# wscat WS request + +```bash +{"jsonrpc":"2.0","method":"debug_getRawReceipts","params":["0x32026E"],"id":1} +``` + +# JSON result + +```json +{ + "jsonrpc": "2.0", + "id": 1, + "result": "0x7ef9010c0182fa0db9010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c08353766d" +} +``` + + + +### `debug_getRawTransaction` + +Returns the [RLP encoding](https://ethereum.org/en/developers/docs/data-structures-and-encoding/rlp/) +of the specified transaction. + +#### Parameters + +`transaction`: _string_ - 32-byte transaction hash + +#### Returns + +`result`: _object_ - RLP-encoded [transaction object](objects.md#transaction-object) + + + +# curl HTTP request + +```bash +curl -X POST --data '{"jsonrpc":"2.0","method":"debug_getRawBlock","params":["0x3a2fd1a5ea9ffee477f449be53a49398533d2c006a5815023920d1c397298df3"],"id":1}' http://127.0.0.1:8545 +``` + +# wscat WS request + +```bash +{"jsonrpc":"2.0","method":"debug_getRawBlock","params":["0x3a2fd1a5ea9ffee477f449be53a49398533d2c006a5815023920d1c397298df3"],"id":1} +``` + +# JSON result + +```json +{ + "jsonrpc": "2.0", + "id": 1, + "result": "0xe6808609184e72a0008303000094b0920c523d582040f2bcb1bd7fb1c7c1ecebdb3480801c8080" +} +``` + + + ### `debug_metrics` Returns metrics providing information on the internal operation of Besu. From da7192f1d32408fc51a76ba34da33e6e3d2f64fc Mon Sep 17 00:00:00 2001 From: Alexandra Tran Carrillo <12214231+alexandratran@users.noreply.github.com> Date: Thu, 17 Aug 2023 23:05:03 -0700 Subject: [PATCH 2/3] Apply suggestions from code review Co-authored-by: Sally MacFarlane Co-authored-by: Gabriel Fukushima Signed-off-by: Alexandra Tran Carrillo <12214231+alexandratran@users.noreply.github.com> --- docs/public-networks/reference/api/index.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/public-networks/reference/api/index.md b/docs/public-networks/reference/api/index.md index 1e84b83e096..43c5cf21792 100644 --- a/docs/public-networks/reference/api/index.md +++ b/docs/public-networks/reference/api/index.md @@ -1034,13 +1034,13 @@ of the specified transaction. # curl HTTP request ```bash -curl -X POST --data '{"jsonrpc":"2.0","method":"debug_getRawBlock","params":["0x3a2fd1a5ea9ffee477f449be53a49398533d2c006a5815023920d1c397298df3"],"id":1}' http://127.0.0.1:8545 +curl -X POST --data '{"jsonrpc":"2.0","method":"debug_getRawTransaction","params":["0x3a2fd1a5ea9ffee477f449be53a49398533d2c006a5815023920d1c397298df3"],"id":1}' http://127.0.0.1:8545 ``` # wscat WS request ```bash -{"jsonrpc":"2.0","method":"debug_getRawBlock","params":["0x3a2fd1a5ea9ffee477f449be53a49398533d2c006a5815023920d1c397298df3"],"id":1} +{"jsonrpc":"2.0","method":"debug_getRawTransaction","params":["0x3a2fd1a5ea9ffee477f449be53a49398533d2c006a5815023920d1c397298df3"],"id":1} ``` # JSON result @@ -1049,7 +1049,7 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"debug_getRawBlock","params":["0x { "jsonrpc": "2.0", "id": 1, - "result": "0xe6808609184e72a0008303000094b0920c523d582040f2bcb1bd7fb1c7c1ecebdb3480801c8080" + "result": "0xf8678084342770c182520894658bdf435d810c91414ec09147daa6db624063798203e880820a95a0af5fc351b9e457a31f37c84e5cd99dd3c5de60af3de33c6f4160177a2c786a60a0201da7a21046af55837330a2c52fc1543cd4d9ead00ddf178dd96935b607ff9b" } ``` From a7509a4729eb9b66b125a9ab964449f79a7acafd Mon Sep 17 00:00:00 2001 From: Alexandra Tran Date: Thu, 17 Aug 2023 23:07:36 -0700 Subject: [PATCH 3/3] add array Signed-off-by: Alexandra Tran --- docs/public-networks/reference/api/index.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/public-networks/reference/api/index.md b/docs/public-networks/reference/api/index.md index 43c5cf21792..370b6ebd45a 100644 --- a/docs/public-networks/reference/api/index.md +++ b/docs/public-networks/reference/api/index.md @@ -1010,7 +1010,10 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"debug_getRawReceipts","params":[ { "jsonrpc": "2.0", "id": 1, - "result": "0x7ef9010c0182fa0db9010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c08353766d" + "result": [ + "0xf901a60182c70eb9010000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000002000000000000000000000008000000000000000000000000000000000040000000001000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000100000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000002000000000100000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000020000000000000000f89df89b947753cfad258efbc52a9a1452e42ffbce9be486cbf863a0ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa00000000000000000000000000828d0386c1122e565f07dd28c7d1340ed5b3315a000000000000000000000000021849e99c31e3113a489d7eb0fd4d8c0edbe47afa00000000000000000000000000000000000000000000000000000000029b92700", + "0xf901a70183018e1cb9010000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000002000000000000000000000008000000000000000000000000000000000040000000001000000000000000000000000000000000000000000000000010000000000000000000000000000000008000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000002000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000020000000000000000f89df89b947753cfad258efbc52a9a1452e42ffbce9be486cbf863a0ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa00000000000000000000000000828d0386c1122e565f07dd28c7d1340ed5b3315a000000000000000000000000069cda9d6cc6ce05982d0b4fdf9480f2991f39b5aa00000000000000000000000000000000000000000000000000000000029b92700" + ] } ```