forked from octra-labs/wallet-gen
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.sh
More file actions
executable file
·91 lines (74 loc) · 2.18 KB
/
start.sh
File metadata and controls
executable file
·91 lines (74 loc) · 2.18 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
#!/bin/bash
# Octra Wallet Generator Setup Script
# Automated setup: security warning, build from source, run, and open browser
echo "=== Octra Wallet Generator Setup ==="
echo ""
# Show security warning first
echo "=== ⚠️ SECURITY WARNING ⚠️ ==="
echo ""
echo "This tool generates real cryptographic keys. Always:"
echo " - Keep your private keys secure"
echo " - Never share your mnemonic phrase"
echo " - Don't store wallet files on cloud services"
echo " - Use on a secure, offline computer for production wallets"
echo ""
read -p "Press Enter to continue..."
echo ""
# Function to install Bun
install_bun() {
echo "Installing Bun..."
if command -v bun &> /dev/null; then
echo "Bun is already installed. Version: $(bun --version)"
else
echo "Installing Bun..."
curl -fsSL https://bun.sh/install | bash
# Set PATH to include Bun's binary directory
export PATH="$HOME/.bun/bin:$PATH"
echo "Bun installed successfully!"
fi
}
# Build from source
echo "=== Building from Source ==="
echo ""
# Install Bun if not present
install_bun
echo ""
echo "Installing dependencies..."
bun install
echo ""
echo "Building standalone executable..."
bun run build
if [ ! -f "./wallet-generator" ]; then
echo "❌ Error: wallet-generator executable not found!"
echo "Build may have failed. Please check the build output above."
exit 1
fi
echo ""
echo "Build complete!"
echo ""
# Execute binary
echo "=== Starting Wallet Generator ==="
echo ""
echo "Starting wallet generator server..."
# Start the binary in the background
./wallet-generator &
WALLET_PID=$!
# Wait a moment for the server to start
sleep 2
# Open browser
echo "Opening browser at http://localhost:8888"
BROWSER_CMD=""
if command -v open &> /dev/null; then
# macOS
BROWSER_CMD="open"
elif command -v xdg-open &> /dev/null; then
# Linux
BROWSER_CMD="xdg-open"
fi
if [ -n "$BROWSER_CMD" ]; then
$BROWSER_CMD http://localhost:8888 2>/dev/null || echo "Could not automatically open browser. Please manually open http://localhost:8888"
else
echo "Please manually open http://localhost:8888 in your browser"
fi
# Wait for the background process
wait $WALLET_PID