Closed gil-air-may closed 5 years ago
I could not find a way to get a direct connection between the browser node and the daemon node.
Hi, try enabling websocket transport in go-ipfs (eg. on /ip4/0.0.0.0/tcp/4003/ws
):
Then browser and daemon will share a transport that both can use.
Thank you very much! Enabling websockets was the missing piece.
DEADLINE 27/03/2019 :hourglass_flowing_sand:
Objective
Overview of the Problem
We are trying to connect 2 nodes and get the Pubsub functionality working between them.
But, despite having tried several different configurations, we did not get the Pubsub feature working in this scenario.
Why is this necessary?
This behavior is required since it is part of our current strategy to pin the submitted ideas to IPFS, and make them available to the public in a decentralized way. Put simply, if we manage to achieve Pubsub between Node A and Node B, that means we can move forward with the POC app that we've been developing.
NODE A (browser) Current Config
First you need to require
wrtc
. This is necessary to setup a p2p connection between the 2 nodes:Then you can instantiate the node by:
NODE B (daemon) Current Config
Once you install IFPS on your machine and run
ipfs start
from the terminal, a folder named .ipfs will be created in your $HOME directory. Inside that folder, you will find aconfig
file. The current state of my file is:The Problem
I start the daemon on the terminal using:
ipfs daemon --enable-pubsub-experiment
and subscribe to the topic usingipfs pubsub sub testing123
I navigate to localhost:3000 and the console logs:
Cool. So looks like the p2p circuit is online! So next we upload a file IPFS and save the CID to the state. (this.state.added_file_hash)
Then on the browser, we try to communicate with the daemon using
After this, browser console logs:
published to testing123
but the daemon does not get the message. :cry:Why P2P Circuit? Did you try a direct connection
So maybe Pubsub does not work with P2P circuits. However, I could not find a way to get a direct connection between the browser node and the daemon node.
If you use:
You get an browser console logs an error that says:
I want to contribute but I'm not sure where to start...
If you would like to know more about why solving this task is critical, feel free to reach out to me or @abinashk :smiley: Right now this is our priority. If you're up for the challenge, I can also help setting up Node A and Node B so you can aid us to reach a conclusion :1st_place_medal: