Skip to content

Commit

Permalink
Merge pull request #152 from Samourai-Wallet/feat_mydojo_whirlpool
Browse files Browse the repository at this point in the history
add new optional whirlpool container
  • Loading branch information
kenshin-samourai authored Apr 28, 2020
2 parents d5f9932 + cae4ffc commit 7ea3484
Show file tree
Hide file tree
Showing 14 changed files with 410 additions and 38 deletions.
75 changes: 75 additions & 0 deletions doc/DOCKER_advanced_setups.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ A word of caution, though, the default values of these options try to maximize y
## Table of Content ##
- [Local indexer of Bitcoin addresses](#local_indexer)
- [Local Electrum server used as data source for imports/rescans](#local_electrum)
- [Local Whirlpool client](#local_whirlpool)
- [External Bitcoin full node](#external_bitcoind)
- [bitcoind RPC API ans ZMQ notifications exposed to external apps](#exposed_rpc_zmq)
- [Static onion address for bitcoind hidden service](#static_onion)
Expand Down Expand Up @@ -117,6 +118,80 @@ nano ./conf/docker-node.conf
```


<a name="local_whirlpool"/>

## Local Whirlpool client ##

This setup allows to install and run a [Whirlpool client](https://github.com/Samourai-Wallet/whirlpool-client-cli) inside MyDojo.

The client can be configured and controlled through a REST API exposed as a Tor hidden service.


### Procedure ###

```
# If you're installing a new Dojo or if you're upgrading from a Dojo version < 1.6, edit the docker-whirlpool.conf.tpl file
nano ./conf/docker-whirlpool.conf.tpl
# Otherwise, edit the docker-whirlpool.conf file
nano ./conf/docker-whirlpool.conf
#
# Set the value of WHIRLPOOL_INSTALL to "on"
## Save and exit nano
#
```

### Installation of Whirlpool GUI ###

The [Whirlpool GUI application]((https://github.com/Samourai-Wallet/whirlpool-gui)) provides a graphical interface for your Whirlpool client.

These steps describe how to install the Whirlpool GUI application how a computer and how to connect it to your Whirlpool client.


**Requirements**

- MyDojo has been fully initialized,
- Whirlpool client has been activated in MyDojo,
- Your Samourai Wallet is paired to MyDojo,
- MyDojo is running.
- Tor browser is installed on the computer that will run the Whirlpool GUI application.


**Procedure**

- Retrieve the onion address of the API provided by your Whirlpool client

```
# Open a terminal console on the computer hosting your Dojo
# Retrieve the onion address of the Whirlpool API
./dojo.sh onion
```

- Install and configure the Whirlpool GUI application

```
# If needed, install Tor browser on the computer that will run the Whirlpool GUI application
# Launch the Tor browser
# Install the Whirlpool GUI application on the computer and launch it
# Select 'Advanced: remote CLI'
# Set 'CLI address' with 'http://your_onion_address' where your_onion_address is the address of the Whirlpool API
# Check that the 'Tor proxy' field has the correct socks5 port used by your Tor browser.
# Click 'Connect'.
# Paste the pairing payload from your mobile device when prompted:
# Select the Samourai Wallet Menu (3 dots top right),
# Go to Settings -> Transactions -> Pair to Whirlpool GUI,
# Copy the payload and send to your main computer using any method you prefer,
# Paste the payload.
# The GUI will restart and prompt for you to enter your Samourai Wallet passphrase.
# You are all set and ready to mix!
```

<a name="external_bitcoind"/>

## External Bitcoin full node ##
Expand Down
83 changes: 47 additions & 36 deletions doc/DOCKER_setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,42 +27,41 @@ MyDojo is a set of Docker containers providing a full Samourai backend composed
## Architecture ##


------------------- ------------------- --------------------
| Samourai Wallet | | Sentinel | | Bitcoin full nodes |
------------------- ------------------- --------------------
|_______________________|_______________________|
|
------------

Tor network

------------
|
Host machine | (Tor hidden services)
______________________________ | _____________________________
| | |
| --------- dmznet |
| --------| Tor |------------ |
| | --------- | |
| | | |
| --------- | |
| --| Nginx |-------- | |
| | --------- | | |
|- - - - -|- - - - - - - - - - -|- - - - - - - - -|- - - - - - |
| | | | |
| ---------- ---------- ---------- |
| | Nodejs |----------| Explorer |------| Bitcoind | |
| ---------- ---------- ---------- |
| | | | | |
| | ------- | | |
| | | | | |
| ---------- | ---------- | |
| | MySQL | ----| Indexer |----------- |
| ---------- ---------- |
| dojonet |
|______________________________________________________________|


------------------ -------------------- --------------- -----------------------
| Mobile Wallets | | Bitcoin full nodes | | Whirlpool GUI | | Whirlpool Coordinator |
------------------ -------------------- --------------- -----------------------
|_______________________|____________________|_______________________|
|
-------------
| |
---------------------- | Tor network |
| | |
| ------------
| |
| | (Tor hidden services)
_____ | ____________________________ | _________________________________________
| | | | |
| | | --------- dmznet |
| | | -----------| Tor |------------------------ |
| | | | --------- | |
| | --------- | |
| | | nginx | - - - - - - - - - - - - - - - - - - - - - -|- - - - - - |
| | --------- | |
| | | | | | |
| | --- | ---------------------------- | |
| | | | | | | |
| ----------- | ---------- ---------- ---------- |
| | whirlpool | | | Nodejs |----------| Explorer |------| Bitcoind | |
| ----------- | ---------- ---------- ---------- |
| | | | | | |
| | | ------- | | |
| | | | | | |
| | ---------- | ---------- | |
| | | MySQL | ----| Indexer |----------- |
| | ---------- ---------- |
| whirlnet | dojonet |
|_________________|______________________________________________________________|
Host machine



Expand Down Expand Up @@ -160,6 +159,7 @@ This procedure allows to install a new Dojo from scratch.
* Dojo provides a few additional settings for advanced setups:
* installation of an address indexer used for fast imports and rescans,
* support of an external electrum server (ElectrumX or electrs) used for fast imports and rescans,
* installation of a Whirlpool client,
* static onion address for your full node,
* bitcoind RPC API exposed to external apps,
* use of an external full node,
Expand Down Expand Up @@ -258,6 +258,7 @@ Available commands:
dojo.sh logs pushtx : display the logs of the pushTx API (nodejs)
dojo.sh logs pushtx-orchest : display the logs of the Orchestrator (nodejs)
dojo.sh logs explorer : display the logs of the Explorer
dojo.sh logs whirlpool : display the logs of the Whirlpool client
Available options (for api, tracker, pushtx, pushtx-orchest and explorer modules):
-d [VALUE] : select the type of log to be displayed.
Expand All @@ -277,6 +278,12 @@ Available commands:
upgrade Upgrade your Dojo.
version Display the version of dojo.
whirlpool [action] Interact with the internal whirlpool-cli mdule."
Available actions:"
apikey : display the API key generated by whirlpool-cli."
reset : reset the whirlpool-cli instance (delete configuration file)."
```


Expand Down Expand Up @@ -346,6 +353,10 @@ The maintenance tool is accessed as a Tor hidden service (static onion address).

The block explorer is accessed as a Tor hidden service (static onion address).

The Whirlpool API is accessed as a Tor hidden service (static onion address).

The Whirlpool client connects to the Whirlpool Coordinator hidden service.

The Bitcoin node only allows incoming connections from Tor (ephemeral onion address).

The Bitcoin node attempts outgoing connections to both Tor and clearnet nodes (through the Tor local proxy).
3 changes: 2 additions & 1 deletion docker/my-dojo/.env
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ DOJO_VERSION_TAG=1.6.0
DOJO_DB_VERSION_TAG=1.1.1
DOJO_BITCOIND_VERSION_TAG=1.5.0
DOJO_NODEJS_VERSION_TAG=1.6.0
DOJO_NGINX_VERSION_TAG=1.4.0
DOJO_NGINX_VERSION_TAG=1.5.0
DOJO_TOR_VERSION_TAG=1.4.0
DOJO_EXPLORER_VERSION_TAG=1.3.0
DOJO_INDEXER_VERSION_TAG=1.0.0
DOJO_WHIRLPOOL_VERSION_TAG=1.0.0


#########################################
Expand Down
20 changes: 20 additions & 0 deletions docker/my-dojo/conf/docker-whirlpool.conf.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#########################################
# CONFIGURATION OF WHIRLPOOL CONTAINER
#########################################

# Install and run an instance of whirlpool-cli inside Docker
# Value: on | off
WHIRLPOOL_INSTALL=off


#
# EXPERT SETTINGS
#

# Activate debug logs
# Value: on | off
WHIRLPOOL_DEBUG=off

# Activate more debug logs
# Value: on | off
WHIRLPOOL_DEBUG_CLIENT=off
9 changes: 9 additions & 0 deletions docker/my-dojo/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ services:
depends_on:
- node
networks:
whirlnet:
ipv4_address: 172.30.1.3
dmznet:
ipv4_address: 172.29.1.3
dojonet:
Expand All @@ -79,6 +81,7 @@ services:
env_file:
- ./.env
- ./conf/docker-explorer.conf
- ./conf/docker-whirlpool.conf
- ./conf/docker-tor.conf
restart: always
command: /restart.sh
Expand All @@ -103,6 +106,12 @@ networks:
driver: default
config:
- subnet: 172.29.0.0/16
whirlnet:
driver: bridge
ipam:
driver: default
config:
- subnet: 172.30.0.0/16

volumes:
data-mysql:
Expand Down
Loading

0 comments on commit 7ea3484

Please sign in to comment.