Skip to content

config: split data and config directories#709

Merged
zramsay merged 5 commits intoconfigfrom
556-seperate-configs
Oct 26, 2017
Merged

config: split data and config directories#709
zramsay merged 5 commits intoconfigfrom
556-seperate-configs

Conversation

@zramsay
Copy link
Contributor

@zramsay zramsay commented Oct 4, 2017

}
// Read priv_validator.json to populate vals
privValFile := path.Join(dataDir, mach, "priv_validator.json")
privValFile := path.Join(dataDir, mach, cfg.DefaultPrivValPath)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

filepath

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))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

)

var (
DefaultTendermintDir = ".tendermint"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where is it used?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added to cmd/tendermint/main.go

config/config.go Outdated
DefaultConfigDir = "config"
DefaultDataDir = "data"

DefaultConfigFileName = "config.toml"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'll tackle that in #705 when diving deeper into the config

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-io
Copy link

codecov-io commented Oct 4, 2017

Codecov Report

Merging #709 into config will increase coverage by 0.36%.
The diff coverage is 68.42%.

@@            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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we even need this one if we Ensure subdirs?

@zramsay zramsay force-pushed the 556-seperate-configs branch from ad2ff96 to 7914230 Compare October 9, 2017 11:51
@zramsay
Copy link
Contributor Author

zramsay commented Oct 9, 2017

addressed all the comments, PTAL

@zramsay zramsay force-pushed the 556-seperate-configs branch from 7914230 to 37a2644 Compare October 9, 2017 11:58
@zramsay zramsay mentioned this pull request Oct 10, 2017
@ebuchman ebuchman mentioned this pull request Oct 10, 2017
5 tasks
@zramsay zramsay changed the base branch from develop to config October 11, 2017 13:04
@zramsay zramsay added this to the 0.12.0 milestone Oct 26, 2017
@zramsay zramsay force-pushed the 556-seperate-configs branch from 5013ecd to 6c7fa96 Compare October 26, 2017 14:24
@zramsay
Copy link
Contributor Author

zramsay commented Oct 26, 2017

rebased on config, merging to that branch

@zramsay zramsay force-pushed the 556-seperate-configs branch from f9aae8f to 98e6f3b Compare October 26, 2017 14:32
@zramsay zramsay merged commit 376dfe0 into config Oct 26, 2017
@zramsay zramsay deleted the 556-seperate-configs branch October 26, 2017 14:33
@zramsay zramsay mentioned this pull request Oct 26, 2017
cmwaters pushed a commit to cmwaters/tendermint that referenced this pull request Dec 12, 2022
adrianbrink pushed a commit to heliaxdev/tendermint that referenced this pull request May 23, 2023
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants