Using js-ipfs
to add and retrieve files. There are two methods to make peers find each other and share data between them:
- Using
webrtc
. Nodes use asignalling server
to connect directly to each other. The server has no access to the data. - Using
websockets
. Nodes use asocket.io server
to connect to each other and share data. The server relays the data.
yarn
- Spin up the signalling server
npx star-signal
yarn start
(make sure the config for the IPFS nodes point to thep2p-webrtc-star
swarm address.- Open up some browsers to
localhost:3000
(e.g. One regular Chrome, one Incognito Chrome, one Safari and one Firefox). - Add files using either browser and try to fetch them with the other browsers. By using the provided mock files browser work correctly if using the smaller files.
Firefox
yarn start
another app and open up another Firefox browser tolocalhost:3001
- Using both Firefox browsers all the provided files should be shared correctly.
Probably these:
Make sure the IPFS node config has the p2p-webrtc-star
swarm address uncommented.
# in one terminal
npx star-signal
# in another terminal
yarn start
Chrome and Safari are not able to share files bigger than 256Kb (tested with 500Kb files actual limit might be different).
Latest Firefox works ok with files (tested with files up to 3Mb).
Make sure the IPFS node config has the p2p-websocket-star
swarm address uncommented.
# in one terminal
npx rendezvous --port=9191
# in another terminal
yarn start
All browsers work as they should and are able to share files (tested with files up to 3Mb).