This guide will help you set up a Core Testnet node using an Ubuntu/Linux operating system. It includes all the necessary steps, from installing dependencies to launching the node.
Before you begin, ensure your system meets the following requirements:
- Ubuntu 22.04 LTS or later (with terminal access).
- Basic understanding of Linux terminal commands.
- Ensure your system meets the hardware and system requirements. Check eligibility here.
- Storage: 1 TB SSD (Solid State Drive), gp3, 8k IOPS, 250MB/s throughput, read latency <1ms.
- CPU: 4 CPU cores.
- RAM: 8 GB.
- Internet Speed: Broadband connection with upload/download speeds of at least 10 Mbps.
Start by ensuring your system is up-to-date.
-
Open a terminal.
-
Run the following commands to update your package list and upgrade installed packages:
sudo apt update sudo apt upgrade -y
Install the necessary dependencies to build the Core node software.
-
Run the following command to install Git, GCC, Go, and other required tools:
sudo apt install -y git gcc make curl lz4 golang unzip
-
Verify the installation of
gccandgo:gcc --version go version
You should see version details for both GCC and Go.
-
Clone the
core-chainrepository from GitHub:git clone https://github.com/coredao-org/core-chain
-
Navigate into the cloned directory:
cd core-chain
-
Run the following command to install the dependencies for building the
gethbinary:make geth
-
The build process will output details similar to:
>>> /usr/lib/go-1.22/bin/go build -ldflags "-X github.com/ethereum/go-ethereum/internal/version.gitCommit=afb8bd3ffe652e90a59af26db119bd988a03dd8f ..." -o /home/harystyles/core-chain/build/bin/geth ./cmd/geth Done building.
Syncing from the genesis block can be time-consuming. It is recommended to use a snapshot of the blockchain for faster syncing.
-
Download the latest Testnet snapshot from Core Snapshots GitHub:
wget https://snap.coredao.org/coredao-snapshot-testnet-20240327-pruned.tar.lz4
-
Create a directory for your node data:
mkdir -p ./node
-
Decompress and extract the snapshot into the
./nodedirectory:lz4 -d coredao-snapshot-testnet-20240327-pruned.tar.lz4 coredao-snapshot-testnet-20240327-pruned.tar tar -xvf coredao-snapshot-testnet-20240327-pruned.tar -C ./node
The genesis.json file sets the initial state of the blockchain for your node.
-
Download and extract the
testnet2.ziprelease from GitHub:wget https://github.com/coredao-org/core-chain/releases/download/v1.0.14/testnet2.zip unzip testnet2.zip
-
Initialize the genesis block with the following command:
./build/bin/geth --datadir ./node init ./testnet2/genesis.json
Ensure that the path to genesis.json is correct (./testnet2/genesis.json).
You can start the node in two ways:
Run the following command to start your node:
./build/bin/geth --datadir ./node --cache 8000 --rpc.allow-unprotected-txs --networkid 1114This command sets:
--datadir ./node: Location of blockchain data.--cache 8000: Allocates 8 GB of RAM for performance.--rpc.allow-unprotected-txs: Allows unprotected transactions (needed for validator actions).--networkid 1114: Specifies the Testnet network ID.
Alternatively, you can use a configuration file to help your node connect to peers:
./build/bin/geth --config ./testnet2/config.toml --datadir ./node --cache 8000 --rpc.allow-unprotected-txs --networkid 1114Once your node is running, you can monitor the logs to ensure everything is working properly.
-
To view the logs in real-time, use the following command:
tail -f ./node/logs/core.log