checkpoint

package
v5.0.1-rc.4 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIInitializer

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

APIInitializer manages initializing the beacon node using checkpoint sync, retrieving the checkpoint state and root from the remote beacon node api.

func NewAPIInitializer

func NewAPIInitializer(beaconNodeHost string) (*APIInitializer, error)

NewAPIInitializer creates an APIInitializer, handling the set up of a beacon node api client using the provided host string.

func (*APIInitializer) Initialize

func (dl *APIInitializer) Initialize(ctx context.Context, d db.Database) error

Initialize downloads origin state and block for checkpoint sync and initializes database records to prepare the node to begin syncing from that point.

type FileInitializer

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

FileInitializer initializes a beacon-node database to use checkpoint sync, using ssz-encoded block and state data stored in files on the local filesystem.

func NewFileInitializer

func NewFileInitializer(blockPath string, statePath string) (*FileInitializer, error)

NewFileInitializer validates the given path information and creates an Initializer which will use the provided state and block files to prepare the node for checkpoint sync.

func (*FileInitializer) Initialize

func (fi *FileInitializer) Initialize(ctx context.Context, d db.Database) error

Initialize is called in the BeaconNode db startup code if an Initializer is present. Initialize does what is needed to prepare the beacon node database for syncing from the weak subjectivity checkpoint.

type Initializer

type Initializer interface {
	Initialize(ctx context.Context, d db.Database) error
}

Initializer describes a type that is able to obtain the checkpoint sync data (BeaconState and SignedBeaconBlock) in some way and perform database setup to prepare the beacon node for syncing from the given checkpoint. See FileInitializer and APIInitializer.

Jump to

Keyboard shortcuts

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