snapshot

package
v0.4.0-rc3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 24, 2020 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SpentAddressesImportBatchSize       = 100000
	SolidEntryPointCheckThresholdPast   = 50
	SolidEntryPointCheckThresholdFuture = 50
)
View Source
const (
	// AdditionalPruningThreshold is needed, because the transactions in the getMilestoneApprovees call in getSolidEntryPoints
	// can reference older transactions as well
	AdditionalPruningThreshold = 50
)

Variables

View Source
var (
	PLUGIN = node.NewPlugin("Snapshot", node.Enabled, configure, run)

	ErrNoSnapshotSpecified             = errors.New("no snapshot file was specified in the config")
	ErrNoSnapshotDownloadURL           = fmt.Errorf("No download URL given for local snapshot under config option '%s", config.CfgLocalSnapshotsDownloadURL)
	ErrSnapshotImportWasAborted        = errors.New("snapshot import was aborted")
	ErrSnapshotImportFailed            = errors.New("snapshot import failed")
	ErrSnapshotCreationWasAborted      = errors.New("operation was aborted")
	ErrSnapshotCreationFailed          = errors.New("creating snapshot failed: %v")
	ErrTargetIndexTooNew               = errors.New("snapshot target is too new.")
	ErrTargetIndexTooOld               = errors.New("snapshot target is too old.")
	ErrNotEnoughHistory                = errors.New("not enough history.")
	ErrUnconfirmedTxInSubtangle        = errors.New("Unconfirmed tx in subtangle")
	ErrInvalidBalance                  = errors.New("Invalid balance! Total does not match supply:")
	ErrWrongCoordinatorAddressDatabase = errors.New("Configured coordinator address does not match database information")
)
View Source
var ErrUnsupportedLSFileVersion = errors.New("unsupported local snapshot file version")
View Source
var (
	SupportedLocalSnapshotFileVersions = []byte{4}
)

Functions

func CreateLocalSnapshot added in v0.3.0

func CreateLocalSnapshot(targetIndex milestone_index.MilestoneIndex, filePath string, abortSignal <-chan struct{}) error

func LoadGlobalSnapshot

func LoadGlobalSnapshot(filePathLedger string, filePathsSpent []string, snapshotIndex milestone_index.MilestoneIndex) error

func LoadSnapshotFromFile

func LoadSnapshotFromFile(filePath string) error

Types

type WriteCounter added in v0.4.0

type WriteCounter struct {
	Expected uint64
	Total    uint64
}

WriteCounter counts the number of bytes written to it. It implements to the io.Writer interface and we can pass this into io.TeeReader() which will report progress on each write cycle.

func (WriteCounter) PrintProgress added in v0.4.0

func (wc WriteCounter) PrintProgress()

func (*WriteCounter) Write added in v0.4.0

func (wc *WriteCounter) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL