Skip to content

Commit

Permalink
Merge pull request #641 from oasisprotocol/ptrus/feature/nexus-update
Browse files Browse the repository at this point in the history
feat(localnet): update nexus to 0.4.1 and exlporer
  • Loading branch information
ptrus authored Nov 12, 2024
2 parents 7d95d6d + a941da4 commit bc56a08
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 57 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ bind-mounting the runtime state directory (`/serverdir/node`) into your local
filesystem.

```bash
docker run --rm -ti -80:80 -p5432:5432 -p8544-8547:8544-8547 -v /tmp/eth-runtime-test:/serverdir/node ghcr.io/oasisprotocol/sapphire-localnet:local -test-mnemonic -n 4
docker run --rm -ti -p5432:5432 -p8544-8548:8544-8548 -v /tmp/eth-runtime-test:/serverdir/node ghcr.io/oasisprotocol/sapphire-localnet:local
```

If needed, the `oasis-web3-gateway` or `sapphire-paratime` executables could also be
Expand All @@ -46,7 +46,7 @@ the full gateway & paratime stack together.
For running tests, start the docker network without the gateway, by setting the `OASIS_DOCKER_NO_GATEWAY=yes` environment variable:

```bash
docker run --rm -ti -e OASIS_DOCKER_NO_GATEWAY=yes -p80:80 -p5432:5432 -p8544-8547:8544-8547 -v /tmp/eth-runtime-test:/serverdir/node ghcr.io/oasisprotocol/sapphire-localnet:local -test-mnemonic -n 4
docker run --rm -ti -e OASIS_DOCKER_NO_GATEWAY=yes -p5432:5432 -p8544-8548:8544-8548 -v /tmp/eth-runtime-test:/serverdir/node ghcr.io/oasisprotocol/sapphire-localnet:local
```

Once bootstrapped, run the tests:
Expand Down
6 changes: 3 additions & 3 deletions docker/common/explorer.env
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ REACT_APP_BUILD_SHA=sha0000000000000000000000000000000000000
REACT_APP_BUILD_VERSION=
REACT_APP_PRIVACY_POLICY=https://oasisprotocol.org/privacy-policy
REACT_APP_ENABLE_OASIS_MATOMO_ANALYTICS=false
REACT_APP_API=http://localhost:8547/v1/
REACT_APP_TESTNET_API=http://localhost:8547/v1/
REACT_APP_LOCALNET_API=http://localhost:8547/v1/
REACT_APP_META_TITLE="Oasis Explorer - Localnet"
REACT_APP_META_IMAGE="Oasis Explorer - OpenGraph Banner.png"
REACT_APP_META_MANIFEST=app.webmanifest
REACT_APP_META_FAVICON=favicon.svg
REACT_APP_META_APPLE_ICON="Icon Blue 192.png"
REACT_APP_META_DESC="Official explorer for the Oasis Network - Localnet"
REACT_APP_SHOW_BUILD_BANNERS=true
REACT_APP_FIXED_NETWORK=testnet
REACT_APP_FIXED_NETWORK=localnet
REACT_APP_SHOW_FIAT_VALUES=false
REACT_APP_LOCALNET_CONSENSUS=true
2 changes: 1 addition & 1 deletion docker/common/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ 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}

export EXPLORER_PORT=${EXPLORER_PORT:-80}
export EXPLORER_PORT=${EXPLORER_PORT:-8548}

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//')
Expand Down
51 changes: 26 additions & 25 deletions docker/emerald-localnet/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,34 @@ RUN cd oasis-web3-gateway && make && strip -S -x oasis-web3-gateway

FROM ghcr.io/oasisprotocol/oasis-core-dev:stable-24.2.x AS oasis-core-dev

