Last active
August 29, 2015 14:03
-
-
Save stephantual/97b24e90c3d7c3ea063b to your computer and use it in GitHub Desktop.
SLOLI: Super Lazy One Line Install (tm) for Ethereum GoLang on OSX Mavericks
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.9 (for PoC6+) | |
# 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/[currenthash]/raw/[currenthash]/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/[currenthash]/raw/[currenthash]/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 | |
# 01-9-14 - support for Poc6 | |
# 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.9${NC}" | |
echo -e "${B}# Super Lazy One Line Install (tm), or SLOLI${NC}" | |
if [ "$OSTYPE" != "darwin13" ]; then | |
echo -e "${B}Unsupported OS version - you need to be running OSX Mavericks. Exiting.${NC}" | |
exit | |
fi | |
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 10-15 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 | |
echo -e "${B}Installing Go${NC}" | |
brew install go | |
mkdir ~/go | |
export GOPATH=$HOME/go | |
echo export GOPATH=$GOPATH >> ~/.bash_profile | |
echo PATH=$PATH:$GOPATH/bin >> ~/.bash_profile | |
echo -e "${B}Installing dependencies${NC}" | |
cd ~ | |
brew install mercurial gmp leveldb pkg-config readline qt5 | |
echo -e "${B}Setting QT flags${NC}" | |
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 -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 -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}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}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
Any possibility that this will work on Yosemite soon?