2019-07-09 18:39:31 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
set -u
|
|
|
|
set -o pipefail
|
|
|
|
|
2020-05-28 13:35:00 +02:00
|
|
|
ganache_cli="$(yarn bin)/ganache-cli"
|
2019-07-09 18:39:31 +02:00
|
|
|
seed_phrase="${GANACHE_SEED_PHRASE:-phrase upgrade clock rough situate wedding elder clever doctor stamp excess tent}"
|
|
|
|
|
|
|
|
_term () {
|
|
|
|
printf '%s\n' "Received SIGTERM, sending SIGKILL to Ganache"
|
|
|
|
kill -KILL "$child" 2>/dev/null
|
|
|
|
exit 42
|
|
|
|
}
|
|
|
|
|
|
|
|
_int () {
|
|
|
|
printf '%s\n' "Received SIGINT, sending SIGKILL to Ganache"
|
|
|
|
kill -KILL "$child" 2>/dev/null
|
|
|
|
exit 42
|
|
|
|
}
|
|
|
|
|
|
|
|
trap _term SIGTERM
|
|
|
|
trap _int SIGINT
|
|
|
|
|
2020-07-20 19:02:49 +02:00
|
|
|
# shellcheck disable=SC2086
|
2019-07-09 18:39:31 +02:00
|
|
|
$ganache_cli --noVMErrorsOnRPCResponse --networkId 5777 --mnemonic "$seed_phrase" ${GANACHE_ARGS:-} &
|
|
|
|
|
|
|
|
child=$!
|
|
|
|
wait "$child"
|