leveldbstorage

package
v0.0.0-...-5a6e01e Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2023 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Overview

Package leveldb provides storages of leveldb.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database struct {
	*logging.Logging
	// contains filtered or unexported fields
}

func NewDatabase

func NewDatabase(db *leveldb.DB, encs *encoder.Encoders, enc encoder.Encoder) *Database

func NewMemDatabase

func NewMemDatabase(encs *encoder.Encoders, enc encoder.Encoder) *Database

func (*Database) BlockdataMap

func (st *Database) BlockdataMap(height base.Height) (block.BlockdataMap, bool, error)

func (*Database) Clean

func (st *Database) Clean() error

func (*Database) CleanByHeight

func (st *Database) CleanByHeight(height base.Height) error

func (*Database) Close

func (st *Database) Close() error

func (*Database) Copy

func (st *Database) Copy(source storage.Database) error

func (*Database) DB

func (st *Database) DB() *leveldb.DB

func (*Database) Encoder

func (st *Database) Encoder() encoder.Encoder

func (*Database) Encoders

func (st *Database) Encoders() *encoder.Encoders

func (*Database) HasOperationFact

func (st *Database) HasOperationFact(h valuehash.Hash) (bool, error)

func (*Database) HasStagedOperation

func (st *Database) HasStagedOperation(fact valuehash.Hash) (bool, error)

func (*Database) Info

func (st *Database) Info(key string) ([]byte, bool, error)

func (*Database) Initialize

func (st *Database) Initialize() error

func (*Database) LastManifest

func (st *Database) LastManifest() (block.Manifest, bool, error)

func (*Database) LastVoteproof

func (st *Database) LastVoteproof(stage base.Stage) base.Voteproof

func (*Database) LocalBlockdataMapsByHeight

func (st *Database) LocalBlockdataMapsByHeight(height base.Height, callback func(block.BlockdataMap) (bool, error)) error

func (*Database) Manifest

func (st *Database) Manifest(h valuehash.Hash) (block.Manifest, bool, error)

func (*Database) ManifestByHeight

func (st *Database) ManifestByHeight(height base.Height) (block.Manifest, bool, error)

func (*Database) Manifests

func (st *Database) Manifests(load, reverse bool, limit int64, callback func(base.Height, valuehash.Hash, block.Manifest) (bool, error)) error

func (*Database) NewOperationSeals

func (st *Database) NewOperationSeals(seals []operation.Seal) error

func (*Database) NewOperations

func (st *Database) NewOperations(ops []operation.Operation) error

func (*Database) NewProposal

func (st *Database) NewProposal(proposal base.Proposal) error

func (*Database) NewSession

func (st *Database) NewSession(blk block.Block) (storage.DatabaseSession, error)

func (*Database) NewState

func (st *Database) NewState(sta state.State) error

func (*Database) NewSyncerSession

func (st *Database) NewSyncerSession() (storage.SyncerSession, error)

func (*Database) Proposal

func (st *Database) Proposal(h valuehash.Hash) (base.Proposal, bool, error)

func (*Database) ProposalByPoint

func (st *Database) ProposalByPoint(height base.Height, round base.Round, proposer base.Address) (base.Proposal, bool, error)

func (*Database) Proposals

func (st *Database) Proposals(callback func(base.Proposal) (bool, error), sort bool) error

func (*Database) SetBlockdataMaps

func (st *Database) SetBlockdataMaps(bds []block.BlockdataMap) error

func (*Database) SetInfo

func (st *Database) SetInfo(key string, b []byte) error

func (*Database) StagedOperations

func (st *Database) StagedOperations(callback func(operation.Operation) (bool, error), sort bool) error

func (*Database) StagedOperationsByFact

func (st *Database) StagedOperationsByFact(facts []valuehash.Hash) ([]operation.Operation, error)

func (*Database) State

func (st *Database) State(key string) (state.State, bool, error)

func (*Database) UnstagedOperations

func (st *Database) UnstagedOperations(facts []valuehash.Hash) error

func (*Database) Voteproof

func (st *Database) Voteproof(height base.Height, stage base.Stage) (base.Voteproof, error)

type DatabaseSession

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

func NewSession

func NewSession(st *Database, blk block.Block) (*DatabaseSession, error)

func (*DatabaseSession) Block

func (bst *DatabaseSession) Block() block.Block

func (*DatabaseSession) Cancel

func (bst *DatabaseSession) Cancel() error

func (*DatabaseSession) Close

func (bst *DatabaseSession) Close() error

func (*DatabaseSession) Commit

func (bst *DatabaseSession) Commit(ctx context.Context, bd block.BlockdataMap) error

func (*DatabaseSession) SetACCEPTVoteproof

func (bst *DatabaseSession) SetACCEPTVoteproof(voteproof base.Voteproof) error

func (*DatabaseSession) SetBlock

func (bst *DatabaseSession) SetBlock(_ context.Context, blk block.Block) error

type SyncerSession

type SyncerSession struct {
	sync.RWMutex
	*logging.Logging
	// contains filtered or unexported fields
}

func NewSyncerSession

func NewSyncerSession(main *Database) *SyncerSession

func (*SyncerSession) Close

func (st *SyncerSession) Close() error

func (*SyncerSession) Commit

func (st *SyncerSession) Commit() error

func (*SyncerSession) HasBlock

func (st *SyncerSession) HasBlock(height base.Height) (bool, error)

func (*SyncerSession) Manifest

func (st *SyncerSession) Manifest(height base.Height) (block.Manifest, bool, error)

func (*SyncerSession) SetBlocks

func (st *SyncerSession) SetBlocks(blocks []block.Block, maps []block.BlockdataMap) error

func (*SyncerSession) SetManifests

func (st *SyncerSession) SetManifests(manifests []block.Manifest) error

func (*SyncerSession) SetSkipLastBlock

func (st *SyncerSession) SetSkipLastBlock(bool)

Jump to

Keyboard shortcuts

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