-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathJustfile
More file actions
129 lines (105 loc) · 4.83 KB
/
Copy pathJustfile
File metadata and controls
129 lines (105 loc) · 4.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# =================================================================
# F1R3FLY RUST NODE - LOCAL DEVELOPMENT COMMANDS
# =================================================================
# Run `just` to see all available commands.
# Run `just <command>` to execute a command.
#
# Prerequisites:
# - Rust toolchain (cargo)
# - just command runner (included in nix flake)
# Configuration paths
local_dir := justfile_directory() / "run-local"
standalone_conf := local_dir / "conf/standalone.conf"
standalone_genesis := local_dir / "genesis/standalone"
standalone_data := local_dir / "data/standalone"
# Default recipe - show available commands
default:
@just --list
# =================================================================
# BUILD
# =================================================================
# Build the Rust node in release mode
build:
cargo build --release -p node
# Build the Rust node in debug mode (faster compile, slower runtime)
build-debug:
cargo build -p node
# =================================================================
# TEST COVERAGE
# =================================================================
# Enforce 80% unit-test line coverage (requires cargo-llvm-cov + llvm-tools-preview)
coverage *crates:
scripts/coverage.sh {{crates}}
# =================================================================
# STANDALONE NODE
# =================================================================
# Setup standalone node data directory (run once before first start)
setup-standalone:
@echo "Setting up standalone node data directory..."
mkdir -p {{standalone_data}}/genesis
cp {{standalone_genesis}}/bonds.txt {{standalone_data}}/genesis/
cp {{standalone_genesis}}/wallets.txt {{standalone_data}}/genesis/
@echo "Done. Data directory: {{standalone_data}}"
# Run standalone node locally
run-standalone standalone_private_key=env_var('STANDALONE_PRIVATE_KEY'): build setup-standalone
@echo "Starting standalone Rust node..."
@echo " Config: {{standalone_conf}}"
@echo " Data: {{standalone_data}}"
@echo ""
./target/release/node run -s \
--config-file={{standalone_conf}} \
--validator-private-key={{standalone_private_key}} \
--host=localhost \
--no-upnp
# Run standalone node in debug mode (for development)
run-standalone-debug standalone_private_key=env_var('STANDALONE_PRIVATE_KEY'): build-debug setup-standalone
./target/debug/node run -s \
--config-file={{standalone_conf}} \
--validator-private-key={{standalone_private_key}} \
--host=localhost \
--no-upnp
# Clean standalone node data (fresh start from genesis)
clean-standalone:
@echo "Removing standalone node data..."
rm -rf {{standalone_data}}
@echo "Done. Run 'just setup-standalone' or 'just run-standalone' to reinitialize."
# =================================================================
# DISTRIBUTED OCI TESTBED (EPOCH-009)
# =================================================================
# See docs/vps-cloud-testing.md for prerequisites and full walkthrough.
# Scripts default to dry-run when invoked directly; these Justfile
# recipes always pass --apply because that's the point of using them.
# Provision 2 OCI VPSes (VCN, subnet, security list, 2x arm64 A1.Flex)
vps-up:
scripts/remote/oci-provision.sh --apply
# Render .env.remote, scp docker tree to both VPSes, start shard
vps-deploy:
scripts/remote/deploy.sh --apply
# Health check every node (use `just vps-status target=vps1` to narrow)
vps-status target="both":
scripts/remote/status.sh {{target}}
# Ship a Docker image from local daemon to both VPSes (parallel)
vps-image-push image="sjc.ocir.io/axd0qezqa9z3/f1r3fly-rust:latest":
scripts/remote/image-transfer.sh --apply {{image}}
# Stop containers on both VPSes, then terminate the OCI VPSes themselves
vps-down:
scripts/remote/teardown.sh --apply
scripts/remote/oci-destroy.sh --apply --force
# Run a latency benchmark against the shard (local if host="", remote via SSH otherwise)
vps-bench-latency host="" duration="60" rate="2":
scripts/bench/latency-benchmark.sh --host {{host}} --duration {{duration}} --rate {{rate}} --apply
# =================================================================
# CI MAINTENANCE
# =================================================================
# Re-pin the trusted system-integration harness (updates all pin sites, runs checks)
repin-system-integration sha:
scripts/repin-system-integration.sh {{sha}}
# =================================================================
# HELP
# =================================================================
# Show node CLI help
help:
./target/release/node --help 2>/dev/null || cargo run --release -p node -- --help
# Show 'run' subcommand options
run-help:
./target/release/node run --help 2>/dev/null || cargo run --release -p node -- run --help