genesis

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: MIT Imports: 38 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertJsonToSnapshot added in v1.2.10

func ConvertJsonToSnapshot(doc *types.GenesisDoc) ([]byte, error)

func ConvertSnapshotToJson added in v1.4.0

func ConvertSnapshotToJson(snap []byte) (*types.GenesisDoc, error)

func DocProvider added in v1.2.10

func DocProvider(config *tm.Config) node.GenesisDocProvider

DocProvider reads the genesis document.

func Extract added in v1.4.0

func Extract(db *coredb.Database, snap ioutil2.SectionReader, shouldKeep func(*url.URL) bool) (map[[32]byte]*AccountData, error)

func Init

func Init(snapshotWriter io.WriteSeeker, opts InitOpts) error

Types

type AccountData added in v1.4.0

type AccountData struct {
	Url    *url.URL
	Keep   bool
	Main   protocol.Account
	States map[string][]*merkle.State
}

type DataRecord

type DataRecord struct {
	Account *url.URL
	Entry   protocol.DataEntry
}

type GenesisAddressAndBalances

type GenesisAddressAndBalances struct {
	Address *url.URL
	Balance int64
}

func LoadFactomAddressesAndBalances

func LoadFactomAddressesAndBalances(file io.Reader) ([]*GenesisAddressAndBalances, error)

type InitOpts

type InitOpts struct {
	Logger log.Logger

	NetworkID      string
	PartitionId    string
	NetworkType    protocol.PartitionType
	GenesisTime    time.Time
	GenesisGlobals *core.GlobalValues
	OperatorKeys   [][]byte

	// For Tendermint
	ConsensusParams *tmtypes.ConsensusParams

	// Preloaded data
	FactomAddresses func() (io.Reader, error)
	Snapshots       []func(*core.GlobalValues) (ioutil2.SectionReader, error)

	// Flags
	IncludeHistoryFromSnapshots bool
}

Jump to

Keyboard shortcuts

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