Waves Node Installation Linux (Ubuntu/Lubuntu)
If you want to generate passive income in the crypto space, you can stake WAVES or operate your own WAVES node. Operating your own WAVES node will yield higher returns due to the additional income from additional/external stakers. However, operating your own node involves some effort and responsibility: maintenance, updates, monitoring and ensuring uptime.
If you want to set up and operate your own WAVES node, you will find the complete node installation instructions in this article. It is a detailed step-by-step guide to setting up your own WAVES node under Linux (distribution: Ubuntu). Please note that a node must hold at least 1000 WAVES or have them in staking/leasing in order for blocks to be mined. The installation time including configuration is around two hours. Let's go!
1. Preparation
1.1 Advance information
This guide is also suitable for beginners. However, you should have some basic knowledge of IT and Linux (Ubuntu). You should be familiar with a terminal and the basic commands. The entire installation is carried out via the terminal. This is not a GUI guide.
Waves can be installed as MainNet or TestNet. As the name suggests, TestNet is intended for testing purposes. In TestNet, all tokens have no value. Tokens cannot be transferred between MainNet and TestNet. The wallet addresses differ between MainNet and TestNet. Another difference is the directory name. MainNet uses the directory: "waves/", TestNet uses the directory "waves-testnet/".
1.2 System requirements
A Waves node works with as little as 4 GB of RAM. 8 GB of RAM is recommended for continuous operation of a MainNet node.
To install a MainNet node (system + blockchain) you need at least 365 GB of hard disk space. The Ubuntu system needs about 45 GB and the blockchain needs to be downloaded and unpacked (2x 160 GB) (as of 03.2024). Therefore, I recommend at least 400 GB for MainNet. SSD hard drive is recommended.
1.3 Set up / install Linux system
This guide describes the installation of a Waves full node on a Linux system (distro: Ubuntu). Accordingly, you need a clean or newly installed Linux system.
First, set up a completely new Linux system (if you don't already have one). You can also use VirtualBox for this. You can find instructions here: Lubuntu 19
Recommendation: A VPS is recommended for the operation of a MainNet Node. Good and inexpensive providers are DigitalOcean and Contabo (HISPEED-1). However, a MainNet node can also be operated on a VirtualBox.
1.4 Install SSH server on Linux (if necessary)
You can skip this point if you have access to the terminal via the GUI. With VPS you always need SSH to access the terminal of the VPS server. Now install the SSH server on your node. I'll show you how this works here: Remote connection to the Linux SSH server
1.5 Perform Linux updates
To ensure that the installation process works properly, you should update the node now. To do this, run these two update and upgrade commands in the node's terminal. You can find more information about the update/upgrade here: Update Lubuntu/Ubuntu packages (update/upgrade)
$ sudo apt-get update
$ sudo apt-get upgrade
1.6 Java per Terminal / SSH installieren (Linux)
The WAVES node requires Java OpenJDK version 11 or 17. This means that you now need to install Java in that version on your Linux system. I will show you how to install Java on a Linux system here: Install Java openJDK 8/11 on Linux (Ubuntu/Lubuntu).
1.7 Create Waves Wallet MainNet or TestNet via wx.network
The WAVES node needs its own WAVES wallet on the WAVES blockchain to function. Now create a Waves wallet for your node. You can do this easily using the wx.exchange client. It is important that you differentiate between TestNet and MainNet. Download links to the corresponding clients: WX.Network | WX.Network TestNet
Here I describe how to create a wallet under waves.network: WX.Wallet
2.0 WAVES-Node installation
After completing the above points, you can now start installing Node. The installation is done via APT repository (Advanced Packaging Tool). Don't worry, it just sounds complicated.
2.1 GPG Schlüssel bekannt gegeben
First, the GPG key must be announced. To do this, curl must be installed on the Linux system. Log in via SSH or the terminal and execute the following command to install curl.
$ sudo apt install curl
The GPG key can now be announced using the curl command. To do this, execute the following command in the terminal.
$ curl -sL http://apt.wavesplatform.com/apt-key.gpg | sudo gpg --dearmour -o /etc/apt/trusted.gpg.d/apt-wavesplatform-com.gpg
2.2 Add WavesPlatform to APT Magazine (repository)
Depending on whether you want to install TestNet or MainNet node, the corresponding APT repository must be added for the installation. When executed this way, all data is downloaded and the package lists are updated.
Info: xenial must also be used with new Linux versions, i.e. use xenial with foscal as well.
Now execute this command:
For TestNet:
$ sudo add-apt-repository "deb https://apt.wavesplatform.com/ xenial testnet"
For MainNet:
$ sudo add-apt-repository "deb https://apt.wavesplatform.com/ xenial mainnet"
If the message "add-apt-repository command not found" appears at this point, then you need to install the software properties. You can do this with this command. Then repeat point 2.2.
$ sudo apt install software-properties-common
2.3 Perform APT update/upgrade
Update and upgrade now:
$ sudo apt update $ sudo apt upgrade
2.4 Install Waves Node
The final installation is carried out here. Depending on which node (TestNet or MainNet) you selected in point 2.2, the corresponding WAVES node can now be installed. For the MainNet you must now execute the following command:
$ sudo apt install waves
And for the TestNet you have to run this command:
$ sudo apt install waves-testnet
The installation will now take about 10 minutes. Then restart the server (node) with this command:
$ sudo reboot now
2.5 Configure or download the WAVES application.ini
The application.ini file was created when the node was installed. The application.ini controls, among other things, how much memory the Java virtual machine (JVM) receives. As mentioned under requirements (point 1.2), a MainNet node should receive 8 GB. A fully configured application.ini of a MainNet node looks like this.
-J-Dwaves.defaults.blockchain.type=mainnet -J-Dwaves.defaults.directory=/var/lib/waves -J-Dwaves.defaults.config.directory=/etc/waves # options from build -J-server -J-Xms4g -J-Xmx8g -J-XX:+ExitOnOutOfMemoryError -J-XX:+UseG1GC -J-XX:+UseNUMA -J-XX:+AlwaysPreTouch -J-XX:+PerfDisableSharedMem -J-XX:+ParallelRefProcEnabled -J-XX:+UseStringDeduplication -J-Dfile.encoding=UTF-8
For the TestNet node, the application.ini values must look like this.
-J-Dwaves.defaults.blockchain.type=testnet -J-Dwaves.defaults.directory=/var/lib/waves-testnet -J-Dwaves.defaults.config.directory=/etc/waves-testnet # options from build -J-server -J-Xms4g -J-Xmx8g -J-XX:+ExitOnOutOfMemoryError -J-XX:+UseG1GC -J-XX:+UseNUMA -J-XX:+AlwaysPreTouch -J-XX:+PerfDisableSharedMem -J-XX:+ParallelRefProcEnabled -J-XX:+UseStringDeduplication -J-Dfile.encoding=UTF-8
The directory of this file is "/etc/waves/" (MainNet), and "/etc/waves-testnet/" (TestNet). This file can be edited via the terminal using the nano editor. To make things easier, the application.ini can also be downloaded directly configured using this command:
For MainNet:
$ curl https://www.chaincheck.de/stuff/waves-node-anleitung/mainnet/application.ini -o /etc/waves/application.ini
For TestNet:
$ curl https://www.chaincheck.de/stuff/waves-node-anleitung/testnet/application.ini -o /etc/waves-testnet/application.ini
2.6 Configuring waves.config
The WAVES config file is relatively complex, so I have explained the structure of this file in detail on the following page: Waves Node configuration file waves.conf
Now configure the waves.config file.
2.7 Download and unpack Waves Blockchain
After you have configured the waves.conf file, the blockchain must now be downloaded and unpacked before starting the node. The download takes about 1-2 hours with a good internet connection. If the download server is heavily overloaded, this can take ~9 hours. You can download the blockchain with this command:
For MainNet:
$ wget -c http://blockchain.wavesnodes.com/blockchain_last.tar -P /var/lib/waves/
For TestNet:
$ wget -c http://blockchain-testnet.wavesnodes.com/blockchain_last.tar -P /var/lib/waves-testnet/
Next, check whether the blockchain directory "data" already exists. This is possible if the node (node service) has already been started. You can perform the check with this command:
$ ls /var/lib/waves/ $ ls /var/lib/waves-testnet/
If the "data" folder does not exist, you can skip this point. Otherwise, you must now empty this folder using this command. (top: MainNet, bottom: TestNet):
$ rm -d /var/lib/waves/data/* $ rm -d /var/lib/waves-testnet/data/*
Now the blockchain_last.tar can be unpacked. This process takes about 20-30 minutes, depending on the hardware. Unpacking is done with this command. Here too, MainNet above, TestNet below:
$ tar -xvf /var/lib/waves/blockchain_last.tar -C /var/lib/waves/data/ $ tar -xvf /var/lib/waves/blockchain_last.tar -C /var/lib/waves-testnet/data/
3.0 System start and node change
Almost done! Your own WAVES node is now completely installed and configured. You can now start your node. This is done with this command (above: MainNet, below: TestNet):
$ systemctl start waves.service $ systemctl start waves-testnet.service
Now you can check if the node is running with this command:
$ journalctl -u waves.service -f $ journalctl -u waves-testnet.service -f
If the output looks like this, or if there is the output "MicroBlock" and "New height: xxxx", then the node installation and the start of the node was successful.
Mar 16 16:41:18 x1.consr.net waves[10687]: INFO c.w.s.BlockchainUpdaterImpl - MicroBlock(B8kKF9o... -> 7kydM44..., txs=6) appended, diff=63374b0 Mar 16 16:41:23 x1.consr.net waves[10687]: INFO c.w.s.BlockchainUpdaterImpl - MicroBlock(4RR512Z... -> B8kKF9o..., txs=1) appended, diff=d75f3f6c Mar 16 16:41:28 x1.consr.net waves[10687]: INFO c.w.s.BlockchainUpdaterImpl - MicroBlock(5Rc4ddB... -> 4RR512Z..., txs=4) appended, diff=b02a6498 Mar 16 16:41:33 x1.consr.net waves[10687]: INFO c.w.s.BlockchainUpdaterImpl - MicroBlock(CCPHwmT... -> 5Rc4ddB..., txs=1) appended, diff=1039424b Mar 16 16:41:36 x1.consr.net waves[10687]: INFO c.w.s.BlockchainUpdaterImpl - New height: 2505451 Mar 16 16:41:38 x1.consr.net waves[10687]: INFO c.w.s.BlockchainUpdaterImpl - MicroBlock(AxAZsML... -> uzebxbE..., txs=1) appended, diff=4d38c552 Mar 16 16:41:40 x1.consr.net waves[10687]: INFO c.w.s.BlockchainUpdaterImpl - MicroBlock(5aDZU9s... -> AxAZsML..., txs=1) appended, diff=d071d6db
Questions & Answers Waves Config-File / Wallet / Restart
Below are some important pieces of information and commands that every node operator should know. Note that these commands refer to MainNet. For TestNet, simply change "waves" to "waves-testnet".
1. Stop, start, disable and enable server/node
$ systemctl stop waves.server $ systemctl start waves.server $ systemctl restart waves.server $ systemctl disable waves.server $ systemctl enable waves.server
2. Delete Wallet.dat
Whenever a significant change is made to the waves.conf file, the wallet.dat must be recreated, otherwise the node service cannot start. In order for the node service to be able to recreate this file, this file must first be deleted. You can delete the wallet.dat with this command.
$ rm /var/lib/waves/wallet/wallet.dat
3. Edit waves.config
A GUI editor such as featherpad, Nodepadqq etc. cannot be used via an SSH connection/terminal. To edit the waves.conf file via SSH/terminal, you can use the program nano.
$ nano /etc/waves/waves.conf
4. Check server status
To check the Waves node status, you can use this command:
$ journalctl -u waves.service -f
5. Check / delete logs
In order to find errors, the node always creates logs. These log files (archives) should be deleted at certain intervals.
This command deletes log archives:
$ rm /var/log/waves/*.log.gz
6. Do node rewards have to be staked to your own node?
The rewards generated by the node do not need to be manually added to the staking of the same/own node. The amount of Waves generated is automatically included.
7. Message "forked at 2721396" and what should be done in such a case?
It can happen that your node reports "forked at xxx". This means that your node is no longer in the consensus of the other nodes. Often the node normalizes itself, just wait 20-30 minutes. If it doesn't work, then the node can be stopped and restarted. This should fix the error. And if that doesn't help, then the blockchain must be downloaded again.
8. Message "/var/lib/waves/data/LOCK: Permission denied"
If you see this message, check in the directory "/var/lib/waves/data/" whether all files have the correct owner and the correct group "waves". You can do this with the command "ll data/". If this is not the case, then all files must have the owner and the group "waves". You can do this with this command.
$ chown waves:waves data/LOC* $ chown waves:waves data/CURRENT
You can then start your WAVES node.
$ sudo systemc