add a doc.go

This commit is contained in:
William Banfield
2021-08-13 15:07:17 -04:00
parent 677d87324d
commit 69239c55c9
2 changed files with 37 additions and 1 deletions

View File

@@ -27,7 +27,7 @@ var InspectCmd = &cobra.Command{
inconsistent state.
The inspect command can be used to query the block and state store using Tendermint
RPC calls to debug issues of inconsisent state.
RPC calls to debug issues of inconsistent state.
`,
RunE: runInspect,

36
inspect/doc.go Normal file
View File

@@ -0,0 +1,36 @@
/*
Package inspect provides a tool for investigating the state of a
failed Tendermint node.
This package provides the Inspect type. The Inspect type runs a subset of the Tendermint
RPC endpoints that are useful for debugging issues with Tendermint consensus.
When a node running the Tendermint consensus engine detects an inconsistent consensus state,
the entire node will crash. The Tendermint consensus engine cannot run in this
inconsistent state so the node will not be able to start up again.
The RPC endpoints provided by the Inspect type allow for a node operator to inspect
the block store and state store to better understand what may have caused the inconsistent state.
The Inspect type's lifecycle is controlled by a context.Context
ins := inspect.NewFromConfig(rpcConfig)
ctx, cancelFunc:= context.WithCancel(context.Background())
// Run blocks until the Inspect server is shut down.
go ins.Run(ctx)
...
// calling the cancel function will stop the running inspect server
cancelFunc()
Inspect serves its RPC endpoints on the address configured in the RPC configuration
rpcConfig.ListenAddress = "tcp://127.0.0.1:26657"
ins := inspect.NewFromConfig(rpcConfig)
go ins.Run(ctx)
The list of available RPC endpoints can then be viewed by navigating to
http://127.0.0.1:26657/ in the web browser.
*/
package inspect