Run a Node
Learn how to run an AxiomLedger
node.
The steps to run an AxiomLedger
node include:
- Prepare the required environment
- Obtain the node binary
- Deploy and start the node
- Connect to mainnet/testnet
Environment Requirements
AxiomLedger
supports the following operating systems:
- Linux:
- Ubuntu 20.04
- Centos 8
- MacOS: Ventura
Obtain Node Binary
Note that the AxiomLedger
binary contains a hidden secret
to ensure that only nodes with the same secret
can
connect to each other. The secret
is injected into the binary during compilation. To connect to mainnet/testnet
you need to download the official binary released on GitHub.
Download from GitHub
Go to the Releases page of the AxiomLedger
code repository, download the latest version binary zip file
for your operating system and CPU architecture, and unzip it in the deployment environment to get the AxiomLedger binary.
Compile from Source
Prepare Compilation Environment
- Install Git.
- Compiling from source requires Golang environment above version
1.20
, see Golang Installation Docs for details.
Get AxiomLedger Code
-
Use the following commands to download the repository code and switch to the latest stable version tag.
git clone https://github.com/axiomesh/axiom-ledger.git cd axiom-ledger git checkout ${latest_tag}
-
Download dependencies.
Use the following command to download dependency libraries.
go mod download
-
Compile the binary.
Use the following command to compile the binary. Note that
secret
can be left unspecified. Andnet
can be used to specify the configuration for mainnet or testnet. If not specified, it will default to the local 4-node configuration.make build secret=${secret} net=${net_name}
The compiled binary is at
./bin/axiom-ledger
.
Deploy and Start Node
-
Generate related config files to specified directory.
axiom-ledger --repo=$WORKSPACE config generate
-
Modify config file.
Config files are at
$WORKSPACE/config.toml
. You mainly need to modify ports and genesis validator configs. Nodes connect each other via P2P DHT network, so you only need to configure the P2P addresses of the genesis seed node.If you need to start quickly, you can configure it for solo node mode.
-
Start node.
axiom-ledger --repo=$WORKSPACE start
To easily manage nodes, you can register
AxiomLedger
as asystemctl
service:[Unit] Description=AxiomLedger Node Service [Service] User=nodeuser Group=nodeuser LimitNOFILE=500000 WorkingDirectory=$WORKSPACE ExecStart=/usr/local/bin/axiom-ledger --repo=$WORKSPACE start Restart=on-failure RestartSec=3s StandardOutput=journal StandardError=journal SyslogIdentifier=AxiomLedger [Install] WantedBy=multi-user.target
Connect to Mainnet/Testnet
The default config generated from the official binary downloaded from GitHub already contains mainnet/testnet P2P seed node information. So after startup it will automatically connect to mainnet/testnet. However, before the governance proposal to add the node is approved, other nodes will reject this node’s connection requests. The node can only join the network after the governance proposal is approved.