Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Commit

Permalink
Introducing make economy and docker
Browse files Browse the repository at this point in the history
  • Loading branch information
xcthulhu authored and jaekwon committed Mar 19, 2015
1 parent 65a232b commit 150959b
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 3 deletions.
27 changes: 27 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Pull base image.
FROM golang:1.4.2-wheezy

# Set the env variables to non-interactive
ENV DEBIAN_FRONTEND noninteractive
ENV DEBIAN_PRIORITY critical
ENV DEBCONF_NOWARNINGS yes
ENV TERM linux
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections

# Install go
# ADD tendermint user
RUN useradd tendermint

# Get rid of tendermint user login shell
RUN usermod -s /sbin/nologin tendermint

ADD . /go/src/github.com/tendermint/tendermint
WORKDIR /go/src/github.com/tendermint/tendermint
RUN make

# Set environment variables
USER tendermint
ENV USER tendermint
ENV TMROOT /tendermint_root
# docker run -v $(pwd)/tendermint_root:/tendermint_root
CMD [ "./tendermint", "daemon" ]
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,11 @@ list_deps:
get_deps:
go get github.com/tendermint/tendermint/...

tendermint_root/priv_validator.json: tendermint_root/priv_validator.json.orig
cp $< $@

economy: tendermint_root/priv_validator.json
docker run -v $(CURDIR)/tendermint_root:/tendermint_root -p 8080:8080 tendermint

clean:
rm -f tendermint
rm -f tendermint tendermint_root/priv_validator.json
25 changes: 25 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "phusion-open-ubuntu-14.04-amd64"
config.vm.box_url = "https://oss-binaries.phusionpassenger.com/vagrant/boxes/latest/ubuntu-14.04-amd64-vbox.box"
# Or, for Ubuntu 12.04:

config.vm.provider :vmware_fusion do |f, override|
override.vm.box_url = "https://oss-binaries.phusionpassenger.com/vagrant/boxes/latest/ubuntu-14.04-amd64-vmwarefusion.box"
end

if Dir.glob("#{File.dirname(__FILE__)}/.vagrant/machines/default/*/id").empty?
# Install Docker
pkg_cmd = "wget -q -O - https://get.docker.io/gpg | apt-key add -;" \
"echo deb http://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list;" \
"apt-get update -qq; apt-get install -q -y --force-yes lxc-docker; "
# Add vagrant user to the docker group
pkg_cmd << "usermod -a -G docker vagrant; "
config.vm.provision :shell, :inline => pkg_cmd
end
end
4 changes: 2 additions & 2 deletions consensus/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ import (
)

const (
roundDuration0 = 30 * time.Second // The first round is 60 seconds long.
roundDurationDelta = 10 * time.Second // Each successive round lasts 15 seconds longer.
roundDuration0 = 10 * time.Second // The first round is 60 seconds long.
roundDurationDelta = 3 * time.Second // Each successive round lasts 15 seconds longer.
roundDeadlinePrevote = float64(1.0 / 3.0) // When the prevote is due.
roundDeadlinePrecommit = float64(2.0 / 3.0) // When the precommit vote is due.
newHeightDelta = roundDuration0 / 3 // The time to wait between commitTime and startTime of next consensus rounds.
Expand Down

0 comments on commit 150959b

Please sign in to comment.