Mount /root to simapp_data on chain start

This commit is contained in:
Simon Warta 2020-08-02 20:44:06 +02:00
parent aa31b6c870
commit 4ece47e0e0
6 changed files with 13 additions and 7 deletions

View File

@ -9,8 +9,8 @@ source "$SCRIPT_DIR"/env
rm -rf "$SCRIPT_DIR/template"
mkdir "$SCRIPT_DIR/template"
cp setup.sh "$SCRIPT_DIR/template/"
cp run_simd.sh "$SCRIPT_DIR/template/"
cp setup.sh "$SCRIPT_DIR/template/" && chmod +x "$SCRIPT_DIR/template/setup.sh"
cp run_simd.sh "$SCRIPT_DIR/template/" && chmod +x "$SCRIPT_DIR/template/run_simd.sh"
# The usage of the accounts below is documented in README.md of this directory
docker run --rm \

2
scripts/simapp/run_simd.sh Executable file → Normal file
View File

@ -2,6 +2,6 @@
set -o errexit -o nounset -o pipefail
command -v shellcheck > /dev/null && shellcheck "$0"
cp -R "/template/.simapp" /root
mkdir -p /root/log
simd start --rpc.laddr tcp://0.0.0.0:26657 --trace

0
scripts/simapp/setup.sh Executable file → Normal file
View File

View File

@ -15,12 +15,16 @@ echo "Using temporary dir $TMP_DIR"
SIMD_LOGFILE="$TMP_DIR/simd.log"
PORT=26657
# Use a fresh volume for every start
docker volume rm -f simapp_data
docker run --rm \
--name "$CONTAINER_NAME" \
-p "$PORT:$PORT" \
--mount type=bind,source="$SCRIPT_DIR/template",target=/root \
--mount type=bind,source="$SCRIPT_DIR/template",target=/template \
--mount type=volume,source=simapp_data,target=/root \
"$REPOSITORY:$VERSION" \
./run_simd.sh \
/template/run_simd.sh \
> "$SIMD_LOGFILE" &
echo "simd running on http://localhost:$PORT and logging into $SIMD_LOGFILE"

View File

@ -2,6 +2,6 @@
set -o errexit -o nounset -o pipefail
command -v shellcheck > /dev/null && shellcheck "$0"
cp -R "/template/.simapp" /root
mkdir -p /root/log
simd start --rpc.laddr tcp://0.0.0.0:26657 --trace

View File

@ -17,9 +17,11 @@ echo "Using temporary dir $TMP_DIR"
WASMD_LOGFILE="$TMP_DIR/wasmd.log"
REST_SERVER_LOGFILE="$TMP_DIR/rest-server.log"
# Use a fresh volume for every start
docker volume rm -f wasmd_data
# This starts up wasmd
# The Tendermint port (26657) and the p2p port (26656) are not exposed since we don't need for testing
docker volume rm -f wasmd_data
docker run --rm \
--name "$CONTAINER_NAME" \
-p "$REST_PORT_HOST":"$REST_PORT_GUEST" \