Comments (7)
I am not able to reproduce the error. The ping example works fine for me.
Doesn't look like a crate bug.
My system config:
rust version: 1.74.1
libp2p: 0.52
from rust-libp2p.
Could you provide any code? The ping example works fine, but it looks like you may have altered the code. Also, if you are running the code twice on the same machine, make sure the port number is different for each since it would have already been assigned to one address (in this case "65332" is assigned on one node, so it cannot be used on the second node).
from rust-libp2p.
Running
target\debug\p2pRecipe.exe 'C:/Program Files/Git/ip4/127.0.0.1/tcp/65332'
Error: InvalidMultiaddr
This log suggests that the path to the program is also passed as an argument which obviously cannot be parsed as a multiaddress.
from rust-libp2p.
Here is the code:
`
use futures::prelude::*;
use libp2p::{noise, ping, swarm::SwarmEvent, tcp, yamux, Multiaddr};
use std::{error::Error, time::Duration};
use tracing_subscriber::EnvFilter;
#[tokio::main]
async fn main() -> Result<(), Box> {
let _ = tracing_subscriber::fmt()
.with_env_filter(EnvFilter::from_default_env())
.try_init();
let mut swarm = libp2p::SwarmBuilder::with_new_identity()
.with_tokio()
.with_tcp(
tcp::Config::default(),
noise::Config::new,
yamux::Config::default,
)?
.with_behaviour(|_| ping::Behaviour::default())?
.with_swarm_config(|cfg| cfg.with_idle_connection_timeout(Duration::from_secs(u64::MAX)))
.build();
swarm.listen_on("/ip4/0.0.0.0/tcp/0".parse()?)?;
// Dial the peer identified by the multi-address given as the second
// command-line argument, if any.
if let Some(addr) = std::env::args().nth(1) {
let remote: Multiaddr = addr.parse()?;
println!("The input:{:?}", std::env::args().nth(1));
swarm.dial(remote)?;
println!("Dialed {addr}")
}
loop {
match swarm.select_next_some().await {
SwarmEvent::NewListenAddr { address, .. } => println!("Listening on {address:?}"),
SwarmEvent::Behaviour(event) => println!("{event:?}"),
_ => {}
}
}
}
`
On further trying to debug, I got this error:
I was trying the debug(just added a few println statements) and now on running the second peer this is what pops up
error: linking with link.exe failed: exit code: 1104
note: LINK : fatal error LNK1104: cannot open file 'D:\VSCode Rust\p2pRecipe\target\debug\deps\p2pRecipe.exe'
from rust-libp2p.
I don't have a windows machine so I can't reproduce this. Can you use WSL instead?
from rust-libp2p.
Here is the code:
` use futures::prelude::*; use libp2p::{noise, ping, swarm::SwarmEvent, tcp, yamux, Multiaddr}; use std::{error::Error, time::Duration}; use tracing_subscriber::EnvFilter;
#[tokio::main] async fn main() -> Result<(), Box> { let _ = tracing_subscriber::fmt() .with_env_filter(EnvFilter::from_default_env()) .try_init();
let mut swarm = libp2p::SwarmBuilder::with_new_identity() .with_tokio() .with_tcp( tcp::Config::default(), noise::Config::new, yamux::Config::default, )? .with_behaviour(|_| ping::Behaviour::default())? .with_swarm_config(|cfg| cfg.with_idle_connection_timeout(Duration::from_secs(u64::MAX))) .build(); swarm.listen_on("/ip4/0.0.0.0/tcp/0".parse()?)?; // Dial the peer identified by the multi-address given as the second // command-line argument, if any. if let Some(addr) = std::env::args().nth(1) { let remote: Multiaddr = addr.parse()?; println!("The input:{:?}", std::env::args().nth(1)); swarm.dial(remote)?; println!("Dialed {addr}") } loop { match swarm.select_next_some().await { SwarmEvent::NewListenAddr { address, .. } => println!("Listening on {address:?}"), SwarmEvent::Behaviour(event) => println!("{event:?}"), _ => {} } }
} `
On further trying to debug, I got this error:
I was trying the debug(just added a few println statements) and now on running the second peer this is what pops up
error: linking with link.exe failed: exit code: 1104
note: LINK : fatal error LNK1104: cannot open file 'D:\VSCode Rust\p2pRecipe\target\debug\deps\p2pRecipe.exe'
Tried this on a Windows OS setup.
Still not able to reproduce the error. The code works fine, just correcting the return type of the main function
async fn main() -> Result<(), Box<dyn Error>> {...}
like it is in the example.
from rust-libp2p.
Link error looks like a microsoft linker is failing to open the .exe file.
This points to the improper, outdated or no installation of Microsoft Windows SDK.
Try upgrading your downloads from MS Visual studio. @varun-doshi
from rust-libp2p.
Related Issues (20)
- Refactor file-sharing example to use tokio instead of async-std
- `Gossipsub`'s substreams keep all connections alive after `idle_connection_timeout`
- mergify continously approving approved pull requests HOT 6
- WebRTC connection doesn't close after timeout HOT 2
- Promote common dependencies to workspace level
- file-sharing works only on local interface HOT 1
- kad: FIND_NODE not conform to specs HOT 9
- Improve request/response documentation HOT 4
- Compilation on docs.rs is failing
- mdns tokio timer panics HOT 2
- Signature verification fails on handshake if 1024 bit RSA key is used HOT 2
- relay: panics due to unimplemented time in wasm HOT 2
- kad: consume `FromSwarm::NewExternalAddrOfPeer` HOT 14
- Reduce `NewExternalAddrCandidate` reports from `identify`
- kad: make `automatic_bootstrap_interval` publicly configurable
- request-response: Inconsistent documentation.
- request-response: Document request/response max sizes HOT 4
- Active streams affect `yamux::connection::rtt` HOT 10
- rendezvous: Example "discovering with identify" doesn't work HOT 4
- kad: make bucket size configurable HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rust-libp2p.