You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
653 B
30 lines
653 B
5 years ago
|
#!/usr/bin/env bash
|
||
|
|
||
|
set -e
|
||
|
set -u
|
||
|
set -o pipefail
|
||
|
|
||
5 years ago
|
ganache_cli="$(yarn bin)/ganache-cli"
|
||
5 years ago
|
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
|
||
|
|
||
4 years ago
|
# shellcheck disable=SC2086
|
||
4 years ago
|
$ganache_cli --noVMErrorsOnRPCResponse --networkId 1337 --mnemonic "$seed_phrase" ${GANACHE_ARGS:-} &
|
||
5 years ago
|
|
||
|
child=$!
|
||
|
wait "$child"
|