Skip to content

Commit

Permalink
docker: Revamp Dockerfiles
Browse files Browse the repository at this point in the history
Adds snippets to support both locally built compoments (for debugging) or
releases (default and faster).
  • Loading branch information
matevz committed Sep 2, 2024
1 parent 76b1eeb commit 8673fff
Show file tree
Hide file tree
Showing 4 changed files with 133 additions and 103 deletions.
30 changes: 15 additions & 15 deletions docker/common/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
# ParaTime.
# Mandatory ENV Variables:
# - all ENV variables required by spinup-oasis-stack.sh
# - OASIS_WEB3_GATEWAY: path to oasis-web3-gateway binary
# - OASIS_WEB3_GATEWAY_BINARY: path to oasis-web3-gateway binary
# - OASIS_WEB3_GATEWAY_CONFIG_FILE: path to oasis-web3-gateway config file
# - OASIS_DEPOSIT: path to oasis-deposit binary
# - OASIS_DEPOSIT_BINARY: path to oasis-deposit binary
# - BEACON_BACKEND: beacon epoch transition mode 'mock' (default) or 'default'
# - OASIS_SINGLE_COMPUTE_NODE: (default: true) if non-empty only run a single compute node

Expand All @@ -21,8 +21,8 @@ export OASIS_DOCKER_DEBUG_DISK_AND_CPU_USAGE=${OASIS_DOCKER_DEBUG_DISK_AND_CPU_U

export OASIS_SINGLE_COMPUTE_NODE=${OASIS_SINGLE_COMPUTE_NODE:-1}

OASIS_WEB3_GATEWAY_VERSION=$(${OASIS_WEB3_GATEWAY} -v | head -n1 | cut -d " " -f 3 | sed -r 's/^v//')
OASIS_CORE_VERSION=$(${OASIS_NODE} -v | head -n1 | cut -d " " -f 3 | sed -r 's/^v//')
OASIS_WEB3_GATEWAY_VERSION=$(${OASIS_WEB3_GATEWAY_BINARY} -v | head -n1 | cut -d " " -f 3 | sed -r 's/^v//')
OASIS_CORE_VERSION=$(${OASIS_NODE_BINARY} -v | head -n1 | cut -d " " -f 3 | sed -r 's/^v//')
VERSION=$(cat /VERSION)

echo "${PARATIME_NAME}-localnet ${VERSION} (oasis-core: ${OASIS_CORE_VERSION}, ${PARATIME_NAME}-paratime: ${PARATIME_VERSION}, oasis-web3-gateway: ${OASIS_WEB3_GATEWAY_VERSION})"
Expand Down Expand Up @@ -126,7 +126,7 @@ if [[ $OASIS_DOCKER_NO_GATEWAY == 'yes' ]]; then
notice "Skipping oasis-web3-gateway start-up...\n"
else
notice "Starting oasis-web3-gateway...\n"
${OASIS_WEB3_GATEWAY} --config ${OASIS_WEB3_GATEWAY_CONFIG_FILE} 2>1 &>/var/log/oasis-web3-gateway.log &
${OASIS_WEB3_GATEWAY_BINARY} --config ${OASIS_WEB3_GATEWAY_CONFIG_FILE} 2>1 &>/var/log/oasis-web3-gateway.log &
OASIS_WEB3_GATEWAY_PID=$!
fi

Expand All @@ -135,27 +135,27 @@ notice "Bootstrapping network (this might take a minute)"
if [[ ${BEACON_BACKEND} == 'mock' ]]; then
echo -n .
notice_debug -l "Waiting for nodes to be ready..."
${OASIS_NODE} debug control wait-nodes -n 2 -a unix:${OASIS_NODE_SOCKET}
${OASIS_NODE_BINARY} debug control wait-nodes -n 2 -a unix:${OASIS_NODE_SOCKET}

echo -n .
notice_debug -l "Setting epoch to 1..."
${OASIS_NODE} debug control set-epoch --epoch 1 -a unix:${OASIS_NODE_SOCKET}
${OASIS_NODE_BINARY} debug control set-epoch --epoch 1 -a unix:${OASIS_NODE_SOCKET}

# Transition to the final epoch when the KM generates ephemeral secret.
if [[ ${PARATIME_NAME} == 'sapphire' ]]; then
notice_debug -l "Waiting for key manager to generate ephemeral secret..."
while (${OASIS_NODE} control status -a unix:${OASIS_KM_SOCKET} | jq -e ".keymanager.secrets.worker.ephemeral_secrets.last_generated_epoch!=2" >/dev/null); do
while (${OASIS_NODE_BINARY} control status -a unix:${OASIS_KM_SOCKET} | jq -e ".keymanager.secrets.worker.ephemeral_secrets.last_generated_epoch!=2" >/dev/null); do
sleep 0.5
done
fi

echo -n .
notice_debug -l "Setting epoch to 2..."
${OASIS_NODE} debug control set-epoch --epoch 2 -a unix:${OASIS_NODE_SOCKET}
${OASIS_NODE_BINARY} debug control set-epoch --epoch 2 -a unix:${OASIS_NODE_SOCKET}
else
echo -n ...
notice_debug -l "Waiting for nodes to be ready..."
${OASIS_NODE} debug control wait-ready -a unix:${OASIS_NODE_SOCKET}
${OASIS_NODE_BINARY} debug control wait-ready -a unix:${OASIS_NODE_SOCKET}
fi
echo

Expand All @@ -169,9 +169,9 @@ if [[ $OASIS_DOCKER_NO_GATEWAY != 'yes' && $PARATIME_NAME == 'sapphire' ]]; then
}
until is_km_ready; do
if [[ ${BEACON_BACKEND} == 'mock' ]]; then
epoch=`${OASIS_NODE} control status -a unix:${OASIS_NODE_SOCKET} | jq '.consensus.latest_epoch'`
epoch=`${OASIS_NODE_BINARY} control status -a unix:${OASIS_NODE_SOCKET} | jq '.consensus.latest_epoch'`
epoch=$((epoch + 1))
${OASIS_NODE} debug control set-epoch --epoch $epoch -a unix:${OASIS_NODE_SOCKET}
${OASIS_NODE_BINARY} debug control set-epoch --epoch $epoch -a unix:${OASIS_NODE_SOCKET}
fi

