module
neo3.network.message
P2P network message classes.
Classes
Message
— P2P network message container.
class
neo3.network.message.
Message
(
msg_type
, payload=None
)
Bases
neo3.core.serialization.ISerializable
P2P network message container.
Attributes
type
(MessageType) — MessageType: an identifier specifying the purpose of the message.
Methods
__len__
(
)
— 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__
(
)
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.
enum
neo3.network.message.
MessageConfig
(
)
Bases
enum.IntFlag
int
enum.Flag
enum.Enum
P2P network message config flags.
Members
COMPRESSED
(int) — 0x1NONE
(int) — 0x0
enum
neo3.network.message.
MessageType
(
)
Bases
enum.IntEnum
int
enum.Enum
P2P network message types.
Members
ADDR
(int) — 0x11ALERT
(int) — 0x40BLOCK
(int) — 0x2cCONSENSUS
(int) — 0x2dDEFAULT
(int) — 0xffEXTENSIBLE
(int) — 0x2eFILTERADD
(int) — 0x31FILTERCLEAR
(int) — 0x32FILTERLOAD
(int) — 0x30GETADDR
(int) — 0x10GETBLOCKBYINDEX
(int) — 0x29GETBLOCKS
(int) — 0x24GETDATA
(int) — 0x28GETHEADERS
(int) — 0x20HEADERS
(int) — 0x21INV
(int) — 0x27MEMPOOL
(int) — 0x25MERKLEBLOCK
(int) — 0x38NOTFOUND
(int) — 0x2aPING
(int) — 0x18PONG
(int) — 0x19REJECT
(int) — 0x2fTRANSACTION
(int) — 0x2bVERACK
(int) — 0x1VERSION
(int) — 0x0