Documentation ¶
Index ¶
- Constants
- Variables
- type Config
- type Store
- func (s *Store) ClearDB() error
- func (s *Store) Close() error
- func (s *Store) ConsensusInfo(ctx context.Context, epoch uint64) (*eventTypes.MinimalEpochConsensusInfo, error)
- func (s *Store) ConsensusInfos(fromEpoch uint64) ([]*eventTypes.MinimalEpochConsensusInfo, error)
- func (s *Store) DatabasePath() string
- func (s *Store) GetLatestEpoch() uint64
- func (s *Store) GetLatestHeaderHash() common.Hash
- func (s *Store) LatestSavedEpoch() uint64
- func (s *Store) LatestSavedPandoraHeaderHash() common.Hash
- func (s *Store) LatestSavedPandoraSlot() uint64
- func (s *Store) LatestSavedVanguardHeaderHash() (hash common.Hash)
- func (s *Store) LatestSavedVanguardSlot() (latestSlot uint64)
- func (s *Store) LatestVerifiedRealmSlot() (slot uint64)
- func (s *Store) PandoraHeaderHash(slot uint64) (*types.HeaderHash, error)
- func (s *Store) PandoraHeaderHashes(fromSlot uint64, limit uint64) ([]*types.HeaderHash, error)
- func (s *Store) SaveConsensusInfo(ctx context.Context, consensusInfo *eventTypes.MinimalEpochConsensusInfo) error
- func (s *Store) SaveLatestEpoch(ctx context.Context) error
- func (s *Store) SaveLatestPandoraHeaderHash() error
- func (s *Store) SaveLatestPandoraSlot() error
- func (s *Store) SaveLatestVanguardHeaderHash() (err error)
- func (s *Store) SaveLatestVanguardSlot() (err error)
- func (s *Store) SaveLatestVerifiedRealmSlot(slot uint64) (err error)
- func (s *Store) SavePandoraHeaderHash(slot uint64, headerHash *types.HeaderHash) error
- func (s *Store) SaveVanguardHeaderHash(slot uint64, headerHash *types.HeaderHash) (err error)
- func (s *Store) VanguardHeaderHash(slot uint64) (headerHash *types.HeaderHash, err error)
- func (s *Store) VanguardHeaderHashes(fromSlot uint64, limit uint64) (vanguardHeaderHashes []*types.HeaderHash, err error)
Constants ¶
View Source
const ( // ConsensusInfosCacheSize with 1024 consensus infos will be 1.5MB. ConsensusInfosCacheSize = 1 << 10 // HeaderHashesCacheSize with HeaderHashesCacheSize = 1 << 20 // OrchestratorNodeDbDirName is the name of the directory containing the orchestrator node database. OrchestratorNodeDbDirName = "orchestrator" // DatabaseFileName is the name of the orchestrator node database. DatabaseFileName = "orchestrator.db" )
Variables ¶
View Source
var ( EmptyHash = common.HexToHash("0000000000000000000000000000000000000000000000000000000000000000") InvalidExtraDataErr = errors.New("Invalid extra data") InvalidSlot = errors.New("Invalid slot") PandoraHeaderNotFoundErr = errors.New("Pandora header not found") )
View Source
var (
VanguardHeaderNotFoundErr = errors.New("Vanguard header not found")
)
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct { // There should be mutex in store sync.Mutex // contains filtered or unexported fields }
func NewKVStore ¶
NewKVStore initializes a new boltDB key-value store at the directory path specified, creates the kv-buckets based on the schema, and stores an open connection db object as a property of the Store struct.
func (*Store) ConsensusInfo ¶
func (s *Store) ConsensusInfo(ctx context.Context, epoch uint64) (*eventTypes.MinimalEpochConsensusInfo, error)
ConsensusInfo
func (*Store) ConsensusInfos ¶
func (s *Store) ConsensusInfos(fromEpoch uint64) ( []*eventTypes.MinimalEpochConsensusInfo, error, )
ConsensusInfos
func (*Store) DatabasePath ¶
DatabasePath at which this database writes files.
func (*Store) GetLatestHeaderHash ¶
GetLatestHeaderHash
func (*Store) LatestSavedPandoraHeaderHash ¶
LatestSavedPandoraHeaderHash
func (*Store) LatestSavedPandoraSlot ¶
LatestSavedPandoraSlot
func (*Store) LatestSavedVanguardHeaderHash ¶
func (*Store) LatestSavedVanguardSlot ¶
func (*Store) LatestVerifiedRealmSlot ¶
func (*Store) PandoraHeaderHash ¶
func (s *Store) PandoraHeaderHash(slot uint64) (*types.HeaderHash, error)
PanHeader
func (*Store) PandoraHeaderHashes ¶
PanHeaders
func (*Store) SaveConsensusInfo ¶
func (s *Store) SaveConsensusInfo( ctx context.Context, consensusInfo *eventTypes.MinimalEpochConsensusInfo, ) error
SaveConsensusInfo
func (*Store) SaveLatestEpoch ¶
SaveLatestEpoch
func (*Store) SaveLatestPandoraHeaderHash ¶
SaveLatestPandoraHeaderHash
func (*Store) SaveLatestPandoraSlot ¶
SaveLatestPanSlot
func (*Store) SaveLatestVanguardHeaderHash ¶
func (*Store) SaveLatestVanguardSlot ¶
func (*Store) SaveLatestVerifiedRealmSlot ¶
func (*Store) SavePandoraHeaderHash ¶
func (s *Store) SavePandoraHeaderHash(slot uint64, headerHash *types.HeaderHash) error
SavePanHeader
func (*Store) SaveVanguardHeaderHash ¶
func (s *Store) SaveVanguardHeaderHash(slot uint64, headerHash *types.HeaderHash) (err error)
func (*Store) VanguardHeaderHash ¶
func (s *Store) VanguardHeaderHash(slot uint64) (headerHash *types.HeaderHash, err error)
func (*Store) VanguardHeaderHashes ¶
Click to show internal directories.
Click to hide internal directories.