Documentation ¶
Index ¶
- func ErrNoData() error
- func GetCertifiedCommit(h int64, node rpcclient.Client, cert lite.Certifier) (empty lite.Commit, err error)
- func GetCertifier(chainID, rootDir, nodeAddr string) (*lite.Inquiring, error)
- func GetWithProof(key []byte, reqHeight int64, node rpcclient.Client, cert lite.Certifier) (val data.Bytes, height int64, proof iavl.KeyProof, err error)
- func GetWithProofOptions(path string, key []byte, opts rpcclient.ABCIQueryOptions, ...) (*ctypes.ResultABCIQuery, iavl.KeyProof, error)
- func IsNoDataErr(err error) bool
- func RPCRoutes(c rpcclient.Client) map[string]*rpc.RPCFunc
- func StartProxy(c rpcclient.Client, listenAddr string, logger log.Logger) error
- func ValidateBlock(meta *types.Block, check lite.Commit) error
- func ValidateBlockMeta(meta *types.BlockMeta, check lite.Commit) error
- func ValidateHeader(head *types.Header, check lite.Commit) error
- type Wrapper
- func (w Wrapper) ABCIQuery(path string, data data.Bytes) (*ctypes.ResultABCIQuery, error)
- func (w Wrapper) ABCIQueryWithOptions(path string, data data.Bytes, opts rpcclient.ABCIQueryOptions) (*ctypes.ResultABCIQuery, error)
- func (w Wrapper) Block(height *int64) (*ctypes.ResultBlock, error)
- func (w Wrapper) BlockchainInfo(minHeight, maxHeight int64) (*ctypes.ResultBlockchainInfo, error)
- func (w Wrapper) Commit(height *int64) (*ctypes.ResultCommit, error)
- func (w Wrapper) Tx(hash []byte, prove bool) (*ctypes.ResultTx, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCertifiedCommit ¶
func GetCertifiedCommit(h int64, node rpcclient.Client, cert lite.Certifier) (empty lite.Commit, err error)
GetCertifiedCommit gets the signed header for a given height and certifies it. Returns error if unable to get a proven header.
func GetWithProof ¶
func GetWithProof(key []byte, reqHeight int64, node rpcclient.Client, cert lite.Certifier) ( val data.Bytes, height int64, proof iavl.KeyProof, err error)
GetWithProof will query the key on the given node, and verify it has a valid proof, as defined by the certifier.
If there is any error in checking, returns an error. If val is non-empty, proof should be KeyExistsProof If val is empty, proof should be KeyMissingProof
func GetWithProofOptions ¶
func GetWithProofOptions(path string, key []byte, opts rpcclient.ABCIQueryOptions, node rpcclient.Client, cert lite.Certifier) ( *ctypes.ResultABCIQuery, iavl.KeyProof, error)
GetWithProofOptions is useful if you want full access to the ABCIQueryOptions
func IsNoDataErr ¶
IsNoDataErr checks whether an error is due to a query returning empty data
func RPCRoutes ¶
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
func StartProxy ¶
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)
Types ¶
type Wrapper ¶
Wrapper wraps a rpcclient with a Certifier and double-checks any input that is provable before passing it along. Allows you to make any rpcclient fully secure.
func SecureClient ¶
SecureClient uses a given certifier 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
func (Wrapper) ABCIQuery ¶
ABCIQuery uses default options for the ABCI query and verifies the returned proof
func (Wrapper) ABCIQueryWithOptions ¶
func (w Wrapper) ABCIQueryWithOptions(path string, data data.Bytes, opts rpcclient.ABCIQueryOptions) (*ctypes.ResultABCIQuery, error)
ABCIQueryWithOptions exposes all options for the ABCI query and verifies the returned proof
func (Wrapper) Block ¶
func (w Wrapper) Block(height *int64) (*ctypes.ResultBlock, error)
Block returns an entire block and verifies all signatures
func (Wrapper) BlockchainInfo ¶
func (w Wrapper) BlockchainInfo(minHeight, maxHeight int64) (*ctypes.ResultBlockchainInfo, error)
BlockchainInfo requests a list of headers and verifies them all... Rather expensive.
TODO: optimize this if used for anything needing performance