Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
b8bf044
feat: rendezvous protocol full implementation
vasco-santos May 20, 2020
d7290df
chore: interface-peer-discovery compliance
vasco-santos Jul 10, 2020
b080670
feat: garbage collector
vasco-santos Jul 13, 2020
ebb22d1
feat: cookie for discovery
vasco-santos Jul 13, 2020
9765a95
chore: cleanup
vasco-santos Jul 15, 2020
b6edaf3
chore: update aegir
vasco-santos Jul 17, 2020
0e304f9
chore: convert to seconds in the wire
vasco-santos Jul 17, 2020
b248924
chore: remove unregister comments for response
vasco-santos Jul 20, 2020
47641f7
feat: use signed peer records to exchange multiaddrs
vasco-santos Jul 22, 2020
b668c8a
chore: tests
vasco-santos Jul 22, 2020
7e3c541
chore: change readme
vasco-santos Jul 27, 2020
1a1590d
chore: update deps
vasco-santos Sep 22, 2020
b357829
chore: remove peer discovery interface as we will be creating libp2p.…
vasco-santos Sep 22, 2020
4abd363
chore: use uint8array instead of buffer
vasco-santos Sep 22, 2020
7763df2
chore: update libp2p integration doc
vasco-santos Sep 28, 2020
63d607b
chore: fix register ttl param return
vasco-santos Sep 28, 2020
5f45c6f
chore: update docs
vasco-santos Sep 29, 2020
640b64f
chore: remove enabled property from libp2p integration doc
vasco-santos Oct 5, 2020
8f6e148
chore: apply suggestions from code review
vasco-santos Nov 16, 2020
894ad2e
chore: separate server and client rendezvous
vasco-santos Nov 17, 2020
ee10d69
chore: add docker
vasco-santos Nov 17, 2020
3798fbb
fix: changed default values and moved them into the server with prope…
vasco-santos Nov 17, 2020
cdf2f6b
chore: update docs and constants
vasco-santos Nov 17, 2020
9fe0691
chore: add tests for protocol with direct connection to server
vasco-santos Nov 18, 2020
52fa2bd
chore: DoS protection with max registrations
vasco-santos Nov 19, 2020
06d53ac
chore: refactor client
vasco-santos Nov 21, 2020
d501d97
chore: add datastore and types
vasco-santos Dec 8, 2020
a2d5f83
chore: fix build
vasco-santos Dec 13, 2020
83cd4b7
chore: run with mysql
vasco-santos Dec 21, 2020
9b294f5
feat: gc
vasco-santos Dec 24, 2020
9bf5bcb
chore: add gc tests
vasco-santos Dec 24, 2020
7a569c7
chore: review docs and binary
vasco-santos Dec 24, 2020
c297156
chore: add datastore docs and model picture
vasco-santos Dec 28, 2020
e1cd224
chore: add library docs
vasco-santos Dec 28, 2020
264ce2a
chore: add docker setup docks
vasco-santos Dec 28, 2020
01ec7bc
chore: remove client code and move server into src
vasco-santos Jan 4, 2021
5f025d3
chore: use connection pool
vasco-santos Jan 11, 2021
2840251
fix: bin stdout addresses and ports correctly
vasco-santos Jan 15, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: add datastore and types
  • Loading branch information
vasco-santos committed Dec 8, 2020
commit d501d973e38a0ffff87d73ca22658e25f2f827c0
34 changes: 23 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# js-libp2p-rendezvous
# js-libp2p-rendezvous <!-- omit in toc -->

