forked from rykcod/massa
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathinstall.sh
executable file
·42 lines (32 loc) · 1.45 KB
/
install.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
#!/bin/bash
echo "installing docker"
sudo apt-get update
sudo apt-get install -y curl
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh ./get-docker.sh
rm get-docker.sh
curl -fsSL https://raw.githubusercontent.com/peterjah/massa-core-docker/main/docker-compose.yml -o docker-compose.yml
read -p "Massa node is ready to start. Do you want to setup a wallet from private key? (y/n)" setupWallet
if [ "$setupWallet" != "y" ]; then
echo "Next step to run your node:"
echo "1- Create a 'massa_mount' folder and put your wallet yaml file in it. Then run your node with 'sudo docker compose up -d' command."
echo "2- Edit the docker-compose.yml file and replace '\${WALLETPWD}' by your wallet password."
echo "3- Run your node with 'sudo docker compose up -d' command."
echo "4- Enjoy life."
exit 0
fi
read -p "Enter wallet privateKey: " privateKey
read -p "Create a wallet password: " walletPassword
read -p "Confirm your wallet password: " walletPasswordconf
if [ "$walletPassword" != "$walletPasswordconf" ]; then
echo "Passwords do not match. Please try again."
exit 1
fi
cat << EOF > .env
WALLETPWD=${walletPassword}
WALLET_PRIVATE_KEY=${privateKey}
EOF
sed -i 's/# - WALLET_PRIVATE_KEY=${WALLET_PRIVATE_KEY}/ - WALLET_PRIVATE_KEY=${WALLET_PRIVATE_KEY}/' docker-compose.yml
sudo docker compose pull
sudo docker compose up -d
echo "Massa node is running in background. You can check logs with 'sudo docker compose logs -f' command."