Skip to content

Commit

Permalink
add script
Browse files Browse the repository at this point in the history
  • Loading branch information
hoank101 committed Apr 9, 2024
1 parent 897dbec commit b05e43c
Show file tree
Hide file tree
Showing 10 changed files with 96 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,6 @@ _build/

mytestnet/

screenlog.0
screenlog.0
.idea
genesis*
8 changes: 7 additions & 1 deletion app/keepers/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,13 @@ func (appKeepers *AppKeepers) InitNormalKeepers(
appCodec, appKeepers.keys[ibchost.StoreKey], appKeepers.GetSubspace(ibchost.ModuleName), appKeepers.StakingKeeper, appKeepers.UpgradeKeeper, appKeepers.ScopedIBCKeeper,
)

appKeepers.Wasm08Keeper = wasm08Keeper.NewKeeper(appCodec, appKeepers.keys[wasm08types.StoreKey], authorityAddress, homePath, &appKeepers.IBCKeeper.ClientKeeper)
appKeepers.Wasm08Keeper = wasm08Keeper.NewKeeper(
appCodec,
appKeepers.keys[wasm08types.StoreKey],
authorityAddress,
homePath,
&appKeepers.IBCKeeper.ClientKeeper,
)

// ICA Host keeper
appKeepers.ICAHostKeeper = icahostkeeper.NewKeeper(
Expand Down
13 changes: 13 additions & 0 deletions scripts/relayer_hyperspace/config-chain-a.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
type = "picasso_kusama"
name = "picasso_dev"
para_id = 2087
parachain_rpc_url = "ws://127.0.0.1:9988"
relay_chain_rpc_url = "ws://127.0.0.1:9944"
client_id = "08-wasm-0"
connection_id = "connection-0"
commitment_prefix = "0x6962632f"
private_key = "//Alice"
ss58_version = 49
channel_whitelist = [["channel-0", "transfer"]]
finality_protocol = "Grandpa"
key_type = "sr25519"
20 changes: 20 additions & 0 deletions scripts/relayer_hyperspace/config-chain-b.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
type = "cosmos"
name = "centauri"
rpc_url = "http://127.0.0.1:26657/"
grpc_url = "http://127.0.0.1:9090/"
websocket_url = "ws://127.0.0.1:26657/websocket"
chain_id = "centauri-dev"
client_id = "07-tendermint-0"
connection_id = "connection-0"
account_prefix = "centauri"
fee_denom = "ppica"
fee_amount = "10000000000000000"
gas_limit = 9223372036854775806
store_prefix = "ibc"
max_tx_size = 20000000
wasm_code_id = "9d5056f2b551213094a03b788db80274445175bae78c8fede38bf25a2ddc84bc"
channel_whitelist = [["channel-0", "transfer"]]
mnemonic = "bottom loan skill merry east cradle onion journey palm apology verb edit desert impose absurd oil bubble sweet glove shallow size build burst effort"
skip_optional_client_updates = false
max_packets_to_process = 50
skip_tokens_list = []
1 change: 1 addition & 0 deletions scripts/relayer_hyperspace/config-core.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
prometheus_endpoint = "https://127.0.0.1"
15 changes: 15 additions & 0 deletions scripts/relayer_hyperspace/config-relayer.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

# create client
../composable-ibc/target/release/hyperspace create-clients --config-a ./scripts/relayer_hyperspace/config-chain-a.toml --config-b ./scripts/relayer_hyperspace/config-chain-b.toml --config-core ./scripts/relayer_hyperspace/config.toml --delay-period 10

# # create connection
# ../composable-ibc/target/release/hyperspace create-connection --config-a ./scripts/relayer_hyperspace/config-chain-a.toml --config-b ./scripts/relayer_hyperspace/config-chain-b.toml --config-core ./scripts/relayer_hyperspace/config.toml --delay-period 1 --port-id transfer --order unordered

# # create channel
# ../composable-ibc/target/release/hyperspace create-channel --config-a ./scripts/relayer_hyperspace/config-chain-a.toml --config-b ./scripts/relayer_hyperspace/config-chain-b.toml --config-core ./scripts/relayer_hyperspace/config.toml --delay-period 0 --port-id tranfer --order unordered --version ics20-1

# # start relayer
# ../composable-ibc/target/release/hyperspace relay --config-a ./scripts/relayer_hyperspace/config-chain-a.toml --config-b ./scripts/relayer_hyperspace/config-chain-b.toml --config-core ./scripts/relayer_hyperspace/config.toml --delay-period 1 --port-id transfer --order unordered --version ics20-1

# # send ibc
# centaurid tx ibc-transfer transfer transfer channel-0 --chain-id test-1 5yNZjX24n2eg7W6EVamaTXNQbWCwchhThEaSWB7V3GRjtHeL 100stake
1 change: 1 addition & 0 deletions scripts/relayer_hyperspace/start_relayer.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hyperspace create-clients --config-a scripts/relayer_hyperspace/config-chain-a.toml --config-b scripts/relayer_hyperspace/config-chain-b.toml --config-core scripts/relayer_hyperspace/config-core.toml --delay-period 10
2 changes: 1 addition & 1 deletion scripts/testnode.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ fi
sed -i'' -e 's/max_body_bytes = /max_body_bytes = 1/g' ~/.banksy/config/config.toml

# Start the node (remove the --pruning=nothing flag if historical queries are not needed)
# centaurid start --pruning=nothing --minimum-gas-prices=0.0001ppica --rpc.laddr tcp://0.0.0.0:26657
centaurid start --pruning=nothing --minimum-gas-prices=0.0001ppica --rpc.laddr tcp://0.0.0.0:26657
17 changes: 17 additions & 0 deletions scripts/upgrade/08-wasm/post_08_wasm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash
KEY="mykey"
KEYALGO="secp256k1"
KEYRING="test"
HOME_DIR=mytestnet


sleep 2

checksum=$(./_build/new/centaurid query ibc-wasm checksums --home $HOME_DIR -o json | jq -r '.checksums[0]')

if ./_build/new/centaurid query ibc-wasm code $checksum --home $HOME_DIR -o json &> /dev/null; then
echo "Code with checksum $checksum exists."
else
echo "Code with checksum $checksum does not exist."
fi

18 changes: 18 additions & 0 deletions scripts/upgrade/08-wasm/pre_08_wasm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash
KEY="mykey"
KEYALGO="secp256k1"
KEYRING="test"
HOME_DIR=mytestnet



# validate dependencies are installed
command -v jq > /dev/null 2>&1 || { echo >&2 "jq not installed. More info: https://stedolan.github.io/jq/download/"; exit 1; }


stat $(pwd)/contracts/ics10_grandpa_cw.wasm
./_build/old/centaurid tx 08-wasm push-wasm $(pwd)/contracts/ics10_grandpa_cw.wasm --from=mykey --gas 10002152622 --fees 10020166ppica --keyring-backend test --chain-id=test-1 -y

sleep 3

./_build/old/centaurid query 08-wasm all-wasm-code

0 comments on commit b05e43c

Please sign in to comment.