-
-
Save iurimatias/c847fa2c8721dde870eb to your computer and use it in GitHub Desktop.
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 | |
# v.1.0.8 (for PoC5 RC15+) | |
# SLOLI | |
# Super Lazy One Line Install (tm), or SLOLI, is for OSX Mavericks ONLY | |
# If you spot inefficiencies they are there for a reason (edge cases, supporting previously aborted installs, etc) | |
# INSTALL | |
# This script will install the GoLang implementation of ethereum, including: | |
# - brew | |
# - golang | |
# - all ethereum dependencies | |
# - ethereum (CLI) and ethereal (GUI) | |
# USAGE | |
# Get and install Master: | |
# curl -s https://gist.githubusercontent.com/stephantual/97b24e90c3d7c3ea063b/raw/0b911ce1cb8c97edf11b7a41bece37fb727e1f7f/go_osx_eth_install -o go_osx_eth_install.sh && bash go_osx_eth_install.sh master && rm go_osx_eth_install.sh | |
# Get and install Develop: | |
# curl -s https://gist.githubusercontent.com/stephantual/97b24e90c3d7c3ea063b/raw/0b911ce1cb8c97edf11b7a41bece37fb727e1f7f/go_osx_eth_install -o go_osx_eth_install.sh && bash go_osx_eth_install.sh develop && rm go_osx_eth_install.sh | |
# To upgrade or switch branches just run the script again! | |
# UPDATE HISTORY | |
# 28-6-14 - initial release | |
# 29-6-14 - fixed typos, bugs and stuff | |
# 06-7-14 - better output | |
# AUTHOR | |
# Stephan Tual | |
# inspired by Maran Hidskes and Jeffrey Wilcke | |
# tested by Joris Bonte | |
# LICENCE | |
# Choose Freedom, 'Do Whatever The Fuck You Want To Public License' (http://www.wtfpl.net/txt/copying/) | |
B='\x1B[0;35m' | |
NC='\x1B[0m' | |
echo -e "${B}# SLOLI v.1.0.8${NC}" | |
echo -e "${B}# Super Lazy One Line Install (tm), or SLOLI, is for OSX Mavericks ONLY${NC}" | |
if [ "$1" == "" ]; then | |
echo -e "${B}Please specify which branch you require:${NC}" | |
echo -e "${B}Usage: $0 branch${NC}" | |
echo -e "${B}branch: master (stable) or develop (unstable)${NC}" | |
exit | |
fi | |
branch=$1 | |
echo -e "${B}**** VERY IMPORTANT ****${NC}" | |
echo -e "${B}This script will completely replace any previous installation of both ethereum and ethereal${NC}" | |
echo -e "${B}It will also erase previous chains, config files as well as public and private keys for both clients, if present${NC}" | |
echo -e "${B}If you are a developer and have installed QT or GoLang in the past, please refer to the wiki rather than executing this script${NC}" | |
echo -e "${B}Are you sure you want to continue? (Y/n)?${NC}" | |
read answer | |
if [[ ! $answer =~ ^[Yy]$ ]]; then | |
echo -e "${B}Installion aborted, exiting.${NC}" | |
exit | |
fi | |
echo -e "${B}Starting installation, this shouldn't take more than 5 minutes${NC}" | |
cd ~ | |
echo -e "${B}Deleting old chains, config and keys${NC}" | |
rm -rf ~/.ethereum | |
rm -rf ~/.ethereal | |
echo -e "${B}Checking brew${NC}" | |
which -s brew | |
if [ $? != 0 ]; then | |
echo -e "${B}Installing Brew${NC}" | |
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)" | |
brew doctor | |
fi | |
go version | |
if [ $? != 0 ]; then | |
echo -e "${B}Installing Go${NC}" | |
cd `brew --prefix` | |
git checkout ac60fc2 Library/Formula/go.rb | |
brew install go | |
mkdir ~/go | |
export GOPATH=$HOME/go | |
echo export GOPATH=$GOPATH >> ~/.bash_profile | |
echo PATH=$PATH:$GOPATH/bin >> ~/.bash_profile | |
else | |
echo -e "${B}Checking go version${NC}" | |
if [[ `go version` != "go version go1.2.2 darwin/amd64" ]]; then | |
echo -e "${B}Fixing Go to 1.2.2${NC}" | |
cd `brew --prefix` | |
git checkout ac60fc2 Library/Formula/go.rb | |
brew install go | |
mkdir ~/go | |
export GOPATH=$HOME/go | |
echo export GOPATH=$GOPATH >> ~/.bash_profile | |
echo PATH=$PATH:$GOPATH/bin >> ~/.bash_profile | |
fi | |
fi | |
echo -e "${B}Installing dependencies${NC}" | |
cd ~ | |
brew install mercurial gmp leveldb pkg-config readline | |
echo -e "${B}Installing QT${NC}" | |
cd `brew --prefix` | |
git checkout 1ca68c0 Library/Formula/qt5.rb | |
brew install qt5 | |
cd ~ | |
export PKG_CONFIG_PATH=`brew --prefix qt5`/lib/pkgconfig | |
export QT5VERSION=`pkg-config --modversion Qt5Core` | |
export CGO_CPPFLAGS=-I`brew --prefix qt5`/include/QtCore/$QT5VERSION/QtCore | |
echo -e "${B}Downloading ethereum (CLI) source${NC}" | |
go get -v -u -d github.com/ethereum/go-ethereum/ethereum | |
if [ $? != 0 ]; then | |
echo -e "${B}ethereum (CLI) Source download failed, check your internet connection and that github.com is up, then try again.${NC}" | |
exit | |
fi | |
echo -e "${B}Downloading ethereal (GUI) source${NC}" | |
go get -v -u -d github.com/ethereum/go-ethereum/ethereal | |
if [ $? != 0 ]; then | |
echo -e "${B}ethereal (GUI) Source download failed, check your internet connection and that github.com is up, then try again.${NC}" | |
exit | |
fi | |
echo -e "${B}Initializing Serpent git submodule${NC}" | |
cd $GOPATH/src/github.com/obscuren/serpent-go | |
git submodule init | |
git submodule update | |
echo -e "${B}Setting branch $branch for repo go-ethereum${NC}" | |
cd $GOPATH/src/github.com/ethereum/go-ethereum | |
git checkout $branch | |
echo -e "${B}Setting branch $branch for repo eth-go${NC}" | |
cd $GOPATH/src/github.com/ethereum/eth-go | |
git checkout $branch | |
echo -e "${B}Setting branch $branch for repo mutan${NC}" | |
cd $GOPATH/src/github.com/obscuren/mutan | |
git checkout $branch | |
echo -e "${B}Installing ethereum (CLI)${NC}" | |
cd $GOPATH/src/github.com/ethereum/go-ethereum/ethereum | |
go install -v | |
echo -e "${B}Installing ethereal (GUI)${NC}" | |
cd $GOPATH/src/github.com/ethereum/go-ethereum/ethereal | |
go install -v | |
echo -e "${B}Script complete.${NC}" | |
cd ~ | |
echo -e "${B}To run ethereum (CLI)${NC}" | |
echo -e "${B}> ethereum${NC}" | |
echo -e "${B}To run ethereal (GUI):${NC}" | |
echo -e "${B}> cd $GOPATH/src/github.com/ethereum/go-ethereum/ethereal${NC}" | |
echo -e "${B}> ethereal${NC}" | |
echo -e "${B}IMPORTANT: please make sure to source ~/.bash_profile or open a new terminal window before proceeding${NC}" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment