Skip to content

Commit

Permalink
Improve local test setup scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
cbrit committed Apr 25, 2024
1 parent b2b17ed commit 13bd983
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 5 deletions.
1 change: 1 addition & 0 deletions module/contrib/local/gorc_config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
keystore = "~/.gravity/config"
31 changes: 27 additions & 4 deletions module/contrib/local/setup_node.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,30 @@
#!/bin/bash
set -eu

gravityd init --chain-id=testing local
gravityd add-genesis-account validator 1000000000stake
gravityd gentx --name validator --amount 1000000000stake
gravityd collect-gentxs
# This doesn't do any check for a clean environment or try to overwrite
# existing files. If you want to start fresh, remove ~/.gravity (or
# wherever the dir is if you use a different path than home) before running
# this script.

gravity init --chain-id=testing local

# Create delegate keys
CONFIG=$(echo "$(pwd)/gorc_config.toml")
gorc keys eth add signer
gorc keys cosmos add orchestrator

SIGNER=$(gorc --config $CONFIG keys eth show signer)
ORCHESTRATOR=$(gorc --config $CONFIG keys cosmos show orchestrator)
# remove prefix from output
ORCHESTRATOR=$(echo $ORCHESTRATOR | sed s/"orchestrator "//)

gravity add-genesis-account validator 1000000000stake

# assumes key has been created
VALIDATOR=$(gravity keys show validator --bech val -a)
SIGNATURE="0x$(gorc sign-delegate-keys signer $VALIDATOR 0)"

echo $SIGNER $ORCHESTRATOR $SIGNATURE

gravity gentx validator 1000000000stake $SIGNER $ORCHESTRATOR $SIGNATURE --chain-id testing
gravity collect-gentxs
7 changes: 6 additions & 1 deletion module/contrib/local/start_node.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
#!/bin/bash
set -eu

gravityd start --rpc.laddr tcp://0.0.0.0:26657 --trace --log_level="main:info,state:debug,*:error"
gravity start \
--rpc.laddr tcp://0.0.0.0:26657 \
--trace \
--log_level="main:info,state:debug,*:error" \
--minimum-gas-prices 0stake

0 comments on commit 13bd983

Please sign in to comment.