Skip to content
This repository has been archived by the owner on Oct 23, 2022. It is now read-only.

can not run example fetch_and_cat #513

Open
conanchen opened this issue Sep 22, 2022 · 2 comments
Open

can not run example fetch_and_cat #513

conanchen opened this issue Sep 22, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@conanchen
Copy link

Describe the bug

  1. When I tried to run the example as below:
    ❯ cargo run --example fetch_and_cat -- --default-bootstrappers bafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi

To Reproduce
2. console log:
Blocking waiting for file lock on package cache
Blocking waiting for file lock on package cache
Blocking waiting for file lock on package cache
Compiling ipfs v0.2.1 (/Users/CC/github/rs-ipfs/rust-ipfs)
Finished dev [unoptimized + debuginfo] target(s) in 8.47s
Running target/debug/examples/fetch_and_cat --default-bootstrappers bafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi
... restore_bootstrappers

Expected behavior
the example can fetch the file ( bafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi ) from ipfs network:

Environment (please complete the following information)

  • macos
  • Rust version: rustc 1.66.0-nightly (a37499ae6 2022-09-18)

Additional context

  1. update the cargo.toml with latest dependencies e.g. libp2p with 0.48.0
  2. cargo run the example , there are compile errors
❯ cargo run --example fetch_and_cat -- --default-bootstrappers  bafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi
   Compiling ipfs v0.2.1 (/Users/CC/github/rs-ipfs/rust-ipfs)
error[E0432]: unresolved import `libp2p::swarm::NetworkBehaviourEventProcess`
  --> src/p2p/behaviour.rs:19:39
   |
19 | use libp2p::swarm::{NetworkBehaviour, NetworkBehaviourEventProcess};
   |                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `NetworkBehaviourEventProcess` in the root

error[E0432]: unresolved import `libp2p::core::connection::ListenerId`
  --> src/p2p/pubsub.rs:11:48
   |
11 |     connection::{ConnectedPoint, ConnectionId, ListenerId},
   |                                                ^^^^^^^^^^ no `ListenerId` in `connection`

error[E0432]: unresolved import `libp2p::tcp::TokioTcpConfig`
 --> src/p2p/transport.rs:9:5
  |
9 | use libp2p::tcp::TokioTcpConfig;
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `TokioTcpConfig` in the root

error[E0432]: unresolved import `libp2p::core::connection::ListenerId`
  --> src/lib.rs:93:9
   |
93 |         connection::ListenerId, multiaddr::multiaddr, multiaddr::Protocol, Multiaddr, PeerId,
   |         ^^^^^^^^^^^^^^^^^^^^^^ no `ListenerId` in `connection`

For more information about this error, try `rustc --explain E0432`.
error: could not compile `ipfs` due to 4 previous errors

@conanchen conanchen added the bug Something isn't working label Sep 22, 2022
@koivunej
Copy link
Collaborator

Thanks for letting us know. We are currently sunsetting the project though, please see #512. You may have more luck with the latest version from master branch. I've already yanked all of the releases.

@dariusc93
Copy link

Hey @conanchen. The issue is that rust-ipfs isnt updated for libp2p v0.48. There has been breaking changes done. I do have it working on my own fork at https://github.com/dariusc93/rust-ipfs but you might want to fork off of it since I have been doing passive maintenance on it, while also making changes as an experiment, but overall it does work with the latest libp2p (which also do work with that example) and do try to keep it up dated with it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants