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 EventDB ¶
type EventDB interface { // StoreLog stores a log StoreLog(ctx context.Context, log types.Log, chainID uint32) error // RetrieveLogs retrieves logs that match a tx hash and chain id RetrieveLogs(ctx context.Context, txHash common.Hash, chainID uint32) (logs []*types.Log, err error) // UnsafeRetrieveAllLogs retrieves all logs in the database. When `specific` is true, you can specify // a chainID and contract address to specifically search for. This is only used for testing. UnsafeRetrieveAllLogs(ctx context.Context, specific bool, chainID uint32, address common.Address) (logs []*types.Log, err error) // StoreReceipt stores a receipt StoreReceipt(ctx context.Context, receipt types.Receipt, chainID uint32) error // RetrieveReceipt retrieves a receipt by tx hash and chain id RetrieveReceipt(ctx context.Context, txHash common.Hash, chainID uint32) (receipt types.Receipt, err error) // UnsafeRetrieveAllReceipts retrieves all receipts in the database. When `specific` is true, you can specify // a chainID to specifically search for. This is only used for testing. UnsafeRetrieveAllReceipts(ctx context.Context, specific bool, chainID uint32) (receipts []*types.Receipt, err 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 // RetrieveLastIndexed retrieves the last indexed for a contract address RetrieveLastIndexed(ctx context.Context, contractAddress common.Address, chainID uint32) (uint64, error) }
EventDB stores events.
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.