How to Run a Qitmeer Network Full Node
Qitmeer Full Node Requirements and Preparation
(1) Hardware requirements: recommended 4 core 8G cloud server
As qng-1.0.18+release version has optimized memory usage and reduced node load. Considering the performance of servers with lower than recommended configurations, the default “cachesize” value is set conservatively at 2000.
For nodes with 8G of memory or more, consider setting a larger “cachesize” value for better performance, and the recommended configuration is 20,000.
However, it is not always better to have a larger size, but to take into account the hardware. An example of a “cachesize” setting is --bdcachesize 20000 --dagcachesize 20000
.
(2) Setting up a 4G+ Swap File on Ubuntu Machines
a. setup the swap file
sudo apt update
sudo apt install --reinstall util-linux
sudo fallocate -l 8G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
b. check the running swap file
sudo swapon -s
c. edit/etc/fstab
file (optional)
sudo vi /etc/fstab
add a line to the end of file /etc/fstab
/swapfile swap swap defaults 0 0
Get the QNG Node EXEFile
a. Download the latest version of release directly:
create a qng node data storage folder and download the latest version of qng release node, download link: https://github.com/Qitmeer/qng/releases
~ mkdir qngnode
~ cd qngnode
~ wget https://github.com/Qitmeer/qng/releases/download/v1.0.18/qng-1.0.18-linux-amd64.tar.gz
~ tar -zxvf qng-1.0.18-linux-amd64.tar.gz
For later use, execute the command
cp . /build/release/linux/amd64/bin/qng qng
to copy the executable to the current directory.
b. Compile from qng library source code (recommended go-lang version 1.19, latest git version):
you need to switch to the release/1.0.18
branch to compile the release version.
~ git clone [https://github.com/Qitmeer/qng.git](https://github.com/Qitmeer/qng.git)
~ cd qng
~ git checkout release/1.0.18
~ make
Start QNG Node
(1) Start the node directly using the default configuration
Execute the command below directly in the directory where the qng node is located:./qng
or nohup ./qng >>log.log 2>&1 &
for running in the background.
By default rpcuser=test, rpcpass=test, rpclisten=8131
p2p port is port=8130
To ensure node synchronization, please make sure the p2p port is open to the public. For ubuntu systems, you can directly execute
ufw allow 8130
to open the port.
If you want to set up other configurations, you can refer to the following, e.g. by adding the evm environment parameter:
./qng --evmenv="--http --http.port=18545 --http.addr=0.0.0.0 --http.api=personal,net,web3,eth,qng,txpool --http.vhosts=* --http.corsdomain=* --ws --ws.port=18546 --ws.addr=0.0.0.0 --ws.origins=* --ws.api=eth,web3,net,debug,txpool"
All data will be stored in the root directory /root/.qng/
.
(2) Custom configuration file to start the node
Use the command touch qng.conf
to create the configuration file qng.conf
in the qngnode
directory you created earlier. Use the vim qng.conf
command to open the edit screen, press the i
key to paste the following commonly recommended configuration, and then press esc
, :wq
, enter
in order to save the edit.
datadir=./data
logdir=./data
rpclisten=0.0.0.0:8131
rpcuser=meer
rpcpass=meer123
notls=false
port=8130
printorigin=false
debuglevel=debug
estimatefee=true
evmenv="--allow-insecure-unlock --http --http.port=18545 --http.addr=0.0.0.0 --http.api=personal,net,web3,eth,qng,txpool --http.vhosts=* --http.corsdomain=* --ws --ws.port=18546 --ws.addr=0.0.0.0 --ws.origins=* --ws.api=eth,web3,net,debug,txpool"
It is important to ensure that at least the p2p port is open to the public (ufw allow 8130
can be run directly on ubuntu systems to open the port).
If the qng
node program and qng.conf
configuration file are in the same directory as qngnode, and the p2p port is open to the public, execute the command:
nohup . /qng -C=. /qng.conf >>log.log 2>&1 &
to start the qng node in the background.
(3) Configure an archive node
To run an archive node, just add the startup parameters --syncmode=full --gcmode=archive
to the evmenv
configuration, that is, the archive node uses the following custom configuration:
datadir=./data
logdir=./data
rpclisten=0.0.0.0:8131
rpcuser=meer
rpcpass=meer123
notls=false
port=8130
printorigin=false
debuglevel=debug
estimatefee=true
evmenv="--allow-insecure-unlock --http --http.port=18545 --http.addr=0.0.0.0 --http.api=personal,net,debug,web3,eth,qng,txpool --http.vhosts=* --http.corsdomain=* --ws --ws.port=18546 --ws.addr=0.0.0.0 --ws.origins=* --ws.api=eth,web3,net,debug,txpool --syncmode=full --gcmode=archive"
(4) Configure public RPC service
By binding the node server to a domain name and reverse proxying the IP, the node can provide public RPC services externally.
The following is a configuration rpc.conf
for implementing reverse proxy through nginx for reference:
# rpc.conf
# qng rpc ws
upstream qng-ws {
server localhost:18546 ;
}
server {
# Port
listen 80;
listen 443 ssl http2;
# Domain
server_name your.domain.name.com;
ssl_certificate /usr/local/src/ssl/rpc.your.domain.name.com_bundle.crt;
ssl_certificate_key /usr/local/src/ssl/rpc.your.domain.name.com.key;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
ssl_buffer_size 16k;
ssl_prefer_server_ciphers on;
# Catalogue browsing
autoindex off;
# Request configuration
location / {
proxy_pass
http://localhost:18545;
}
# Request configuration
location /ws/ {
add_header 'Access-Control-Allow-Origin' '*' always;
proxy_pass http://qng-ws/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
}
}
Fast Synchronisation with Backup Data
Here is a backup of node data up to 1.10 million blocks, which can be used directly to speed up the synchronisation time. To download the backup data at:
- qitmeer.io
- https://www.qitmeer.io/resource/download/NodeDataBackup/data110.zip
- github source
- https://github.com/meerfans/NodeDataBackup/releases/download/data.110/data110.zip
- pan.baidu.com
- Link: https://pan.baidu.com/s/1t_CM9NVgT6Nl7DWBeho_iQ
Password:4cv1
Download and unzip the data.zip
file to the directory where the qng node data is stored (/root/.qng/
by default) and start the qng node directly. In addition, there is a common qng configuration file, qng.conf
available on this site for reference.