From 2e5777aaf090d85e2bac65d0ac6ce9f14349ed00 Mon Sep 17 00:00:00 2001 From: Nicolas MASSART Date: Sat, 15 May 2021 00:51:34 +0200 Subject: [PATCH] add debug state root method (#88) --- common | 2 +- docs/Reference/APIs/DebugAPIs.md | 43 ++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/common b/common index b1dc6c9c..ec95f1d9 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit b1dc6c9c7d8de71ca6b3ef28c33d3da9e1f0a3a7 +Subproject commit ec95f1d9b0fe483f3885164d750541e2404cad25 diff --git a/docs/Reference/APIs/DebugAPIs.md b/docs/Reference/APIs/DebugAPIs.md index 0057f10a..eace6577 100644 --- a/docs/Reference/APIs/DebugAPIs.md +++ b/docs/Reference/APIs/DebugAPIs.md @@ -45,3 +45,46 @@ Retrieves the state of an address at a given block. } } ``` + +### `debug_privateStateRoot` + +Returns the private state root hash at the specified block height. + +#### Parameters + +* `blockNumber`: Integer representing a block number or one of the string tags `latest` (the last block mined) or `pending` + (the last block mined plus pending transactions). + +#### Returns + +* private state root hash at the specified block height + +!!! Example + + === "JSON RPC" + + ```bash + curl -X POST http://localhost:8545 --data '{"jsonrpc":"2.0","method":"debug_privateStateRoot","params":["latest"],"id":1}' --header "Content-Type: application/json" + ``` + + === "JSON result" + + ```json + { + "jsonrpc":"2.0", + "id":1, + "result": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" + } + ``` + + === "geth console command" + + ```js + > debug.privateStateRoot("latest") + ``` + + === "geth console result" + + ```js + "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421" + ```