cosmos-sdk/contrib/rosetta/configuration/data.sh

60 lines
1.5 KiB
Bash
Raw Normal View History

#!/bin/sh
set -e
wait_simd() {
timeout 30 sh -c 'until nc -z $0 $1; do sleep 1; done' localhost 9090
}
# this script is used to recreate the data dir
echo clearing /root/.simapp
rm -rf /root/.simapp
echo initting new chain
# init config files
simd init simd --chain-id testing
# create accounts
simd keys add fd --keyring-backend=test
addr=$(simd keys show fd -a --keyring-backend=test)
val_addr=$(simd keys show fd --keyring-backend=test --bech val -a)
# give the accounts some money
simd add-genesis-account "$addr" 1000000000000stake --keyring-backend=test
# save configs for the daemon
simd gentx fd 10000000stake --chain-id testing --keyring-backend=test
# input genTx to the genesis file
simd collect-gentxs
# verify genesis file is fine
simd validate-genesis
echo changing network settings
sed -i 's/127.0.0.1/0.0.0.0/g' /root/.simapp/config/config.toml
# start simd
echo starting simd...
ci: fix rosetta (#10642) <!-- The default pull request template is for types feat, fix, or refactor. For other templates, add one of the following parameters to the url: - template=docs.md - template=other.md --> ## Description Closes: #XXXX <!-- Add a description of the changes that this PR introduces and the files that are the most critical to review. --> --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change - [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [ ] provided a link to the relevant issue or specification - [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [ ] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable)
2021-11-30 01:22:56 -08:00
simd start --pruning=nothing --mode validator &
pid=$!
echo simd started with PID $pid
echo awaiting for simd to be ready
wait_simd
echo simd is ready
sleep 10
# send transaction to deterministic address
echo sending transaction with addr $addr
simd tx bank send "$addr" cosmos19g9cm8ymzchq2qkcdv3zgqtwayj9asv3hjv5u5 100stake --yes --keyring-backend=test --broadcast-mode=block --chain-id=testing
sleep 10
echo stopping simd...
kill -9 $pid
echo zipping data dir and saving to /tmp/data.tar.gz
tar -czvf /tmp/data.tar.gz /root/.simapp
echo new address for bootstrap.json "$addr" "$val_addr"