-
Notifications
You must be signed in to change notification settings - Fork 1.2k
ipfs-address in the browser #847
Comments
Take a look at the example "Transfer Files" which shows how you can use a Signaling Server to help nodes to find each others: js-ipfs/examples/transfer-files/public/js/app.js Lines 37 to 46 in 637250d
There is also bootstrap nodes on the way, which would help as well. |
Following on what @victorbjelkholm already explained.
If you try the latest js-ipfs from github master, it will auto connect to bootstraper nodes, this feature hasn't been released yet
As @victorbjelkholm suggested, you need to enable the WebRTC transport for that
That is because you are just using WebSockets in the browser, which doesn't have a listener, it can only dial. |
thank you for your helpful answer, I couldn't find a suitable example in the test folder to up and download file from ipfs, the one you shared works just as expected. |
I've enabled webRTC, so now my peers do have address and browser nodes connect directly to each other. |
They should be able to share it, see the example https://github.com/ipfs/js-ipfs/tree/master/examples/transfer-files Note, if you are using Chrome, you might need to open two windows due to Chrome's throttling policy #611 |
they do open a connection through the file api, but it's as if the stream object were damaged. it either never ends or ends up with such error. DOMException: The JWK's "y" member defines an octet string of length 31 bytes but should be 32
index.js:27 Error: Stream ended prematurely I'm trying to transfer image files (png, jpg) as shown in this sample |
Do you have success using the example? As in, did you manage to transfer files using it? |
I just tried the transfer file sample. I do have the same problems. I opened 2 chrome windows and launched a desktop websocket enabled node. connected my two browser node together and with the desktop node. When fetching data from the other window:The ipfs.files.get function does resolve with a stream full of data, but I can't sink it without error. it sink eternally or send an error.
|
I am using ipfs in the browser, I just figured out that my browser node does not connect to peers except when I explicitly connect with ipfs.swarm.connect(address). After that I got one peer connected to my browser node.
I am also unable to get my browser node address, the field multiaddress is always an empty list.
Is that a normal behaviour, is there any configuration needed to get my browser node discoverable by the ipfs network? How could I get my browser node address?
The text was updated successfully, but these errors were encountered: