chainid

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2023 License: Apache-2.0 Imports: 4 Imported by: 4

Documentation

Overview

Package chainid defines helper methods to manipulate and verify chain id used in Cosmos-SDK blockchain genesis

Index

Constants

View Source
const (
	ChainIDSeparator   = "-"
	ChainNameMaxLength = 30
)

Variables

View Source
var ErrInvalidChainID = errors.New("invalid chain ID, format must be <chain-name>-<network-number>")

Functions

func CheckChainName

func CheckChainName(chainName string) error

CheckChainName verifies the name is valid as a chain name

func NewGenesisChainID

func NewGenesisChainID(chainName string, networkNumber uint64) string

NewGenesisChainID returns the genesis chain id from the chain name and the number

func ParseGenesisChainID

func ParseGenesisChainID(genesisChainID string) (string, uint64, error)

ParseGenesisChainID returns the chain name and the number from the chain ID The chain ID follows the format <ChainName>-<Number> The function returns an error if the chain ID is invalid

Types

This section is empty.

Jump to

Keyboard shortcuts

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