config: move NetMode into its own micropackage
It's going to be used a bit more and pulling whole config just for one type is a bit wrong.
This commit is contained in:
parent
6eb600de5a
commit
26f11a52d9
12 changed files with 61 additions and 51 deletions
31
pkg/config/netmode/netmode.go
Normal file
31
pkg/config/netmode/netmode.go
Normal file
|
@ -0,0 +1,31 @@
|
|||
package netmode
|
||||
|
||||
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 = 0
|
||||
)
|
||||
|
||||
// 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 unknown"
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue