-
Notifications
You must be signed in to change notification settings - Fork 204
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
84 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
|
||
set -eu | ||
|
||
namespace="$1" | ||
|
||
echo "---" && sleep 1 | ||
printf "Waiting for network to startup..." | ||
|
||
# TODO: fix this | ||
trap 'printf "\nInterrupted by user.\n"; exit' INT | ||
|
||
elapsed=0 | ||
while true; do | ||
not_ready_pods=$(kubectl get pods --no-headers -n $namespace | grep -v '1/1 *Running' | wc -l) | ||
|
||
if [[ $not_ready_pods -eq 0 ]]; then | ||
printf "Ready! 🚀\n" | ||
break | ||
fi | ||
if [[ $elapsed -eq 60 ]]; then | ||
printf "\nThe network's taking longer than expected to startup. Please investigate via `kubectl get pods`\n" | ||
exit 1 | ||
fi | ||
|
||
sleep 2 && printf "." | ||
elapsed=$((elapsed + 1)) | ||
done |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
relayer_type="$1" | ||
|
||
chain_id="${CHAIN_NAME_A}-test-1" | ||
relayer_config_file=${HOME}/.relayer/config/config.yaml | ||
hermes_config_file=${HOME}/.hermes/config.toml | ||
|
||
if [[ "$relayer_type" == "relayer" ]]; then | ||
if [[ ! -f $relayer_config_file ]]; then | ||
echo "Config not initialized yet" | ||
exit 1 | ||
fi | ||
if ! rly q channels "$CHAIN_NAME_A" 2>/dev/null | grep -q STATE_OPEN; then | ||
echo "Source channel not open yet" | ||
exit 1 | ||
fi | ||
if ! rly q channels "$CHAIN_NAME_B" 2>/dev/null | grep -q STATE_OPEN; then | ||
echo "Destination channel not open yet" | ||
exit 1 | ||
fi | ||
exit 0 | ||
|
||
elif [[ "$relayer_type" == "hermes" ]]; then | ||
if [[ ! -f $hermes_config_file ]]; then | ||
echo "Config not initialized yet" | ||
exit 1 | ||
fi | ||
open_channels=$(hermes query channels --chain "$chain_id" --show-counterparty 2>/dev/null | grep -o "channel-" | wc -l) | ||
if [[ "$open_channels" == "0" ]]; then | ||
echo "Source channel not open yet" | ||
exit 1 | ||
fi | ||
if [[ "$open_channels" == "1" ]]; then | ||
echo "Destination channel not open yet" | ||
exit 1 | ||
fi | ||
exit 0 | ||
|
||
else | ||
echo "ERROR: Unsupported relayer type $relayer_type" | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters