Repository navigation
Expand file tree
/
Copy pathsetup-seed-node.sh
More file actions
79 lines (65 loc) · 3.07 KB
/
Copy pathsetup-seed-node.sh
File metadata and controls
79 lines (65 loc) · 3.07 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
#!/bin/bash
# SALOCOIN Seed Node Quick Setup Script
# Run: bash setup-seed-node.sh
set -e
echo "╔══════════════════════════════════════════════════════════╗"
echo "║ SALOCOIN Seed Node Setup Script ║"
echo "╚══════════════════════════════════════════════════════════╝"
echo ""
# Check if running as root
if [ "$EUID" -eq 0 ]; then
echo "Please run as non-root user (will use sudo when needed)"
exit 1
fi
# Update system
echo "[1/6] Updating system..."
sudo apt update && sudo apt upgrade -y
# Install Python
echo "[2/6] Installing Python 3.11..."
sudo apt install -y python3.11 python3.11-pip python3.11-venv git curl
# Install dependencies
echo "[3/6] Installing Python dependencies..."
pip3 install --user -r requirements.txt
# Configure firewall
echo "[4/6] Configuring firewall..."
sudo ufw allow 7339/tcp comment "SALOCOIN P2P"
sudo ufw allow 7340/tcp comment "SALOCOIN RPC"
sudo ufw --force enable
# Create systemd service
echo "[5/6] Creating systemd service..."
WORKDIR=$(pwd)
PYTHON=$(which python3.11)
sudo tee /etc/systemd/system/salocoind.service > /dev/null << EOF
[Unit]
Description=SALOCOIN Daemon
After=network.target
[Service]
Type=simple
User=$USER
WorkingDirectory=$WORKDIR
ExecStart=$PYTHON salocoind.py --rpcbind=0.0.0.0 --printtoconsole
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable salocoind
# Start the node
echo "[6/6] Starting SALOCOIN node..."
sudo systemctl start salocoind
echo ""
echo "╔══════════════════════════════════════════════════════════╗"
echo "║ Setup Complete! ║"
echo "╠══════════════════════════════════════════════════════════╣"
echo "║ Node Status: sudo systemctl status salocoind ║"
echo "║ View Logs: journalctl -u salocoind -f ║"
echo "║ Stop Node: sudo systemctl stop salocoind ║"
echo "║ Start Node: sudo systemctl start salocoind ║"
echo "╠══════════════════════════════════════════════════════════╣"
echo "║ P2P Port: 7339 | RPC Port: 7340 ║"
echo "║ API: http://$(curl -s ifconfig.me):7340/status ║"
echo "╚══════════════════════════════════════════════════════════╝"
echo ""
echo "Genesis Hash: c52fd198c676978ce4d71d325b2e7703dc302e13621efb7efefe527a04793c0b"
echo ""