From 18308d655806919af23153454a80c62a0e157ab7 Mon Sep 17 00:00:00 2001 From: user Date: Tue, 4 Aug 2020 01:38:14 +0300 Subject: [PATCH 1/8] docs: README, docs/ --- README.md | 111 ++++++++++++- docs/docker_deployment.md | 78 +++++++++ docs/myNode_deployment.md | 295 ++++++++++++++++++++++++++++++++++ docs/raspiblitz_deployment.md | 279 ++++++++++++++++++++++++++++++++ 4 files changed, 762 insertions(+), 1 deletion(-) create mode 100644 docs/docker_deployment.md create mode 100644 docs/myNode_deployment.md create mode 100644 docs/raspiblitz_deployment.md diff --git a/README.md b/README.md index 01f2028..80b5de8 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,116 @@ Relay stores: - Invites (so you can add your friends) - Media Keys: keys for decrypting media files, asymetrically encrypted for each contact in a chat -# run your own sphinx node +# Run your own sphinx node + +## Preparations + +* Be able to connect with your node through SSH. +* Make sure you are running LND version `0.10.0` or higher. This can be seen at http://mynode.local/lnd at the right top. Or by inserting the following console command: + +```sh +$ lncli getinfo +> "version": "0.10.0-beta commit=v0.10.0-beta" +``` + +### If you are already operating your LND + +If you have some open/funded channels of 100 000 sat+ capacity, you don't need to do anything else regarding Sphinx-Relay operation; if you don't have enough capacity in your channel(s) - add funds or rebalance your channels. + +### If you just installed your LND + +If you do not have any open/funded channels you might want to open a channel to the sphinx.chat LND. With a direct channel set up to sphinx.chat sending messages to sphinx.chat-hosted recepients is slightly cheaper. Please, make your own judgement regarding your privacy/cost efficiency balance. + +- Fund your LND wallet + +```bash +$ lncli newaddress p2wkh +{ + "address": "" +} +``` + +Send 100000 satoshi to the provided bitcoin address. + +Check your LND wallet balance with +```bash +$ lncli walletbalance +{ + "total_balance": "100000", + "confirmed_balance": "0", + "unconfirmed_balance": "100000" +} +``` +until it shows: +```bash +{ + "total_balance": "100000", + "confirmed_balance": "100000", + "unconfirmed_balance": "0" +} +``` +- Open a channel to sphinx.chat: + +```bash +$ lncli connect 023d70f2f76d283c6c4e58109ee3a2816eb9d8feb40b23d62469060a2b2867b77f@54.159.193.149:9735 +{ + +} +$ lncli openchannel 023d70f2f76d283c6c4e58109ee3a2816eb9d8feb40b23d62469060a2b2867b77f --local_amt=90000 --push_amt=5000 --sat_per_byte=35 +{ + "funding_txid": "76bc738472545c343ab4eecc733bd26f1493fb512d1921f3f7d863d0f0f0fbca" +} +``` +> **_NB_** Set the right amount of bitcoin transaction fee in `sat_per_byte` +> We recommend using [mempool.space](https://mempool.space) to determine the necessary fee. + +You can monitor the progress of the channel creation operation with `lncli pendingchannels`/`lncli listchannels` commands; the former whill show your channel while the operation is still in progress, the latter will show your channel once it's successfully completed. + +Check the payment delivery by making a small payment to the sphinx.chat LND: + +```bash +$ lncli sendpayment --dest=023d70f2f76d283c6c4e58109ee3a2816eb9d8feb40b23d62469060a2b2867b77f --final_cltv_delta=10 --amt=5 --keysend ++------------+--------------+--------------+--------------+-----+----------+----------+-------+ +| HTLC_STATE | ATTEMPT_TIME | RESOLVE_TIME | RECEIVER_AMT | FEE | TIMELOCK | CHAN_OUT | ROUTE | ++------------+--------------+--------------+--------------+-----+----------+--------------------+---------+ +| HTLC_STATE | ATTEMPT_TIME | RESOLVE_TIME | RECEIVER_AMT | FEE | TIMELOCK | CHAN_OUT | ROUTE | ++------------+--------------+--------------+--------------+-----+----------+----+------------+--------------+--------------+--------------+-----+----------+--------------------+---------+ +| HTLC_STATE | ATTEMPT_TIME | RESOLVE_TIME | RECEIVER_AMT | FEE | TIMELOCK | CHAN_OUT | ROUTE | ++------------+--------------+--------------+--------------+-----+----------+--------------------+---------+ +| SUCCEEDED | 1.544 | 5.188 | 5 | 0 | 642053 | 705537919981322241 | gameb_1 | ++------------+--------------+--------------+--------------+-----+----------+--------------------+---------+ +Amount + fee: 5 + 0 sat +Payment hash: <......> +Payment status: SUCCEEDED, preimage: <.....> +``` + +## Network connectivity + +If you have a permanent public IP on your internet connection and you want your mobile or desktop Sphinx client to connect to it over internet, open port `3001/TCP` on your router and create a port forwarding rule for TCP to port 3001 of your machine running Sphinx-Relay. How to do this is not included in this guide. https://www.yougetsignal.com/tools/open-ports/ is one of the many websites that can be used to check if a port is opened on your network. + +If you plan to use your Sphinx clients within the local network, then you do not have to do anything special. + +Since none of Sphinx clients support connecting to Sphinx-Relay over Tor as of this moment, you could set up a [Tor2IP tunnel](https://github.com/openoms/bitcoin-tutorials/blob/eaac48a5decb6aef8540de249816d255b310dc3a/tor2ip_tunnel.md) as well (for axtra privacy/security or because of unavailability of a permanent public IP address on your local internet connection). + +## Deployment + +[Docker deployment](docs/docker_deployment.md) +[Raspberry Pi/myNode deployment](docs/mynode_deployment.md) +[Raspberry Pi/Raspiblitz deployment](docs/raspiblitz_deployment.md) + +## Connecting a mobile client + +## Connecting a Desktop client + +## Troubleshooting + +## Known issues + +There are several known issues at the time of writing of this document: + + +you can check their actual status on GitHub + ## Using Docker on Raspberry Pi diff --git a/docs/docker_deployment.md b/docs/docker_deployment.md new file mode 100644 index 0000000..fb14ce6 --- /dev/null +++ b/docs/docker_deployment.md @@ -0,0 +1,78 @@ +## 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. +``` +git clone https://github.com/stakwork/sphinx-relay.git +``` + +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. + + +### configure + +Make sure your LND is running with the `--accept-keysend` flag! If you are using lnd.conf file, add `accept-keysend=1` + +Edit the "production" section of config/app.json: + - Change `macaroon_location` to the location of your LND admin macaroon + - Change `tls_location` to the location of your LND cert + +Edit the "production" section of config/config.json + - Update "storage" to point to where you want your DB file to live + +To connect to your app + - `export NODE_IP=x.x.x.x` (you can use a domain name instead if you have that set up) + - For extra security, `export USE_PASSWORD=true` + +### run + +`npm run prod` + +When Relay starts up, it will print a QR in the terminal. You can scan this in your app (Android & iOS) to connect! diff --git a/docs/myNode_deployment.md b/docs/myNode_deployment.md new file mode 100644 index 0000000..6c0cf48 --- /dev/null +++ b/docs/myNode_deployment.md @@ -0,0 +1,295 @@ +# Deployment to myNode + +This guide is focused on installing Sphinx-relay on top of myNode. Information about myNode can be found at: https://mynodebtc.com/. + +### Preparations + +* Be able to connect with your node through SSH. +* Connect to myNode as `admin`: +```sh +$ ssh admin@mynode.local +``` +Use password `bolt` unless you have already changed it. + +### Install dependencies + +sqlite3: `$ sudo apt install sqlite3` + +python2 (if not present): `$ sudo apt install python2` + +### Open port 3001 on myNode + +Open up a console window with SSH. And log in as root +```sh +$ sudo su +``` +Open up port 3001 on your machine and make sure it has been added to the list. +```sh +# ufw allow 3001 comment 'allow Sphinx-Chat' +# ufw status + +> Status: active +> +> To Action From +> -- ------ ---- +> 3001 (v6) ALLOW Anywhere (v6) # Sphinx-Chat +``` + +### Download + +login as user bitcoin. +```sh +$ sudo su bitcoin +$ cd +``` +Clone the repository from Github and install the package. +```sh +$ git clone https://github.com/stakwork/sphinx-relay +$ cd sphinx-relay +$ npm install +``` + +### Configure + +Edit the "production" section of config/app.json. +```sh +$ cd +$ cd sphinx-relay/config/ +$ nano app.json +``` +Change the following 4 lines: + +``` +"macaroon_location": "/home/bitcoin/.lnd/data/chain/bitcoin/mainnet/admin.macaroon", +"tls_location": "/mnt/hdd/mynode/lnd/tls.cert", +"lnd_log_location": "/home/bitcoin/.lnd/logs/bitcoin/mainnet/lnd.log", +``` + +Save and exit: +`Ctrl + X` + +`Y` + +`Enter` + +Edit the "production" section of config/config.json +```sh +$ nano config.json +``` +Change to following line to: +``` +"storage": "/home/bitcoin/sphinx.db" +``` +Save and exit: +`Ctrl + X` + +`Y` + +`Enter` + +#### If you want to use your Sphinx client within the same local network + +```sh +$ cd +$ cd sphinx-relay/config/ +$ export NODE_IP=x.x.x.x:3001 +``` +where `x.x.x.x` is the local IP addres of the machine running your Sphinx-Relay on your local network. + +#### If you want to connect to your Sphinx-Relay from outside of your local network + +```sh +$ cd +$ cd sphinx-relay/config/ +$ export NODE_IP=x.x.x.x:3001 +``` +where `x.x.x.x` is the permanent public IP address of your router. + +Make sure that port 3001 forwarding is properly set up. + +For extra security: +```sh +$ export USE_PASSWORD=true +``` + +### Activate keysend + +We need LND to run with keysend activated. First we check if it is already activated on your node. + +Go to http://mynode.local/lnd/config and check if the line `accept-keysend=True` (or `accept-keysend=1`) is included somewhere in the text. + +If `accept-keysend=True` is already included you can continue without changing anything. If `accept-keysend=True` is not included, add it to a new line and click the `Save` button. This will restart your device. (Restarting could take up to several minutes but also hours, so be patient.) + +### Run + +Now it's time to run the software. + +```sh +$ cd +$ cd sphinx-relay/config/ +$ npm run prod +``` +When Relay starts up, it will print a QR in the terminal. You can scan this in your app (Android or iOS) to connect! + +### To make relay run continuously (also after a restart). + +Before you start this part. Make sure your app is connected and you are able to send & receive messages. + +Login as admin. +```sh +$ sudo su admin +``` +Create a file named sphinx-relay.service +```sh +$ sudo nano /etc/systemd/system/sphinx/sphinx-relay.service +``` +Copy and paste the following text to add it to the file: +```sh +[Unit] +Description=Sphinx Relay Service +After=network.target + +[Service] +Type=simple +User=bitcoin +WorkingDirectory=/home/bitcoin/sphinx-relay/config/ +ExecStart=npm run prod +Restart=always +RestartSec=5 +StandardOutput=syslog +StandardError=syslog +SyslogIdentifier=sphinx-relay + +[Install] +WantedBy=multi-user.target +``` +Save and exit: +`Ctrl + X` + +`Y` + +`Enter` + +Let's run! +```sh +$ sudo systemctl enable sphinx-relay.service +$ sudo systemctl start sphinx-relay.service +``` +Check if relay succesfully started. +```sh +$ sudo systemctl status sphinx-relay.service +``` +### To stop the program + +```sh +$ sudo systemctl stop sphinx-relay.service +``` + +# To update Sphinx-Relay + +> This probably is not the most efficient way to update. But it works so we got that going which is nice. Feel free to optimize the process and contribute. :) + +Login as `admin` and stop the program. +```sh +$ sudo systemctl stop sphinx-relay.service +``` +login as user `bitcoin`. + +```sh +$ sudo su bitcoin +$ cd +``` +## Remove the old version + +```sh +$ rm -rf sphinx-relay +``` +## Download the new version + +Clone the repository from Github and install the package. +```sh +$ git clone https://github.com/stakwork/sphinx-relay +$ cd sphinx-relay +$ npm install +``` +### Configure + +Edit the "production" section of config/app.json. +```sh +$ cd +$ cd sphinx-relay/config/ +$ nano app.json +``` +Change the following 4 lines: + +``` +"macaroon_location": "/home/bitcoin/.lnd/data/chain/bitcoin/mainnet/admin.macaroon", +"tls_location": "/mnt/hdd/mynode/lnd/tls.cert", +"lnd_log_location": "/home/bitcoin/.lnd/logs/bitcoin/mainnet/lnd.log", +"lncli_location": "/home/bitcoin/go/bin", +``` + +Save and exit: +`Ctrl + X` + +`Y` + +`Enter` + +Edit the "production" section of config/config.json +```sh +$ nano config.json +``` +Change to following line to: +``` +"storage": "/home/bitcoin/sphinx.db" +``` +Save and exit: +`Ctrl + X` + +`Y` + +`Enter` + +#### If you want to use your Sphinx client within the same local network + +```sh +$ cd +$ cd sphinx-relay/config/ +$ export NODE_IP=x.x.x.x:3001 +``` +where `x.x.x.x` is the local IP addres of the machine running your Sphinx-Relay on your local network. + +#### If you want to connect to your Sphinx-Relay from outside of your local network + +```sh +$ cd +$ cd sphinx-relay/config/ +$ export NODE_IP=x.x.x.x:3001 +``` +where `x.x.x.x` is the permanent public IP address of your router. + +> Make sure that port 3001 forwarding is properly set up. + +For extra security: +```sh +$ export USE_PASSWORD=true +``` +### Turn on the service. +Login as admin. +```sh +$ su admin +``` +Or +```sh +$ exit +``` +Turn the service on and check the status. +```sh +$ sudo systemctl enable sphinx-relay.service +$ sudo systemctl start sphinx-relay.service +``` + +### tail logs + +`journalctl -u sphinx-relay -f` \ No newline at end of file diff --git a/docs/raspiblitz_deployment.md b/docs/raspiblitz_deployment.md new file mode 100644 index 0000000..7c01250 --- /dev/null +++ b/docs/raspiblitz_deployment.md @@ -0,0 +1,279 @@ +# Deployment to Raspiblitz + +This guide is focused on installing Sphinx-relay on top of myNode. Information about myNode can be found at: https://mynodebtc.com/. + +### Preparations + +* Be able to connect with your node through SSH. +* Connect to myNode as `admin`: +```sh +$ ssh admin@mynode.local +``` +Use password `raspiblitz` unless you have already changed it. + +### Install dependencies + +sqlite3: `$ sudo apt install sqlite3` + +python2 (if not present): `$ sudo apt install python2` + +### Open port 3001 on Raspiblitz + +Open up a console window with SSH. And log in as root +```sh +$ sudo su +``` +Open up port 3001 on your machine and make sure it has been added to the list. +```sh +# ufw allow 3001 comment 'allow Sphinx-Chat' +# ufw status + +> Status: active +> +> To Action From +> -- ------ ---- +> 3001 (v6) ALLOW Anywhere (v6) # Sphinx-Chat +``` + +### Download + +login as user bitcoin. +```sh +$ sudo su bitcoin +$ cd +``` +Clone the repository from Github and install the package. +```sh +$ git clone https://github.com/stakwork/sphinx-relay +$ cd sphinx-relay +$ npm install +``` + +### Configure +Edit the "production" section of config/app.json. +```sh +$ cd +$ cd sphinx-relay/config/ +$ nano app.json +``` +Change the following 4 lines: + +``` +"macaroon_location": "/home/bitcoin/.lnd/data/chain/bitcoin/mainnet/admin.macaroon", +"tls_location": "/mnt/hdd/lnd/tls.cert", +"lnd_log_location": "/home/bitcoin/.lnd/logs/bitcoin/mainnet/lnd.log", +``` + +Save and exit: +`Ctrl + X` + +`Y` + +`Enter` + +Edit the "production" section of config/config.json +```sh +$ nano config.json +``` +Change to following line to: +``` +"storage": "/home/bitcoin/sphinx.db" +``` +Save and exit: +`Ctrl + X` + +`Y` + +`Enter` + +#### If you want to use your Sphinx client within the same local network + +```sh +$ cd +$ cd sphinx-relay/config/ +$ export NODE_IP=x.x.x.x:3001 +``` +where `x.x.x.x` is the local IP addres of the machine running your Sphinx-Relay on your local network. + +#### If you want to connect to your Sphinx-Relay from outside of your local network + +```sh +$ cd +$ cd sphinx-relay/config/ +$ export NODE_IP=x.x.x.x:3001 +``` +where `x.x.x.x` is the permanent public IP address of your router. + +> Make sure that port 3001 forwarding is properly set up. + +For extra security: +```sh +$ export USE_PASSWORD=true +``` + +### Activate keysend + +We need LND to run with keysend activated. First we check if it is already activated on your node. + +Go to raspiblitz menu, or: + +```sh +$ raspiblitz +``` + +Find item menu "Services" and activate Keysend + +### Run + +Now it's time to run the software. + +```sh +$ cd +$ cd sphinx-relay/config/ +$ npm run prod +``` +When Relay starts up, it will print a QR in the terminal. You can scan this in your app (Android or iOS) to connect! + +### To make relay run continuously (also after a restart). +Before you start this part. Make sure your app is connected and you are able to send & receive messages. + +Login as admin. +```sh +$ sudo su admin +``` +Create a file named sphinx-relay.service +```sh +$ sudo nano /etc/systemd/system/sphinx/sphinx-relay.service +``` +Copy and paste the following text to add it to the file: +```sh +[Unit] +Description=Sphinx Relay Service +After=network.target + +[Service] +Type=simple +User=bitcoin +WorkingDirectory=/home/bitcoin/sphinx-relay/config/ +ExecStart=npm run prod +Restart=always +RestartSec=5 +StandardOutput=syslog +StandardError=syslog +SyslogIdentifier=sphinx-relay + +[Install] +WantedBy=multi-user.target +``` +Save and exit: +`Ctrl + X` + +`Y` + +`Enter` + +Let's run! +```sh +$ sudo systemctl enable sphinx-relay.service +$ sudo systemctl start sphinx-relay.service +``` +Check if relay succesfully started. +```sh +$ sudo systemctl status sphinx-relay.service +``` +### To stop the program +```sh +$ sudo systemctl stop sphinx-relay.service +``` + +# To update Sphinx-Relay + +> This probably is not the most efficient way to update. But it works so we got that going which is nice. Feel free to optimize the process and contribute. :) + +Login as `admin` and stop the program. +```sh +$ sudo systemctl stop sphinx-relay.service +``` +login as user `bitcoin`. +```sh +$ sudo su bitcoin +$ cd +``` +## Remove the old version +```sh +$ rm -rf sphinx-relay +``` +## Download the new version +Clone the repository from Github and install the package. +```sh +$ git clone https://github.com/stakwork/sphinx-relay +$ cd sphinx-relay +$ npm install +``` +### Configure +Edit the "production" section of config/app.json. +```sh +$ cd +$ cd sphinx-relay/config/ +$ nano app.json +``` +Change the following 4 lines: + +``` +"macaroon_location": "/home/bitcoin/.lnd/data/chain/bitcoin/mainnet/admin.macaroon", +"tls_location": "/mnt/hdd/lnd/tls.cert", +"lnd_log_location": "/home/bitcoin/.lnd/logs/bitcoin/mainnet/lnd.log", +"lncli_location": "/home/bitcoin/go/bin", +``` + +Save and exit: +`Ctrl + X` + +`Y` + +`Enter` + +Edit the "production" section of config/config.json +```sh +$ nano config.json +``` +Change to following line to: +``` +"storage": "/home/bitcoin/sphinx.db" +``` +Save and exit: +`Ctrl + X` + +`Y` + +`Enter` + +To connect to your app: +(replace x.x.x.x with your IP - NOTE: This is your external IP) +```sh +$ cd +$ cd sphinx-relay/config/ +$ export NODE_IP=x.x.x.x:3001 +``` +For extra security: +```sh +$ export USE_PASSWORD=true +``` +### Turn on the service. +Login as admin. +```sh +$ su admin +``` +Or +```sh +$ exit +``` +Turn the service on and check the status. +```sh +$ sudo systemctl enable sphinx-relay.service +$ sudo systemctl start sphinx-relay.service +``` + +### tail logs + +`journalctl -u sphinx-relay -f` \ No newline at end of file From 699fc0a900b7a86938a9283467f0a91c9dca7170 Mon Sep 17 00:00:00 2001 From: user Date: Tue, 4 Aug 2020 14:42:26 +0300 Subject: [PATCH 2/8] docs: README, docs/ --- README.md | 128 +++++++++++++----------------------------------------- 1 file changed, 30 insertions(+), 98 deletions(-) diff --git a/README.md b/README.md index 80b5de8..11492c1 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Relay stores: - Invites (so you can add your friends) - Media Keys: keys for decrypting media files, asymetrically encrypted for each contact in a chat -# Run your own sphinx node +# Run your own Sphinx node ## Preparations @@ -104,121 +104,53 @@ Since none of Sphinx clients support connecting to Sphinx-Relay over Tor as of t ## Deployment -[Docker deployment](docs/docker_deployment.md) -[Raspberry Pi/myNode deployment](docs/mynode_deployment.md) -[Raspberry Pi/Raspiblitz deployment](docs/raspiblitz_deployment.md) +* [Docker deployment](docs/docker_deployment.md) +* [Raspberry Pi/myNode deployment](docs/myNode_deployment.md) +* [Raspberry Pi/Raspiblitz deployment](docs/raspiblitz_deployment.md) ## Connecting a mobile client -## Connecting a Desktop client - -## Troubleshooting - -## Known issues - -There are several known issues at the time of writing of this document: - - -you can check their actual status on GitHub - - -## 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. -``` -git clone https://github.com/stakwork/sphinx-relay.git -``` - -Copy your id_rsa to clone the private lnd-lean repo. +Scan the generated QR code with your iOS or Android Sphinx client. -``` -cp ~/.ssh/id_rsa . -``` +> You should see `[socket.io] connected!` in your Relay console output. -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 -``` +Add some friends' adresses and start chatting! -- In another terminal, go to the project folder and run. +## Connecting a Desktop client -``` -docker-compose exec lnd bash -``` +As of the time of this writing, neither of the Desktop Sphinx clients can scan Relay QR codes, nor directly import the connection string (printed by Relay just above the QR code). -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. +To connect your Desktop Sphinx to your Relay: +- connect a mobile Sphinx client; +- open Profile in your mobile client; +- Export Private Key (key will be stored in your device's clipboard); +- send the private key to your Desktop and paste it to the connection input field. -Edit your app.json file inside config and on the `production` key replace `node_ip` with the one from the ping. +> You should see `[socket.io] connected!` in your Relay console output. -Run Relay. +## Troubleshooting -``` -docker-compose up node_server -``` +### Mobile Sphinx does not scan the generated QR code -Create / Unlock your wallet +- restart the Relay machine; +- connect as `admin`; +- switch to user `bitcoin` with `sudo su bitcoin`; +- make sure `NODE_IP` environment variable contains correct `:` values, `export` again if necessary; +- `cd ~/sphinx-relay; npm run prod` -``` -docker-compose exec lnd lncli create +### Messages sent with your Relay are delivered empty or not delivered at all -docker-compose exec lnd lncli unlock +Make small manual lightning payments to the Sphinx.chat LND +```bash +$ lncli sendpayment --dest=023d70f2f76d283c6c4e58109ee3a2816eb9d8feb40b23d62469060a2b2867b77f --final_cltv_delta=10 --amt=5 --keysend ``` +Then make manual payments to your destination address. -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! - -### guide - -mynode users: here is a complete guide provided by someone who is running Relay at home: [MyNode Guide](https://github.com/stakwork/sphinx-relay/blob/master/install_guide_myNode_and_Raspiblitz.md) +Make sure all payments complete successfully. -### download - -`git clone https://github.com/stakwork/sphinx-relay` - -`cd sphinx-relay` - -`npm install` - -### dependencies - -sqlite3: `apt-get install sqlite3` - -### configure - -Make sure your LND is running with the `--accept-keysend` flag! If you are using lnd.conf file, add `accept-keysend=1` - -Edit the "production" section of config/app.json: - - Change `macaroon_location` to the location of your LND admin macaroon - - Change `tls_location` to the location of your LND cert - -Edit the "production" section of config/config.json - - Update "storage" to point to where you want your DB file to live - -To connect to your app - - `export NODE_IP=x.x.x.x` (you can use a domain name instead if you have that set up) - - For extra security, `export USE_PASSWORD=true` - -### run - -`npm run prod` +## Known issues -When Relay starts up, it will print a QR in the terminal. You can scan this in your app (Android & iOS) to connect! +There are several known issues at the time of the writing of this document, you can [check their actual status on GitHub](https://github.com/stakwork/sphinx-relay/issues) # Roadmap From 9726c3f4ba099b30d57410fee27c5318d2eb2f6c Mon Sep 17 00:00:00 2001 From: user Date: Wed, 5 Aug 2020 17:00:27 +0300 Subject: [PATCH 3/8] docs: README, docs/ --- README.md | 25 +++++++++++++------------ docs/docker_deployment.md | 4 ++-- docs/myNode_deployment.md | 20 ++++++++++---------- docs/raspiblitz_deployment.md | 18 +++++++++--------- 4 files changed, 34 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index 11492c1..e174298 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 it 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) @@ -9,7 +9,7 @@ Relay stores: - Messages - Recurring payment configurations - Invites (so you can add your friends) -- Media Keys: keys for decrypting media files, asymetrically encrypted for each contact in a chat +- Media Keys: keys for decrypting media files, asymmetrically encrypted for each contact in a chat # Run your own Sphinx node @@ -25,11 +25,11 @@ $ lncli getinfo ### If you are already operating your LND -If you have some open/funded channels of 100 000 sat+ capacity, you don't need to do anything else regarding Sphinx-Relay operation; if you don't have enough capacity in your channel(s) - add funds or rebalance your channels. +If you have some open/funded channels of 100 000 sat+ capacity, you don't need to do anything else regarding Sphinx-Relay operation; if you don't have enough capacity in your channel(s) - add funds or rebalance your channel(s). ### If you just installed your LND -If you do not have any open/funded channels you might want to open a channel to the sphinx.chat LND. With a direct channel set up to sphinx.chat sending messages to sphinx.chat-hosted recepients is slightly cheaper. Please, make your own judgement regarding your privacy/cost efficiency balance. +If you do not have any open/funded channels, you might want to open a channel to the Sphinx.chat LND. With a direct channel set up to sphinx.chat, sending messages to sphinx.chat-hosted recipients is slightly cheaper. Please, make your own judgment regarding your privacy/cost efficiency balance. - Fund your LND wallet @@ -40,7 +40,7 @@ $ lncli newaddress p2wkh } ``` -Send 100000 satoshi to the provided bitcoin address. +Send 100000 sats to the provided bitcoin address. Check your LND wallet balance with ```bash @@ -74,9 +74,9 @@ $ lncli openchannel 023d70f2f76d283c6c4e58109ee3a2816eb9d8feb40b23d62469060a2b28 > **_NB_** Set the right amount of bitcoin transaction fee in `sat_per_byte` > We recommend using [mempool.space](https://mempool.space) to determine the necessary fee. -You can monitor the progress of the channel creation operation with `lncli pendingchannels`/`lncli listchannels` commands; the former whill show your channel while the operation is still in progress, the latter will show your channel once it's successfully completed. +You can monitor the progress of the channel creation operation with `lncli pendingchannels`/`lncli listchannels` commands; the former will show your channel while the operation is still in progress, the latter will show your channel once it's successfully completed. -Check the payment delivery by making a small payment to the sphinx.chat LND: +Check the payment delivery by making a small payment to the Sphinx.chat LND: ```bash $ lncli sendpayment --dest=023d70f2f76d283c6c4e58109ee3a2816eb9d8feb40b23d62469060a2b2867b77f --final_cltv_delta=10 --amt=5 --keysend @@ -100,7 +100,7 @@ If you have a permanent public IP on your internet connection and you want your If you plan to use your Sphinx clients within the local network, then you do not have to do anything special. -Since none of Sphinx clients support connecting to Sphinx-Relay over Tor as of this moment, you could set up a [Tor2IP tunnel](https://github.com/openoms/bitcoin-tutorials/blob/eaac48a5decb6aef8540de249816d255b310dc3a/tor2ip_tunnel.md) as well (for axtra privacy/security or because of unavailability of a permanent public IP address on your local internet connection). +Since none of Sphinx clients support connecting to Sphinx-Relay over Tor as of this moment, you could set up a [Tor2IP tunnel](https://github.com/openoms/bitcoin-tutorials/blob/eaac48a5decb6aef8540de249816d255b310dc3a/tor2ip_tunnel.md) as well (for extra privacy/security or because of unavailability of a permanent public IP address on your local internet connection). ## Deployment @@ -114,16 +114,16 @@ Scan the generated QR code with your iOS or Android Sphinx client. > You should see `[socket.io] connected!` in your Relay console output. -Add some friends' adresses and start chatting! +Add some friends' addresses and start chatting! ## Connecting a Desktop client -As of the time of this writing, neither of the Desktop Sphinx clients can scan Relay QR codes, nor directly import the connection string (printed by Relay just above the QR code). +As of this writing, neither of the Desktop Sphinx clients can scan Relay QR codes, nor directly import the connection string (printed by Relay just above the QR code). To connect your Desktop Sphinx to your Relay: - connect a mobile Sphinx client; - open Profile in your mobile client; -- Export Private Key (key will be stored in your device's clipboard); +- Export Private Key (key is stored in your device clipboard); - send the private key to your Desktop and paste it to the connection input field. > You should see `[socket.io] connected!` in your Relay console output. @@ -150,7 +150,8 @@ Make sure all payments complete successfully. ## Known issues -There are several known issues at the time of the writing of this document, you can [check their actual status on GitHub](https://github.com/stakwork/sphinx-relay/issues) +There are several known issues at the time of the writing of this document. +You can [check their actual status on GitHub](https://github.com/stakwork/sphinx-relay/issues) # Roadmap diff --git a/docs/docker_deployment.md b/docs/docker_deployment.md index fb14ce6..cfe076a 100644 --- a/docs/docker_deployment.md +++ b/docs/docker_deployment.md @@ -56,9 +56,9 @@ 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. -### configure +### Configure -Make sure your LND is running with the `--accept-keysend` flag! If you are using lnd.conf file, add `accept-keysend=1` +Make sure your LND is running with the `--accept-keysend` flag! If you are using lnd.conf file, add `accept-keysend=1`, if necessary Edit the "production" section of config/app.json: - Change `macaroon_location` to the location of your LND admin macaroon diff --git a/docs/myNode_deployment.md b/docs/myNode_deployment.md index 6c0cf48..c192397 100644 --- a/docs/myNode_deployment.md +++ b/docs/myNode_deployment.md @@ -19,7 +19,7 @@ python2 (if not present): `$ sudo apt install python2` ### Open port 3001 on myNode -Open up a console window with SSH. And log in as root +Open up a console window with SSH. And login as root ```sh $ sudo su ``` @@ -76,7 +76,7 @@ Edit the "production" section of config/config.json ```sh $ nano config.json ``` -Change to following line to: +Change the following line to: ``` "storage": "/home/bitcoin/sphinx.db" ``` @@ -94,7 +94,7 @@ $ cd $ cd sphinx-relay/config/ $ export NODE_IP=x.x.x.x:3001 ``` -where `x.x.x.x` is the local IP addres of the machine running your Sphinx-Relay on your local network. +where `x.x.x.x` is the local IP address of the machine running your Sphinx-Relay on your local network. #### If you want to connect to your Sphinx-Relay from outside of your local network @@ -114,7 +114,7 @@ $ export USE_PASSWORD=true ### Activate keysend -We need LND to run with keysend activated. First we check if it is already activated on your node. +We need LND to run with keysend activated. First, we check if it is already enabled on your node. Go to http://mynode.local/lnd/config and check if the line `accept-keysend=True` (or `accept-keysend=1`) is included somewhere in the text. @@ -131,9 +131,9 @@ $ npm run prod ``` When Relay starts up, it will print a QR in the terminal. You can scan this in your app (Android or iOS) to connect! -### To make relay run continuously (also after a restart). +### To make Relay run continuously (also after a restart). -Before you start this part. Make sure your app is connected and you are able to send & receive messages. +Before you start this part, make sure your app is connected and that you are able to send & receive messages. Login as admin. ```sh @@ -175,7 +175,7 @@ Let's run! $ sudo systemctl enable sphinx-relay.service $ sudo systemctl start sphinx-relay.service ``` -Check if relay succesfully started. +Check if Relay successfully started. ```sh $ sudo systemctl status sphinx-relay.service ``` @@ -187,7 +187,7 @@ $ sudo systemctl stop sphinx-relay.service # To update Sphinx-Relay -> This probably is not the most efficient way to update. But it works so we got that going which is nice. Feel free to optimize the process and contribute. :) +> This probably is not the most efficient way to update. But it works, so we got that going, which is nice. Feel free to optimize the process and contribute. :) Login as `admin` and stop the program. ```sh @@ -240,7 +240,7 @@ Edit the "production" section of config/config.json ```sh $ nano config.json ``` -Change to following line to: +Change the following line to: ``` "storage": "/home/bitcoin/sphinx.db" ``` @@ -258,7 +258,7 @@ $ cd $ cd sphinx-relay/config/ $ export NODE_IP=x.x.x.x:3001 ``` -where `x.x.x.x` is the local IP addres of the machine running your Sphinx-Relay on your local network. +where `x.x.x.x` is the local IP address of the machine running your Sphinx-Relay on your local network. #### If you want to connect to your Sphinx-Relay from outside of your local network diff --git a/docs/raspiblitz_deployment.md b/docs/raspiblitz_deployment.md index 7c01250..08f4e9b 100644 --- a/docs/raspiblitz_deployment.md +++ b/docs/raspiblitz_deployment.md @@ -1,11 +1,11 @@ # Deployment to Raspiblitz -This guide is focused on installing Sphinx-relay on top of myNode. Information about myNode can be found at: https://mynodebtc.com/. +This guide is focused on installing Sphinx-relay on top of ***raspiblitz***. Information about myNode can be found at: https://raspiblitz.com/. ### Preparations * Be able to connect with your node through SSH. -* Connect to myNode as `admin`: +* Connect to **raspiblitz** as `admin`: ```sh $ ssh admin@mynode.local ``` @@ -75,7 +75,7 @@ Edit the "production" section of config/config.json ```sh $ nano config.json ``` -Change to following line to: +Change the following line to: ``` "storage": "/home/bitcoin/sphinx.db" ``` @@ -93,7 +93,7 @@ $ cd $ cd sphinx-relay/config/ $ export NODE_IP=x.x.x.x:3001 ``` -where `x.x.x.x` is the local IP addres of the machine running your Sphinx-Relay on your local network. +where `x.x.x.x` is the local IP address of the machine running your Sphinx-Relay on your local network. #### If you want to connect to your Sphinx-Relay from outside of your local network @@ -113,7 +113,7 @@ $ export USE_PASSWORD=true ### Activate keysend -We need LND to run with keysend activated. First we check if it is already activated on your node. +We need LND to run with keysend activated. First, we check if it is already enabled on your node. Go to raspiblitz menu, or: @@ -121,7 +121,7 @@ Go to raspiblitz menu, or: $ raspiblitz ``` -Find item menu "Services" and activate Keysend +Find menu "Services" item and activate Keysend. ### Run @@ -135,7 +135,7 @@ $ npm run prod When Relay starts up, it will print a QR in the terminal. You can scan this in your app (Android or iOS) to connect! ### To make relay run continuously (also after a restart). -Before you start this part. Make sure your app is connected and you are able to send & receive messages. +Before you start this part, make sure your app is connected and that you are able to send & receive messages. Login as admin. ```sh @@ -177,7 +177,7 @@ Let's run! $ sudo systemctl enable sphinx-relay.service $ sudo systemctl start sphinx-relay.service ``` -Check if relay succesfully started. +Check if Relay successfully started. ```sh $ sudo systemctl status sphinx-relay.service ``` @@ -188,7 +188,7 @@ $ sudo systemctl stop sphinx-relay.service # To update Sphinx-Relay -> This probably is not the most efficient way to update. But it works so we got that going which is nice. Feel free to optimize the process and contribute. :) +> This probably is not the most efficient way to update. But it works, so we got that going, which is nice. Feel free to optimize the process and contribute. :) Login as `admin` and stop the program. ```sh From 6f5c1dfd7af093cbc5e0e90715cb44061a8eb34a Mon Sep 17 00:00:00 2001 From: dimaatmelodromru Date: Wed, 5 Aug 2020 17:02:01 +0300 Subject: [PATCH 4/8] Delete install_guide_myNode_and_Raspiblitz.md --- install_guide_myNode_and_Raspiblitz.md | 290 ------------------------- 1 file changed, 290 deletions(-) delete mode 100644 install_guide_myNode_and_Raspiblitz.md diff --git a/install_guide_myNode_and_Raspiblitz.md b/install_guide_myNode_and_Raspiblitz.md deleted file mode 100644 index 57e0083..0000000 --- a/install_guide_myNode_and_Raspiblitz.md +++ /dev/null @@ -1,290 +0,0 @@ -# Guide: install Sphinx-relay on myNode / Raspiblitz. - -This guide is focused on installing Sphinx-relay on top of myNode. Information about myNode can be found at: https://mynodebtc.com/. - -### Preparations - -* Be able to connect with your node through SSH. -* Make sure you are running LND version `0.10.0` or higher. This can be seen at http://mynode.local/lnd at the right top. Or by inserting the following console command: - -```sh -$ lncli getinfo -> "version": "0.10.0-beta commit=v0.10.0-beta" -``` -* Open port `3001/TCP` on your router. How to do this is not included in this guide. https://www.yougetsignal.com/tools/open-ports/ is one of the many websites that can be used to check if a port is opened on your network. ---- -## Let's Start - -### Open port 3001 on myNode - -Open up a console window with SSH. And log in as root -```sh -$ sudo su -``` -Open up port 3001 on your machine and make sure it has been added to the list. -```sh -$ ufw allow 3001 comment 'allow Sphinx-Chat' -$ ufw status - -> Status: active -> -> To Action From -> -- ------ ---- -> 3001 (v6) ALLOW Anywhere (v6) # Sphinx-Chat -``` - -### Download - -login as user bitcoin. -```sh -$ sudo su bitcoin -$ cd -``` -Clone the repository from Github and install the package. -```sh -$ git clone https://github.com/stakwork/sphinx-relay -$ cd sphinx-relay -$ npm install -``` -### Dependencies - -sqlite3: `$ sudo apt-get install sqlite3` - -python2: `$ sudo apt-get install python2` - -### Configure -Edit the "production" section of config/app.json. -```sh -$ cd -$ cd sphinx-relay/config/ -$ nano app.json -``` -Change the following 4 lines: - -#### myNode -``` -"macaroon_location": "/home/bitcoin/.lnd/data/chain/bitcoin/mainnet/admin.macaroon", -"tls_location": "/mnt/hdd/mynode/lnd/tls.cert", -"lnd_log_location": "/home/bitcoin/.lnd/logs/bitcoin/mainnet/lnd.log", -``` - -#### Raspiblitz -``` -"macaroon_location": "/home/bitcoin/.lnd/data/chain/bitcoin/mainnet/admin.macaroon", -"tls_location": "/mnt/hdd/lnd/tls.cert", -"lnd_log_location": "/home/bitcoin/.lnd/logs/bitcoin/mainnet/lnd.log", -``` - -Save and exit: -`Ctrl + X` - -`Y` - -`Enter` - -Edit the "production" section of config/config.json -```sh -$ nano config.json -``` -Change to following line to: -``` -"storage": "/home/bitcoin/sphinx.db" -``` -Save and exit: -`Ctrl + X` - -`Y` - -`Enter` - -To connect to your app: -(replace x.x.x.x with your IP - NOTE: This is your external IP) -```sh -$ cd -$ cd sphinx-relay/config/ -$ export NODE_IP=x.x.x.x:3001 -``` -For extra security: -```sh -$ export USE_PASSWORD=true -``` -### Activate keysend - - -We need LND to run with keysend activated. First we check if it is already activated on your node. - -#### myNode: -Go to http://mynode.local/lnd/config and check if the line `accept-keysend=1` (or `accept-keysend=True`) is included somewhere in the text. - -If `accept-keysend=1` is already included you can continue without changing anything. If `accept-keysend=1` is not included, add it to a new line and click the `Save` button. This will restart your device. (Restarting could take up to several minutes but also hours, so be patient.) - -#### Raspiblitz: -Go to raspiblitz menu, or: - -```sh -$ raspiblitz -``` - -Find item menu "Services" and activate Keysend - -### Run -Now it's time to run the software. - -```sh -$ cd -$ cd sphinx-relay/config/ -$ npm run prod -``` -When Relay starts up, it will print a QR in the terminal. You can scan this in your app (Android or iOS) to connect! - -### To make relay run continuously (also after a restart). -Before you start this part. Make sure your app is connected and you are able to send & receive messages. - -Login as admin. -```sh -$ sudo su admin -``` -Create a file named sphinx-relay.service -```sh -$ sudo nano /etc/systemd/system/sphinx/sphinx-relay.service -``` -Copy and paste the following text to add it to the file: -```sh -[Unit] -Description=Sphinx Relay Service -After=network.target - -[Service] -Type=simple -User=bitcoin -WorkingDirectory=/home/bitcoin/sphinx-relay/config/ -ExecStart=npm run prod -Restart=always -RestartSec=5 -StandardOutput=syslog -StandardError=syslog -SyslogIdentifier=sphinx-relay - -[Install] -WantedBy=multi-user.target -``` -Save and exit: -`Ctrl + X` - -`Y` - -`Enter` - -Let's run! -```sh -$ sudo systemctl enable sphinx-relay.service -$ sudo systemctl start sphinx-relay.service -``` -Check if relay succesfully started. -```sh -$ sudo systemctl status sphinx-relay.service -``` -### To stop the program -```sh -$ sudo systemctl stop sphinx-relay.service -``` - -# To update Sphinx-Relay -(This probably is not the most efficient way to update. But it works so we got that goin which is nice. Feel free to optimize the process and contribute. :) ) - -Login as Admin and stop the program. -```sh -$ sudo systemctl stop sphinx-relay.service -``` -login as user bitcoin. -```sh -$ sudo su bitcoin -$ cd -``` -## Remove the old version -```sh -$ rm -rf sphinx-relay -``` -## Download the new version -Clone the repository from Github and install the package. -```sh -$ git clone https://github.com/stakwork/sphinx-relay -$ cd sphinx-relay -$ npm install -``` -### Configure -Edit the "production" section of config/app.json. -```sh -$ cd -$ cd sphinx-relay/config/ -$ nano app.json -``` -Change the following 4 lines: - -#### myNode -``` -"macaroon_location": "/home/bitcoin/.lnd/data/chain/bitcoin/mainnet/admin.macaroon", -"tls_location": "/mnt/hdd/mynode/lnd/tls.cert", -"lnd_log_location": "/home/bitcoin/.lnd/logs/bitcoin/mainnet/lnd.log", -"lncli_location": "/home/bitcoin/go/bin", -``` - -#### Raspiblitz -``` -"macaroon_location": "/home/bitcoin/.lnd/data/chain/bitcoin/mainnet/admin.macaroon", -"tls_location": "/mnt/hdd/lnd/tls.cert", -"lnd_log_location": "/home/bitcoin/.lnd/logs/bitcoin/mainnet/lnd.log", -"lncli_location": "/home/bitcoin/go/bin", -``` - -Save and exit: -`Ctrl + X` - -`Y` - -`Enter` - -Edit the "production" section of config/config.json -```sh -$ nano config.json -``` -Change to following line to: -``` -"storage": "/home/bitcoin/sphinx.db" -``` -Save and exit: -`Ctrl + X` - -`Y` - -`Enter` - -To connect to your app: -(replace x.x.x.x with your IP - NOTE: This is your external IP) -```sh -$ cd -$ cd sphinx-relay/config/ -$ export NODE_IP=x.x.x.x:3001 -``` -For extra security: -```sh -$ export USE_PASSWORD=true -``` -### Turn on the service. -Login as admin. -```sh -$ su admin -``` -Or -```sh -$ exit -``` -Turn the service on and check the status. -```sh -$ sudo systemctl enable sphinx-relay.service -$ sudo systemctl start sphinx-relay.service -``` - -### tail logs - -`journalctl -u sphinx-relay -f` \ No newline at end of file From cd5a58844c319df757a1550dc46f11185ed85c1f Mon Sep 17 00:00:00 2001 From: user Date: Wed, 5 Aug 2020 17:10:21 +0300 Subject: [PATCH 5/8] docs: README, docs/ --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e174298..ca0b835 100644 --- a/README.md +++ b/README.md @@ -137,10 +137,11 @@ To connect your Desktop Sphinx to your Relay: - switch to user `bitcoin` with `sudo su bitcoin`; - make sure `NODE_IP` environment variable contains correct `:` values, `export` again if necessary; - `cd ~/sphinx-relay; npm run prod` +Then try again. ### Messages sent with your Relay are delivered empty or not delivered at all -Make small manual lightning payments to the Sphinx.chat LND +Make small manual lightning payments to the Sphinx.chat LND (or the node you are connected to) ```bash $ lncli sendpayment --dest=023d70f2f76d283c6c4e58109ee3a2816eb9d8feb40b23d62469060a2b2867b77f --final_cltv_delta=10 --amt=5 --keysend ``` @@ -148,6 +149,8 @@ Then make manual payments to your destination address. Make sure all payments complete successfully. +Try messaging again in both directions. Usually, as the first messages is successfully delivered, there are no futher issues. + ## Known issues There are several known issues at the time of the writing of this document. From 74d3c4f7d0211e7834ced138e9e42f02b4a6c254 Mon Sep 17 00:00:00 2001 From: user Date: Wed, 5 Aug 2020 17:12:32 +0300 Subject: [PATCH 6/8] docs: README, docs/ --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index ca0b835..12b32f0 100644 --- a/README.md +++ b/README.md @@ -137,6 +137,7 @@ To connect your Desktop Sphinx to your Relay: - switch to user `bitcoin` with `sudo su bitcoin`; - make sure `NODE_IP` environment variable contains correct `:` values, `export` again if necessary; - `cd ~/sphinx-relay; npm run prod` + Then try again. ### Messages sent with your Relay are delivered empty or not delivered at all From 2501c531650dad7a28c79cc06c768a0eee4acbb9 Mon Sep 17 00:00:00 2001 From: user Date: Wed, 5 Aug 2020 17:17:48 +0300 Subject: [PATCH 7/8] docs: README, docs/ --- docs/docker_deployment.md | 2 ++ docs/myNode_deployment.md | 5 ++++- docs/raspiblitz_deployment.md | 5 ++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/docs/docker_deployment.md b/docs/docker_deployment.md index cfe076a..d5bc34d 100644 --- a/docs/docker_deployment.md +++ b/docs/docker_deployment.md @@ -76,3 +76,5 @@ To connect to your app `npm run prod` When Relay starts up, it will print a QR in the terminal. You can scan this in your app (Android & iOS) to connect! + +[Back to README](https://github.com/dimaatmelodromru/sphinx-relay/tree/docs-edit#connecting-a-mobile-client) diff --git a/docs/myNode_deployment.md b/docs/myNode_deployment.md index c192397..351456c 100644 --- a/docs/myNode_deployment.md +++ b/docs/myNode_deployment.md @@ -292,4 +292,7 @@ $ sudo systemctl start sphinx-relay.service ### tail logs -`journalctl -u sphinx-relay -f` \ No newline at end of file +`journalctl -u sphinx-relay -f` + + +[Back to README](https://github.com/dimaatmelodromru/sphinx-relay/tree/docs-edit#connecting-a-mobile-client) \ No newline at end of file diff --git a/docs/raspiblitz_deployment.md b/docs/raspiblitz_deployment.md index 08f4e9b..49e7f1c 100644 --- a/docs/raspiblitz_deployment.md +++ b/docs/raspiblitz_deployment.md @@ -276,4 +276,7 @@ $ sudo systemctl start sphinx-relay.service ### tail logs -`journalctl -u sphinx-relay -f` \ No newline at end of file +`journalctl -u sphinx-relay -f` + + +[Back to README](https://github.com/dimaatmelodromru/sphinx-relay/tree/docs-edit#connecting-a-mobile-client) \ No newline at end of file From 809faa94f6ecea5ca28b524cfb9294f580bfaa7b Mon Sep 17 00:00:00 2001 From: user Date: Mon, 10 Aug 2020 18:29:32 +0300 Subject: [PATCH 8/8] run as a service updated for mynode+raspiblitz --- docs/myNode_deployment.md | 16 ++++++++-------- docs/raspiblitz_deployment.md | 14 +++++++------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/docs/myNode_deployment.md b/docs/myNode_deployment.md index 351456c..4c457cf 100644 --- a/docs/myNode_deployment.md +++ b/docs/myNode_deployment.md @@ -141,7 +141,7 @@ $ sudo su admin ``` Create a file named sphinx-relay.service ```sh -$ sudo nano /etc/systemd/system/sphinx/sphinx-relay.service +$ sudo nano /etc/systemd/system/sphinx-relay.service ``` Copy and paste the following text to add it to the file: ```sh @@ -172,17 +172,17 @@ Save and exit: Let's run! ```sh -$ sudo systemctl enable sphinx-relay.service -$ sudo systemctl start sphinx-relay.service +$ sudo systemctl enable sphinx-relay +$ sudo systemctl start sphinx-relay ``` Check if Relay successfully started. ```sh -$ sudo systemctl status sphinx-relay.service +$ sudo systemctl status sphinx-relay ``` ### To stop the program ```sh -$ sudo systemctl stop sphinx-relay.service +$ sudo systemctl stop sphinx-relay ``` # To update Sphinx-Relay @@ -191,7 +191,7 @@ $ sudo systemctl stop sphinx-relay.service Login as `admin` and stop the program. ```sh -$ sudo systemctl stop sphinx-relay.service +$ sudo systemctl stop sphinx-relay ``` login as user `bitcoin`. @@ -286,8 +286,8 @@ $ exit ``` Turn the service on and check the status. ```sh -$ sudo systemctl enable sphinx-relay.service -$ sudo systemctl start sphinx-relay.service +$ sudo systemctl enable sphinx-relay +$ sudo systemctl start sphinx-relay ``` ### tail logs diff --git a/docs/raspiblitz_deployment.md b/docs/raspiblitz_deployment.md index 49e7f1c..2a61cfc 100644 --- a/docs/raspiblitz_deployment.md +++ b/docs/raspiblitz_deployment.md @@ -143,7 +143,7 @@ $ sudo su admin ``` Create a file named sphinx-relay.service ```sh -$ sudo nano /etc/systemd/system/sphinx/sphinx-relay.service +$ sudo nano /etc/systemd/system/sphinx-relay.service ``` Copy and paste the following text to add it to the file: ```sh @@ -174,16 +174,16 @@ Save and exit: Let's run! ```sh -$ sudo systemctl enable sphinx-relay.service -$ sudo systemctl start sphinx-relay.service +$ sudo systemctl enable sphinx-relay +$ sudo systemctl start sphinx-relay ``` Check if Relay successfully started. ```sh -$ sudo systemctl status sphinx-relay.service +$ sudo systemctl status sphinx-relay ``` ### To stop the program ```sh -$ sudo systemctl stop sphinx-relay.service +$ sudo systemctl stop sphinx-relay ``` # To update Sphinx-Relay @@ -270,8 +270,8 @@ $ exit ``` Turn the service on and check the status. ```sh -$ sudo systemctl enable sphinx-relay.service -$ sudo systemctl start sphinx-relay.service +$ sudo systemctl enable sphinx-relay +$ sudo systemctl start sphinx-relay ``` ### tail logs