version — Node handshake data

Version information is exchanged with the remote node upon first connection. It is part of the handshake sequence.

The VersionPayload contains attributes that uniquely identify the node, ensures the node is intended to work on the same network (think Mainnet vs Testnet) and make its capabilities known to the remote node.

class neo3.network.payloads.version.VersionPayload(nonce, user_agent, capabilities)

Bases: neo3.core.serialization.ISerializable

A payload carrying node handshake data.

Create payload.

Parameters
  • nonce (int) – unique number which identifies the node instance.

  • user_agent (str) – node user agent description. e.g. “NEO3-PYTHON-V001”. Max 1024 bytes.

  • capabilities (List[NodeCapability]) – a list of services a node offers.

deserialize(reader)

Deserialize the object from a binary stream.

Parameters

reader (BinaryReader) – instance.

Return type

None

classmethod deserialize_from_bytes(data)

Parse data into an object instance.

Parameters

data (Union[bytes, bytearray]) – hex escaped bytes.

Return type

~ISerializable_T

Returns

a deserialized instance of the class.

serialize(writer)

Serialize the object into a binary stream.

Parameters

writer (BinaryWriter) – instance.

Return type

None

to_array()

Serialize the object into a bytearray.

Return type

bytes

MAX_CAPABILITIES = 32
capabilities

A list of services a node offers. See capabilities

magic

A network id. Differs for NEO’s Mainnet (use 5195086) and Testnet (use 1951352142).

Reference nodes will disconnect if the value doesn’t match with their local settings.

nonce

A unique identifier for the node.

timestamp

The UTC time when the node connected

user_agent

A node client description i.e. “NEO-MAMBA-V001”

version

Protocol version of the node