constants

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2021 License: BSD-3-Clause Imports: 6 Imported by: 1

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 (
	// NodeIDPrefix is used to denote node addresses rather than other
	// addresses.
	NodeIDPrefix string = "NodeID-"

	// SecretKeyPrefix is used to denote secret keys rather than other byte
	// arrays.
	SecretKeyPrefix string = "PrivateKey-"
)
View Source
const (
	// PlatformName exports the name of the platform
	PlatformName = "flare"

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

Const variables to be exported

View Source
const (
	// DefaultHealthCheckExecutionPeriod is the default time between
	// executions of a health check function
	DefaultHealthCheckExecutionPeriod = 1 * time.Minute

	// DefaultHealthCheckInitialDelay ...
	DefaultHealthCheckInitialDelay = 10 * time.Second

	// MinConnectedStake is the minimum percentage of the Primary Network's
	// that this node must be connected to to be considered healthy
	MinConnectedStake = float64(.80)
)
View Source
const (
	FlareID    uint32 = 1
	SongbirdID uint32 = 5
	CostonID   uint32 = 7
	TestingID  uint32 = 10
	LocalID    uint32 = 12345

	FlareName    = "flare"
	SongbirdName = "songbird"
	CostonName   = "coston"
	TestingName  = "testing"
	LocalName    = "local"

	FlareHRP    = "flare"
	SongbirdHRP = "songbird"
	CostonHRP   = "coston"
	TestingHRP  = "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 = math.MaxUint32
)

Const variables to be exported

Variables

View Source
var (
	PrimaryNetworkID = ids.Empty
	PlatformChainID  = ids.Empty

	NetworkIDToNetworkName = map[uint32]string{
		FlareID:    FlareName,
		SongbirdID: SongbirdName,
		CostonID:   CostonName,
		TestingID:  TestingName,
		LocalID:    LocalName,
	}
	NetworkNameToNetworkID = map[string]uint32{
		FlareName:    FlareID,
		SongbirdName: SongbirdID,
		CostonName:   CostonID,
		TestingName:  TestingID,
		LocalName:    LocalID,
	}

	NetworkIDToHRP = map[uint32]string{
		FlareID:    FlareHRP,
		SongbirdID: SongbirdHRP,
		CostonID:   CostonHRP,
		TestingID:  TestingHRP,
		LocalID:    LocalHRP,
	}
	NetworkHRPToNetworkID = map[string]uint32{
		FlareHRP:    FlareID,
		SongbirdHRP: SongbirdID,
		CostonHRP:   CostonID,
		TestingHRP:  TestingID,
		LocalHRP:    LocalID,
	}

	ValidNetworkPrefix = "network-"
)

Variables to be exported

Functions

func GetHRP

func GetHRP(networkID uint32) string

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

func NetworkID

func NetworkID(networkName string) (uint32, error)

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

func NetworkName

func NetworkName(networkID uint32) string

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

Types

type MsgType

type MsgType byte
const (
	NullMsg MsgType = iota
	GetAcceptedFrontierMsg
	AcceptedFrontierMsg
	GetAcceptedFrontierFailedMsg
	GetAcceptedMsg
	AcceptedMsg
	GetAcceptedFailedMsg
	GetMsg
	PutMsg
	GetFailedMsg
	PushQueryMsg
	PullQueryMsg
	ChitsMsg
	QueryFailedMsg
	ConnectedMsg
	DisconnectedMsg
	NotifyMsg
	GossipMsg
	GetAncestorsMsg
	MultiPutMsg
	GetAncestorsFailedMsg
	TimeoutMsg
)

func (MsgType) String

func (t MsgType) String() string

Jump to

Keyboard shortcuts

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