-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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(server/v2): Add snapshots commands #21065
Changes from 21 commits
225b3d9
ad5d439
09d530d
6ed70ee
7ef5347
2bb232b
bb9e86f
da91ebe
81c51b6
e6450ad
483c585
0c6ecb9
a195d4f
bf2c89a
5b31c7d
4569385
93c73ea
d142e3b
f8061a8
e302502
de47370
4735146
79a9728
f7f30ff
c03a6c8
f1f462e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,50 @@ | ||||||
#!/usr/bin/env bash | ||||||
|
||||||
set -o errexit | ||||||
set -o nounset | ||||||
set -x | ||||||
|
||||||
ROOT=$PWD | ||||||
|
||||||
SIMD="$ROOT/build/simdv2" | ||||||
CONFIG="${CONFIG:-$HOME/.simappv2/config}" | ||||||
|
||||||
COSMOS_BUILD_OPTIONS=v2 make build | ||||||
|
||||||
if [ -d "$($SIMD config home)" ]; then rm -rv $($SIMD config home); fi | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Quote the command substitution to prevent word splitting. The command substitution should be quoted to prevent word splitting and potential issues. - if [ -d "$($SIMD config home)" ]; then rm -rv $($SIMD config home); fi
+ if [ -d "$("$SIMD" config home)" ]; then rm -rv "$("$SIMD" config home)"; fi Committable suggestion
Suggested change
ToolsShellcheck
|
||||||
|
||||||
$SIMD init simapp-v2-node --chain-id simapp-v2-chain | ||||||
|
||||||
cd "$CONFIG" | ||||||
|
||||||
# to change the voting_period | ||||||
jq '.app_state.gov.voting_params.voting_period = "600s"' genesis.json > temp.json && mv temp.json genesis.json | ||||||
|
||||||
# to change the inflation | ||||||
jq '.app_state.mint.minter.inflation = "0.300000000000000000"' genesis.json > temp.json && mv temp.json genesis.json | ||||||
|
||||||
$SIMD config set client chain-id simapp-v2-chain | ||||||
$SIMD keys add test_validator --indiscreet | ||||||
VALIDATOR_ADDRESS=$($SIMD keys show test_validator -a --keyring-backend test) | ||||||
|
||||||
$SIMD genesis add-genesis-account "$VALIDATOR_ADDRESS" 1000000000stake | ||||||
$SIMD genesis gentx test_validator 1000000000stake --keyring-backend test | ||||||
$SIMD genesis collect-gentxs | ||||||
|
||||||
$SIMD start & | ||||||
SIMD_PID=$! | ||||||
|
||||||
# wait 10s then export snapshot at height 10 | ||||||
sleep 10 | ||||||
|
||||||
kill -9 "$SIMD_PID" | ||||||
|
||||||
$SIMD store export --height 5 | ||||||
|
||||||
# clear sc & ss data | ||||||
rm -rf "$HOME/.simappv2/data/application.db" | ||||||
rm -rf "$HOME/.simappv2/data/ss" | ||||||
|
||||||
# restore | ||||||
|
||||||
$SIMD restore 5 3 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
package store | ||
|
||
const ( | ||
FlagAppDBBackend = "app-db-backend" | ||
FlagPruningKeepRecent = "keep-recent" | ||
FlagAppDBBackend = "app-db-backend" | ||
FlagKeepRecent = "keep-recent" | ||
FlagInterval = "interval" | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be a system test instead? cc @alpe