diff --git a/CHANGELOG_PENDING.md b/CHANGELOG_PENDING.md index 992a05d36..746ea89c1 100644 --- a/CHANGELOG_PENDING.md +++ b/CHANGELOG_PENDING.md @@ -59,6 +59,9 @@ Friendly reminder: We have a [bug bounty program](https://hackerone.com/tendermi - [store/state/evidence/light] \#5771 Use an order-preserving varint key encoding (@cmwaters) - [mempool] \#6396 Remove mempool's write ahead log (WAL), (previously unused by the tendermint code). (@tychoish) +- Tooling + - [tools] \#6498 Set OS home dir to instead of the hardcoded PATH. (@JayT106) + ### FEATURES - [config] Add `--mode` flag and config variable. See [ADR-52](https://github.com/tendermint/tendermint/blob/master/docs/architecture/adr-052-tendermint-mode.md) @dongsam diff --git a/tools/tm-signer-harness/Makefile b/tools/tm-signer-harness/Makefile index 1c404ebf8..fc4157108 100644 --- a/tools/tm-signer-harness/Makefile +++ b/tools/tm-signer-harness/Makefile @@ -3,7 +3,7 @@ TENDERMINT_VERSION?=latest BUILD_TAGS?='tendermint' VERSION := $(shell git describe --always) -BUILD_FLAGS = -ldflags "-X github.com/tendermint/tendermint/version.TMCoreSemVer=$(VERSION) +BUILD_FLAGS = -ldflags "-X github.com/tendermint/tendermint/version.TMCoreSemVer=$(VERSION)" .DEFAULT_GOAL := build diff --git a/tools/tm-signer-harness/main.go b/tools/tm-signer-harness/main.go index af730666c..a32537fff 100644 --- a/tools/tm-signer-harness/main.go +++ b/tools/tm-signer-harness/main.go @@ -18,12 +18,13 @@ import ( const ( defaultAcceptRetries = 100 defaultBindAddr = "tcp://127.0.0.1:0" - defaultTMHome = "~/.tendermint" defaultAcceptDeadline = 1 defaultConnDeadline = 3 defaultExtractKeyOutput = "./signing.key" ) +var defaultTMHome string + var logger = log.NewTMLogger(log.NewSyncWriter(os.Stdout)) // Command line flags @@ -60,6 +61,14 @@ Use "tm-signer-harness help " for more information about that command.` fmt.Println("") } + hd, err := os.UserHomeDir() + if err != nil { + fmt.Println("The UserHomeDir is not defined, setting the default TM Home PATH to \"~/.tendermint\"") + defaultTMHome = "~/.tendermint" + } else { + defaultTMHome = fmt.Sprintf("%s/.tendermint", hd) + } + runCmd = flag.NewFlagSet("run", flag.ExitOnError) runCmd.IntVar(&flagAcceptRetries, "accept-retries",