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

Fixed startup script to be a bit friendlier. By default will run ./se… #1078

Merged
merged 1 commit into from
Aug 22, 2022
Merged
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
37 changes: 17 additions & 20 deletions scripts/start-node.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,32 @@

set -o errexit

CHAINID=$1
GENACCT=$2
SECRETD=${1:-./secretd}
SECRETD_HOME=${2:-$HOME/.secretd_local}
CHAINID=${3:-secretdev-1}
GENACCT=$4

if [ -z "$1" ]; then
echo "Need to input chain id..."
exit 1
fi

rm -rf ~/.secretd
rm -rf $SECRETD_HOME

# Build genesis file incl account for passed address
coins="10000000000uscrt,100000000000stake"
secretd init --chain-id $CHAINID $CHAINID
secretd keys add validator --keyring-backend="test"
secretd add-genesis-account $(secretd keys show validator -a --keyring-backend="test") $coins
$SECRETD init --chain-id $CHAINID $CHAINID --home $SECRETD_HOME
$SECRETD keys add validator --keyring-backend="test" --home $SECRETD_HOME
$SECRETD add-genesis-account $($SECRETD keys show validator -a --keyring-backend="test" --home $SECRETD_HOME) $coins --home $SECRETD_HOME

if [ ! -z "$2" ]; then
secretd add-genesis-account $GENACCT $coins
$SECRETD add-genesis-account $GENACCT $coins
fi

secretd gentx validator 5000000000uscrt --keyring-backend="test" --chain-id $CHAINID
secretd collect-gentxs
$SECRETD gentx validator 5000000000uscrt --keyring-backend="test" --chain-id $CHAINID --home $SECRETD_HOME
$SECRETD collect-gentxs --home $SECRETD_HOME

# Set proper defaults and change ports
sed -i 's#"tcp://127.0.0.1:26657"#"tcp://0.0.0.0:26657"#g' ~/.secretd/config/config.toml
sed -i 's/timeout_commit = "5s"/timeout_commit = "1s"/g' ~/.secretd/config/config.toml
sed -i 's/timeout_propose = "3s"/timeout_propose = "1s"/g' ~/.secretd/config/config.toml
sed -i 's/index_all_keys = false/index_all_keys = true/g' ~/.secretd/config/config.toml
perl -i -pe 's/"stake"/ "uscrt"/g' ~/.secretd/config/genesis.json
sed -i 's#"tcp://127.0.0.1:26657"#"tcp://0.0.0.0:26657"#g' $SECRETD_HOME/config/config.toml
sed -i 's/timeout_commit = "5s"/timeout_commit = "1s"/g' $SECRETD_HOME/config/config.toml
sed -i 's/timeout_propose = "3s"/timeout_propose = "1s"/g' $SECRETD_HOME/config/config.toml
sed -i 's/index_all_keys = false/index_all_keys = true/g' $SECRETD_HOME/config/config.toml
perl -i -pe 's/"stake"/ "uscrt"/g' $SECRETD_HOME/config/genesis.json

# Start the secretd
secretd start --pruning=nothing --bootstrap
$SECRETD start --pruning=nothing --bootstrap --home $SECRETD_HOME