archive

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 23, 2023 License: Apache-2.0 Imports: 17 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateBackup

func CreateBackup(
	conn *grpc.ClientConn,
	logger hclog.Logger,
	from uint64,
	to *uint64,
	outPath string,
) (uint64, uint64, error)

CreateBackup fetches blockchain data with the specific range via gRPC and save this data as binary archive to given path

func RestoreChain

func RestoreChain(chain blockchainInterface, filePath string, progression *progress.ProgressionWrapper) error

RestoreChain reads blocks from the archive and write to the chain

Types

type Metadata

type Metadata struct {
	Latest     uint64
	LatestHash types.Hash
}

Metadata is the data stored in the beginning of backup

func (*Metadata) MarshalRLP

func (m *Metadata) MarshalRLP() []byte

MarshalRLP returns RLP encoded bytes

func (*Metadata) MarshalRLPTo

func (m *Metadata) MarshalRLPTo(dst []byte) []byte

MarshalRLPTo sets RLP encoded bytes to given byte slice

func (*Metadata) MarshalRLPWith

func (m *Metadata) MarshalRLPWith(arena *fastrlp.Arena) *fastrlp.Value

MarshalRLPWith appends own field into arena for encode

func (*Metadata) UnmarshalRLP

func (m *Metadata) UnmarshalRLP(input []byte) error

UnmarshalRLP unmarshals and sets the fields from RLP encoded bytes

func (*Metadata) UnmarshalRLPFrom

func (m *Metadata) UnmarshalRLPFrom(p *fastrlp.Parser, v *fastrlp.Value) error

UnmarshalRLPFrom sets the fields from parsed RLP encoded value

Jump to

Keyboard shortcuts

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