types

package
v0.50.8-lsm Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 18, 2024 License: Apache-2.0 Imports: 15 Imported by: 3,663

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ABCI added in v0.50.0

type ABCI interface {
	// Info/Query Connection
	Info(*abci.RequestInfo) (*abci.ResponseInfo, error)                     // Return application info
	Query(context.Context, *abci.RequestQuery) (*abci.ResponseQuery, error) // Query for state

	// Mempool Connection
	CheckTx(*abci.RequestCheckTx) (*abci.ResponseCheckTx, error) // Validate a tx for the mempool

	// Consensus Connection
	InitChain(*abci.RequestInitChain) (*abci.ResponseInitChain, error) // Initialize blockchain w validators/other info from CometBFT
	PrepareProposal(*abci.RequestPrepareProposal) (*abci.ResponsePrepareProposal, error)
	ProcessProposal(*abci.RequestProcessProposal) (*abci.ResponseProcessProposal, error)
	// Deliver the decided block with its txs to the Application
	FinalizeBlock(*abci.RequestFinalizeBlock) (*abci.ResponseFinalizeBlock, error)
	// Create application specific vote extension
	ExtendVote(context.Context, *abci.RequestExtendVote) (*abci.ResponseExtendVote, error)
	// Verify application's vote extension data
	VerifyVoteExtension(*abci.RequestVerifyVoteExtension) (*abci.ResponseVerifyVoteExtension, error)
	// Commit the state and return the application Merkle root hash
	Commit() (*abci.ResponseCommit, error)

	// State Sync Connection
	ListSnapshots(*abci.RequestListSnapshots) (*abci.ResponseListSnapshots, error)                // List available snapshots
	OfferSnapshot(*abci.RequestOfferSnapshot) (*abci.ResponseOfferSnapshot, error)                // Offer a snapshot to the application
	LoadSnapshotChunk(*abci.RequestLoadSnapshotChunk) (*abci.ResponseLoadSnapshotChunk, error)    // Load a snapshot chunk
	ApplySnapshotChunk(*abci.RequestApplySnapshotChunk) (*abci.ResponseApplySnapshotChunk, error) // Apply a shapshot chunk
}

ABCI is an interface that enables any finite, deterministic state machine to be driven by a blockchain-based replication engine via the ABCI.

type AppCreator

type AppCreator func(log.Logger, dbm.DB, io.Writer, AppOptions) Application

AppCreator is a function that allows us to lazily initialize an application using various configurations.

type AppExporter

type AppExporter func(
	logger log.Logger,
	db dbm.DB,
	traceWriter io.Writer,
	height int64,
	forZeroHeight bool,
	jailAllowedAddrs []string,
	opts AppOptions,
	modulesToExport []string,
) (ExportedApp, error)

AppExporter is a function that dumps all app state to JSON-serializable structure and returns the current validator set.

type AppOptions

type AppOptions interface {
	Get(string) interface{}
}

AppOptions defines an interface that is passed into an application constructor, typically used to set BaseApp options that are either supplied via config file or through CLI arguments/flags. The underlying implementation is defined by the server package and is typically implemented via a Viper literal defined on the server Context. Note, casting Get calls may not yield the expected types and could result in type assertion errors. It is recommend to either use the cast package or perform manual conversion for safety.

type Application

type Application interface {
	ABCI

	RegisterAPIRoutes(*api.Server, config.APIConfig)

	// RegisterGRPCServer registers gRPC services directly with the gRPC
	// server.
	RegisterGRPCServer(grpc.Server)

	// RegisterTxService registers the gRPC Query service for tx (such as tx
	// simulation, fetching txs by hash...).
	RegisterTxService(client.Context)

	// RegisterTendermintService registers the gRPC Query service for CometBFT queries.
	RegisterTendermintService(client.Context)

	// RegisterNodeService registers the node gRPC Query service.
	RegisterNodeService(client.Context, config.Config)

	// CommitMultiStore return the multistore instance
	CommitMultiStore() storetypes.CommitMultiStore

	// Return the snapshot manager
	SnapshotManager() *snapshots.Manager

	// Close is called in start cmd to gracefully cleanup resources.
	// Must be safe to be called multiple times.
	Close() error
}

Application defines an application interface that wraps abci.Application. The interface defines the necessary contracts to be implemented in order to fully bootstrap and start an application.

type ExportedApp

type ExportedApp struct {
	// AppState is the application state as JSON.
	AppState json.RawMessage
	// Validators is the exported validator set.
	Validators []cmttypes.GenesisValidator
	// Height is the app's latest block height.
	Height int64
	// ConsensusParams are the exported consensus params for ABCI.
	ConsensusParams cmtproto.ConsensusParams
}

ExportedApp represents an exported app state, along with validators, consensus params and latest app height.

type ModuleInitFlags

type ModuleInitFlags func(startCmd *cobra.Command)

ModuleInitFlags takes a start command and adds modules specific init flags.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL