Skip to content

Commit 9bef6b2

Browse files
committed
fix: pass ledger and chain directories to demo
Signed-off-by: Arnaud Bailly <arnaud@pankzsoft.com>
1 parent 297df55 commit 9bef6b2

3 files changed

Lines changed: 16 additions & 10 deletions

File tree

Makefile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ dev: ## Compile and run for development with default options
7777
cargo run -- daemon \
7878
--ledger-dir $(LEDGER_DIR) \
7979
--chain-dir $(CHAIN_DIR) \
80-
--peer-address=$(AMARU_PEER_ADDRESS) \
80+
--peer-address $(AMARU_PEER_ADDRESS) \
8181
--network=$(NETWORK) \
82-
--listen-address=$(LISTEN_ADDRESS)
82+
--listen-address $(LISTEN_ADDRESS)
8383

8484
test-e2e: ## Run snapshot tests, assuming snapshots are available.
8585
cargo test -p amaru -- --ignored
@@ -94,19 +94,19 @@ check-llvm-cov: ## Check if cargo-llvm-cov is installed, install if not
9494

9595
coverage-html: check-llvm-cov ## Run test coverage for Amaru
9696
cargo llvm-cov \
97-
--no-cfg-coverage \
98-
--html \
99-
--output-dir $(COVERAGE_DIR) $(foreach package,$(COVERAGE_CRATES), --package $(package))
97+
--no-cfg-coverage \
98+
--html \
99+
--output-dir $(COVERAGE_DIR) $(foreach package,$(COVERAGE_CRATES), --package $(package))
100100

101101
coverage-lconv: ## Run test coverage for CI to upload to Codecov
102102
cargo llvm-cov \
103-
--all-features \
103+
--all-features \
104104
--workspace \
105105
--lcov \
106106
--output-path lcov.info
107107

108108
demo: ## Synchronize Amaru until a target epoch $DEMO_TARGET_EPOCH
109-
./scripts/demo.sh $(AMARU_PEER_ADDRESS) $(DEMO_TARGET_EPOCH) $(NETWORK)
109+
LEDGER_DIR=$(LEDGER_DIR) CHAIN_DIR=$(CHAIN_DIR) ./scripts/demo.sh $(AMARU_PEER_ADDRESS) $(DEMO_TARGET_EPOCH) $(NETWORK)
110110

111111
build-examples: ## Build all examples
112112
@for dir in $(wildcard examples/*/.); do \

examples/Cargo.lock

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/demo.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,17 @@ fi
1919

2020
NETWORK=${3:-preprod}
2121

22+
LEDGER_DIR=${LEDGER_DIR:-./ledger.db}
23+
24+
CHAIN_DIR=${CHAIN_DIR:-./chain.db}
25+
2226
echo -e " \033[1;32mTarget\033[00m epoch $TARGET_EPOCH"
2327
set -eo pipefail
24-
AMARU_TRACE="amaru=info" cargo run -- --with-json-traces daemon --peer-address=$PEER_ADDRESS --network=$NETWORK | while read line; do
28+
AMARU_TRACE="amaru=info" cargo run -- --with-json-traces daemon \
29+
--peer-address="${PEER_ADDRESS}" \
30+
--network="${NETWORK}" \
31+
--chain-dir="${CHAIN_DIR}" \
32+
--ledger-dir="${LEDGER_DIR}" | while read line; do
2533
EVENT=$(echo $line | jq -r '.fields.message' 2>/dev/null)
2634
SPAN=$(echo $line | jq -r '.span.name' 2>/dev/null)
2735
if [ "$EVENT" == "exit" ] && [ "$SPAN" == "epoch_transition" ]; then

0 commit comments

Comments
 (0)