From 555534ba1b6cdbfa81817572033cfd14610b639d Mon Sep 17 00:00:00 2001 From: Ethan Frey Date: Tue, 4 Feb 2020 14:29:38 +0100 Subject: [PATCH] Add script to run local binaries, help debug --- scripts/cosm/manual_start.sh | 41 ++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100755 scripts/cosm/manual_start.sh diff --git a/scripts/cosm/manual_start.sh b/scripts/cosm/manual_start.sh new file mode 100755 index 00000000..a203e7bc --- /dev/null +++ b/scripts/cosm/manual_start.sh @@ -0,0 +1,41 @@ +#!/bin/bash +set -o errexit -o nounset -o pipefail +command -v shellcheck > /dev/null && shellcheck "$0" + +## This is like start.sh but using local binaries, not docker images +SCRIPT_DIR="$(realpath "$(dirname "$0")")" + +TMP_DIR=$(mktemp -d "${TMPDIR:-/tmp}/gaia.XXXXXXXXX") +chmod 777 "$TMP_DIR" +echo "Using temporary dir $TMP_DIR" +WASMD_LOGFILE="$TMP_DIR/wasmd.log" +REST_SERVER_LOGFILE="$TMP_DIR/rest-server.log" + +# move the template into our temporary home +cp -r "$SCRIPT_DIR"/template/.wasm* "$TMP_DIR" + +wasmd start \ + --home "$TMP_DIR/.wasmd" \ + --trace \ + --rpc.laddr tcp://0.0.0.0:26657 \ + > "$WASMD_LOGFILE" & + +echo "wasmd running and logging into $WASMD_LOGFILE" + +sleep 10 +cat "$WASMD_LOGFILE" + +wasmcli rest-server \ + --home "$TMP_DIR/.wasmcli" \ + --node tcp://localhost:26657 \ + --trust-node \ + --laddr tcp://0.0.0.0:1317 \ + > "$REST_SERVER_LOGFILE" & + +echo "rest server running on http://localhost:1317 and logging into $REST_SERVER_LOGFILE" + +# Debug rest server start +sleep 3 +cat "$REST_SERVER_LOGFILE" + +tail -f "$WASMD_LOGFILE"