Documentation ¶
Index ¶
- func DefaultAppConfig() *srvconfig.Config
- func DefaultGenesisState(fundedAccounts ...string) (map[string]json.RawMessage, keyring.Keyring, error)
- func DefaultParams() *tmproto.ConsensusParams
- func DefaultTendermintConfig() *config.Config
- type Context
- func DefaultNetwork(t *testing.T, blockTime time.Duration) (cleanup func() error, accounts []string, cctx Context)
- func New(t *testing.T, cparams *tmproto.ConsensusParams, tmCfg *config.Config, ...) (*node.Node, srvtypes.Application, Context, error)
- func StartGRPCServer(app srvtypes.Application, appCfg *srvconfig.Config, cctx Context) (Context, func() error, error)
- func StartNode(tmNode *node.Node, cctx Context) (Context, func() error, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultAppConfig ¶
DefaultAppConfig wraps the default config described in the server
func DefaultGenesisState ¶
func DefaultGenesisState(fundedAccounts ...string) (map[string]json.RawMessage, keyring.Keyring, error)
DefaultGenesisState returns a default genesis state and a keyring with accounts that have coins. The keyring accounts are based on the fundedAccounts parameter.
func DefaultParams ¶
func DefaultParams() *tmproto.ConsensusParams
func DefaultTendermintConfig ¶
Types ¶
type Context ¶
func DefaultNetwork ¶
func DefaultNetwork(t *testing.T, blockTime time.Duration) (cleanup func() error, accounts []string, cctx Context)
DefaultNetwork creates an in-process single validator metro network using test friendly defaults. These defaults include fast block times and funded accounts. The returned client.Context has a keyring with all of the funded keys stored in it.
func New ¶
func New( t *testing.T, cparams *tmproto.ConsensusParams, tmCfg *config.Config, supressLog bool, genState map[string]json.RawMessage, kr keyring.Keyring, ) (*node.Node, srvtypes.Application, Context, error)
New creates a ready to use tendermint node that operates a single validator metro network using the provided genesis state. The provided keyring is stored in the client.Context that is returned.
NOTE: the forced delay between blocks, TimeIotaMs in the consensus parameters, is set to the lowest possible value (1ms).
func StartGRPCServer ¶
func StartGRPCServer(app srvtypes.Application, appCfg *srvconfig.Config, cctx Context) (Context, func() error, error)
StartGRPCServer starts the grpc server using the provided application and config. A grpc client connection to that server is also added to the client context. The returned function should be used to shutdown the server.
func StartNode ¶
StartNode starts the tendermint node along with a local core rpc client. The rpc is returned via the client.Context. The function returned should be called during cleanup to teardown the node, core client, along with canceling the internal context.Context in the returned Context.
func (*Context) LatestHeight ¶
LatestHeight returns the latest height of the network or an error if the query fails.
func (*Context) WaitForHeight ¶
WaitForHeight performs a blocking check where it waits for a block to be committed after a given block. If that height is not reached within a timeout, an error is returned. Regardless, the latest height queried is returned.
func (*Context) WaitForHeightWithTimeout ¶
WaitForHeightWithTimeout is the same as WaitForHeight except the caller can provide a custom timeout.
func (*Context) WaitForNextBlock ¶
WaitForNextBlock waits for the next block to be committed, returning an error upon failure.