archive

package
v0.0.0-...-8d666af Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

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