-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Conversation
@@ -0,0 +1,14 @@ | |||
# How to use WebRTC star | |||
|
|||
There's still a bit of work required to start up an in-browser node in a robust way, so that it will work whether or not there is an existing initialized IPFS repo in the user's browser. If there isn't one, you need to call `init` as above, but if there is one, calling `init` will fail. Moreover, there's currently no good way to check if you need to call `init` or not. |
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.
Not sure how that is related to "how to use webrtc-star", even if it's good information in general when using js-ipfs.
|
||
There's still a bit of work required to start up an in-browser node in a robust way, so that it will work whether or not there is an existing initialized IPFS repo in the user's browser. If there isn't one, you need to call `init` as above, but if there is one, calling `init` will fail. Moreover, there's currently no good way to check if you need to call `init` or not. | ||
|
||
Also, an in-browser node isn't able to call up normal IPFS nodes over raw TCP; it can only communicate over Websockets and WebRTC. Currently, there are no Websockets or WebRTC bootstrap nodes run by the IPFS maintainers. You will probably want to set up a [libp2p-webrtc-star signaling server](https://github.com/libp2p/js-libp2p-webrtc-star) so nodes used in your application can find each other: |
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.
We do run a publicly available signaling server which would better to point users to rather than everyone setting up their own. We should start with an explanation for connecting to the existing one and later also explain how to run their own if necessary.
We could simplify this example by creating a new repository every time, by randomizing the path rather than having to figure out if it's already initialized or not. That way, you can open the same application in two different tabs. |
This example needs to be updated from latest js-ipfs master. Now it is super simple to add webrtc start, check -- https://github.com/ipfs/js-ipfs#advanced-options-when-creating-an-ipfs-node -- on how to add custom addrs. For webrtc-star, all you need to add now is:
@JGAntunes feeling like updating it? |
I believe this example is no longer necessary as the process of adding webrtc to the mix is quite simple now, plus transfer-files shows how to do it just well. Big thank you to everyone that keeps pushing stuff to make js-ipfs more awesome! The decision here is to keep the examples set small, so that it is easy to find what one needs. |
Add WebRTC star example done by @interfect, previously on #784 and #525.