2020-06-14 07:34:50 +00:00
|
|
|
package netmode
|
|
|
|
|
2020-06-14 19:38:43 +00:00
|
|
|
import "strconv"
|
|
|
|
|
2020-06-14 07:34:50 +00:00
|
|
|
const (
|
2022-12-07 13:51:03 +00:00
|
|
|
// MainNet contains magic code used in the Neo main official network.
|
2021-07-21 09:32:22 +00:00
|
|
|
MainNet Magic = 0x334f454e // NEO3
|
2022-12-07 13:51:03 +00:00
|
|
|
// TestNet contains magic code used in the Neo testing network.
|
2022-05-03 20:27:06 +00:00
|
|
|
TestNet Magic = 0x3554334e // N3T5
|
2022-12-07 13:51:03 +00:00
|
|
|
// PrivNet contains magic code usually used for Neo private networks.
|
2020-06-14 07:34:50 +00:00
|
|
|
PrivNet Magic = 56753 // docker privnet
|
|
|
|
// UnitTestNet is a stub magic code used for testing purposes.
|
2020-06-14 19:40:52 +00:00
|
|
|
UnitTestNet Magic = 42
|
2024-07-31 03:02:17 +00:00
|
|
|
//MainNetNeoFS contains magic code used in the NeoFS main network.
|
|
|
|
MainNetNeoFS Magic = 0x572dfa5 // NeoFS mainnet
|
|
|
|
//TestNetNeoFS contains magic code used in the NeoFS test network.
|
|
|
|
TestNetNeoFS Magic = 0x2bdb2b5f // NeoFS testnet
|
2020-06-14 07:34:50 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// 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"
|
2024-07-31 03:02:17 +00:00
|
|
|
case MainNetNeoFS:
|
|
|
|
return "mainnet.neofs"
|
|
|
|
case TestNetNeoFS:
|
|
|
|
return "testnet.neofs"
|
2020-06-14 07:34:50 +00:00
|
|
|
default:
|
2020-06-14 19:38:43 +00:00
|
|
|
return "net 0x" + strconv.FormatUint(uint64(n), 16)
|
2020-06-14 07:34:50 +00:00
|
|
|
}
|
|
|
|
}
|