-
Notifications
You must be signed in to change notification settings - Fork 0
/
upgradeparity.sh
36 lines (29 loc) · 1.02 KB
/
upgradeparity.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
#!/bin/bash
# Prompt the user for the node name
read -p "Enter NODE name: " name
echo "export NODE=$name"
# Get the current username
current_user=$(whoami)
# Create the service file using the node name variable and current username
sudo tee /etc/systemd/system/polkadot.service > /dev/null <<EOF
[Unit]
Description=Polkadot Validator Service
After=network.target
[Service]
Type=simple
User=$current_user
ExecStart=$HOME/polkadot-sdk/target/release/polkadot --validator --name "$name" --chain=polkadot --database ParityDb --telemetry-url 'wss://telemetry-backend.w3f.community/submit 1' --state-pruning 1000 --prometheus-external --prometheus-port=9615 --insecure-validator-i-know-what-i-do
Restart=always
RestartSec=10
StandardOutput=journal
StandardError=journal
Environment=START
[Install]
WantedBy=multi-user.target
EOF
# Reload systemd daemon and start the service
sudo systemctl daemon-reload
sudo systemctl enable polkadot.service
sudo systemctl restart polkadot.service
# View the service logs
sudo journalctl -u polkadot.service -f