echo -n .
Expand All @@ -184,7 +184,7 @@ else
fi

notice "Populating accounts...\n\n"
${OASIS_DEPOSIT} -sock unix:${OASIS_NODE_SOCKET} "$@"
${OASIS_DEPOSIT_BINARY} -sock unix:${OASIS_NODE_SOCKET} "$@"

T_END="$(date +%s)"

Expand Down Expand Up @@ -223,9 +223,9 @@ if [[ ${BEACON_BACKEND} == 'mock' ]]; then

sleep $((60*10))

epoch=`${OASIS_NODE} control status -a unix:${OASIS_NODE_SOCKET} | jq '.consensus.latest_epoch'`
epoch=`${OASIS_NODE_BINARY} control status -a unix:${OASIS_NODE_SOCKET} | jq '.consensus.latest_epoch'`
epoch=$((epoch + 1))
${OASIS_NODE} debug control set-epoch --epoch $epoch -a unix:${OASIS_NODE_SOCKET}
${OASIS_NODE_BINARY} debug control set-epoch --epoch $epoch -a unix:${OASIS_NODE_SOCKET}
done
else
wait
Expand Down
25 changes: 13 additions & 12 deletions docker/emerald-localnet/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,35 +17,36 @@ ENV PARATIME_NAME=emerald
ENV GATEWAY__CHAIN_ID=0xa514

# start.sh and spinup-oasis-stack.sh ENV variables.
ENV OASIS_NODE=/oasis-node
ENV OASIS_NET_RUNNER=/oasis-net-runner
ENV OASIS_NODE_BINARY=/oasis-node
ENV OASIS_NET_RUNNER_BINARY=/oasis-net-runner
ENV OASIS_NODE_DATADIR=/serverdir/node
ENV OASIS_WEB3_GATEWAY=/oasis-web3-gateway
ENV OASIS_DEPOSIT=/oasis-deposit
ENV OASIS_WEB3_GATEWAY_BINARY=/oasis-web3-gateway
ENV OASIS_DEPOSIT_BINARY=/oasis-deposit
ENV OASIS_WEB3_GATEWAY_CONFIG_FILE=/localnet.yml
ENV PARATIME=/runtime.elf
ENV PARATIME_BINARY=/runtime.elf
ENV KEYMANAGER_BINARY=""
ENV OASIS_CLI_BINARY=/oasis

