genesis

package
v5.1.2-mekong Latest Latest
Warning

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

Go to latest
Published: Nov 7, 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 genesis state and block to prepare the beacon node for syncing. The genesis state is retrieved from the remote beacon node api, using the debug state retrieval endpoint.

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 genesis state and block using ssz-encoded state data stored in files on the local filesystem.

func NewFileInitializer

func NewFileInitializer(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 prepares the beacondb using the provided genesis state.

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