Run Archive Node

Fresh setup from 0

Linux Instance

  • OS - Ubuntu 20.04 LTS or higher version

Specifications

CPU 8Core
Ram 16GB
7 TB of Data Disk (SSD) 8k IOPS, 250MB/S throughput
Network: 10 MB/s at least

Allow Inbound and Outbound

  • Protocol - TCP & UDP

  • Port - 30303

  • Source IP - 0.0.0.0/0

Installation Steps

Create new bkc-node directory

  • Mainnet

mkdir -p /bkc-node/mainnet
  • Testnet

mkdir -p /bkc-node/testnet

Install Geth via binary

sudo curl -L https://bkc-storage.obs.ap-southeast-2.myhuaweicloud.com/geth/v2.1.0/geth-linux-amd64-go1-18-10 -o /usr/bin/geth
sudo chmod +x /usr/bin/geth

Check geth version

/usr/bin/geth version

The result after running commands

Geth
Version: 2.1.0-bkc-stable
Git Commit: 8ee545524b9411c306ebb62bcbfa4536264e20c2
Git Commit Date: 20230802
...

Download chain configuration and genesis file

  • Mainnet

#config.toml
sudo curl https://raw.githubusercontent.com/bitkub-chain/bkc-node/v2.1.0/mainnet/config.toml --create-dirs -o "/bkc-node/mainnet/config.toml"

#genesis.json
sudo curl https://raw.githubusercontent.com/bitkub-chain/bkc-node/v2.1.0/mainnet/genesis.json --create-dirs -o "/bkc-node/mainnet/genesis.json"
  • Testnet

#config.toml
sudo curl https://raw.githubusercontent.com/bitkub-chain/bkc-node/v2.1.0/testnet/config.toml --create-dirs -o "/bkc-node/testnet/config.toml"

#genesis.json
sudo curl https://raw.githubusercontent.com/bitkub-chain/bkc-node/v2.1.0/testnet/genesis.json --create-dirs -o "/bkc-node/testnet/genesis.json"

Initialize a genesis file

#Mainnet
geth --datadir /bkc-node/mainnet/data init /bkc-node/mainnet/genesis.json

#Testnet
geth --datadir /bkc-node/testnet/data init /bkc-node/testnet/genesis.json

Create system service/unit file

sudo nano /etc/systemd/system/geth.service

Furthermore, copy and paste the code below

geth.service
[Unit]
Description=BKC ValidatorNode
After=network.target auditd.service
Wants=network.target

[Service]
Type=simple
ExecStart=/usr/bin/geth --datadir <DIRECTORY_LOCATION> \
    --config <CONFIG_FILE> --syncmode full --gcmode archive
KillMode=process
KillSignal=SIGINT
Restart=on-failure
RestartSec=5s
TimeoutStopSec=60

[Install]
WantedBy=default.target 
RequiredBy=swarm.service
Alias=geth.service

Important Configuration

--datadir <DIRECTORY_LOCATION>

The directory to store the chain data e.g., mainnet: /bkc-node/mainnet/data testnet: /bkc-node/testnet/data

--config <CONFIG_FILE>

The location of the toml config file e.g.,

mainnet: /bkc-node/mainnet/config.toml

testnet: /bkc-node/testnet/config.toml

Enable and start the service

sudo systemctl daemon-reload
sudo systemctl enable geth
sudo systemctl start geth

Last updated