Setting up Kovan Ethereum Full Node

Recommended instance#

To speed up the sync time for your Kovan node, we recommend that you create your instance with the following configuration:

  1. High memory, 16GB+. Then set this flag to increase the cache size --cache-size=8192.
  2. High disk space, 250GB+.
  3. High bandwidth, 5Gbps+.
  4. Multiple cores, 4+. Then set these flags to utilize multi-core instance --jsonrpc-threads, --jsonrpc-server-threads, --snapshot-threads.

Our recommendation is to use at least a 4-core, 16GB memory instance with over 250GB of disk space.

1. Install snap and parity#

Ubuntu

wget https://github.com/openethereum/openethereum/releases/download/v3.2.6/openethereum-linux-v3.2.6.zip
unzip openethereum-linux-v3.2.6.zip
sudo cp openethereum /snap/bin/
sudo chmod +x /snap/bin/openethereum

Redhat

wget https://github.com/openethereum/openethereum/releases/download/v3.2.6/openethereum-linux-v3.2.6.zip
unzip openethereum-linux-v3.2.6.zip
sudo cp openethereum /snap/bin/
sudo chmod +x /snap/bin/openethereum

2. Configure parity system service#

Change User=ubuntu to your user name.

sudo vi /etc/systemd/system/kovan.service

[Unit]
Description=kovan
[Service]
WorkingDirectory=~
ExecStart=bash -c 'openethereum --chain=kovan --cache-size=4096 --jsonrpc-port=7777 --jsonrpc-interface=all --ws-port=7778 --ws-interface=all'
Type=simple
Restart=always
RestartSec=1
User=ubuntu
[Install]
WantedBy=multi-user.target

Reload and start service

sudo systemctl daemon-reload
sudo systemctl start kovan

3. Check configuration and sync progress#

note

With the recommended settings, a full sync takes around 1 day to complete.

Check if the node RPC is up and running.

curl -X POST -H "Content-Type: application/json" \
-d '{
"jsonrpc":"2.0",
"method":"eth_getBlockByNumber",
"params":["latest", false],
"id":1
}' \
localhost:5555

Check the block gap.

curl -X POST -H "Content-Type: application/json" \
-d '{
"method":"parity_chainStatus",
"params":[],
"id":1,
"jsonrpc":"2.0"
}' \
localhost:5555

When the node is fully synced you should see the below response. Otherwise, you will be shown synced blocks and total blocks in hex format.

{"jsonrpc":"2.0","result":{"blockGap":null},"id":1}

Run this to verify if the node is fully synced and working properly

curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_getTransactionByHash","params":["0x316925f7c0d762b799d55465f0022d0516f12e8b59e9488e39b8634a1b0abdc0"],"id":1}' localhost:5555

4. Configure SSL for web service usage#

We use Caddy as reverse proxy here, you can select your own proxy and perform similar config.

  1. Create a DNS record for the RPC. Example: kovan.example.com
  2. Configure proxy

vi ~/Caddyfile

https://kovan.example.com {
@websockets {
header Connection *Upgrade*
header Upgrade websocket
}
reverse_proxy @websockets localhost:5556
reverse_proxy localhost:5555
}
  1. Configure system service

sudo vi /etc/systemd/system/caddy.service

[Unit]
Description=caddy
[Service]
WorkingDirectory=~
ExecStart=bash -c 'sudo caddy run --environ --config ~/Caddyfile'
Type=simple
Restart=always
RestartSec=1
User=ubuntu
[Install]
WantedBy=multi-user.target
  1. Reload and start service
sudo systemctl daemon-reload
sudo systemctl start caddy
  1. Query the RPC via DNS name
curl -X POST -H "Content-Type: application/json" \
-d '{
"jsonrpc":"2.0",
"method":"eth_getBlockByNumber",
"params":["latest", false],
"id":1
}' \
https://kovan.example.com
Last updated on