-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJustfile
More file actions
128 lines (101 loc) · 2.84 KB
/
Justfile
File metadata and controls
128 lines (101 loc) · 2.84 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
set shell := ["bash", "-cu"]
default:
@just --list
# Run all quality checks (format, lint, typecheck, test, build)
[group('quality')]
quality: check test build
# Fast static checks only (no compilation, no tests)
[group('quality')]
check: fmt lint frontend-lint frontend-typecheck
# All tests
[group('quality')]
test: backend-test
# All builds (proves compilation + artifacts)
[group('quality')]
build: backend-build frontend-build
# Full CI pipeline
[group('quality')]
ci: quality
# Check Rust formatting
[group('backend')]
fmt:
cd backend && cargo fmt --all --check
# Fix Rust formatting in-place
[group('backend')]
fmt-fix:
cd backend && cargo fmt --all
# Run clippy
[group('backend')]
lint: backend-clippy
[group('backend')]
backend-clippy:
cd backend && cargo clippy --workspace --all-targets -- -D warnings
[group('backend')]
backend-test:
cd backend && cargo test --workspace --all-targets
[group('backend')]
backend-build:
cd backend && cargo build --workspace
# Build optimised release binary to build/atlas-server
[group('backend')]
build-release:
cd backend && cargo build --release --bin atlas-server
mkdir -p build
cp backend/target/release/atlas-server build/atlas-server
# Install atlas-server to ~/.cargo/bin (available on PATH after cargo setup)
[group('backend')]
install:
cd backend && cargo install --path crates/atlas-server --locked
[group('backend')]
backend-run:
cd backend && cargo run --bin atlas-server -- run
[group('frontend')]
frontend-install:
cd frontend && bun install --frozen-lockfile
[group('frontend')]
frontend-dev:
cd frontend && bun run dev
[group('frontend')]
frontend-lint: frontend-install
cd frontend && bun run lint
[group('frontend')]
frontend-typecheck: frontend-install
cd frontend && bunx tsc -b --noEmit
[group('frontend')]
frontend-build: frontend-install
cd frontend && bun run build
[group('docker')]
docker-up:
docker compose up -d
[group('docker')]
docker-build:
docker compose build
[group('docker')]
docker-down:
docker compose down
[group('docker')]
docker-logs service="atlas-server":
docker compose logs -f {{service}}
[group('docker')]
docker-rebuild service="atlas-server":
docker compose build {{service}} && docker compose up -d {{service}}
# Docker
rpc_url := "https://ev-reth-eden-testnet.binarybuilders.services:8545"
# Run full stack against eden testnet, starting from latest block
[group('docker')]
test-run:
#!/usr/bin/env bash
latest=$(curl -s -X POST {{rpc_url}} \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' \
| jq -r '.result')
start_block=$((latest))
echo "Latest block: $start_block"
RPC_URL={{rpc_url}} \
START_BLOCK=$start_block \
REINDEX=false \
RPC_REQUESTS_PER_SECOND=10000 \
FETCH_WORKERS=10 \
BATCH_SIZE=10000 \
RPC_BATCH_SIZE=100 \
docker compose up --build