config: split data and config directories#709
Conversation
cmd/tendermint/commands/testnet.go
Outdated
| } | ||
| // Read priv_validator.json to populate vals | ||
| privValFile := path.Join(dataDir, mach, "priv_validator.json") | ||
| privValFile := path.Join(dataDir, mach, cfg.DefaultPrivValPath) |
cmd/tendermint/commands/testnet.go
Outdated
| for i := 0; i < nValidators; i++ { | ||
| mach := cmn.Fmt("mach%d", i) | ||
| genDoc.SaveAs(path.Join(dataDir, mach, "genesis.json")) | ||
| genDoc.SaveAs(path.Join(dataDir, mach, cfg.DefaultGenesisJSONPath)) |
| ) | ||
|
|
||
| var ( | ||
| DefaultTendermintDir = ".tendermint" |
There was a problem hiding this comment.
added to cmd/tendermint/main.go
config/config.go
Outdated
| DefaultConfigDir = "config" | ||
| DefaultDataDir = "data" | ||
|
|
||
| DefaultConfigFileName = "config.toml" |
There was a problem hiding this comment.
I like these, but we already have the config https://github.com/tendermint/tendermint/blob/develop/config/config.go#L69, so we probably use those
There was a problem hiding this comment.
i'll tackle that in #705 when diving deeper into the config
There was a problem hiding this comment.
Mmm I think Anton is right. Best if we use the values in the config object where we need them rather than these package level globals - it should be part of this PR
There was a problem hiding this comment.
Well - I like having all the strings at the top in one place, but I don't think they should be exported.
The only one that should be exported is DefaultTendermintDir
Codecov Report
@@ Coverage Diff @@
## config #709 +/- ##
==========================================
+ Coverage 57.37% 57.73% +0.36%
==========================================
Files 82 80 -2
Lines 8441 8412 -29
==========================================
+ Hits 4843 4857 +14
+ Misses 3176 3129 -47
- Partials 422 426 +4 |
config/config.go
Outdated
| DefaultConfigDir = "config" | ||
| DefaultDataDir = "data" | ||
|
|
||
| DefaultConfigFileName = "config.toml" |
There was a problem hiding this comment.
Mmm I think Anton is right. Best if we use the values in the config object where we need them rather than these package level globals - it should be part of this PR
config/config.go
Outdated
| DefaultConfigDir = "config" | ||
| DefaultDataDir = "data" | ||
|
|
||
| DefaultConfigFileName = "config.toml" |
There was a problem hiding this comment.
Well - I like having all the strings at the top in one place, but I don't think they should be exported.
The only one that should be exported is DefaultTendermintDir
config/toml.go
Outdated
| @@ -13,9 +12,10 @@ import ( | |||
|
|
|||
| func EnsureRoot(rootDir string) { | |||
| cmn.EnsureDir(rootDir, 0700) | |||
There was a problem hiding this comment.
do we even need this one if we Ensure subdirs?
ad2ff96 to
7914230
Compare
|
addressed all the comments, PTAL |
7914230 to
37a2644
Compare
5013ecd to
6c7fa96
Compare
|
rebased on |
f9aae8f to
98e6f3b
Compare
…nt#709) * crypto/merkle: Add error handling (tendermint#558) * porting pr * Disallow nil root hashes * linting * making computeRootHash private * Update release notes. * Update .changelog/unreleased/breaking-changes/558-tm10011.md Co-authored-by: Thane Thomson <connect@thanethomson.com> * Wrapping the private function into a public one with the old signature. * update comment * remove dependency on amino * Update .changelog/unreleased/breaking-changes/558-tm10011.md Co-authored-by: Thane Thomson <connect@thanethomson.com> --------- Co-authored-by: Thane Thomson <connect@thanethomson.com> (cherry picked from commit d067b74) # Conflicts: # crypto/merkle/proof.go * fix conflict --------- Co-authored-by: Lasaro <lasaro@informal.systems>
#556