Komodo Platform's AtomicDEX-API is an open-source atomic-swap protocol for trading seamlessly between essentially any blockchain asset in existence. Seed nodes play an essential part in orderbook propagation and relaying information about peers within the network and the status of swaps in progress.
With the start of the 5th Komodo Notary Node Season, operators will be running a seed node on their third party (3P) server to further decentralize the network. This expands the current number of seed nodes from half a dozen to over 60 nodes, distributed geographically across the planet, and maintained by a diverse group of respected people within the Komodo community with great expertise in KMD related technologies and the ability to rapidly deploy updates and assist each other with troubleshooting as required.
Operators with the best metrics in terms of uptime and responsiveness to updates will also be rewarded with bonus points towards their Season 5 score, and the chance to win automatic re-election.
For each hour of uptime with the correct version, Notary Nodes will receive 0.2 points to their season score.
You'll need to open port 38890 - sudo ufw allow 38890
The simple scripts in this repository will assist operators in setting up their seed node and keeping it up to date whenever update announcements are broadcast.
Creates an MM2.json config file to define node as seed.
Downloads latest coins file from https://github.com/KomodoPlatform/coins/
Downloads latest mm2 binary from https://github.com/KomodoPlatform/atomicDEX-API/releases
Launches mm2, and logs output.
Stops mm2.
- Clone repository
git clone https://github.com/smk762/nn_mm2_seed/ && cd nn_mm2_seed
- Install pip requirements -
pip3 install -r requirements.txt
(dosudo apt-get -y install python3-pip
first if not installed) - Get latest coins file -
./update_coins.sh
- Get latest MM2 binary -
./update_mm2.sh
- Generate config -
./gen_conf.py
(Don't use your Notary passphrase! Use a fresh one. This passphrase will be linked to your PeerID and should not be changed later) - Start MM2 -
run_mm2.sh
- Find your PeerID in mm2.log
cat mm2.log | grep 'Local peer id'
- Send the domain name of your server and your PeerID to smk in Discord DM (can be run on Third Party nodes, or a separate VPS in any region)
peerid.mp4
In order for our seed node to be able to process WSS connections, we'll need to register a domain and generate SSL certificates.
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.
DNS propagation can take a little while. You can check the progress at https://www.whatsmydns.net and / or via ping in terminal.
ping dev.smk.dog
Step 2: Generate SSL certificates with LetsEncrypt
The simplest way to do this is with the EFF's Certbot
sudo apt update && sudo apt upgrade
sudo apt install snapd
sudo snap install core; sudo snap refresh core
sudo apt remove certbot # Remove older version if existing
sudo snap install --classic certbot
sudo ln -s /snap/bin/certbot /usr/bin/certbot
sudo apt install nginx
# Temporarily open port 80 so certbot can confirm certificate config
sudo ufw allow 80
sudo certbot certonly --nginx # This might fail is DNS propagation is not yet complete - if so, try again later
Once the certs are generated, add entries to your MM2.json as below, substituting in your subdomain as required:
"wss_certs": {
"server_priv_key":"/etc/letsencrypt/live/dev.smk.dog/privkey.pem",
"certificate":"/etc/letsencrypt/live/dev.smk.dog/fullchain.pem"
}
sudo ufw allow 38900
sudo ufw status numbered # To find the ID numbers for port 80
sudo ufw delete 20 # Remove port 80 on ipv6
sudo ufw delete 10 # Remove port 80 on ipv4
Start mm2 and review your logs.
./run_mm2.sh && tail -f mm2.log
If you see an error like 'Error reading WSS key/cert file "/etc/letsencrypt/live/dev.smk.dog/privkey.pem": Permission denied (os error 13)'
you need to change the ownership of these files for mm2 to be able to access them.
sudo chown -R $USER:$USER /etc/letsencrypt/archive/dev.smk.dog/
sudo setfacl -m "u:${USER}:rx" /etc/letsencrypt/archive /etc/letsencrypt/live # You might need to 'sudo apt install acl' first
Once it looks like it is working, you can confirm external connections are being accepted via https://websocketking.com/
- Developer docs: https://developers.komodoplatform.com/basic-docs/atomicdex-api-legacy/rational_number_note.html
- Cipi's MM2 scripts: https://github.com/cipig/mmtools
- PytomicDEX: https://github.com/smk762/pytomicDEX_makerbot
- Update cmake: https://apt.kitware.com/
- Install Rustup: https://rustup.rs/
- Install buildessential:
sudo apt install build-essential
- Update Rustup:
rustup install nightly-2021-05-17
rustup default nightly-2021-05-17
rustup component add rustfmt-preview
- Build mm2:
git clone https://github.com/KomodoPlatform/atomicDEX-API
cd atomicDEX-API
git checkout b8598439a # check for latest valid version hash at https://github.com/smk762/DragonhoundTools/blob/master/atomicdex/seednode_version.json
cargo build -vv
Additional build notes at https://github.com/KomodoPlatform/atomicDEX-API/#building-from-source