neoneo-go/pkg/config/netmode/netmode.go
Roman Khimov c1b2a79cfe netmode: use proper testnet magic number
Preview5 network used 'N3P5' as its magic, but the official testnet magic is
still 'NEOt', that's the way it's defined in neo-node, so use that.
2021-03-19 16:18:45 +03:00

33 lines
849 B
Go

package netmode
import "strconv"
const (
// MainNet contains magic code used in the NEO main official network.
MainNet Magic = 0x004f454e // 5195086
// TestNet contains magic code used in the NEO testing network.
TestNet Magic = 0x744f454e // 1951352142
// 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)
}
}