From c14c5516477335f76d0b19b578257f6118c55fe0 Mon Sep 17 00:00:00 2001 From: Gonzalo Javier Aune Date: Tue, 21 Apr 2020 11:39:51 +0100 Subject: [PATCH] Added instructions --- .lnd/lnd.conf | 11 +++++++++ README.md | 58 +++++++++++++++++++++++++++++++++++++++++++++- docker-compose.yml | 11 ++------- lnd.conf.sample | 11 +++++++++ 4 files changed, 81 insertions(+), 10 deletions(-) create mode 100644 .lnd/lnd.conf create mode 100644 lnd.conf.sample diff --git a/.lnd/lnd.conf b/.lnd/lnd.conf new file mode 100644 index 0000000..f948250 --- /dev/null +++ b/.lnd/lnd.conf @@ -0,0 +1,11 @@ +bitcoin.mainnet=1 +bitcoin.active=1 +bitcoin.node=neutrino + +alias=myalias +listen=0.0.0.0:9735 +rpclisten=0.0.0.0:10009 + +ignore-historical-gossip-filters=true +nobootstrap=true +numgraphsyncpeers=1 diff --git a/README.md b/README.md index 33509ff..6ad5d90 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Relay -**Relay** is a Node.js wrapper around [LND](https://github.com/lightningnetwork/lnd), handling connectivity and storage for [**Sphinx**](https://sphinx.chat). Communication between Relay nodes takes place entirely on the Lightning Network, so is decentralized, untraceable, and encrypted. Message content is also end-to-end encrypted using client public keys, on the **Sphinx** app itself. +**Relay** is a Node.js wrapper around [LND](https://github.com/lightningnetwork/lnd), handling connectivity and storage for [**Sphinx**](https://sphinx.chat). Communication between Relay nodes takes place entirely on the Lightning Network, so is decentralized, untraceable, and encrypted. Message content is also end-to-end encrypted using client public keys, on the **Sphinx** app itself. ![Relay](https://github.com/stakwork/sphinx-relay/raw/master/public/relay.jpg) @@ -13,6 +13,62 @@ Relay stores: # run your own sphinx node +## Using Docker on Raspberry Pi + +Install docker-compose: https://medium.com/@techiebouncer/install-docker-and-docker-compose-on-raspberry-pi-4-raspbian-buster-c5b78b9a0d08 + +Clone this repo. + +Copy your id_rsa to clone the private lnd-lean repo. + +``` +cp ~/.ssh/id_rsa . +``` + +Build it. + +``` +docker-compose build +``` + +Edit your docker-compose.yml file replacing NODE_IP and NODE_ALIAS. + +Relay will run on port 3000 local. You would need to point your router's port forwarding from 80 to 3000 to your docker machine. + +Start up LND separately first. + +``` +docker-compose up lnd +``` + +- In another terminal, go to the project folder and run. + +``` +docker-compose exec lnd bash +``` + +Once you're given a bash, run `ping lnd` and take note of the IP, this is because we need to tell Relay where lnd is via the IP, this is a temporary measure due to the limitation of the grpc connection can only be done via IP and not domain name. + +Edit your app.json file inside config and on the `production` key replace `node_ip` with the one from the ping. + +Run Relay. + +``` +docker-compose up node_server +``` + +Create / Unlock your wallet + +``` +docker-compose exec lnd lncli create + +docker-compose exec lnd lncli unlock +``` + +NOTE: All lncli commands need to be prepended with `docker-compose exec lnd`, this tells docker to execute **something** on the lnd container. + +## Without Docker + You can run your own Sphinx node in order to have full ownership over your communication! ### download diff --git a/docker-compose.yml b/docker-compose.yml index 8df2ab2..03e745a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,11 +12,7 @@ services: ports: - "9735:9735" - "10009:10009" - - "8080:8080" command: 'lnd --accept-keysend' - # networks: - # - lnd_relay - # tty: true node_server: build: context: . @@ -29,12 +25,9 @@ services: - node_modules:/relay/node_modules ports: - "3000:3000" - # tty: true command: "npm start" - # networks: - # - lnd_relay environment: - PORT=3000 - - NODE_IP=51.37.119.104 - - NODE_ALIAS=gonza-ireland + - NODE_IP=mynodeip + - NODE_ALIAS=myalias - NODE_ENV=production \ No newline at end of file diff --git a/lnd.conf.sample b/lnd.conf.sample new file mode 100644 index 0000000..f948250 --- /dev/null +++ b/lnd.conf.sample @@ -0,0 +1,11 @@ +bitcoin.mainnet=1 +bitcoin.active=1 +bitcoin.node=neutrino + +alias=myalias +listen=0.0.0.0:9735 +rpclisten=0.0.0.0:10009 + +ignore-historical-gossip-filters=true +nobootstrap=true +numgraphsyncpeers=1