- Docker / w/ convenience script
- Docker Compose
- Docker linux post install steps: https://docs.docker.com/engine/install/linux-postinstall/ , Configure Docker to start on boot with systemd
- 100GB+ disk space free
Docker adds iptables rules that will override UFW rules! Make sure to run the steps below to secure the ports used by Docker. See this article for more info: https://www.techrepublic.com/article/how-to-fix-the-docker-and-ufw-security-flaw/
Open docker config file
sudo nano /etc/default/docker
Add this line; save and exit.
DOCKER_OPTS="--iptables=false"
Restart docker
sudo systemctl restart docker
- Clone this repository:
git clone https://github.com/smk762/notary_docker_3p
- Run
./setup
to create the.env
anddocker-compose.yml
files and build the daemon containers - Run
./start
to launch all the deamons within the docker containers, and tail their logs - Run
./iguana_3p
to launch Iguana for the 3P daemons within the docker containers - Run
./stop
to stop all the deamons
As we will be running multiple instances of the KMD daemon on the server, we will be using a non-standard data folder and ports for the 3P KMD daemon. This is to avoid conflicts with the native KMD daemon running on the host machine for the "main" coins.
There are also some other minor differences with paths and ports used for 3P daemons within the docker containers, so a modified m_notary_3rdparty
file is used to launch Iguana.
Make sure to return any notary funds to the faucet address or smk.
As the coins list may change between seasons, its best to stop the docker containers before updating the repo, otherwise you'll need to stop the old containers manually.
cd ~/notary_docker_3p
docker compose stop
git pull
./setup
./start
Once all cahins are running, you can start iguana with ./iguana_3p
, then split your UTXOs to get ready for notarisations.
- Run
./purge
to remove all docker containers, images, volumes and networks. Local chain data will be preserved.- To clear space from older builds, run
./purge
while your containers are running. It will delete all other containers. - If all else fails and you want to start fresh, run
./stop
first, then./purge
to delete everything.
- To clear space from older builds, run
- Run
./add_peers
to help add connections when doing initial sync. - Run
./start <ticker>
to launch a specific deamon within a docker container, and tail it's logs - Run
./stop <ticker>
to stop a specific deamon - Run
./logs <ticker>
to view logs of a specific deamon
When there is an update to any daemon repository, we need to update our docker-compose.yml
file with the updated COMMIT_HASH
for deamons which need to be rebuilt.
- Run
./update
to stop all daemons, update this repo, regenerate thedocker-compose.yml
file, and rebuild the docker images. - Run
./update <ticker>
to stop a specific daemon and rebuild its image. - Run
./update <ticker> --no-cache
to stop a specific daemon and force rebuild its image from fresh. - Once update is complete, run
./start
to start all daemons again. - Run
./setup nobuild
to refresh configs without rebuilding images.
Wrapper scripts for all CLI commands are automatically created and linked to /home/${USER}/.local/bin
when the docker containers are built. This allows you to run commands like mcl-cli getinfo
from anywhere on the host machine.
The mm2
container is used to run a seed node for AtomicDEX. It is not mandatory to run this container, but it is recommended.
The seed node will generate its own seed prase and rpcpassword on first run. If you want to use your own, edit docker_files/mm2_files/MM2.json
and rebuild the mm2 container.
Before building and launching the AtomicDEX container, we need to setup SSL certificates for WSS capability. For this, we'll need to register a domain and generate SSL certificates (in the container).
There are many providers, and they are available for as low as $5/year. I'll use https://www.hover.com/domain-pricing for example.
Setup nameservers for DNS propagation - https://help.hover.com/hc/en-us/articles/217282477 Setup DNS records to link IP address with domain - https://help.hover.com/hc/en-us/articles/217282457-Managing-DNS-records-
I'll be using my 3P nodes, though you can run the mm2 seednode on a different server in any region.
My domain name will be smk.dog
. The settings below will create the subdomains dev.smk.dog
and na.smk.dog
pointing to my 3P Dev & NA servers.
Additional subdomains for each of your nodes can be added as required.
Step 2: Generate SSL certificates with LetsEncrypt
- Run
./setup
to regenerate thedocker-compose.yml
file with a block for themm2
service - Run
./setup_mm2
to generate an MM2.json file, get the latest coins file, get SSL certificates, and build the mm2 container.
- Run
./start mm2
to launch the mm2 container - Try
cd mm2 && ./version
to confirm the host machine can recieve repsonses from AtomicDEX API commands.
You can confirm external connections are being accepted by going to https://websocketking.com/ and trying to connect to your domain on port 42855. For example, wss://dev.smk.dog:42855
Shortly after launch mm2
, you should see a line in the logs like below:
mm2_libp2p::atomicdex_behaviour:653] INFO Local peer id: PeerId("12D3KooWNGGBfPWQbubupECdkYhj1VomMLUUAYpsR2Bo3R4NzHju")
The simplest way to find this is via docker compose logs mm2 | grep Local
DM the PeerID
value to @smk on Discord, and it will be added to the notary seednode list for uptime and version monitoring to apply the bonus scoring for participating notaries.
If you already have data in the daemon data folders (e.g. from a previous season) then you might encounter some issues like below.
mil_1 | : You need to rebuild the database using -reindex-chainstate to change addressindex.
mil_1 | Please restart with -reindex or -reindex-chainstate to recover.
To overcome this, you can either:
- Delete the data folders and restart the containers
- Stop the service with
./stop <ticker>
and then run./start <ticker> -reindex
to launch the daemon with reindex. - Enter the container with to launch the daemons with
-reindex
manually (see below)
# Enter the container
docker compose run <service> bash
# Launch the daemon with reindex
mild -reindex
# Monitor the daemon logs
tail -f ~/.mil/debug.log (you can also do this from outside the container, as the `.mil` folder is a shared volume)
# Exit the container
exit
If you see the following:
Error response from daemon: driver failed programming external connectivity on endpoint notary_docker_3p-kmd-1 (b38e98fe0534cf22b41c424be924de0b826835080e21cdf1b557c927295f2304): Error starting userland proxy: listen tcp4 0.0.0.0:7771: bind: address already in use
Make sure you are not running any other instances of the daemon on your host machine. Stop the deamons, and then run docker compose up -d
again.
https://www.cloudbees.com/blog/how-to-clean-up-deleting-all-docker-images