[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://protocol.ai)
[![](https://img.shields.io/badge/project-libp2p-yellow.svg?style=flat-square)](http://libp2p.io/)
Expand All @@ -7,16 +7,26 @@

> Javascript implementation of the rendezvous protocol for libp2p

## Lead Maintainer <!-- omit in toc -->

[Vasco Santos](https://github.com/vasco-santos).

## Table of Contents<!-- omit in toc -->

- [Overview](#overview)
- [Usage](#usage)
- [Install](#install)
- [CLI](#cli)
- [Docker Setup](#docker-setup)
- [Contribute](#contribute)
- [License](#license)

## Overview

Libp2p rendezvous is a lightweight mechanism for generalized peer discovery. It can be used for bootstrap purposes, real time peer discovery, application specific routing, and so on. Any node implementing the rendezvous protocol can act as a rendezvous point, allowing the discovery of relevant peers in a decentralized fashion.

See the [SPEC](https://github.com/libp2p/specs/tree/master/rendezvous) for more details.

## Lead Maintainer

[Vasco Santos](https://github.com/vasco-santos).

## Usage

### Install
Expand All @@ -27,10 +37,12 @@ See the [SPEC](https://github.com/libp2p/specs/tree/master/rendezvous) for more

Now you can use the cli command `libp2p-rendezvous-server` to spawn a libp2p rendezvous server.

It accepts several arguments: `--peerId`, `--listenMultiaddrs`, `--announceMultiaddrs`, `--metricsMultiaddr` and `--disableMetrics`
### CLI

After installing the rendezvous server, you can use its binary. It accepts several arguments: `--peerId`, `--listenMultiaddrs`, `--announceMultiaddrs`, `--metricsPort` and `--disableMetrics`

```sh
libp2p-rendezvous-server [--peerId <jsonFilePath>] [--listenMultiaddrs <ma> ... <ma>] [--announceMultiaddrs <ma> ... <ma>] [--metricsMultiaddr <ma>] [--disableMetrics]
libp2p-rendezvous-server [--peerId <jsonFilePath>] [--listenMultiaddrs <ma> ... <ma>] [--announceMultiaddrs <ma> ... <ma>] [--metricsPort <port>] [--disableMetrics]
```

For further customization (e.g. swapping the muxer, using other transports) it is recommended to create a server via the API.
Expand All @@ -55,10 +67,10 @@ By default it listens on `/ip4/127.0.0.1/tcp/15002/ws` and has no announce multi

#### Metrics

Metrics are enabled by default on `/ip4/127.0.0.1/tcp/8003` via Prometheus. This address can also be modified with:
Metrics are enabled by default on `/ip4/127.0.0.1/tcp/8003` via Prometheus. This port can also be modified with:

```sh
libp2p-rendezvous-server --metricsMultiaddr '/ip4/127.0.0.1/tcp/8000'
libp2p-rendezvous-server --metricsPort '8008'
```

Moreover, metrics can also be disabled with:
Expand All @@ -67,13 +79,13 @@ Moreover, metrics can also be disabled with:
libp2p-rendezvous-server --disableMetrics
```

## Docker Setup
### Docker Setup

TODO

## Contribute

Feel free to join in. All welcome. Open an [issue](https://github.com/libp2p/js-libp2p-pubsub-peer-discovery/issues)!
Feel free to join in. All welcome. Open an [issue](https://github.com/libp2p/js-libp2p-rendezvous/issues)!

This repository falls under the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md).

Expand Down
6 changes: 6 additions & 0 deletions mysql/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# MySQL
DATABASE=libp2p_rendezvous_db
ROOT_USER=root
ROOT_PASSWORD=my-secret-pw
USER=libp2p
PASSWORD=dev
10 changes: 10 additions & 0 deletions mysql/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Derived from official mysql image (our base image)
FROM mysql

# Add env variables
ENV MYSQL_DATABASE libp2p-rendezvous
ENV MYSQL_ROOT_PASSWORD=my-secret-pw
ENV MYSQL_USER=vsantos
ENV MYSQL_PASSWORD=my-secret-pw

EXPOSE 3306
21 changes: 21 additions & 0 deletions mysql/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: '3.1'
services:
db:
image: mysql
volumes:
- mysql-db:/var/lib/mysql
command: --default-authentication-plugin=mysql_native_password
restart: always
environment:
# MYSQL_ROOT_PASSWORD: my-secret-pw
# MYSQL_USER: libp2p
# MYSQL_PASSWORD: my-secret-pw
# MYSQL_DATABASE: libp2p_rendezvous_db
MYSQL_DATABASE: ${DATABASE}
MYSQL_ROOT_PASSWORD: ${ROOT_PASSWORD}
MYSQL_USER: ${USER}
MYSQL_PASSWORD: ${PASSWORD}
ports:
- "3306:3306"
volumes:
mysql-db:
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,24 +44,25 @@
"dependencies": {
"debug": "^4.2.0",
"err-code": "^2.0.3",
"es6-promisify": "^6.1.1",
"it-buffer": "^0.1.2",
"it-length-prefixed": "^3.1.0",
"it-pipe": "^1.1.0",
"libp2p": "libp2p/js-libp2p#0.30.x",
"libp2p": "libp2p/js-libp2p#chore/add-typedfs-with-post-install",
"libp2p-mplex": "^0.10.0",
"libp2p-noise": "^2.0.1",
"libp2p-tcp": "^0.15.1",
"libp2p-websockets": "^0.14.0",
"menoetius": "0.0.2",
"minimist": "^1.2.5",
"multiaddr": "^8.0.0",
"mysql": "^2.18.1",
"peer-id": "^0.14.1",
"protons": "^2.0.0",
"streaming-iterables": "^5.0.2",
"uint8arrays": "^1.1.0"
"streaming-iterables": "^5.0.2"
},
"devDependencies": {
"aegir": "^28.2.0",
"aegir": "^29.2.2",
"chai": "^4.2.0",
"chai-as-promised": "^7.1.1",
"delay": "^4.4.0",
Expand Down
Loading