Module grin_p2p::msg

source ·
Expand description

Message types that transit over the network and related serialization code.

Structs§

  • Ask for other peers addresses, required for network discovery.
  • First part of a handshake, sender advertises its version and characteristics.
  • Serializable wrapper for a list of block headers.
  • We receive 512 headers from a peer. But we process them in smaller batches of 32 headers. HeadersData wraps the current batch and a count of the headers remaining after this batch.
  • Serializable wrapper for the block locator.
  • Header of any protocol message, used to identify incoming messages.
  • Response to an output bitmap MMR segment request.
  • Response to an output PMMR segment request.
  • Peer addresses we know of that are fresh enough, in response to GetPeerAddrs.
  • We found some issue in the communication, sending an error back, usually followed by closing the connection.
  • Request to get a segment of a (P)MMR at a particular block.
  • Response to a (P)MMR segment request.
  • Second part of a handshake, receiver of the first part replies with its own version and characteristics.
  • Response to a txhashset archive request, must include a zip stream of the archive after the message body.
  • Request to get an archive of the full txhashset store, required to sync a new node.

Enums§

  • A wrapper around a message header. If the header is for an unknown msg type then we will be unable to parse the msg itself (just a bunch of random bytes). But we need to know how many bytes to discard to discard the full message.

Constants§

  • Grin’s user agent with current version

Functions§

  • Read a message body from the provided stream, always blocking until we have a result (or timeout).
  • Read (an unknown) message from the provided stream and discard it.
  • Read a header from the provided stream without blocking if the underlying stream is async. Typically headers will be polled for, so we do not want to block.
  • Read a single item from the provided stream, always blocking until we have a result (or timeout). Returns the item and the total bytes read.
  • Reads a full message from the underlying stream.