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

feat(cmd): snapshots command #2825

Merged
merged 1 commit into from
Nov 8, 2023
Merged

Conversation

rootulp
Copy link
Collaborator

@rootulp rootulp commented Nov 8, 2023

Closes #2824

Testing

I verified the snapshots command was added

$ ./build/celestia-appd snapshots
Manage local snapshots

Usage:
  celestia-appd snapshots [command]

Available Commands:
  delete      Delete a local snapshot
  dump        Dump the snapshot as portable archive format
  export      Export app state to snapshot store
  list        List local snapshots
  load        Load a snapshot archive file (.tar.gz) into snapshot store
  restore     Restore app state from local snapshot

Flags:
  -h, --help   help for snapshots

@rootulp rootulp self-assigned this Nov 8, 2023
@rootulp rootulp marked this pull request as ready for review November 8, 2023 13:27
@codecov-commenter
Copy link

Codecov Report

Merging #2825 (e23e8fc) into main (7e9fb84) will decrease coverage by 0.01%.
Report is 1 commits behind head on main.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main    #2825      +/-   ##
==========================================
- Coverage   19.44%   19.44%   -0.01%     
==========================================
  Files         143      143              
  Lines       17320    17323       +3     
==========================================
  Hits         3368     3368              
- Misses      13633    13636       +3     
  Partials      319      319              
Files Coverage Δ
cmd/celestia-appd/cmd/root.go 0.00% <0.00%> (ø)

Copy link
Contributor

@cmwaters cmwaters left a comment

Choose a reason for hiding this comment

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

ty! this turned out to be easier than I thought. Can we backport this to v1.x?

Comment on lines +153 to +155
rootCmd.AddCommand(
snapshot.Cmd(NewAppServer),
)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I guess this could have just been appended to the AddCommand function above

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

true. TBH the contents of this function don't make sense to me. IDK why we add some commands in a block at the top and then add more later

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah it's all a bit messy but not too problematic

@rootulp rootulp changed the title feat: snapshots command feat(cmd): snapshots command Nov 8, 2023
@rootulp rootulp added the backport:v1.x PR will be backported automatically to the v1.x branch upon merging label Nov 8, 2023
@rootulp rootulp merged commit 7d28fc0 into celestiaorg:main Nov 8, 2023
31 checks passed
@rootulp rootulp deleted the rp/snapshots branch November 8, 2023 14:21
mergify bot pushed a commit that referenced this pull request Nov 8, 2023
Closes #2824

## Testing

I verified the snapshots command was added

```shell
$ ./build/celestia-appd snapshots
Manage local snapshots

Usage:
  celestia-appd snapshots [command]

Available Commands:
  delete      Delete a local snapshot
  dump        Dump the snapshot as portable archive format
  export      Export app state to snapshot store
  list        List local snapshots
  load        Load a snapshot archive file (.tar.gz) into snapshot store
  restore     Restore app state from local snapshot

Flags:
  -h, --help   help for snapshots

```

(cherry picked from commit 7d28fc0)
rootulp added a commit that referenced this pull request Nov 8, 2023
This is an automatic backport of pull request #2825 done by
[Mergify](https://mergify.com).


---


<details>
<summary>Mergify commands and options</summary>

<br />

More conditions and actions can be found in the
[documentation](https://docs.mergify.com/).

You can also trigger Mergify actions by commenting on this pull request:

- `@Mergifyio refresh` will re-evaluate the rules
- `@Mergifyio rebase` will rebase this PR on its base branch
- `@Mergifyio update` will merge the base branch into this PR
- `@Mergifyio backport <destination>` will backport this PR on
`<destination>` branch

Additionally, on Mergify [dashboard](https://dashboard.mergify.com) you
can:

- look at your merge queues
- generate the Mergify configuration with the config editor.

Finally, you can contact us on https://mergify.com
</details>

Co-authored-by: Rootul P <rootulp@gmail.com>
cmwaters pushed a commit that referenced this pull request Nov 9, 2023
Closes #2824

## Testing

I verified the snapshots command was added

```shell
$ ./build/celestia-appd snapshots
Manage local snapshots

Usage:
  celestia-appd snapshots [command]

Available Commands:
  delete      Delete a local snapshot
  dump        Dump the snapshot as portable archive format
  export      Export app state to snapshot store
  list        List local snapshots
  load        Load a snapshot archive file (.tar.gz) into snapshot store
  restore     Restore app state from local snapshot

Flags:
  -h, --help   help for snapshots

```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:v1.x PR will be backported automatically to the v1.x branch upon merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add CLI support for initializing application stores from an existing snapshot
4 participants