-
Hi, I'm playing with rust and libp2p but most of the time I see myself changing the code in examples to work in my personal project. The examples work fine in the rust-libp2p project itself but when I try it in a different project with my For example, in the example gossip-chat it gives me a dependecy error:
an some methods not publics errors:
and a method not found method:
while my Cargo has these dependencies: [package]
name = "rust-learning"
version = "0.1.0"
authors = ["OnikenX <[email protected]>"]
edition = "2018"
[[bin]]
name = "gossipsub-chat"
path = "src/gossipsub-chat.rs"
[dependencies]
async-std = { version = "1.9.0", features = ["attributes"] }
futures = "0.3.14"
libp2p = { version = "0.36.0", features = ["tcp-tokio", "mdns", "floodsub", "mplex", "noise", "gossipsub", "deflate", "dns-async-std", "floodsub", "identify", "kad", "gossipsub", "mdns", "mplex", "noise", "ping", "plaintext", "pnet", "relay", "request-response", "secp256k1", "tcp-async-io", "uds", "wasm-ext", "websocket", "yamux", ] }
tokio = { version = "*", features = ["io-util", "io-std", "stream", "macros", "rt", "rt-multi-thread", "fs", "time", "sync"] }
serde = { version = "1.0.125", features = ["derive"] }
serde_json = "1.0.64"
once_cell = "1.7.2"
log = "0.4.14"
pretty_env_logger = "0.4.0"
env_logger = "0.8.3" I've been copying some dependencies from the main I'm also new in rust this can be my ignorance on rust and cargo and nothing to do with libp2p itself, if someone can give me advice I would appreciate it very much and probably anyone who ends up here, if this is a common problem please give us an example Thank you in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Looks like I was using the master branch of the examples in my project when I was using the v0.36 package 😅 |
Beta Was this translation helpful? Give feedback.
Looks like I was using the master branch of the examples in my project when I was using the v0.36 package 😅
that was the only problem, basically for someone with the same problem change the repo version to the tag that is the same for your dependency.