* **address** - `string` - The first address of the internal chain for this `xpub`, derivation path `M/1/0`. Use compressed P2PHK address regardless of HD derivation scheme.
* **signature** - `string` - The base64-encoded signature of the double SHA256 hash of `[varuint length of xpub string, xpub string]`. Signature scheme follows [bitcoinjs-message](https://github.com/bitcoinjs/bitcoinjs-message/blob/master/index.js) with a message prefix matching the [coin type](https://github.com/bitcoinjs/bitcoinjs-lib/blob/v3.1.1/src/networks.js). Use the ECPair associated with the `M/1/0` address to sign.
* **at** - `string` (optional) - Access Token (json web token). Required if authentication is activated.
* **at** - `string` (optional) - Access Token (json web token). Required if authentication is activated. Alternatively, the access token can be passed through the `Authorization` HTTP header (with the `Bearer` scheme).
The 3 configuration files of Dojo provide a few advanced options allowing to tune your setup.
The configuration files of Dojo provide a few advanced options allowing to tune your setup.
A word of caution, though, the default values of these options try to maximize your privacy at a network level. All the advanced setups described in this document may damage your privacy. Use at your own risk!
A word of caution, though, the default values of these options try to maximize your privacy at a network level. Most of the advanced setups described in this document may damage your privacy. Use at your own risk!
Users can choose a full install (Dojo + bitcoin full node) or installing using an external full node.
1. [Full install using a VirtualBox](#macos-installation-using-a-virtual-machine)
2. [Full install using Docker for MacOS](#macos-installation-using-docker-for-macos)
3. [Install the Dojo using an external full node](#install-the-dojo-using-an-external-full-node)
## 1. MacOS Installation using a Virtual Machine
__The instructions below are for a full install of the Dojo, including a new bitcoind node that will synch from scratch__
This installation was tested on an iMac (mid 2011) with a 2.7GHz i5 processor with 8GB RAM and 1TB external Hard Drive. For this specific machine, this proved to be a more stable alternative to installing Docker for Mac.
### Getting Started
#### Download and install Virtualbox with Debian 9:
Follow the instructions in this [video](https://www.youtube.com/watch?v=6M1DivpQSdo&t=703s). This will guide you to set up the VirtualBox and Debian 9. Make sure to follow all the steps, including the virtual box additions towards the end.
Also, remember to install the virtual box at a directory where you have __enough free space__ to install the Dojo. Specially if you are running a full node.
After the setup is complete, start the virtual box and open a terminal window then proceed to install the Dojo following these [instructions](https://github.com/Samourai-Wallet/samourai-dojo/blob/develop/doc/DOCKER_setup.md#install).
## 2. MacOs Installation using Docker for MacOs
This installation was tested on an iMac (mid 2011) with a 2.7GHz i5 processor with 8GB RAM and 1TB external Hard Drive.
## Getting Started
### Getting Started
#### Create a new user:
1. Launch System Preferences by clicking the **System Preferences** icon in the **Dock**, or selecting **System Preferences** from the Apple menu.
1. Launch System Preferences by clicking the __System Preferences__ icon in the __Dock__, or selecting __System Preferences__ from the Apple menu.
2. Click on __Users & Groups__
3. If settings are locked, click on the __Lock__ at the bottom of window and enter your password.
4. Click on __+__ to add a new User
5. Under __New Account__ select __Administrator__
6. Fill the remaining fields with your choice of User Name and Password
#### Move the __New User Folder__ into the __External HD__
##### Move the __New User Folder__ into the __External HD__
Note: _This is an important step, otherwise, it's probable that when you run the container, it will be installed in your main OS Hard Drive and will run out of space as it validates the Bitcoin blockchain._
1. Open **Finder** and navigate to your startup drive's **/Users** folder. For most people, this is **/Macintosh HD/Users**. In the **Users** **folder**, you'll find your user's folder.
2. On your external Hard Drive, create a folder named **Users**.
3. Select your user folder and drag it to the external HD **/Users** folder you created. _Because you're using a different drive for the destination, the operating system will copy the data rather than move it. This ok for now but delete it later._
1. Open __Finder__ and navigate to your startup drive's __/Users__ folder. For most people, this is __/Macintosh HD/Users__. In the __Users__ __folder__, you'll find your user's folder.
2. On your external Hard Drive, create a folder named __Users__.
3. Select your user folder and drag it to the external HD __/Users__ folder you created. _Because you're using a different drive for the destination, the operating system will copy the data rather than move it. This ok for now but delete it later._
4. Launch System Preferences again.
5. In the **Users & Groups** click the lock icon in the bottom left corner, then provide an administrator name and password.
6. From the list of user accounts, right-click on the account whose home folder you moved, and select **Advanced Options** from the pop-up menu.
5. In the __Users & Groups__ click the lock icon in the bottom left corner, then provide an administrator name and password.
6. From the list of user accounts, right-click on the account whose home folder you moved, and select __Advanced Options__ from the pop-up menu.
_Do not make any changes to Advanced Options except for those noted here. Doing so can cause quite a few unforeseen problems that could lead to data loss or the need to reinstall the operating system._
7. In the **Advanced Options** sheet, click **Choose**, located to the right of the **Home directory** field.
8. Navigate to the location you moved your home folder to, select the new home folder, and click **OK**.
9. Click **OK** to dismiss the **Advanced Options** sheet, and then close **System Preferences**.
7. In the __Advanced Options__ sheet, click __Choose__, located to the right of the __Home directory__ field.
8. Navigate to the location you moved your home folder to, select the new home folder, and click __OK__.
9. Click __OK__ to dismiss the __Advanced Options__ sheet, and then close __System Preferences__.
10. __Restart your Mac__
#### Download and install Docker, Kitematic and TOR
##### Download and install Docker, Kitematic and TOR
1. Make sure your system fills the [requirements]([https://docs.docker.com/docker-for-mac/install/](https://docs.docker.com/docker-for-mac/install/)) (particularly MacOS Sierra 10.12 or higher. If not, upgrade before proceeding).
2. [Download Docker]([https://docs.docker.com/docker-for-mac/install/](https://docs.docker.com/docker-for-mac/install/)) and follow the installation steps.
3. _Optional_: Download [Kitematic]([https://kitematic.com/) and follow installation instructions.
(_This may be system specific but I've found that monitoring the logs with Kitematic was more stable than using the Terminal_).
4. Install [Tor Browser](https://www.torproject.org/projects/torbrowser.html.en) on the host machine.
## Adjust Docker Settings
### Adjust Docker Settings
1. Click on the Docker icon (![whale menu](https://docs.docker.com/docker-for-mac/images/whale-x.png)) at the status bar and select __Preferences__.
2. Under Disk, click on __Reveal in Finder__ and double check that the disk image is saved under the external HD.
3. __Adjust Disk__ Image size to 400GB+ and click Apply.
4. Click __Advanced__ and increase the CPU count, Memory and Swap sizes. Adjusting these will speed up the blockchain validation process
(_At 4 CPUs, 8GB of RAM and a 4GiB Swap - the initial block download took 4.5 days at the time of writing_).
## Install the DOJO
### Install the DOJO
Follow the instructions [here](https://github.com/Samourai-Wallet/samourai-dojo/blob/develop/doc/DOCKER_setup.md) starting at the step:
__"Download the most recent release of Dojo from Github"__
_Note: For tracking progress, open Kitematic and follow the bitcoind logs. You'll be able to see the Blockchain verification process under the _progress_ log variable (1.00 = fully validated). This process takes a long time. Just let it do its thing. In my system it took 3 days._
@ -52,3 +82,39 @@ __Some possible optimization tips:__
. This may optimize speed: open __Activity Monitor__, check the PID (Process ID) of your docker process. Open Terminal and type:
`sudo renice-20 -p [enter your PID]`
## 3. Install the Dojo using an external full node
This installation was tested on an iMac (late 2014) with a 3.5GHz i5 processor with 12GB RAM and 1TB Internal Hard Drive. This Setup is Geared for using Docker on Mac and pointing to an external bitcoind.
### Getting Started
#### Download and install Docker and TOR
1. Make sure your system fills the [requirements]([https://docs.docker.com/docker-for-mac/install/](https://docs.docker.com/docker-for-mac/install/)) (particularly MacOS Sierra 10.12 or higher. If not, upgrade before proceeding).
2. [Download Docker]([https://docs.docker.com/docker-for-mac/install/](https://docs.docker.com/docker-for-mac/install/)) and follow the installation steps.
3. Install [Tor Browser](https://www.torproject.org/projects/torbrowser.html.en) on the host machine.
### Adjust Docker Settings
1. Click on the Docker icon (![whale menu](https://docs.docker.com/docker-for-mac/images/whale-x.png)) at the status bar and select __Preferences__.
2. Under Disk, click on __Reveal in Finder__ and allow the disk image to be saved in defult location
3. __Adjust Disk__ Image size to 400GB+ and click Apply.
(Since pointing to an external bitcoind and not having an internal container for bitcoind the Disk Image Size could potentially be much smaller. Currently mine shows 13.4 GB on Disk.)
4. Click __Advanced__ and increase the CPU count, Memory and Swap sizes. Adjusting these will speed up the blockchain validation process
### Install the DOJO Pointing and Existing bitcoind
Follow the instructions [here](https://github.com/Samourai-Wallet/samourai-dojo/blob/develop/doc/DOCKER_setup.md) starting at the step:
__"Download the most recent release of Dojo from Github"__ until you reach __"Launch the Installation of Your Dojo with"__ ***DO NOT LAUNCH DOJO YET***
Once you Reach Step __"Launch the Installation of Your Dojo with"__ from above you will need to read and follow the instructions from [here](https://github.com/Samourai-Wallet/samourai-dojo/blob/develop/doc/DOCKER_advanced_setups.md)
Once adjustments are made to your external bitcoind bitcoin.conf __(location dependent on what device you have bitcoind)__ and docker-bitcoind.conf.tpl __(dojo_dir > docker > my-dojo > conf)__ you can proceed with Install and revert back to original instructions [here](https://github.com/Samourai-Wallet/samourai-dojo/blob/develop/doc/DOCKER_setup.md) at section __"Launch the Installation of Your Dojo with"__
_Note: For tracking progress, open terminal, change directory to my-dojo and run /dojo.sh logs tracker
__Some possible optimization tips:__
If you notice that progress has stopped. Click the whale icon and select Restart. Restart Logs Tracker from step above to verify progress has resumed.
This may optimize speed: open __Activity Monitor__, check the PID (Process ID) of your docker process. Open Terminal and type:
@ -177,16 +177,17 @@ Note: The upgrade process will override all manual modifications of the files st
## Configuration files ##
Each new release of Dojo is packaged with 3 template files stored in the `<dojo_dir>/docker/my-dojo/conf` directory:
Each new release of Dojo is packaged with 4 template files stored in the `<dojo_dir>/docker/my-dojo/conf` directory:
- docker-common.conf.tpl
- docker-bitcoin.conf.tpl
- docker-mysql.conf.tpl
- docker-node.conf.tpl
These templates files define default values for configuration options of your Dojo.
These template files define default values for configuration options of your Dojo.
During the first-time installation (dojo.sh install) these templates are used to initialize the configuration files (files with .conf extension) that will be used by your Dojo.
During an upgrade (dojo.sh upgrade), the content of the templates files is merged with the content of the configuration files, preserving the values that you may have modified in the configuration files. A backup of the configuration files is saved in the same directory (files with .save extension).
During an upgrade (dojo.sh upgrade), the content of the template files is merged with the content of the configuration files, preserving the values that you may have modified in the configuration files. A backup of the configuration files is saved in the same directory (files with .save extension).
Most options provided in the configuration files can be later modified. New values will become active after a call to
@ -264,9 +265,11 @@ Sign in with the value entered for `NODE_ADMIN_KEY`.
Once the database has finished syncing, you can pair your Samourai Wallet with your Dojo in 2 steps:
* Open the maintenance tool in a Tor browser (Tor v3 onion address) and sign in with your admin key.
1. Open the maintenance tool in a Tor browser (Tor v3 onion address) and sign in with your admin key.
* Get your smartphone and launch the Samourai Wallet app. Scan the QRCode displayed in the "Pairing" tab of the maintenance tool.
2. Get your smartphone and launch the Samourai Wallet app. Scan the QRCode displayed in the "Pairing" tab of the maintenance tool.
If you experience any problems when pairing, try re-installing the app and select "Connect to existing Dojo" from the [⋮] menu.
* **at** - `string` (optional) - Access Token (json web token). Required if authentication is activated.
* **at** - `string` (optional) - Access Token (json web token). Required if authentication is activated. Alternatively, the access token can be passed through the `Authorization` HTTP header (with the `Bearer` scheme).
* **at** - `string` (optional) - Access Token (json web token). Required if authentication is activated.
* **at** - `string` (optional) - Access Token (json web token). Required if authentication is activated. Alternatively, the access token can be passed through the `Authorization` HTTP header (with the `Bearer` scheme).
@ -38,7 +38,7 @@ GET /multiaddr?active=...[&new=...][&bip49=...][&bip84=...][&pubkey=...]
* **bip49** - `string` - A pipe-separated list of **new** extended public keys to be derived via [BIP49](https://github.com/bitcoin/bips/blob/master/bip-0049.mediawiki) and/or new P2WPKH/P2SH loose addresses
* **bip84** - `string` - A pipe-separated list of **new** extended public keys to be derived via [BIP84](https://github.com/bitcoin/bips/blob/master/bip-0084.mediawiki) and/or new P2WPKH Bech32 loose addresses
* **pubkey** - `string` - A pipe-separated list of **new** public keys to be derived as P2PKH, P2WPKH/P2SH, P2WPKH Bech32 addresses
* **at** - `string` (optional) - Access Token (json web token). Required if authentication is activated.
* **at** - `string` (optional) - Access Token (json web token). Required if authentication is activated. Alternatively, the access token can be passed through the `Authorization` HTTP header (with the `Bearer` scheme).
* **at** - `string` (optional) - Access Token (json web token). Required if authentication is activated.
* **at** - `string` (optional) - Access Token (json web token). Required if authentication is activated. Alternatively, the access token can be passed through the `Authorization` HTTP header (with the `Bearer` scheme).
* **active** - `string` - A pipe-separated list of extended public keys and/or loose addresses and/or pubkeys (`xpub1|address1|address2|pubkey1|...`)
* **page** - `integer` - Index of the requested page (first page is index 0)
* **count** - `integer` - Number of transactions returned per page
* **at** - `string` (optional) - Access Token (json web token). Required if authentication is activated.
* **at** - `string` (optional) - Access Token (json web token). Required if authentication is activated. Alternatively, the access token can be passed through the `Authorization` HTTP header (with the `Bearer` scheme).
@ -36,7 +36,7 @@ GET /unspent?active=...&new=...&bip49=...&bip84=...&pubkey=...
* **bip49** - `string` - A pipe-separated list of **new** extended public keys to be derived via [BIP49](https://github.com/bitcoin/bips/blob/master/bip-0049.mediawiki) and/or new P2WPKH/P2SH loose addresses
* **bip84** - `string` - A pipe-separated list of **new** extended public keys to be derived via [BIP84](https://github.com/bitcoin/bips/blob/master/bip-0084.mediawiki) and/or new P2WPKH Bech32 loose addresses
* **pubkey** - `string` - A pipe-separated list of **new** public keys to be derived as P2PKH, P2WPKH/P2SH, P2WPKH Bech32 addresses
* **at** - `string` (optional) - Access Token (json web token). Required if authentication is activated.
* **at** - `string` (optional) - Access Token (json web token). Required if authentication is activated. Alternatively, the access token can be passed through the `Authorization` HTTP header (with the `Bearer` scheme).
* **:xpub** - `string` - The extended public key for the HD Account
* **at** - `string` (optional) - Access Token (json web token). Required if authentication is activated.
* **at** - `string` (optional) - Access Token (json web token). Required if authentication is activated. Alternatively, the access token can be passed through the `Authorization` HTTP header (with the `Bearer` scheme).
Authenticate to the backend by providing the API key expected by the server. If authentication succeeds, the endpoint returns a json embedding an access token and a refresh token (JSON Web Tokens). The access token must be passed as an argument for all later calls to the backend (account & pushtx REST API + websockets). The refresh token must be passed as an argument for later calls to /auth/refresh allowing to generate a new access token.
Authenticate to the backend by providing the API key expected by the server. If authentication succeeds, the endpoint returns a json embedding an access token and a refresh token (JSON Web Tokens). The access token must be passed as an argument or in the `Authorization` HTTP header for all later calls to the backend (account & pushtx REST API + websockets). The refresh token must be passed as an argument or in the `Authorization` HTTP header for later calls to /auth/refresh allowing to generate a new access token.
Authentication is activated in /keys/inndex.js configuration file
Request a new access token from the backend. A valid refresh token must be passed as an argument.
Request a new access token from the backend. A valid refresh token must be passed as an argument or through the `Authorization` HTTP header (with the `Bearer` scheme).
* **at** - `string` (optional) - Access Token (json web token). Required if authentication is activated.
* **at** - `string` (optional) - Access Token (json web token). Required if authentication is activated. Alternatively, the access token can be passed through the `Authorization` HTTP header (with the `Bearer` scheme).
* **type** - `string` - Whether this is a newly-created account or one being restored. Recognized values are `'new'` and `'restore'`.
* **segwit** - `string` (optional) - What type of SegWit support for this xpub, if any. Valid values: `'bip49'` and `'bip84'`
* **force** - `boolean` (optional) - Force an override of derivation scheme even if xpub is locked. Used for `'restore'` operation.
* **at** - `string` (optional) - Access Token (json web token). Required if authentication is activated.
* **at** - `string` (optional) - Access Token (json web token). Required if authentication is activated. Alternatively, the access token can be passed through the `Authorization` HTTP header (with the `Bearer` scheme).
* **address** - `string` - The first address of the internal chain for this `xpub`, derivation path `M/1/0`. Use compressed P2PHK address regardless of HD derivation scheme.
* **message** - `string` - Either `"lock"` or `"unlock"`
* **signature** - `string` - The base64-encoded signature of the double SHA256 hash of `[varuint length of message string, message string]`. Signature scheme follows [bitcoinjs-message](https://github.com/bitcoinjs/bitcoinjs-message/blob/master/index.js) with a message prefix matching the [coin type](https://github.com/bitcoinjs/bitcoinjs-lib/blob/v3.1.1/src/networks.js). Use the ECPair associated with the `M/1/0` address to sign.
* **at** - `string` (optional) - Access Token (json web token). Required if authentication is activated.
* **at** - `string` (optional) - Access Token (json web token). Required if authentication is activated. Alternatively, the access token can be passed through the `Authorization` HTTP header (with the `Bearer` scheme).