github.com/nspcc-dev/neo-go@v0.105.2-0.20240517133400-6be757af3eba/pkg/config/netmode/netmode.go (about)

     1  package netmode
     2  
     3  import "strconv"
     4  
     5  const (
     6  	// MainNet contains magic code used in the Neo main official network.
     7  	MainNet Magic = 0x334f454e // NEO3
     8  	// TestNet contains magic code used in the Neo testing network.
     9  	TestNet Magic = 0x3554334e // N3T5
    10  	// PrivNet contains magic code usually used for Neo private networks.
    11  	PrivNet Magic = 56753 // docker privnet
    12  	// UnitTestNet is a stub magic code used for testing purposes.
    13  	UnitTestNet Magic = 42
    14  )
    15  
    16  // Magic describes the network the blockchain will operate on.
    17  type Magic uint32
    18  
    19  // String implements the stringer interface.
    20  func (n Magic) String() string {
    21  	switch n {
    22  	case PrivNet:
    23  		return "privnet"
    24  	case TestNet:
    25  		return "testnet"
    26  	case MainNet:
    27  		return "mainnet"
    28  	case UnitTestNet:
    29  		return "unit_testnet"
    30  	default:
    31  		return "net 0x" + strconv.FormatUint(uint64(n), 16)
    32  	}
    33  }