Documentation ¶
Index ¶
- Constants
- Variables
- func CopyFile(fs afero.Fs, src, dst string) error
- func Generate(ctx context.Context, fs afero.Fs, db *sql.Database, dataDir string, ...) error
- func ParseRestoreLayer(fname string) (types.LayerID, error)
- func ReadCheckpointAndDie(ctx context.Context, logger log.Log, dataDir, uri string, ...) error
- func Recover(ctx context.Context, logger log.Log, fs afero.Fs, cfg *RecoverConfig, ...) error
- func RecoverWithDb(ctx context.Context, logger log.Log, db *sql.Database, fs afero.Fs, ...) (*sql.Database, error)
- func RecoveryDir(dataDir string) string
- func RecoveryFilename(dataDir, base string, restore types.LayerID) string
- func SelfCheckpointFilename(dataDir string, snapshot types.LayerID) string
- func ValidateSchema(data []byte) error
- type Account
- type Checkpoint
- type Config
- type InnerData
- type RecoverConfig
- type RecoveryFile
- type ShortAtx
Constants ¶
View Source
const (
SchemaVersion = "https://spacemesh.io/checkpoint.schema.json.1.0"
)
Variables ¶
View Source
var Schema string
Functions ¶
func ParseRestoreLayer ¶
ParseRestoreLayer parses the restore layer from the filename. only used in systests when RecoverFromDefaultDir is true. DO NOT USE in production as inferring metadata from filename is not robust and error-prone.
func ReadCheckpointAndDie ¶
func ReadCheckpointAndDie(ctx context.Context, logger log.Log, dataDir, uri string, restore types.LayerID) error
ReadCheckpointAndDie copies the checkpoint file from uri and panic to restart the node and recover from the checkpoint data just copied. only used in systests. only has effect when RecoverFromDefaultDir is true.
func RecoverWithDb ¶
func RecoveryDir ¶
func SelfCheckpointFilename ¶
func ValidateSchema ¶
Types ¶
type Checkpoint ¶
type Config ¶
type Config struct { Uri string `mapstructure:"recovery-uri"` Restore uint32 `mapstructure:"recovery-layer"` // set to false if atxs are not compatible before and after the checkpoint recovery. PreserveOwnAtx bool `mapstructure:"preserve-own-atx"` // only set for systests. recovery from file in $DataDir/recovery RecoverFromDefaultDir bool }
func DefaultConfig ¶
func DefaultConfig() Config
type RecoverConfig ¶
type RecoveryFile ¶
type RecoveryFile struct {
// contains filtered or unexported fields
}
func NewRecoveryFile ¶
func NewRecoveryFile(fs afero.Fs, path string) (*RecoveryFile, error)
type ShortAtx ¶
type ShortAtx struct { ID []byte `json:"id"` Epoch uint32 `json:"epoch"` CommitmentAtx []byte `json:"commitmentAtx"` VrfNonce uint64 `json:"vrfNonce"` NumUnits uint32 `json:"numUnits"` BaseTickHeight uint64 `json:"baseTickHeight"` TickCount uint64 `json:"tickCount"` PublicKey []byte `json:"publicKey"` Sequence uint64 `json:"sequence"` Coinbase []byte `json:"coinbase"` }
Click to show internal directories.
Click to hide internal directories.