Documentation ¶
Index ¶
- Variables
- func Resume(logDB LogStorage) error
- type ChainsDB
- func (db *ChainsDB) AddLog(chain types.ChainID, logHash backendTypes.TruncatedHash, block eth.BlockID, ...) error
- func (db *ChainsDB) Close() error
- func (db *ChainsDB) LatestBlockNum(chain types.ChainID) uint64
- func (db *ChainsDB) Resume() error
- func (db *ChainsDB) Rewind(chain types.ChainID, headBlockNum uint64) error
- type HeadsStorage
- type LogStorage
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrUnknownChain = errors.New("unknown chain")
)
Functions ¶
func Resume ¶
func Resume(logDB LogStorage) error
Resume prepares the given LogStore to resume recording events. It returns the block number of the last block that is guaranteed to have been fully recorded to the database and rewinds the database to ensure it can resume recording from the first log of the next block.
Types ¶
type ChainsDB ¶
type ChainsDB struct {
// contains filtered or unexported fields
}
func NewChainsDB ¶
func NewChainsDB(logDBs map[types.ChainID]LogStorage, heads HeadsStorage) *ChainsDB
func (*ChainsDB) AddLog ¶
func (db *ChainsDB) AddLog(chain types.ChainID, logHash backendTypes.TruncatedHash, block eth.BlockID, timestamp uint64, logIdx uint32, execMsg *backendTypes.ExecutingMessage) error
type HeadsStorage ¶
type HeadsStorage interface { }
type LogStorage ¶
type LogStorage interface { io.Closer AddLog(logHash backendTypes.TruncatedHash, block eth.BlockID, timestamp uint64, logIdx uint32, execMsg *backendTypes.ExecutingMessage) error Rewind(newHeadBlockNum uint64) error LatestBlockNum() uint64 ClosestBlockInfo(blockNum uint64) (uint64, backendTypes.TruncatedHash, error) }
Click to show internal directories.
Click to hide internal directories.