Skip to main content

Module ant_protocol

Module ant_protocol 

Source
Expand description

Wire protocol re-exports from the ant_protocol crate.

This module existed as first-party ant-node code until version 0.11. The wire contract now lives in the ant_protocol crate so ant-client and ant-node can evolve their release cycles independently. Everything this module previously exported is re-exported below verbatim, including the chunk submodule path so downstream callers of ant_node::ant_protocol::chunk::* keep working.

Internal ant-node code can keep using crate::ant_protocol::…; the imports resolve to the same types they always did. New code should prefer ant_protocol::… directly.

Modules§

chunk
Chunk message types for the ANT protocol.

Structs§

ChunkGetOrCloserRequest
Request a chunk, or the responder’s closest peers to it when it does not hold the chunk.
ChunkGetRequest
Request to retrieve a chunk.
ChunkMessage
Wire-format wrapper that pairs a sender-assigned request_id with a ChunkMessageBody.
ChunkPutRequest
Request to store a chunk.
ChunkQuoteRequest
Request a storage quote for a chunk.
ChunkQuoteRequestV2
Request a storage quote, declaring the settlement rules the client pays under.
MerkleCandidateQuoteRequest
Request a merkle candidate quote for batch payments.
MerkleCandidateQuoteRequestV2
Request a merkle candidate quote, declaring the settlement rules the client pays under.

Enums§

ChunkGetOrCloserResponse
Response to a get-or-closer request.
ChunkGetResponse
Response to a GET request.
ChunkMessageBody
Enum of all chunk protocol message types.
ChunkPutResponse
Response to a PUT request.
ChunkQuoteResponse
Response with a storage quote.
MerkleCandidateQuoteResponse
Response with a merkle candidate quote.
ProtocolError
Errors that can occur during protocol operations.
SettlementCompatibility
Whether a storer on this build can promise to accept what a client settling under client_version will pay.

Constants§

CHUNK_PROTOCOL_ID
Protocol identifier for chunk operations.
CLOSE_GROUP_MAJORITY
Minimum number of close group members that must agree for a decision to be valid.
CLOSE_GROUP_SIZE
Number of nodes in a Kademlia close group.
CURRENT_SETTLEMENT_VERSION
Settlement rules this build pays and verifies under.
DATA_TYPE_CHUNK
Data type identifier for chunks.
GET_OR_CLOSER_AGENT_TOKEN
User-agent token a node announces when it answers ChunkMessageBody::GetOrCloserRequest (ant-node ADR-0020).
MAX_CHUNK_SIZE
Maximum chunk size in bytes (4MB).
MAX_WIRE_MESSAGE_SIZE
Maximum wire message size in bytes (5MB).
MIN_SUPPORTED_SETTLEMENT_VERSION
Oldest settlement version this build will issue a quote for.
PROOF_TAG_MERKLE
Version byte prefix for merkle payment proofs.
PROOF_TAG_SINGLE_NODE
Version byte prefix for payment proof serialization. Allows the verifier to detect proof type before deserialization.
PROTOCOL_VERSION
Current protocol version.
XORNAME_LEN
Byte length of an XorName.

Functions§

advertises_get_or_closer
Whether a peer’s user agent says it answers ChunkMessageBody::GetOrCloserRequest.
settlement_compatibility
Can a storer on this build safely quote a client settling under client_version?

Type Aliases§

XorName
Content-addressed identifier (32 bytes).