Skip to content

Commit 8173de2

Browse files
committed
work on doc.go
1 parent 88eb49d commit 8173de2

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

cmd/utils/flags.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,7 @@ var (
743743

744744
StateDiffFlag = cli.BoolFlag{
745745
Name: "statediff",
746-
Usage: "Enables the calculation of state diffs between each block, persists these state diffs the configured persistence mode.",
746+
Usage: "Enables the processing of state diffs between each block",
747747
}
748748
StateDiffPathsAndProofs = cli.BoolFlag{
749749
Name: "statediff.pathsandproofs",

statediff/doc.go

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,23 @@ This work is adapted from work by Charles Crain at https://github.com/jpmorganch
2020
Package statediff provides an auxiliary service that processes state diff objects from incoming chain events,
2121
relaying the objects to any rpc subscriptions.
2222
23+
The service is spun up using the below CLI flags
24+
--statediff: boolean flag, turns on the service
25+
--statediff.streamblock: boolean flag, configures the service to associate and stream out the rest of the block data with the state diffs.
26+
--statediff.intermediatenodes: boolean flag, tells service to include intermediate (branch and extension) nodes; default (false) processes leaf nodes only.
27+
--statediff.pathsandproofs: boolean flag, tells service to generate paths and proofs for the diffed storage and state trie leaf nodes.
28+
--statediff.watchedaddresses: string slice flag, used to limit the state diffing process to the given addresses. Usage: --statediff.watchedaddresses=addr1 --statediff.watchedaddresses=addr2 --statediff.watchedaddresses=addr3
29+
30+
If you wish to use the websocket endpoint to subscribe to the statediff service, be sure to open up the Websocket RPC server with the `--ws` flag.
31+
2332
Rpc subscriptions to the service can be created using the rpc.Client.Subscribe() method,
2433
with the "statediff" namespace, a statediff.Payload channel, and the name of the statediff api's rpc method- "stream".
2534
2635
e.g.
2736
37+
cli, _ := rpc.Dial("ipcPathOrWsURL")
2838
stateDiffPayloadChan := make(chan statediff.Payload, 20000)
29-
rpcSub, err := Subscribe(context.Background(), "statediff", stateDiffPayloadChan, "stream"})
39+
rpcSub, err := cli.Subscribe(context.Background(), "statediff", stateDiffPayloadChan, "stream"})
3040
for {
3141
select {
3242
case stateDiffPayload := <- stateDiffPayloadChan:
@@ -35,6 +45,5 @@ for {
3545
log.Error(err)
3646
}
3747
}
38-
3948
*/
4049
package statediff

0 commit comments

Comments
 (0)