Documentation ¶
Overview ¶
Package isaacdatabase handles data for isaac
Index ¶
- func CleanSyncPool(st *leveldbstorage.Storage) error
- func HeightFromPrefixStoragePrefix(b []byte) (base.Height, error)
- func NewHashRecordMeta(h util.Hash) util.Byter
- func NewPoolOperationRecordMeta(op base.Operation) util.Byter
- func ReadHashRecordMeta(b []byte) (util.Hash, error)
- type Center
- func (db *Center) BlockMap(height base.Height) (base.BlockMap, bool, error)
- func (db *Center) BlockMapBytes(height base.Height) (enchint hint.Hint, meta, body []byte, found bool, err error)
- func (*Center) Close() error
- func (db *Center) ExistsInStateOperation(h util.Hash) (bool, error)
- func (db *Center) ExistsKnownOperation(h util.Hash) (bool, error)
- func (db *Center) LastBlockMap() (base.BlockMap, bool, error)
- func (db *Center) LastBlockMapBytes() (enchint hint.Hint, meta, body []byte, found bool, err error)
- func (db *Center) LastNetworkPolicy() base.NetworkPolicy
- func (db *Center) LastSuffrageProof() (base.SuffrageProof, bool, error)
- func (db *Center) LastSuffrageProofBytes() (enchint hint.Hint, meta, body []byte, found bool, lastheight base.Height, ...)
- func (db *Center) MergeAllPermanent() error
- func (db *Center) MergeBlockWriteDatabase(w isaac.BlockWriteDatabase) error
- func (db *Center) NewBlockWriteDatabase(height base.Height) (isaac.BlockWriteDatabase, error)
- func (db *Center) RemoveBlocks(height base.Height) (bool, error)
- func (db *Center) SetLogging(l *logging.Logging) *logging.Logging
- func (db *Center) State(key string) (base.State, bool, error)
- func (db *Center) StateBytes(key string) (ht hint.Hint, _, _ []byte, _ bool, _ error)
- func (db *Center) SuffrageProof(suffrageHeight base.Height) (base.SuffrageProof, bool, error)
- func (db *Center) SuffrageProofByBlockHeight(height base.Height) (base.SuffrageProof, bool, error)
- func (db *Center) SuffrageProofBytes(suffrageHeight base.Height) (enchint hint.Hint, meta, body []byte, found bool, err error)
- type LeveldbBlockWrite
- func (db *LeveldbBlockWrite) BlockMap() (base.BlockMap, error)
- func (db *LeveldbBlockWrite) BlockMapBytes() (enchint hint.Hint, meta, body []byte, err error)
- func (db *LeveldbBlockWrite) Cancel() error
- func (db *LeveldbBlockWrite) Close() error
- func (db *LeveldbBlockWrite) NetworkPolicy() base.NetworkPolicy
- func (db LeveldbBlockWrite) Prefix() []byte
- func (db LeveldbBlockWrite) Remove() error
- func (db *LeveldbBlockWrite) SetBlockMap(m base.BlockMap) error
- func (db *LeveldbBlockWrite) SetOperations(ops []util.Hash) error
- func (db *LeveldbBlockWrite) SetStates(sts []base.State) error
- func (db *LeveldbBlockWrite) SetSuffrageProof(proof base.SuffrageProof) error
- func (db *LeveldbBlockWrite) SuffrageState() base.State
- func (db *LeveldbBlockWrite) TempDatabase() (isaac.TempDatabase, error)
- func (db *LeveldbBlockWrite) Write() error
- type LeveldbPermanent
- func (db *LeveldbPermanent) BlockMap(height base.Height) (m base.BlockMap, _ bool, _ error)
- func (db *LeveldbPermanent) BlockMapBytes(height base.Height) (enchint hint.Hint, meta, body []byte, found bool, err error)
- func (db *LeveldbPermanent) Clean() error
- func (db LeveldbPermanent) Close() error
- func (db *LeveldbPermanent) ExistsInStateOperation(h util.Hash) (bool, error)
- func (db *LeveldbPermanent) ExistsKnownOperation(h util.Hash) (bool, error)
- func (db LeveldbPermanent) LastBlockMap() (base.BlockMap, bool, error)
- func (db LeveldbPermanent) LastBlockMapBytes() (enchint hint.Hint, meta, body []byte, found bool, err error)
- func (db LeveldbPermanent) LastNetworkPolicy() base.NetworkPolicy
- func (db LeveldbPermanent) LastSuffrageProof() (base.SuffrageProof, bool, error)
- func (db LeveldbPermanent) LastSuffrageProofBytes() (enchint hint.Hint, meta, body []byte, found bool, err error)
- func (db *LeveldbPermanent) MergeTempDatabase(ctx context.Context, temp isaac.TempDatabase) error
- func (db LeveldbPermanent) Prefix() []byte
- func (db LeveldbPermanent) Remove() error
- func (db *LeveldbPermanent) State(key string) (st base.State, found bool, err error)
- func (db *LeveldbPermanent) StateBytes(key string) (enchint hint.Hint, meta, body []byte, found bool, err error)
- func (db *LeveldbPermanent) SuffrageProof(suffrageHeight base.Height) (base.SuffrageProof, bool, error)
- func (db *LeveldbPermanent) SuffrageProofByBlockHeight(height base.Height) (base.SuffrageProof, bool, error)
- func (db *LeveldbPermanent) SuffrageProofBytes(suffrageHeight base.Height) (enchint hint.Hint, meta, body []byte, found bool, err error)
- type LeveldbTempSyncPool
- func (db *LeveldbTempSyncPool) BlockMap(height base.Height) (m base.BlockMap, found bool, _ error)
- func (db *LeveldbTempSyncPool) Cancel() error
- func (db LeveldbTempSyncPool) Close() error
- func (db LeveldbTempSyncPool) Prefix() []byte
- func (db LeveldbTempSyncPool) Remove() error
- func (db *LeveldbTempSyncPool) SetBlockMap(m base.BlockMap) error
- type MemTempSyncPool
- type PoolOperationRecordMeta
- type RedisPermanent
- func (db *RedisPermanent) BlockMap(height base.Height) (m base.BlockMap, _ bool, _ error)
- func (db *RedisPermanent) BlockMapBytes(height base.Height) (enchint hint.Hint, meta, body []byte, found bool, err error)
- func (db *RedisPermanent) Clean() error
- func (db *RedisPermanent) Close() error
- func (db *RedisPermanent) ExistsInStateOperation(h util.Hash) (bool, error)
- func (db *RedisPermanent) ExistsKnownOperation(h util.Hash) (bool, error)
- func (db RedisPermanent) LastBlockMap() (base.BlockMap, bool, error)
- func (db RedisPermanent) LastBlockMapBytes() (enchint hint.Hint, meta, body []byte, found bool, err error)
- func (db RedisPermanent) LastNetworkPolicy() base.NetworkPolicy
- func (db RedisPermanent) LastSuffrageProof() (base.SuffrageProof, bool, error)
- func (db RedisPermanent) LastSuffrageProofBytes() (enchint hint.Hint, meta, body []byte, found bool, err error)
- func (db *RedisPermanent) MergeTempDatabase(ctx context.Context, temp isaac.TempDatabase) error
- func (db *RedisPermanent) State(key string) (st base.State, found bool, _ error)
- func (db *RedisPermanent) StateBytes(key string) (enchint hint.Hint, meta, body []byte, found bool, err error)
- func (db *RedisPermanent) SuffrageProof(suffrageHeight base.Height) (base.SuffrageProof, bool, error)
- func (db *RedisPermanent) SuffrageProofByBlockHeight(height base.Height) (base.SuffrageProof, bool, error)
- func (db *RedisPermanent) SuffrageProofBytes(suffrageHeight base.Height) (enchint hint.Hint, meta, body []byte, found bool, err error)
- type TempLeveldb
- func (db *TempLeveldb) BlockMapBytes() (enchint hint.Hint, meta, body []byte, _ error)
- func (db *TempLeveldb) Close() error
- func (db *TempLeveldb) ExistsInStateOperation(h util.Hash) (bool, error)
- func (db *TempLeveldb) ExistsKnownOperation(h util.Hash) (bool, error)
- func (db *TempLeveldb) Height() base.Height
- func (db *TempLeveldb) LastBlockMap() (base.BlockMap, bool, error)
- func (db *TempLeveldb) LastSuffrageProofBytes() (enchint hint.Hint, meta, body []byte, found bool, err error)
- func (db *TempLeveldb) Merge() error
- func (db *TempLeveldb) NetworkPolicy() base.NetworkPolicy
- func (db TempLeveldb) Prefix() []byte
- func (db *TempLeveldb) Remove() error
- func (db *TempLeveldb) State(key string) (st base.State, found bool, err error)
- func (db *TempLeveldb) StateBytes(key string) (enchint hint.Hint, meta, body []byte, found bool, err error)
- func (db *TempLeveldb) SuffrageHeight() base.Height
- func (db *TempLeveldb) SuffrageProof() (base.SuffrageProof, bool, error)
- type TempPool
- func (db *TempPool) Ballot(point base.Point, stage base.Stage, isSuffrageConfirm bool) (base.Ballot, bool, error)
- func (db *TempPool) Close() error
- func (db *TempPool) LastVoteproofs() (base.INITVoteproof, base.ACCEPTVoteproof, bool, error)
- func (db *TempPool) NewOperation(_ context.Context, operationhash util.Hash) (op base.Operation, found bool, _ error)
- func (db *TempPool) NewOperationBytes(_ context.Context, operationhash util.Hash) (enchint hint.Hint, meta, body []byte, found bool, _ error)
- func (db *TempPool) NewOperationHashes(ctx context.Context, height base.Height, limit uint64, ...) ([]util.Hash, error)
- func (db TempPool) Prefix() []byte
- func (db *TempPool) Proposal(h util.Hash) (pr base.ProposalSignFact, found bool, _ error)
- func (db *TempPool) ProposalByPoint(point base.Point, proposer base.Address) (base.ProposalSignFact, bool, error)
- func (db *TempPool) ProposalBytes(h util.Hash) (enchint hint.Hint, meta, body []byte, found bool, _ error)
- func (db TempPool) Remove() error
- func (db *TempPool) RemoveSuffrageWithdrawOperationsByFact(facts []base.SuffrageWithdrawFact) error
- func (db *TempPool) RemoveSuffrageWithdrawOperationsByHeight(height base.Height) error
- func (db *TempPool) SetBallot(bl base.Ballot) (bool, error)
- func (db *TempPool) SetLastVoteproofs(ivp base.INITVoteproof, avp base.ACCEPTVoteproof) error
- func (db *TempPool) SetNewOperation(_ context.Context, op base.Operation) (bool, error)
- func (db *TempPool) SetProposal(pr base.ProposalSignFact) (bool, error)
- func (db *TempPool) SetSuffrageWithdrawOperation(op base.SuffrageWithdrawOperation) error
- func (db *TempPool) SuffrageWithdrawOperation(height base.Height, node base.Address) (base.SuffrageWithdrawOperation, bool, error)
- func (db *TempPool) TraverseSuffrageWithdrawOperations(_ context.Context, height base.Height, callback isaac.SuffrageVoteFunc) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanSyncPool ¶
func CleanSyncPool(st *leveldbstorage.Storage) error
Types ¶
type Center ¶
type Center struct { *logging.Logging *util.ContextDaemon sync.RWMutex // contains filtered or unexported fields }
func NewCenter ¶
func NewCenter( st *leveldbstorage.Storage, encs *encoder.Encoders, enc encoder.Encoder, perm isaac.PermanentDatabase, newBlockWriteDatabase func(base.Height) (isaac.BlockWriteDatabase, error), ) (*Center, error)
func (*Center) BlockMapBytes ¶
func (*Center) ExistsInStateOperation ¶
func (*Center) ExistsKnownOperation ¶
func (*Center) LastBlockMapBytes ¶
func (*Center) LastNetworkPolicy ¶
func (db *Center) LastNetworkPolicy() base.NetworkPolicy
func (*Center) LastSuffrageProof ¶
func (db *Center) LastSuffrageProof() (base.SuffrageProof, bool, error)
func (*Center) LastSuffrageProofBytes ¶
func (*Center) MergeAllPermanent ¶
func (*Center) MergeBlockWriteDatabase ¶
func (db *Center) MergeBlockWriteDatabase(w isaac.BlockWriteDatabase) error
func (*Center) NewBlockWriteDatabase ¶
func (*Center) RemoveBlocks ¶
RemoveBlocks removes temp databases over height including height.
func (*Center) StateBytes ¶
func (*Center) SuffrageProof ¶
func (*Center) SuffrageProofByBlockHeight ¶
type LeveldbBlockWrite ¶
func NewLeveldbBlockWrite ¶
func NewLeveldbBlockWrite( height base.Height, st *leveldbstorage.Storage, encs *encoder.Encoders, enc encoder.Encoder, ) *LeveldbBlockWrite
func (*LeveldbBlockWrite) BlockMapBytes ¶
func (db *LeveldbBlockWrite) BlockMapBytes() (enchint hint.Hint, meta, body []byte, err error)
func (*LeveldbBlockWrite) Cancel ¶
func (db *LeveldbBlockWrite) Cancel() error
func (*LeveldbBlockWrite) Close ¶
func (db *LeveldbBlockWrite) Close() error
func (*LeveldbBlockWrite) NetworkPolicy ¶
func (db *LeveldbBlockWrite) NetworkPolicy() base.NetworkPolicy
func (*LeveldbBlockWrite) SetBlockMap ¶
func (db *LeveldbBlockWrite) SetBlockMap(m base.BlockMap) error
func (*LeveldbBlockWrite) SetOperations ¶
func (db *LeveldbBlockWrite) SetOperations(ops []util.Hash) error
func (*LeveldbBlockWrite) SetStates ¶
func (db *LeveldbBlockWrite) SetStates(sts []base.State) error
func (*LeveldbBlockWrite) SetSuffrageProof ¶
func (db *LeveldbBlockWrite) SetSuffrageProof(proof base.SuffrageProof) error
func (*LeveldbBlockWrite) SuffrageState ¶
func (db *LeveldbBlockWrite) SuffrageState() base.State
func (*LeveldbBlockWrite) TempDatabase ¶
func (db *LeveldbBlockWrite) TempDatabase() (isaac.TempDatabase, error)
func (*LeveldbBlockWrite) Write ¶
func (db *LeveldbBlockWrite) Write() error
type LeveldbPermanent ¶
func NewLeveldbPermanent ¶
func NewLeveldbPermanent( st *leveldbstorage.Storage, encs *encoder.Encoders, enc encoder.Encoder, ) (*LeveldbPermanent, error)
func (*LeveldbPermanent) BlockMapBytes ¶
func (*LeveldbPermanent) Clean ¶
func (db *LeveldbPermanent) Clean() error
func (*LeveldbPermanent) ExistsInStateOperation ¶
func (db *LeveldbPermanent) ExistsInStateOperation(h util.Hash) (bool, error)
func (*LeveldbPermanent) ExistsKnownOperation ¶
func (db *LeveldbPermanent) ExistsKnownOperation(h util.Hash) (bool, error)
func (LeveldbPermanent) LastBlockMap ¶
func (LeveldbPermanent) LastBlockMapBytes ¶
func (LeveldbPermanent) LastNetworkPolicy ¶
func (db LeveldbPermanent) LastNetworkPolicy() base.NetworkPolicy
func (LeveldbPermanent) LastSuffrageProof ¶
func (db LeveldbPermanent) LastSuffrageProof() (base.SuffrageProof, bool, error)
func (LeveldbPermanent) LastSuffrageProofBytes ¶
func (*LeveldbPermanent) MergeTempDatabase ¶
func (db *LeveldbPermanent) MergeTempDatabase(ctx context.Context, temp isaac.TempDatabase) error
func (*LeveldbPermanent) StateBytes ¶
func (*LeveldbPermanent) SuffrageProof ¶
func (db *LeveldbPermanent) SuffrageProof(suffrageHeight base.Height) (base.SuffrageProof, bool, error)
func (*LeveldbPermanent) SuffrageProofByBlockHeight ¶
func (db *LeveldbPermanent) SuffrageProofByBlockHeight(height base.Height) (base.SuffrageProof, bool, error)
func (*LeveldbPermanent) SuffrageProofBytes ¶
type LeveldbTempSyncPool ¶
type LeveldbTempSyncPool struct {
// contains filtered or unexported fields
}
func NewLeveldbTempSyncPool ¶
func NewLeveldbTempSyncPool( height base.Height, st *leveldbstorage.Storage, encs *encoder.Encoders, enc encoder.Encoder, ) (*LeveldbTempSyncPool, error)
func (*LeveldbTempSyncPool) Cancel ¶
func (db *LeveldbTempSyncPool) Cancel() error
func (*LeveldbTempSyncPool) SetBlockMap ¶
func (db *LeveldbTempSyncPool) SetBlockMap(m base.BlockMap) error
type MemTempSyncPool ¶
func NewMemTempSyncPool ¶
func NewMemTempSyncPool() *MemTempSyncPool
func (*MemTempSyncPool) Cancel ¶
func (db *MemTempSyncPool) Cancel() error
func (*MemTempSyncPool) Close ¶
func (db *MemTempSyncPool) Close() error
func (*MemTempSyncPool) SetBlockMap ¶
func (db *MemTempSyncPool) SetBlockMap(m base.BlockMap) error
type PoolOperationRecordMeta ¶
type PoolOperationRecordMeta struct {
// contains filtered or unexported fields
}
func ReadPoolOperationRecordMeta ¶
func ReadPoolOperationRecordMeta(b []byte) (meta PoolOperationRecordMeta, _ error)
func (PoolOperationRecordMeta) AddedAt ¶
func (h PoolOperationRecordMeta) AddedAt() time.Time
func (PoolOperationRecordMeta) Fact ¶
func (h PoolOperationRecordMeta) Fact() util.Hash
func (PoolOperationRecordMeta) Hint ¶
func (h PoolOperationRecordMeta) Hint() hint.Hint
func (PoolOperationRecordMeta) Operation ¶
func (h PoolOperationRecordMeta) Operation() util.Hash
func (PoolOperationRecordMeta) Version ¶
func (h PoolOperationRecordMeta) Version() byte
type RedisPermanent ¶
type RedisPermanent struct { *logging.Logging sync.Mutex // contains filtered or unexported fields }
func NewRedisPermanent ¶
func NewRedisPermanent( st *redisstorage.Storage, encs *encoder.Encoders, enc encoder.Encoder, ) (*RedisPermanent, error)
func (*RedisPermanent) BlockMapBytes ¶
func (*RedisPermanent) Clean ¶
func (db *RedisPermanent) Clean() error
func (*RedisPermanent) Close ¶
func (db *RedisPermanent) Close() error
func (*RedisPermanent) ExistsInStateOperation ¶
func (db *RedisPermanent) ExistsInStateOperation(h util.Hash) (bool, error)
func (*RedisPermanent) ExistsKnownOperation ¶
func (db *RedisPermanent) ExistsKnownOperation(h util.Hash) (bool, error)
func (RedisPermanent) LastBlockMap ¶
func (RedisPermanent) LastBlockMapBytes ¶
func (RedisPermanent) LastNetworkPolicy ¶
func (db RedisPermanent) LastNetworkPolicy() base.NetworkPolicy
func (RedisPermanent) LastSuffrageProof ¶
func (db RedisPermanent) LastSuffrageProof() (base.SuffrageProof, bool, error)
func (RedisPermanent) LastSuffrageProofBytes ¶
func (*RedisPermanent) MergeTempDatabase ¶
func (db *RedisPermanent) MergeTempDatabase(ctx context.Context, temp isaac.TempDatabase) error
func (*RedisPermanent) StateBytes ¶
func (*RedisPermanent) SuffrageProof ¶
func (db *RedisPermanent) SuffrageProof(suffrageHeight base.Height) (base.SuffrageProof, bool, error)
func (*RedisPermanent) SuffrageProofByBlockHeight ¶
func (db *RedisPermanent) SuffrageProofByBlockHeight(height base.Height) (base.SuffrageProof, bool, error)
func (*RedisPermanent) SuffrageProofBytes ¶
type TempLeveldb ¶
type TempLeveldb struct {
// contains filtered or unexported fields
}
func NewTempLeveldbFromPrefix ¶
func NewTempLeveldbFromPrefix( st *leveldbstorage.Storage, prefix []byte, encs *encoder.Encoders, enc encoder.Encoder, ) (*TempLeveldb, error)
func (*TempLeveldb) BlockMapBytes ¶
func (db *TempLeveldb) BlockMapBytes() (enchint hint.Hint, meta, body []byte, _ error)
func (*TempLeveldb) Close ¶
func (db *TempLeveldb) Close() error
func (*TempLeveldb) ExistsInStateOperation ¶
func (db *TempLeveldb) ExistsInStateOperation(h util.Hash) (bool, error)
func (*TempLeveldb) ExistsKnownOperation ¶
func (db *TempLeveldb) ExistsKnownOperation(h util.Hash) (bool, error)
func (*TempLeveldb) Height ¶
func (db *TempLeveldb) Height() base.Height
func (*TempLeveldb) LastBlockMap ¶
func (db *TempLeveldb) LastBlockMap() (base.BlockMap, bool, error)
func (*TempLeveldb) LastSuffrageProofBytes ¶
func (*TempLeveldb) Merge ¶
func (db *TempLeveldb) Merge() error
func (*TempLeveldb) NetworkPolicy ¶
func (db *TempLeveldb) NetworkPolicy() base.NetworkPolicy
func (*TempLeveldb) Remove ¶
func (db *TempLeveldb) Remove() error
func (*TempLeveldb) StateBytes ¶
func (*TempLeveldb) SuffrageHeight ¶
func (db *TempLeveldb) SuffrageHeight() base.Height
func (*TempLeveldb) SuffrageProof ¶
func (db *TempLeveldb) SuffrageProof() (base.SuffrageProof, bool, error)
type TempPool ¶
type TempPool struct { *util.ContextDaemon // contains filtered or unexported fields }
func NewTempPool ¶
func (*TempPool) LastVoteproofs ¶
func (db *TempPool) LastVoteproofs() (base.INITVoteproof, base.ACCEPTVoteproof, bool, error)
func (*TempPool) NewOperation ¶
func (*TempPool) NewOperationBytes ¶
func (*TempPool) NewOperationHashes ¶
func (*TempPool) ProposalByPoint ¶
func (*TempPool) ProposalBytes ¶
func (*TempPool) RemoveSuffrageWithdrawOperationsByFact ¶
func (db *TempPool) RemoveSuffrageWithdrawOperationsByFact(facts []base.SuffrageWithdrawFact) error
func (*TempPool) RemoveSuffrageWithdrawOperationsByHeight ¶
func (*TempPool) SetLastVoteproofs ¶
func (db *TempPool) SetLastVoteproofs(ivp base.INITVoteproof, avp base.ACCEPTVoteproof) error
func (*TempPool) SetNewOperation ¶
func (*TempPool) SetProposal ¶
func (db *TempPool) SetProposal(pr base.ProposalSignFact) (bool, error)
func (*TempPool) SetSuffrageWithdrawOperation ¶
func (db *TempPool) SetSuffrageWithdrawOperation(op base.SuffrageWithdrawOperation) error
func (*TempPool) SuffrageWithdrawOperation ¶
func (*TempPool) TraverseSuffrageWithdrawOperations ¶
Click to show internal directories.
Click to hide internal directories.