Fixes for local sim on macOS [skip ci]

This commit is contained in:
Zahary Karadjov 2020-06-25 12:42:17 +03:00
parent 902093f57c
commit b67a506b3f
No known key found for this signature in database
GPG Key ID: C8936F8A3073D609
2 changed files with 9 additions and 7 deletions

View File

@ -175,11 +175,11 @@ if [[ $USE_GANACHE == "0" ]]; then
else
make deposit_contract
echo "Launching ganache"
echo "Launching ganache"
ganache-cli --blockTime 17 --gasLimit 100000000 -e 100000 --verbose > "${DATA_DIR}/log_ganache.txt" 2>&1 &
PIDS="${PIDS},$!"
echo "Deploying deposit contract"
echo "Deploying deposit contract"
WEB3_ARG="--web3-url=ws://localhost:8545"
DEPOSIT_CONTRACT_ADDRESS=$(./build/deposit_contract deploy $WEB3_ARG)
DEPOSIT_CONTRACT_ARG="--deposit-contract=$DEPOSIT_CONTRACT_ADDRESS"
@ -202,7 +202,8 @@ fi
./scripts/make_prometheus_config.sh \
--nodes ${NUM_NODES} \
--base-metrics-port ${BASE_METRICS_PORT} \
--config-file "${DATA_DIR}/prometheus.yml"
--config-file "${DATA_DIR}/prometheus.yml" || true # TODO: this currently fails on macOS,
# but it can be considered non-critical
# Kill child processes on Ctrl-C/SIGTERM/exit, passing the PID of this shell
# instance as the parent and the target process name as a pattern to the

View File

@ -67,9 +67,10 @@ fi
mkdir -p "${METRICS_DIR}"
./scripts/make_prometheus_config.sh \
--nodes ${TOTAL_NODES} \
--base-metrics-port ${BASE_METRICS_PORT} \
--config-file "${METRICS_DIR}/prometheus.yml"
--nodes ${TOTAL_NODES} \
--base-metrics-port ${BASE_METRICS_PORT} \
--config-file "${METRICS_DIR}/prometheus.yml" || true # TODO: this currently fails on macOS,
# but it can be considered non-critical
COMMANDS=()
@ -87,7 +88,7 @@ if [[ "$USE_PROMETHEUS" == "yes" ]]; then
rm -rf "${METRICS_DIR}/data"
mkdir -p "${METRICS_DIR}/data"
# TODO: Prometheus is not shut down properly on tmux kill-session
killall prometheus
killall prometheus > /dev/null || true
PROMETHEUS_FLAGS="--config.file=./prometheus.yml --storage.tsdb.path=./data"
$TMUX_CMD new-window -d -t $TMUX_SESSION_NAME -n "$PROMETHEUS_CMD" "cd '$METRICS_DIR' && $PROMETHEUS_CMD $PROMETHEUS_FLAGS"
else