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.
Click to show internal directories.
Click to hide internal directories.