diff --git a/_pkg.dev/wire/protocol/protocol.go b/_pkg.dev/wire/protocol/protocol.go deleted file mode 100644 index d8b223267..000000000 --- a/_pkg.dev/wire/protocol/protocol.go +++ /dev/null @@ -1,44 +0,0 @@ -package protocol - -//Version represents the latest protocol version for the neo node -type Version uint32 - -const ( - // DefaultVersion is the nodes default protocol version - DefaultVersion Version = 0 - // UserAgent is the nodes user agent or human-readable name - UserAgent = "/NEO-GO/" -) - -// ServiceFlag indicates the services provided by the node. 1 = P2P Full Node -type ServiceFlag uint64 - -// List of Services offered by the node -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 - -// List of possible networks -const ( - MainNet Magic = 7630401 - TestNet Magic = 0x74746e41 -) - -// String implements the stringer interface -func (m Magic) String() string { - switch m { - case MainNet: - return "Mainnet" - case TestNet: - return "Testnet" - default: - return "UnknownNet" - } -} diff --git a/pkg/network/payload/version.go b/pkg/network/payload/version.go index 42d69f451..f5be4b615 100644 --- a/pkg/network/payload/version.go +++ b/pkg/network/payload/version.go @@ -8,6 +8,15 @@ import ( const minVersionSize = 27 +// List of Services offered by the node +const ( + nodePeerService uint64 = 1 + // BloomFilerService uint64 = 2 // Not implemented + // PrunedNode uint64 = 3 // Not implemented + // LightNode uint64 = 4 // Not implemented + +) + // Version payload. type Version struct { // currently the version of the protocol is 0 @@ -32,7 +41,7 @@ type Version struct { func NewVersion(id uint32, p uint16, ua string, h uint32, r bool) *Version { return &Version{ Version: 0, - Services: 1, + Services: nodePeerService, Timestamp: uint32(time.Now().UTC().Unix()), Port: p, Nonce: id,