Downloading and running the node
After completing this section, your node will be connected to the Aleph Zero Testnet and will start receiving blocks from the network.
Prerequisites
You will need docker
and wget
. If you are using Linux, we recommend that you add your user to the docker
group so that using docker
doesnβt require sudo access. You can find the Docker installation instructions here and using it without sudo access here (if you can't use Docker without sudo, simply add sudo
before running the script.
You will also need to make sure that the ports 9944, 30333, 30343 are not busy. On Linux, you can check this with:
If there is no output, the port is free.
Before you proceed, please take a minute to read the section about exposing ports in the context of validators and archivists as that is crucial to the correct functioning of your node within the Aleph network.
Clone the Aleph Node Runner repo:
IMPORTANT: With release 12.0, the Node Runner is undergoing significant changes. You will need to either do a git pull
or delete your aleph-node-runner
repo and clone it again. Regardless of which option you choose, please make sure to back up any changes you may have made to the config.
The new Node Runner is able to figure out the correct version of Aleph Node to run so the only time where you'll want to do a git pull
in the future will be when a new Aleph Node Runner Version is released (it will always be announced).
Setup and running
Once inside the aleph-node-runner
folder, run:
If you are using a domain name instead of an IP (e.g. in a DynDNS configuration), you will need to pass the --dns
argument:
The choice of your_nodes_name
is entirely up to you but for the sake of more comprehensible logs please try using something unique and memorable. If you donβt provide the name, the script will do its best to generate one for you based on your username but it is not recommended as it might result in potential name clashes and make the logs harder to read.
On Testnet, it's best to have this name be the same as the identity you'll set in the next section and the name you use in the form.
Your ports 30333 and 30343 need to be accessible from the outside after you start your node. You can check that using a website like https://www.yougetsignal.com/tools/open-ports/
It might take quite some time before you actually get the node running: the script will first download required files, including a database snapshot (sized ~100GB). It will then run the node for you and you can inspect the logs by running docker logs <your_nodes_name>
You can connect to other nodes before obtaining a full database by providing the --sync_from_genesis
flag: it will start with the genesis and perform a full sync by using data from other nodes. Note that in most cases it will be slower than using the default way with the DB snapshot.
And thatβs it!
Your node is now connected to the Aleph Zero Testnet and is able to communicate with other nodes and receive blocks.
Please read on if you would like to know about customizing your setup and verifying that the node actually works.
Note that the node will be running in background, so you can safely close the terminal window you used to run it.
We strongly recommend that you set up telemetry for your node, as described here.
Managing the node
The setup done by the script is based on Docker, so you can treat Aleph Node like any other container. To execute the commands below, you will need to provide the name of your container. The name assigned to the container will be the same as the name you have chosen for your node.
For instance, you might want to:
Stop the node
docker stop <your_nodes_name>
Start the node after stopping it
You have two options:
The first one doesn't require you to execute the script again:
docker start <your_nodes_name>
while the second is to simply run the script again and let it take care of container management
The script also accepts a --stash_account <your stash account>
option: if you provide it, it will do an automatic check of your session keys.
Updating your node
IMPORTANT: do not delete your aleph-node-runner
repository.
To update your node, you need to run two things:
docker stop <your_nodes_name>
./run_node.sh --name <your_nodes_name> --ip <your_ip_address>
That will take care of downloading the newest available version and starting the node again.
If you use a domain name instead of an IP address, the --ip
flag above needs to be replaced with the --dns
flag. You can also pass the --stash_account
flag mentioned above.
Starting with version 12 of the node, the aleph-node-runner
repo does not auto-update (but still is able to figure out the correct version of the node to run). However, it's now best to check for updates of the runner repo from time to time and do a git pull
.
Database pruning
The aleph-node-runner
script uses database pruning mode for Testnet by default. It allows to save a significant portion of the persistent memory by discarding old state entries in the blockchain's database. Block entries of the database stay untouched in this mode. This has several consequences for node operators, especially during the update process.
Pruning mode is supported only by the ParityDB
database engine. Database instances created without pruning mode are not compatible with a node that runs with pruning enabled. Therefore, we need to re-downloaded database snapshot that supports pruning (or sync from genesis) when run for the first time with pruning. The aleph-node-runner
script downloads a pruned version of the database snapshot automatically. By default it stores it in the ~/.alephzero/data/chains/testnet/paritydb/full
directory. Please notice that this script does not attempt to delete previous versions (e.g. not pruned) of the database. Users can delete old versions of the database manually. By default, any such version is stored in the ~/.alephzero/data/chains/testnet/db/full
directory. The script also attempts to minimize node's downtime during the transition. It will first attempt to download a pruned version of the database without any interaction with any possibly running instance of aleph-node
, then it tries to shutdown any running aleph-node
instance (by stopping it's docker container) and launches a new version with pruning enabled.
Print logs from Aleph Node
docker logs <your_nodes_name>
Or, if you want to keep getting the logs in real-time:
docker logs --follow <your_nodes_name>
Check running containers and their key properties
docker ps
(or docker ps -a
if you want to see stopped containers as well)
It will allow you to check which container is running and whether the ports are mapped correctly.
Last updated