ARG VERSION

# oasis-web3-gateway binary, config, spinup-* scripts and staking_genesis.json.
COPY --from=oasis-web3-gateway /go/oasis-web3-gateway/oasis-web3-gateway ${OASIS_WEB3_GATEWAY}
COPY --from=oasis-web3-gateway /go/oasis-web3-gateway/docker/common/oasis-deposit/oasis-deposit ${OASIS_DEPOSIT}
COPY --from=oasis-web3-gateway /go/oasis-web3-gateway/oasis-web3-gateway ${OASIS_WEB3_GATEWAY_BINARY}
COPY --from=oasis-web3-gateway /go/oasis-web3-gateway/docker/common/oasis-deposit/oasis-deposit ${OASIS_DEPOSIT_BINARY}
COPY docker/common/localnet.yml ${OASIS_WEB3_GATEWAY_CONFIG_FILE}
COPY docker/common/start.sh /
COPY tests/tools/* /

# Configure oasis-node and oasis-net-runner.
RUN wget --quiet "https://github.com/oasisprotocol/oasis-core/releases/download/v${OASIS_CORE_VERSION}/oasis_core_${OASIS_CORE_VERSION}_linux_amd64.tar.gz" \
&& tar xfvz "oasis_core_${OASIS_CORE_VERSION}_linux_amd64.tar.gz" \
&& mkdir -p "$(dirname ${OASIS_NODE})" "$(dirname ${OASIS_NET_RUNNER})" \
&& mv "oasis_core_${OASIS_CORE_VERSION}_linux_amd64/oasis-node" "${OASIS_NODE}" \
&& mv "oasis_core_${OASIS_CORE_VERSION}_linux_amd64/oasis-net-runner" "${OASIS_NET_RUNNER}" \
&& mkdir -p "$(dirname ${OASIS_NODE_BINARY})" "$(dirname ${OASIS_NET_RUNNER_BINARY})" \
&& mv "oasis_core_${OASIS_CORE_VERSION}_linux_amd64/oasis-node" "${OASIS_NODE_BINARY}" \
&& mv "oasis_core_${OASIS_CORE_VERSION}_linux_amd64/oasis-net-runner" "${OASIS_NET_RUNNER_BINARY}" \
&& rm "oasis_core_${OASIS_CORE_VERSION}_linux_amd64.tar.gz" \
&& rm -rf "oasis_core_${OASIS_CORE_VERSION}_linux_amd64" \
&& echo "" \
&& echo "Configure the ParaTime." \
&& mkdir -p "$(dirname ${PARATIME})" \
&& mkdir -p "$(dirname ${PARATIME_BINARY})" \
&& wget --quiet "https://github.com/oasisprotocol/${PARATIME_NAME}-paratime/releases/download/v${PARATIME_VERSION}/localnet-${PARATIME_NAME}-paratime.orc" -O "/paratime.orc" \
&& unzip "paratime.orc" \
&& chmod a+x "runtime.elf" \
Expand All @@ -60,7 +61,7 @@ RUN wget --quiet "https://github.com/oasisprotocol/oasis-core/releases/download/
&& echo "" \
&& echo "Write VERSION information." \
&& echo "${VERSION}" > /VERSION \
&& strip -S -x /oasis-net-runner /oasis-node /oasis
&& strip -S -x ${OASIS_NET_RUNNER_BINARY} ${OASIS_NODE_BINARY} ${OASIS_CLI_BINARY}

# Web3 gateway http and ws ports.
EXPOSE 8545/tcp
Expand Down
165 changes: 97 additions & 68 deletions docker/sapphire-localnet/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,100 +1,129 @@
# Build oasis-web3-gateway
FROM golang:1.22.3 AS oasis-web3-gateway
ARG PARATIME_VERSION=0.8.2-testnet
ARG PARATIME_NAME=sapphire

COPY . /go/oasis-web3-gateway
RUN cd oasis-web3-gateway && make && strip -S -x oasis-web3-gateway docker/common/oasis-deposit/oasis-deposit

# Build simple-keymanager
# Build simple-keymanager, oasis-deposit and, fetch (or optionally build) other components.
FROM ghcr.io/oasisprotocol/oasis-core-dev:stable-24.2.x AS oasis-core-dev

ENV OASIS_UNSAFE_MOCK_SGX=1
ENV OASIS_UNSAFE_ALLOW_DEBUG_ENCLAVES=1
ENV OASIS_CORE_VERSION=stable/24.2.x
ENV OASIS_CLI_VERSION=0.10.0
ENV OASIS_CORE_SIMPLE_KM_BRANCH=stable/24.2.x
RUN git clone https://github.com/oasisprotocol/oasis-core.git oasis-core-km --branch ${OASIS_CORE_SIMPLE_KM_BRANCH} --depth 1 \
&& cd /oasis-core-km/tests/runtimes/simple-keymanager \
&& OASIS_UNSAFE_ALLOW_DEBUG_ENCLAVES=1 CARGO_PROFILE_RELEASE_LTO=true CARGO_PROFILE_RELEASE_OPT_LEVEL=s CARGO_PROFILE_RELEASE_CODEGEN_UNITS=1 OASIS_UNSAFE_SKIP_AVR_VERIFY=1 \
cargo build --release --features debug-mock-sgx \
&& mv /oasis-core-km/target/release/simple-keymanager / \
&& rm -rf /oasis-core-km

COPY docker/common/oasis-deposit /oasis-deposit-git
RUN cd oasis-deposit-git \
&& go build \
&& mv /oasis-deposit-git/oasis-deposit / \
&& rm -rf /oasis-deposit-git

# Fetch latest released components. Replace with commented snippet below to build manually.
ENV OASIS_CORE_VERSION=24.2
RUN wget https://github.com/oasisprotocol/oasis-core/releases/download/v${OASIS_CORE_VERSION}/oasis_core_${OASIS_CORE_VERSION}_linux_amd64.tar.gz \
&& tar -zxvf oasis_core_${OASIS_CORE_VERSION}_linux_amd64.tar.gz \
&& mv oasis_core_${OASIS_CORE_VERSION}_linux_amd64/oasis-node / \
&& mv oasis_core_${OASIS_CORE_VERSION}_linux_amd64/oasis-net-runner / \
&& rm -rf /oasis_core_${OASIS_CORE_VERSION}_linux_amd64*
#ENV OASIS_CORE_BRANCH=stable/24.2.x
#RUN git clone https://github.com/oasisprotocol/oasis-core.git --branch ${OASIS_CORE_BRANCH} --depth 1 \
# && cd /oasis-core \
# && make -C go oasis-node oasis-net-runner \
# && mv /oasis-core/go/oasis-net-runner/oasis-net-runner /oasis-core/go/oasis-node/oasis-node / \
# && rm -rf /oasis-core

RUN git clone https://github.com/oasisprotocol/oasis-core.git --branch ${OASIS_CORE_VERSION} --depth 1 \
&& cd oasis-core/go/ \
&& make oasis-node oasis-net-runner \
&& cd ../../ \
&& cd oasis-core/tests/runtimes/simple-keymanager \
&& CARGO_PROFILE_RELEASE_LTO=true CARGO_PROFILE_RELEASE_OPT_LEVEL=s CARGO_PROFILE_RELEASE_CODEGEN_UNITS=1 OASIS_UNSAFE_SKIP_AVR_VERIFY=1 cargo build --release --features debug-mock-sgx \
&& cd ../../../../ \
&& cd oasis-core \
&& cargo build -p oasis-core-runtime-loader --release \
&& cd .. \
&& git clone https://github.com/oasisprotocol/cli.git --branch v${OASIS_CLI_VERSION} --depth 1 \
&& cd cli \
&& make CGO_ENABLED=0
ENV OASIS_CLI_VERSION=0.10.0
RUN wget https://github.com/oasisprotocol/cli/releases/download/v${OASIS_CLI_VERSION}/oasis_cli_${OASIS_CLI_VERSION}_linux_amd64.tar.gz \
&& tar -zxvf oasis_cli_${OASIS_CLI_VERSION}_linux_amd64.tar.gz \
&& mv /oasis_cli_${OASIS_CLI_VERSION}_linux_amd64/oasis / \
&& rm -rf /oasis_cli_${OASIS_CLI_VERSION}_linux_amd64*
#ENV OASIS_CLI_BRANCH=master
#RUN git clone https://github.com/oasisprotocol/cli.git --branch ${OASIS_CLI_BRANCH} --depth 1 \
# && make -C cli CGO_ENABLED=0 \
# && mv /cli/oasis / \
# && rm -rf cli

ENV OASIS_WEB3_GATEWAY_VERSION=5.1.0
RUN wget https://github.com/oasisprotocol/oasis-web3-gateway/releases/download/v${OASIS_WEB3_GATEWAY_VERSION}/oasis_web3_gateway_${OASIS_WEB3_GATEWAY_VERSION}_linux_amd64.tar.gz \
&& tar -zxvf oasis_web3_gateway_${OASIS_WEB3_GATEWAY_VERSION}_linux_amd64.tar.gz \
&& mv /oasis_web3_gateway_${OASIS_WEB3_GATEWAY_VERSION}_linux_amd64/oasis-web3-gateway / \
&& rm -rf /oasis_web3_gateway_${OASIS_WEB3_GATEWAY_VERSION}_linux_amd64*
#ENV OASIS_WEB3_GATEWAY_BRANCH=main
#RUN git clone https://github.com/oasisprotocol/oasis-web3-gateway.git oasis-web3-gateway-git --branch ${OASIS_WEB3_GATEWAY_BRANCH} --depth 1 \
# && make -C oasis-web3-gateway-git \
# && mv /oasis-web3-gateway-git/oasis-web3-gateway / \
# && rm -rf /oasis-web3-gateway-git

ARG PARATIME_VERSION
ARG PARATIME_NAME
RUN wget https://github.com/oasisprotocol/${PARATIME_NAME}-paratime/releases/download/v${PARATIME_VERSION}/localnet-${PARATIME_NAME}-paratime.orc \
&& unzip "localnet-${PARATIME_NAME}-paratime.orc" "ronl.elf" \
&& chmod a+x "ronl.elf" \
&& mv "ronl.elf" "sapphire-paratime" \
&& rm "localnet-${PARATIME_NAME}-paratime.orc"
#ENV OASIS_SAPPHIRE_PARATIME_BRANCH=main
#RUN git clone https://github.com/oasisprotocol/sapphire-paratime.git sapphire-paratime-git --branch ${OASIS_SAPPHIRE_PARATIME_BRANCH} --depth 1 \
# && cd sapphire-paratime-git/runtime \
# && OASIS_UNSAFE_SKIP_AVR_VERIFY=1 OASIS_UNSAFE_ALLOW_DEBUG_ENCLAVES=1 OASIS_UNSAFE_USE_LOCALNET_CHAINID=1 \
# cargo build --release --locked --features debug-mock-sgx \
# && mv /sapphire-paratime-git/runtime/target/release/sapphire-paratime / \
# && rm -rf sapphire-paratime-git

# Build sapphire-localnet
FROM postgres:16-alpine
RUN apk add --no-cache bash gcompat libseccomp jq binutils curl \
&& su -c "POSTGRES_USER=postgres POSTGRES_PASSWORD=postgres /usr/local/bin/docker-entrypoint.sh postgres &" postgres
&& su -c "POSTGRES_USER=postgres POSTGRES_PASSWORD=postgres /usr/local/bin/docker-entrypoint.sh postgres &" postgres

# Docker-specific variables
ENV PARATIME_VERSION=0.8.1-testnet
ENV PARATIME_NAME=sapphire
ARG PARATIME_VERSION
ARG PARATIME_NAME
ENV PARATIME_VERSION=${PARATIME_VERSION}
ENV PARATIME_NAME=${PARATIME_NAME}
ENV GATEWAY__CHAIN_ID=0x5afd

# start.sh and spinup-oasis-stack.sh ENV variables.
ENV OASIS_NODE_LOG_LEVEL=warn
ENV OASIS_NODE=/oasis-node
ENV OASIS_NET_RUNNER=/oasis-net-runner
ENV OASIS_NODE_BINARY=/oasis-node
ENV OASIS_NET_RUNNER_BINARY=/oasis-net-runner
ENV OASIS_NODE_DATADIR=/serverdir/node
ENV OASIS_WEB3_GATEWAY=/oasis-web3-gateway
ENV OASIS_DEPOSIT=/oasis-deposit
ENV OASIS_WEB3_GATEWAY_BINARY=/oasis-web3-gateway
ENV OASIS_DEPOSIT_BINARY=/oasis-deposit
ENV OASIS_WEB3_GATEWAY_CONFIG_FILE=/localnet.yml
ENV PARATIME=/ronl.elf
ENV PARATIME_BINARY=/ronl.elf
ENV KEYMANAGER_BINARY=/simple-keymanager
ENV CLI_BINARY=/oasis
ENV OASIS_CLI_BINARY=/oasis
ENV OASIS_UNSAFE_SKIP_AVR_VERIFY=1
ENV OASIS_UNSAFE_ALLOW_DEBUG_ENCLAVES=1
ENV OASIS_UNSAFE_MOCK_SGX=1

ARG VERSION

# oasis-node and oasis-net-runner
COPY --from=oasis-core-dev /oasis-core/go/oasis-node/oasis-node ${OASIS_NODE}
COPY --from=oasis-core-dev /oasis-core/go/oasis-net-runner/oasis-net-runner ${OASIS_NET_RUNNER}

# simple-keymanager
COPY --from=oasis-core-dev /oasis-core/target/release/simple-keymanager ${KEYMANAGER_BINARY}

# oasis-core-runtime-loader
COPY --from=oasis-core-dev /oasis-core/target/release/oasis-core-runtime-loader ${OASIS_CORE_RUNTIME_LOADER}

# cli
COPY --from=oasis-core-dev /cli/oasis ${CLI_BINARY}
# Copy local builds.
COPY --from=oasis-core-dev /simple-keymanager ${KEYMANAGER_BINARY}
COPY --from=oasis-core-dev /oasis-deposit ${OASIS_DEPOSIT_BINARY}
COPY --from=oasis-core-dev /oasis-web3-gateway ${OASIS_WEB3_GATEWAY_BINARY}
COPY --from=oasis-core-dev /oasis-node ${OASIS_NODE_BINARY}
COPY --from=oasis-core-dev /oasis-net-runner ${OASIS_NET_RUNNER_BINARY}
COPY --from=oasis-core-dev /oasis ${OASIS_CLI_BINARY}
COPY --from=oasis-core-dev /sapphire-paratime ${PARATIME_BINARY}

# oasis-web3-gateway binary, config, spinup-* scripts and staking_genesis.json.
COPY --from=oasis-web3-gateway /go/oasis-web3-gateway/oasis-web3-gateway ${OASIS_WEB3_GATEWAY}
COPY --from=oasis-web3-gateway /go/oasis-web3-gateway/docker/common/oasis-deposit/oasis-deposit ${OASIS_DEPOSIT}
COPY docker/common/localnet.yml ${OASIS_WEB3_GATEWAY_CONFIG_FILE}
COPY docker/common/start.sh /
COPY tests/tools/* /

# Configure paratime.
# XXX: Build locally.
COPY docker/sapphire-localnet/sapphire-paratime ${PARATIME}
RUN echo "Configure the ParaTime." \
# && mkdir -p "$(dirname ${PARATIME})" \
# && wget --quiet "https://github.com/oasisprotocol/${PARATIME_NAME}-paratime/releases/download/v${PARATIME_VERSION}/localnet-${PARATIME_NAME}-paratime.orc" -O "/paratime.orc" \
# && unzip "paratime.orc" \
# && chmod a+x "runtime.elf" \
# && rm "paratime.orc" \
# && echo "" \
&& echo "Write VERSION information." \
&& echo "${VERSION}" > /VERSION \
&& strip -S -x ${OASIS_NET_RUNNER} ${OASIS_NODE} ${KEYMANAGER_BINARY} ${CLI_BINARY} \
&& echo "" \
&& ls -l / \
&& echo "" \
&& echo "*** Oasis Node:" \
&& ${OASIS_NODE} --version \
&& echo "" \
&& echo "*** Oasis CLI:" \
&& ${CLI_BINARY} --version \
&& echo ""
RUN echo "Write VERSION information." \
&& echo "${VERSION}" > /VERSION \
&& strip -S -x ${OASIS_WEB3_GATEWAY_BINARY} ${OASIS_DEPOSIT_BINARY} ${OASIS_NET_RUNNER_BINARY} ${OASIS_NODE_BINARY} ${KEYMANAGER_BINARY} ${OASIS_CLI_BINARY} \
&& echo "" \
&& ls -l / \
&& echo "" \
&& echo "*** Oasis Node:" \
&& ${OASIS_NODE_BINARY} --version \
&& echo "" \
&& echo "*** Oasis CLI:" \
&& ${OASIS_CLI_BINARY} --version \
&& echo ""

# Web3 gateway http and ws ports.
EXPOSE 8545/tcp
Expand Down
16 changes: 8 additions & 8 deletions tests/tools/spinup-oasis-stack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ set -euo pipefail

# This script spins up local oasis node configured with the provided EVM ParaTime.
# Supported ENV Variables:
# - OASIS_NODE: path to oasis-node binary
# - OASIS_NET_RUNNER: path to oasis-net-runner binary
# - OASIS_NODE_BINARY: path to oasis-node binary
# - OASIS_NET_RUNNER_BINARY: path to oasis-net-runner binary
# - BEACON_BACKEND: choose 'mock' backend (default), or use other behavior
# - PARATIME: path to ParaTime binary (inside .orc bundle)
# - PARATIME_BINARY: path to ParaTime binary (inside .orc bundle)
# - PARATIME_VERSION: version of the binary. e.g. 3.0.0
# - OASIS_NODE_DATADIR: path to temporary oasis-node data dir e.g. /tmp/oasis-localnet
# - KEYMANAGER_BINARY: path to key manager binary e.g. simple-keymanager
Expand All @@ -32,14 +32,14 @@ if [ ! -z "${KEYMANAGER_BINARY:-}" ]; then
fi

# Prepare configuration for oasis-node (fixture).
${OASIS_NET_RUNNER} dump-fixture \
${OASIS_NET_RUNNER_BINARY} dump-fixture \
--fixture.default.tee_hardware "${TEE_HARDWARE}" \
--fixture.default.node.binary "${OASIS_NODE}" \
--fixture.default.node.binary "${OASIS_NODE_BINARY}" \
--fixture.default.deterministic_entities \
--fixture.default.fund_entities \
--fixture.default.num_entities 2 \
--fixture.default.keymanager.binary "${KEYMANAGER_BINARY:-}" \
--fixture.default.runtime.binary "${PARATIME}" \
--fixture.default.runtime.binary "${PARATIME_BINARY}" \
--fixture.default.runtime.provisioner "unconfined" \
--fixture.default.runtime.version "$(paratime_ver 1).$(paratime_ver 2).$(paratime_ver 3)" \
--fixture.default.halt_epoch 100000 \
Expand All @@ -55,7 +55,7 @@ fi
if [ ! -z "${KEYMANAGER_BINARY:-}" ]; then
jq "
.runtimes[0].deployments[0].components[0].binaries.\"0\" = \"${KEYMANAGER_BINARY}\" |
.runtimes[${RT_IDX}].deployments[0].components[0].binaries.\"0\" = \"${PARATIME}\"
.runtimes[${RT_IDX}].deployments[0].components[0].binaries.\"0\" = \"${PARATIME_BINARY}\"
" "$FIXTURE_FILE" >"$FIXTURE_FILE.tmp"
mv "$FIXTURE_FILE.tmp" "$FIXTURE_FILE"
fi
Expand Down Expand Up @@ -106,4 +106,4 @@ jq ".runtimes[${RT_IDX}].txn_scheduler.batch_flush_timeout=1000000000" "$FIXTURE
mv "$FIXTURE_FILE.tmp" "$FIXTURE_FILE"

# Run oasis-node.
${OASIS_NET_RUNNER} --fixture.file "$FIXTURE_FILE" --basedir "${OASIS_NODE_DATADIR}" --basedir.no_temp_dir $@
${OASIS_NET_RUNNER_BINARY} --fixture.file "$FIXTURE_FILE" --basedir "${OASIS_NODE_DATADIR}" --basedir.no_temp_dir $@

0 comments on commit 8673fff

Please sign in to comment.