Skip to content

Commit

Permalink
chore(cli): apply new cli to documents and scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
yangby-cryptape committed Sep 7, 2023
1 parent 294e439 commit ea3eee7
Show file tree
Hide file tree
Showing 11 changed files with 96 additions and 56 deletions.
45 changes: 15 additions & 30 deletions .github/workflows/axon-start-with-short-genesis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@ jobs:
run: |
target/debug/axon --version | tee ${{ env.LOG_FILE }}
target/debug/axon init \
--config devtools/chain/config.toml \
--config devtools/chain/config.toml \
--chain-spec devtools/chain/specs/single_node/chain-spec.toml \
--key-file devtools/chain/debug.key \
| tee -a ${{ env.LOG_FILE }}
target/debug/axon run \
--config devtools/chain/config.toml \
--config devtools/chain/config.toml \
| tee -a ${{ env.LOG_FILE }} &
sleep 10
Expand Down Expand Up @@ -89,35 +90,19 @@ jobs:
target/debug/axon --version
target/debug/axon init \
--config devtools/chain/nodes/node_1.toml \
--chain-spec devtools/chain/specs/multi_nodes_short_epoch_len/chain-spec.toml \
> ${{ env.LOG_PATH }}/node_1.log
target/debug/axon init \
--config devtools/chain/nodes/node_2.toml \
--chain-spec devtools/chain/specs/multi_nodes_short_epoch_len/chain-spec.toml \
> ${{ env.LOG_PATH }}/node_2.log
target/debug/axon init \
--config devtools/chain/nodes/node_3.toml \
--chain-spec devtools/chain/specs/multi_nodes_short_epoch_len/chain-spec.toml \
> ${{ env.LOG_PATH }}/node_3.log
target/debug/axon init \
--config devtools/chain/nodes/node_4.toml \
--chain-spec devtools/chain/specs/multi_nodes_short_epoch_len/chain-spec.toml \
> ${{ env.LOG_PATH }}/node_4.log
for id in 1 2 3 4; do
target/debug/axon init \
--config devtools/chain/nodes/node_${id}.toml \
--chain-spec devtools/chain/specs/multi_nodes_short_epoch_len/chain-spec.toml \
--key-file devtools/chain/debug.key \
> ${{ env.LOG_PATH }}/node_${id}.log
done
target/debug/axon run \
--config devtools/chain/nodes/node_1.toml \
>> ${{ env.LOG_PATH }}/node_1.log &
target/debug/axon run \
--config devtools/chain/nodes/node_2.toml \
>> ${{ env.LOG_PATH }}/node_2.log &
target/debug/axon run \
--config devtools/chain/nodes/node_3.toml \
>> ${{ env.LOG_PATH }}/node_3.log &
target/debug/axon run \
--config devtools/chain/nodes/node_4.toml \
>> ${{ env.LOG_PATH }}/node_4.log &
for id in 1 2 3 4; do
target/debug/axon run \
--config devtools/chain/nodes/node_${id}.toml \
>> ${{ env.LOG_PATH }}/node_${id}.log &
done
npx zx <<'EOF'
import { waitXBlocksPassed } from './devtools/ci/scripts/helper.js'
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/openzeppelin_test_11.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,14 @@ jobs:
- name: Deploy Local Network of Axon
run: |
rm -rf ./devtools/chain/data
./target/debug/axon init --config devtools/chain/config.toml --chain-spec devtools/chain/specs/single_node/chain-spec.toml > /tmp/log 2>&1
./target/debug/axon run --config devtools/chain/config.toml >> /tmp/log 2>&1 &
./target/debug/axon init \
--config devtools/chain/config.toml \
--chain-spec devtools/chain/specs/single_node/chain-spec.toml \
--key-file devtools/chain/debug.key \
> /tmp/log 2>&1
./target/debug/axon run \
--config devtools/chain/config.toml \
>> /tmp/log 2>&1 &
- name: Run prepare
id: runtest
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/openzeppelin_test_16_19.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,14 @@ jobs:
- name: Deploy Local Network of Axon
run: |
rm -rf ./devtools/chain/data
./target/debug/axon init --config devtools/chain/config.toml --chain-spec devtools/chain/specs/single_node/chain-spec.toml > /tmp/log 2>&1
./target/debug/axon run --config devtools/chain/config.toml >> /tmp/log 2>&1 &
./target/debug/axon init \
--config devtools/chain/config.toml \
--chain-spec devtools/chain/specs/single_node/chain-spec.toml \
--key-file devtools/chain/debug.key \
> /tmp/log 2>&1
./target/debug/axon run \
--config devtools/chain/config.toml \
>> /tmp/log 2>&1 &
- name: Run prepare
id: runtest
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/openzeppelin_test_1_5_and_12_15.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,14 @@ jobs:
- name: Deploy Local Network of Axon
run: |
rm -rf ./devtools/chain/data
./target/debug/axon init --config devtools/chain/config.toml --chain-spec devtools/chain/specs/single_node/chain-spec.toml > /tmp/log 2>&1
./target/debug/axon run --config devtools/chain/config.toml >> /tmp/log 2>&1 &
./target/debug/axon init \
--config devtools/chain/config.toml \
--chain-spec devtools/chain/specs/single_node/chain-spec.toml \
--key-file devtools/chain/debug.key \
> /tmp/log 2>&1
./target/debug/axon run \
--config devtools/chain/config.toml \
>> /tmp/log 2>&1 &
- name: Run prepare
id: runtest
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/openzeppelin_test_6_10.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,14 @@ jobs:
- name: Deploy Local Network of Axon
run: |
rm -rf ./devtools/chain/data
./target/debug/axon init --config devtools/chain/config.toml --chain-spec devtools/chain/specs/single_node/chain-spec.toml > /tmp/log 2>&1
./target/debug/axon run --config devtools/chain/config.toml >> /tmp/log 2>&1 &
./target/debug/axon init \
--config devtools/chain/config.toml \
--chain-spec devtools/chain/specs/single_node/chain-spec.toml \
--key-file devtools/chain/debug.key \
> /tmp/log 2>&1
./target/debug/axon run \
--config devtools/chain/config.toml \
>> /tmp/log 2>&1 &
- name: Run prepare
id: runtest
run: |
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/somking_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,14 @@ jobs:
- name: Start axon
run: |
cd ${{ github.workspace }}/axon
./axon init --config ${{ github.workspace }}/axon/config.toml --chain-spec ${{ github.workspace }}/axon/specs/single_node/chain-spec.toml > /tmp/log 2>&1
./axon run --config ${{ github.workspace }}/axon/config.toml >> /tmp/log 2>&1 &
./axon init \
--config ${{ github.workspace }}/axon/config.toml \
--chain-spec ${{ github.workspace }}/axon/specs/single_node/chain-spec.toml \
--key-file ${{ github.workspace }}/axon/debug.key \
> /tmp/log 2>&1
./axon run \
--config ${{ github.workspace }}/axon/config.toml \
>> /tmp/log 2>&1 &
sleep 120
- name: Check Axon Status
run: |
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/v3_core_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,14 @@ jobs:
- name: Deploy Local Network of Axon
run: |
rm -rf ./devtools/chain/data
./target/debug/axon init --config devtools/chain/config.toml --chain-spec devtools/chain/specs/single_node/chain-spec.toml > /tmp/log 2>&1
./target/debug/axon run --config devtools/chain/config.toml >> /tmp/log 2>&1 &
./target/debug/axon init \
--config devtools/chain/config.toml \
--chain-spec devtools/chain/specs/single_node/chain-spec.toml \
--key-file devtools/chain/debug.key \
> /tmp/log 2>&1
./target/debug/axon run \
--config devtools/chain/config.toml \
>> /tmp/log 2>&1 &
- name: Install dependencies
run: |
cd /home/runner/work/axon/axon/v3-core
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/web3_compatible.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,12 @@ jobs:
run: |
rm -rf ./devtools/chain/data
./target/debug/axon init \
--config devtools/chain/config.toml \
--config devtools/chain/config.toml \
--chain-spec devtools/chain/specs/single_node/chain-spec.toml \
--key-file devtools/chain/debug.key \
> /tmp/log 2>&1
./target/debug/axon run \
--config devtools/chain/config.toml \
--config devtools/chain/config.toml \
>> /tmp/log 2>&1 &
- name: Checkout gpBlockchain/axon-test
Expand Down
20 changes: 16 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,14 @@ e2e-test-lint:
e2e-test:
cargo build
rm -rf ./devtools/chain/data
./target/debug/axon init --config devtools/chain/config.toml --chain-spec devtools/chain/specs/single_node/chain-spec.toml > /tmp/log 2>&1
./target/debug/axon run --config devtools/chain/config.toml >> /tmp/log 2>&1 &
./target/debug/axon init \
--config devtools/chain/config.toml \
--chain-spec devtools/chain/specs/single_node/chain-spec.toml \
--key-file devtools/chain/debug.key \
> /tmp/log 2>&1
./target/debug/axon run \
--config devtools/chain/config.toml \
>> /tmp/log 2>&1 &
cd tests/e2e && yarn
cd tests/e2e/src && yarn exec http-server &
cd tests/e2e && yarn exec wait-on -t 5000 tcp:8000 && yarn exec wait-on -t 5000 tcp:8080 && yarn test
Expand All @@ -74,8 +80,14 @@ e2e-test:
e2e-test-ci:
cargo build
rm -rf ./devtools/chain/data
./target/debug/axon init --config devtools/chain/config.toml --chain-spec devtools/chain/specs/single_node/chain-spec.toml > /tmp/log 2>&1
./target/debug/axon run --config devtools/chain/config.toml >> /tmp/log 2>&1 &
./target/debug/axon init \
--config devtools/chain/config.toml \
--chain-spec devtools/chain/specs/single_node/chain-spec.toml \
--key-file devtools/chain/debug.key \
> /tmp/log 2>&1
./target/debug/axon run \
--config devtools/chain/config.toml \
>> /tmp/log 2>&1 &
cd tests/e2e && yarn
cd tests/e2e/src && yarn exec http-server &
cd tests/e2e && yarn exec wait-on -t 5000 tcp:8000 && yarn exec wait-on -t 5000 tcp:8080 && HEADLESS=true yarn test
Expand Down
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<img src="./docs/assets/logo/axon-01.png" width="450">
</a>
<p align="center">
<a href="https://github.com/axonweb3/axon/releases"><img src="https://img.shields.io/github/v/release/axonweb3/axon?sort=semver"></a>
<a href="https://github.com/axonweb3/axon/releases"><img src="https://img.shields.io/github/v/release/axonweb3/axon?sort=semver"></a>
<a href = "https://hub.docker.com/r/axonweb3/axon/tags"><img src = "https://img.shields.io/docker/pulls/axonweb3/axon"></a>
<a href="https://github.com/axonweb3/axon/blob/main/LICENSE"><img src="https://img.shields.io/badge/License-MIT-green.svg"></a>
<a href="https://github.com/axonweb3/axon"><img src="https://github.com/axonweb3/axon/actions/workflows/web3_compatible.yml/badge.svg?branch=main"></a>
Expand Down Expand Up @@ -52,8 +52,12 @@ Axon provides the compiled binary on the [release page](`https://github.com/axon
# Clone from GitHub
git clone https://github.com/axonweb3/axon.git && cd axon
# Run release binary for single node
cargo run --release -- init -c devtools/chain/config.toml -s devtools/chain/specs/single_node/chain-spec.toml
cargo run --release -- run -c devtools/chain/config.toml
cargo build --release
target/release/axon init \
--config devtools/chain/config.toml \
--chain-spec devtools/chain/specs/single_node/chain-spec.toml \
--key-file devtools/chain/debug.key
target/release/axon run --config devtools/chain/config.toml

```

Expand Down
12 changes: 7 additions & 5 deletions devtools/docker/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#!/bin/sh

DATA_DIR="/app/devtools/chain/data"
CONFIG_FILE="/app/devtools/chain/config.toml"
CHAIN_SPEC_FILE="/app/devtools/chain/specs/single_node/chain-spec.toml"
BASE_DIR="/app/devtools/chain"
DATA_DIR="${BASE_DIR}/data"
CONFIG_FILE="${BASE_DIR}/config.toml"
CHAIN_SPEC_FILE="${BASE_DIR}/specs/single_node/chain-spec.toml"
KEY_FILE="${BASE_DIR}/debug.key"

if [ ! -e "${DATA_DIR}" ]; then
/app/axon init -c=${CONFIG_FILE} -s=${CHAIN_SPEC_FILE}
/app/axon init --config "${CONFIG_FILE}" --chain-spec "${CHAIN_SPEC_FILE}" --key-file "${KEY_FILE}"
fi
/app/axon run -c=${CONFIG_FILE}
/app/axon run --config "${CONFIG_FILE}"

0 comments on commit ea3eee7

Please sign in to comment.