-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.sh
More file actions
executable file
·46 lines (39 loc) · 1.29 KB
/
Copy pathstart.sh
File metadata and controls
executable file
·46 lines (39 loc) · 1.29 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
#!/bin/bash
# iCLONE Production Server — start script
# Run: bash start.sh
set -e
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
VENV="$SCRIPT_DIR/venv312"
SERVER="$SCRIPT_DIR/agent/server.py"
SMART_WALLET="0x44cc25d55a4291b92f52062ba023ca1f14206664"
RPC_URL="https://mainnet.base.org"
echo "================================================"
echo " iCLONE ACP Server"
echo " Smart wallet: $SMART_WALLET"
echo "================================================"
echo ""
# Check smart wallet is deployed
echo "Checking smart wallet deployment..."
DEPLOYED=$("$VENV/bin/python3.12" -c "
from web3 import Web3
w3 = Web3(Web3.HTTPProvider('$RPC_URL'))
code = w3.eth.get_code(Web3.to_checksum_address('$SMART_WALLET'))
print('yes' if len(code) > 0 else 'no')
" 2>/dev/null)
if [ "$DEPLOYED" != "yes" ]; then
echo ""
echo "ERROR: Smart wallet not deployed on Base mainnet."
echo "Run: acp agent use (select CLONE) and retry."
exit 1
fi
# Check acp-cli auth
echo "Checking acp-cli authentication..."
if ! acp agent whoami --json 2>/dev/null | grep -q '"name"'; then
echo ""
echo "ERROR: acp-cli not authenticated."
echo "Run: acp configure && acp agent use"
exit 1
fi
echo "Smart wallet deployed. acp-cli authenticated. Starting server..."
echo ""
exec "$VENV/bin/python3.12" "$SERVER"