Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ Ref: https://keepachangelog.com/en/1.0.0/

# Unreleased

### Features

- (store) [#13](https://github.com/EscanBE/evermint/pull/13) Add local `snapshots` management commands (backport #12)

### Improvement

- (test) [#11](https://github.com/EscanBE/evermint/pull/11) Use Testnet chain-id instead of Mainnet chain-id for tests (backport #10)
Expand Down
29 changes: 29 additions & 0 deletions cmd/evmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"errors"
"fmt"
"github.com/EscanBE/evermint/v12/constants"
"github.com/cosmos/cosmos-sdk/client/snapshot"
"io"
"os"
"path/filepath"
Expand Down Expand Up @@ -121,6 +122,34 @@ func NewRootCmd() (*cobra.Command, params.EncodingConfig) {
config.Cmd(),
pruning.PruningCmd(a.newApp),
NewConvertAddressCmd(),
func() *cobra.Command {
snapshotCmd := snapshot.Cmd(a.newApp)
snapshotCmd.Long = fmt.Sprintf(`
How to use "%s snapshot" command:
In this context, we gonna to export snapshot for height 100000
1. Create state-sync snapshot on a running node with "export"
> sudo systemctl stop %s
> %s snapshots export --height 100000
You gonna get state-sync snapshot at "%s/snapshots/" dir as usual:
> Log: Snapshot created at height 100000, format 2, chunks 10
2. Pack snapshot with "dump":
> %s snapshots dump 100000 2
You gonna get "100000-2.tar.gz" at current working directory
3. Share to another node or reset data of current node with "unsafe-reset-all"
4. Unsafe-reset the node and unpack snapshot with "load":
> %s snapshots load 100000-2.tar.gz
5. Then restore app state with "restore":
> %s snapshots restore 100000 2
You gonna get "data/application.db" unpacked
6. Now bootstrap state with "bootstrap-state":
%s tendermint bootstrap-state
`,
constants.ApplicationBinaryName, constants.ApplicationBinaryName, constants.ApplicationBinaryName,
constants.ApplicationHome,
constants.ApplicationBinaryName, constants.ApplicationBinaryName, constants.ApplicationBinaryName, constants.ApplicationBinaryName,
)
return snapshotCmd
}(),
}

// End of command rename chain
Expand Down
1 change: 1 addition & 0 deletions server/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ func AddCommands(
sdkserver.VersionCmd(),
tmcmd.ResetAllCmd,
tmcmd.ResetStateCmd,
sdkserver.BootstrapStateCmd(opts.AppCreator),
)

startCmd := StartCmd(opts)
Expand Down