checkpoint

package
v0.3.2-beta.1 Latest Latest
Warning

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

Go to latest
Published: May 12, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SchemaVersion = "https://spacemesh.io/checkpoint.schema.json.1.0"
)

Variables

View Source
var Schema string

Functions

func SelfCheckpointFilename

func SelfCheckpointFilename(dataDir string, snapshotLayer, restoreLayer types.LayerID) string

func ValidateSchema

func ValidateSchema(data []byte) error

Types

type Account

type Account struct {
	Address  []byte `json:"address"`
	Balance  uint64 `json:"balance"`
	Nonce    uint64 `json:"nonce"`
	Template []byte `json:"template"`
	State    []byte `json:"state"`
}

type Checkpoint

type Checkpoint struct {
	Version string    `json:"version"`
	Data    InnerData `json:"data"`
}

type InnerData

type InnerData struct {
	CheckpointId string     `json:"id"`
	Restore      uint32     `json:"restore"`
	Atxs         []ShortAtx `json:"atxs"`
	Accounts     []Account  `json:"accounts"`
}

type Opt

type Opt func(*Runner)

func WithDataDir

func WithDataDir(dir string) Opt

func WithFilesystem

func WithFilesystem(fs afero.Fs) Opt

func WithLogger

func WithLogger(lg log.Log) Opt

type RecoveryFile

type RecoveryFile struct {
	// contains filtered or unexported fields
}

func NewRecoveryFile

func NewRecoveryFile(fs afero.Fs, path string) (*RecoveryFile, error)

type Runner

type Runner struct {
	// contains filtered or unexported fields
}

func NewRunner

func NewRunner(db *sql.Database, opts ...Opt) *Runner

func (*Runner) Generate

func (r *Runner) Generate(ctx context.Context, snapshot, restore types.LayerID) (string, 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"`
}

func (ShortAtx) MarshalLogObject

func (vatx ShortAtx) MarshalLogObject(encoder log.ObjectEncoder) error

Jump to

Keyboard shortcuts

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