diff --git a/docker/common/start.sh b/docker/common/start.sh index 3e9b4264..bb6bbd90 100755 --- a/docker/common/start.sh +++ b/docker/common/start.sh @@ -67,7 +67,7 @@ fi T_START="$(date +%s)" notice "Starting oasis-net-runner with ${CYAN}${PARATIME_NAME}${OFF}...\n" -/spinup-oasis-stack.sh --log.level info 2>1 &>/var/log/spinup-oasis-stack.log & +/spinup-oasis-stack.sh --log.level warn 2>1 &>/var/log/spinup-oasis-stack.log & OASIS_NODE_PID=$! notice "Starting postgres...\n" diff --git a/docker/sapphire-localnet/Dockerfile b/docker/sapphire-localnet/Dockerfile index 7cf79de9..94ecb3a7 100644 --- a/docker/sapphire-localnet/Dockerfile +++ b/docker/sapphire-localnet/Dockerfile @@ -8,11 +8,15 @@ RUN cd oasis-web3-gateway && make && strip -S -x oasis-web3-gateway docker/commo FROM ghcr.io/oasisprotocol/oasis-core-dev:stable-23.0.x AS oasis-core-dev ENV OASIS_UNSAFE_SKIP_KM_POLICY=1 +ENV OASIS_CORE_VERSION=master ENV OASIS_CLI_VERSION=0.7.1 -RUN git clone https://github.com/oasisprotocol/oasis-core.git --branch stable/23.0.x --depth 1 \ +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 build --release \ + && CARGO_PROFILE_RELEASE_LTO=true CARGO_PROFILE_RELEASE_OPT_LEVEL=s CARGO_PROFILE_RELEASE_CODEGEN_UNITS=1 cargo build --release \ && cd ../../../../ \ && git clone https://github.com/oasisprotocol/cli.git --branch v${OASIS_CLI_VERSION} --depth 1 \ && cd cli \ @@ -24,7 +28,6 @@ RUN apk add --no-cache bash gcompat libseccomp jq binutils \ && su -c "POSTGRES_USER=postgres POSTGRES_PASSWORD=postgres /usr/local/bin/docker-entrypoint.sh postgres &" postgres # Docker-specific variables -ENV OASIS_CORE_VERSION=23.0.9 ENV PARATIME_VERSION=0.7.0 ENV PARATIME_NAME=sapphire ENV GATEWAY__CHAIN_ID=0x5afd @@ -38,17 +41,22 @@ ENV OASIS_DEPOSIT=/oasis-deposit ENV OASIS_WEB3_GATEWAY_CONFIG_FILE=/localnet.yml ENV PARATIME=/runtime.elf ENV KEYMANAGER_BINARY=/simple-keymanager +ENV CLI_BINARY=/oasis ENV OASIS_UNSAFE_SKIP_AVR_VERIFY=1 ENV OASIS_UNSAFE_SKIP_KM_POLICY=1 ENV OASIS_UNSAFE_ALLOW_DEBUG_ENCLAVES=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} # cli -COPY --from=oasis-core-dev /cli/oasis /oasis +COPY --from=oasis-core-dev /cli/oasis ${CLI_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} @@ -57,16 +65,8 @@ 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}" \ - && rm "oasis_core_${OASIS_CORE_VERSION}_linux_amd64.tar.gz" \ - && rm -rf "oasis_core_${OASIS_CORE_VERSION}_linux_amd64" \ - && echo "" \ - && echo "Configure the ParaTime." \ +# Configure 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" \ @@ -75,7 +75,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 /simple-keymanager \ + && strip -S -x ${OASIS_NET_RUNNER} ${OASIS_NODE} ${KEYMANAGER_BINARY} ${CLI_BINARY} \ && echo "" \ && ls -l / \ && echo "" \ @@ -83,7 +83,7 @@ RUN wget --quiet "https://github.com/oasisprotocol/oasis-core/releases/download/ && ${OASIS_NODE} --version \ && echo "" \ && echo "*** Oasis CLI:" \ - && /oasis --version \ + && ${CLI_BINARY} --version \ && echo "" # Web3 gateway http and ws ports.