Documentation ¶
Index ¶
Constants ¶
View Source
const (
WriteBlockSource = "archive"
)
Variables ¶
View Source
var ( // Error Info ErrBlockRange = errors.New("block range error: from is greater than or equal to to") )
Functions ¶
func CreateBackup ¶
func CreateBackup( conn *grpc.ClientConn, logger hclog.Logger, from uint64, to *uint64, outPath string, overwriteFile bool, enableZstdCompression bool, zstdLevel int, ) (resFrom uint64, resTo uint64, err error)
CreateBackup fetches blockchain data with the specific range via gRPC and save this data as binary archive to given path
func RestoreChain ¶
RestoreChain reads blocks from the archive and write to the chain
Types ¶
type Metadata ¶
Metadata is the data stored in the beginning of backup
func (*Metadata) MarshalRLP ¶
MarshalRLP returns RLP encoded bytes
func (*Metadata) MarshalRLPTo ¶
MarshalRLPTo sets RLP encoded bytes to given byte slice
func (*Metadata) MarshalRLPWith ¶
MarshalRLPWith appends own field into arena for encode
func (*Metadata) UnmarshalRLP ¶
UnmarshalRLP unmarshals and sets the fields from RLP encoded bytes
Click to show internal directories.
Click to hide internal directories.