constants

package
v1.7.11-rc.23 Latest Latest
Warning

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

Go to latest
Published: May 19, 2022 License: BSD-3-Clause Imports: 7 Imported by: 264

Documentation

Index

Constants

View Source
const (
	// ChainAliasPrefix denotes a prefix for an alias that belongs to a blockchain ID.
	ChainAliasPrefix string = "bc/"

	// VMAliasPrefix ddenotes a prefix for an alias that belongs to a VM ID.
	VMAliasPrefix string = "vm/"
)
View Source
const (
	// PlatformName exports the name of the platform
	PlatformName = "avalanche"

	// AppName exports the name of the avalanche application
	AppName = "avalanchego"
)

Const variables to be exported

View Source
const (
	MainnetID uint32 = 1
	CascadeID uint32 = 2
	DenaliID  uint32 = 3
	EverestID uint32 = 4
	FujiID    uint32 = 5

	TestnetID  uint32 = FujiID
	UnitTestID uint32 = 10
	LocalID    uint32 = 12345

	MainnetName  = "mainnet"
	CascadeName  = "cascade"
	DenaliName   = "denali"
	EverestName  = "everest"
	FujiName     = "fuji"
	TestnetName  = "testnet"
	UnitTestName = "testing"
	LocalName    = "local"

	MainnetHRP  = "avax"
	CascadeHRP  = "cascade"
	DenaliHRP   = "denali"
	EverestHRP  = "everest"
	FujiHRP     = "fuji"
	UnitTestHRP = "testing"
	LocalHRP    = "local"
	FallbackHRP = "custom"
)

Const variables to be exported

View Source
const (
	// Request ID used when sending a Put message to gossip an accepted container
	// (ie not sent in response to a Get)
	GossipMsgRequestID uint32 = math.MaxUint32

	// The network must be "tcp", "tcp4", "tcp6", "unix" or "unixpacket".
	NetworkType = "tcp"

	DefaultMaxMessageSize  = 2 * units.MiB
	DefaultPingPongTimeout = 30 * time.Second
	DefaultPingFrequency   = 3 * DefaultPingPongTimeout / 4
	DefaultByteSliceCap    = 128

	MaxContainersLen = int(4 * DefaultMaxMessageSize / 5)
)

Const variables to be exported

View Source
const SecretKeyPrefix string = "PrivateKey-"

SecretKeyPrefix is used to denote secret keys rather than other byte arrays.

Variables

Variables to be exported

View Source
var (
	PlatformVMID = ids.ID{'p', 'l', 'a', 't', 'f', 'o', 'r', 'm', 'v', 'm'}
	AVMID        = ids.ID{'a', 'v', 'm'}
	EVMID        = ids.ID{'e', 'v', 'm'}
)

Functions

func GetHRP

func GetHRP(networkID uint32) string

GetHRP returns the Human-Readable-Part of bech32 addresses for a networkID

func NetworkID added in v1.0.0

func NetworkID(networkName string) (uint32, error)

NetworkID returns the ID of the network with name [networkName]

func NetworkName added in v1.0.0

func NetworkName(networkID uint32) string

NetworkName returns a human readable name for the network with ID [networkID]

Types

This section is empty.

Jump to

Keyboard shortcuts

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