Browse Source

move revisions file to ~/.tendermint/

pull/111/merge
Jae Kwon 10 years ago
parent
commit
e4fae760af
4 changed files with 7 additions and 13 deletions
  1. +4
    -8
      Makefile
  2. +1
    -3
      common/os.go
  3. +1
    -0
      config/tendermint/config.go
  4. +1
    -2
      node/node.go

+ 4
- 8
Makefile View File

@ -2,13 +2,15 @@
all: install
TMROOT = $${TMROOT:-$$HOME/.tendermint}
install:
go install github.com/tendermint/tendermint/cmd/tendermint
go install github.com/tendermint/tendermint/cmd/barak
go install github.com/tendermint/tendermint/cmd/debora
go install github.com/tendermint/tendermint/cmd/stdinwriter
go install github.com/tendermint/tendermint/cmd/logjack
echo -n `git rev-parse --verify HEAD` > .revision
@echo -n `git rev-parse --verify HEAD` > $(TMROOT)/revisions
build:
go build -o build/tendermint github.com/tendermint/tendermint/cmd/tendermint
@ -44,10 +46,4 @@ gen_client:
go generate rpc/core_client/*.go
revision:
echo -n `git rev-parse --verify HEAD` > .revision
tendermint_root/priv_validator.json: tendermint_root/priv_validator.json.orig
cp $< $@
clean:
rm -f tendermint tendermint_root/priv_validator.json
@echo -n `git rev-parse --verify HEAD` > $(TMROOT)/revisions

+ 1
- 3
common/os.go View File

@ -5,14 +5,12 @@ import (
"io/ioutil"
"os"
"os/signal"
"path"
"sync"
"time"
)
var (
GoPath = os.Getenv("GOPATH")
TendermintRepo = path.Join(GoPath, "src", "github.com", "tendermint", "tendermint")
GoPath = os.Getenv("GOPATH")
)
func TrapSignal(cb func()) {


+ 1
- 0
config/tendermint/config.go View File

@ -70,6 +70,7 @@ func GetConfig(rootDir string) cfg.Config {
mapConfig.SetDefault("db_dir", rootDir+"/data")
mapConfig.SetDefault("log_level", "info")
mapConfig.SetDefault("rpc_laddr", "0.0.0.0:46657")
mapConfig.SetDefault("revisions_file", rootDir+"/revisions")
return mapConfig
}


+ 1
- 2
node/node.go View File

@ -7,7 +7,6 @@ import (
"net"
"net/http"
"os"
"path"
"strconv"
"strings"
"time"
@ -247,7 +246,7 @@ func makeNodeInfo(sw *p2p.Switch) *types.NodeInfo {
}
// include git hash in the nodeInfo if available
if rev, err := ReadFile(path.Join(TendermintRepo, ".revision")); err == nil {
if rev, err := ReadFile(config.GetString("revisions_file")); err == nil {
nodeInfo.Revision = string(rev)
}


Loading…
Cancel
Save