From 7b1de09ba1e2426a82f95d172734a9a9900df7f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matev=C5=BE=20Jekovec?= Date: Mon, 15 Jan 2024 12:23:47 +0100 Subject: [PATCH 1/2] fix: Rename Docker emerald and sapphire -dev to -localnet --- .../{docker-dev.yml => docker-localnet.yml} | 4 ++-- Makefile | 10 +++++----- docker/README.md | 12 ++++++------ docker/common/start.sh | 2 +- docker/{emerald-dev => emerald-localnet}/Dockerfile | 2 +- docker/{emerald-dev => emerald-localnet}/test.sh | 4 ++-- .../{sapphire-dev => sapphire-localnet}/Dockerfile | 2 +- docker/{sapphire-dev => sapphire-localnet}/test.sh | 4 ++-- 8 files changed, 20 insertions(+), 20 deletions(-) rename .github/workflows/{docker-dev.yml => docker-localnet.yml} (96%) rename docker/{emerald-dev => emerald-localnet}/Dockerfile (99%) rename docker/{emerald-dev => emerald-localnet}/test.sh (88%) rename docker/{sapphire-dev => sapphire-localnet}/Dockerfile (99%) rename docker/{sapphire-dev => sapphire-localnet}/test.sh (91%) diff --git a/.github/workflows/docker-dev.yml b/.github/workflows/docker-localnet.yml similarity index 96% rename from .github/workflows/docker-dev.yml rename to .github/workflows/docker-localnet.yml index 7dc46920..d2eee051 100644 --- a/.github/workflows/docker-dev.yml +++ b/.github/workflows/docker-localnet.yml @@ -1,4 +1,4 @@ -name: docker-dev +name: docker-localnet on: push: @@ -12,7 +12,7 @@ jobs: docker: strategy: matrix: - docker_image: [emerald-dev, sapphire-dev] + docker_image: [emerald-localnet, sapphire-localnet] runs-on: ubuntu-latest steps: - name: Checkout code diff --git a/Makefile b/Makefile index 606648d4..4f161a4f 100644 --- a/Makefile +++ b/Makefile @@ -55,13 +55,13 @@ lint: $(lint-targets) release-build: @goreleaser release --rm-dist -docker: docker-emerald-dev docker-sapphire-dev +docker: docker-emerald-localnet docker-sapphire-localnet -docker-emerald-dev: - @docker build -t ghcr.io/oasisprotocol/emerald-dev:local --build-arg VERSION=local -f docker/emerald-dev/Dockerfile . +docker-emerald-localnet: + @docker build -t ghcr.io/oasisprotocol/emerald-localnet:local --build-arg VERSION=local -f docker/emerald-localnet/Dockerfile . -docker-sapphire-dev: - @docker build -t ghcr.io/oasisprotocol/sapphire-dev:local --build-arg VERSION=local -f docker/sapphire-dev/Dockerfile . +docker-sapphire-localnet: + @docker build -t ghcr.io/oasisprotocol/sapphire-localnet:local --build-arg VERSION=local -f docker/sapphire-localnet/Dockerfile . # List of targets that are not actual files. diff --git a/docker/README.md b/docker/README.md index feca26ad..9005bc59 100644 --- a/docker/README.md +++ b/docker/README.md @@ -10,8 +10,8 @@ set up localnet for developing dApps running on Emerald or Sapphire: ## Prebuilt images -Oasis provides prebuilt `emerald-dev` and `sapphire-dev` docker images. `latest` -versions are based on: +Oasis provides prebuilt `emerald-localnet` and `sapphire-localnet` docker +images. `latest` versions are based on: - `stable` branch of `oasis-core`, - `master` branch of `oasis-sdk`, - `main` branch of `oasis-web3-gateway` repository. @@ -19,8 +19,8 @@ versions are based on: To use the precompiled images, run: ```sh -docker run -it -p8545:8545 -p8546:8546 ghcr.io/oasisprotocol/emerald-dev # Emerald -docker run -it -p8545:8545 -p8546:8546 ghcr.io/oasisprotocol/sapphire-dev # Sapphire +docker run -it -p8545:8545 -p8546:8546 ghcr.io/oasisprotocol/emerald-localnet # Emerald +docker run -it -p8545:8545 -p8546:8546 ghcr.io/oasisprotocol/sapphire-localnet # Sapphire ``` ## Build image locally @@ -35,8 +35,8 @@ make docker To run the compiled image type: ```sh -docker run -it -p8545:8545 -p8546:8546 ghcr.io/oasisprotocol/emerald-dev:local -docker run -it -p8545:8545 -p8546:8546 ghcr.io/oasisprotocol/sapphire-dev:local +docker run -it -p8545:8545 -p8546:8546 ghcr.io/oasisprotocol/emerald-localnet:local +docker run -it -p8545:8545 -p8546:8546 ghcr.io/oasisprotocol/sapphire-localnet:local ``` ## Usage diff --git a/docker/common/start.sh b/docker/common/start.sh index ecc384c2..f6af02c2 100755 --- a/docker/common/start.sh +++ b/docker/common/start.sh @@ -19,7 +19,7 @@ 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//') VERSION=$(cat /VERSION) -echo "${PARATIME_NAME}-dev ${VERSION} (oasis-core: ${OASIS_CORE_VERSION}, ${PARATIME_NAME}-paratime: ${PARATIME_VERSION}, oasis-web3-gateway: ${OASIS_WEB3_GATEWAY_VERSION})" +echo "${PARATIME_NAME}-localnet ${VERSION} (oasis-core: ${OASIS_CORE_VERSION}, ${PARATIME_NAME}-paratime: ${PARATIME_VERSION}, oasis-web3-gateway: ${OASIS_WEB3_GATEWAY_VERSION})" echo export BEACON_BACKEND=${BEACON_BACKEND:-mock} diff --git a/docker/emerald-dev/Dockerfile b/docker/emerald-localnet/Dockerfile similarity index 99% rename from docker/emerald-dev/Dockerfile rename to docker/emerald-localnet/Dockerfile index dd3259ea..c28a996b 100644 --- a/docker/emerald-dev/Dockerfile +++ b/docker/emerald-localnet/Dockerfile @@ -4,7 +4,7 @@ FROM golang:1.21 AS oasis-web3-gateway COPY . /go/oasis-web3-gateway RUN cd oasis-web3-gateway && make && strip -S -x oasis-web3-gateway docker/common/oasis-deposit/oasis-deposit -# Build emerald-dev +# Build emerald-localnet FROM postgres:16-alpine 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 diff --git a/docker/emerald-dev/test.sh b/docker/emerald-localnet/test.sh similarity index 88% rename from docker/emerald-dev/test.sh rename to docker/emerald-localnet/test.sh index c7e7d80d..aa27b499 100755 --- a/docker/emerald-dev/test.sh +++ b/docker/emerald-localnet/test.sh @@ -2,8 +2,8 @@ set -euo pipefail -TAG=${TAG:-ghcr.io/oasisprotocol/emerald-dev:local} -NAME="emerald-dev-test" +TAG=${TAG:-ghcr.io/oasisprotocol/emerald-localnet:local} +NAME="emerald-localnet-test" cleanup() { # Print standard output content. diff --git a/docker/sapphire-dev/Dockerfile b/docker/sapphire-localnet/Dockerfile similarity index 99% rename from docker/sapphire-dev/Dockerfile rename to docker/sapphire-localnet/Dockerfile index dbf70c20..7cf79de9 100644 --- a/docker/sapphire-dev/Dockerfile +++ b/docker/sapphire-localnet/Dockerfile @@ -18,7 +18,7 @@ RUN git clone https://github.com/oasisprotocol/oasis-core.git --branch stable/23 && cd cli \ && make CGO_ENABLED=0 -# Build sapphire-dev +# Build sapphire-localnet FROM postgres:16-alpine 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 diff --git a/docker/sapphire-dev/test.sh b/docker/sapphire-localnet/test.sh similarity index 91% rename from docker/sapphire-dev/test.sh rename to docker/sapphire-localnet/test.sh index ff573c6e..422dd56f 100755 --- a/docker/sapphire-dev/test.sh +++ b/docker/sapphire-localnet/test.sh @@ -2,8 +2,8 @@ set -euo pipefail -TAG=${TAG:-ghcr.io/oasisprotocol/sapphire-dev:local} -NAME="sapphire-dev-test" +TAG=${TAG:-ghcr.io/oasisprotocol/sapphire-localnet:local} +NAME="sapphire-localnet-test" cleanup() { # Print standard output content. From 2949d2e0447c2da348820745dbdebc3b2dce2af8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matev=C5=BE=20Jekovec?= Date: Tue, 16 Jan 2024 11:10:52 +0100 Subject: [PATCH 2/2] feat: Show chain ID in docker --- docker/common/start.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/common/start.sh b/docker/common/start.sh index f6af02c2..3e9b4264 100755 --- a/docker/common/start.sh +++ b/docker/common/start.sh @@ -112,7 +112,7 @@ T_END="$(date +%s)" echo printf "${YELLOW}WARNING: The chain is running in ephemeral mode. State will be lost after restart!${OFF}\n\n" -notice "Listening on ${CYAN}http://localhost:8545${OFF} and ${CYAN}ws://localhost:8546${OFF}\n" +notice "Listening on ${CYAN}http://localhost:8545${OFF} and ${CYAN}ws://localhost:8546${OFF}. Chain ID: ${GATEWAY__CHAIN_ID}\n" notice "Container start-up took ${CYAN}$((T_END-T_START))${OFF} seconds.\n" if [[ ${BEACON_BACKEND} == 'mock' ]]; then