{"id":18449317,"url":"https://github.com/axonweb3/axon-cli","last_synced_at":"2025-04-08T01:32:56.460Z","repository":{"id":61164362,"uuid":"529151643","full_name":"axonweb3/axon-cli","owner":"axonweb3","description":"A command line interface to manage Axon chain config, deploy and DevOps.","archived":false,"fork":false,"pushed_at":"2023-01-30T01:55:08.000Z","size":1497,"stargazers_count":3,"open_issues_count":2,"forks_count":5,"subscribers_count":6,"default_branch":"main","last_synced_at":"2023-03-05T17:45:27.829Z","etag":null,"topics":["axon","blockchain","ckb","cli","crosschain","devops","web3"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/axonweb3.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null}},"created_at":"2022-08-26T07:02:14.000Z","updated_at":"2022-11-25T08:07:30.000Z","dependencies_parsed_at":"2023-02-16T02:46:22.965Z","dependency_job_id":null,"html_url":"https://github.com/axonweb3/axon-cli","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axonweb3%2Faxon-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axonweb3%2Faxon-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axonweb3%2Faxon-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axonweb3%2Faxon-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/axonweb3","download_url":"https://codeload.github.com/axonweb3/axon-cli/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223297990,"owners_count":17122179,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["axon","blockchain","ckb","cli","crosschain","devops","web3"],"created_at":"2024-11-06T07:19:36.660Z","updated_at":"2024-11-06T07:19:37.621Z","avatar_url":"https://github.com/axonweb3.png","language":"Rust","readme":"# Axon CLI\nYou need to take the following steps to run axon and benchmark with axon-cli.\n## 1. Build axon-cli\nUnder the axon-cli directory, run the following command:  \n    `cargo build --release` Or  `cargo build`\n## 2. Run axon-cli\n For example,\n`./target/debug/axon-cli` in case you run the command `cargo build`.\n\n## 3. Interactive Commands\nBefore the execution of axon commands, you have to enable tcp port for docker(0.0.0.0:2375 in this case).  \nMoreover, to execute the following commands successfully, you need to copy the dir `axon-cli/devtools` in this repository into dir `$HOME/.axon/` in your local machine. If `$HOME/.axon` does not exist, please create it mannully.  \nIf you start axon without copying the config files to `$HOME/.axon`, this command will create `$HOME/.axon` for you. But, the axon process in the docker won't work. In fact, the axon process will panic due to lack of config files. You can run `docker logs axon1` to have a look, the output will be similar to the following:\n\u003ethread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: IO(Os { code: 2, kind: NotFound, message: \"No such file or directory\" })', core/cli/src/lib.rs:43:65 \n\nAfter axon-cli gets run. You have 5 commands to execute.  \n\n- start  \nYou can start 1 or 4 docker axon nodes. The default is 1, you can start 4 by `axon start --number=4`.  \nAlso, you can specify the axon dir by adding things like `-d=/root/.axon`.  \n\n- stop  \nstop the 4 docker nodes just started.\n- rm  \nremove the 4 docker containers just created.\n- del  \ndelete chain data under the path specified by parameter --data-dir. If not specified, it will be the dir specified by `axon start -d` plus `devtools/chain`.\n- bm  \nstart benchmark, transactions will be sent to the axon nodes.  \nPlease clone repository `https://github.com/axonweb3/axon-devops` beforehand, because benchmark related files are maintained here. After the download, please refer to the readme of benchmark to modify config.jason. Here is the current one:\n```conf\n{\n    \"http_endpoint\": \"http://127.0.0.1:8000\",\n    \"chain_id\": 2022,\n    \"mnemonic\": \"test test test test test test test test test test test junk\",\n    \"mnemonic_index\": 0,\n    \"continuous_benchmark\": false,\n    \"benchmark_time\": 60000,\n    \"batch_size\": 100,\n    \"thread_num\": 10,\n    \"id\": \"936501604767629344\",\n    \"token\": \"Fha8Hn6C31VEu3wL5XejIVGocTXiQbJ6HabAC5sLtHHwvqQ63iXj1FmOkH_FVN4mTZwQ\",\n    \"benchmark_cases\": [\"./benchmark\", \"./contract_benchmark\"]\n}\n                                               \n```  \nThis config is not working now, please wait for update. Error messages like the following will be printted:  \n\u003e BigNumber.toString does not accept any parameters; base-10 is assumed.  \n\nYou must specify benchmark dir by --data-dir like `axon bm --data-dir=/home/wenyuan/git/axon-devops/benchmark/benchmark`. Please replace `/home/wenyuan/git/axon-devops/benchmark/benchmark` with your local benchamark dir.\n\n## 4. Check axon status  \nTo be sure of the correctness. You can check by the following commands:  \n### 1．check the liveness of axon nodes \n\u003eroot@yoga:# docker ps  \nCONTAINER ID   IMAGE     COMMAND                  CREATED          STATUS          PORTS     NAMES  \nd82bf78d05cc   axon:v1   \"./axon -c=/app/devt…\"   41 seconds ago   Up 38 seconds             axon1  \n3cdd6cab7077   axon:v1   \"./axon -c=/app/devt…\"   41 seconds ago   Up 38 seconds             axon3  \n303bd01e6bd6   axon:v1   \"./axon -c=/app/devt…\"   41 seconds ago   Up 37 seconds             axon2  \ne54ad14dbb24   axon:v1   \"./axon -c=/app/devt…\"   41 seconds ago   Up 37 seconds             axon4\n\n### 2．check the axon logs\n\u003eroot@yoga:~# docker logs axon4 | grep height  \n[2022-04-12T00:58:52.340656848+00:00 INFO core_network::outbound::gossip] no trace id found for gossip /gossip/consensus/broadcast_height  \n[2022-04-12T00:58:52.341000035+00:00 INFO overlord::state::process] overlord: start from wal wal info height 472, round 1, step Propose  \n[2022-04-12T00:58:52.341056842+00:00 INFO overlord::state::process] Overlord: \"027ffd6a6a231561f2afe5878b1c743323b34263d16787130b1815fe35649b0bf5\" become leader, height 472, round 1  \n[2022-04-12T00:58:54.342405157+00:00 INFO core_network::outbound::gossip] no trace id found for gossip /gossip/consensus/broadcast_height  \n\nIt's easy to find the chain height has grown to height 472, and if you check it later, you can find the height is larger than the current 472.\n\n### 3．check the network connect between the nodes.\n```\n    docker exec -it axon1 /bin/bash\n    apt install net-tools\n    apt install iputils-ping\n```\n`ping axon2` without timeout like following:\n\u003eroot@6f816d8be4b7:/app# ping axon2  \nPING axon2 (172.18.0.2) 56(84) bytes of data.  \n64 bytes from axon2.axon-cli_axon-net (172.18.0.2): icmp_seq=1 ttl=64 time=0.298 ms  \n64 bytes from axon2.axon-cli_axon-net (172.18.0.2): icmp_seq=2 ttl=64 time=0.074 ms  \n\nor \n\u003enetstat -tnp | grep axon show 3 other nodes like following:  \nroot@6f816d8be4b7:/app# netstat -tnp | grep axon  \ntcp        0      0 172.18.0.3:8001         172.18.0.2:8001         ESTABLISHED 1/./axon   \ntcp        0      0 172.18.0.3:8001         172.18.0.5:8001         ESTABLISHED 1/./axon  \ntcp        0      0 172.18.0.3:8001         172.18.0.4:8001         ESTABLISHED 1/./axon\n\n## 5. Start Benchmark\n`bm` is short for benchmark, this command will start benchmark. You can run `docker logs bm` to have a look at the benchmark status.\nFor example:  \n\u003eroot@yoga:~# docker logs bm  \n/////////////////////////////////////////////////////  \nbenchmark time: 60000 ms  \nendpoint: http://172.17.0.1:8000  \n/////////////////////////////////////////////////////  \n\u003e  \n\u003ewaiting...  \npreparing...  \n\u003e  \n\u003edeploying contract:  ERC20  \ncontract ERC20 deployed to 0xF67Bc4E50d1df92b0E4C61794A4517AF6a995CB2  \n\u003e  \n\u003eprepared  \nbenchmark case 0: ./benchmark  \n\u003e  \n\u003e/////////////////////////////////////////////////////  \nbenchmark time:  64650.558417998254 ms  \ntransaction count: 7200  \nTPS: 111.3679475658724 ms  \ntransfer rate: 98.83  \n/////////////////////////////////////////////////////  \n\nYou can check the result by the end of the output.\n\n## 6. start apm\nWe offer `apm start` and `apm stop` commands to start and stop apm features respectively.\nHowever, before you start, you need to get some configs prepared.\n- In `apm/deploy/hosts`, change ip of axon_node to your own ip. In my case, it is `172.19.86.210`.\n\n- In `apm/deploy/roles/monitor/vars/main.yaml`, change `monitor_dir` to your dir.  \nAll monitor related files willed be moved here, the data will be stored under `monitor_dir/data`. Please use absolute path, pathes like `~/.axon` are illegal.\n\n- In `apm/deploy/roles/agent/vars/main.yaml`.  \nFirst, set `monitor_agent_dir` to your dir. All agent related files willed be moved here, the data will be stored under `monitor_agent_dir/data`.\nSecond, set `log_path`.  \nAt present, there is no need to modify `monitor_address` and `es_address`. \n\n- The correct execution of `apm start` now depends on the apm path. You need commands like this:  \n   `apm start -p=/home/wenyuan/git/axon-cli/apm` or \n   `apm stop` \n    Please replace `/home/wenyuan/git/axon-cli/apm` with your own apm dir.  \n    If `apm start` returns the following message of `filebeat`, don't mind, this won't affect the following actions.\n    \u003eStart err error 400 Bad Request - failed to create shim: OCI runtime create failed: container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: rootfs_linux.go:75: mounting \"/root/.axon/agent/config/filebeat/filebeat.yml\" to rootfs at \"/usr/share/filebeat/filebeat.yml\" caused: mount through procfd: not a directory: unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type  \n    \n- To clean data, you need command `clean` like this:  \n   `apm clean -p=/home/wenyuan/git/axon-cli/apm`.\n\nRemeber, `apm start` may take a long time to complete due to heavy underground jobs, please be patient.  \nAfter the right config and the successful start of apm, you can visit Grafana by `localhost:8600` in your browser. The default user name and password of grafana is `admin` and `admin`.  \nYou can take a look at the `axon-node` Dashboard. The default time range may be 7 days, you need to change it to `Last 1 hour` or similar time ranges to observe the data clearly.  \n\u003cdiv align=center\u003e\u003cimg src=\"./grafana.png\"\u003e\u003c/div\u003e\n\u003cdiv align=center\u003e\u003cimg src=\"./actuator.png\"\u003e\u003c/div\u003e\n\nIf you just run the benchmark, you can have a look at the `axon-benchmark` Dashboard.\n\u003cdiv align=center\u003e\u003cimg src=\"./benchmark.png\"\u003e\u003c/div\u003e\n\n# 7. CKB -\u003e AXON tx\n## 1. deploy crosschain metadata\n`cs --sender-key=dd50cac37ec6dd12539a968c1a2cbedda75bd8724f7bcad486548eaabb87fc8b --capacity=1000 --tx-type=0`\n\n## 2. transfer token from CKB to AXON\n`cs --sender-key=dd50cac37ec6dd12539a968c1a2cbedda75bd8724f7bcad486548eaabb87fc8b --capacity=1000 --tx-type=1`\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxonweb3%2Faxon-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faxonweb3%2Faxon-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxonweb3%2Faxon-cli/lists"}