Verified Commit 93e7fe2b authored by Pavel Ševčík's avatar Pavel Ševčík
Browse files

Updated documentation

parent a735f575
......@@ -4,7 +4,7 @@ Remove an HD account from the server. All addresses and transactions associated
Note: this endpoint uses the HTTP `DELETE` verb.
```
```http request
DELETE /xpub/:xpub
```
......@@ -15,7 +15,7 @@ DELETE /xpub/:xpub
### Example
```
```http request
DELETE /xpub/xpub0123456789?address=1address&signature=Base64X==
```
......
......@@ -45,7 +45,7 @@ To date, the initial installation of the indexer requires 120GB of additionnal d
### Procedure ###
```
```sh
# If you're installing a new Dojo or if you're upgrading from a Dojo version <= 1.4.1, edit the docker-indexer.conf.tpl file
nano ./conf/docker-indexer.conf.tpl
......@@ -93,7 +93,7 @@ Important: Do not use an Electrum server operated by a third party or hosted on
### Procedure ###
```
```sh
# If you're installing a new Dojo or if you're upgrading from a Dojo version <= 1.4.1, edit the docker-indexer.conf.tpl file
nano ./conf/docker-indexer.conf.tpl
......@@ -129,7 +129,7 @@ The client can be configured and controlled through a REST API exposed as a Tor
### Procedure ###
```
```sh
# 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
......@@ -162,7 +162,7 @@ These steps describe how to install the Whirlpool GUI application how a computer
- Retrieve the onion address of the API provided by your Whirlpool client
```
```sh
# Open a terminal console on the computer hosting your Dojo
# Retrieve the onion address of the Whirlpool API
......@@ -207,7 +207,9 @@ The external full node mustn't be pruned.
The external full node must be configured for the support of Dojo. Edit the bitcoin.conf file of your external full node and check that the following lines are properly initialized.
```
The external full node must use `rpcauth` for authentication.
```sh
# Force bitcoind to accept JSON-RPC commands
server=1
......@@ -224,11 +226,8 @@ rpcport=...
# Check that the RPC API listens on an IP address accessible from the nodejs container
rpcbind=...
# Check that the RPC user is set
rpcuser=...
# Check that the RPC password is set
rpcpassword=
# Check that the rpcauth payload is set (generated by ./share/rpcuser/rpcuser.py)
rpcauth=...
# Enable publish hash block on an IP address accessible from the nodejs container
zmqpubhashblock=...
......@@ -242,7 +241,7 @@ zmqpubrawtx=...
#### Configuration of Dojo ####
```
```sh
# If you're installing a new Dojo, edit the docker-bitcoind.conf.tpl file
nano ./conf/docker-bitcoind.conf.tpl
......@@ -253,6 +252,8 @@ nano ./conf/docker-bitcoind.conf
# Set the value of BITCOIND_INSTALL to "off"
# Set the value of BITCOIND_IP with the IP address of you bitcoin full node
# Set the value of BITCOIND_RPC_PORT with the port used by your bitcoin full node for the RPC API
# Set the value of BITCOIND_RPC_USER with the user used by your bitcoin full node for the RPC API
# Set the value of BITCOIND_RPC_PASSWORD with the password used by your bitcoin full node for the RPC API
# Set the value of BITCOIND_ZMQ_RAWTXS with the port used by your bitcoin full node for ZMQ notifications of raw transactions
# (i.e. port defined for -zmqpubrawtx in the bitcoin.conf of your full node)
# Set the value of BITCOIND_ZMQ_BLK_HASH with the port used by your bitcoin full node for ZMQ notifications of block hashes
......@@ -288,7 +289,7 @@ By default, access to the RPC API of your bitcoind is restricted to Docker conta
The following steps allow to expose the RPC API and ZMQ notifications to applications running on your local machine but outside of Docker.
```
```sh
#
# If your Docker runs on macos or windows,
# retrieve the local IP address of the VM
......@@ -335,7 +336,7 @@ By default, Dojo creates a new onion address for your bitcoind at each startup.
The following steps allow to keep a static onion address (not recommended).
```
```sh
# Stop your Dojo
./dojo.sh stop
......@@ -364,7 +365,7 @@ By default, Dojo doesn't try to hide that Tor is being used. For the majority of
The following steps allow to activate the use of Tor bridges by Dojo.
```
```sh
# Stop your Dojo
./dojo.sh stop
......@@ -404,7 +405,7 @@ By default, Dojo is installed for running on Bitcoin mainnet.
The following steps allow to install an instance of Dojo running on Bitcoin testnet.
```
```sh
# Edit the docker-common.conf.tpl file
nano ./conf/docker-common.conf.tpl
......
......@@ -100,7 +100,7 @@ During an upgrade (dojo.sh upgrade), the content of the template files is merged
Most options provided in the configuration files can be later modified. New values will become active after a call to
```
```sh
./dojo.sh restart
```
......@@ -174,7 +174,7 @@ This procedure allows to install a new Dojo from scratch.
* Launch the installation of your Dojo with
```
```sh
./dojo.sh install
```
......@@ -183,7 +183,7 @@ Docker and Docker Compose are going to build the images and containers of your D
* Monitor the progress made for the initialization of the database with this command displaying the logs of the tracker
```
```sh
./dojo.sh logs nodejs
```
......@@ -192,7 +192,7 @@ Exit the logs with CTRL+C when the syncing of the database has completed.
* Retrieve the Tor onion addresses (v3) of the API and block explorer of your Dojo
```
```sh
./dojo.sh onion
```
......@@ -207,7 +207,7 @@ This procedure allows to upgrade your Dojo with a new version.
* Stop your Dojo with
```
```sh
./dojo.sh stop
```
......@@ -219,7 +219,7 @@ This procedure allows to upgrade your Dojo with a new version.
* Launch the upgrade of your Dojo with
```
```sh
./dojo.sh upgrade
```
......@@ -234,7 +234,7 @@ Note: The upgrade process will override all manual modifications of the files st
dojo.sh is a multifeature tool allowing to interact with your Dojo.
```
```sh
Usage: ./dojo.sh command [module] [options]
Available commands:
......@@ -306,7 +306,7 @@ A block explorer ([BTC RPC Explorer](https://github.com/janoside/btc-rpc-explore
You can retrieve the onion address of the block explorer with the command
```
```sh
./dojo.sh onion
```
......
......@@ -58,7 +58,7 @@ db | WARNING: no logs are available with the 'db' log driver
## Usage
- Retrieve the Tor onion addresses (v3) of the API and block explorer of your Dojo
```
```sh
./dojo.sh onion
```
Use Tor Browser for:
......@@ -68,16 +68,16 @@ Use Tor Browser for:
## Upgrade
- Open SSH terminal to your Synology
- Stop Dojo
```
```sh
cd <dojo_dir>
./docker/my-dojo/dojo.sh stop
```
- Backup
```
```sh
cp -r ./ ../dojo-backup
```
- Download latest Dojo from [Gitlab releases](https://code.samourai.io/dojo/samourai-dojo/-/releases)
```
```sh
mkdir newDojo
cd newDojo
wget https://code.samourai.io/dojo/samourai-dojo/-/archive/v1.7.0/samourai-dojo-v1.7.0.tar.gz
......@@ -86,10 +86,10 @@ cp -r ./ ../dojo-backup
cd ..
```
- Upgrade
```
```sh
./docker/my-dojo/dojo.sh upgrade
```
- Clean
```
```sh
rm -Rf newDojo
```
......@@ -54,7 +54,7 @@ First, we must prepare our host system for MyDojo by installing required operati
#### 3.1.1/ Install OS dependencies
```
```sh
> cd ~
> sudo apt-get update
> sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common unzip
......@@ -66,13 +66,13 @@ For an installation of Docker and Docker Compose with a different Linux distribu
If Docker is already installed on the host machine remove old Docker versions installed on the computer
```
```sh
> sudo apt-get remove docker docker-engine docker.io containerd runc
```
__Download Docker's official PGP key__
```
```sh
> curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
> sudo apt-key fingerprint 0EBFCD88
```
......@@ -81,7 +81,7 @@ Verify that you now have the key with the fingerprint `9DC8 5822 9FC7 DD38 854A
__Install Docker__
```
```sh
> sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
> sudo apt-get update
> sudo apt-get install docker-ce docker-ce-cli containerd.io
......@@ -89,7 +89,7 @@ __Install Docker__
__Test the installation of Docker__
```
```sh
> sudo docker --version
```
......@@ -98,14 +98,14 @@ This command should return the version of Docker if installation was successful.
__Install Docker Compose__
```
```sh
> sudo curl -L "https://github.com/docker/compose/releases/download/1.25.3/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
> sudo chmod +x /usr/local/bin/docker-compose
```
__Test the installation of Docker Compose__
```
```sh
> sudo docker-compose --version
```
......@@ -118,7 +118,7 @@ Creating a segregated user account for MyDojo is a good idea for security reason
#### 3.1.3/ Create a dojo user
```
```sh
> sudo useradd -s /bin/bash -d /home/dojo -m -G sudo dojo
> sudo passwd dojo
```
......@@ -127,19 +127,19 @@ Enter and confirm the password for the `dojo` user.
__Add the user to the docker group__
```
```sh
> sudo usermod -aG docker dojo
```
__Restart Host System__
```
```sh
> sudo shutdown -r now
```
Log back into the Host System with the `dojo` user and test the Docker installation
```
```sh
> docker run hello-world
```
......@@ -152,19 +152,19 @@ This step should be applied if you don't want to store MyDojo and Docker data un
__Stop the Docker Service__
```
```sh
> sudo systemctl stop docker
```
Create the directory that will store Docker data (replace `/path/to/target/directory/` by the correct path).
```
```sh
> sudo mkdir /path/to/target/directory/
```
Temporarily switch to root and create the daemon.json file storing the path to your Docker direct (replace `/path/to/target/directory/` by the correct path).
```
```sh
> sudo su - root
> sudo echo '{ "data-root": "/path/to/target/directory/" }' > /etc/docker/daemon.json
> exit
......@@ -180,7 +180,7 @@ Now that the Host System has been prepared, we will download the latest version
We first create a directory for housing our MyDojo files. In this guide we are naming this directory `dojo-app` and it will be located in the home directory of the `dojo` user.
```
```sh
> mkdir ~/dojo-app
```
......@@ -188,7 +188,7 @@ We first create a directory for housing our MyDojo files. In this guide we are n
Download and unpack the source archive for the latest version of MyDojo and copy these files to the newly created `dojo-app` directory with the following commands.
```
```sh
> cd ~
> wget https://code.samourai.io/dojo/samourai-dojo/-/archive/master/samourai-dojo-master.zip
> unzip samourai-dojo-master.zip -d .
......@@ -197,7 +197,7 @@ Download and unpack the source archive for the latest version of MyDojo and copy
Delete the source archive now that we have copied the files to our directory.
```
```sh
> rm -rf samourai-dojo-master
> rm samourai-dojo-master.zip
```
......@@ -207,7 +207,7 @@ Delete the source archive now that we have copied the files to our directory.
Change the working directory to the MyDojo configuration directory.
```
```sh
> cd ~/dojo-app/docker/my-dojo/conf
```
......@@ -215,7 +215,7 @@ __Note:__
You will be required to generate various random alphanumeric passwords to secure various aspects of your Dojo installation. You can generate these in any way you wish, but you may wish to use the following command in a terminal session to generate these passwords with sufficient entropy:
```
```sh
> cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 64 | head -n 1
```
......@@ -223,13 +223,13 @@ You will be required to generate various random alphanumeric passwords to secure
Edit the `docker-bitcoind.conf.tpl` file.
```
```sh
> nano docker-bitcoind.conf.tpl
```
Customize the content of the file
```
```sh
BITCOIND_RPC_USER=<provide_this_value>
BITCOIND_RPC_PASSWORD=<provide_this_value>
```
......@@ -245,13 +245,13 @@ Save and exit the file with `CTRL+X`, `Y` and `ENTER`.
Edit the ``docker-mysql.conf.tpl`` file.
```
```sh
> nano docker-mysql.conf.tpl
```
Customize the content of the file
```
```sh
MYSQL_ROOT_PASSWORD=<provide_this_value>
MYSQL_USER=<provide_this_value>
MYSQL_PASSWORD=<provide_this_value>
......@@ -264,13 +264,13 @@ Save and exit the file with `CTRL+X`, `Y` and `ENTER`.
Edit the `docker-node.conf.tpl` file.
```
```sh
> nano docker-node.conf.tpl
```
Customize the content of the file
```
```sh
NODE_API_KEY=<provide_this_value>
NODE_ADMIN_KEY=<provide_this_value>
NODE_JWT_SECRET=<provide_this_value>
......@@ -284,13 +284,13 @@ Save and exit the file with `CTRL+X`, `Y` and `ENTER`.
Edit the `docker-indexer.conf.tpl` file.
```
```sh
> nano docker-indexer.conf.tpl
```
Customize the content of the file
```
```sh
INDEXER_INSTALL=on
```
......@@ -301,13 +301,13 @@ Save and exit the file with `CTRL+X`, `Y` and `ENTER`.
Edit the `docker-explorer.conf.tpl` file.
```
```sh
> nano docker-explorer.conf.tpl
```
Customize the content of the file
```
```sh
EXPLORER_KEY=<provide_this_value>
```
......@@ -318,7 +318,7 @@ Save and exit the file with `CTRL+X`, `Y` and `ENTER`.
From this point on the install process is automatic. Launch the installation of MyDojo
```
```sh
> cd ~/dojo-app/docker/my-dojo
> ./dojo.sh install
```
......@@ -371,7 +371,7 @@ Note: You may notice errors returned by the Block Explorer during all these oper
Retrieve the onion address of the DMT with the commands
```
```sh
> cd ~/dojo-app/docker/my-dojo
> ./dojo.sh onion
```
......@@ -395,7 +395,7 @@ This procedure allows to upgrade MyDojo to the latest version.
#### 4.1.1/ Stop MyDojo
```
```sh
> cd ~/dojo-app/docker/my-dojo
> ./dojo.sh stop
```
......@@ -404,20 +404,20 @@ This procedure allows to upgrade MyDojo to the latest version.
Download the archive of latest version
```
```sh
> cd ~
> wget https://code.samourai.io/dojo/samourai-dojo/-/archive/master/samourai-dojo-master.zip
```
Uncompress the archive
```
```sh
> unzip samourai-dojo-master.zip -d .
```
Overwrite the dojo-app directory with the content of the archive
```
```sh
> cp -a samourai-dojo-master/. dojo-app/
```
......@@ -430,7 +430,7 @@ If applicable, edit the templates files stored in `~/dojo-app/docker/my-dojo/con
#### 4.1.4/ Start Upgrade
```
```sh
> cd ~/dojo-app/docker/my-dojo
> ./dojo.sh upgrade
```
......@@ -442,7 +442,7 @@ The shell script is going to rebuild the Docker containers. MyDojo will be autom
#### 4.1.5/ Cleanup
```
```sh
> cd ~
> rm -rf samourai-dojo-master
> rm samourai-dojo-master.zip
......@@ -455,7 +455,7 @@ This procedure allows to upgrade MyDojo to a specific version `X.Y.Z`
#### 4.2.1/ Stop MyDojo
```
```sh
> cd ~/dojo-app/docker/my-dojo
> ./dojo.sh stop
```
......@@ -464,20 +464,20 @@ This procedure allows to upgrade MyDojo to a specific version `X.Y.Z`
Download the archive of version `X.Y.Z`
```
```sh
> cd ~
> wget https://code.samourai.io/dojo/samourai-dojo/-/archive/vX.Y.Z/samourai-dojo-vX.Y.Z.zip
```
Uncompress the archive
```
```sh
> unzip samourai-dojo-vX.Y.Z.zip -d .
```
Overwrite the dojo-app directory with the content of the archive
```
```sh
> cp -a samourai-dojo-vX.Y.Z/. dojo-app/
```
......@@ -490,7 +490,7 @@ If applicable, edit the templates files stored in `~/dojo-app/docker/my-dojo/con
#### 4.2.4/ Start Upgrade
```
```sh
> cd ~/dojo-app/docker/my-dojo
> ./dojo.sh upgrade
```
......@@ -502,7 +502,7 @@ The shell script is going to rebuild the Docker containers. MyDojo will be autom
#### 4.2.5/ Cleanup
```
```sh
> cd ~
> rm -rf samourai-dojo-vX.Y.Z
> rm samourai-dojo-vX.Y.Z.zip
......
......@@ -3,7 +3,7 @@
Returns `bitcoind`'s estimated fee rates for inclusion in blocks at various delays. Fee rates are in Satoshi/byte.
```
```http request
GET /fees
```
......@@ -13,7 +13,7 @@ GET /fees
### Examples
```
```http request
GET /fees
```
......
......@@ -3,7 +3,7 @@
Request the header for a given block.
```
```http request
GET /header/:hash
```
......@@ -13,7 +13,7 @@ GET /header/:hash
### Examples
```
```http request
GET /header/000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f
```
......
......@@ -30,7 +30,7 @@ Note that loose addresses that are also part of one of the HD accounts requested
The `POST` version of multiaddr is identical, except the parameters are in the POST body.
```
```http request
GET /multiaddr?active=...[&new=...][&bip49=...][&bip84=...][&pubkey=...]
```
......@@ -44,7 +44,7 @@ GET /multiaddr?active=...[&new=...][&bip49=...][&bip84=...][&pubkey=...]
### Examples
```
```http request
GET /multiaddr?active=xpub0123456789&new=address2|address3&pubkey=pubkey4
GET /multiaddr?active=xpub0123456789|address1|address2
GET /multiaddr?bip49=xpub0123456789
......
......@@ -3,7 +3,7 @@
Request details about a single Bitcoin transaction. Pass `?fees=1` to scan the previous outputs and compute the fees paid in this transaction.
```
```http request
GET /tx/:txid
GET /tx/:txid?fees=1
```
......@@ -15,7 +15,7 @@ GET /tx/:txid?fees=1
### Examples
```
```http request
GET /tx/abcdef
GET /tx/abcdef?fees=1
```
......
......@@ -4,7 +4,7 @@ Request a paginated list of transactions related to a collection of HD accounts
Note that loose addresses that are also part of one of the HD accounts requested will be ignored. Their transactions are listed as part of the HD account result.