Documentation ¶
Index ¶
- Constants
- Variables
- func DeleteSchedule(db ethdb.KeyValueWriter, id uint64)
- func DeleteSnapshotBlob(db ethdb.KeyValueWriter, address common.Address, storageRoot common.Hash)
- func DeleteSnapshotMetadata(db ethdb.KeyValueWriter, address common.Address, blockHash common.Hash)
- func HasSnapshotBlob(db ethdb.KeyValueReader, address common.Address, storageRoot common.Hash) bool
- func HasSnapshotBlobAnyAccount(db ethdb.Iteratee, storageRoot common.Hash) bool
- func HasSnapshotMetadata(db ethdb.KeyValueReader, address common.Address, storageRoot common.Hash) bool
- func ReadSchedule(db ethdb.KeyValueReader, id uint64) snapshot_types.Schedule
- func ReadSnapshotBlob(db ethdb.KeyValueReader, address common.Address, storageRoot common.Hash) []byte
- func ReadSnapshotBlobAnyAccount(db ethdb.Iteratee, storageRoot common.Hash) []byte
- func WriteSchedule(db ethdb.KeyValueWriter, id uint64, schedule snapshot_types.Schedule)
- func WriteSnapshotBlob(db ethdb.KeyValueWriter, address common.Address, storageRoot common.Hash, ...)
- func WriteSnapshotMetadata(db ethdb.KeyValueWriter, metadata SnapshotMetadata)
- type Ethereum
- type Schedule
- type ScheduleIterator
- type Scheduler
- func (s *Scheduler) AddSchedule(schedule snapshot_types.Schedule, blockNumber uint64) (snapshot_types.ScheduleResponse, error)
- func (s *Scheduler) DeleteSchedule(id uint64) error
- func (s *Scheduler) GetSchedules() (map[uint64]snapshot_types.Schedule, error)
- func (s *Scheduler) RunSchedule(blockNumber uint64, f func(schedule snapshot_types.Schedule)) bool
- type SnapshotBlobIterator
- type SnapshotMaker
- type SnapshotMetadata
- type SnapshotMetadataIterator
- type SnapshotMetadataWithStatus
- type SnapshotQuery
- type SnapshotReader
- type SnapshotResponse
- type SnapshotStatus
- type SnapshotWriter
- type WorkerTask
Constants ¶
View Source
const ( SnapshotStatus_Done = snapshot_types.SnapshotStatus_Done SnapshotStatus_Pending = snapshot_types.SnapshotStatus_Pending SnapshotStatus_Fail = snapshot_types.SnapshotStatus_Fail )
View Source
const ( SnapshotListMaxResults = 1000 TaskBufferSize = 256 SchedulerTickInterval = 8 * time.Second ScheduledSnapshotsBeforePrune = 16 )
Variables ¶
View Source
var ( SnapshotBlobPrefix = []byte("arch-snap-blob-") SnapshotMetadataPrefix = []byte("arch-snap-metadata-") SchedulePrefix = []byte("arch-schedule-") )
View Source
var ( ErrBlockNotFound = errors.New("block not found") ErrSnapshotNotFound = errors.New("snapshot not found") ErrSchedulerDisabled = errors.New("scheduler is disabled") ErrMissingBlob = errors.New("missing blob") )
View Source
var Root = NewSnapshotMaker(true)
Functions ¶
func DeleteSchedule ¶
func DeleteSchedule(db ethdb.KeyValueWriter, id uint64)
func DeleteSnapshotBlob ¶
func DeleteSnapshotMetadata ¶
func HasSnapshotBlob ¶
func HasSnapshotMetadata ¶
func ReadSchedule ¶
func ReadSchedule(db ethdb.KeyValueReader, id uint64) snapshot_types.Schedule
func ReadSnapshotBlob ¶
func WriteSchedule ¶
func WriteSchedule(db ethdb.KeyValueWriter, id uint64, schedule snapshot_types.Schedule)
func WriteSnapshotBlob ¶
func WriteSnapshotMetadata ¶
func WriteSnapshotMetadata(db ethdb.KeyValueWriter, metadata SnapshotMetadata)
Types ¶
type Schedule ¶
type Schedule = snapshot_types.Schedule
type ScheduleIterator ¶
func IterateSchedules ¶
func IterateSchedules(db ethdb.Iteratee) *ScheduleIterator
func (*ScheduleIterator) ID ¶
func (it *ScheduleIterator) ID() uint64
func (*ScheduleIterator) Schedule ¶
func (it *ScheduleIterator) Schedule() snapshot_types.Schedule
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
func (*Scheduler) AddSchedule ¶
func (s *Scheduler) AddSchedule(schedule snapshot_types.Schedule, blockNumber uint64) (snapshot_types.ScheduleResponse, error)
func (*Scheduler) DeleteSchedule ¶
func (*Scheduler) GetSchedules ¶
func (s *Scheduler) GetSchedules() (map[uint64]snapshot_types.Schedule, error)
func (*Scheduler) RunSchedule ¶
func (s *Scheduler) RunSchedule(blockNumber uint64, f func(schedule snapshot_types.Schedule)) bool
type SnapshotBlobIterator ¶
func IterateSnapshotBlobs ¶
func IterateSnapshotBlobs(db ethdb.Iteratee) *SnapshotBlobIterator
func (*SnapshotBlobIterator) Address ¶
func (it *SnapshotBlobIterator) Address() common.Address
func (*SnapshotBlobIterator) Blob ¶
func (it *SnapshotBlobIterator) Blob() []byte
func (*SnapshotBlobIterator) StorageRoot ¶
func (it *SnapshotBlobIterator) StorageRoot() common.Hash
type SnapshotMaker ¶
type SnapshotMaker struct {
// contains filtered or unexported fields
}
func NewSnapshotMaker ¶
func NewSnapshotMaker(enableScheduling bool) *SnapshotMaker
func (*SnapshotMaker) IsSchedulerEnabled ¶
func (s *SnapshotMaker) IsSchedulerEnabled() bool
func (*SnapshotMaker) NewReader ¶
func (s *SnapshotMaker) NewReader(ethereum Ethereum) SnapshotReader
func (*SnapshotMaker) NewWriter ¶
func (s *SnapshotMaker) NewWriter(ethereum Ethereum) SnapshotWriter
func (*SnapshotMaker) RunScheduler ¶
func (s *SnapshotMaker) RunScheduler()
func (*SnapshotMaker) RunSnapshotWorker ¶
func (s *SnapshotMaker) RunSnapshotWorker()
type SnapshotMetadata ¶
type SnapshotMetadata = snapshot_types.SnapshotMetadata
func ReadSnapshotMetadata ¶
func ReadSnapshotMetadata(db ethdb.KeyValueReader, address common.Address, blockHash common.Hash) SnapshotMetadata
type SnapshotMetadataIterator ¶
func IterateAccountSnapshotMetadata ¶
func IterateAccountSnapshotMetadata(db ethdb.Iteratee, address common.Address) *SnapshotMetadataIterator
func IterateSnapshotMetadata ¶
func IterateSnapshotMetadata(db ethdb.Iteratee) *SnapshotMetadataIterator
func (*SnapshotMetadataIterator) Address ¶
func (it *SnapshotMetadataIterator) Address() common.Address
func (*SnapshotMetadataIterator) BlockHash ¶
func (it *SnapshotMetadataIterator) BlockHash() common.Hash
func (*SnapshotMetadataIterator) Metadata ¶
func (it *SnapshotMetadataIterator) Metadata() SnapshotMetadata
type SnapshotMetadataWithStatus ¶
type SnapshotMetadataWithStatus = snapshot_types.SnapshotMetadataWithStatus
type SnapshotQuery ¶
type SnapshotQuery = snapshot_types.SnapshotQuery
type SnapshotReader ¶
type SnapshotReader interface { Get(address common.Address, blockHash common.Hash) (SnapshotResponse, error) Last(address common.Address) (SnapshotMetadataWithStatus, error) List(address common.Address) ([]SnapshotMetadataWithStatus, error) GetSchedules() (map[uint64]snapshot_types.Schedule, error) }
type SnapshotResponse ¶
type SnapshotResponse = snapshot_types.SnapshotResponse
type SnapshotStatus ¶
type SnapshotStatus = snapshot_types.SnapshotStatus
type SnapshotWriter ¶
type SnapshotWriter interface { New(query SnapshotQuery) ([]SnapshotMetadataWithStatus, error) Update(query SnapshotQuery) ([]SnapshotMetadataWithStatus, error) Delete(query SnapshotQuery) error Prune() error AddSchedule(schedule snapshot_types.Schedule) (snapshot_types.ScheduleResponse, error) DeleteSchedule(id uint64) error }
type WorkerTask ¶
Click to show internal directories.
Click to hide internal directories.