Documentation ¶
Index ¶
- Variables
- func Close() error
- func Open(options badger.Options, gcIntervalSeconds int) (*badger.DB, error)
- type Config
- type DB
- func (db *DB) BadgerDB() *badger.DB
- func (db *DB) Close() error
- func (db *DB) InsertBlockFilter(chainId uint64, filterId primitives.Data32, filter *dbt.BlockFilter) error
- func (db *DB) InsertIndexerState(chainId uint64, data []byte) error
- func (db *DB) InsertLogFilter(chainId uint64, filterId primitives.Data32, filter *dbt.LogFilter) error
- func (db *DB) InsertTransactionFilter(chainId uint64, filterId primitives.Data32, filter *dbt.TransactionFilter) error
- func (db *DB) NewWriter() *Writer
- func (db *DB) Update(fn func(txn *ViewTxn) error) error
- func (db *DB) View(fn func(txn *ViewTxn) error) error
- type ViewTxn
- func (txn *ViewTxn) DeleteBlockFilter(chainId uint64, filterId dbp.Data32) error
- func (txn *ViewTxn) DeleteFilter(chainId uint64, filterId dbp.Data32) error
- func (txn *ViewTxn) DeleteLogFilter(chainId uint64, filterId dbp.Data32) error
- func (txn *ViewTxn) DeleteTransactionFilter(chainId uint64, filterId dbp.Data32) error
- func (txn *ViewTxn) ReadBlock(chainId uint64, key dbt.BlockKey, fullTransactions bool) (*response.Block, error)
- func (txn *ViewTxn) ReadBlockFilter(chainId uint64, filterId dbp.Data32) (*db.BlockFilter, error)
- func (txn *ViewTxn) ReadBlockHashes(ctx context.Context, chainId uint64, from *dbt.BlockKey, to *dbt.BlockKey, ...) ([]primitives.Data32, *dbt.BlockKey, error)
- func (txn *ViewTxn) ReadBlockKey(chainId uint64, hash primitives.Data32) (*dbt.BlockKey, error)
- func (txn *ViewTxn) ReadBlockTxCount(chainId uint64, key dbt.BlockKey) (primitives.HexUint, error)
- func (txn *ViewTxn) ReadEarliestBlockKey(chainId uint64) (*dbt.BlockKey, error)
- func (txn *ViewTxn) ReadEarliestLogKey(chainId uint64) (*db.LogKey, error)
- func (txn *ViewTxn) ReadEarliestTxKey(chainId uint64) (*dbt.TransactionKey, error)
- func (txn *ViewTxn) ReadFilter(chainId uint64, filterId dbp.Data32) (any, error)
- func (txn *ViewTxn) ReadIndexerState(chainId uint64) ([]byte, error)
- func (txn *ViewTxn) ReadLatestBlockKey(chainId uint64) (*dbt.BlockKey, error)
- func (txn *ViewTxn) ReadLatestLogKey(chainId uint64) (*db.LogKey, error)
- func (txn *ViewTxn) ReadLatestTxKey(chainId uint64) (*dbt.TransactionKey, error)
- func (txn *ViewTxn) ReadLogFilter(chainId uint64, filterId dbp.Data32) (*db.LogFilter, error)
- func (txn *ViewTxn) ReadLogs(ctx context.Context, chainId uint64, from *db.LogKey, to *db.LogKey, ...) ([]*response.Log, *db.LogKey, error)
- func (txn *ViewTxn) ReadTransactionFilter(chainId uint64, filterId dbp.Data32) (*db.TransactionFilter, error)
- func (txn *ViewTxn) ReadTransactions(ctx context.Context, chainId uint64, from *dbt.TransactionKey, ...) ([]any, *dbt.TransactionKey, error)
- func (txn *ViewTxn) ReadTx(chainId uint64, key dbt.TransactionKey) (*response.Transaction, error)
- func (txn *ViewTxn) ReadTxKey(chainId uint64, hash primitives.Data32) (*dbt.TransactionKey, error)
- func (txn *ViewTxn) ReadTxReceipt(chainId uint64, key dbt.TransactionKey) (*response.TransactionReceipt, error)
- type Writer
- func (w *Writer) Cancel()
- func (w *Writer) Flush() error
- func (w *Writer) InsertBlock(chainId, height uint64, hash primitives.Data32, data *dbt.Block) error
- func (w *Writer) InsertLog(chainId, height, txIndex, logIndex uint64, data *dbt.Log) error
- func (w *Writer) InsertTransaction(chainId, height, index uint64, hash primitives.Data32, data *dbt.Transaction) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrLimited = errors.New("limited")
Functions ¶
Types ¶
type Config ¶
type Config struct { MaxScanIterators uint `mapstructure:"maxScanIterators"` ScanRangeThreshold uint `mapstructure:"scanRangeThreshold"` FilterTtlMinutes int `mapstructure:"filterTtlMinutes"` GcIntervalSeconds int `mapstructure:"gcIntervalSeconds"` BadgerConfig badger.Options `mapstructure:"options"` }
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func (*DB) BadgerDB ¶
func (db *DB) BadgerDB() *badger.DB
For debugging/testing/etc purposes For production purposes use db.View(...) and db.InsertSomething functions
func (*DB) InsertBlockFilter ¶
func (db *DB) InsertBlockFilter(chainId uint64, filterId primitives.Data32, filter *dbt.BlockFilter) error
func (*DB) InsertLogFilter ¶
func (*DB) InsertTransactionFilter ¶
func (db *DB) InsertTransactionFilter(chainId uint64, filterId primitives.Data32, filter *dbt.TransactionFilter) error
type ViewTxn ¶
type ViewTxn struct {
// contains filtered or unexported fields
}
Wrapper that hides internals from outer packages
func (*ViewTxn) DeleteBlockFilter ¶
func (*ViewTxn) DeleteFilter ¶
func (*ViewTxn) DeleteLogFilter ¶
func (*ViewTxn) DeleteTransactionFilter ¶
func (*ViewTxn) ReadBlockFilter ¶
func (*ViewTxn) ReadBlockHashes ¶
func (*ViewTxn) ReadBlockKey ¶
func (*ViewTxn) ReadBlockTxCount ¶
func (*ViewTxn) ReadEarliestBlockKey ¶
func (*ViewTxn) ReadEarliestLogKey ¶
func (*ViewTxn) ReadEarliestTxKey ¶
func (txn *ViewTxn) ReadEarliestTxKey(chainId uint64) (*dbt.TransactionKey, error)
func (*ViewTxn) ReadFilter ¶
func (*ViewTxn) ReadIndexerState ¶
func (*ViewTxn) ReadLatestBlockKey ¶
func (*ViewTxn) ReadLatestLogKey ¶
func (*ViewTxn) ReadLatestTxKey ¶
func (txn *ViewTxn) ReadLatestTxKey(chainId uint64) (*dbt.TransactionKey, error)
func (*ViewTxn) ReadLogFilter ¶
func (*ViewTxn) ReadTransactionFilter ¶
func (*ViewTxn) ReadTransactions ¶
func (txn *ViewTxn) ReadTransactions( ctx context.Context, chainId uint64, from *dbt.TransactionKey, to *dbt.TransactionKey, full bool, limit int, ) ([]any, *dbt.TransactionKey, error)
func (*ViewTxn) ReadTx ¶
func (txn *ViewTxn) ReadTx(chainId uint64, key dbt.TransactionKey) (*response.Transaction, error)
func (*ViewTxn) ReadTxKey ¶
func (txn *ViewTxn) ReadTxKey(chainId uint64, hash primitives.Data32) (*dbt.TransactionKey, error)
func (*ViewTxn) ReadTxReceipt ¶
func (txn *ViewTxn) ReadTxReceipt(chainId uint64, key dbt.TransactionKey) (*response.TransactionReceipt, error)
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
Wrapper that hides internals from outer packages
func (*Writer) InsertBlock ¶
func (*Writer) InsertTransaction ¶
func (w *Writer) InsertTransaction(chainId, height, index uint64, hash primitives.Data32, data *dbt.Transaction) error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.