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

Stable block headers in ci #100

Merged
merged 4 commits into from
Mar 10, 2021
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions scripts/simapp/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ 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
sed -i "s/\"port_id\": *\"transfer\"/\"port_id\": \"$TRANSFER_PORT\"/" "$HOME"/.simapp/config/genesis.json # allow custom ibc transfer port
# this is essential for sub-1s block times (or header times go crazy)
sed -i 's/"time_iota_ms": "1000"/"time_iota_ms": "10"/' "$HOME"/.simapp/config/genesis.json

echo "Setting up validator ..."
if ! simd keys show validator 2>/dev/null; then
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjcmVhdGVkIjoiMjAyMS0wMy0xMCAxNTozNTozOS45NDU5NjcwMDkgKzAwMDAgVVRDIG09KzAuMDk0MzUwNjQzIiwiZW5jIjoiQTI1NkdDTSIsInAyYyI6ODE5MiwicDJzIjoiOE1ENkJqLS15Qk9FSEJuXyJ9.WuJqyfG5VB98XESmeAAd7Qe4frsztVuuSoH5DW8Ui6dOdx2G2rrACw.kRzQVEC3Ob5chLSR.aDu11cwxY86tdg_AygsylzqYp6iRNxnovBtcITdzMU0D3z0SaOkjgfzxFceplC_vn21VsqFQ-vriW8Z8RQ4xT3Vueegef-DpfhwMkIGd0JsaqlGaC3wd8robkKjOirSY0u7AhjqRFtKNhoOy9wmJaxWIbjduMN9OH48NqzxM8IqjdXllojurwwjJet-mv5BUulxd-MenX9_1UXfJD_chInVrE1ylMLFGR5xrsRJ6pt8MjoqI2fNeH_2z.eG5pKBrkHy8OO91Aj793Bw
32 changes: 16 additions & 16 deletions scripts/simapp/template/.simapp/config/genesis.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{
"@type": "/cosmos.auth.v1beta1.BaseAccount",
"account_number": "0",
"address": "cosmos1xehnmu6e0d6lf6xuacjclg9swypzespzef9stv",
"address": "cosmos1k0utpaq7kvm0fgrs6xvj4vgh2gq9vvhzl4rg7p",
"pub_key": null,
"sequence": "0"
},
Expand Down Expand Up @@ -180,7 +180,7 @@
]
},
{
"address": "cosmos1xehnmu6e0d6lf6xuacjclg9swypzespzef9stv",
"address": "cosmos1f7j7ryulwjfe9ljplvhtcaxa6wqgula3etktce",
"coins": [
{
"amount": "1000000000",
Expand All @@ -193,7 +193,7 @@
]
},
{
"address": "cosmos1f7j7ryulwjfe9ljplvhtcaxa6wqgula3etktce",
"address": "cosmos1vkv9sfwaak76weyamqx0flmng2vuquxqcuqukh",
"coins": [
{
"amount": "1000000000",
Expand All @@ -206,7 +206,7 @@
]
},
{
"address": "cosmos1vkv9sfwaak76weyamqx0flmng2vuquxqcuqukh",
"address": "cosmos10dyr9899g6t0pelew4nvf4j5c3jcgv0r73qga5",
"coins": [
{
"amount": "1000000000",
Expand All @@ -219,7 +219,7 @@
]
},
{
"address": "cosmos10dyr9899g6t0pelew4nvf4j5c3jcgv0r73qga5",
"address": "cosmos106jwym4s9aujcmes26myzzwqsccw09sdm0v5au",
"coins": [
{
"amount": "1000000000",
Expand All @@ -232,7 +232,7 @@
]
},
{
"address": "cosmos106jwym4s9aujcmes26myzzwqsccw09sdm0v5au",
"address": "cosmos14qemq0vw6y3gc3u3e0aty2e764u4gs5le3hada",
"coins": [
{
"amount": "1000000000",
Expand All @@ -245,7 +245,7 @@
]
},
{
"address": "cosmos14qemq0vw6y3gc3u3e0aty2e764u4gs5le3hada",
"address": "cosmos142u9fgcjdlycfcez3lw8x6x5h7rfjlnfhpw2lx",
"coins": [
{
"amount": "1000000000",
Expand All @@ -258,7 +258,7 @@
]
},
{
"address": "cosmos142u9fgcjdlycfcez3lw8x6x5h7rfjlnfhpw2lx",
"address": "cosmos1k0utpaq7kvm0fgrs6xvj4vgh2gq9vvhzl4rg7p",
"coins": [
{
"amount": "1000000000",
Expand Down Expand Up @@ -442,15 +442,15 @@
},
"public_key": {
"@type": "/cosmos.crypto.secp256k1.PubKey",
"key": "AhzV+8QSxROnzLCSt1m1UJFKVDd0WQDnuuEG7SDcUZeG"
"key": "A8zRRptdU4iURW4V9ZT4NdlHmrAjBGCInbBE/v4C03Cu"
},
"sequence": "0"
}
]
},
"body": {
"extension_options": [],
"memo": "d39b635fce85d35c65813a6899c375e2efdd8212@172.17.0.2:26656",
"memo": "55709ce4b190d810f266c2ab07ce99a8883b846f@172.17.0.2:26656",
"messages": [
{
"@type": "/cosmos.staking.v1beta1.MsgCreateValidator",
Expand All @@ -459,7 +459,7 @@
"max_rate": "0.200000000000000000",
"rate": "0.100000000000000000"
},
"delegator_address": "cosmos1xehnmu6e0d6lf6xuacjclg9swypzespzef9stv",
"delegator_address": "cosmos1k0utpaq7kvm0fgrs6xvj4vgh2gq9vvhzl4rg7p",
"description": {
"details": "",
"identity": "",
Expand All @@ -470,9 +470,9 @@
"min_self_delegation": "1",
"pubkey": {
"@type": "/cosmos.crypto.ed25519.PubKey",
"key": "QNZE8wAsI9mHP3QEBga9AZ4wuehdjIgzdnDEDv5gmR0="
"key": "TP4DgQaFWjKKxp+DFkvoA89VXdk9E/CBO9g16Pc+fsA="
},
"validator_address": "cosmosvaloper1xehnmu6e0d6lf6xuacjclg9swypzespzua398l",
"validator_address": "cosmosvaloper1k0utpaq7kvm0fgrs6xvj4vgh2gq9vvhz6phajj",
"value": {
"amount": "3000000",
"denom": "ustake"
Expand All @@ -483,7 +483,7 @@
"timeout_height": "0"
},
"signatures": [
"lk/lTmxdDR2OqbgoxkrPy4QYkzyN+++3G9a1lyJquSk/uoWAi8gi4rxAv3Y3ILkqvEIbpS1/bLE48eOtNYiVKw=="
"w4uHdKCyWX0v9kT5+4aLp6X91X3lhNe47IxcwZGC0CURg3Gr10YNjpC6uddXvkpP3RmWhdvM7mvsuoo3G525NA=="
]
}
]
Expand Down Expand Up @@ -599,7 +599,7 @@
"block": {
"max_bytes": "22020096",
"max_gas": "-1",
"time_iota_ms": "1000"
"time_iota_ms": "10"
},
"evidence": {
"max_age_duration": "172800000000000",
Expand All @@ -613,6 +613,6 @@
},
"version": {}
},
"genesis_time": "2021-03-08T14:34:34.046341871Z",
"genesis_time": "2021-03-10T15:35:39.799454492Z",
"initial_height": "1"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"body":{"messages":[{"@type":"/cosmos.staking.v1beta1.MsgCreateValidator","description":{"moniker":"simd-moniker","identity":"","website":"","security_contact":"","details":""},"commission":{"rate":"0.100000000000000000","max_rate":"0.200000000000000000","max_change_rate":"0.010000000000000000"},"min_self_delegation":"1","delegator_address":"cosmos1k0utpaq7kvm0fgrs6xvj4vgh2gq9vvhzl4rg7p","validator_address":"cosmosvaloper1k0utpaq7kvm0fgrs6xvj4vgh2gq9vvhz6phajj","pubkey":{"@type":"/cosmos.crypto.ed25519.PubKey","key":"TP4DgQaFWjKKxp+DFkvoA89VXdk9E/CBO9g16Pc+fsA="},"value":{"denom":"ustake","amount":"3000000"}}],"memo":"55709ce4b190d810f266c2ab07ce99a8883b846f@172.17.0.2:26656","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[{"public_key":{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"A8zRRptdU4iURW4V9ZT4NdlHmrAjBGCInbBE/v4C03Cu"},"mode_info":{"single":{"mode":"SIGN_MODE_DIRECT"}},"sequence":"0"}],"fee":{"amount":[],"gas_limit":"200000","payer":"","granter":""}},"signatures":["w4uHdKCyWX0v9kT5+4aLp6X91X3lhNe47IxcwZGC0CURg3Gr10YNjpC6uddXvkpP3RmWhdvM7mvsuoo3G525NA=="]}

This file was deleted.

2 changes: 1 addition & 1 deletion scripts/simapp/template/.simapp/config/node_key.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"priv_key":{"type":"tendermint/PrivKeyEd25519","value":"TRFjcA/FLd+DfnB+cyS5cB+cgP37AnDVjIQc6H7KX1L8AofJlXA4H5GIcNaMd43cAxYwZOR8TjYRM3RFi1X5/Q=="}}
{"priv_key":{"type":"tendermint/PrivKeyEd25519","value":"SlaMxwrURsTgt1npmAVf89+2cX2+OmgaaTMJmA4YbMzg5jn12CvQ1CcvoQRjcUsW/ma/xVSZbOd7OrRCjOMy0Q=="}}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"address": "0662C4AFEC30214207EB9E8198902C8164476440",
"address": "DA9FE299B5ED6AB145DB1DE192C4D4A920E03C1D",
"pub_key": {
"type": "tendermint/PubKeyEd25519",
"value": "QNZE8wAsI9mHP3QEBga9AZ4wuehdjIgzdnDEDv5gmR0="
"value": "TP4DgQaFWjKKxp+DFkvoA89VXdk9E/CBO9g16Pc+fsA="
},
"priv_key": {
"type": "tendermint/PrivKeyEd25519",
"value": "CN1o3NQb42cbxL1ofNPyQ8Op9qnbeFX+3CBFWxbswAlA1kTzACwj2Yc/dAQGBr0BnjC56F2MiDN2cMQO/mCZHQ=="
"value": "V5p6K3kYrM+ZJ1Qwu9lyn5Bvx5fuYAfXCpr+uDMcQVFM/gOBBoVaMorGn4MWS+gDz1Vd2T0T8IE72DXo9z5+wA=="
}
}
2 changes: 1 addition & 1 deletion scripts/simapp/template/.simapp/keyhash
Original file line number Diff line number Diff line change
@@ -1 +1 @@
$2a$10$Yj6qu35kxkIeNO0p1lcG5Obj..fe9mvp5VgD2Q3galiX/PvOkzHW.
$2a$10$F4jP.tpLb2nc0FWuO8KX1e6kL2.iZrZV4lwgilCl/rUOSpPk7ZyyS
2 changes: 1 addition & 1 deletion scripts/simapp/template/.simapp/validator.info
Original file line number Diff line number Diff line change
@@ -1 +1 @@
eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjcmVhdGVkIjoiMjAyMS0wMy0wOCAxNDozNDozNC4yMDY3OTgzMzcgKzAwMDAgVVRDIG09KzAuMTAyNjgzODgwIiwiZW5jIjoiQTI1NkdDTSIsInAyYyI6ODE5MiwicDJzIjoiaTJiYm44aHRseVN0ck9xVyJ9.0UpcXTMfvSxjtcVv3I11o2D7jdo3oMlhXeSv4mZEXvpRWOs62PV6_g.FkDgJ_PIUCHy_LYt.-wColJPADEsjQ9mFnhG0Sln_5ULSMK0W9CBilhfYl1BCEHf3G0hLsV4bXIs6AHMn9C84OLhclUdp_UVf9v5Qgs8K8Hea8mSjyYIrbwkJAJ03V3ZXPmY7Ce8aWs1RtsmLUOEJXGPtfa96gvGtjuMU6dLyLanu_B6ygUzjnc0-smv9DSw-aHr3wWnZLe8KGNLbx7oJOPTbR-FWwip2teowMDLNfz5iXI16qQg1crmgNLLr2Mu674odletqNCeYOFY5C4vXSCR-PuuAZB4rttrp75llc6MIn9FA_MTnvrjWiv5zxuxqcKHWFh-ccCbT-py832Wfn5dPkr32lzRV2iehE49EQanDFH-EAeitJzOpcP4Au4hF.4ES5oMCnxte0ElojzjYDxg
eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjcmVhdGVkIjoiMjAyMS0wMy0xMCAxNTozNTozOS45NDE4ODg0MzEgKzAwMDAgVVRDIG09KzAuMDkwMjcyMDg1IiwiZW5jIjoiQTI1NkdDTSIsInAyYyI6ODE5MiwicDJzIjoiT3d3Rm5hbU9xMnB4RVhEUiJ9.0o_Je_yulaEEdml1n1TlnzcEwu52A7DJ3FvQPZ5_FhYWmgIP41CzQw.yL9ugvLKh4jUxR22.dEM-c_XPFpCoZQ0yEi_W4q7maewYdX_r4DSm_MgfkALvIPkTA4Krtkrdu8WG6POKjL2x4sfVMeMbOqmXbaP3QETlkC7z8Ld4o_PyAgd9-WA-W53QJEp4HYr8pFkJp3ENuxQRr5QzpnxloK6CQ5F2Tyd71Zv9xkER0XKksydVoTvd-4bp3KSf2xaXQdLrJqMtpwS0vHZ-FfBW3VCTEa7rPaFdzMQI6KNiS2uNNyRaWxZLHkLxWk_mEGjNf-6MFoTAf2iwb5E2TiRvC1FhUSY47Cx_mzrrOgj5KOjeLATht7Cc6UNGP5jjpLgwtzX6iz86pSX7GQbMmH-07yOUm4Y-2Wrjf4jo28fQTG0e3aVdbfunXP5d.mQqpr04f2hGJEXaGR6pZVg
2 changes: 2 additions & 0 deletions scripts/simapp/template/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ 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
sed -i "s/\"port_id\": *\"transfer\"/\"port_id\": \"$TRANSFER_PORT\"/" "$HOME"/.simapp/config/genesis.json # allow custom ibc transfer port
# this is essential for sub-1s block times (or header times go crazy)
sed -i 's/"time_iota_ms": "1000"/"time_iota_ms": "10"/' "$HOME"/.simapp/config/genesis.json

echo "Setting up validator ..."
if ! simd keys show validator 2>/dev/null; then
Expand Down
6 changes: 5 additions & 1 deletion scripts/wasmd/generate_template.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,17 @@ mkdir "$SCRIPT_DIR/template"

export CHAIN_ID=wasmd-1

# TODO: go back to just using ./setup_wasmd.sh and not mounting scripts dir
# once https://github.com/CosmWasm/wasmd/pull/453 is merged and in our CI image

# The usage of the accounts below is documented in README.md of this directory
docker run --rm \
-e PASSWORD=my-secret-password \
-e CHAIN_ID \
--mount type=bind,source="$SCRIPT_DIR/template",target=/root \
--mount type=bind,source="$SCRIPT_DIR/scripts/setup_wasmd.sh",target=/opt/setup_wasmd.sh \
"$REPOSITORY:$VERSION" \
./setup_wasmd.sh \
/opt/setup_wasmd.sh \
wasm1pkptre7fdkl6gfrzlesjjvhxhlc3r4gm32kke3 wasm10dyr9899g6t0pelew4nvf4j5c3jcgv0r5d3a5l wasm1xy4yqngt0nlkdcenxymg8tenrghmek4n3u2lwa wasm142u9fgcjdlycfcez3lw8x6x5h7rfjlnfaallkd wasm1hsm76p4ahyhl5yh3ve9ur49r5kemhp2r93f89d \
wasm14qemq0vw6y3gc3u3e0aty2e764u4gs5lndxgyk wasm1hhg2rlu9jscacku2wwckws7932qqqu8xm5ca8y wasm1xv9tklw7d82sezh9haa573wufgy59vmwnxhnsl wasm17yg9mssjenmc3jkqth6ulcwj9cxujrxxg9nmzk wasm1f7j7ryulwjfe9ljplvhtcaxa6wqgula3nh873j \
wasm1lvrwcvrqlc5ktzp2c4t22xgkx29q3y83426at5 wasm1vkv9sfwaak76weyamqx0flmng2vuquxqjq3flu wasm106jwym4s9aujcmes26myzzwqsccw09sd3nap5h wasm1c7wpeen2uv8thayf7g8q2rgpm29clj0dzlu7t9 wasm1mjxpv9ft30wer7ma7kwfxhm42l379xuttrjcl3 \
Expand Down
33 changes: 33 additions & 0 deletions scripts/wasmd/scripts/setup_wasmd.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/sh
#set -o errexit -o nounset -o pipefail

PASSWORD=${PASSWORD:-1234567890}
STAKE=${STAKE_TOKEN:-ustake}
FEE=${FEE_TOKEN:-ucosm}
CHAIN_ID=${CHAIN_ID:-testing}
MONIKER=${MONIKER:-node001}

wasmd init --chain-id "$CHAIN_ID" "$MONIKER"
# staking/governance token is hardcoded in config, change this
sed -i "s/\"stake\"/\"$STAKE\"/" "$HOME"/.wasmd/config/genesis.json
# this is essential for sub-1s block times (or header times go crazy)
sed -i 's/"time_iota_ms": "1000"/"time_iota_ms": "10"/' "$HOME"/.wasmd/config/genesis.json

if ! wasmd keys show validator; then
(echo "$PASSWORD"; echo "$PASSWORD") | wasmd keys add validator
fi
# hardcode the validator account for this instance
echo "$PASSWORD" | wasmd add-genesis-account validator "1000000000$STAKE,1000000000$FEE"

# (optionally) add a few more genesis accounts
for addr in "$@"; do
echo $addr
wasmd add-genesis-account "$addr" "1000000000$STAKE,1000000000$FEE"
done

# submit a genesis validator tx
## Workraround for https://github.com/cosmos/cosmos-sdk/issues/8251
(echo "$PASSWORD"; echo "$PASSWORD"; echo "$PASSWORD") | wasmd gentx validator "250000000$STAKE" --chain-id="$CHAIN_ID" --amount="250000000$STAKE"
## should be:
# (echo "$PASSWORD"; echo "$PASSWORD"; echo "$PASSWORD") | wasmd gentx validator "250000000$STAKE" --chain-id="$CHAIN_ID"
wasmd collect-gentxs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
eyJhbGciOiJQQkVTMi1IUzI1NitBMTI4S1ciLCJjcmVhdGVkIjoiMjAyMS0wMy0xMCAxNTo1NDo1My45NDQ5OTQyMTEgKzAwMDAgVVRDIG09KzAuMDk0ODY5MTU1IiwiZW5jIjoiQTI1NkdDTSIsInAyYyI6ODE5MiwicDJzIjoiRGd5cUxsMXlUbnIxVTE0QSJ9.HrC0vdXsaG09MLmPanGGh4OjwWeN_Z8LYdD13_gIlgtHAErkq-BNmQ.SLcgh1o1JYlC4Wox.6MD_HwIH5ber5XVdsdbKXyOhwR8g47PKbA4BhZ8F2kAQ73rdcadHf8tMrw9E2q_Fx_sDIn58Fxx3VrRAhrDZ7dyWBMk3Hi828Fn495Z6jzQkOrpE7c0hV8tZPZ9ocVEO_raynE0hAE8Y2tEVpqQr6MpRC-sNNf8pN2fBFp8R8fS3dJNC-Be9LFts0fB5eV-dJ40p5r7VfMArZLeum6EDfLY27eXuCvKDmgmJgyHYq48fkCcxiybtD84e.mLBRNAGl1HHcnVJ-PRaFUA

This file was deleted.

Loading