-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit_validator.sh
41 lines (32 loc) · 1.05 KB
/
init_validator.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
#!/bin/bash
NODEIP=$(curl -s4 icanhazip.com)
echo "Updating Firewall..."
sudo ufw allow 1478
echo "Installing dependencies..."
echo
echo
# Install dependencies
sudo apt install wget
wget https://golang.org/dl/go1.18.3.linux-amd64.tar.gz
sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.18.3.linux-amd64.tar.gz
echo "export PATH=$PATH:/usr/local/go/bin" >> ~/.profile
source ~/.profile
# Clone and build bitindi
git clone https://github.com/bitindi/blockchain-core.git && cd blockchain-core
echo "Building Go executable, please wait..."
go build -o bitindi main.go
# Initialize validator dir
echo "Initializing validator directory.."
cp ../genesis.json . && chmod +x genesis.json
echo
./bitindi secrets init --data-dir data-dir
echo
## Show private key
pk=$(cat data-dir/consensus/validator.key)
echo "Private Key = $pk"
echo
## Prompt user
echo
echo
read -n 1 -s -r -p "Additionally, please make a copy of your \`Private Key\` and store this somewhere safe - DO NOT SHARE YOUR PRIVATE KEY WITH ANYONE! Once this is done, press any key to continue.."
echo