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 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 AtxDep
- type Config
- type PreservedData
- func Recover(ctx context.Context, logger *zap.Logger, fs afero.Fs, cfg *RecoverConfig) (*PreservedData, error)
- func RecoverFromLocalFile(ctx context.Context, logger *zap.Logger, db *sql.Database, ...) (*PreservedData, error)
- func RecoverWithDb(ctx context.Context, logger *zap.Logger, db *sql.Database, ...) (*PreservedData, error)
- type RecoverConfig
- type RecoveryFile
Constants ¶
View Source
const ( SchemaVersion = "https://spacemesh.io/checkpoint.schema.json.1.0" CommandString = "grpcurl -plaintext -d '%s' 0.0.0.0:9093 spacemesh.v1.AdminService.CheckpointStream" )
Variables ¶
View Source
var ( ErrCheckpointNotFound = errors.New("checkpoint not found") ErrUrlSchemeNotSupported = errors.New("url scheme not supported") )
View Source
var Schema string
Functions ¶
func RecoveryDir ¶
func SelfCheckpointFilename ¶
func ValidateSchema ¶
Types ¶
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"` }
func DefaultConfig ¶
func DefaultConfig() Config
type PreservedData ¶
type PreservedData struct { Deps []*AtxDep Proofs []*types.PoetProofMessage }
func Recover ¶
func Recover( ctx context.Context, logger *zap.Logger, fs afero.Fs, cfg *RecoverConfig, ) (*PreservedData, error)
func RecoverFromLocalFile ¶ added in v1.6.1
func RecoverWithDb ¶
type RecoverConfig ¶
type RecoverConfig struct { GoldenAtx types.ATXID DataDir string DbFile string LocalDbFile string NodeIDs []types.NodeID // IDs to preserve own ATXs Uri string Restore types.LayerID }
func (*RecoverConfig) DbPath ¶ added in v1.6.1
func (c *RecoverConfig) DbPath() string
type RecoveryFile ¶
type RecoveryFile struct {
// contains filtered or unexported fields
}
func NewRecoveryFile ¶
func NewRecoveryFile(aferoFs afero.Fs, path string) (*RecoveryFile, error)
Click to show internal directories.
Click to hide internal directories.