github.com/aakash4dev/cometbft@v0.38.2/inspect/doc.go (about)

     1  /*
     2  Package inspect provides a tool for investigating the state of a
     3  failed CometBFT node.
     4  
     5  This package provides the Inspector type. The Inspector type runs a subset of the CometBFT
     6  RPC endpoints that are useful for debugging issues with CometBFT's consensus.
     7  
     8  When a node running the CometBFT's consensus engine detects an inconsistent consensus state,
     9  the entire node will crash. The CometBFT's consensus engine cannot run in this
    10  inconsistent state so the node will not be able to start up again.
    11  
    12  The RPC endpoints provided by the Inspector type allow for a node operator to inspect
    13  the block store and state store to better understand what may have caused the inconsistent state.
    14  
    15  The Inspector type's lifecycle is controlled by a context.Context
    16  
    17  	ins := inspect.NewFromConfig(rpcConfig)
    18  	ctx, cancelFunc:= context.WithCancel(context.Background())
    19  
    20  	// Run blocks until the Inspector server is shut down.
    21  	go ins.Run(ctx)
    22  	...
    23  
    24  	// calling the cancel function will stop the running inspect server
    25  	cancelFunc()
    26  
    27  Inspector serves its RPC endpoints on the address configured in the RPC configuration
    28  
    29  	rpcConfig.ListenAddress = "tcp://127.0.0.1:26657"
    30  	ins := inspect.NewFromConfig(rpcConfig)
    31  	go ins.Run(ctx)
    32  
    33  The list of available RPC endpoints can then be viewed by navigating to
    34  http://127.0.0.1:26657/ in the web browser.
    35  */
    36  package inspect