initialization

package
v2.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 44 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// common
	TerraDenom          = "uluna"
	AtomDenom           = "uatom"
	TerraIBCDenom       = "ibc/4627AD2524E3E0523047E35BB76CC90E37D9D57ACF14F0FCBCEB2480705F3CB8"
	MinGasPrice         = "0.000"
	IbcSendAmount       = 3300000000
	ValidatorWalletName = "val"
	// chainA
	ChainAID      = "terra-test-a"
	TerraBalanceA = 20000000000000
	StakeBalanceA = 110000000000
	StakeAmountA  = 100000000000
	// chainB
	ChainBID          = "terra-test-b"
	TerraBalanceB     = 500000000000
	StakeBalanceB     = 440000000000
	StakeAmountB      = 400000000000
	GenesisFeeBalance = 100000000000
	WalletFeeBalance  = 100000000
	// chainC
	ChainCID      = "terra-test-c"
	TerraBalanceC = 500000000000
	StakeBalanceC = 440000000000
	StakeAmountC  = 400000000000
)

Variables

View Source
var (
	StakeAmountIntA  = sdk.NewInt(StakeAmountA)
	StakeAmountCoinA = sdk.NewCoin(TerraDenom, StakeAmountIntA)
	StakeAmountIntB  = sdk.NewInt(StakeAmountB)
	StakeAmountCoinB = sdk.NewCoin(TerraDenom, StakeAmountIntB)

	InitBalanceStrA = fmt.Sprintf("%d%s", TerraBalanceA, TerraDenom)
	InitBalanceStrB = fmt.Sprintf("%d%s", TerraBalanceB, TerraDenom)
	InitBalanceStrC = fmt.Sprintf("%d%s", TerraBalanceC, TerraDenom)
	LunaToken       = sdk.NewInt64Coin(TerraDenom, IbcSendAmount) // 3,300luna

	OneMin  = time.Minute              // nolint
	TwoMin  = 2 * time.Minute          // nolint
	FiveMin = 5 * time.Minute          // nolint
	TaxRate = sdk.NewDecWithPrec(2, 2) // 0.02
)

Functions

func SetAddressPrefixes

func SetAddressPrefixes()

SetAddressPrefixes builds the Config with Bech32 addressPrefix and publKeyPrefix for accounts, validators, and consensus nodes and verifies that addreeses have correct format.

Types

type Chain

type Chain struct {
	ChainMeta ChainMeta `json:"chainMeta"`
	Nodes     []*Node   `json:"validators"`
}

func InitChain

func InitChain(id, dataDir string, nodeConfigs []*NodeConfig, forkHeight int) (*Chain, error)

type ChainMeta

type ChainMeta struct {
	DataDir string `json:"dataDir"`
	ID      string `json:"id"`
}

type Node

type Node struct {
	Name          string `json:"name"`
	ConfigDir     string `json:"configDir"`
	Mnemonic      string `json:"mnemonic"`
	PublicAddress string `json:"publicAddress"`
	PublicKey     string `json:"publicKey"`
	PeerID        string `json:"peerId"`
	IsValidator   bool   `json:"isValidator"`
}

func InitSingleNode

func InitSingleNode(chainID, dataDir string, existingGenesisDir string, nodeConfig *NodeConfig, trustHeight int64, trustHash string, stateSyncRPCServers []string, persistentPeers []string) (*Node, error)

type NodeConfig

type NodeConfig struct {
	Name               string // name of the config that will also be assigned to Docke container.
	Pruning            string // default, nothing, everything, or custom
	PruningKeepRecent  string // keep all of the last N states (only used with custom pruning)
	PruningInterval    string // delete old states from every Nth block (only used with custom pruning)
	SnapshotInterval   uint64 // statesync snapshot every Nth block (0 to disable)
	SnapshotKeepRecent uint32 // number of recent snapshots to keep and serve (0 to keep all)
	IsValidator        bool   // flag indicating whether a node should be a validator
}

NodeConfig is a confiuration for the node supplied from the test runner to initialization scripts. It should be backwards compatible with earlier versions. If this struct is updated, the change must be backported to earlier branches that might be used for upgrade testing.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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