Documentation ¶
Index ¶
- func DefaultAppConfig() *srvconfig.Config
- func DefaultParams() *tmproto.ConsensusParams
- func DefaultTendermintConfig() *config.Config
- type 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)
- func StartNode(tmNode *node.Node, cctx Context) (Context, func(), error)
- func (c *Context) FillBlock(squareSize int, accounts []string, broadcastMode string) (*sdk.TxResponse, error)
- func (c *Context) GoContext() context.Context
- func (c *Context) LatestHeight() (int64, error)
- func (c *Context) PostData(account, broadcastMode string, ns, msg []byte) (*sdk.TxResponse, error)
- func (c *Context) WaitForHeight(h int64) (int64, error)
- func (c *Context) WaitForHeightWithTimeout(h int64, t time.Duration) (int64, error)
- func (c *Context) WaitForNextBlock() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultAppConfig ¶
DefaultAppConfig wraps the default config described in the server
func DefaultParams ¶
func DefaultParams() *tmproto.ConsensusParams
func DefaultTendermintConfig ¶
Types ¶
type Context ¶
func New ¶
func New(t *testing.T, cparams *tmproto.ConsensusParams, tmCfg *config.Config, supressLog bool, fundedAccounts ...string) (*node.Node, srvtypes.Application, Context, error)
New creates a ready to use tendermint node that operates a single validator celestia-app network. The passed account names in fundedAccounts are used to generate new private keys, which are included as funded accounts in the genesis file. These keys are stored in the keyring that is returned in the client.Context. 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)
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) FillBlock ¶
func (c *Context) FillBlock(squareSize int, accounts []string, broadcastMode string) (*sdk.TxResponse, error)
FillBlock creates and submits a single transaction that is large enough to create a square of the desired size. broadcast mode indicates if the tx should be submitted async, sync, or block. (see flags.BroadcastModeSync). If broadcast mode is the string zero value, then it will be set to block. This function does not perform checks on the passed squaresize arg, and only works with squaresize >= 2. TODO: perform checks (is a power of 2 and is > 2) on the passed squaresize arg
func (*Context) LatestHeight ¶
LatestHeight returns the latest height of the network or an error if the query fails.
func (*Context) PostData ¶
PostData will create and submit PFD transaction containing the message and namespace. This function blocks until the PFD has been included in a block and returns an error if the transaction is invalid or is rejected by the mempool.
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.