diff --git a/dev-env b/dev-env deleted file mode 100755 index 4243a6599..000000000 --- a/dev-env +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash -e -RELAYER_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -RELAYER_CONF="$HOME/.relayer" -GAIA_CONF="$(pwd)/data" - -# Ensure user understands what will be deleted -if ([[ -d $RELAYER_CONF ]] || [[ -d $GAIA_CONF ]]) && [[ ! "$1" == "skip" ]]; then - read -p "$0 will delete \$HOME/.relayer and \$(pwd)/data folder. Do you wish to continue? (y/n): " -n 1 -r - echo - if [[ ! $REPLY =~ ^[Yy]$ ]]; then - exit 1 - fi -fi - -cd $RELAYER_DIR -rm -rf $RELAYER_CONF &> /dev/null -pwd -bash scripts/two-chainz "skip" - -echo "waiting for blocks..." -sleep 3 - -# creates client, connection, and channel all in one command -rly tx link demo -d -t 3s -sleep 2 -echo "Initial balances" -echo "balance 0 $(rly q bal ibc-0)" -echo "balance 1 $(rly q bal ibc-1)" -rly tx transfer ibc-0 ibc-1 100000samoleans "$(rly keys show ibc-1)" channel-0 -d -rly tx transfer ibc-1 ibc-0 100000samoleans "$(rly keys show ibc-0)" channel-0 -d -sleep 5 -# relay remaining packets and then finishes as opposed to starting a continuous listening loop with `rly start` -rly tx relay-packets demo channel-0 -d -sleep 5 -# relay remaining acknowledgments and then finishes as opposed to starting a continuous listening loop with `rly start` -rly tx relay-acknowledgements demo channel-0 -d -sleep 5 -echo "Balances after packets are sent" -echo "balance 0 $(rly q bal ibc-0)" -echo "balance 1 $(rly q bal ibc-1)" \ No newline at end of file diff --git a/examples/demo/configs/chains/ibc-1.json b/examples/demo/configs/chains/ibc-1.json index 101d5e219..56ad3c370 100644 --- a/examples/demo/configs/chains/ibc-1.json +++ b/examples/demo/configs/chains/ibc-1.json @@ -8,7 +8,7 @@ "account-prefix": "cosmos", "keyring-backend": "test", "gas-adjustment": 1.5, - "gas-prices": "0.025stake", + "gas-prices": "0.025rice", "debug": true, "timeout": "10s", "output-format": "json", diff --git a/examples/demo/dev-env b/examples/demo/dev-env index cf5c4ae5c..a9d0a2894 100755 --- a/examples/demo/dev-env +++ b/examples/demo/dev-env @@ -24,18 +24,35 @@ sleep 3 # creates clients, connections and channels (all this happens in rly tx command) rly tx link demo -d -t 3s sleep 2 -echo "Initial balances" +echo "-- Initial balances --" echo "balance 0 $(rly q bal ibc-0)" echo "balance 1 $(rly q bal ibc-1)" + +echo "-- Sending IBC transaction... --" rly tx transfer ibc-0 ibc-1 100000samoleans "$(rly keys show ibc-1)" channel-0 -d -rly tx transfer ibc-1 ibc-0 100000samoleans "$(rly keys show ibc-0)" channel-0 -d sleep 5 -# relay remaining packets and then finishes as opposed to starting a continuous listening loop with `rly start` + +# relay remaining packets -- (could also be accomplished by running: `rly start`) +rly tx relay-packets demo channel-0 -d +sleep 5 + +# relay remaining acknowledgments -- (could also be accomplished by running: `rly start`) +rly tx relay-acknowledgements demo channel-0 -d +sleep 5 +echo "-- Balances after packets are sent --" +echo "balance 0 $(rly q bal ibc-0)" +echo "balance 1 $(rly q bal ibc-1)" + +echo "-- Sending tokens back to original wallet... --" +rly tx transfer ibc-1 ibc-0 100000transfer/channel-0/samoleans "$(rly keys show ibc-0)" channel-0 -d +sleep 5 + rly tx relay-packets demo channel-0 -d sleep 5 -# relay remaining acknowledgments and then finishes as opposed to starting a continuous listening loop with `rly start` + rly tx relay-acknowledgements demo channel-0 -d sleep 5 -echo "Balances after packets are sent" + +echo "-- Balances after sending packets back --" echo "balance 0 $(rly q bal ibc-0)" echo "balance 1 $(rly q bal ibc-1)" \ No newline at end of file diff --git a/examples/demo/scripts/one-chain b/examples/demo/scripts/one-chain index bc1921f47..ebb291361 100755 --- a/examples/demo/scripts/one-chain +++ b/examples/demo/scripts/one-chain @@ -25,6 +25,8 @@ RPCPORT=$4 P2PPORT=$5 PROFPORT=$6 GRPCPORT=$7 +DENOM=$8 +BASEDENOM=$9 if [ -z "$1" ]; then display_usage "[BINARY] ($BINARY|akash)" @@ -63,8 +65,8 @@ if ! mkdir -p $CHAINDIR/$CHAINID 2>/dev/null; then fi # Build genesis file incl account for passed address -coins="100000000000stake,100000000000samoleans" -delegate="100000000000stake" +coins="100000000000$DENOM,100000000000$BASEDENOM" +delegate="100000000000$DENOM" redirect $BINARY --home $CHAINDIR/$CHAINID --chain-id $CHAINID init $CHAINID sleep 1 @@ -89,7 +91,7 @@ if [ "$unamestr" = 'Linux' ]; then fi # Set proper defaults and change ports (use a different sed for Mac or Linux) -echo "Change settings in config.toml file..." +echo "Change settings in config.toml and genesis.json files..." if [ $platform = 'linux' ]; then sed -i 's#"tcp://127.0.0.1:26657"#"tcp://0.0.0.0:'"$RPCPORT"'"#g' $CHAINDIR/$CHAINID/config/config.toml sed -i 's#"tcp://0.0.0.0:26656"#"tcp://0.0.0.0:'"$P2PPORT"'"#g' $CHAINDIR/$CHAINID/config/config.toml @@ -97,6 +99,7 @@ if [ $platform = 'linux' ]; then sed -i 's/timeout_commit = "5s"/timeout_commit = "1s"/g' $CHAINDIR/$CHAINID/config/config.toml sed -i 's/timeout_propose = "3s"/timeout_propose = "1s"/g' $CHAINDIR/$CHAINID/config/config.toml sed -i 's/index_all_keys = false/index_all_keys = true/g' $CHAINDIR/$CHAINID/config/config.toml + sed -i 's/"bond_denom": "stake"/"bond_denom": "'"$DENOM"'"/g' $CHAINDIR/$CHAINID/config/genesis.json # sed -i '' 's#index-events = \[\]#index-events = \["message.action","send_packet.packet_src_channel","send_packet.packet_sequence"\]#g' $CHAINDIR/$CHAINID/config/app.toml else sed -i '' 's#"tcp://127.0.0.1:26657"#"tcp://0.0.0.0:'"$RPCPORT"'"#g' $CHAINDIR/$CHAINID/config/config.toml @@ -105,6 +108,7 @@ else sed -i '' 's/timeout_commit = "5s"/timeout_commit = "1s"/g' $CHAINDIR/$CHAINID/config/config.toml sed -i '' 's/timeout_propose = "3s"/timeout_propose = "1s"/g' $CHAINDIR/$CHAINID/config/config.toml sed -i '' 's/index_all_keys = false/index_all_keys = true/g' $CHAINDIR/$CHAINID/config/config.toml + sed -i '' 's/"bond_denom": "stake"/"bond_denom": "'"$DENOM"'"/g' $CHAINDIR/$CHAINID/config/genesis.json # sed -i '' 's#index-events = \[\]#index-events = \["message.action","send_packet.packet_src_channel","send_packet.packet_sequence"\]#g' $CHAINDIR/$CHAINID/config/app.toml fi diff --git a/examples/demo/scripts/two-chainz b/examples/demo/scripts/two-chainz index 1772e46e1..d2d770999 100755 --- a/examples/demo/scripts/two-chainz +++ b/examples/demo/scripts/two-chainz @@ -47,8 +47,8 @@ chainid1=ibc-1 echo "Generating gaia configurations..." mkdir -p $GAIA_DATA && cd $GAIA_DATA && cd ../ -./scripts/one-chain gaiad $chainid0 ./data 26657 26656 6060 9090 -./scripts/one-chain gaiad $chainid1 ./data 26557 26556 6061 9091 +./scripts/one-chain gaiad $chainid0 ./data 26657 26656 6060 9090 stake samoleans +./scripts/one-chain gaiad $chainid1 ./data 26557 26556 6061 9091 rice beans [ -f $GAIA_DATA/$chainid0.log ] && echo "$chainid0 initialized. Watch file $GAIA_DATA/$chainid0.log to see its execution." [ -f $GAIA_DATA/$chainid1.log ] && echo "$chainid1 initialized. Watch file $GAIA_DATA/$chainid1.log to see its execution."