Browse Source

Introducing make economy and docker

pull/32/head
Matthew Wampler-Doty 10 years ago
committed by Jae Kwon
parent
commit
150959b182
4 changed files with 61 additions and 3 deletions
  1. +27
    -0
      Dockerfile
  2. +7
    -1
      Makefile
  3. +25
    -0
      Vagrantfile
  4. +2
    -2
      consensus/state.go

+ 27
- 0
Dockerfile View File

@ -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" ]

+ 7
- 1
Makefile View File

@ -17,5 +17,11 @@ list_deps:
get_deps: get_deps:
go get github.com/tendermint/tendermint/... 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: clean:
rm -f tendermint
rm -f tendermint tendermint_root/priv_validator.json

+ 25
- 0
Vagrantfile View File

@ -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

+ 2
- 2
consensus/state.go View File

@ -71,8 +71,8 @@ import (
) )
const ( 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. roundDeadlinePrevote = float64(1.0 / 3.0) // When the prevote is due.
roundDeadlinePrecommit = float64(2.0 / 3.0) // When the precommit vote 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. newHeightDelta = roundDuration0 / 3 // The time to wait between commitTime and startTime of next consensus rounds.


Loading…
Cancel
Save