Skip to content

Commit

Permalink
testnet deploy script
Browse files Browse the repository at this point in the history
  • Loading branch information
faboweb committed Nov 16, 2023
1 parent f79d047 commit 8bfb2dd
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions deploy/init_stake_contract_testnet.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
docker run --rm -v "$(pwd)":/code \
--mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target \
--mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
cosmwasm/workspace-optimizer-arm64:0.14.0

# cargo install --git https://github.com/cmoog/bech32

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)
CODE_ID=$(echo $RES | jq -r '.raw_log | fromjson | .[0].events[] | select(.type == "store_code") | .attributes[] | select(.key == "code_id") | .value')
ADMIN_OSMOSIS=osmo1sfhy3emrgp26wnzuu64p06kpkxd9phel8ym0ge
ADMIN_CELESTIA=celestia1sfhy3emrgp26wnzuu64p06kpkxd9phel74e0yx

CHANNEL_CELESTIA=channel-25
CHANNEL=channel-4370

# token depends on channel it was send over
# find the token by sending it to you and then reading it
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
osmosisd query bank balances osmo1sfhy3emrgp26wnzuu64p06kpkxd9phel8ym0ge --node https://rpc.testnet.osmosis.zone:443

RESERVE_TOKEN="ibc/0E22FFB61DB307FE01D3D0DFF4A8EBEB6CC4997DCF9E901AE0751A2FFF4B90DD"
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)
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)
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)
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\"}
RES=$(osmosisd tx wasm instantiate $CODE_ID $INIT \
--from test_master --label "milkyway test" -y \
--admin "$ADMIN_OSMOSIS" --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 --output json)
CONTRACT=$(echo $RES | jq -r '.raw_log | fromjson | .[0].events[] | select(.type == "instantiate") | .attributes[] | select(.key == "_contract_address") | .value')
echo $CONTRACT

# current deployment
# osmo1tcmdquceeen0wzye5y5mmctye70gx7mkr6027drzg4xdaphf98ps9rlrw0

0 comments on commit 8bfb2dd

Please sign in to comment.