cmd

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2021 License: Apache-2.0 Imports: 68 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// FlagOverwrite defines a flag to overwrite an existing genesis JSON file.
	FlagOverwrite = "overwrite"

	// FlagSeed defines a flag to initialize the private validator key from a specific seed.
	FlagRecover = "recover"
)

Variables

This section is empty.

Functions

func AddGenesisAccountCmd

func AddGenesisAccountCmd(defaultNodeHome string) *cobra.Command

AddGenesisAccountCmd returns add-genesis-account cobra Command.

func ConvertBech32Cmd

func ConvertBech32Cmd() *cobra.Command

get cmd to convert any bech32 address to an osmo prefix

func Execute

func Execute(rootCmd *cobra.Command) error

Execute executes the root command.

func ExportAirdropSnapshotCmd

func ExportAirdropSnapshotCmd() *cobra.Command

ExportAirdropSnapshotCmd generates a snapshot.json from a provided cosmos-sdk v0.36 genesis export.

func ImportGenesisAccountsFromSnapshotCmd

func ImportGenesisAccountsFromSnapshotCmd(defaultNodeHome string) *cobra.Command

func InitCmd

func InitCmd(mbm module.BasicManager, defaultNodeHome string) *cobra.Command

InitCmd returns a command that initializes all files needed for Tendermint and the respective application.

func InitTestnet

func InitTestnet(
	clientCtx client.Context,
	cmd *cobra.Command,
	nodeConfig *tmconfig.Config,
	mbm module.BasicManager,
	genBalIterator banktypes.GenesisBalancesIterator,
	genesisParams GenesisParams,
	chainID string,
	outputDir,
	minGasPrices,
	nodeDirPrefix,
	nodeDaemonHome,
	startingIPAddress,
	keyringBackend,
	algoStr string,
	numValidators int,
) error

Initialize the testnet

func NewRootCmd

func NewRootCmd() (*cobra.Command, params.EncodingConfig)

NewRootCmd creates a new root command for simd. It is called once in the main function.

func PrepareGenesis

func PrepareGenesis(clientCtx client.Context, appState map[string]json.RawMessage, genDoc *tmtypes.GenesisDoc, genesisParams GenesisParams, chainID string) (map[string]json.RawMessage, *tmtypes.GenesisDoc, error)

func PrepareGenesisCmd

func PrepareGenesisCmd(defaultNodeHome string, mbm module.BasicManager) *cobra.Command

Types

type AppStateV036

type AppStateV036 struct {
	Accounts []v036genaccounts.GenesisAccount `json:"accounts"`
	Staking  v036staking.GenesisState         `json:"staking"`
}

AppStateV036 is app state structure for app state

type GenesisParams

type GenesisParams struct {
	AirdropSupply sdk.Int

	StrategicReserveAccounts []banktypes.Balance

	ConsensusParams *tmproto.ConsensusParams

	GenesisTime         time.Time
	NativeCoinMetadatas []banktypes.Metadata

	StakingParams      stakingtypes.Params
	MintParams         minttypes.Params
	DistributionParams distributiontypes.Params
	GovParams          govtypes.Params

	CrisisConstantFee sdk.Coin

	SlashingParams    slashingtypes.Params
	IncentivesGenesis incentivestypes.GenesisState

	PoolIncentivesGenesis poolincentivestypes.GenesisState

	Epochs []epochstypes.EpochInfo

	ClaimParams claimtypes.Params
}

func MainnetGenesisParams

func MainnetGenesisParams() GenesisParams

func TestnetGenesisParams

func TestnetGenesisParams() GenesisParams

type GenesisStateV036

type GenesisStateV036 struct {
	AppState AppStateV036 `json:"app_state"`
}

GenesisStateV036 is minimum structure to import airdrop accounts

type Snapshot

type Snapshot struct {
	TotalAtomAmount         sdk.Int `json:"total_atom_amount"`
	TotalOsmosAirdropAmount sdk.Int `json:"total_osmo_amount"`
	NumberAccounts          uint64  `json:"num_accounts"`

	Accounts map[string]SnapshotAccount `json:"accounts"`
}

type SnapshotAccount

type SnapshotAccount struct {
	AtomAddress string `json:"atom_address"` // Atom Balance = AtomStakedBalance + AtomUnstakedBalance

	AtomBalance          sdk.Int `json:"atom_balance"`
	AtomOwnershipPercent sdk.Dec `json:"atom_ownership_percent"`

	AtomStakedBalance   sdk.Int `json:"atom_staked_balance"`
	AtomUnstakedBalance sdk.Int `json:"atom_unstaked_balance"` // AtomStakedPercent = AtomStakedBalance / AtomBalance
	AtomStakedPercent   sdk.Dec `json:"atom_staked_percent"`

	OsmoBalance      sdk.Int `json:"osmo_balance"`           // OsmoBalance = sqrt( AtomBalance ) * (1 + 1.5 * atom staked percent)
	OsmoBalanceBase  sdk.Int `json:"osmo_balance_base"`      // OsmoBalanceBase = sqrt(atom balance)
	OsmoBalanceBonus sdk.Int `json:"osmo_balance_bonus"`     // OsmoBalanceBonus = OsmoBalanceBase * (1.5 * atom staked percent)
	OsmoPercent      sdk.Dec `json:"osmo_ownership_percent"` // OsmoPercent = OsmoNormalizedBalance / TotalOsmoSupply
}

SnapshotAccount provide fields of snapshot per account

Jump to

Keyboard shortcuts

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