Documentation ¶
Index ¶
- func NewProgressReporter(log *logger.Logger, header string, expected uint64) io.Writer
- type MockedSnapshotManager
- func (smrT MockedSnapshotManager) BlockCommittedAsync(snapshotInfo SnapshotInfo)
- func (msmT *MockedSnapshotManager) IsSnapshotReady(snapshotInfo SnapshotInfo) bool
- func (smrT MockedSnapshotManager) LoadSnapshotAsync(snapshotInfo SnapshotInfo) <-chan error
- func (msmT *MockedSnapshotManager) SetAfterSnapshotCreated(fun func(SnapshotInfo))
- func (msmT *MockedSnapshotManager) SnapshotExists(stateIndex uint32, commitment *state.L1Commitment) bool
- func (msmT *MockedSnapshotManager) SnapshotReady(snapshotInfo SnapshotInfo)
- func (smrT MockedSnapshotManager) UpdateAsync()
- func (msmT *MockedSnapshotManager) WaitNodeUpdateCount(count uint32, sleepTime time.Duration, maxSleepCount int) bool
- func (msmT *MockedSnapshotManager) WaitSnapshotCreateFinalisedCount(count uint32, sleepTime time.Duration, maxSleepCount int) bool
- func (msmT *MockedSnapshotManager) WaitSnapshotCreateRequestCount(count uint32, sleepTime time.Duration, maxSleepCount int) bool
- func (msmT *MockedSnapshotManager) WaitSnapshotCreatedCount(count uint32, sleepTime time.Duration, maxSleepCount int) bool
- func (msmT *MockedSnapshotManager) WaitSnapshotLoadRequestCount(count uint32, sleepTime time.Duration, maxSleepCount int) bool
- func (msmT *MockedSnapshotManager) WaitSnapshotLoadedCount(count uint32, sleepTime time.Duration, maxSleepCount int) bool
- type SnapshotInfo
- type SnapshotManager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MockedSnapshotManager ¶
type MockedSnapshotManager struct {
// contains filtered or unexported fields
}
func (MockedSnapshotManager) BlockCommittedAsync ¶
func (smrT MockedSnapshotManager) BlockCommittedAsync(snapshotInfo SnapshotInfo)
func (*MockedSnapshotManager) IsSnapshotReady ¶
func (msmT *MockedSnapshotManager) IsSnapshotReady(snapshotInfo SnapshotInfo) bool
func (MockedSnapshotManager) LoadSnapshotAsync ¶
func (smrT MockedSnapshotManager) LoadSnapshotAsync(snapshotInfo SnapshotInfo) <-chan error
func (*MockedSnapshotManager) SetAfterSnapshotCreated ¶
func (msmT *MockedSnapshotManager) SetAfterSnapshotCreated(fun func(SnapshotInfo))
func (*MockedSnapshotManager) SnapshotExists ¶
func (msmT *MockedSnapshotManager) SnapshotExists(stateIndex uint32, commitment *state.L1Commitment) bool
func (*MockedSnapshotManager) SnapshotReady ¶
func (msmT *MockedSnapshotManager) SnapshotReady(snapshotInfo SnapshotInfo)
func (MockedSnapshotManager) UpdateAsync ¶
func (smrT MockedSnapshotManager) UpdateAsync()
func (*MockedSnapshotManager) WaitNodeUpdateCount ¶
func (*MockedSnapshotManager) WaitSnapshotCreateFinalisedCount ¶
func (*MockedSnapshotManager) WaitSnapshotCreateRequestCount ¶
func (*MockedSnapshotManager) WaitSnapshotCreatedCount ¶
func (*MockedSnapshotManager) WaitSnapshotLoadRequestCount ¶
func (*MockedSnapshotManager) WaitSnapshotLoadedCount ¶
type SnapshotInfo ¶
type SnapshotInfo interface { StateIndex() uint32 Commitment() *state.L1Commitment TrieRoot() trie.Hash BlockHash() state.BlockHash String() string Equals(SnapshotInfo) bool }
func NewSnapshotInfo ¶
func NewSnapshotInfo(index uint32, commitment *state.L1Commitment) SnapshotInfo
type SnapshotManager ¶
type SnapshotManager interface { UpdateAsync() BlockCommittedAsync(SnapshotInfo) SnapshotExists(uint32, *state.L1Commitment) bool LoadSnapshotAsync(SnapshotInfo) <-chan error }
SnapshotManager is responsible for servicing snapshot related queries in appropriate manner. Some of the requests are synchronous, but most of them are asynchronous. They can be handled in snapshot manager's thread or in another thread created by snapshot manager. Snapshot manager keeps and updates on request a list of available snapshots. However, only the information that snapshot exists is stored and not the entire snapshot. To store/load the snapshot, snapshot manager depends on `snapshotter`. Snapshot manager is also responsible for deciding if snapshot has to be created.
func NewEmptySnapshotManager ¶
func NewEmptySnapshotManager() SnapshotManager
Click to show internal directories.
Click to hide internal directories.