snapshotcreator

package
v1.0.0-beta.9 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2024 License: Apache-2.0 Imports: 34 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GenesisTransactionCommitment = iotago.IdentifierFromData([]byte("genesis"))

Functions

func CreateSnapshot

func CreateSnapshot(opts ...options.Option[Options]) error

func WithAccounts

func WithAccounts(accounts ...AccountDetails) options.Option[Options]

func WithAddGenesisRootBlock

func WithAddGenesisRootBlock(add bool) options.Option[Options]

WithAddGenesisRootBlock define whether a Genesis root block should be added.

func WithBasicOutputs

func WithBasicOutputs(basicOutputs ...BasicOutputDetails) options.Option[Options]

func WithDatabaseVersion

func WithDatabaseVersion(dbVersion byte) options.Option[Options]

func WithFilePath

func WithFilePath(filePath string) options.Option[Options]

func WithGenesisKeyManager

func WithGenesisKeyManager(keyManager *wallet.KeyManager) options.Option[Options]

WithGenesisKeyManager defines the seed used to generate keypair that can spend Genesis outputs.

func WithLedgerProvider

func WithLedgerProvider(ledgerProvider module.Provider[*engine.Engine, ledger.Ledger]) options.Option[Options]

func WithProtocolParameters

func WithProtocolParameters(params iotago.ProtocolParameters) options.Option[Options]

WithProtocolParameters defines the protocol parameters used for the network.

func WithRootBlocks

func WithRootBlocks(rootBlocks map[iotago.BlockID]iotago.CommitmentID) options.Option[Options]

WithRootBlocks define the initial blocks to which new blocks can attach to.

Types

type AccountDetails

type AccountDetails struct {
	AccountID iotago.AccountID

	Address              iotago.Address
	Amount               iotago.BaseToken
	Mana                 iotago.Mana
	IssuerKey            iotago.BlockIssuerKey
	ExpirySlot           iotago.SlotIndex
	BlockIssuanceCredits iotago.BlockIssuanceCredits

	StakingEndEpoch iotago.EpochIndex
	FixedCost       iotago.Mana
	StakedAmount    iotago.BaseToken
}

AccountDetails is a struct that specifies details of accounts created in the Genesis snapshot. AccountID is derived from IssuerKey, therefore, this value must be unique for each account.

type BasicOutputDetails

type BasicOutputDetails struct {
	Address iotago.Address
	Amount  iotago.BaseToken
	Mana    iotago.Mana
}

BasicOutputDetails is a struct that specifies details of a basic output created in the Genesis snapshot.

type Options

type Options struct {
	// FilePath is the path to the snapshot file.
	FilePath string

	// ProtocolParameters provides the protocol parameters used for the network.
	ProtocolParameters iotago.ProtocolParameters

	// AddGenesisRootBlock defines whether a Genesis root block should be added.
	AddGenesisRootBlock bool

	// RootBlocks define the initial blocks to which new blocks can attach to.
	RootBlocks map[iotago.BlockID]iotago.CommitmentID

	// GenesisKeyManager defines the key manager used to generate keypair that can spend Genesis outputs.
	GenesisKeyManager *wallet.KeyManager

	// Accounts defines the accounts that are created in the ledger as part of the Genesis.
	Accounts []AccountDetails

	// BasicOutput defines the basic outputs that are created in the ledger as part of the Genesis.
	BasicOutputs []BasicOutputDetails

	DataBaseVersion byte
	LedgerProvider  module.Provider[*engine.Engine, ledger.Ledger]
}

Options stores the details about snapshots created for integration tests.

func NewOptions

func NewOptions(opts ...options.Option[Options]) *Options

Jump to

Keyboard shortcuts

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