Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Example: Add WebRTC star example #786

Closed
wants to merge 1 commit into from

Conversation

JGAntunes
Copy link
Member

Add WebRTC star example done by @interfect, previously on #784 and #525.

@jbenet jbenet added the status/in-progress In progress label Mar 12, 2017
@daviddias daviddias added the status/deferred Conscious decision to pause or backlog label Mar 13, 2017
@daviddias daviddias changed the title feat: Add WebRTC star example Example: Add WebRTC star example Mar 13, 2017
@@ -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.
Copy link
Member

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:
Copy link
Member

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.

@victorb
Copy link
Member

victorb commented Mar 13, 2017

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.

@daviddias daviddias added status/ready Ready to be worked status/deferred Conscious decision to pause or backlog and removed status/deferred Conscious decision to pause or backlog status/in-progress In progress status/ready Ready to be worked labels Mar 15, 2017
@daviddias
Copy link
Member

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:

/libp2p-webrtc-star/dns4/star-signal.cloud.ipfs.team/wss

@JGAntunes feeling like updating it?

@daviddias
Copy link
Member

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.

@daviddias daviddias closed this Mar 21, 2017
@daviddias daviddias deleted the feat/add-webrtc-star-example branch March 21, 2017 18:34
@daviddias daviddias removed the status/deferred Conscious decision to pause or backlog label Mar 21, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants