pebble

package
v0.37.0-preview-5 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2024 License: Apache-2.0 Imports: 18 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Accounts

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

func NewAccounts

func NewAccounts(db *Storage) *Accounts

func (*Accounts) GetBalance

func (a *Accounts) GetBalance(address common.Address) (*big.Int, error)

func (*Accounts) GetNonce

func (a *Accounts) GetNonce(address common.Address) (uint64, error)

func (*Accounts) Update

func (a *Accounts) Update(
	tx models.Transaction,
	receipt *models.Receipt,
	batch *pebble.Batch,
) error

type Blocks

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

func NewBlocks

func NewBlocks(store *Storage, chainID flowGo.ChainID) *Blocks

func (*Blocks) GetByHeight

func (b *Blocks) GetByHeight(height uint64) (*models.Block, error)

func (*Blocks) GetByID

func (b *Blocks) GetByID(ID common.Hash) (*models.Block, error)

func (*Blocks) GetCadenceHeight

func (b *Blocks) GetCadenceHeight(evmHeight uint64) (uint64, error)

func (*Blocks) GetCadenceID added in v0.16.0

func (b *Blocks) GetCadenceID(evmHeight uint64) (flow.Identifier, error)

func (*Blocks) GetHeightByID added in v0.7.0

func (b *Blocks) GetHeightByID(ID common.Hash) (uint64, error)

func (*Blocks) InitHeights added in v0.2.0

func (b *Blocks) InitHeights(cadenceHeight uint64, cadenceID flow.Identifier) error

InitHeights sets the Cadence height to zero as well as EVM heights. Used for empty database init.

func (*Blocks) LatestCadenceHeight

func (b *Blocks) LatestCadenceHeight() (uint64, error)

func (*Blocks) LatestExecutedHeight

func (b *Blocks) LatestExecutedHeight() (uint64, error)

func (*Blocks) LatestIndexedHeight

func (b *Blocks) LatestIndexedHeight() (uint64, error)

func (*Blocks) SetExecutedHeight

func (b *Blocks) SetExecutedHeight(evmHeight uint64) error

func (*Blocks) SetLatestCadenceHeight added in v0.2.0

func (b *Blocks) SetLatestCadenceHeight(height uint64, batch *pebble.Batch) error

func (*Blocks) Store

func (b *Blocks) Store(
	cadenceHeight uint64,
	cadenceID flow.Identifier,
	block *models.Block,
	batch *pebble.Batch,
) error

type Receipts

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

func NewReceipts

func NewReceipts(store *Storage) *Receipts

func (*Receipts) BloomsForBlockRange

func (r *Receipts) BloomsForBlockRange(start, end uint64) ([]*models.BloomsHeight, error)

func (*Receipts) GetByBlockHeight

func (r *Receipts) GetByBlockHeight(height uint64) ([]*models.Receipt, error)

func (*Receipts) GetByTransactionID

func (r *Receipts) GetByTransactionID(ID common.Hash) (*models.Receipt, error)

func (*Receipts) Store

func (r *Receipts) Store(receipts []*models.Receipt, batch *pebble.Batch) error

Store receipt in the index.

Storing receipt will create multiple indexes, each receipt has a transaction ID, and a block height. We create following mappings: - receipt transaction ID => block height bytes - receipt block height => list of encoded receipts (1+ per block) - receipt block height => list of bloom filters (1+ per block)

type Register

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

func NewRegister

func NewRegister(store *Storage, height uint64) *Register

func (*Register) AllocateSlabIndex

func (l *Register) AllocateSlabIndex(owner []byte) (atree.SlabIndex, error)

func (*Register) GetValue

func (l *Register) GetValue(owner, key []byte) ([]byte, error)

func (*Register) SetValue

func (l *Register) SetValue(owner, key, value []byte) error

func (*Register) ValueExists

func (l *Register) ValueExists(owner, key []byte) (bool, error)

type Storage

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

func New

func New(dir string, log zerolog.Logger) (*Storage, error)

New creates a new storage instance using the provided dir location as the storage directory.

func (*Storage) NewBatch added in v0.22.0

func (s *Storage) NewBatch() *pebble.Batch

type Traces added in v0.16.0

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

func NewTraces added in v0.16.0

func NewTraces(store *Storage) *Traces

func (*Traces) GetTransaction added in v0.16.0

func (t *Traces) GetTransaction(ID common.Hash) (json.RawMessage, error)

func (*Traces) StoreTransaction added in v0.16.0

func (t *Traces) StoreTransaction(ID common.Hash, trace json.RawMessage, batch *pebble.Batch) error

type Transactions

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

func NewTransactions

func NewTransactions(store *Storage) *Transactions

func (*Transactions) Get

func (*Transactions) Store

func (t *Transactions) Store(tx models.Transaction, batch *pebble.Batch) error

Jump to

Keyboard shortcuts

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