Documentation ¶
Overview ¶
Package storage provides databases for storage.
Index ¶
- Variables
- func CheckBlock(st Database, networkID base.NetworkID) (block.Manifest, error)
- func CheckBlockEmpty(st Database) (block.Manifest, error)
- func MergeFSError(err error) error
- func MergeStorageError(err error) error
- type Database
- type DatabaseSession
- type LastBlockSaver
- type StateUpdater
- type Statepool
- func (sp *Statepool) AddOperations(ops ...operation.Operation)
- func (sp *Statepool) AddedOperations() map[string]operation.Operation
- func (sp *Statepool) Done()
- func (sp *Statepool) Get(key string) (state.State, bool, error)
- func (sp *Statepool) Height() base.Height
- func (sp *Statepool) InsertedOperations() map[string]valuehash.Hash
- func (sp *Statepool) IsUpdated() bool
- func (sp *Statepool) Set(fact valuehash.Hash, s ...state.State) error
- func (sp *Statepool) Updates() []*state.StateUpdater
- type SyncerSession
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func CheckBlockEmpty ¶
CheckBlockEmpty checks whether local has block data. If empty, return nil block.Manifest.
func MergeFSError ¶
func MergeStorageError ¶
Types ¶
type Database ¶
type Database interface { util.Initializer Encoder() encoder.Encoder Encoders() *encoder.Encoders Close() error Clean() error CleanByHeight(base.Height) error Copy(Database) error NewSession(block.Block) (DatabaseSession, error) NewSyncerSession() (SyncerSession, error) LastManifest() (block.Manifest, bool, error) Manifest(valuehash.Hash) (block.Manifest, bool, error) ManifestByHeight(base.Height) (block.Manifest, bool, error) Manifests(bool, bool, int64, func(base.Height, valuehash.Hash, block.Manifest) (bool, error)) error NewOperationSeals([]operation.Seal) error NewOperations([]operation.Operation) error NewProposal(base.Proposal) error Proposal(valuehash.Hash) (base.Proposal, bool, error) ProposalByPoint(base.Height, base.Round, base.Address) (base.Proposal, bool, error) Proposals(func(base.Proposal) (bool, error), bool) error State(key string) (state.State, bool, error) LastVoteproof(base.Stage) base.Voteproof Voteproof(base.Height, base.Stage) (base.Voteproof, error) HasOperationFact(valuehash.Hash) (bool, error) // NOTE StagedOperationOperations returns operation.Operation by incoming order. StagedOperationsByFact(facts []valuehash.Hash) ([]operation.Operation, error) HasStagedOperation(valuehash.Hash) (bool, error) StagedOperations(func(operation.Operation) (bool, error), bool) error UnstagedOperations([]valuehash.Hash) error SetInfo(string, []byte) error Info(string) ([]byte, bool, error) BlockdataMap(base.Height) (block.BlockdataMap, bool, error) SetBlockdataMaps([]block.BlockdataMap) error LocalBlockdataMapsByHeight(base.Height, func(block.BlockdataMap) (bool, error)) error }
type DatabaseSession ¶
type LastBlockSaver ¶
type StateUpdater ¶
type Statepool ¶
func NewStatepool ¶
func NewStatepoolWithBase ¶
NewStatepoolWithBase only used for testing
func (*Statepool) AddOperations ¶
func (*Statepool) AddedOperations ¶
func (*Statepool) InsertedOperations ¶
func (*Statepool) Updates ¶
func (sp *Statepool) Updates() []*state.StateUpdater
Directories ¶
Path | Synopsis |
---|---|
Package blockdata provides entire block data.
|
Package blockdata provides entire block data. |
localfs
Package localfs provides block data from local filesystem.
|
Package localfs provides block data from local filesystem. |
Package leveldb provides storages of leveldb.
|
Package leveldb provides storages of leveldb. |
Package mongodb provides storages of mongodb.
|
Package mongodb provides storages of mongodb. |
Click to show internal directories.
Click to hide internal directories.