# ARG NEXUS_VERSION=0.4.0
# RUN wget https://github.com/oasisprotocol/nexus/releases/download/v${NEXUS_VERSION}/oasis_nexus_${NEXUS_VERSION}_linux_amd64.tar.gz \
# && tar -zxvf oasis_nexus_${NEXUS_VERSION}_linux_amd64.tar.gz \
# && strip -S -x /oasis_nexus_${NEXUS_VERSION}_linux_amd64/nexus \
# && mv /oasis_nexus_${NEXUS_VERSION}_linux_amd64/nexus / \
# && rm -rf /oasis_nexus_${NEXUS_VERSION}_linux_amd64* && \
# # We also need to fetch the storage migrations.
# git clone https://github.com/oasisprotocol/nexus.git nexus-git --branch v${NEXUS_VERSION} --depth 1 \
# && mv /nexus-git/storage/migrations /nexus-migrations \
# && rm -rf nexus-git
ARG NEXUS_VERSION=main
RUN git clone https://github.com/oasisprotocol/nexus.git nexus-git --depth 1 \
&& cd nexus-git \
&& git fetch --depth 1 origin ${NEXUS_VERSION} \
&& git checkout ${NEXUS_VERSION} \
&& go install github.com/deepmap/oapi-codegen/cmd/[email protected] \
&& make codegen-go \
&& go build \
&& strip -S -x /nexus-git/nexus \
&& mv /nexus-git/nexus / \
ARG NEXUS_VERSION=0.4.1
RUN wget https://github.com/oasisprotocol/nexus/releases/download/v${NEXUS_VERSION}/oasis_nexus_${NEXUS_VERSION}_linux_amd64.tar.gz \
&& tar -zxvf oasis_nexus_${NEXUS_VERSION}_linux_amd64.tar.gz \
&& strip -S -x /oasis_nexus_${NEXUS_VERSION}_linux_amd64/nexus \
&& mv /oasis_nexus_${NEXUS_VERSION}_linux_amd64/nexus / \
&& rm -rf /oasis_nexus_${NEXUS_VERSION}_linux_amd64* && \
# We also need to fetch the storage migrations.
git clone https://github.com/oasisprotocol/nexus.git nexus-git --branch v${NEXUS_VERSION} --depth 1 \
&& mv /nexus-git/storage/migrations /nexus-migrations \
&& rm -rf /nexus-git
&& rm -rf nexus-git
# ARG NEXUS_VERSION=main
# RUN git clone https://github.com/oasisprotocol/nexus.git nexus-git --depth 1 \
# && cd nexus-git \
# && git fetch --depth 1 origin ${NEXUS_VERSION} \
# && git checkout ${NEXUS_VERSION} \
# && go install github.com/deepmap/oapi-codegen/cmd/[email protected] \
# && make codegen-go \
# && go build \
# && strip -S -x /nexus-git/nexus \
# && mv /nexus-git/nexus / \
# && mv /nexus-git/storage/migrations /nexus-migrations \
# && rm -rf /nexus-git

# ARG EXPLORER_REPO=https://github.com/oasisprotocol/explorer.git
# ARG EXPLORER_VERSION=v1.13.0
# TODO: update once some support for localnet is added: https://github.com/oasisprotocol/explorer/issues/1597
ARG EXPLORER_REPO=https://github.com/ptrus/explorer.git
ARG EXPLORER_VERSION=1a78782e10fa266707a428c5fd8ba91966d588a1
ARG EXPLORER_REPO=https://github.com/oasisprotocol/explorer.git
ARG EXPLORER_VERSION=bcb125108db2f6439fcdd536f690b0edfd38aad7
COPY docker/common/explorer.env /nexus.env.production
RUN git clone ${EXPLORER_REPO} explorer --depth 1 \
&& cd explorer \
Expand Down Expand Up @@ -133,15 +133,16 @@ RUN wget --quiet "https://github.com/oasisprotocol/oasis-core/releases/download/
&& echo "${VERSION}" > /VERSION \
&& strip -S -x ${OASIS_NET_RUNNER_BINARY} ${OASIS_NODE_BINARY} ${OASIS_CLI_BINARY}

# Explorer port.
EXPOSE 80/tcp

# Envoy proxy port.
EXPOSE 8544/tcp
# Web3 gateway http and ws ports.
EXPOSE 8545/tcp
EXPOSE 8546/tcp
# Nexus port.
EXPOSE 8547/tcp
# Explorer port.
EXPOSE 8548/tcp

USER root
ENTRYPOINT ["/start.sh"]
52 changes: 26 additions & 26 deletions docker/sapphire-localnet/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -71,34 +71,34 @@ RUN wget https://github.com/oasisprotocol/${PARATIME_NAME}-paratime/releases/dow
# && mv /sapphire-paratime-git/runtime/target/release/sapphire-paratime / \
# && rm -rf sapphire-paratime-git

