Skip to main content

Module node_batch

Module node_batch 

Source
Expand description

A batched node request between peers that both answer it (engine 0.2.1, bsv-overlay-cloudflare #58).

POST /requestForeignGASPNodes takes up to NODE_BATCH_MAX_OUTPOINTS outpoints and answers their nodes in one body of at most NODE_BATCH_MAX_BYTES. Each entry names its outpoint and carries either the node, as /requestForeignGASPNode answers it, or a refusal word. The route is ours: a reference peer answers it 404 and is asked one node at a time, as before (overlay-services@480d77a src/GASP/OverlayGASPRemote.ts has the single request only).

What the sync does with an answer is in GASPSync::prefetched_root: every entry feeds the same code a single answer feeds.

Modules§

refusal
The words of a per-entry refusal.

Structs§

BatchOutpoint
One outpoint of a batch request.
NodeBatch
What a remote received for one batch request: the answer and the bytes of its body, which the sync holds to NODE_BATCH_MAX_BYTES.
NodeBatchAnswer
The answer of POST /requestForeignGASPNodes. An outpoint the byte budget left out has no entry; the asker names it again in its next body.
NodeBatchEntry
One entry of a batch answer: the node, or a refusal word.
NodeBatchRequest
The body of POST /requestForeignGASPNodes.

Constants§

NODE_BATCH_MAX_BYTES
The most bytes one batch answer may carry, its JSON envelope included.
NODE_BATCH_MAX_OUTPOINTS
The most outpoints one batch request may name; a request over it is answered 400 with this number in the body.