-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
165 lines (139 loc) · 4.19 KB
/
Makefile
File metadata and controls
165 lines (139 loc) · 4.19 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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
# LUXBIN Development Makefile
.PHONY: help setup build test clean doc fmt clippy audit run-dev run-testnet
# Default target
help:
@echo "LUXBIN Development Commands:"
@echo ""
@echo "Setup:"
@echo " make setup - Install development dependencies"
@echo ""
@echo "Building:"
@echo " make build - Build the node in debug mode"
@echo " make build-release - Build the node in release mode"
@echo " make build-runtime - Build only the runtime"
@echo ""
@echo "Testing:"
@echo " make test - Run all tests"
@echo " make test-unit - Run unit tests only"
@echo " make test-integration - Run integration tests"
@echo ""
@echo "Code Quality:"
@echo " make fmt - Format code"
@echo " make clippy - Run clippy linter"
@echo " make audit - Run security audit"
@echo " make check - Run all checks (fmt, clippy, test)"
@echo ""
@echo "Running:"
@echo " make run-dev - Run single node development network"
@echo " make run-testnet - Run local testnet (2 nodes)"
@echo ""
@echo "Documentation:"
@echo " make doc - Generate documentation"
@echo " make doc-open - Generate and open documentation"
@echo ""
@echo "Maintenance:"
@echo " make clean - Clean build artifacts"
@echo " make update - Update dependencies"
# Setup
setup:
@echo "Installing development dependencies..."
rustup install nightly
rustup target add wasm32-unknown-unknown --toolchain stable
sudo apt-get update
sudo apt-get install -y clang libclang-dev llvm-dev pkg-config
cargo install cargo-husky --version "1.5.0" || true
@echo "Setup complete! 🎉"
# Building
build:
cargo build --manifest-path=Cargo.toml
build-release:
cargo build --release --manifest-path=Cargo.toml
build-runtime:
cargo build --release -p solochain-template-runtime --manifest-path=Cargo.toml
# Testing
test:
cargo test --manifest-path=Cargo.toml
test-unit:
cargo test --lib --manifest-path=Cargo.toml
test-integration:
cargo test --test integration --manifest-path=Cargo.toml
# Code Quality
fmt:
cargo fmt --all
clippy:
cargo clippy -- -D warnings
audit:
cargo install cargo-audit || true
cargo audit
check: fmt clippy test
@echo "All checks passed! ✅"
# Running
run-dev:
@echo "Starting development network..."
cargo build --release --bin solochain-template-node --manifest-path=Cargo.toml
./target/release/solochain-template-node \
--base-path /tmp/luxbin-dev \
--chain local \
--alice \
--node-key 0000000000000000000000000000000000000000000000000000000000000001 \
--validator
run-testnet:
@echo "Starting local testnet..."
cargo build --release --bin solochain-template-node --manifest-path=Cargo.toml
@echo "Starting Alice node..."
./target/release/solochain-template-node \
--base-path /tmp/luxbin-alice \
--chain local \
--alice \
--port 30333 \
--ws-port 9944 \
--rpc-port 9933 \
--node-key 0000000000000000000000000000000000000000000000000000000000000001 \
--validator &
@echo "Waiting 5 seconds for Alice to start..."
sleep 5
@echo "Starting Bob node..."
./target/release/solochain-template-node \
--base-path /tmp/luxbin-bob \
--chain local \
--bob \
--port 30334 \
--ws-port 9945 \
--rpc-port 9934 \
--node-key 0000000000000000000000000000000000000000000000000000000000000002 \
--validator \
--bootnodes /ip4/127.0.0.1/tcp/30333/p2p/12D3KooWEyoppNCUx8Yx66oV9fJnriXwCcXwDDUA2kj6vnc6iDE
# Documentation
doc:
cargo doc --manifest-path=Cargo.toml --no-deps --open
doc-open:
cargo doc --manifest-path=Cargo.toml --no-deps --open
# Maintenance
clean:
cargo clean
update:
cargo update
# Benchmarks
bench:
cargo bench --manifest-path=Cargo.toml
# Docker (future)
docker-build:
docker build -t luxbin-node .
docker-run:
docker run -p 9944:9944 -p 9933:9933 luxbin-node
# CI/CD simulation
ci: check build audit
@echo "CI/CD checks passed! 🚀"
# Development helpers
watch:
cargo watch -x check
# Performance profiling
profile:
cargo build --release --bin solochain-template-node --manifest-path=Cargo.toml
sudo perf record -F 99 -g -- target/release/solochain-template-node --dev --tmp
sudo perf report
# Dependency analysis
deps:
cargo tree
cargo outdated || true
cargo audit || true