bsc/tests/truffle/scripts/utils.sh
dylanhuang f2f68dba15
ci: unit test and truffle test (#456)
* ci: add unit test

fix: failed on test

* ci: add truffle test

* ci: update os version

* ci: add cache for go build
2021-10-18 18:16:32 +08:00

15 lines
328 B
Bash

wait_for_host_port() {
while ! nc -v -z -w 3 ${1} ${2} >/dev/null 2>&1 < /dev/null; do
echo "$(date) - waiting for ${1}:${2}..."
sleep 5
done
}
get_host_ip() {
local host_ip
while [ -z ${host_ip} ]; do
host_ip=$(getent hosts ${1}| awk '{ print $1 ; exit }')
done
echo $host_ip
}