Running a Full Node
This document outlines the process for running a full ZetaChain node. It is intended for those who are familiar with the Linux operating system and the command line interface.
Please refer to Technical Requirements for more details on the technical requirements for running a ZetaChain node.
Set Limits on Open Files and Number of Processes
To better manage the resources of your nodes, we recommend setting some limits on the maximum number of open file descriptors (nofile) and maximum number of processes (nproc).
/etc/security/limits.conf to include or modify the following parameters:
* soft nproc 262144
* hard nproc 262144
* soft nofile 262144
* hard nofile 262144
/etc/sysctl.conf to include the following:
Create zetachain User Account
We recommend running ZetaChain binary files with a user account rather than as root.
useradd -m -s /bin/bash zetachain
Create ZetaChain Directory Structure
This is needed to store ZetaChain binary and configuration files.
sudo su zetachain
mkdir -p /home/zetachain/.zetacored/bin
Download and Install the zetacored binary
Binaries are built based on OS version and CPU architecture. You can download the latest binaries from our ZetaChain Node GitHub Repo
Install it in your PATH:
Install ZetaChain Configuration Files
ZetaChain configuration files can be downloaded from the Athens3 Github Repo
Install it as follows:
Create a Systemd Unit File
We recommend using Systemd to start and stop ZetaChain binary files and view the
logs. You can create a Systemd unit file at the following location
ExecStart=zetacored start --home /home/zetachain/.zetacored/ --log_format json --log_level info --moniker <YOUR_NODE_NAME_HERE>
Then start the service with
systemctl start zetacored.
You can view the logs with
journalctl -o cat -f -u zetacored.
ZetaChain Core is built with the Cosmos SDK. There is an
—help flag that can
be used with any subcommand to learn its use and syntax.
In a production environment we recommend monitoring the node resources (CPU load, Memory Usage, Disk usage and Disk IO) for any performance degradation.
ZetaChain Core generates a log that can be monitored for errors and used for
troubleshooting. If you install Zetacore as a Systemd service using the
instructions above you can view this log with
journalctl -o cat -f -u zetacored.
Prometheus can be enabled to serve metrics which can be consumed by Prometheus collector(s). Telemetry include Prometheus metrics can be enabled in the app.toml file. See the CosmosSDK Telemetry Documentation for more information.
See more about your Validator Monitoring here.
Syncing from a StateSync node
Use the state sync node closer your node. Run the following command to collect
latest block height and
latest block hash:
curl -s http://<closest StateSync IP>:26657/block | jq -r '.result.block.header.height + "\n" + .result.block_id.hash'
$ curl -s http://184.108.40.206:26657/block | jq -r '.result.block.header.height + "\n" + .result.block_id.hash'
Use the return values to edit the following variables in
# State sync rapidly bootstraps a new node by discovering, fetching, and restoring a state machine
# snapshot from peers instead of fetching and replaying historical blocks. Requires some peers in
# the network to take and serve state machine snapshots. State sync is not attempted if the node
# has any local state (LastBlockHeight > 0). The node will have a truncated block history,
# starting from the height of the snapshot.
enable = true
# RPC servers (comma-separated) for light client verification of the synced state machine and
# retrieval of state data for node bootstrapping. Also needs a trusted height and corresponding
# header hash obtained from a trusted source, and a period during which validators can be trusted.
# For Cosmos SDK-based chains, trust_period should usually be about 2/3 of the unbonding time (~2
# weeks) during which they can be financially punished (slashed) for misbehavior.
rpc_servers = "<closest StateSync IP>:26657,<closest StateSync IP>:26657"
trust_height = <return value for the latest block height>
trust_hash = "<return value for the latest block hash>"
Start the ZetaChain node: