presets

package
v0.0.0-...-3f5b497 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Base = []options.Option[snapshotcreator.Options]{
		snapshotcreator.WithDatabaseVersion(protocol.DatabaseVersion),
		snapshotcreator.WithFilePath("snapshot.bin"),
		snapshotcreator.WithProtocolParameters(protocolParamsBase),
		snapshotcreator.WithAddGenesisRootBlock(true),
	}

	Docker = []options.Option[snapshotcreator.Options]{
		snapshotcreator.WithFilePath("docker-network.snapshot"),
		snapshotcreator.WithProtocolParameters(protocolParamsDocker),
		snapshotcreator.WithAccounts(
			snapshotcreator.AccountDetails{

				AccountID:            blake2b.Sum256(lo.PanicOnErr(hexutil.DecodeHex("0x293dc170d9a59474e6d81cfba7f7d924c09b25d7166bcfba606e53114d0a758b"))),
				Address:              iotago.Ed25519AddressFromPubKey(lo.PanicOnErr(hexutil.DecodeHex("0x293dc170d9a59474e6d81cfba7f7d924c09b25d7166bcfba606e53114d0a758b"))),
				Amount:               mock.MinValidatorAccountAmount(protocolParamsDocker),
				IssuerKey:            iotago.Ed25519PublicKeyHashBlockIssuerKeyFromPublicKey(ed25519.PublicKey(lo.PanicOnErr(hexutil.DecodeHex("0x293dc170d9a59474e6d81cfba7f7d924c09b25d7166bcfba606e53114d0a758b")))),
				ExpirySlot:           iotago.MaxSlotIndex,
				BlockIssuanceCredits: iotago.MaxBlockIssuanceCredits / 5,
				StakingEndEpoch:      iotago.MaxEpochIndex,
				FixedCost:            1,
				StakedAmount:         mock.MinValidatorAccountAmount(protocolParamsDocker),
				Mana:                 iotago.Mana(mock.MinValidatorAccountAmount(protocolParamsDocker)),
			},
			snapshotcreator.AccountDetails{

				AccountID:            blake2b.Sum256(lo.PanicOnErr(hexutil.DecodeHex("0x05c1de274451db8de8182d64c6ee0dca3ae0c9077e0b4330c976976171d79064"))),
				Address:              iotago.Ed25519AddressFromPubKey(lo.PanicOnErr(hexutil.DecodeHex("0x05c1de274451db8de8182d64c6ee0dca3ae0c9077e0b4330c976976171d79064"))),
				Amount:               mock.MinValidatorAccountAmount(protocolParamsDocker),
				IssuerKey:            iotago.Ed25519PublicKeyHashBlockIssuerKeyFromPublicKey(ed25519.PublicKey(lo.PanicOnErr(hexutil.DecodeHex("0x05c1de274451db8de8182d64c6ee0dca3ae0c9077e0b4330c976976171d79064")))),
				ExpirySlot:           iotago.MaxSlotIndex,
				BlockIssuanceCredits: iotago.MaxBlockIssuanceCredits / 5,
				StakingEndEpoch:      iotago.MaxEpochIndex,
				FixedCost:            1,
				StakedAmount:         mock.MinValidatorAccountAmount(protocolParamsDocker),
				Mana:                 iotago.Mana(mock.MinValidatorAccountAmount(protocolParamsDocker)),
			},
			snapshotcreator.AccountDetails{

				AccountID:            blake2b.Sum256(lo.PanicOnErr(hexutil.DecodeHex("0x1e4b21eb51dcddf65c20db1065e1f1514658b23a3ddbf48d30c0efc926a9a648"))),
				Address:              iotago.Ed25519AddressFromPubKey(lo.PanicOnErr(hexutil.DecodeHex("0x1e4b21eb51dcddf65c20db1065e1f1514658b23a3ddbf48d30c0efc926a9a648"))),
				Amount:               mock.MinValidatorAccountAmount(protocolParamsDocker),
				IssuerKey:            iotago.Ed25519PublicKeyHashBlockIssuerKeyFromPublicKey(ed25519.PublicKey(lo.PanicOnErr(hexutil.DecodeHex("0x1e4b21eb51dcddf65c20db1065e1f1514658b23a3ddbf48d30c0efc926a9a648")))),
				ExpirySlot:           iotago.MaxSlotIndex,
				BlockIssuanceCredits: iotago.MaxBlockIssuanceCredits / 5,
				StakingEndEpoch:      iotago.MaxEpochIndex,
				FixedCost:            1,
				StakedAmount:         mock.MinValidatorAccountAmount(protocolParamsDocker),
				Mana:                 iotago.Mana(mock.MinValidatorAccountAmount(protocolParamsDocker)),
			},
			snapshotcreator.AccountDetails{

				AccountID:            blake2b.Sum256(lo.PanicOnErr(hexutil.DecodeHex("0xc9ceac37d293155a578381aa313ee74edfa3ac73ee930d045564aae7771e8ffe"))),
				Address:              iotago.Ed25519AddressFromPubKey(lo.PanicOnErr(hexutil.DecodeHex("0xc9ceac37d293155a578381aa313ee74edfa3ac73ee930d045564aae7771e8ffe"))),
				Amount:               mock.MinValidatorAccountAmount(protocolParamsDocker),
				IssuerKey:            iotago.Ed25519PublicKeyHashBlockIssuerKeyFromPublicKey(ed25519.PublicKey(lo.PanicOnErr(hexutil.DecodeHex("0xc9ceac37d293155a578381aa313ee74edfa3ac73ee930d045564aae7771e8ffe")))),
				ExpirySlot:           iotago.MaxSlotIndex,
				BlockIssuanceCredits: iotago.MaxBlockIssuanceCredits / 5,
				StakingEndEpoch:      iotago.MaxEpochIndex,
				FixedCost:            1,
				StakedAmount:         mock.MinValidatorAccountAmount(protocolParamsDocker),
				Mana:                 iotago.Mana(mock.MinValidatorAccountAmount(protocolParamsDocker)),
			},
			snapshotcreator.AccountDetails{

				AccountID:            blake2b.Sum256(lo.PanicOnErr(hexutil.DecodeHex("0x997be92a22b1933f36e26fba5f721756f95811d6b4ae21564197c2bfa4f28270"))),
				Address:              iotago.Ed25519AddressFromPubKey(lo.PanicOnErr(hexutil.DecodeHex("0x997be92a22b1933f36e26fba5f721756f95811d6b4ae21564197c2bfa4f28270"))),
				Amount:               mock.MinIssuerAccountAmount(protocolParamsDocker),
				IssuerKey:            iotago.Ed25519PublicKeyHashBlockIssuerKeyFromPublicKey(ed25519.PublicKey(lo.PanicOnErr(hexutil.DecodeHex("0x997be92a22b1933f36e26fba5f721756f95811d6b4ae21564197c2bfa4f28270")))),
				ExpirySlot:           iotago.MaxSlotIndex,
				BlockIssuanceCredits: iotago.MaxBlockIssuanceCredits / 5,
				Mana:                 iotago.Mana(mock.MinIssuerAccountAmount(protocolParamsDocker)),
			},
		),
		snapshotcreator.WithBasicOutputs(

			snapshotcreator.BasicOutputDetails{
				Address: lo.Return2(iotago.ParseBech32("rms1xqqz7e8e69uej86s2s4srcp5lgzrkx25qwr4hpnha7h3j66pezyq85qpqg55v3ur")),
				Amount:  1_000_000_000_000_000,
				Mana:    1_000_000_000_000_000,
			},
		),
	}

	// Feature is a preset for the feature network.
	Feature = []options.Option[snapshotcreator.Options]{
		snapshotcreator.WithFilePath("docker-network.snapshot"),
		snapshotcreator.WithProtocolParameters(protocolParamsFeature),
		snapshotcreator.WithAccounts(
			snapshotcreator.AccountDetails{

				AccountID:            blake2b.Sum256(lo.PanicOnErr(hexutil.DecodeHex("0x01fb6b9db5d96240aef00bc950d1c67a6494513f6d7cf784e57b4972b96ab2fe"))),
				Address:              iotago.Ed25519AddressFromPubKey(lo.PanicOnErr(hexutil.DecodeHex("0x01fb6b9db5d96240aef00bc950d1c67a6494513f6d7cf784e57b4972b96ab2fe"))),
				Amount:               mock.MinValidatorAccountAmount(protocolParamsFeature),
				IssuerKey:            iotago.Ed25519PublicKeyHashBlockIssuerKeyFromPublicKey(ed25519.PublicKey(lo.PanicOnErr(hexutil.DecodeHex("0x01fb6b9db5d96240aef00bc950d1c67a6494513f6d7cf784e57b4972b96ab2fe")))),
				ExpirySlot:           iotago.MaxSlotIndex,
				BlockIssuanceCredits: iotago.MaxBlockIssuanceCredits / 5,
				StakingEndEpoch:      iotago.MaxEpochIndex,
				FixedCost:            1,
				StakedAmount:         mock.MinValidatorAccountAmount(protocolParamsFeature),
				Mana:                 iotago.Mana(mock.MinValidatorAccountAmount(protocolParamsFeature)),
			},
			snapshotcreator.AccountDetails{

				AccountID:            blake2b.Sum256(lo.PanicOnErr(hexutil.DecodeHex("0x83e7f71a440afd48981a8b4684ddae24434b7182ce5c47cfb56ac528525fd4b6"))),
				Address:              iotago.Ed25519AddressFromPubKey(lo.PanicOnErr(hexutil.DecodeHex("0x83e7f71a440afd48981a8b4684ddae24434b7182ce5c47cfb56ac528525fd4b6"))),
				Amount:               mock.MinValidatorAccountAmount(protocolParamsFeature),
				IssuerKey:            iotago.Ed25519PublicKeyHashBlockIssuerKeyFromPublicKey(ed25519.PublicKey(lo.PanicOnErr(hexutil.DecodeHex("0x83e7f71a440afd48981a8b4684ddae24434b7182ce5c47cfb56ac528525fd4b6")))),
				ExpirySlot:           iotago.MaxSlotIndex,
				BlockIssuanceCredits: iotago.MaxBlockIssuanceCredits / 5,
				StakingEndEpoch:      iotago.MaxEpochIndex,
				FixedCost:            1,
				StakedAmount:         mock.MinValidatorAccountAmount(protocolParamsFeature),
				Mana:                 iotago.Mana(mock.MinValidatorAccountAmount(protocolParamsFeature)),
			},
			snapshotcreator.AccountDetails{

				AccountID:            blake2b.Sum256(lo.PanicOnErr(hexutil.DecodeHex("0xac628986b2ef52a1679f2289fcd7b4198476976dea4c30ae34ff04ae52e14805"))),
				Address:              iotago.Ed25519AddressFromPubKey(lo.PanicOnErr(hexutil.DecodeHex("0xac628986b2ef52a1679f2289fcd7b4198476976dea4c30ae34ff04ae52e14805"))),
				Amount:               mock.MinValidatorAccountAmount(protocolParamsFeature),
				IssuerKey:            iotago.Ed25519PublicKeyHashBlockIssuerKeyFromPublicKey(ed25519.PublicKey(lo.PanicOnErr(hexutil.DecodeHex("0xac628986b2ef52a1679f2289fcd7b4198476976dea4c30ae34ff04ae52e14805")))),
				ExpirySlot:           iotago.MaxSlotIndex,
				BlockIssuanceCredits: iotago.MaxBlockIssuanceCredits / 5,
				StakingEndEpoch:      iotago.MaxEpochIndex,
				FixedCost:            1,
				StakedAmount:         mock.MinValidatorAccountAmount(protocolParamsFeature),
				Mana:                 iotago.Mana(mock.MinValidatorAccountAmount(protocolParamsFeature)),
			},
			snapshotcreator.AccountDetails{

				AccountID:            blake2b.Sum256(lo.PanicOnErr(hexutil.DecodeHex("0xc9ceac37d293155a578381aa313ee74edfa3ac73ee930d045564aae7771e8ffe"))),
				Address:              iotago.Ed25519AddressFromPubKey(lo.PanicOnErr(hexutil.DecodeHex("0xc9ceac37d293155a578381aa313ee74edfa3ac73ee930d045564aae7771e8ffe"))),
				Amount:               mock.MinValidatorAccountAmount(protocolParamsFeature),
				IssuerKey:            iotago.Ed25519PublicKeyHashBlockIssuerKeyFromPublicKey(ed25519.PublicKey(lo.PanicOnErr(hexutil.DecodeHex("0xc9ceac37d293155a578381aa313ee74edfa3ac73ee930d045564aae7771e8ffe")))),
				ExpirySlot:           iotago.MaxSlotIndex,
				BlockIssuanceCredits: iotago.MaxBlockIssuanceCredits / 5,
				StakingEndEpoch:      iotago.MaxEpochIndex,
				FixedCost:            1,
				StakedAmount:         mock.MinValidatorAccountAmount(protocolParamsFeature),
				Mana:                 iotago.Mana(mock.MinValidatorAccountAmount(protocolParamsFeature)),
			},
			snapshotcreator.AccountDetails{

				AccountID:            blake2b.Sum256(lo.PanicOnErr(hexutil.DecodeHex("0x670a1a20ddb02a6cec53ec3196bc7d5bd26df2f5a6ca90b5fffd71364f104b25"))),
				Address:              iotago.Ed25519AddressFromPubKey(lo.PanicOnErr(hexutil.DecodeHex("0x670a1a20ddb02a6cec53ec3196bc7d5bd26df2f5a6ca90b5fffd71364f104b25"))),
				Amount:               mock.MinIssuerAccountAmount(protocolParamsFeature),
				IssuerKey:            iotago.Ed25519PublicKeyHashBlockIssuerKeyFromPublicKey(ed25519.PublicKey(lo.PanicOnErr(hexutil.DecodeHex("0x670a1a20ddb02a6cec53ec3196bc7d5bd26df2f5a6ca90b5fffd71364f104b25")))),
				ExpirySlot:           iotago.MaxSlotIndex,
				BlockIssuanceCredits: iotago.MaxBlockIssuanceCredits / 5,
				Mana:                 iotago.Mana(mock.MinIssuerAccountAmount(protocolParamsFeature)),
			},
		),
		snapshotcreator.WithBasicOutputs(

			snapshotcreator.BasicOutputDetails{
				Address: lo.Return2(iotago.ParseBech32("rms1xqqy3txhvnmzv53kgm2ueu30splfd5ct02cqvnehpdn04qgeskv9a3qpqgrhlhv3")),
				Amount:  1_000_000_000_000_000,
				Mana:    1_000_000_000_000_000,
			},
		),
	}
)

Functions

func GenerateFromYaml

func GenerateFromYaml(hostsFile string) ([]options.Option[snapshotcreator.Options], error)

Types

type BasicOutputYaml

type BasicOutputYaml struct {
	Address string `yaml:"address"`
	Amount  uint64 `yaml:"amount"`
	Mana    uint64 `yaml:"mana"`
}

type BlockIssuerYaml

type BlockIssuerYaml struct {
	Name      string `yaml:"name"`
	PublicKey string `yaml:"public-key"`
}

type ConfigYaml

type ConfigYaml struct {
	Name     string `yaml:"name"`
	FilePath string `yaml:"filepath"`

	Validators   []ValidatorYaml   `yaml:"validators"`
	BlockIssuers []BlockIssuerYaml `yaml:"block-issuers"`
	BasicOutputs []BasicOutputYaml `yaml:"basic-outputs"`
}

type ValidatorYaml

type ValidatorYaml struct {
	Name      string `yaml:"name"`
	PublicKey string `yaml:"public-key"`
}

Jump to

Keyboard shortcuts

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