Skip to content

Commit 8bfb2dd

Browse files
committed
testnet deploy script
1 parent f79d047 commit 8bfb2dd

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

deploy/init_stake_contract_testnet.sh

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
docker run --rm -v "$(pwd)":/code \
2+
--mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target \
3+
--mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
4+
cosmwasm/workspace-optimizer-arm64:0.14.0
5+
6+
# cargo install --git https://github.com/cmoog/bech32
7+
8+
RES=$(osmosisd tx wasm store ./artifacts/staking-aarch64.wasm --from test_master --output json --node https://rpc.testnet.osmosis.zone:443 -y -b block --gas-prices 0.025uosmo --gas-adjustment 1.7 --gas auto --chain-id osmo-test-5)
9+
CODE_ID=$(echo $RES | jq -r '.raw_log | fromjson | .[0].events[] | select(.type == "store_code") | .attributes[] | select(.key == "code_id") | .value')
10+
ADMIN_OSMOSIS=osmo1sfhy3emrgp26wnzuu64p06kpkxd9phel8ym0ge
11+
ADMIN_CELESTIA=celestia1sfhy3emrgp26wnzuu64p06kpkxd9phel74e0yx
12+
13+
CHANNEL_CELESTIA=channel-25
14+
CHANNEL=channel-4370
15+
16+
# token depends on channel it was send over
17+
# find the token by sending it to you and then reading it
18+
celestia-appd tx ibc-transfer transfer transfer $CHANNEL_CELESTIA --from test_master --node https://rpc.celestia-mocha.com:443 --chain-id mocha-4 osmo1sfhy3emrgp26wnzuu64p06kpkxd9phel8ym0ge 1utia --fees 21000utia -y
19+
osmosisd query bank balances osmo1sfhy3emrgp26wnzuu64p06kpkxd9phel8ym0ge --node https://rpc.testnet.osmosis.zone:443
20+
21+
RESERVE_TOKEN="ibc/0E22FFB61DB307FE01D3D0DFF4A8EBEB6CC4997DCF9E901AE0751A2FFF4B90DD"
22+
CELESTIA_VALIDATOR_1=$(celestia-appd query staking validators --node https://rpc.celestia-mocha.com:443 --output json | jq -r '.validators | map(.operator_address) | join(",")' | cut -d',' -f1 | bech32 --decode | bech32 --prefix celestia)
23+
CELESTIA_VALIDATOR_2=$(celestia-appd query staking validators --node https://rpc.celestia-mocha.com:443 --output json | jq -r '.validators | map(.operator_address) | join(",")' | cut -d',' -f2 | bech32 --decode | bech32 --prefix celestia)
24+
CELESTIA_VALIDATOR_3=$(celestia-appd query staking validators --node https://rpc.celestia-mocha.com:443 --output json | jq -r '.validators | map(.operator_address) | join(",")' | cut -d',' -f3 | bech32 --decode | bech32 --prefix celestia)
25+
INIT={\"native_token_denom\":\"$RESERVE_TOKEN\",\"liquid_stake_token_denom\":\"stTIA\",\"treasury_address\":\"$ADMIN_OSMOSIS\",\"node_operators\":[\"$ADMIN_OSMOSIS\"],\"validators\":[\"$CELESTIA_VALIDATOR_1\",\"$CELESTIA_VALIDATOR_2\",\"$CELESTIA_VALIDATOR_3\"],\"batch_period\":86400,\"unbonding_period\":1209600,\"protocol_fee_config\":{\"dao_treasury_fee\":\"10\"},\"multisig_address_config\":{\"controller_address\":\"$ADMIN_CELESTIA\",\"staker_address\":\"$ADMIN_CELESTIA\",\"reward_collector_address\":\"$ADMIN_CELESTIA\"},\"minimum_liquid_stake_amount\":\"100\",\"minimum_rewards_to_collect\":\"10\",\"ibc_channel_id\":\"$CHANNEL\"}
26+
RES=$(osmosisd tx wasm instantiate $CODE_ID $INIT \
27+
--from test_master --label "milkyway test" -y \
28+
--admin "$ADMIN_OSMOSIS" --node https://rpc.testnet.osmosis.zone:443 -y -b block \
29+
--gas-prices 0.025uosmo --gas-adjustment 1.7 --gas auto \
30+
--chain-id osmo-test-5 --output json)
31+
CONTRACT=$(echo $RES | jq -r '.raw_log | fromjson | .[0].events[] | select(.type == "instantiate") | .attributes[] | select(.key == "_contract_address") | .value')
32+
echo $CONTRACT
33+
34+
# current deployment
35+
# osmo1tcmdquceeen0wzye5y5mmctye70gx7mkr6027drzg4xdaphf98ps9rlrw0

0 commit comments

Comments
 (0)