Skip to main content

Zero to Axon with Axon-CLI

Axon-CLI is an all-in-one command-line interface that makes operating Axon fast and easy. It contains initialization, DevOps, and cross-chain requests, among other functions.

Zero to Axon with Axon-CLI is a hands-on tutorial. In less than 15 minutes, you can build a chain from scratch and learn how to start and manage a node with just one command.

Requirement

Axon-CLI heavily relies on docker, make sure that you have installed it. To run apm, ansible-playbook is also required.

Install Axon-CLI From GitHub

Start by cloning Axon-CLI from the GitHub repo by command:

git clone https://github.com/axonweb3/axon-cli.git

Enter into Axon-CLI directory

cd axon-cli

Under the Axon-CLI directory, run the following command to build binary:

cargo build --release

Now your basic Axon-CLI development environment is ready. Enter the Axon-CLI interface by running the following command:

./target/release/axon-cli

To quit Axon-CLI, use Ctrl + C.

Managing Axon nodes

Before starting, we have to generate key pairs for nodes, by running:

axon keygen

To start multiple nodes, use -n argument to specify nodes number:

axon keygen -n <NUMBER OF NODE>

Then, we need to generate config files from these key pairs:

axon config-gen

Now, we can start nodes:

axon start

See axon help for more usage.

Application performance monitoring (APM)

Start APM monitor and agent(s) by running:

apm monitor start
apm monitor agent

You might need to input your user password.

After setting up, you can access the APM platform Grafana by visiting localhost:8600 in your browser.

Now you can see the axon-node Dashboard is displayed as below. Grafana provides time range control which is 7 days by default. Click on the time units on the top navbar to change the range. (The Last 1 hour is selected here as shown below.)

dash1 last 1 hourdash2

You can also view the benchmark in the Dashboard axon-benchmark displayed as below.

dash3 benchmark

Benchmark

Use benchmark start and benchmark stop control the benchmark status.

Axon & CKB

Axon repository on GitHub : https://github.com/axonweb3/axon

CKB docs and technical reference: https://docs.nervos.org/

Deploy EVM DApps

Learn how to get started with EVM and deploy Solidity-based smart contracts in Hardhat environment.

Solidity: https://docs.soliditylang.org/en/latest/ Hardhat: https://hardhat.org/