-
Notifications
You must be signed in to change notification settings - Fork 1
Conversation
src/get-ipfs.ts
Outdated
|
||
if (!ipfsPkg?.create) return null | ||
const peers = (config.peers || []).concat(config.browserPeers || []) | ||
const ipfs = await ipfsPkg.create({ config: { Addresses: { Swarm: peers }}}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this work? I tried locally and got Error: no valid addresses were provided for transports [WebSockets,WebRTCStar,Circuit]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I'm getting this error as well. That's what I'm trying to figure out with the new js-ipfs. This used to work, see our Fission Drive code: https://github.com/fission-suite/drive/blob/22468f5908b7715bf516c87debf05ae36c974588/src/Javascript/ipfs.js#L32-L34
Could it be something regarding "delegated routing" which they excluded now? https://blog.ipfs.io/2020-02-13-js-ipfs-0-41/ (search for "Delegated peer and content routing")
Are we doing delegated routing with us passing the peer id in the multiaddr? (eg. /dns4/node.fission.systems/tcp/4003/wss/ipfs/QmVLEz2SxoNiFnuyLpbXsH6SvjPTrHNMU88vCQZyhgBzgw
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I... don't think so? Not very familiar with that. But delegated routing seems to be "okay I have this peer id, but not the full multiaddr, can you connect me?"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's actually surprising to me that that worked in the Fission Drive code. I thought I remembered trying this back when originally making this lib and it not working. I either had to use ipfs.swarm.connect()
or put the addresses in config.Bootstrap
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh weird. Ok, I'll do some more digging because this is all very confusing 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome thanks 👍 I did notice you added a tries: number
param, but never used it. Do you want me to implement this? Also, no timeout/delay between retries?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quick code edits squeezed in before team meetings come back to bite me 😛
Yes I'll fix that haha
And the timeout doesn't seem to be necessary. It either requires multiple connect attempts or a timeout of about 200ms 🤷♂️
I'll add it as an additional param though in case we want to use it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😬 😄 Ok cool. So weird these connection issues.
One last thing, I'm getting an error on safari when using the latest js-ipfs. Could you check if you get that too with ipfs-user-settings? 🙏 I'm getting a timeoutController.clear is not a function
error. Made an issue for that on the libp2p repo, but trying to get more info.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay pushed the new code 👍
I'm on linux so unfortunately don't have Safari 😬 but I don't get any such error in FF/Chrome
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah right. Carry on! 😬 😅
@dholms How do I use this |
ah So yeah just ignore it for now. There's a little more cleanup I need to do on the tooling as well. I'll make an issue for it |
Cool, sounds good 👍 I've bumped the version and added a changelog. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright I'm gonna give this an approval because it seems like this is working for both of us with the retry logic.
If you could take a quick look at the code I added before merging, that'd be great 👍
I'm also going to create a separate issue about the AggregateError
for further review, but I don't think that needs to block us from merging this
Adds the option: