12 breaking releases

0.28.1 Nov 4, 2024
0.27.0 Oct 21, 2024
0.21.0 Jul 22, 2024

#138 in Algorithms

Download history 839/week @ 2024-08-03 1102/week @ 2024-08-10 784/week @ 2024-08-17 367/week @ 2024-08-24 789/week @ 2024-08-31 209/week @ 2024-09-07 684/week @ 2024-09-14 313/week @ 2024-09-21 632/week @ 2024-09-28 325/week @ 2024-10-05 509/week @ 2024-10-12 995/week @ 2024-10-19 355/week @ 2024-10-26 1098/week @ 2024-11-02 359/week @ 2024-11-09 220/week @ 2024-11-16

2,185 downloads per month
Used in 6 crates (3 directly)

MIT/Apache

635KB
13K SLoC

iroh-blobs

This crate provides blob and collection transfer support for iroh. It implements a simple request-response protocol based on blake3 verified streaming.

A request describes data in terms of blake3 hashes and byte ranges. It is possible to request blobs or ranges of blobs, as well as collections.

The requester opens a quic stream to the provider and sends the request. The provider answers with the requested data, encoded as blake3 verified streams, on the same quic stream.

This crate is usually used together with iroh-net, but can also be used with normal quinn connections. Connection establishment is left up to the user or a higher level APIs such as the iroh CLI.

Concepts

  • Blob: a sequence of bytes of arbitrary size, without any metadata.

  • Link: a 32 byte blake3 hash of a blob.

  • HashSeq: a blob that contains a sequence of links. Its size is a multiple of 32.

  • Provider: The side that provides data and answers requests. Providers wait for incoming requests from Requests.

  • Requester: The side that asks for data. It is initiating requests to one or many providers.

Examples

Examples that use iroh-blobs can be found in the iroh crate. the iroh crate publishes iroh_blobs as iroh::bytes.

License

This project is licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~47–83MB
~1.5M SLoC