Skip to content

Commit

Permalink
better instructions for preparing a remote node
Browse files Browse the repository at this point in the history
  • Loading branch information
openoms committed Dec 10, 2020
1 parent f18625d commit 840afdf
Showing 1 changed file with 26 additions and 20 deletions.
46 changes: 26 additions & 20 deletions prepare_remote_node.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,67 +5,73 @@ This guide shows how to prepare a RaspiBlitz to accept this connection.

## LAN connection

### In the node terminal - allow remote RPC connections to Bitcoin Core
This can be skipped if you [connect through Tor](#tor-connection))
In the terminal of the node - allow remote RPC connections to Bitcoin Core
This can be skipped if you [connect through Tor](#tor-connection)

1) #### Edit the bitcoin.conf:
1) Edit the bitcoin.conf
`$ sudo nano /mnt/hdd/bitcoin/bitcoin.conf`

Add the values:
(edit to your local subnet - the first 3 numbes of the LAN IP address, example here: 192.168.1)
(edit to your local subnet - the first 3 numbes of the LAN IP address, the example used here is: 192.168.1)
(can keep the other `rpcallowip` and `rpcbind` entires especially for the localhost: 127.0.0.1)
```
rpcallowip=192.168.1.0/24
rpcbind=0.0.0.0
```
2) #### Restart Bitcoin Core:
2) Restart Bitcoin Core

`$ sudo systemctl restart bitcoind`

3) #### The firewall needs to be opened to allow the RPC connection from LAN
3) Open the firewall to allow the RPC connection from LAN

(edit to your local subnet):
`sudo ufw allow from 192.168.1.0/24 to any port 8332`
`ufw enable`

### Take note of the `LAN_ADDRESS` of the remote node and fill it in to the `rpc_host` in `joinmarket.cfg`
4) Take note of the `LAN_ADDRESS` of the remote node and fill it in to the `rpc_host` in `joinmarket.cfg`

## Tor connection

### On the node - activate Tor and create a Hidden Service
On the node - activate Tor and create a Hidden Service

Make sure that Tor is active in the SERVICES menu.
Make sure that Tor is installed or active in the SERVICES menu

#### Create a Hidden Service to forward the bitcoin RPC port

On the RaspiBlitz since v1.4 there is a script to create a hidden service:
1) On the RaspiBlitz since v1.4 there is a script to create a hidden service:
`./config.scripts/internet.hiddenservice.sh bitcoinrpc 8332 8332`

2) Take note of the `Tor_Hidden_Service.onion` and fill in to the `rpc_host` in the `joinmarket.cfg`

Alternatively proceed manually:

1) #### Open the Tor configuration file:
1) Open the Tor configuration file
`$ sudo nano /etc/tor/torrc`

2) #### Insert the lines:
2) Insert the lines
```bash
# Hidden Service v3 for bitcoinrpc
HiddenServiceDir /mnt/hdd/tor/bitcoinrpc
HiddenServiceVersion 3
HiddenServicePort 8332 127.0.0.1:8332
```
3) #### Restart Tor:
3) Restart Tor

`$ sudo systemctl restart tor`

4) #### Take note of the `Tor_Hidden_Service.onion`:
4) Take note of the `Tor_Hidden_Service.onion`

`$ sudo cat /mnt/hdd/tor/bitcoinrpc/hostname`

5) #### Fill in the `Tor_Hidden_Service.onion` to the `rpc_host` in the `joinmarket.cfg`
5) Fill in the `Tor_Hidden_Service.onion` to the `rpc_host` in the `joinmarket.cfg`


### Take note of the `Tor_Hidden_Service.onion` and fill in to the `rpc_host` in the `joinmarket.cfg`
Remember to use `torify` with the python scripts when connecting remotely through Tor - applied automatically in the JoininBox

### Remember to use `torify` with the python scripts when connecting remotely through Tor.
(Applied automatically in the JoininBox)
Example:
`torify wallet-tool.py wallet.jmdat`
Example:
`torify wallet-tool.py wallet.jmdat`

also need to [allow Tor to connect to localhost](FAQ.md#allow-tor-to-connect-to-localhost)
## Resources:

* [JoinMarket on the RaspiBlitz guide](https://github.com/openoms/bitcoin-tutorials/blob/master/joinmarket/README.md)
Expand Down

0 comments on commit 840afdf

Please sign in to comment.