Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example code gives error #49

Open
hbaklan943 opened this issue Jan 19, 2025 · 1 comment
Open

Example code gives error #49

hbaklan943 opened this issue Jan 19, 2025 · 1 comment

Comments

@hbaklan943
Copy link

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
@Arqu Arqu added this to iroh Jan 19, 2025
@matheus23
Copy link
Member

matheus23 commented Jan 20, 2025

Thanks for letting us know!

You need to enable the rpc feature for iroh-blobs.
You can do this by running cargo add iroh-blobs --features rpc in the file-transfer directory.

I've edited the quickstart instructions to make this clearer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

2 participants