Documentation ¶
Index ¶
- Constants
- Variables
- func CreateLocalSnapshot(targetIndex milestone.Index, filePath string, writeToDatabase bool, ...) error
- func LoadGlobalSnapshot(filePathLedger string, filePathsSpent []string, snapshotIndex milestone.Index) error
- func LoadSnapshotFromFile(filePath string) error
- func PruneDatabaseByDepth(depth milestone.Index) error
- func PruneDatabaseByTargetIndex(targetIndex milestone.Index) error
- type WriteCounter
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 ( SupportedLocalSnapshotFileVersions = []byte{4} ErrCritical = errors.New("critical error") ErrUnsupportedLSFileVersion = errors.New("unsupported local snapshot file version") ErrApproverTxNotFound = errors.New("approver transaction not found") )
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) ErrSnapshotDownloadWasAborted = errors.New("snapshot download was aborted") 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") ErrTargetIndexTooNew = errors.New("snapshot target is too new.") ErrTargetIndexTooOld = errors.New("snapshot target is too old.") ErrNotEnoughHistory = errors.New("not enough history.") ErrNoPruningNeeded = errors.New("no pruning needed.") ErrPruningAborted = errors.New("pruning was aborted.") 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") )
Functions ¶
func CreateLocalSnapshot ¶ added in v0.3.0
func LoadGlobalSnapshot ¶
func LoadSnapshotFromFile ¶
func PruneDatabaseByDepth ¶ added in v0.4.0
func PruneDatabaseByTargetIndex ¶ added in v0.4.0
Types ¶
type WriteCounter ¶ added in v0.4.0
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()
Click to show internal directories.
Click to hide internal directories.