Fullnode
Defichain Fullnode
To stabilize the network, it is possible to setup a Defichain Fullnode on a virtual or physical server with a fixed IP address. A Fullnode hold the whole blockchain without acting as a masternode (no Collateral required) and other Nodes and Wallets in the network can use it to synchronize. Everyone in the community can help make the network more stable with a public Fullnode.
Requirements
General
- Fixed IP-Address
- Port Forwarding enabled on Router (Port 8555)
- 24/7 online
- Stable Internetconnection (Upload)
Hardware
- 100 GB free disk space (SSD recommended)
- 2-4 vCPU
- 4 GB Memory
Software
- Debian 10, 64 Bit
- Ubuntu 16.04 LTS
- Ubuntu 18.04
- CentOS 8
List of Fullnodes
- 45.157.177.82:8555
- 185.244.194.174:8555
- 85.214.187.210:8555
- 202.61.246.71:8555
- 24.134.79.25:8555
- 77.56.65.5:8555
- 195.90.210.76:8555
- 85.214.55.116:8555
- ...
to be continued...
Fullnode Installation
Ubuntu 16.04/18.04/20.04
Create Swapfile
recommended for Systems less then 4 GB
sudo fallocate -l 4G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
Check the swapfile
sudo swapon --show
make the Swapfile permanent
sudo cp /etc/fstab /etc/fstab.bak
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
Optimization
sudo sysctl vm.swappiness=10
sudo nano /etc/sysctl.conf
vm.swappiness=10
Install Fullnode
wget https://github.com/DeFiCh/ain/releases/download/v1.5.0/defichain-1.5.0-x86_64-pc-linux-gnu.tar.gz
unzip package
tar -xvzf defichain-1.5.0-x86_64-pc-linux-gnu.tar.gz
copy to directory
mkdir ~/.defi
cp ./defichain-1.5.0/bin/* ~/.defi
Start Fullnode
Start Fullnode
~/.defi/defid -daemon
When you upgrade from a previous version, please reindex the whole blockchaindata
~/.defi/defid -reindex -daemon
Monitor Fullnode
Check Blockcount
.defi/defi-cli getblockcount
Start defid after reboot
sudo crontab -e
* * * * * pidof defid || ~/.defi/defid
Is your node online?
After the node is completely synchronized, check the number of connections with the command below.
~/.defi/defi-cli getconnectioncount
If the number of connections is 8 or less, only outbound connections are active. Check your firewall or router to see whether your full node can be reached from the Internet via port 8555.
More than 8 connections mean that incoming connections are also possible and exist.
Create and use backup for blockchain data
Problem description
Some users report that this error message occurs again and again. Afterwards, the entire blockchain has to be reloaded, which is very tedious. The cause of this problem lies in the incorrect termination of the DeFi app. It is important that the app is always shut down correctly.
As a remedy, it is recommended to work with backup solutions. Then the entire blockchain does not have to be reloaded, but only the blocks after creating the backup.
Create backup
- Close the DeFi app
- Go to the folder with the blockchain data On Windows:
C:\Users\%username%\AppData\Roaming\DeFi Blockchain
On Mac:/Users/%username%/Library/Application Support/DeFi/
On Linux:~/.defi
- Copy the following 3 folders to another location. This is your blockchain backup.
blocks
enhancedcs
chainstate
- The backup is thus created.
Restore backup
- Launch the DeFi app and make sure the app has started syncing.
- Exit the DeFi App
- Go to the folder with the blockchain data On Windows:
C:\Users\%username%\AppData\Roaming\DeFi Blockchain
On Mac:/Users/%username%/Library/Application Support/DeFi/
On Linux:~/.defi
- Delete the following folders
blocks
enhancedcs
chainstate
- Copy the 3 folders from your backup to this folder
- Restart the computer
- Launch the DeFi App
- The app should now continue at the state of the last backup.
Blockchain Snapshot Service
Introduction
A snapshot helps in cases of corrupted blocks not to re-index the blockchain again. You will start from a much closer block to the most recent one. So, usage of a blockchain snapshot saves time and nerves not to verifying each block again and again and again. It can be stored and installed locally, so that in case of issues, you can sync from that point on.
Download sources
DeFiChain Fondation:
Installation guide
1. Backup your wallet |
---|
Before doing anything else, always take a backup from your wallet!
|
2. Remove blockchain files |
---|
We are still in the DeFi Blockchain data directory from step 1.
|
3. Unzip blockchain archive |
---|
|
4. Start DeFi app |
---|
OPTION 1 - New wallet or transaction history is not important
|