Documentation ¶
Index ¶
- func CreateSnapshot(opts ...options.Option[Options]) error
- func KeyValues[K comparable, V any](in map[K]V) ([]K, []V)
- func WithAttestAll(attestAll bool) options.Option[Options]
- func WithDatabaseVersion(databaseVersion database.Version) options.Option[Options]
- func WithFilePath(filePath string) options.Option[Options]
- func WithGenesisSeed(masterSeed []byte) options.Option[Options]
- func WithGenesisTokenAmount(genesisTokenAmount uint64) options.Option[Options]
- func WithGenesisUnixTime(unixTime int64) options.Option[Options]
- func WithInitialAttestationsBase58(initialAttestationBase58 []string) options.Option[Options]
- func WithInitialAttestationsPublicKey(initialAttestation []ed25519.PublicKey) options.Option[Options]
- func WithLedgerProvider(ledgerProvider module.Provider[*engine.Engine, ledger.Ledger]) options.Option[Options]
- func WithPeersAmountsPledged(peersAmountsPledged []uint64) options.Option[Options]
- func WithPeersPublicKeys(peersPublicKey []ed25519.PublicKey) options.Option[Options]
- func WithPeersPublicKeysBase58(peersPublicKeyBase58 []string) options.Option[Options]
- func WithPeersSeedBase58(peersSeedBase58 []string) options.Option[Options]
- func WithPledgeIDs(pledgeIDs map[ed25519.PublicKey]uint64) options.Option[Options]
- func WithSlotDuration(duration int64) options.Option[Options]
- func WithTotalTokensPledged(totalTokensPledged uint64) options.Option[Options]
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func KeyValues ¶
func KeyValues[K comparable, V any](in map[K]V) ([]K, []V)
func WithAttestAll ¶
WithAttestAll indicates if all node should be included in attestations.
func WithDatabaseVersion ¶
WithDatabaseVersion sets the database version to use for the snapshot.
func WithGenesisTokenAmount ¶
WithGenesisTokenAmount sets the amount of tokens left on the Genesis, pledged to Peer Master.
func WithGenesisUnixTime ¶
WithGenesisUnixTime provides the genesis time of the snapshot.
func WithInitialAttestationsBase58 ¶
WithInitialAttestationsBase58 sets the initial attestation node to use for the snapshot based on provided public keys in base58.
func WithInitialAttestationsPublicKey ¶
func WithInitialAttestationsPublicKey(initialAttestation []ed25519.PublicKey) options.Option[Options]
WithInitialAttestationsPublicKey sets the initial attestation node public key to use for the snapshot.
func WithLedgerProvider ¶
func WithLedgerProvider(ledgerProvider module.Provider[*engine.Engine, ledger.Ledger]) options.Option[Options]
WithLedgerProvider sets the MemPool to use for the snapshot.
func WithPeersAmountsPledged ¶
WithPeersAmountsPledged sets the amount of tokens to be pledged to the peers.
func WithPeersPublicKeys ¶
func WithPeersPublicKeysBase58 ¶
WithPeersPublicKeysBase58 sets the public keys of the peers based on provided base58 encoded public keys.
func WithPeersSeedBase58 ¶
WithPeersSeedBase58 sets the seed of the peers to be used in the snapshot.
func WithPledgeIDs ¶
WithPledgeIDs sets the public keys and pledge amounts to use for the snapshot.
func WithSlotDuration ¶
WithSlotDuration defines the duration in seconds of each slot.
Types ¶
type Options ¶
type Options struct { // FilePath is the path to the snapshot file. FilePath string // GenesisSeed is the seed of the PeerMaster node where the genesis pledge goes to. GenesisSeed []byte // GenesisTokenAmount is the amount of tokens left on the Genesis, pledged to Peer Master. GenesisTokenAmount uint64 // TotalTokensPledged is the total amount of tokens pledged from genesis to the peers. // If provided mana will be distributed equally. TotalTokensPledged uint64 // PeersSeedBase58 is a slice of Seeds encoded in Base58, one entry per peer. PeersSeedBase58 []string // PeersPublicKey is a slice of public keys, one entry per peer. PeersPublicKey []ed25519.PublicKey // PeersAmountsPledged is a slice of amounts to be pledged to the peers, one entry per peer. PeersAmountsPledged []uint64 // InitialAttestationsPublicKey indicates which node public key should be included in the first commitment. InitialAttestationsPublicKey []ed25519.PublicKey // AttestAll indicates that all nodes will be included in the attestation. AttestAll bool // GenesisUnixTime provides the genesis time of the snapshot. GenesisUnixTime int64 // SlotDuration defines the duration in seconds of each slot. SlotDuration int64 DataBaseVersion database.Version LedgerProvider module.Provider[*engine.Engine, ledger.Ledger] }
Options stores the details about snapshots created for integration tests