# ARG NEXUS_VERSION=0.4.0
# RUN wget https://github.com/oasisprotocol/nexus/releases/download/v${NEXUS_VERSION}/oasis_nexus_${NEXUS_VERSION}_linux_amd64.tar.gz \
# && tar -zxvf oasis_nexus_${NEXUS_VERSION}_linux_amd64.tar.gz \
# && strip -S -x /oasis_nexus_${NEXUS_VERSION}_linux_amd64/nexus \
# && mv /oasis_nexus_${NEXUS_VERSION}_linux_amd64/nexus / \
# && rm -rf /oasis_nexus_${NEXUS_VERSION}_linux_amd64* && \
# # We also need to fetch the storage migrations.
# git clone https://github.com/oasisprotocol/nexus.git nexus-git --branch v${NEXUS_VERSION} --depth 1 \
# && mv /nexus-git/storage/migrations /nexus-migrations \
# && rm -rf nexus-git
ARG NEXUS_VERSION=main
RUN git clone https://github.com/oasisprotocol/nexus.git nexus-git --depth 1 \
&& cd nexus-git \
&& git fetch --depth 1 origin ${NEXUS_VERSION} \
&& git checkout ${NEXUS_VERSION} \
&& go install github.com/deepmap/oapi-codegen/cmd/[email protected] \
&& make codegen-go \
&& go build \
&& strip -S -x /nexus-git/nexus \
&& mv /nexus-git/nexus / \
ARG NEXUS_VERSION=0.4.1
RUN wget https://github.com/oasisprotocol/nexus/releases/download/v${NEXUS_VERSION}/oasis_nexus_${NEXUS_VERSION}_linux_amd64.tar.gz \
&& tar -zxvf oasis_nexus_${NEXUS_VERSION}_linux_amd64.tar.gz \
&& strip -S -x /oasis_nexus_${NEXUS_VERSION}_linux_amd64/nexus \
&& mv /oasis_nexus_${NEXUS_VERSION}_linux_amd64/nexus / \
&& rm -rf /oasis_nexus_${NEXUS_VERSION}_linux_amd64* && \
# We also need to fetch the storage migrations.
git clone https://github.com/oasisprotocol/nexus.git nexus-git --branch v${NEXUS_VERSION} --depth 1 \
&& mv /nexus-git/storage/migrations /nexus-migrations \
&& rm -rf /nexus-git
&& rm -rf nexus-git
# ARG NEXUS_VERSION=main
# RUN git clone https://github.com/oasisprotocol/nexus.git nexus-git --depth 1 \
# && cd nexus-git \
# && git fetch --depth 1 origin ${NEXUS_VERSION} \
# && git checkout ${NEXUS_VERSION} \
# && go install github.com/deepmap/oapi-codegen/cmd/[email protected] \
# && make codegen-go \
# && go build \
# && strip -S -x /nexus-git/nexus \
# && mv /nexus-git/nexus / \
# && mv /nexus-git/storage/migrations /nexus-migrations \
# && rm -rf /nexus-git

# ARG EXPLORER_REPO=https://github.com/oasisprotocol/explorer.git
# ARG EXPLORER_VERSION=v1.13.0
# TODO: update once some support for localnet is added: https://github.com/oasisprotocol/explorer/issues/1597
ARG EXPLORER_REPO=https://github.com/ptrus/explorer.git
ARG EXPLORER_VERSION=1a78782e10fa266707a428c5fd8ba91966d588a1
# TODO: Update to a released version once a version with localnet explorer support is available (https://github.com/oasisprotocol/explorer/issues/1597).
ARG EXPLORER_REPO=https://github.com/oasisprotocol/explorer.git
ARG EXPLORER_VERSION=3a32a5080a65ed7e5cfd48586a4cd892a7c881c2
COPY docker/common/explorer.env /nexus.env.production
RUN git clone ${EXPLORER_REPO} explorer --depth 1 \
&& cd explorer \
Expand Down Expand Up @@ -196,15 +196,15 @@ RUN echo "Write VERSION information." \
&& ${OASIS_CLI_BINARY} --version \
&& echo

# Explorer port.
EXPOSE 80/tcp
# Envoy proxy port.
EXPOSE 8544/tcp
# Web3 gateway http and ws ports.
EXPOSE 8545/tcp
EXPOSE 8546/tcp
# Nexus port.
EXPOSE 8547/tcp
# Explorer port.
EXPOSE 8548/tcp

USER root
ENTRYPOINT ["/start.sh"]

0 comments on commit bc56a08

Please sign in to comment.