GetCertifiedCommit gets the signed header for a given height and certifies it. Returns error if unable to get a proven header.
GetWithProof will query the key on the given node, and verify it has a valid proof, as defined by the Verifier.
If there is any error in checking, returns an error.
func GetWithProofOptions(prt *merkle.ProofRuntime, path string, key byte, opts rpcclient.ABCIQueryOptions, node rpcclient.Client, cert lite.Verifier) ( *ctypes.ResultABCIQuery, error)
GetWithProofOptions is useful if you want full access to the ABCIQueryOptions. XXX Usage of path? It's not used, and sometimes it's /, sometimes /key, sometimes /store.
IsErrNoData checks whether an error is due to a query returning empty data
func NewVerifier(chainID, rootDir string, client lclient.SignStatusClient, logger log.Logger, cacheSize int) (*lite.DynamicVerifier, error)
RPCRoutes just routes everything to the given client, as if it were a tendermint fullnode.
if we want security, the client must implement it as a secure client
StartProxy will start the websocket manager on the client, set up the rpc routes to proxy via the given client, and start up an http/rpc server on the location given by bind (eg. :1234) NOTE: This function blocks - you may want to call it in a go-routine.
Wrapper wraps a rpcclient with a Verifier and double-checks any input that is provable before passing it along. Allows you to make any rpcclient fully secure.
SecureClient uses a given Verifier to wrap an connection to an untrusted host and return a cryptographically secure rpc client.
If it is wrapping an HTTP rpcclient, it will also wrap the websocket interface
ABCIQuery uses default options for the ABCI query and verifies the returned proof
func (w Wrapper) ABCIQueryWithOptions(path string, data cmn.HexBytes, opts rpcclient.ABCIQueryOptions) (*ctypes.ResultABCIQuery, error)
ABCIQueryWithOptions exposes all options for the ABCI query and verifies the returned proof
Block returns an entire block and verifies all signatures
BlockchainInfo requests a list of headers and verifies them all... Rather expensive.
TODO: optimize this if used for anything needing performance
Commit downloads the Commit and certifies it with the lite.
This is the foundation for all other verification in this module
SubscribeWS subscribes for events using the given query and remote address as a subscriber, but does not verify responses (UNSAFE)!
Tx queries for a given tx and verifies the proof if it was requested
UnsubscribeAllWS calls original client's UnsubscribeAll using remote address as a subscriber.
UnsubscribeWS calls original client's Unsubscribe using remote address as a subscriber.