Xahau / mainnet-docker

Xahau mainnet (network ID 21337) Docker container (x86_64)
40 stars 4 forks source link

Xahaud Docker Container

Docker container to run a Xahau node on MAINNET.

The way this container should be used (like all Docker containers) is to map config files from the host to the container, so the container can be destroyed and re-created (build image) in case of updates, without losing config. See folder mapping examples in the ./up script in this repository.

Alternatively: install without Docker:

If you prefer not to run in a Docker container, simply fetch the install script (xahaud-install-update.sh) and run it on the host.

Live build:

https://build.xahau.tech/2024.11.18-release%2B1141

IPv6 edition (!)

For Docker + IPv6 setup, see:

Updating

Either re-create the Docker container based on a new image, or keep the container running and update the xahaud binary inside the container.

Example Gist to do this: https://gist.github.com/WietseWind/2ed35d85dcd056d82645de2958934f86

⚠️ Warning regarding the pinned binary

All Xahau builds are available at https://build.xahau.tech.

The build script in this repository contains the right pinned build.

If you build the image yourself, without the build script, you will have to manually replace the right build version! If you don't, the binary will fail to sync and most likely crash during the sync process.


XAHAU MAINNET, NETWORK ID 21337

                   $$\                                 $$\ 
                   $$ |                                $$ |
$$\   $$\ $$$$$$\  $$$$$$$\   $$$$$$\  $$\   $$\  $$$$$$$ |
\$$\ $$  |\____$$\ $$  __$$\  \____$$\ $$ |  $$ |$$  __$$ |
 \$$$$  / $$$$$$$ |$$ |  $$ | $$$$$$$ |$$ |  $$ |$$ /  $$ |
 $$  $$< $$  __$$ |$$ |  $$ |$$  __$$ |$$ |  $$ |$$ |  $$ |
$$  /\$$\\$$$$$$$ |$$ |  $$ |\$$$$$$$ |\$$$$$$  |\$$$$$$$ |
\__/  \__|\_______|\__|  \__| \_______| \______/  \_______|

Build:

WARNING!

./build

Run:

WARNING! This will remove any running container called xahaud-mainnet!

./up

Config & database

Config and database perist in ./store/etc and ./store/db. Logfiles in ./store/log.

Feel free to clean the db and log folder at your convenience, contents will be re-created.

Xahaud server identity

The xahaud server identity will perist as long as you keep the contents of wallet.db in the ./store/db folder.

You can stop, remove & re-create the container: as long as this file persists your server identity will be the same after a restart.

Remote access

This container runs ssh as well. You can SSH into the container, but for every build the SSH server identity will change. The user is root, so: ssh root@localhost -p 2222.

To allow SSH access (key only), add your pubkey(s) to ./store/ssh/authorized_keys

NOTE: not a hidden file, don't start with a dot). Make sure to chmod 400 the file. Make sure the file is owned by root (chown root:root).

Commands

To get the latest server status (or run another xahaud command):

# docker exec {container} {binary} {cliopts}
docker exec xahaud-mainnet xahaud server_info

To check the current sync status:

# docker exec {container} {binary} {cliargs} {cliopts} | grep {string to match}
docker exec xahaud-mainnet xahaud -q server_info | grep complete_ledgers

To check the peer connections:

# docker exec {container} {binary} {cliargs} {cliopts} | grep {string to match}
docker exec xahaud-mainnet xahaud -q peers|grep address

To check the live Xahaud logs:

# docker exec {container} {binary} {cliargs} {cliopts} | grep {string to match}
docker exec xahaud-mainnet tail -f /opt/xahaud/log/debug.log

To monitor sync status (exit with CTRL-C):

watch 'docker exec xahaud-mainnet xahaud -q server_info | grep complete_ledgers'

To start/stop/restart xahaud:

systemctl start xahaud
systemctl restart xahaud
systemctl stop xahaud

To prevent xahaud from auto-starting when the container starts:

systemctl disable xahaud

Enjoy!