Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: examples-browser #508

Merged
merged 11 commits into from
Jan 24, 2020
Merged

Conversation

vasco-santos
Copy link
Member

@vasco-santos vasco-santos commented Dec 11, 2019

This PR refactors the browser example to the refactored async js-libp2p.

@vasco-santos vasco-santos force-pushed the refactor/examples-browser branch from 145c336 to 461cfad Compare December 11, 2019 13:49
@jacobheun jacobheun force-pushed the refactor/async-await branch from 374ceb4 to 45f4702 Compare December 12, 2019 09:30
@vasco-santos vasco-santos force-pushed the refactor/examples-browser branch from 461cfad to 965d3bf Compare December 16, 2019 11:52
@vasco-santos
Copy link
Member Author

Added information for people to run a signaling server

Copy link
Contributor

@jacobheun jacobheun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some small content changes. @vasco-santos have you gotten this running locally? I had two peers and they weren't able to connect over a local signaling server. I turned the debug logs on and got quite a few dialing failures.

@vasco-santos
Copy link
Member Author

I tried it out with the latest changes and two local peers, but the dial hangs forever. Do you have any idea on what is going on?

@jacobheun jacobheun force-pushed the refactor/examples-browser branch from 0d661dc to a63e476 Compare January 20, 2020 16:30
@jacobheun jacobheun force-pushed the refactor/examples-browser branch from 501eae3 to 1df7472 Compare January 22, 2020 10:49
@jacobheun jacobheun dismissed their stale review January 22, 2020 10:58

Review is stale

@jacobheun
Copy link
Contributor

I've reworked the browser example, it's now based off of the js-ipfs browser-parcel example, and the code has been simplified to a single file.

The issues with webrtc and websockets have been resolved, this is ready for a final review.

Copy link
Member

@achingbrain achingbrain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@alanshaw alanshaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just some minor tweaks!


Start by installing libp2p's dependencies.
In order to run the example, first install the dependencies from same directory as this README:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You also need to ensure dependencies in the root of the project are installed since it depends on libp2p: "../../"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NPM should actually handle the install for you, I've verified this works a few times after clearing node modules from the project root.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh nice, I did not realise.

@jacobheun jacobheun merged commit 751a227 into refactor/async-await Jan 24, 2020
@jacobheun jacobheun deleted the refactor/examples-browser branch January 24, 2020 10:44
jacobheun added a commit that referenced this pull request Jan 24, 2020
* refactor: examples-browser

* chore: add information to use signalling server

* chore: apply suggestions from code review

Co-Authored-By: Jacob Heun <[email protected]>

* chore: update deps

* docs: refactor libp2p browser example

* docs(examples): add back websockets and boostrap nodes

docs(examples): redo the browser readme

* fix: handle edge case of connections closing early

* chore: fix lint

* chore: update example deps and readme

* chore: update webrtc-star

* chore: apply suggestions from code review

Co-Authored-By: Alan Shaw <[email protected]>

Co-authored-by: Jacob Heun <[email protected]>
Co-authored-by: Alan Shaw <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants