neoneo-go/pkg/config/netmode/netmode.go

34 lines
840 B
Go
Raw Normal View History

package netmode
import "strconv"
const (
2022-12-07 13:51:03 +00:00
// MainNet contains magic code used in the Neo main official network.
MainNet Magic = 0x334f454e // NEO3
2022-12-07 13:51:03 +00:00
// TestNet contains magic code used in the Neo testing network.
TestNet Magic = 0x3554334e // N3T5
2022-12-07 13:51:03 +00:00
// PrivNet contains magic code usually used for Neo private networks.
PrivNet Magic = 56753 // docker privnet
// UnitTestNet is a stub magic code used for testing purposes.
UnitTestNet Magic = 42
)
// Magic describes the network the blockchain will operate on.
type Magic uint32
// String implements the stringer interface.
func (n Magic) String() string {
switch n {
case PrivNet:
return "privnet"
case TestNet:
return "testnet"
case MainNet:
return "mainnet"
case UnitTestNet:
return "unit_testnet"
default:
return "net 0x" + strconv.FormatUint(uint64(n), 16)
}
}