Skip to content

Example code gives error #49

@hbaklan943

Description

@hbaklan943

https://github.com/n0-computer/iroh-blobs/blob/030420e7fa03c80b44491f8da16b993f4015007f/examples/transfer.rs

I was redirected to this file from: https://www.iroh.computer/docs/quickstart#what-we-ll-build

When I run cargo run it says:

   Compiling file-transfer v0.1.0 (/home/file-transfer)
error[E0433]: failed to resolve: could not find `rpc` in `iroh_blobs`
  --> src/main.rs:7:5
   |
7  |     rpc::client::blobs::{ReadAtLen, WrapOption},
   |     ^^^ could not find `rpc` in `iroh_blobs`
   |
note: found an item that was configured out
  --> /home/.cargo/registry/src/index.crates.io-6f17d22bba15001f/iroh-blobs-0.31.0/src/lib.rs:45:9
   |
45 | pub mod rpc;
   |         ^^^
note: the item is gated behind the `rpc` feature
  --> /home/.cargo/registry/src/index.crates.io-6f17d22bba15001f/iroh-blobs-0.31.0/src/lib.rs:44:7
   |
44 | #[cfg(feature = "rpc")]
   |       ^^^^^^^^^^^^^^^

error[E0599]: no method named `client` found for struct `Blobs` in the current scope
  --> src/main.rs:29:23
   |
29 |     let blobs = blobs.client();
   |                       ^^^^^^ method not found in `Blobs<Store>`

Some errors have detailed explanations: E0433, E0599.
For more information about an error, try `rustc --explain E0433`.
error: could not compile `file-transfer` (bin "file-transfer") due to 2 previous errors

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions