diff --git a/scripts/simapp/env b/scripts/simapp/env index 403fec6b..487d4444 100644 --- a/scripts/simapp/env +++ b/scripts/simapp/env @@ -1,4 +1,4 @@ -# Choose from https://hub.docker.com/r/interchainio/cosmos-sdk/tags -REPOSITORY="interchainio/cosmos-sdk" -VERSION="july-2-2020" +# Choose from https://hub.docker.com/r/interchainio/simapp/tags +REPOSITORY="interchainio/simapp" +VERSION="nightly-2020-07-29" CONTAINER_NAME="simapp" diff --git a/scripts/simapp/generate_template.sh b/scripts/simapp/generate_template.sh index dff9811e..26dee504 100755 --- a/scripts/simapp/generate_template.sh +++ b/scripts/simapp/generate_template.sh @@ -9,8 +9,8 @@ source "$SCRIPT_DIR"/env rm -rf "$SCRIPT_DIR/template" mkdir "$SCRIPT_DIR/template" -cp setup.sh "$SCRIPT_DIR/template/" -cp run_simd.sh "$SCRIPT_DIR/template/" +cp setup.sh "$SCRIPT_DIR/template/" && chmod +x "$SCRIPT_DIR/template/setup.sh" +cp run_simd.sh "$SCRIPT_DIR/template/" && chmod +x "$SCRIPT_DIR/template/run_simd.sh" # The usage of the accounts below is documented in README.md of this directory docker run --rm \ diff --git a/scripts/simapp/run_simd.sh b/scripts/simapp/run_simd.sh old mode 100755 new mode 100644 index 7a66bbbb..3264dacc --- a/scripts/simapp/run_simd.sh +++ b/scripts/simapp/run_simd.sh @@ -2,6 +2,6 @@ set -o errexit -o nounset -o pipefail command -v shellcheck > /dev/null && shellcheck "$0" +cp -R "/template/.simapp" /root mkdir -p /root/log - simd start --rpc.laddr tcp://0.0.0.0:26657 --trace diff --git a/scripts/simapp/setup.sh b/scripts/simapp/setup.sh old mode 100755 new mode 100644 index d274693c..6d61efb0 --- a/scripts/simapp/setup.sh +++ b/scripts/simapp/setup.sh @@ -5,21 +5,28 @@ command -v shellcheck > /dev/null && shellcheck "$0" PASSWORD=${PASSWORD:-1234567890} STAKE=${STAKE_TOKEN:-ustake} FEE=${FEE_TOKEN:-ucosm} -CHAIN_ID=${CHAIN_ID:-testing} +CHAIN_ID=${CHAIN_ID:-simd-testing} +MONIKER=${MONIKER:-simd-moniker} -simd init --chain-id="$CHAIN_ID" "$CHAIN_ID" -# staking/governance token is hardcoded in config, change this -sed -i "s/\"stake\"/\"$STAKE\"/" "$HOME"/.simapp/config/genesis.json -if ! simcli keys show validator; then - (echo "$PASSWORD"; echo "$PASSWORD") | simcli keys add validator +echo "Creating genesis ..." +simd init --chain-id "$CHAIN_ID" "$MONIKER" +sed -i "s/\"stake\"/\"$STAKE\"/" "$HOME"/.simapp/config/genesis.json # staking/governance token is hardcoded in config, change this + +echo "Setting up validator ..." +if ! simd keys show validator; then + echo "Validator does not yet exist. Creating it ..." + (echo "$PASSWORD"; echo "$PASSWORD") | simd keys add validator fi # hardcode the validator account for this instance echo "$PASSWORD" | simd add-genesis-account validator "1000000000$STAKE,1000000000$FEE" + +echo "Setting up accounts ..." # (optionally) add a few more genesis accounts for addr in "$@"; do echo $addr simd add-genesis-account "$addr" "1000000000$STAKE,1000000000$FEE" done -# submit a genesis validator tx -(echo "$PASSWORD"; echo "$PASSWORD"; echo "$PASSWORD") | simd gentx --name validator --amount "250000000$STAKE" + +echo "Creating genesis tx ..." +(echo "$PASSWORD"; echo "$PASSWORD"; echo "$PASSWORD") | simd gentx validator --amount "250000000$STAKE" --chain-id "$CHAIN_ID" simd collect-gentxs diff --git a/scripts/simapp/start.sh b/scripts/simapp/start.sh index 7d66da2c..6fef2b4d 100755 --- a/scripts/simapp/start.sh +++ b/scripts/simapp/start.sh @@ -2,28 +2,32 @@ set -o errexit -o nounset -o pipefail command -v shellcheck > /dev/null && shellcheck "$0" +TENDERMINT_PORT_GUEST="26657" +TENDERMINT_PORT_HOST="26657" + SCRIPT_DIR="$(realpath "$(dirname "$0")")" # shellcheck source=./env # shellcheck disable=SC1091 source "$SCRIPT_DIR"/env -echo "$CONTAINER_NAME" - TMP_DIR=$(mktemp -d "${TMPDIR:-/tmp}/simapp.XXXXXXXXX") chmod 777 "$TMP_DIR" echo "Using temporary dir $TMP_DIR" SIMD_LOGFILE="$TMP_DIR/simd.log" -PORT=26657 + +# Use a fresh volume for every start +docker volume rm -f simapp_data docker run --rm \ --name "$CONTAINER_NAME" \ - -p "$PORT:$PORT" \ - --mount type=bind,source="$SCRIPT_DIR/template",target=/root \ + -p "$TENDERMINT_PORT_HOST":"$TENDERMINT_PORT_GUEST" \ + --mount type=bind,source="$SCRIPT_DIR/template",target=/template \ + --mount type=volume,source=simapp_data,target=/root \ "$REPOSITORY:$VERSION" \ - ./run_simd.sh \ + /template/run_simd.sh \ > "$SIMD_LOGFILE" & -echo "simd running on http://localhost:$PORT and logging into $SIMD_LOGFILE" +echo "simd running on http://localhost:$TENDERMINT_PORT_HOST and logging into $SIMD_LOGFILE" if [ -n "${CI:-}" ]; then # Follow the logs in CI's background job diff --git a/scripts/simapp/template/.simapp/2bb7a14fe96a5d63899b4a1c6971d5da08e56ff5.address b/scripts/simapp/template/.simapp/2bb7a14fe96a5d63899b4a1c6971d5da08e56ff5.address deleted file mode 100644 index 9592fdd2..00000000 --- a/scripts/simapp/template/.simapp/2bb7a14fe96a5d63899b4a1c6971d5da08e56ff5.address +++ /dev/null @@ -1 +0,0 @@ -eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjcmVhdGVkIjoiMjAyMC0wNy0wMiAxMjowNzoyMy4xODYzNzMyMjMgKzAwMDAgVVRDIG09KzAuMTg4NzI3NzY0IiwiZW5jIjoiQTI1NkdDTSIsInAyYyI6ODE5MiwicDJzIjoiNGdMcVVEdlcyRGRaWk1NXyJ9.B-AuI5w3Sx51GG0g-VzBciHaWu8VpOvGfPJsWEMWZ3XpnOQib-6BeQ.ZrDU9r8QGYayFR1E.YtowOLcWfNA8bZmDvoJhVB_zrE1AWa-E5P2ShZV4hIAHBusrkyR-RwxEG4y7Kc4FHIXw5UCIuJvZaJy39z670xIhL6ktgTgZUmC4BTmHAnlC1oRDj_Ih0_J-oAsjTir8-Y0VXb1vyky1E4yo9jq-E3vTvqfxn3QCqHIBpnQ7dqoM8Zi3hCy9YxQoBGptEf9z5fimIszZMM1sXjqS7sEZPWoJO6jYmRUp9D5NvaY6zyTgOrEEWXF7JpqC.CTb3ibPIGwVtVIkziDg7GA \ No newline at end of file diff --git a/scripts/simapp/template/.simapp/be69af0cca1189f1074bffb9efc176c6fd7e2e38.address b/scripts/simapp/template/.simapp/be69af0cca1189f1074bffb9efc176c6fd7e2e38.address new file mode 100644 index 00000000..f841893e --- /dev/null +++ b/scripts/simapp/template/.simapp/be69af0cca1189f1074bffb9efc176c6fd7e2e38.address @@ -0,0 +1 @@ +eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjcmVhdGVkIjoiMjAyMC0wNy0yOSAxMjozMzo0My4yNzMwNzc0ICswMDAwIFVUQyBtPSswLjQyMDc1MDIwMSIsImVuYyI6IkEyNTZHQ00iLCJwMmMiOjgxOTIsInAycyI6Ik1QUEpoYXdfUE9CTk84ckcifQ.1qbmeelJhpCbCgKFx3RUYchhFtsZhl8HpVe2TIk_ioOt4LE9zJ1a5A.rYvjRK55ePe7O9JU.-RTRUDq1_79yOeZoXXUyyiVlanfHFjlmxQ8ZdtDCfLg8OcIgEvQYWpQG0NXFVQSaV3yYc8m1sWuXQqnMH5pm9kgxFWq7jahobz9a70d9WibfAUNBqdcvC7AyvM1L8eWIo1a_HJV_C1-CkZDjUuAK4MDj8KReC4NFbOKW_A1rNkJxCrVX7m1v2SQF9fEAEepnEZzYtH0LFDTZYNhpwt8o-ofk-47lPYr0KJB6CXaMv2CJ2clRTg12V_a0.Xv8QuXyJcO_9ZLK6LBhBkg \ No newline at end of file diff --git a/scripts/simapp/template/.simapp/config/config.toml b/scripts/simapp/template/.simapp/config/config.toml index 2e8062c5..3e4cabc4 100644 --- a/scripts/simapp/template/.simapp/config/config.toml +++ b/scripts/simapp/template/.simapp/config/config.toml @@ -13,7 +13,7 @@ proxy_app = "tcp://127.0.0.1:26658" # A custom human readable name for this node -moniker = "testing" +moniker = "simd-moniker" # If this node is many blocks behind the tip of the chain, FastSync # allows them to catchup quickly by downloading blocks in parallel diff --git a/scripts/simapp/template/.simapp/config/genesis.json b/scripts/simapp/template/.simapp/config/genesis.json index 8b9a1e7a..e5a6e25e 100644 --- a/scripts/simapp/template/.simapp/config/genesis.json +++ b/scripts/simapp/template/.simapp/config/genesis.json @@ -1,6 +1,6 @@ { - "genesis_time": "2020-07-02T12:07:22.868761784Z", - "chain_id": "testing", + "genesis_time": "2020-07-29T12:33:42.4598863Z", + "chain_id": "simd-testing", "consensus_params": { "block": { "max_bytes": "22020096", @@ -19,6 +19,50 @@ }, "app_hash": "", "app_state": { + "mint": { + "minter": { + "inflation": "0.130000000000000000", + "annual_provisions": "0.000000000000000000" + }, + "params": { + "mint_denom": "ustake", + "inflation_rate_change": "0.130000000000000000", + "inflation_max": "0.200000000000000000", + "inflation_min": "0.070000000000000000", + "goal_bonded": "0.670000000000000000", + "blocks_per_year": "6311520" + } + }, + "params": null, + "slashing": { + "params": { + "signed_blocks_window": "100", + "min_signed_per_window": "0.500000000000000000", + "downtime_jail_duration": "600000000000", + "slash_fraction_double_sign": "0.050000000000000000", + "slash_fraction_downtime": "0.010000000000000000" + }, + "signing_infos": {}, + "missed_blocks": {} + }, + "staking": { + "params": { + "unbonding_time": "1814400000000000", + "max_validators": 100, + "max_entries": 7, + "historical_entries": 100, + "bond_denom": "ustake" + }, + "last_total_power": "0", + "last_validator_powers": null, + "validators": null, + "delegations": null, + "unbonding_delegations": null, + "redelegations": null + }, + "transfer": { + "port_id": "transfer" + }, "auth": { "params": { "max_memo_characters": "256", @@ -31,7 +75,7 @@ { "type": "cosmos-sdk/BaseAccount", "value": { - "address": "cosmos19wm6znlfdfwk8zvmfgwxjuw4mgyw2ml4lxx9p7" + "address": "cosmos1he567rx2zxylzp6tl7u7lstkcm7hut3cfv966s" } }, { @@ -138,40 +182,7 @@ } ] }, - "evidence": { - "evidence": [] - }, - "params": null, "upgrade": {}, - "slashing": { - "params": { - "signed_blocks_window": "100", - "min_signed_per_window": "0.500000000000000000", - "downtime_jail_duration": "600000000000", - "slash_fraction_double_sign": "0.050000000000000000", - "slash_fraction_downtime": "0.010000000000000000" - }, - "signing_infos": {}, - "missed_blocks": {} - }, - "capability": { - "index": "1", - "owners": [] - }, - "mint": { - "minter": { - "inflation": "0.130000000000000000", - "annual_provisions": "0.000000000000000000" - }, - "params": { - "mint_denom": "ustake", - "inflation_rate_change": "0.130000000000000000", - "inflation_max": "0.200000000000000000", - "inflation_min": "0.070000000000000000", - "goal_bonded": "0.670000000000000000", - "blocks_per_year": "6311520" - } - }, "ibc": { "client_genesis": { "clients": [], @@ -191,6 +202,53 @@ "ack_sequences": [] } }, + "gov": { + "starting_proposal_id": "1", + "deposits": null, + "votes": null, + "proposals": null, + "deposit_params": { + "min_deposit": [ + { + "denom": "ustake", + "amount": "10000000" + } + ], + "max_deposit_period": "172800000000000" + }, + "voting_params": { + "voting_period": "172800000000000" + }, + "tally_params": { + "quorum": "0.334000000000000000", + "threshold": "0.500000000000000000", + "veto": "0.334000000000000000" + } + }, + "distribution": { + "params": { + "community_tax": "0.020000000000000000", + "base_proposer_reward": "0.010000000000000000", + "bonus_proposer_reward": "0.040000000000000000", + "withdraw_addr_enabled": true + }, + "fee_pool": { + "community_pool": [] + }, + "delegator_withdraw_infos": [], + "outstanding_rewards": [], + "validator_accumulated_commissions": [], + "validator_historical_rewards": [], + "validator_current_rewards": [], + "delegator_starting_infos": [], + "validator_slash_events": [] + }, + "crisis": { + "constant_fee": { + "denom": "ustake", + "amount": "1000" + } + }, "genutil": { "gentxs": [ { @@ -201,7 +259,7 @@ "type": "cosmos-sdk/MsgCreateValidator", "value": { "description": { - "moniker": "testing" + "moniker": "simd-moniker" }, "commission": { "rate": "0.100000000000000000", @@ -209,9 +267,9 @@ "max_change_rate": "0.010000000000000000" }, "min_self_delegation": "1", - "delegator_address": "cosmos19wm6znlfdfwk8zvmfgwxjuw4mgyw2ml4lxx9p7", - "validator_address": "cosmosvaloper19wm6znlfdfwk8zvmfgwxjuw4mgyw2ml46jjsdd", - "pubkey": "cosmosvalconspub1zcjduepq97t76hzwgxnd6cj6tx6wuyv0d3llh8qr9uhdhdzjrurl5uvxjmcqhul8gk", + "delegator_address": "cosmos1he567rx2zxylzp6tl7u7lstkcm7hut3cfv966s", + "validator_address": "cosmosvaloper1he567rx2zxylzp6tl7u7lstkcm7hut3cvc30kr", + "pubkey": "cosmosvalconspub1zcjduepq2r9g6vm7ss5m6ae34xpp33w87glwnrf0480pwlt5tf445scc3dkqxmewyp", "value": { "denom": "ustake", "amount": "250000000" @@ -225,17 +283,19 @@ }, "signatures": [ { - "pub_key": "61rphyEDo5veugup1kp9T3NLAQiIk/eI21R0m82zpPRtj1y8GNQ=", - "signature": "QYjIsOmKs2aQAiEMFLd6X7viwHALp/lMonQi4wweMGU1lQGqztfV9xZncNXSJDljAqdj1BGjVxT9slAAaeMJgQ==" + "pub_key": "61rphyEDiRqk1Quo95zzOYnlLvQcUI09YZBXaxrst6RlfQuTyUI=", + "signature": "nA7GOLRiwa0XeVru59l4GuAxVgJEEYO1pFdszC9H1qxXn/5Lk0Pwq7SyMS7IsZcBReijt3MCkjzfBezTwEr6Ww==" } ], - "memo": "666829b87c30fe2c35ec3ad9d955fd4acabdda8f@172.17.0.2:26656" + "memo": "6dbcbfaca8ecb898784bacca9facf262b796e201@172.17.0.2:26656" } } ] }, "bank": { - "send_enabled": true, + "params": { + "default_send_enabled": true + }, "balances": [ { "address": "cosmos1pkptre7fdkl6gfrzlesjjvhxhlc3r4gmmk8rs6", @@ -250,19 +310,6 @@ } ] }, - { - "address": "cosmos19wm6znlfdfwk8zvmfgwxjuw4mgyw2ml4lxx9p7", - "coins": [ - { - "denom": "ucosm", - "amount": "1000000000" - }, - { - "denom": "ustake", - "amount": "1000000000" - } - ] - }, { "address": "cosmos1xy4yqngt0nlkdcenxymg8tenrghmek4nmqm28k", "coins": [ @@ -393,6 +440,19 @@ } ] }, + { + "address": "cosmos1he567rx2zxylzp6tl7u7lstkcm7hut3cfv966s", + "coins": [ + { + "denom": "ucosm", + "amount": "1000000000" + }, + { + "denom": "ustake", + "amount": "1000000000" + } + ] + }, { "address": "cosmos1cjsxept9rkggzxztslae9ndgpdyt2408lk850u", "coins": [ @@ -472,74 +532,15 @@ ] } ], - "supply": [] + "supply": [], + "denom_metadata": null }, - "transfer": { - "port_id": "transfer" + "capability": { + "index": "1", + "owners": [] }, - "gov": { - "starting_proposal_id": "1", - "deposits": null, - "votes": null, - "proposals": null, - "deposit_params": { - "min_deposit": [ - { - "denom": "ustake", - "amount": "10000000" - } - ], - "max_deposit_period": "172800000000000" - }, - "voting_params": { - "voting_period": "172800000000000" - }, - "tally_params": { - "quorum": "0.334000000000000000", - "threshold": "0.500000000000000000", - "veto": "0.334000000000000000" - } - }, - "distribution": { - "params": { - "community_tax": "0.020000000000000000", - "base_proposer_reward": "0.010000000000000000", - "bonus_proposer_reward": "0.040000000000000000", - "withdraw_addr_enabled": true - }, - "fee_pool": { - "community_pool": [] - }, - "delegator_withdraw_infos": [], - "previous_proposer": "", - "outstanding_rewards": [], - "validator_accumulated_commissions": [], - "validator_historical_rewards": [], - "validator_current_rewards": [], - "delegator_starting_infos": [], - "validator_slash_events": [] - }, - "crisis": { - "constant_fee": { - "denom": "ustake", - "amount": "1000" - } - }, - "staking": { - "params": { - "unbonding_time": "1814400000000000", - "max_validators": 100, - "max_entries": 7, - "historical_entries": 100, - "bond_denom": "ustake" - }, - "last_total_power": "0", - "last_validator_powers": null, - "validators": null, - "delegations": null, - "unbonding_delegations": null, - "redelegations": null, - "exported": false + "evidence": { + "evidence": [] } } } \ No newline at end of file diff --git a/scripts/simapp/template/.simapp/config/gentx/gentx-666829b87c30fe2c35ec3ad9d955fd4acabdda8f.json b/scripts/simapp/template/.simapp/config/gentx/gentx-666829b87c30fe2c35ec3ad9d955fd4acabdda8f.json deleted file mode 100644 index 53347d31..00000000 --- a/scripts/simapp/template/.simapp/config/gentx/gentx-666829b87c30fe2c35ec3ad9d955fd4acabdda8f.json +++ /dev/null @@ -1 +0,0 @@ -{"type":"cosmos-sdk/StdTx","value":{"msg":[{"type":"cosmos-sdk/MsgCreateValidator","value":{"description":{"moniker":"testing"},"commission":{"rate":"0.100000000000000000","max_rate":"0.200000000000000000","max_change_rate":"0.010000000000000000"},"min_self_delegation":"1","delegator_address":"cosmos19wm6znlfdfwk8zvmfgwxjuw4mgyw2ml4lxx9p7","validator_address":"cosmosvaloper19wm6znlfdfwk8zvmfgwxjuw4mgyw2ml46jjsdd","pubkey":"cosmosvalconspub1zcjduepq97t76hzwgxnd6cj6tx6wuyv0d3llh8qr9uhdhdzjrurl5uvxjmcqhul8gk","value":{"denom":"ustake","amount":"250000000"}}}],"fee":{"amount":[],"gas":"200000"},"signatures":[{"pub_key":"61rphyEDo5veugup1kp9T3NLAQiIk/eI21R0m82zpPRtj1y8GNQ=","signature":"QYjIsOmKs2aQAiEMFLd6X7viwHALp/lMonQi4wweMGU1lQGqztfV9xZncNXSJDljAqdj1BGjVxT9slAAaeMJgQ=="}],"memo":"666829b87c30fe2c35ec3ad9d955fd4acabdda8f@172.17.0.2:26656"}} diff --git a/scripts/simapp/template/.simapp/config/gentx/gentx-6dbcbfaca8ecb898784bacca9facf262b796e201.json b/scripts/simapp/template/.simapp/config/gentx/gentx-6dbcbfaca8ecb898784bacca9facf262b796e201.json new file mode 100644 index 00000000..0891ec2f --- /dev/null +++ b/scripts/simapp/template/.simapp/config/gentx/gentx-6dbcbfaca8ecb898784bacca9facf262b796e201.json @@ -0,0 +1 @@ +{"type":"cosmos-sdk/StdTx","value":{"msg":[{"type":"cosmos-sdk/MsgCreateValidator","value":{"description":{"moniker":"simd-moniker"},"commission":{"rate":"0.100000000000000000","max_rate":"0.200000000000000000","max_change_rate":"0.010000000000000000"},"min_self_delegation":"1","delegator_address":"cosmos1he567rx2zxylzp6tl7u7lstkcm7hut3cfv966s","validator_address":"cosmosvaloper1he567rx2zxylzp6tl7u7lstkcm7hut3cvc30kr","pubkey":"cosmosvalconspub1zcjduepq2r9g6vm7ss5m6ae34xpp33w87glwnrf0480pwlt5tf445scc3dkqxmewyp","value":{"denom":"ustake","amount":"250000000"}}}],"fee":{"amount":[],"gas":"200000"},"signatures":[{"pub_key":"61rphyEDiRqk1Quo95zzOYnlLvQcUI09YZBXaxrst6RlfQuTyUI=","signature":"nA7GOLRiwa0XeVru59l4GuAxVgJEEYO1pFdszC9H1qxXn/5Lk0Pwq7SyMS7IsZcBReijt3MCkjzfBezTwEr6Ww=="}],"memo":"6dbcbfaca8ecb898784bacca9facf262b796e201@172.17.0.2:26656"}} diff --git a/scripts/simapp/template/.simapp/config/node_key.json b/scripts/simapp/template/.simapp/config/node_key.json index 59b1f8eb..3e68a2f2 100644 --- a/scripts/simapp/template/.simapp/config/node_key.json +++ b/scripts/simapp/template/.simapp/config/node_key.json @@ -1 +1 @@ -{"priv_key":{"type":"tendermint/PrivKeyEd25519","value":"4nAO7LSVDv3A7aRFdKReCGFPG5bbn7N+HmOvD+yy5bD3n3CY+jsnSjhdzhp+Ei7XNS0AXNz6z/hjqq3gkPjbgQ=="}} \ No newline at end of file +{"priv_key":{"type":"tendermint/PrivKeyEd25519","value":"WG36bpfjSh8gy3HBWU4buv4sA6b8SrRa4Jj5sjo2CXyPRlP2d8Br7UNztMkUSomavPEZoUo2WzlzZ2XnyPi0rQ=="}} \ No newline at end of file diff --git a/scripts/simapp/template/.simapp/config/priv_validator_key.json b/scripts/simapp/template/.simapp/config/priv_validator_key.json index 5dec82c2..a28b53e4 100644 --- a/scripts/simapp/template/.simapp/config/priv_validator_key.json +++ b/scripts/simapp/template/.simapp/config/priv_validator_key.json @@ -1,11 +1,11 @@ { - "address": "440C0F8873E50FDB8DDEA8F836FBA828ACF221D6", + "address": "69EA0594C2B1320ABFC6EEE8B9BF421DA9FD9195", "pub_key": { "type": "tendermint/PubKeyEd25519", - "value": "L5ftXE5Bpt1iWlm07hGPbH/7nAMvLtu0Uh8H+nGGlvA=" + "value": "UMqNM36EKb13MamCGMXH8j7pjS+p3hd9dFprWkMYi2w=" }, "priv_key": { "type": "tendermint/PrivKeyEd25519", - "value": "RAznCBLeFaH1/OlbKzkB20pxTH+pv3LmC6mP6Pt2hM4vl+1cTkGm3WJaWbTuEY9sf/ucAy8u27RSHwf6cYaW8A==" + "value": "n8wH/j0kqdFfGVfvEbR1JVJeXps84BU+gNJ0kz+KJmFQyo0zfoQpvXcxqYIYxcfyPumNL6neF310WmtaQxiLbA==" } } \ No newline at end of file diff --git a/scripts/simapp/template/.simapp/data/.gitkeep b/scripts/simapp/template/.simapp/data/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/scripts/simapp/template/.simapp/data/priv_validator_state.json b/scripts/simapp/template/.simapp/data/priv_validator_state.json new file mode 100644 index 00000000..ca3ad2f7 --- /dev/null +++ b/scripts/simapp/template/.simapp/data/priv_validator_state.json @@ -0,0 +1,5 @@ +{ + "height": "0", + "round": "0", + "step": 0 +} \ No newline at end of file diff --git a/scripts/simapp/template/.simapp/keyhash b/scripts/simapp/template/.simapp/keyhash index 0dcb5b5c..977be397 100755 --- a/scripts/simapp/template/.simapp/keyhash +++ b/scripts/simapp/template/.simapp/keyhash @@ -1 +1 @@ -$2a$10$2AeLq0go9NVRoA5qsAyTUuBOfVILtn2ZqqYcwx8uuummZAMPa2wt. \ No newline at end of file +$2a$10$0haA89aJOZcjF4Vqcx99jeXOoDDnYym3wvGNHxxBdfoDOhvXdjumu \ No newline at end of file diff --git a/scripts/simapp/template/.simapp/validator.info b/scripts/simapp/template/.simapp/validator.info index 34b4f3ad..92d91fb4 100644 --- a/scripts/simapp/template/.simapp/validator.info +++ b/scripts/simapp/template/.simapp/validator.info @@ -1 +1 @@ -eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjcmVhdGVkIjoiMjAyMC0wNy0wMiAxMjowNzoyMy4xNzQ5Nzc4NjMgKzAwMDAgVVRDIG09KzAuMTc3MzMyNDA0IiwiZW5jIjoiQTI1NkdDTSIsInAyYyI6ODE5MiwicDJzIjoicFBxLVd0emZtTGFISHRLNCJ9.hcGBhR2s8TUx0gx_4nkafYHdpp4dTNyIFq9Yuncd_wRE6jY01EcxmA.GA-GnezDkH3vxfGe.Qf1TGdR-mJkct-MLbjPTekI9xzIBpuetY81gx7ifVT5NxptOHDoT4y8lUi96rbOH6wkgI3xYzBg9ieIKFz4-mpSqSOrdwbM4wSy_mOZLLqVE05x2ld3ggSRqFhOVlq2WLydqxEgZQIlXjXRuYq5iEvB1N977bZa8QW6Rs2-8-ZjApboNxp0hkZVyanAXMF70yc0kt3HW_vFfLBbI4xKe9ENAzDhDZvNkK8bpqBJtPIL-HMoD71UYa8z58XN7HKvtozmuqYhU9iRlU6pRTov0HzvepWEFuQaVPo1yXHpmNwwF-8fP03H1wMJ_wTVuLOEjIC-PnvZuEk9KOIm9QFnIXQmw_kaTLSVb1qXfq83F-Hf-Mt4w.pmuxyqelY9tPbPDErVEjAg \ No newline at end of file +eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjcmVhdGVkIjoiMjAyMC0wNy0yOSAxMjozMzo0My4yNTA3MTQxICswMDAwIFVUQyBtPSswLjM5ODMzOTYwMSIsImVuYyI6IkEyNTZHQ00iLCJwMmMiOjgxOTIsInAycyI6ImJUWEFGbmd6dlpGU0xIdUgifQ.OblR71PYvd-hM-i-umBX-8Rufz8oDYhC0YBf_NS8VjM8r_D0Dkg2Mg.ll8r6qH1V9srND3w.skQG_BTTBvr6lbxD5qQAqumjRk0Hpp160lCLaIhf0vJ0rmd93p66HmfxQd3ZLCODuPz_XRUefmrIlw6k5b0jYjvcb9qEKJxb2emDNd_8lRp4v5Z6SpeLNMpGRjP0_cDtaCUlYb-yuJ-aebAK_ftwr6kWgB8fJkdMhVRrTdsNjPxk-o9q9IWT_7aWvlnbjdXBi-IwKqZE-mqLxR3HnF2m5K4NnnW9EMzLZM3B_LoLjEGnnSl5IYVaGy-LC1EbINPbj2DDetxUj7atXwY3GJOsIU0VX26NdNHKvv29UWkGdg8vgJlvhKX0-_GFIKP3L_a6S6klnAngowlQPvYIXOq8AX8chk47yUmGeREmFcrZKFfyfF5Z.gu6X671jqogyqHOoHiKnxQ \ No newline at end of file diff --git a/scripts/simapp/template/run_simd.sh b/scripts/simapp/template/run_simd.sh index 7a66bbbb..3264dacc 100755 --- a/scripts/simapp/template/run_simd.sh +++ b/scripts/simapp/template/run_simd.sh @@ -2,6 +2,6 @@ set -o errexit -o nounset -o pipefail command -v shellcheck > /dev/null && shellcheck "$0" +cp -R "/template/.simapp" /root mkdir -p /root/log - simd start --rpc.laddr tcp://0.0.0.0:26657 --trace diff --git a/scripts/simapp/template/setup.sh b/scripts/simapp/template/setup.sh index d274693c..6d61efb0 100755 --- a/scripts/simapp/template/setup.sh +++ b/scripts/simapp/template/setup.sh @@ -5,21 +5,28 @@ command -v shellcheck > /dev/null && shellcheck "$0" PASSWORD=${PASSWORD:-1234567890} STAKE=${STAKE_TOKEN:-ustake} FEE=${FEE_TOKEN:-ucosm} -CHAIN_ID=${CHAIN_ID:-testing} +CHAIN_ID=${CHAIN_ID:-simd-testing} +MONIKER=${MONIKER:-simd-moniker} -simd init --chain-id="$CHAIN_ID" "$CHAIN_ID" -# staking/governance token is hardcoded in config, change this -sed -i "s/\"stake\"/\"$STAKE\"/" "$HOME"/.simapp/config/genesis.json -if ! simcli keys show validator; then - (echo "$PASSWORD"; echo "$PASSWORD") | simcli keys add validator +echo "Creating genesis ..." +simd init --chain-id "$CHAIN_ID" "$MONIKER" +sed -i "s/\"stake\"/\"$STAKE\"/" "$HOME"/.simapp/config/genesis.json # staking/governance token is hardcoded in config, change this + +echo "Setting up validator ..." +if ! simd keys show validator; then + echo "Validator does not yet exist. Creating it ..." + (echo "$PASSWORD"; echo "$PASSWORD") | simd keys add validator fi # hardcode the validator account for this instance echo "$PASSWORD" | simd add-genesis-account validator "1000000000$STAKE,1000000000$FEE" + +echo "Setting up accounts ..." # (optionally) add a few more genesis accounts for addr in "$@"; do echo $addr simd add-genesis-account "$addr" "1000000000$STAKE,1000000000$FEE" done -# submit a genesis validator tx -(echo "$PASSWORD"; echo "$PASSWORD"; echo "$PASSWORD") | simd gentx --name validator --amount "250000000$STAKE" + +echo "Creating genesis tx ..." +(echo "$PASSWORD"; echo "$PASSWORD"; echo "$PASSWORD") | simd gentx validator --amount "250000000$STAKE" --chain-id "$CHAIN_ID" simd collect-gentxs diff --git a/scripts/wasmd/start.sh b/scripts/wasmd/start.sh index 06223a77..0d540321 100755 --- a/scripts/wasmd/start.sh +++ b/scripts/wasmd/start.sh @@ -2,27 +2,28 @@ set -o errexit -o nounset -o pipefail command -v shellcheck > /dev/null && shellcheck "$0" -REST_PORT_GUEST="1317" -REST_PORT_HOST="1317" +LCD_API_PORT_GUEST="1317" +LCD_API_PORT_HOST="1317" +# Tendermint port (26657) and p2p port (26656) are not exposed since we don't need them for testing + SCRIPT_DIR="$(realpath "$(dirname "$0")")" # shellcheck source=./env # shellcheck disable=SC1091 source "$SCRIPT_DIR"/env -echo "$CONTAINER_NAME" - -TMP_DIR=$(mktemp -d "${TMPDIR:-/tmp}/gaia.XXXXXXXXX") +TMP_DIR=$(mktemp -d "${TMPDIR:-/tmp}/wasmd.XXXXXXXXX") chmod 777 "$TMP_DIR" echo "Using temporary dir $TMP_DIR" WASMD_LOGFILE="$TMP_DIR/wasmd.log" REST_SERVER_LOGFILE="$TMP_DIR/rest-server.log" -# This starts up wasmd -# The Tendermint port (26657) and the p2p port (26656) are not exposed since we don't need for testing +# Use a fresh volume for every start docker volume rm -f wasmd_data + +# This starts up wasmd docker run --rm \ --name "$CONTAINER_NAME" \ - -p "$REST_PORT_HOST":"$REST_PORT_GUEST" \ + -p "$LCD_API_PORT_HOST":"$LCD_API_PORT_GUEST" \ --mount type=bind,source="$SCRIPT_DIR/template",target=/template \ --mount type=volume,source=wasmd_data,target=/root \ "$REPOSITORY:$VERSION" \ @@ -48,10 +49,10 @@ docker exec "$CONTAINER_NAME" \ --node tcp://localhost:26657 \ --trust-node \ --unsafe-cors \ - --laddr "tcp://0.0.0.0:$REST_PORT_GUEST" \ + --laddr "tcp://0.0.0.0:$LCD_API_PORT_GUEST" \ > "$REST_SERVER_LOGFILE" & -echo "rest server running on http://localhost:$REST_PORT_HOST and logging into $REST_SERVER_LOGFILE" +echo "rest server running on http://localhost:$LCD_API_PORT_HOST and logging into $REST_SERVER_LOGFILE" # Give REST server some time to come alive. No idea why this helps. Needed for CI. if [ -n "${CI:-}" ]; then