Skip to content

Commit

Permalink
add debug state root method (#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasMassart authored May 14, 2021
1 parent 65ef5a5 commit 2e5777a
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 1 deletion.
2 changes: 1 addition & 1 deletion common
43 changes: 43 additions & 0 deletions docs/Reference/APIs/DebugAPIs.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
```

0 comments on commit 2e5777a

Please sign in to comment.