-
Notifications
You must be signed in to change notification settings - Fork 189
Conversation
When Tendermint starts it is not harnessed to an ABCI app, the tutorial should reassure them that this is normal until Ethermint is started.
Reassure users that error output is expected
Signed-off-by: Adrian Brink <[email protected]>
Signed-off-by: Adrian Brink <[email protected]>
Signed-off-by: Adrian Brink <[email protected]>
Signed-off-by: Adrian Brink <[email protected]>
… #stable is covered by semver, everything else can change. Signed-off-by: Adrian Brink <[email protected]>
Ethstat install helpers
…rking Feature/benchmarking
comment about reasons for Pending
Add Unsafe Reset All
Codecov Report
@@ Coverage Diff @@
## unstable #224 +/- ##
============================================
- Coverage 40.42% 34.18% -6.24%
============================================
Files 5 5
Lines 282 351 +69
============================================
+ Hits 114 120 +6
- Misses 149 208 +59
- Partials 19 23 +4
Continue to review full report at Codecov.
|
Node node.Config | ||
Ethstats ethstatsConfig | ||
type additionalConfigs struct { | ||
UnlockAccounts []string `toml:",omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Am not familiar with toml, but toml:",omitempty"
for all the struct fields seems a little off to me.
@@ -91,6 +136,23 @@ func DefaultNodeConfig() node.Config { | |||
return cfg | |||
} | |||
|
|||
// LoadConfig takes configuration file path and full configuration and applies file configs to it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we make this:
LoadConfig reads a configuration from disk and saves it into cfg
Minor not: also perhaps for easier parameter reading, make cfg something like
saveCfg or so and if that change applies, apply it to the comment above, please.
} | ||
defer f.Close() // nolint: errcheck | ||
|
||
err = tomlSettings.NewDecoder(bufio.NewReader(f)).Decode(cfg) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The signature http://godoc.org/github.com/naoina/toml#Config.NewDecoder is:
func (*toml.Config).NewDecoder(io.Reader)
so I don't think we need the bufio.NewReader(f)
since *os.File is already an io.Reader
, unless there is something special about that decoder that it needs buffered io.
defer f.Close() // nolint: errcheck | ||
|
||
err = tomlSettings.NewDecoder(bufio.NewReader(f)).Decode(cfg) | ||
// Add file name to errors that have a line number. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
} | ||
lines := strings.Split(string(text), "\n") | ||
// Sanitise DOS line endings. | ||
for i := range lines { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be a lot easier to read if for a non channel we didn't use i := range lines
so
for i := 0; i < len(lines); i++
comment += "# Note: this config doesn't contain the genesis block.\n\n" | ||
} | ||
|
||
out, err := tomlSettings.Marshal(&cfg) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Double indirection here, cfg is already a pointer i.e *GethConfig
|
||
// DumpConfig dumps toml file from the configurations to stdout | ||
// #unstable | ||
func DumpConfig(cfg *GethConfig) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a nice helper but we could perhaps make it more configurable like this
// FdumpTomlConfig serializes cfg to the output writer
func FdumpTomlConfig(f io.Writer, cfg *GethConfig) error {
comment := ""
if cfg.Eth.Genesis != nil {
cfg.Eth.Genesis = nil
comment += "# Note: this config doesn't contain the genesis block.\n\n"
}
out, err := tomlSettings.Marshal(cfg)
if err != nil {
return err
}
io.WriteString(w, comment)
_, err = w.Write(out)
return err
}
and then
// DumpTomlConfig is a helper that serializes cfg to stdout
func DumpTomlConfig(cfg *GethConfig) error {
return FdumpTomlConfig(os.Stdout, cfg)
}
and then we can also make unit tests to test that FdumpTomlConfig works well and matches our expectations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @nodar-chkuaselidze, thank you for the PR! I am getting familiar with Ethermint, so please pardon me if I suggested the wrong thing, but I've left some comments that perhaps could be applied to the code.
Well, |
@nodar-chkuaselidze oh I see, my bad. In that case, please feel free to get your changes in for parity with geth, and then I'll submit a follow up PR adding the changes and tag you as a review if you are free. Am new around here so just learning how things work :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid blocking you as mentioned in my last comment, I'll remove my requested changes :)
This PR will not be merged in this form. I would like to thank everyone that contributed, but the new proposed structure in #295 will tackle this separately. |
Bumps [github.com/spf13/cobra](https://github.com/spf13/cobra) from 0.0.5 to 0.0.6. - [Release notes](https://github.com/spf13/cobra/releases) - [Commits](spf13/cobra@0.0.5...v0.0.6) Signed-off-by: dependabot-preview[bot] <[email protected]> Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Implements: #223
Integrated codebase from
go-ethereum
for parsingtoml
files.Now we can remove
configs
flag and expect it in thehome
and remove flags.Where should I put example toml file ?