-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Error: no valid addresses were provided for transports #2779
Comments
Are you running in Node.js or the browser or somewhere else? What swarm addresses do you have configured? ipfs.config.get(‘Addresses.Swarm’). I’m guessing you have a websocket-star address or something in there. |
I found the "issue" 😅 I'm connecting to a peer (swarm) after I called If I pass an empty swarm list to create, as follows, it does work: Ipfs.create({ config: { Addresses: { Swarm: [] } } })
await ipfs.swarm.connect(...) Previously I didn't have to pass this empty list to create. What do you think @alanshaw? Is the new behaviour better, is this confusing, is this just edge-case, or am I not using this as intended? Thanks ✌️ PS. I'm running this in the browser using the minified unpkg distribution. |
I think by using that config you removed the websocket-star address you previously had saved in @jacobheun do you think this startup error should be downgraded to a warning? |
@alanshaw yes, I think so, this shouldn't be a fatal error. The available startup addresses don't have any transports so it will fail to connect, however, performing a manual connect will still work. The important thing to note is that your node will be dial only. We need to make this a configurable option in libp2p in case people want the overt error, but we can configure js-ipfs (node, browser or both) to be more lenient. I created an issue in libp2p, libp2p/js-libp2p#575, to track this. |
im having this issue in 0.41.2 version. what is the solution, how can i use swarm addresses? |
FYI, I will be working on the libp2p/js-libp2p#575 next week. We aim to get a better explanation for this error and configure it to be more lenient. @woss regarding your issue. You are probably using a For now, if you want to use ipfs in a browser environment, you should rely on |
@vasco-santos on a small tangent, is there any way to tell if the |
@5310 you should try to connect to it and handle the failure if it doesn't work. Better yet, stand up your own signalling server which you can guarantee is available, not under heavy load, etc and use that. Take a look at the webrtc-star readme: https://github.com/libp2p/js-libp2p-webrtc-star#rendezvous-server-aka-signalling-server |
@5310 as @achingbrain recommended, the best solution is to run your own signalling server. We want to update the available public signalling servers and increase their redundancy, but they should only be used for demos and examples purposes, since there is no guarantee on availability. |
Right now I do have a local WebRTC-Star signaling server that I use for testing. But the public server was pretty nifty for Codepen demos. I've actually not caught it up even once all year, even though it seemed to not have been discontinued just yet from the docs. The existence of WebRTC-Stardust also made things a bit confusing, but I guess it's not ready yet. Will try to host a remotely accessible signaling server for my demos. 👍 |
As part of this we need to get a webrtc-star server deployed to replace the websocket-star server, tracking this at libp2p/js-libp2p-webrtc-star#180. |
Hello, i have the same issue ... upgrading from 0.40.0 to latest version this simple code does not work anymore ... <!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script src="https://cdn.jsdelivr.net/npm/ipfs/dist/index.js"></script>
</head>
<body id="body"></body>
</html>
<script type="text/javascript">
let node = null;
window.onload = async () => {
node = await Ipfs.create({
"EXPERIMENTAL" : { "pubsub":true },
"repo" : "repo-" + Date.now(),
"config":{
"Addresses":{
"Swarm":["/dns4/ipfs.runfission.com/tcp/4003/wss/ipfs/QmVLEz2SxoNiFnuyLpbXsH6SvjPTrHNMU88vCQZyhgBzgw"]
}
}
});
};
</script> Thrown errors are:
and
The exact same code works fine with 0.40.0 ... Do i have to change something in order to make it work now ? @icidasset 's solution didn't work for me ... One more question ...do you know about any other public node with wss relay capability enabled ?? |
@lazyweirdo yeah we’d be glad of a network of wss relays. Just talked to the Qri folks this morning, I’ll ask them if this is of interest. Please ping me wherever you open an issue and I’ll coordinate Fission’s side of things. |
@bmann nice ! ... i'll pin you :) |
I did not know this repo. I think it is related to public gateways. What if you create a repo specific for signalling servers? This way, we could track for now the webrtc-star and stardust signal server and the deployed versions. If you do it, we should reference it from the |
FYI we are working on getting some |
Nice ... let me know if you create a repo for this, I would like to contribute ... If i got enough time, i would do it ... maybe one of these days |
On `js-ipfs@0.41`, we removed the `websocket-star` module from the libp2p default configuration for browser nodes in `js-ipfs`. We removed it because this module was not refactored during #1670, since the libp2p goal is to [sunset the star protocols](libp2p/js-libp2p#385) and we preferred to use the time refactoring `websocket-star` into improving the browser support. In the refactor, the `webrtc-star` module was refactored so that browser users could discover other peers in the network. In addition, `circuit-relay` may be used for establishing connections between browser nodes using `websockets`. However, this migration has not been smooth for `js-ipfs` users. Users previously using `websocket-star` swarm addresses, did not have enough visibility of this change, since the removal of `websocket-star` was transparent for them and on the default `js-ipfs` release and not technically a programmable breaking change. With the above in mind, once `js-ipfs` users updated they started getting errors from `js-libp2p` in scenarios where they were providing only `websocket-star` swarm addresses. When `js-libp2p` receives listening multiaddrs, it throws an error if it cannot use any to listen on the configured transports, which was the case here (For instance #2779). In `js-libp2p`, we added an option to tolerate these errors [libp2p/js-libp2p#643](libp2p/js-libp2p#643), which was also mentioned for some other cases earlier. After syncing about this issue, we decided to temporarily throw an error when `js-ipfs` receives `websocket-star` multiaddrs. This aims to help users who still need to migrate to identify the problem faster.
Hey folks! 👋 https://wrtc-star1.par.dwebops.pub/ We also have both instances up via a round-robin DNS at https://webrtc-star.discovery.libp2p.io . Bear in mind that using this one might result in not discovering peers that went to the other server. But for some use cases, it can be enough and offers more reliability. Let me know if you need any help on integrating this and I will be working on updating the browser example for IPFS and libp2p. |
i am self wrtc deployed server and getting same issue no valid addresses were provided for transports [WebSockets,WebRTCStar,Circuit] https://secure-beyond-12878.herokuapp.com/ @vasco-santos am i have something wrong? |
@geolffreym Also, thanks everyone, I can confirm that everything works as expected now. |
@icidasset sorry my bad, i post wrong conf. => this is the current i am using |
@geolffreym Can you try If you access http://secure-beyond-12878.herokuapp.com, that's the address that should be used to listen on |
Actually @vasco-santos trying with |
Oh I see, I did not realize you were adding |
You can read more on how to configure them on discuss.libp2p. Meanwhile, you should be able to use with |
i really thank u @vasco-santos ... thanks everyone too!! i let u know about it!! |
it can be that heroku is making a redirect to https? Maybe? |
@geolffreym it seems that you are running it in a node environment now. If you want to connect a browser node, with a node.js node, you will need to make a custom config for libp2p in IPFS. Basically, add the cc @achingbrain should we add it by default in node? What do you think? |
ohhh right!! Got it.. I assumed that js-ipfs did it by itself, thanks for the clarification @vasco-santos |
Anybody with same issue in node here is a cool example to customize libp2p in IPFS https://github.com/ipfs/js-ipfs/blob/bf92fb321a66651a63a8b9cc81112f149573826a/examples/custom-libp2p/index.js @vasco-santos thanks again!! |
@jacobheun is there any updated version of this example => link i think last versions is not supporting |
@geolffreym the latest version of ipfs, 0.47 is up to date, https://github.com/ipfs/js-ipfs/blob/ipfs%400.47.0/examples/custom-libp2p/index.js. The version you're linking to is older. For customizing libp2p in Node.js there is an example of a setup using WebrtcStar, Websockets and TCP at https://github.com/libp2p/js-libp2p-examples/blob/libp2p-0.28.x/chat/nodejs/08-End/index.js#L35. In particular you can pass params, like the |
Yay!!!! i really thank u.. on it!!! @jacobheun |
@jacobheun |
For anyone who has a problem similar to mine, here is my p2p settings. My problem if it was that I needed to connect nodes from different environments using node to emit data and the browser to obtain it, I managed to solve it with the help of everyone, thank you very much. In the same way I leave here the link to deploy your own webrtc signaling server
|
Per #2779 , this PR adds the public webrtc servers to the browser example. This allows users to run easily the example, but also provides information for how users should use a signaling server for production.
Closing this as this should no longer be a problem and configuration options were provided in previous comments. |
👋 Thanks for the 0.41.0 update!
I'm having an issue with upgrading from 0.38
I'm getting the following error:
I'm setting it up as follows, which worked before the upgrade:
Any thoughts on what changed?
The text was updated successfully, but these errors were encountered: