Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
Create represents a method that allows to build any database from a given codec and configuration
type Database ¶
type Database interface {
// HasBlock tells whether or not the database has already stored the block having the given height.
// An error is returned if the operation fails.
HasBlock(height int64) (bool, error)
// SaveBlock will be called when a new block is parsed, passing the block itself
// and the transactions contained inside that block.
// An error is returned if the operation fails.
// NOTE. For each transaction inside txs, SaveTx will be called as well.
SaveBlock(block *tmctypes.ResultBlock, totalGas, commitSignatures uint64) error
// SaveTx will be called to save each transaction contained inside a block.
// An error is returned if the operation fails.
SaveTx(tx *types.Tx) error
// HasValidator returns true if a given validator by consensus address exists.
// An error is returned if the operation fails.
HasValidator(address string) (bool, error)
// SetValidator stores a validator if it does not already exist.
// An error is returned if the operation fails.
// The address should be the consensus address of the validator.
SaveValidator(address, publicKey string) error
// SetPreCommit stores a validator's pre-commit.
// An error is returned if the operation fails.
SaveCommitSig(height int64, commitSig tmtypes.CommitSig, votingPower, proposerPriority int64) error
}
Database represents an abstract database that can be used to save data inside it
Click to show internal directories.
Click to hide internal directories.