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

feat: add initial server #1

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

feat: add initial server #1

wants to merge 3 commits into from

Conversation

jacobheun
Copy link
Owner

@jacobheun jacobheun commented Mar 29, 2020

The initial implementation of a simple js-libp2p relay server that also subscribes to the js-libp2p-pubsub-peer-discovery service. This enables any peers connected to the relay, who also use the module to discover one another.

TODO

  • Add a prometheus metrics endpoint
  • Add a Dockerfile for easier deployment
  • Performance testing of the server

Dependencies

@jacobheun
Copy link
Owner Author

@vasco-santos @mkg20001 this is the initial relay server that leverages the pubsub discovery module. Still needs additional testing and a few updates, but the initial test demonstrates the discovery functionality over the relay.

},
peerDiscovery: {
[PubsubPeerDiscovery.tag]: {
delay: options.delay || 5000,
Copy link

Choose a reason for hiding this comment

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

The default should be updated

console.error('could not read peer id from path %s', idPath)
}

const libp2p = await create({ peerId })
Copy link

Choose a reason for hiding this comment

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

Needs to forward delay option from argv

enabled: true,
hop: {
enabled: true,
active: false
Copy link

Choose a reason for hiding this comment

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

Interesting to consider: Using active hopping and connections between relays to enable inter-relay connectivity, so if A dials B over R1 and B isn't connected to R1, R1 (that is connected to R2) will ask it for a connection to B, that way relaying becomes easily scalable

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.

2 participants