snapshotcreator

package
v0.8.18 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2022 License: Apache-2.0, BSD-2-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateSnapshot

func CreateSnapshot(genesisTokenAmount uint64, seedBytes []byte, pledgeTokenAmount uint64, nodesToPledge map[string]Pledge, snapshotFileName string) (*ledgerstate.Snapshot, error)

CreateSnapshot writes a new snapshot file to the path declared by snapshot name. Genesis is defined by genesisTokenAmount and seedBytes. The amount pledge to each node is defined by nodesToPledge map. Whenever the amount is 0 in the map pledgeTokenAmount is used.

Types

type Genesis

type Genesis struct {
	// The genesis seed.
	Seed *seed.Seed
	// The genesis token amount.
	Amount uint64
}

Genesis holds information about the genesis output.

type Pledge

type Pledge struct {
	// Target address, if nil, a random address will be used instead.
	Address ledgerstate.Address
	// Whether to pledge the genesis amount to the genesis address.
	Genesis bool
	// Amount to use for the pledge, if zero, cfgPledgeTokenAmount is used.
	Amount uint64
}

Pledge defines a pledge to a node.

Jump to

Keyboard shortcuts

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