2025-12-17 01:03:03 +03:00
|
|
|
set shell := ["bash", "-eu", "-o", "pipefail", "-c"]
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
@just --list
|
|
|
|
|
|
|
|
|
|
# ---- Configuration ----
|
|
|
|
|
ARTIFACTS := "artifacts"
|
|
|
|
|
|
2026-06-05 22:08:49 +03:00
|
|
|
# Build risc0 program artifacts.
|
2025-12-17 01:03:03 +03:00
|
|
|
build-artifacts:
|
|
|
|
|
@echo "🔨 Building artifacts"
|
2026-06-09 16:02:56 +03:00
|
|
|
@rm -rf {{ARTIFACTS}}
|
|
|
|
|
@just build-artifact lee/privacy_preserving_circuit
|
|
|
|
|
@just build-artifact lez/programs programs
|
|
|
|
|
|
|
|
|
|
build-artifact methods_path features="":
|
|
|
|
|
@echo "Building artifacts for {{methods_path}}"
|
|
|
|
|
@rm -rf target/{{methods_path}}/riscv32im-risc0-zkvm-elf/docker/*.bin
|
|
|
|
|
@if [ "{{features}}" = "" ]; then \
|
|
|
|
|
CARGO_TARGET_DIR=target/{{methods_path}} cargo risczero build --manifest-path {{methods_path}}/Cargo.toml; \
|
|
|
|
|
else \
|
|
|
|
|
CARGO_TARGET_DIR=target/{{methods_path}} cargo risczero build --no-default-features --features {{features}} --manifest-path {{methods_path}}/Cargo.toml; \
|
|
|
|
|
fi
|
|
|
|
|
@mkdir -p {{ARTIFACTS}}/{{methods_path}}
|
|
|
|
|
@cp target/{{methods_path}}/riscv32im-risc0-zkvm-elf/docker/*.bin {{ARTIFACTS}}/{{methods_path}}
|
2026-02-23 17:02:24 +03:00
|
|
|
|
2026-06-05 22:08:49 +03:00
|
|
|
# Format codebase.
|
|
|
|
|
fmt:
|
|
|
|
|
@echo "🎨 Formatting codebase"
|
|
|
|
|
cargo +nightly fmt
|
|
|
|
|
taplo fmt
|
|
|
|
|
|
|
|
|
|
# Run tests.
|
2026-02-23 17:02:24 +03:00
|
|
|
test:
|
|
|
|
|
@echo "🧪 Running tests"
|
|
|
|
|
RISC0_DEV_MODE=1 cargo nextest run --no-fail-fast
|
|
|
|
|
|
2026-05-21 16:44:40 +02:00
|
|
|
# Run criterion benches: fast crypto primitives, then the slow PPE verify (real proving setup).
|
|
|
|
|
bench:
|
|
|
|
|
@echo "📊 Running criterion benches"
|
|
|
|
|
cargo bench -p crypto_primitives_bench --bench primitives
|
|
|
|
|
cargo bench -p cycle_bench --features ppe --bench verify
|
|
|
|
|
|
2026-06-05 22:08:49 +03:00
|
|
|
# Run Bedrock node in docker.
|
2026-02-23 17:02:24 +03:00
|
|
|
[working-directory: 'bedrock']
|
|
|
|
|
run-bedrock:
|
|
|
|
|
@echo "⛓️ Running bedrock"
|
|
|
|
|
docker compose up
|
|
|
|
|
|
2026-06-05 22:08:49 +03:00
|
|
|
# Run Sequencer. Run with RISC0_DEV_MODE=1 to disable proof verification for faster iteration.
|
2026-06-02 14:14:42 -03:00
|
|
|
[working-directory: 'lez/sequencer/service']
|
2026-06-05 22:08:49 +03:00
|
|
|
run-sequencer standalone="":
|
2026-02-23 17:02:24 +03:00
|
|
|
@echo "🧠 Running sequencer"
|
2026-06-05 22:08:49 +03:00
|
|
|
@if [ "{{standalone}}" = "standalone" ]; then \
|
|
|
|
|
echo "🧪 Running in standalone mode"; \
|
|
|
|
|
RUST_LOG=info cargo run --features standalone --release -p sequencer_service configs/debug/sequencer_config.json; \
|
|
|
|
|
else \
|
|
|
|
|
echo "🚀 Running in normal mode"; \
|
|
|
|
|
RUST_LOG=info cargo run --release -p sequencer_service configs/debug/sequencer_config.json; \
|
|
|
|
|
fi
|
2026-02-23 17:02:24 +03:00
|
|
|
|
2026-06-05 22:08:49 +03:00
|
|
|
# Run Indexer. Run with RISC0_DEV_MODE=1 to disable proof verification for faster iteration.
|
2026-06-02 14:14:42 -03:00
|
|
|
[working-directory: 'lez/indexer/service']
|
2026-03-04 21:54:23 +03:00
|
|
|
run-indexer mock="":
|
2026-02-23 17:02:24 +03:00
|
|
|
@echo "🔍 Running indexer"
|
2026-03-04 21:54:23 +03:00
|
|
|
@if [ "{{mock}}" = "mock" ]; then \
|
|
|
|
|
echo "🧪 Using mock data"; \
|
2026-06-23 14:29:23 +03:00
|
|
|
RUST_LOG=info cargo run --release --features mock-responses -p indexer_service configs/debug/indexer_config.json; \
|
2026-03-04 21:54:23 +03:00
|
|
|
else \
|
|
|
|
|
echo "🚀 Using real data"; \
|
2026-06-23 14:29:23 +03:00
|
|
|
RUST_LOG=info cargo run --release -p indexer_service configs/debug/indexer_config.json; \
|
2026-03-04 21:54:23 +03:00
|
|
|
fi
|
2026-02-23 17:02:24 +03:00
|
|
|
|
2026-06-05 22:08:49 +03:00
|
|
|
# Run Explorer.
|
2026-06-02 14:14:42 -03:00
|
|
|
[working-directory: 'lez/explorer_service']
|
2026-02-23 17:02:24 +03:00
|
|
|
run-explorer:
|
|
|
|
|
@echo "🌐 Running explorer"
|
|
|
|
|
RUST_LOG=info cargo leptos serve
|
|
|
|
|
|
2026-06-05 22:08:49 +03:00
|
|
|
# Run Wallet.
|
2026-06-02 14:14:42 -03:00
|
|
|
[working-directory: 'lez/wallet']
|
2026-02-23 17:02:24 +03:00
|
|
|
run-wallet +args:
|
|
|
|
|
@echo "🔑 Running wallet"
|
2026-06-01 17:10:46 -03:00
|
|
|
LEE_WALLET_HOME_DIR=$(pwd)/configs/debug cargo run --release -p wallet -- {{args}}
|
2026-02-23 17:02:24 +03:00
|
|
|
|
2026-06-05 22:08:49 +03:00
|
|
|
# Import test accounts supplied in sequencer configuration.
|
|
|
|
|
wallet-import-test-accounts:
|
|
|
|
|
@echo "⚙️ Initializing accounts"
|
|
|
|
|
just run-wallet account import public --private-key 7f273098f25b71e6c005a9519f2678da8d1c7f01f6a27778e2d9948abdf901fb
|
|
|
|
|
just run-wallet vault claim --account-id Public/CbgR6tj5kWx5oziiFptM7jMvrQeYY3Mzaao6ciuhSr2r --amount 10000
|
|
|
|
|
|
|
|
|
|
just run-wallet account import public --private-key f434f8741720014586ae43356d2aec6257da086222f604ddb75d69733b86fc4c
|
|
|
|
|
just run-wallet vault claim --account-id Public/2RHZhw9h534Zr3eq2RGhQete2Hh667foECzXPmSkGni2 --amount 20000
|
|
|
|
|
|
|
|
|
|
just run-wallet account list
|
|
|
|
|
|
2026-02-23 17:02:24 +03:00
|
|
|
# Clean runtime data
|
|
|
|
|
clean:
|
|
|
|
|
@echo "🧹 Cleaning run artifacts"
|
2026-06-02 14:14:42 -03:00
|
|
|
rm -rf lez/sequencer/service/bedrock_signing_key
|
|
|
|
|
rm -rf lez/sequencer/service/rocksdb
|
2026-06-22 13:16:35 +03:00
|
|
|
rm -rf lez/indexer/service/rocksdb*
|
2026-06-02 14:14:42 -03:00
|
|
|
rm -rf lez/wallet/configs/debug/storage.json
|
2026-06-22 13:16:35 +03:00
|
|
|
rm -rf rocksdb*
|
2026-03-06 16:07:50 +03:00
|
|
|
cd bedrock && docker compose down -v
|