# lightly adapted from the cool cats at Confio / cosmwasm
# as always, thanks and mega props
RPC="http://localhost:26657"
# initialize junod configuration files
junod init testmoniker --chain-id ${CHAIN_ID} --home ${APP_HOME}
# add minimum gas prices config to app configuration file
sed -i -r 's/minimum-gas-prices = ""/minimum-gas-prices = "0.025ujuno"/' ${APP_HOME}/config/app.toml
# --keyring-backend test is for testing purposes
# Change it to --keyring-backend file for secure usage.
export KEYRING="--keyring-backend test --keyring-dir $HOME/.juno_keys"
junod keys add main $KEYRING
# create validator address
junod keys add validator $KEYRING
# add your wallet addresses to genesis
junod add-genesis-account $(junod keys show -a main $KEYRING) 10000000000ujuno --home ${APP_HOME}
junod add-genesis-account $(junod keys show -a validator $KEYRING) 10000000000ujuno --home ${APP_HOME}
# add second address as validator's address
# validator is the key name
junod gentx validator 1000000000ujuno --home ${APP_HOME} --chain-id ${CHAIN_ID} $KEYRING
# collect gentxs & add to genesis
junod collect-gentxs --home ${APP_HOME}
# validate the genesis file
junod validate-genesis --home ${APP_HOME}
junod start --home ${APP_HOME}