Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd: main function, full and light commands with subcommands #97

Merged
merged 15 commits into from
Oct 11, 2021

Conversation

Wondertan
Copy link
Member

@Wondertan Wondertan commented Sep 29, 2021

Context

Finally, the main function with cobra commands to run our work. The PR also introduces a pattern for reusable commands in cmd package.

Other Changes

  • Improves logging
  • Fixes a bug where lock for repo is applied on nonexisting directory
  • node.ParseType to parse NodeType from a string
  • And others described in commits...

TODO

  • Make ASCI art visible on every help(optional)
  • Make start command

Refs

Closes #17

Copy link
Member

@liamsi liamsi left a comment

Choose a reason for hiding this comment

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

Looks good. Please make sure the code is properly formatted as the linter suggested tho.

node/init.go Outdated Show resolved Hide resolved
node/type.go Show resolved Hide resolved
@Wondertan
Copy link
Member Author

Wondertan commented Sep 30, 2021

@liamsi, @renaynay, start command works now for Full and Light node. Tested them manually along with init, works like a charm.

cmd/start.go Show resolved Hide resolved
cmd/start.go Show resolved Hide resolved
Copy link
Member

@renaynay renaynay left a comment

Choose a reason for hiding this comment

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

comments but otherwise lgtm

cmd/celestia/main.go Show resolved Hide resolved
cmd/celestia/main.go Show resolved Hide resolved
cmd/celestia/main.go Outdated Show resolved Hide resolved
cmd/celestia/full.go Show resolved Hide resolved
cmd/celestia/light.go Show resolved Hide resolved
cmd/start.go Show resolved Hide resolved
node/init.go Outdated Show resolved Hide resolved
node/node.go Outdated Show resolved Hide resolved
core/config.go Show resolved Hide resolved
Copy link
Member

@liamsi liamsi left a comment

Choose a reason for hiding this comment

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

Thanks a lot @Wondertan 👏🏼

Copy link
Member

@renaynay renaynay left a comment

Choose a reason for hiding this comment

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

yay

@renaynay renaynay merged commit a494536 into main Oct 11, 2021
@renaynay renaynay deleted the hlib/main branch October 11, 2021 11:38
@renaynay renaynay restored the hlib/main branch October 11, 2021 11:38
@liamsi liamsi deleted the hlib/main branch October 15, 2021 13:31
@@ -55,9 +54,9 @@ func InitWith(path string, tp Type, cfg *Config) error {
if err != nil {
return err
}
log.Info("Saving config")
log.Infow("Saving config", "path", cfgPath)
Copy link
Member Author

Choose a reason for hiding this comment

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

@renaynay, What's the point of this log if it duplicates Initializing %s Node Repository over '%s' above? I mean it logs the path to the repo and cfg is constantly repo_path+config.toml, so not sure if there is a point to add this path here, but it does not hurt anyway.

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.

cmd: Implement a basic CLI app
4 participants