Documentation ¶
Index ¶
- Constants
- Variables
- func ChangeAddressPrefix(address, newPrefix string) (string, error)
- func CheckGenesisContainsAddress(genesisPath, addr string) (bool, error)
- func GenesisAndHashFromURL(ctx context.Context, url string) (genesis []byte, hash string, err error)
- func GetAddressPrefix(address string) (string, error)
- func SetGenesisTime(genesisPath string, genesisTime int64) error
- type ChainGenesis
- type Genesis
- type GentxInfo
- type PubKey
- type StargateGentx
Constants ¶
const (
ChainConfigDir = "config"
)
Variables ¶
var GentxFilename = "gentx.json"
Functions ¶
func ChangeAddressPrefix ¶
ChangeAddressPrefix returns the address with another prefix
func CheckGenesisContainsAddress ¶
CheckGenesisContainsAddress returns true if the address exist into the genesis file
func GenesisAndHashFromURL ¶
func GenesisAndHashFromURL(ctx context.Context, url string) (genesis []byte, hash string, err error)
GenesisAndHashFromURL fetches the genesis from the given url and returns its content along with the sha256 hash.
func GetAddressPrefix ¶
GetAddressPrefix returns the bech 32 prefix used by the address
func SetGenesisTime ¶
SetGenesisTime sets the genesis time inside a genesis file
Types ¶
type ChainGenesis ¶
type ChainGenesis struct { AppState struct { Auth struct { Accounts []struct { Address string `json:"address"` } `json:"accounts"` } `json:"auth"` Staking struct { Params struct { BondDenom string `json:"bond_denom"` } `json:"params"` } `json:"staking"` } `json:"app_state"` }
ChainGenesis represents the stargate genesis file
type Genesis ¶
Genesis represents a more readable version of the stargate genesis file
func ParseGenesis ¶
ParseGenesis parse ChainGenesis object from a genesis file
func (Genesis) HasAccount ¶
HasAccount check if account exist into the genesis account
type GentxInfo ¶
GentxInfo represents the basic info about gentx file
func GentxFromPath ¶
GentxFromPath returns GentxInfo from the json file
type StargateGentx ¶
type StargateGentx struct { Body struct { Messages []struct { DelegatorAddress string `json:"delegator_address"` ValidatorAddress string `json:"validator_address"` PubKey struct { Key string `json:"key"` } `json:"pubkey"` Value struct { Denom string `json:"denom"` Amount string `json:"amount"` } `json:"value"` } `json:"messages"` } `json:"body"` }
StargateGentx represents the stargate gentx file