Documentation ¶
Overview ¶
Package db implements the data store
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoNonceForChain = errors.New("no nonce exists for this chain")
ErrNoNonceForChain indicates that no nonces have been saved for the chain yet.
View Source
var ErrNoNonceForDomain = errors.New("no nonce exists for this domain")
ErrNoNonceForDomain indicates there is no nonce for a domain.
View Source
var ErrNoStoredBlockForChain = errors.New("no block exists for this chain")
ErrNoStoredBlockForChain indicates there are no blocks stored for this domain.
View Source
var ErrNotFound = errors.New("record not found")
ErrNotFound is a not found record standardized across db drivers.
Functions ¶
This section is empty.
Types ¶
type EthTxFilter ¶ added in v0.0.9
EthTxFilter is a filter to use when querying the database for eth transactions.
type EventDBReader ¶ added in v0.0.9
type EventDBReader interface { // RetrieveLogsWithFilter retrieves all logs that match a filter. RetrieveLogsWithFilter(ctx context.Context, logFilter LogFilter) (logs []*types.Log, err error) // RetrieveLogsInRange retrieves all logs that match an inputted filter, and are within a range. RetrieveLogsInRange(ctx context.Context, logFilter LogFilter, startBlock, endBlock uint64) (logs []*types.Log, err error) // RetrieveReceiptsInRange retrieves receipts in a range. RetrieveReceiptsInRange(ctx context.Context, receiptFilter ReceiptFilter, startBlock, endBlock uint64) (receipts []types.Receipt, err error) // RetrieveReceiptsWithFilter retrieves receipts with a filter. RetrieveReceiptsWithFilter(ctx context.Context, receiptFilter ReceiptFilter) (receipts []types.Receipt, err error) // RetrieveEthTxsWithFilter retrieves eth transactions with a filter. RetrieveEthTxsWithFilter(ctx context.Context, ethTxFilter EthTxFilter) ([]types.Transaction, error) // RetrieveEthTxsInRange retrieves eth transactions in a range. RetrieveEthTxsInRange(ctx context.Context, ethTxFilter EthTxFilter, startBlock, endBlock uint64) ([]types.Transaction, error) // RetrieveLastIndexed retrieves the last indexed for a contract address RetrieveLastIndexed(ctx context.Context, contractAddress common.Address, chainID uint32) (uint64, error) }
EventDBReader is an interface for reading events from a database.
type EventDBWriter ¶ added in v0.0.9
type EventDBWriter interface { // StoreLog stores a log StoreLog(ctx context.Context, log types.Log, chainID uint32) error // StoreReceipt stores a receipt StoreReceipt(ctx context.Context, receipt types.Receipt, chainID uint32) error // StoreEthTx stores a processed transaction StoreEthTx(ctx context.Context, tx *types.Transaction, chainID uint32, blockNumber uint64) error // StoreLastIndexed stores the last indexed for a contract address StoreLastIndexed(ctx context.Context, contractAddress common.Address, chainID uint32, blockNumber uint64) error }
EventDBWriter is an interface for writing events to a database.
Directories ¶
Path | Synopsis |
---|---|
datastore
|
|
sql
Package sql accesses a db
|
Package sql accesses a db |
sql/base
Package base contains the base sql implementation
|
Package base contains the base sql implementation |
sql/mysql
Package mysql implements the mysql package
|
Package mysql implements the mysql package |
sql/sqlite
Package sqlite implements the sqlite package
|
Package sqlite implements the sqlite package |
Click to show internal directories.
Click to hide internal directories.