Skip to content

AquiGorka/test-ipfs-file-sharing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Testing IPFS file sharing

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 a signalling server to connect directly to each other. The server has no access to the data.
  • Using websockets. Nodes use a socket.io server to connect to each other and share data. The server relays the data.

Install dependencies

yarn

Test run

  1. Spin up the signalling server npx star-signal
  2. yarn start (make sure the config for the IPFS nodes point to the p2p-webrtc-star swarm address.
  3. Open up some browsers to localhost:3000 (e.g. One regular Chrome, one Incognito Chrome, one Safari and one Firefox).
  4. 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

  1. yarn start another app and open up another Firefox browser to localhost:3001
  2. Using both Firefox browsers all the provided files should be shared correctly.

What is going on?

Probably these:

WebRTC setup

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).

Websockets setup

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).

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published