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

CLI refactor #410

Merged
merged 51 commits into from Mar 4, 2022
Merged

CLI refactor #410

merged 51 commits into from Mar 4, 2022

Conversation

zivkovicmilos
Copy link
Contributor

@zivkovicmilos zivkovicmilos commented Feb 8, 2022

Description

This PR features a complete rewrite of the CLI module in Polygon Edge, the simplification of command additions and the pruning of several now useless packages:

The new CLI implementation is based on Cobra

Changes include

  • Bugfix (non-breaking change that solves an issue)
  • Hotfix (change that solves an urgent issue, and requires immediate attention)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (change that is not backwards-compatible and/or changes current functionality)

Checklist

  • I have assigned this PR to myself
  • I have added at least 1 reviewer
  • I have added the relevant labels
  • I have updated the official documentation
  • I have added sufficient documentation in code

Testing

  • I have tested this code with the official test suite
  • I have tested this code manually

Manual tests

The changes have been tested mostly through the e2e test suite that we have baked in, but also by following the official documentation and checking out different command flows.

Documentation update

Relevant Docs PR

Additional comments

Fixes EDGE-44

CLI changes

The following flags have been renamed:

Command Old flag New flag
genesis chainid chain-id
server grpc grpc-address

Dropped commands

dev

The helpful dev command has been dropped for now, and it's reintroduction should be a part of a smaller task in the future.

New tasks

During the refactor of the CLI module, several places for improvement have been spotted.

Dropping the --seal concept from Polygon Edge

Explained in detail in E-394

Adding unit tests

Explained in detail in E-397

Generating CLI docs

Explained in detail in E-398

@dbrajovic dbrajovic self-requested a review February 18, 2022 10:59
Copy link
Contributor

@dbrajovic dbrajovic left a comment

Choose a reason for hiding this comment

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

Apart from the global params variable in each params.go file (which we should discuss), everything else seems well encapsulated. 👍

Copy link
Contributor

@Aleksao998 Aleksao998 left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Contributor

@lazartravica lazartravica left a comment

Choose a reason for hiding this comment

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

Tests pass, common commands confirmed working, backwards compatibility is also 👌

I have one issue while testing, I cannot start server with default values for arguments:

$ go run main.go server
failed to parse addr 'http://127.0.0.1:8545': address http://127.0.0.1:8545: too many colons in address
exit status 1

Please take a look at this and address my comments in the code review, thanks for the extra effort on this PR 🙏

consensus/ibft/ibft.go Outdated Show resolved Hide resolved
consensus/ibft/ibft.go Outdated Show resolved Hide resolved
consensus/ibft/ibft.go Outdated Show resolved Hide resolved
consensus/ibft/sign.go Outdated Show resolved Hide resolved
e2e/framework/helper.go Show resolved Hide resolved
network/server.go Outdated Show resolved Hide resolved
network/server.go Outdated Show resolved Hide resolved
secrets/hashicorpvault/hashicorp_vault.go Outdated Show resolved Hide resolved
server/builtin.go Show resolved Hide resolved
server/builtin.go Show resolved Hide resolved
@zivkovicmilos
Copy link
Contributor Author

@lazartravica

Resolved the problem with the default address, turns out it was just the default value set incorrectly to include the protocol name:

61e0d02

@lazartravica
Copy link
Contributor

@zivkovicmilos thanks for fixing the comments, and sorry for bugging you about the dev & dummy consensus - i’ve misunderstood your additional comments section :)

merging this

@zivkovicmilos zivkovicmilos merged commit b06e562 into develop Mar 4, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Mar 4, 2022
@zivkovicmilos zivkovicmilos deleted the feature/cli-refactor branch March 4, 2022 10:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature New update to Polygon Edge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants