Skip to content
module

neo3.network.payloads.ping

Heartbeat payload with chain height information.

Classes
  • PingPayload An interface like class supporting NEO's network serialization protocol.
class

neo3.network.payloads.ping.PingPayload(height=0)

Bases
neo3.core.serialization.ISerializable

An interface like class supporting NEO's network serialization protocol.

Attributes
  • current_height The current local chain height
  • nonce Random number
  • timestamp The local time in UTC as a timestamp
Methods
  • __len__() (int) Get the total size in bytes of the object.
  • deserialize(reader) Deserialize the object from a binary stream.
  • serialize(writer) Serialize the object into a binary stream.
  • to_array() (bytes) Serialize the object into a bytearray.
  • deserialize_from_bytes(data) (ISerializable_T) Parse data into an object instance.
classmethod

deserialize_from_bytes(data)

Parse data into an object instance.

Parameters
  • data (bytes | bytearray) hex escaped bytes.
Returns (ISerializable_T)

a deserialized instance of the class.

method

to_array() → bytes

Serialize the object into a bytearray.

method

__len__() → int

Get the total size in bytes of the object.

method

deserialize(reader)

Deserialize the object from a binary stream.

Parameters
  • reader (BinaryReader) instance.
method

serialize(writer)

Serialize the object into a binary stream.

Parameters
  • writer (BinaryWriter) instance.