Documentation
¶
Index ¶
- type Worker
- func (w Worker) ExportBlock(b *tmctypes.ResultBlock, txs []*types.Tx, vals *tmctypes.ResultValidators) error
- func (w Worker) ExportPreCommit(commit *tmtypes.Commit, vals *tmctypes.ResultValidators) error
- func (w Worker) ExportTxs(txs []*types.Tx) error
- func (w Worker) ExportValidator(val *tmtypes.Validator) error
- func (w Worker) HandleGenesis(genesis *tmtypes.GenesisDoc) error
- func (w Worker) Start()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Worker ¶
type Worker struct {
// contains filtered or unexported fields
}
Worker defines a job consumer that is responsible for getting and aggregating block and associated data and exporting it to a database.
func NewWorker ¶
func NewWorker(cdc *codec.Codec, q types.Queue, cp *client.Proxy, db db.Database, modules []modules.Module) Worker
NewWorker allows to create a new Worker implementation.
func (Worker) ExportBlock ¶
func (w Worker) ExportBlock(b *tmctypes.ResultBlock, txs []*types.Tx, vals *tmctypes.ResultValidators) error
ExportBlock accepts a finalized block and a corresponding set of transactions and persists them to the database along with attributable metadata. An error is returned if the write fails.
func (Worker) ExportPreCommit ¶
ExportPreCommit accepts a block commitment and a corresponding set of validators for the commitment and persists them to the database. An error is returned if any write fails or if there is any missing aggregated data.
func (Worker) ExportTxs ¶
ExportTxs accepts a slice of transactions and persists then inside the database. An error is returned if the write fails.
func (Worker) ExportValidator ¶
ExportValidator persists a Tendermint validator with an address and a consensus public key. An error is returned if the public key cannot be Bech32 encoded or if the DB write fails.
func (Worker) HandleGenesis ¶
func (w Worker) HandleGenesis(genesis *tmtypes.GenesisDoc) error
HandleGenesis accepts a GenesisDoc and calls all the registered genesis handlers in the order in which they have been registered.