-
Notifications
You must be signed in to change notification settings - Fork 0
/
800gb0904.sh
104 lines (95 loc) · 2.64 KB
/
800gb0904.sh
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
#!/bin/bash
function colors {
GREEN="\e[32m"
RED="\e[39m"
NORMAL="\e[0m"
}
function logo {
curl -s https://raw.githubusercontent.com/DOUBLE-TOP/tools/main/doubletop.sh | bash
}
function line {
echo -e "${GREEN}-----------------------------------------------------------------------------${NORMAL}"
}
function get_vars {
export CHAIN="gemini-3d"
export RELEASE="gemini-3d-2023-apr-24"
export SUBSPACE_NODENAME=$(cat $HOME/subspace_docker/docker-compose.yml | grep "\-\-name" | awk -F\" '{print $4}')
export WALLET_ADDRESS=$(cat $HOME/subspace_docker/docker-compose.yml | grep "\-\-reward-address" | awk -F\" '{print $4}')
export PLOT_SIZE=$(cat $HOME/subspace_docker/docker-compose.yml | grep "\-\-plot-size" | awk -F\" '{print $4}')
}
function eof_docker_compose {
sudo tee <<EOF >/dev/null $HOME/subspace_docker/docker-compose.yml
version: "3.7"
services:
node:
image: ghcr.io/subspace/node:$RELEASE
volumes:
- node-data:/var/subspace:rw
ports:
- "0.0.0.0:32333:30333"
- "0.0.0.0:32433:30433"
restart: unless-stopped
command: [
"--chain", "$CHAIN",
"--base-path", "/var/subspace",
"--execution", "wasm",
"--blocks-pruning", "archive",
"--state-pruning", "archive",
"--port", "30333",
"--dsn-listen-on", "/ip4/0.0.0.0/tcp/30433",
"--rpc-cors", "all",
"--rpc-methods", "safe",
"--unsafe-ws-external",
"--dsn-disable-private-ips",
"--no-private-ipv4",
"--validator",
"--name", "$SUBSPACE_NODENAME",
"--telemetry-url", "wss://telemetry.subspace.network/submit 0",
"--telemetry-url", "wss://telemetry.doubletop.io/submit 0",
"--out-peers", "100"
]
healthcheck:
timeout: 5s
interval: 30s
retries: 5
farmer:
depends_on:
- node
image: ghcr.io/subspace/farmer:$RELEASE
volumes:
- farmer-data:/var/subspace:rw
ports:
- "0.0.0.0:32533:30533"
restart: unless-stopped
command: [
"--base-path", "/var/subspace",
"farm",
"--disable-private-ips",
"--node-rpc-url", "ws://node:9944",
"--listen-on", "/ip4/0.0.0.0/tcp/30533",
"--reward-address", "$WALLET_ADDRESS",
"--plot-size", "800G"
]
volumes:
node-data:
farmer-data:
EOF
}
function update_subspace {
cd $HOME/subspace_docker/
docker-compose down
eof_docker_compose
docker-compose pull
docker-compose up -d
}
colors
line
logo
line
get_vars
update_subspace
line
line
# line
echo -e "${GREEN}=== Обновление завершено ===${NORMAL}"
cd $HOME