-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·71 lines (64 loc) · 2.17 KB
/
Copy pathsetup.sh
File metadata and controls
executable file
·71 lines (64 loc) · 2.17 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
#!/usr/bin/env bash
# ProofPoll Always-On Node Setup
#
# Run this on a fresh GCE e2-micro instance (Debian/Ubuntu).
# Prerequisites: SSH access, the ProofPoll hApp file.
#
# Usage:
# 1. Create GCE instance:
# gcloud compute instances create proofpoll-node \
# --zone=us-central1-a \
# --machine-type=e2-micro \
# --boot-disk-size=10GB \
# --image-family=debian-12 \
# --image-project=debian-cloud \
# --tags=proofpoll-node
#
# 2. SSH in and run:
# sudo bash setup.sh
#
# 3. Copy the hApp file to the server:
# gcloud compute scp ../src-tauri/resources/proofpoll_v1_3_happ.happ \
# proofpoll-node:~/node/ --zone=us-central1-a
#
# 4. Install the hApp:
# bash install-happ.sh
set -euo pipefail
echo "=== ProofPoll Node Setup ==="
# Install Docker if not present
if ! command -v docker &>/dev/null; then
echo "Installing Docker..."
apt-get update
apt-get install -y ca-certificates curl gnupg
install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
chmod a+r /etc/apt/keyrings/docker.asc
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] \
https://download.docker.com/linux/debian $(. /etc/os-release && echo "$VERSION_CODENAME") stable" \
> /etc/apt/sources.list.d/docker.list
apt-get update
apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
systemctl enable docker
systemctl start docker
echo "Docker installed."
else
echo "Docker already installed."
fi
# Add current user to docker group (for non-root usage)
if [ -n "${SUDO_USER:-}" ]; then
usermod -aG docker "$SUDO_USER"
echo "Added $SUDO_USER to docker group (re-login to take effect)."
fi
# Pull the edge node image
echo "Pulling edge node image..."
docker pull ghcr.io/holo-host/edgenode:v0.0.10-hc0.6.0-go-pion
# Start the container
echo "Starting ProofPoll node..."
docker compose up -d
echo ""
echo "=== Container running ==="
echo "Next steps:"
echo " 1. Copy the hApp file to this directory:"
echo " scp proofpoll_v1_3_happ.happ <this-server>:~/node/"
echo " 2. Run: bash install-happ.sh"
echo ""