badger

package
v1.1.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2024 License: CC0-1.0 Imports: 19 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockHandler

type BlockHandler struct {
	Config *Config
	// contains filtered or unexported fields
}

func NewBlockHandler

func NewBlockHandler() (*BlockHandler, error)

func NewBlockHandlerWithCodec

func NewBlockHandlerWithCodec(codec codec.Codec) (*BlockHandler, error)

func (*BlockHandler) BlockHashToNumber

func (h *BlockHandler) BlockHashToNumber(ctx context.Context, hash common.H256) (*uint64, error)

func (*BlockHandler) BlockNumber

func (h *BlockHandler) BlockNumber(ctx context.Context) (*primitives.HexUint, error)

func (*BlockHandler) BlockNumberToHash

func (h *BlockHandler) BlockNumberToHash(ctx context.Context, number common.BN64) (*string, error)

func (*BlockHandler) Close

func (h *BlockHandler) Close() error

func (*BlockHandler) GetBlockByHash

func (h *BlockHandler) GetBlockByHash(ctx context.Context, hash common.H256, isFull bool) (*response.Block, error)

func (*BlockHandler) GetBlockByNumber

func (h *BlockHandler) GetBlockByNumber(ctx context.Context, number common.BN64, isFull bool) (*response.Block, error)

func (*BlockHandler) GetBlockTransactionCountByHash

func (h *BlockHandler) GetBlockTransactionCountByHash(ctx context.Context, hash common.H256) (*primitives.HexUint, error)

func (*BlockHandler) GetBlockTransactionCountByNumber

func (h *BlockHandler) GetBlockTransactionCountByNumber(ctx context.Context, number common.BN64) (*primitives.HexUint, error)

func (*BlockHandler) GetFilterChanges

func (h *BlockHandler) GetFilterChanges(ctx context.Context, filter any) (*[]interface{}, error)

func (*BlockHandler) GetFilterLogs

func (h *BlockHandler) GetFilterLogs(ctx context.Context, filter *dbt.LogFilter) ([]*response.Log, error)

func (*BlockHandler) GetIndexerState

func (h *BlockHandler) GetIndexerState(chainId uint64) ([]byte, error)

func (*BlockHandler) GetLogs

func (h *BlockHandler) GetLogs(ctx context.Context, filter *dbt.LogFilter) ([]*response.Log, error)

func (*BlockHandler) GetTransactionByBlockHashAndIndex

func (h *BlockHandler) GetTransactionByBlockHashAndIndex(ctx context.Context, hash common.H256, index common.Uint64) (*response.Transaction, error)

func (*BlockHandler) GetTransactionByBlockNumberAndIndex

func (h *BlockHandler) GetTransactionByBlockNumberAndIndex(ctx context.Context, number common.BN64, index common.Uint64) (*response.Transaction, error)

func (*BlockHandler) GetTransactionByHash

func (h *BlockHandler) GetTransactionByHash(ctx context.Context, hash common.H256) (*response.Transaction, error)

func (*BlockHandler) GetTransactionReceipt

func (h *BlockHandler) GetTransactionReceipt(ctx context.Context, hash common.H256) (*response.TransactionReceipt, error)

func (*BlockHandler) InsertBlock

func (h *BlockHandler) InsertBlock(block *indexer.Block) error

func (*BlockHandler) SetIndexerState

func (h *BlockHandler) SetIndexerState(chainId uint64, data []byte) error

type Config

type Config struct {
	Core core.Config `mapstructure:"core"`
}

func GetConfig

func GetConfig() *Config

type FilterHandler

type FilterHandler struct {
	Config *Config
	// contains filtered or unexported fields
}

func NewFilterHandler

func NewFilterHandler() (*FilterHandler, error)

func NewFilterHandlerWithCodec

func NewFilterHandlerWithCodec(codec codec.Codec) (*FilterHandler, error)

func (*FilterHandler) Close

func (h *FilterHandler) Close() error

func (*FilterHandler) DeleteFilter

func (h *FilterHandler) DeleteFilter(ctx context.Context, filterId primitives.Data32) error

func (*FilterHandler) GetBlockFilter

func (h *FilterHandler) GetBlockFilter(ctx context.Context, filterId primitives.Data32) (*dbt.BlockFilter, error)

func (*FilterHandler) GetFilter

func (h *FilterHandler) GetFilter(ctx context.Context, filterId primitives.Data32) (any, error)

func (*FilterHandler) GetLogFilter

func (h *FilterHandler) GetLogFilter(ctx context.Context, filterId primitives.Data32) (*dbt.LogFilter, error)

func (*FilterHandler) GetTransactionFilter

func (h *FilterHandler) GetTransactionFilter(ctx context.Context, filterId primitives.Data32) (*dbt.TransactionFilter, error)

func (*FilterHandler) StoreBlockFilter

func (h *FilterHandler) StoreBlockFilter(ctx context.Context, filterId primitives.Data32, filter *dbt.BlockFilter) error

func (*FilterHandler) StoreFilter

func (h *FilterHandler) StoreFilter(ctx context.Context, filterId primitives.Data32, filter any) error

func (*FilterHandler) StoreLogFilter

func (h *FilterHandler) StoreLogFilter(ctx context.Context, filterId primitives.Data32, filter *dbt.LogFilter) error

func (*FilterHandler) StoreTransactionFilter

func (h *FilterHandler) StoreTransactionFilter(ctx context.Context, filterId primitives.Data32, filter *dbt.TransactionFilter) error

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

func NewBadgerLogger

func NewBadgerLogger(log *log.Logger) Logger

func (Logger) Debugf

func (l Logger) Debugf(f string, v ...interface{})

func (Logger) Errorf

func (l Logger) Errorf(f string, v ...interface{})

func (Logger) Infof

func (l Logger) Infof(f string, v ...interface{})

func (Logger) Warningf

func (l Logger) Warningf(f string, v ...interface{})

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL