GithubHelp home page GithubHelp logo

decentrasol / docker-ipfs-infrastructure Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 0.0 10.61 MB

Setup a websocket libp2p relay with letsencrypt and nginx

JavaScript 51.60% Shell 44.53% Dockerfile 3.87%

docker-ipfs-infrastructure's Introduction

Websocket libp2p-relay

Description

This is a docker image and docker compose file which runs a

  • NodeJS websocket relay for libp2p with
  • nginx and
  • letsencrypt

Usage

  1. Copy .env.example to .env and change to your environment
  2. Modify init-letsencrypt.sh (domains=(ipfs.le-space.de) around line 8) to setup your letsencrypt domain
  3. Run ./init-letsencrypt.sh (letsencrypt is creating ssl certificates for nginx)
  4. Run docker-compose up -d (nginx, letsencrypt, relay-service starting)
  5. Run docker-compose logs and find the libp2p address to connect your peers

Todo

  • move private key from relay.js into .env
  • SERVER_NAME inside docker-compose.yml should go into .env
  • init-letsencrypt.sh should take SERVER_NAME as an argument or environment variable
  • make listen addresses of relay service configurable via .env / docker-compose
  • make announce: ['/dns4/ipfs.le-space.de//tcp/443/wss'] configurable via .env / docker-compose
  • make bootstrap seed nodes configurable via .env / docker-compose
  • make pubsubPeerDiscovery topics configurable via .env / docker-compose

docker-ipfs-infrastructure's People

Contributors

silkroadnomad avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

docker-ipfs-infrastructure's Issues

Websocket relay does not relay pubsub messages (except pub-sub peer-discovery)

e.g. in hotel wifi's where Webrtc is restricted through some firewall, (connection is established via Websocket), relay establishes the WebSocket connection to browser peers

The peers create a Webrtc swarm successfully

  • not confirmed anymore 15.03.2024 - location Komune
  • confiremd 25.05.2024 - location ekb coworking

Unfortunately, if any peer publishes a pub-sub message no other peer can listen and react to it. (except probably the relay, which doesn't relay it via WebSocket).

Mobile networks:
In mobile networks on the other hand this works perfectly (via webrtc then)

Test:

  • in an environment where peer-to-peer connections are blocked (peer-to-peer pub-sub doesn't work) which if that counts for both a WebRTC only connected peers and also for a Websocket only connected peers.

  • 25.05.2024 (location ekb coworking) - successfully webrtc only connected swarm (via Rust WebRTC relay) but NO pubsub on deContact topic but OrbitDB replicates successfully (via pubsub)

  • 25.05.2024 (location ekb coworking) - successfully websocket only connected swarm (via Websocket relay) but NO pubsub on deContact but OrbitDB replicates successfully (via pubsub)

  • check if websocket relay can subscribe to a peers topic manually.

  • make sure / clarify a websocket relay is able to relay pubsub messages via websocket if peers are not already connected via webrtc

Finish Todos on Readme

  • init-letsencrypt.sh should take SERVER_NAME as an argument or environment variable
  • make listen addresses of relay service configurable via .env / docker-compose
  • make bootstrap seed nodes configurable via .env / docker-compose
  • make pubsubPeerDiscovery topics configurable via .env / docker-compose
  • make announce: ['/dns4/ipfs.le-space.de//tcp/443/wss'] configurable via .env / docker-compose

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.