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.
Enums§
- Bitswap
Error - Bitswap client errors.
- Fetch
Outcome - Per-CID outcome from a Bitswap block request.
Constants§
- BLAK
E2B_ 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-BLOCKrequest forcidstopeerand 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.