Last active
March 5, 2019 20:58
-
-
Save colin-axner/3e84c74b6f0c830722a619a3bd888559 to your computer and use it in GitHub Desktop.
bash script for installing go, geth, truffle, plasmamvp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Upgrade the system and install go, gcc, make, geth | |
sudo apt-get install software-properties-common | |
sudo add-apt-repository -y ppa:ethereum/ethereum | |
sudo apt update | |
sudo apt upgrade -y | |
sudo apt install gcc make ethereum -y | |
sudo snap install --classic go | |
sudo mkdir -p ~/go/bin/ | |
# Export GO path and append to .bashrc file | |
sed -i -e "\$aexport GOPATH=\$HOME/go\nexport PATH=\$GOPATH/bin:\$PATH" ~/.bashrc | |
. ~/.bashrc | |
# Install dep | |
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh | |
# Install plasmad and plasmacli | |
go get github.com/FourthState/plasma-mvp-sidechain | |
cd ~/go/src/github.com/FourthState/plasma-mvp-sidechain/ | |
git fetch --all | |
git checkout develop | |
dep ensure | |
cd server/plasmad/ | |
go install | |
plasmad unsafe-reset-all | |
cd ../../client/plasmacli/ | |
go install | |
# Install npm, Truffle | |
apt-get install nodejs | |
apt-get install npm | |
# setup geth as system service | |
sudo useradd -m -d /opt/geth --system --shell /usr/sbin/nologin geth | |
sudo -u geth mkdir -p /opt/geth/rinkeby | |
cd /opt/geth/rinkeby/ | |
# geth.service | |
echo "[Unit] | |
Description=Geth | |
After=network-online.target | |
[Service] | |
User=geth | |
ExecStart=/usr/bin/geth --datadir=/opt/geth/rinkeby/chaindata/ --rinkeby --rpc --rpcapi db,eth,net,web3,personal | |
Restart=always | |
RestartSec=3 | |
LimitNOFILE=4096 | |
[Install] | |
WantedBy=multi-user.target" > geth.service | |
sudo mv geth.service /etc/systemd/system/ | |
sudo systemctl enable geth.service | |
echo "" | |
echo "Run 'sudo service geth start' to begin syncing to rinkeby network" | |
echo "Set configuration parameters in ~./plasmacli/plasma.toml, ~/.plasmad/config/" | |
echo "" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment