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

Feature: Replace clean commands with reset and purge commands #76

Merged
merged 9 commits into from
May 3, 2024

Conversation

sambukowski
Copy link
Contributor

The existing workflow for initializing, cleaning/reseting data, and running or re-running for the cli wasn't particularly clear. Specifically the user flow for when you needed to re-run init after a given command and that running init would reset all config.
init now ignores all files that currently exist, so a user can make changes to their env files or other config and re-run init without fear of those changes being removed.
The existing clean commands have been removed and replace with more descriptive reset and purge commands.
The new user flow is as follows:

  • if you run a reset command, you don't need to run init again before run.
  • if you run a purge command, you do need to run init again before run

reset commands return the data to their initial state, as though init was run for the first time.
purge commands simply delete the specified data

Added commands:
dev reset config -> reset cometbft configs
dev reset env -> reset env files
dev reset state -> reset the state
dev purge binaries -> delete the downloaded binaries
dev purge all -> delete an instance

closes #71

@sambukowski sambukowski requested a review from steezeburger May 2, 2024 22:13
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
cmd/devtools/init.go Outdated Show resolved Hide resolved
cmd/devtools/purge.go Outdated Show resolved Hide resolved
cmd/devtools/purge.go Outdated Show resolved Hide resolved
cmd/devtools/purge.go Outdated Show resolved Hide resolved
cmd/devtools/reset.go Outdated Show resolved Hide resolved
cmd/devtools/init.go Outdated Show resolved Hide resolved
@sambukowski sambukowski merged commit a617dd0 into integration/v1 May 3, 2024
1 check passed
@sambukowski sambukowski deleted the feat/clean-commands branch May 3, 2024 21:42
steezeburger added a commit that referenced this pull request May 15, 2024
* integration/v1:
  add cometbft rpc server ready check (#77)
  Feature: Replace `clean` commands with `reset` and `purge` commands (#76)
steezeburger added a commit that referenced this pull request May 23, 2024
* Chore: Update to Dusk-5 (#67)

* working local updates for dusk-5

* revert rollup name in env

* update remote config and sequencer internals for new protos

* env var updates

* Update go.mod

* use astria-dusk-5 for all networks

* Feature: store private key in keyring or keyfile (#64)

* store private key in os keyring

* --insecure flag for createaccount

* improve secure flag

* createaccount support keyfile

* cleanup

* working transfer with privkey, keyring, and keyfile

* handle error

* test file decryption

* remove quotes that implied we aren't secure.

was quoting because we're in the if branch that is ran when no `--insecure` flag exists, which means we're "secure"

* capture all args for nicer just run usage

* update just command comment

* use astria-dusk-5 as chain id so remote will work

* can only pass in one type of key flag

* Feature: Replace `clean` commands with `reset` and `purge` commands (#76)

* init doesn't overwrite existing files

* add reset commands

* add purge commands

* update exec "cp" commands with io.copy

* readme updates

* update comments and descriptions

* refactor helper functions and config

* fix sequencer transfer description in readme

* add cometbft rpc server ready check (#77)

* feature: bridge commands (#66)

* feat: Add init-bridge and bridge-lock commands

* minor changes

* store private key in os keyring

* --insecure flag for createaccount

* chore: initbridge response and command changes

* improve secure flag

* createaccount support keyfile

* cleanup

* working transfer with privkey, keyring, and keyfile

* handle error

* test file decryption

* remove quotes that implied we aren't secure.

was quoting because we're in the if branch that is ran when no `--insecure` flag exists, which means we're "secure"

* capture all args for nicer just run usage

* update just command comment

* update go-sequencer-client and protos.

* helpers. tests.

* Update initbridge.go

* noun verb. remove --privkey from usage

* usage strings

* consistent doc strings

* reorg bridge commands into one file. make parent bridge command for proper help text. add missing fields to proto.

* add chain, asset, and fee asset ids to init bridge opts

---------

Co-authored-by: Jesse Snyder <[email protected]>

* Feature: Update services and CLI config (#79)

* added network config default file creation

* cleanup network config init

* apply config overrides

* flags and commands updated

* update transfer command and integration tests

* update invalid sequencer chain id errors

* add default denom to network config and reset

* move networks config from utils package to config package

* readme updates

* readme fmt

* add base config and service log level flags

* added debug logging for config

* removed extra config struct nesting

* remove .env files

* refactor config dir

* update reset commands

* reset networks command comment and info update

* move shared dev command flags to dev cmd root

* command handler added for dev commands

* update cli flag handler to have bindBoolFlag and rename handler file

* update sequencer commands to use flagHandler

* update flagHandler GetValue function to properly return differently typed flag values

* update sequencer-chain-id and sequencer-url flags

* GetEnvOverrides now updates ASTRIA_COMPOSER_ROLLUPS completely

* update bridge commands to use flag handler

* update load config names

* instance flag help update

* comments, typos, and small formatting fixes

* refactor service log flag, remove need to SetLogLevel using PreRun for all commands

* cobra init functions moved to after all command definitions

* ValidateServiceLogLevelOrPanic moved to run.go

* process runner opts config var renamed to env

* move non global flags to local commands

* use constants for defaults, fix initialisms

* update bridge lock sequencer url description

* fix string flag get value bug

* typo fixes and small renamings

* ConvertStructToEnvArray moved to ToSlice on BaseConfig

* fix LoadNetworkConfigsOrPanic naming and CreateBaseConfig doc comment

* update environment config flow

* update GetEndpointOverrides to match full ws endpoint

* doc comment and regex update for GetEndpointOverrides

* Fix/bridge opts integration branch (#87)

* added network config default file creation

* cleanup network config init

* apply config overrides

* flags and commands updated

* update transfer command and integration tests

* update invalid sequencer chain id errors

* add default denom to network config and reset

* move networks config from utils package to config package

* readme updates

* readme fmt

* add base config and service log level flags

* added debug logging for config

* removed extra config struct nesting

* remove .env files

* refactor config dir

* update reset commands

* reset networks command comment and info update

* move shared dev command flags to dev cmd root

* command handler added for dev commands

* update cli flag handler to have bindBoolFlag and rename handler file

* update sequencer commands to use flagHandler

* update flagHandler GetValue function to properly return differently typed flag values

* update sequencer-chain-id and sequencer-url flags

* GetEnvOverrides now updates ASTRIA_COMPOSER_ROLLUPS completely

* update bridge commands to use flag handler

* update load config names

* add fields to bridge lock opts

* usage strings and doc comments

* instance flag help update

* update protos and go-sequencer-client versions

* comments, typos, and small formatting fixes

* refactor service log flag, remove need to SetLogLevel using PreRun for all commands

* cobra init functions moved to after all command definitions

* ValidateServiceLogLevelOrPanic moved to run.go

* process runner opts config var renamed to env

* move non global flags to local commands

* update flag names

* consistent naming

* use constants for defaults, fix initialisms

* update bridge lock sequencer url description

* fix string flag get value bug

* typo fixes and small renamings

* ConvertStructToEnvArray moved to ToSlice on BaseConfig

* fix LoadNetworkConfigsOrPanic naming and CreateBaseConfig doc comment

* fix bridge lock flags

* update environment config flow

* update GetEndpointOverrides to match full ws endpoint

---------

Co-authored-by: Sam Bukowski <[email protected]>

---------

Co-authored-by: Sam Bukowski <[email protected]>
Co-authored-by: quasystaty <[email protected]>
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.

2 participants