How to setup an Astor (Sha-3 TestNet) node

Stevan Lohja
Ethereum Classic Cooperative
4 min readMay 17, 2021

Hyperledger Besu is an Apache 2.0 licensed, MainNet compatible, Ethereum client written in Java. Besu allows you to run Ethereum Classic and related Testnets. Nodes allow you to download and sync the blockchain, interact with the blockchain via API, run mining nodes, and more. ETC Cooperative, IOHK Mantis, and the SHA3 Classic Coalition have been supporting efforts around ECIP-1049 which proposes to change the ETC PoW algorithm to Keccak-256 (Sha-3). This has lead to keccak mining support in Besu, up and coming Keccak support in IOHK Mantis, and ETC Coop is supporting keccak mining support in Core-geth. The Astor TestNet is the official-public TestNet featuring ECIP-1049 allowing developers and miners to begin testing tools and hardware.

Goals

  • Install and manage Besu with Docker
  • Start Besu on Astor TestNet
  • Start Besu as a API service and/ or mining service
  • Optional: Setup basic metrics and monitoring

System Requirements

ℹ️ More system resources will increase the download and sync performance of the Besu node.

Astor TestNet:

CPURAMFAST syncFULL sync24~10 GB~ 10 GB

Prerequisites

  • Docker: Docker will be used to install and manage the Besu service.
  • Storage Volume (optional): Running a node will download and sync the blockchain. Astor is a small TestNet and some developers may not be interested in preserving the state on their machine. So, using a mounted volume is optional.

ℹ️ Running Besu as a docker container without mounted storage for the chain data will cause the Besu container to grow in size and restarting the Besu container could risk restarting the chain state.

Install Besu

  • Install Besu via Docker by pulling the image:
$ docker pull hyperledger/besu
  • Check the Besu image is installed:
$ docker image list
REPOSITORY TAG IMAGE ID CREATED SIZE
hyperledger/besu latest 59d4d204ed23 13 days ago 326MB

Update Besu

  • To update Besu, pull the latest image or specific release tag:
$ docker pull hyperledger/besu:latest
$ docker pull hyperledger/besu:<release>
$ docker pull hyperledger/besu:develop

Start Besu on Astor TestNet

ℹ️ Please read this section completely before initiating your Astor node.

  • Start Besu to download and sync the Astor TestNet with GPU mining enabled via stratum+tcp:
$ docker run --name astor-node -p 8545:8545 hyperledger/besu:develop \
--data-path=/var/lib/besu --network=astor --sync-mode=FULL \
--rpc-http-enabled --rpc-ws-enabled \
--miner-enabled --miner-coinbase=fe3b557e8fb62b89f4916b721be55ceb828dbd73 --miner-stratum-enabled --miner-stratum-host=0.0.0.0 --miner-stratum-port=8008 \
--bootnodes=enode://b638fc3dca6181ae97fac2ea0157e8330f5ac8a20c0d4c63aa6f98dcbac4e35b4e023f656757b58c1da7a7b2be9ffad9342e0f769b8cf0f5e35ff73116ff7dfd@3.16.171.213:30303
  • Consider adding the following options and commands to make your node more unique to the Astor TestNet. This helps with the overall testing and organization of the network:

--miner-extra-data=<extraData>: A hex string representing the (32) bytes to be included in the extra data field of a mined block (default: 0x)

E.g.: --miner-extra-data=0x45544320436f6f7065726174697665, 0x455... hex value translates to the string ETC Cooperative. You can use https://eserialize.com/ to translate a unique alias or name in HEX form.

Change the --miner-coinbase=<account> to your unique TestNet address.

Confirm node is running

  • eth_chainId returns the chain ID of the network. Astor TestNet chainId is 212 or 0xd4 is HEX format.
$ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":1}' localhost:8545
  • eth_syncing returns the starting, current, and highest block.
$ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' localhost:8545

Mining

Besu supports both CPU and GPU mining.

  • Configure CPU mining by adding the following options:

--rpc-http-api=ETH,MINER --miner-enabled --miner-coinbase=<account>

  • Configure GPU mining with the following options:

--rpc-http-api=ETH,MINER --miner-enabled --miner-stratum-enabled --miner-coinbase=<account>

Optional command-line options are:

  • --miner-stratum-host to specify the host of the mining service.
  • --miner-stratum-portto specify the port of the mining service.

CORS, Host/ Domain

CORS and allowed host can be set with the following options:

--rpc-http-cors-origins="all" --host-allowlist="*"

🚨 These settings are a security risk for production environments since it exposes the RPC connection on your node to any remote connection. Set CORS and allowed host suitable to your environment.

Metrics

Besu supports Prometheus monitoring and alerting service to access Besu and you can use Grafana to visualize the collected data. To enabled Besu metrics add the following options:

--metrics-enabled

ℹ️ The default host and port are 127.0.0.1 and 9545. To specify host and port use --metrics-host and --metrics-port options.

Hyperledger Besu Documentation

Visit the Besu documentation to learn more about the project and features:

--

--