Documentation ¶
Index ¶
- Constants
- type BoltStore
- func (s *BoltStore) AddIR(id protocol.SystemIdentifier, ir *certificates.InputRecord) error
- func (s *BoltStore) CountUC() (int, error)
- func (s *BoltStore) GetAllIRs() (map[protocol.SystemIdentifier]*certificates.InputRecord, error)
- func (s *BoltStore) GetIR(id protocol.SystemIdentifier) (*certificates.InputRecord, error)
- func (s *BoltStore) GetUC(id protocol.SystemIdentifier) (*certificates.UnicityCertificate, error)
- func (s *BoltStore) ReadAllUC() (map[protocol.SystemIdentifier]*certificates.UnicityCertificate, error)
- func (s *BoltStore) ReadLatestRoundNumber() (uint64, error)
- func (s *BoltStore) ReadLatestRoundRootHash() ([]byte, error)
- func (s *BoltStore) WriteState(newState RootState) error
- type InMemState
- type PersistentRootState
- type RootState
Constants ¶
View Source
const ( ErrIllegalNewRound = "illegal new round number in new state" ErrPersistentStoreBackendIsNil = "persistent store backend is nil" )
View Source
const BoltRootChainStoreFileName = "rootchain.db"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BoltStore ¶
type BoltStore struct {
// contains filtered or unexported fields
}
func NewBoltStore ¶
func (*BoltStore) AddIR ¶
func (s *BoltStore) AddIR(id protocol.SystemIdentifier, ir *certificates.InputRecord) error
func (*BoltStore) GetAllIRs ¶
func (s *BoltStore) GetAllIRs() (map[protocol.SystemIdentifier]*certificates.InputRecord, error)
func (*BoltStore) GetIR ¶
func (s *BoltStore) GetIR(id protocol.SystemIdentifier) (*certificates.InputRecord, error)
func (*BoltStore) GetUC ¶
func (s *BoltStore) GetUC(id protocol.SystemIdentifier) (*certificates.UnicityCertificate, error)
func (*BoltStore) ReadAllUC ¶
func (s *BoltStore) ReadAllUC() (map[protocol.SystemIdentifier]*certificates.UnicityCertificate, error)
func (*BoltStore) ReadLatestRoundNumber ¶
func (*BoltStore) ReadLatestRoundRootHash ¶
func (*BoltStore) WriteState ¶
type InMemState ¶
type InMemState struct {
// contains filtered or unexported fields
}
func NewInMemStateStore ¶
func NewInMemStateStore(hashAlgorithm gocrypto.Hash) *InMemState
NewInMemStateStore stores state in volatile memory only, everything is lost on exit
func (*InMemState) Get ¶
func (s *InMemState) Get() (RootState, error)
func (*InMemState) Save ¶
func (s *InMemState) Save(newState RootState) error
type PersistentRootState ¶
type PersistentRootState struct {
// contains filtered or unexported fields
}
func NewPersistentStateStore ¶
func NewPersistentStateStore(store *BoltStore) (*PersistentRootState, error)
NewPersistentStateStore persists state using the persistent storage provider interface Currently uses RootSate as cache (probably should be refactored)
func (*PersistentRootState) Get ¶
func (p *PersistentRootState) Get() (RootState, error)
func (*PersistentRootState) Save ¶
func (p *PersistentRootState) Save(newState RootState) error
type RootState ¶
type RootState struct { LatestRound uint64 LatestRootHash []byte Certificates map[protocol.SystemIdentifier]*certificates.UnicityCertificate }
Click to show internal directories.
Click to hide internal directories.