referrerpolicy=no-referrer-when-downgrade

Module bitswap

Module bitswap 

Source
Expand description

Bitswap server for Substrate.

Supports querying indexed transactions by hash over the standard bitswap protocol (v1.2.0). CIDs must reference a supported 256-bit transaction hash.

Modules§

schema
Bitswap protobuf schema, generated from the protocol definitions. Include sources generated from protobuf definitions.

Structs§

Prefix
CID metadata without the actual content bytes.

Enums§

BitswapError
Bitswap client errors.
FetchOutcome
Per-CID outcome from a Bitswap block request.

Constants§

BLAKE2B_256_MULTIHASH_CODE
Const from https://github.com/multiformats/multicodec/blame/master/table.csv Multihash code for BLAKE2b-256.
KECCAK_256_MULTIHASH_CODE
Multihash code for Keccak-256.
MAX_WANTED_BLOCKS
Max number of blocks per wantlist.
RAW_CODEC
IPFS raw multicodec used for indexed transaction payload bytes.
SHA2_256_MULTIHASH_CODE
Multihash code for SHA2-256.

Functions§

is_cid_supported
Check if a CID is supported by the bitswap protocol — CIDv1, 32-byte digest, with a supported multihash code (Blake2b-256, SHA2-256, or Keccak-256).
request_bitswap_blocks
Send one WANT-BLOCK request for cids to peer and classify the response.
request_bitswap_blocks_unverified
Like request_bitswap_blocks, but does not recompute or verify the hash of received bytes.

Type Aliases§

Cid
A Cid that contains a multihash with an allocated size of 512 bits.