-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
164 lines (143 loc) · 4.63 KB
/
Makefile
File metadata and controls
164 lines (143 loc) · 4.63 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
.PHONY: install build test deploy clean frontend help
# Default target
help:
@echo "ΞTHΛURΛ - P256 Account Abstraction"
@echo ""
@echo "Available commands:"
@echo " make install - Install all dependencies"
@echo " make build - Build smart contracts"
@echo " make test - Run contract tests"
@echo " make test-gas - Run tests with gas report"
@echo " make coverage - Run tests with coverage report"
@echo " make deploy-sepolia - Deploy to Sepolia testnet"
@echo " make verify-sepolia - Verify contracts on Sepolia"
@echo " make verify-mainnet - Verify contracts on Mainnet"
@echo " make frontend - Run frontend dev server"
@echo " make clean - Clean build artifacts"
@echo ""
@echo "Helios Light Client (Development):"
@echo " make helios-install - Install Helios light client"
@echo " make helios-sepolia - Start Helios for Sepolia (dev)"
@echo " make helios-mainnet - Start Helios for Mainnet (prod)"
@echo " make helios-test - Test Helios RPC connection"
@echo " make helios-checkpoint - Update checkpoint"
@echo ""
@echo "Production Consensus Node (Linux only):"
@echo " make consensus-setup - Set up production consensus node"
@echo ""
# Install dependencies
install:
@echo "Installing Foundry dependencies..."
forge install OpenZeppelin/openzeppelin-contracts --no-commit
forge install eth-infinitism/account-abstraction --no-commit
forge install foundry-rs/forge-std --no-commit
@echo "Installing frontend dependencies..."
cd frontend && npm install
@echo "✅ Installation complete!"
# Build contracts
build:
@echo "Building contracts..."
forge build
@echo "✅ Build complete!"
# Run tests
test:
@echo "Running tests..."
forge test
@echo "✅ Tests complete!"
# Run tests with gas report
test-gas:
@echo "Running tests with gas report..."
forge test --gas-report
@echo "✅ Tests complete!"
# Run tests with coverage
coverage:
@echo "Running coverage..."
forge coverage --ir-minimum
@echo "✅ Coverage complete!"
# Deploy to Sepolia
deploy-sepolia:
@echo "Deploying to Sepolia..."
forge script script/Deploy.s.sol:DeployScript --rpc-url sepolia --broadcast --verify
@echo "✅ Deployment complete!"
# Verify contracts on Sepolia
verify-sepolia:
@echo "Verifying contracts on Sepolia..."
@if [ -z "$$FACTORY_ADDRESS" ]; then \
echo "Error: FACTORY_ADDRESS not set"; \
echo "Usage: FACTORY_ADDRESS=0x... make verify-sepolia"; \
exit 1; \
fi
@chmod +x scripts/verify-contracts.sh
@./scripts/verify-contracts.sh sepolia
@echo "✅ Verification complete!"
# Verify contracts on Mainnet
verify-mainnet:
@echo "Verifying contracts on Mainnet..."
@if [ -z "$$FACTORY_ADDRESS" ]; then \
echo "Error: FACTORY_ADDRESS not set"; \
echo "Usage: FACTORY_ADDRESS=0x... make verify-mainnet"; \
exit 1; \
fi
@chmod +x scripts/verify-contracts.sh
@./scripts/verify-contracts.sh mainnet
@echo "✅ Verification complete!"
# Run frontend
frontend:
@echo "Starting frontend dev server..."
cd frontend && npm run dev
# Build frontend
frontend-build:
@echo "Building frontend..."
cd frontend && npm run build
@echo "✅ Frontend build complete!"
# Clean build artifacts
clean:
@echo "Cleaning build artifacts..."
forge clean
rm -rf frontend/dist
@echo "✅ Clean complete!"
# Format code
format:
@echo "Formatting code..."
forge fmt
@echo "✅ Format complete!"
# Run local node
anvil:
@echo "Starting local Anvil node..."
anvil
# Snapshot gas
snapshot:
@echo "Creating gas snapshot..."
forge snapshot
@echo "✅ Snapshot complete!"
# Helios Light Client commands
helios-install:
@echo "Installing Helios..."
@curl https://raw.githubusercontent.com/a16z/helios/master/heliosup/install | bash
@echo "Run: source ~/.bashrc && heliosup"
helios-sepolia:
@echo "Starting Helios for Sepolia (development)..."
@chmod +x scripts/start-helios.sh
@./scripts/start-helios.sh sepolia
helios-mainnet:
@echo "Starting Helios for Mainnet (production)..."
@chmod +x scripts/start-helios.sh
@./scripts/start-helios.sh mainnet
helios-test:
@echo "Testing Helios RPC connection..."
@chmod +x scripts/test-helios.sh
@./scripts/test-helios.sh
helios-checkpoint:
@echo "Updating Helios checkpoint..."
@chmod +x scripts/update-checkpoint.sh
@./scripts/update-checkpoint.sh $(NETWORK)
# Production Consensus Node setup (Linux only)
consensus-setup:
@echo "Setting up production consensus node..."
@if [ "$$(uname)" != "Linux" ]; then \
echo "Error: This command is for Linux production environments only"; \
echo "For development, use: make helios-sepolia"; \
exit 1; \
fi
@chmod +x scripts/setup-production-consensus.sh
@sudo ./scripts/setup-production-consensus.sh