Documentation ¶
Index ¶
- Variables
- func CreateSnapshot(opts ...options.Option[Options]) error
- func WithAccounts(accounts ...AccountDetails) options.Option[Options]
- func WithAddGenesisRootBlock(add bool) options.Option[Options]
- func WithBasicOutputs(basicOutputs ...BasicOutputDetails) options.Option[Options]
- func WithDatabaseVersion(dbVersion byte) options.Option[Options]
- func WithFilePath(filePath string) options.Option[Options]
- func WithGenesisKeyManager(keyManager *wallet.KeyManager) options.Option[Options]
- func WithLedgerProvider(ledgerProvider module.Provider[*engine.Engine, ledger.Ledger]) options.Option[Options]
- func WithProtocolParameters(params iotago.ProtocolParameters) options.Option[Options]
- func WithRootBlocks(rootBlocks map[iotago.BlockID]iotago.CommitmentID) options.Option[Options]
- type AccountDetails
- type BasicOutputDetails
- type Options
Constants ¶
This section is empty.
Variables ¶
var GenesisTransactionCommitment = iotago.IdentifierFromData([]byte("genesis"))
Functions ¶
func WithAccounts ¶
func WithAccounts(accounts ...AccountDetails) options.Option[Options]
func WithAddGenesisRootBlock ¶
WithAddGenesisRootBlock define whether a Genesis root block should be added.
func WithBasicOutputs ¶
func WithBasicOutputs(basicOutputs ...BasicOutputDetails) 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 WithProtocolParameters ¶
func WithProtocolParameters(params iotago.ProtocolParameters) options.Option[Options]
WithProtocolParameters defines the protocol parameters used for the network.
func WithRootBlocks ¶
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 ¶
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.