2019-02-25 22:44:14 +00:00
|
|
|
package protocol
|
|
|
|
|
2019-03-17 18:26:35 +00:00
|
|
|
//Version represents the latest protocol version for the neo node
|
2019-02-25 22:44:14 +00:00
|
|
|
type Version uint32
|
|
|
|
|
|
|
|
const (
|
2019-03-17 18:26:35 +00:00
|
|
|
// DefaultVersion is the nodes default protocol version
|
2019-02-25 22:44:14 +00:00
|
|
|
DefaultVersion Version = 0
|
2019-03-17 18:26:35 +00:00
|
|
|
// UserAgent is the nodes user agent or human-readable name
|
|
|
|
UserAgent = "/NEO-GO/"
|
2019-02-25 22:44:14 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// ServiceFlag indicates the services provided by the node. 1 = P2P Full Node
|
|
|
|
type ServiceFlag uint64
|
|
|
|
|
2019-03-17 18:26:35 +00:00
|
|
|
// List of Services offered by the node
|
2019-02-25 22:44:14 +00:00
|
|
|
const (
|
|
|
|
NodePeerService ServiceFlag = 1
|
|
|
|
// BloomFilerService ServiceFlag = 2 // Not implemented
|
|
|
|
// PrunedNode ServiceFlag = 3 // Not implemented
|
|
|
|
// LightNode ServiceFlag = 4 // Not implemented
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
// Magic is the network that NEO is running on
|
|
|
|
type Magic uint32
|
|
|
|
|
2019-03-17 18:26:35 +00:00
|
|
|
// List of possible networks
|
2019-02-25 22:44:14 +00:00
|
|
|
const (
|
|
|
|
MainNet Magic = 7630401
|
|
|
|
TestNet Magic = 0x74746e41
|
|
|
|
)
|
2019-03-23 16:57:05 +00:00
|
|
|
|
|
|
|
// String implements the stringer interface
|
|
|
|
func (m Magic) String() string {
|
|
|
|
switch m {
|
|
|
|
case MainNet:
|
|
|
|
return "Mainnet"
|
|
|
|
case TestNet:
|
|
|
|
return "Testnet"
|
|
|
|
default:
|
|
|
|
return "UnknownNet"
|
|
|
|
}
|
|
|
|
}
|