diff --git a/DOCKER/README.md b/DOCKER/README.md index 92617c189..e765fc525 100644 --- a/DOCKER/README.md +++ b/DOCKER/README.md @@ -1,5 +1,16 @@ +# Docker + +Tendermint uses docker for deployment of testnets via the [mintnet](github.com/tendermint/mintnet) tool. + +For faster development iterations (ie. to avoid docker builds), +the dockerfile just sets up the OS, and tendermint is fetched/installed at runtime. + +For the deterministic docker builds used in testing, see the [tests directory](https://github.com/tendermint/tendermint/tree/master/test) + # Build and run a docker image and container +These are notes for the dev team. + ``` # Build base Docker image # Make sure ./run.sh exists. diff --git a/INSTALL.md b/INSTALL.md new file mode 100644 index 000000000..eca4f0aa9 --- /dev/null +++ b/INSTALL.md @@ -0,0 +1,57 @@ +# Install Go + +[Install Go, set the `GOPATH`, and put `GOPATH/bin` on your `PATH`](https://github.com/tendermint/tendermint/wiki/Setting-GOPATH). + +# Install Tendermint + +You should be able to install the latest with a simple `go get -u github.com/tendermint/tendermint/cmd/tendermint`. +The `-u` makes sure all dependencies are updated as well. + +Run `tendermint version` and `tendermint --help`. + +If the install falied, see [vendored dependencies below](#vendored-dependencies). + +To start a one-node blockchain with a simple in-process application: + +``` +tendermint init +tendermint node --proxy_app=dummy +``` + +See the [application developers guide](https://github.com/tendermint/tendermint/wiki/Application-Developers) for more details on building and running applications. + + +## Vendored dependencies + +If the `go get` failed, updated dependencies may have broken the build. +Install the correct version of each dependency using `glide`. + +Fist, install `glide`: + +``` +go get github.com/Masterminds/glide +``` + +Now, fetch the dependencies and install them with `glide` and `go`: + +``` +cd $GOPATH/src/github.com/tendermint/tendermint +glide install +go install ./cmd/tendermint +``` + +Sometimes `glide install` is painfully slow. Hang in there champ. + +The latest Tendermint Core version is now installed. Check by running `tendermint version`. + +## Troubleshooting + +If `go get` failing bothers you, fetch the code using `git`: + +``` +mkdir -p $GOPATH/src/github.com/tendermint +git clone https://github.com/tendermint/tendermint $GOPATH/src/github.com/tendermint/tendermint +cd $GOPATH/src/github.com/tendermint/tendermint +glide install +go install ./cmd/tendermint +``` diff --git a/INSTALL/FORK_TESTNET.md b/INSTALL/FORK_TESTNET.md deleted file mode 100644 index 37063069b..000000000 --- a/INSTALL/FORK_TESTNET.md +++ /dev/null @@ -1,21 +0,0 @@ -1. Fork github.com/tendermint/tendermint. -2. Run "make", it should install the daemon, which we named "tendermint". -3. Run "tendermint gen_account". Save the address, pub_key bytes, and priv_key bytes. - This is your developer key for controlling the cloud nodes. -4. Also run "tendermint gen_validator" 5 times, once for each cloud node. Save the output. -5. Create a directory ~/.debora/ and copy cmd/debora/default.cfg into ~/.debora/default.cfg - Copy the priv_key bytes from step 4 into ~/.debora/default.cfg where it says so. - Change the list of hosts in ~/.debora/default.cfg with your own set of 5 cloud nodes. -6. Replace cmd/barak/seed's pubkey with the pub_key bytes from step 3. -7. Update config/tendermint/config.go's genesis with validator pubkeys from step 4. - Give each of your nodes the same amount of voting power. - Set up the accounts however you want. -8. On each cloud node, follow the instructions here: https://github.com/tendermint/tendermint/tree/master/INSTALL - Create tmuser, install go, and also install 'barak'. - Then, run `barak -config="cmd/barak/seed"`. - You don't need to start the node at this time. -9. Now you can run "debora list" on your development machine and post commands to each cloud node. -10. Run scripts/unsafe_upgrade_barak.sh to test that barak is running. - The old barak you started on step 8 should now have quit. - A new instance of barak should be running. Check with `ps -ef | grep "barak"` -11. Run scripts/unsafe_restart_net.sh start your new testnet. diff --git a/INSTALL/README.md b/INSTALL/README.md deleted file mode 100644 index 88e416da5..000000000 --- a/INSTALL/README.md +++ /dev/null @@ -1,30 +0,0 @@ -NOTE: Only Ubuntu 14.04 64bit is supported at this time. - -### Server setup / create `tmuser` - -Secure the server, install dependencies, and create a new user `tmuser` - - curl -L https://raw.githubusercontent.com/tendermint/tendermint/master/INSTALL/install_env.sh > install_env.sh - source install_env.sh - cd /home/tmuser - -### Install Go as `tmuser` - -Don't use `apt-get install golang`, it's still on an old version. - - curl -L https://raw.githubusercontent.com/tendermint/tendermint/master/INSTALL/install_golang.sh > install_golang.sh - source install_golang.sh - -### Run Barak - -WARNING: THIS STEP WILL GIVE CONTROL OF THE CURRENT USER TO THE DEV TEAM. - - go get -u github.com/tendermint/tendermint/cmd/barak - nohup barak -config="$GOPATH/src/github.com/tendermint/tendermint/cmd/barak/seed" & - -### Install/Update MintDB - - go get -u github.com/tendermint/tendermint/cmd/tendermint - mkdir -p ~/.tendermint - cp $GOPATH/src/github.com/tendermint/tendermint/config/tendermint/genesis.json ~/.tendermint/ - tendermint node --seeds="goldenalchemist.chaintest.net:46656" diff --git a/INSTALL/install_env.sh b/INSTALL/install_env.sh deleted file mode 100755 index c947a1f9c..000000000 --- a/INSTALL/install_env.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/bash -# Run this as root user -# This part is for hardening the server and setting up a user account - -if [ `whoami` != "root" ]; -then - echo "You must run this script as root" - exit 1 -fi - -USER="tmuser" -OPEN_PORTS=(46656 46657 46658 46659 46660 46661 46662 46663 46664 46665 46666 46667 46668 46669 46670 46671) -SSH_PORT=22 -WHITELIST=() - -# update and upgrade -apt-get update -y -apt-get upgrade -y - -# fail2ban for monitoring logins -apt-get install -y fail2ban - -# set up the network time daemon -apt-get install -y ntp - -# install dependencies -apt-get install -y make screen gcc git mercurial libc6-dev pkg-config libgmp-dev - -# set up firewall -echo "ENABLE FIREWALL ..." -set -x -# white list ssh access -for ip in "${WHITELIST[@]}"; do - ufw allow from $ip to any port $SSH_PORT -done -if [ ${#WHITELIST[@]} -eq 0 ]; then - ufw allow $SSH_PORT -fi -# open ports -for port in "${OPEN_PORTS[@]}"; do - ufw allow $port -done -# apply -ufw --force enable -set +x -# set up firewall END - -# watch the logs and have them emailed to me -# apt-get install -y logwatch -# echo "/usr/sbin/logwatch --output mail --mailto $ADMIN_EMAIL --detail high" >> /etc/cron.daily/00logwatch - -# set up user account -echo "CREATE USER $USER ..." -useradd $USER -d /home/$USER -# This user should not have root access. -# usermod -aG sudo $USER -mkdir /home/$USER -cp /etc/skel/.bashrc . -cp /etc/skel/.profile . -chown -R $USER:$USER /home/$USER - -echo "Done setting env. Switching to $USER..." -su $USER diff --git a/INSTALL/install_golang.sh b/INSTALL/install_golang.sh deleted file mode 100755 index 2b69c08f8..000000000 --- a/INSTALL/install_golang.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash -# Run this as tmuser user -# This part is for installing go - -if [ `whoami` == "root" ]; -then - echo "You should not run this script as root" - exit 1 -fi - -USER=`whoami` -PWD=`pwd` - -# get dependencies -# sudo apt-get install -y make screen gcc git mercurial libc6-dev pkg-config libgmp-dev - -# install golang -cd /home/$USER -mkdir gocode -wget https://storage.googleapis.com/golang/go1.4.2.src.tar.gz -tar -xzvf go*.tar.gz -cd go/src -./make.bash -mkdir -p /home/$USER/go/src -echo 'export GOROOT=/home/$USER/go' >> /home/$USER/.bashrc -echo 'export GOPATH=/home/$USER/gocode' >> /home/$USER/.bashrc -echo 'export PATH=$PATH:$GOROOT/bin:$GOPATH/bin' >> /home/$USER/.bashrc -source /home/$USER/.bashrc -cd $PWD diff --git a/cmd/tendermint/init.go b/cmd/tendermint/init.go index 5ee76c379..8a7a7b096 100644 --- a/cmd/tendermint/init.go +++ b/cmd/tendermint/init.go @@ -20,4 +20,5 @@ func init_files() { genDoc.SaveAs(config.GetString("genesis_file")) + log.Notice("Initialized tendermint", "genesis", config.GetString("genesis_file"), "priv_validator", config.GetString("priv_validator_file")) }