From 24923294379ce2d768582d8f38c81585cdb423f2 Mon Sep 17 00:00:00 2001 From: shreyasbhat0 Date: Fri, 13 Sep 2024 14:33:24 +0530 Subject: [PATCH 1/4] fix: scripts genesis --- scripts/genesis.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/genesis.sh b/scripts/genesis.sh index b2b0872c..f4e43d8f 100755 --- a/scripts/genesis.sh +++ b/scripts/genesis.sh @@ -94,10 +94,18 @@ if [ ! -f ~/.arkeo/config/genesis.json ]; then add_account "$BOB" $TOKEN 1000000000000000 # bob, 1m add_claim_records "ARKEO" "$BOB" 1000 1000 1000 true + # Thorchain derived test addresses + add_account "tarkeo1dllfyp57l4xj5umqfcqy6c2l3xfk0qk6zpc3t7" $TOKEN 1000000000000000 # bob, 10m + add_claim_records "ARKEO" "ch" 1000 1000 1000 true + add_account "tarkeo1xrz7z3zwtpc45xm72tpnevuf3wn53re8q4u4nr" $TOKEN 1000000000000000 + add_claim_records "ARKEO" "tarkeo1xrz7z3zwtpc45xm72tpnevuf3wn53re8q4u4nr" 1000 1000 1000 true + # add_claim_records "ARKEO" "{YOUR ARKEO ADDRESS}" 500000 500000 500000 true # add_account "{YOUR ARKEO ADDRESS}" $TOKEN 1000000000000000 # add_claim_records "ETHEREUM" "{YOUR ETH ADDRESS}" 500000 600000 700000 true + add_claim_records "ETHEREUM" "0x92E14917A0508Eb56C90C90619f5F9Adbf49f47d" 500000 600000 700000 true + # enable CORs on testnet/localnet sed -i 's/enabled-unsafe-cors = false/enabled-unsafe-cors = true/g' ~/.arkeo/config/app.toml @@ -107,6 +115,7 @@ if [ ! -f ~/.arkeo/config/genesis.json ]; then sed -i 's/"stake"/"uarkeo"/g' ~/.arkeo/config/genesis.json sed -i 's/enable = false/enable = true/g' ~/.arkeo/config/app.toml sed -i 's/127.0.0.1:26657/0.0.0.0:26657/g' ~/.arkeo/config/config.toml + sed -i 's/address = "tcp:\/\/localhost:1317"/address = "tcp:\/\/0.0.0.0:1317"/g' ~/.arkeo/config/app.toml # Update the supply field in genesis.json using jq jq --arg DENOM "$TOKEN" --arg AMOUNT "$TOTAL_SUPPLY" '.app_state.bank.supply = [{"denom": $DENOM, "amount": $AMOUNT}]' <~/.arkeo/config/genesis.json >/tmp/genesis.json From 9ee884a90858ff5ef4004e2ad78d52af11b94f42 Mon Sep 17 00:00:00 2001 From: shreyasbhat0 Date: Fri, 13 Sep 2024 14:33:46 +0530 Subject: [PATCH 2/4] fix: update docker file --- Dockerfile.localnet | 61 ++++++++++++++++++++++++++++++++++++ docker-compose-localnet.yaml | 19 ++++++----- 2 files changed, 73 insertions(+), 7 deletions(-) create mode 100644 Dockerfile.localnet diff --git a/Dockerfile.localnet b/Dockerfile.localnet new file mode 100644 index 00000000..d982bdde --- /dev/null +++ b/Dockerfile.localnet @@ -0,0 +1,61 @@ +# +# Arkeo +# + +ARG GO_VERSION="1.21" + +# +# Build +# +FROM golang:${GO_VERSION} as builder + +ARG GIT_VERSION +ARG GIT_COMMIT + +ENV GOBIN=/go/bin +ENV GOPATH=/go +ENV CGO_ENABLED=0 +ENV GOOS=linux + +RUN go install github.com/jackc/tern/v2@latest + +# Download go dependencies +WORKDIR /app +COPY go.mod go.sum ./ +RUN go mod download +COPY . . +ARG TAG=testnet +RUN make install + +# +# Main +# +FROM ubuntu:lunar + +# hadolint ignore=DL3008,DL4006 +RUN apt-get update -y && \ + apt-get upgrade -y && \ + apt-get install -y --no-install-recommends \ + jq curl htop vim ca-certificates && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +RUN update-ca-certificates + +# Copy the compiled binaries over. +COPY --from=builder /go/bin/sentinel /go/bin/arkeod /go/bin/indexer /go/bin/api /go/bin/tern /usr/bin/ +COPY scripts /scripts + +ARG TAG=testnet +ENV NET=$TAG + +EXPOSE 1317 + +EXPOSE 26656 + +EXPOSE 26657 + +ENTRYPOINT ["scripts/genesis.sh"] + +# default to fullnode +CMD ["arkeod", "start"] \ No newline at end of file diff --git a/docker-compose-localnet.yaml b/docker-compose-localnet.yaml index 0d133b89..dbca2e6e 100644 --- a/docker-compose-localnet.yaml +++ b/docker-compose-localnet.yaml @@ -1,16 +1,21 @@ ---- version: "3" services: node: - image: ghcr.io/arkeonetwork/arkeo-dev:${IMAGE_TAG} + image: ${IMAGE_TAG} + build: + context: . + dockerfile: Dockerfile.localnet # Ensure the Dockerfile is correctly referenced entrypoint: - - sh - - /opt/genesis.sh + - bash + - -c + - | + ./genesis.sh && \ + arkeod start ports: - - 9090:9090 + - 1317:1317 - 26657:26657 - 26656:26656 volumes: - - ./scripts:/opt:z - working_dir: /opt \ No newline at end of file + - ./scripts:/scripts:z + working_dir: /scripts From 9036dfdbaa81ff3dec8c53cdad89611f6417f169 Mon Sep 17 00:00:00 2001 From: shreyasbhat0 Date: Fri, 13 Sep 2024 14:33:57 +0530 Subject: [PATCH 3/4] fix: update make file --- Makefile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 13b54df2..2ca9831f 100644 --- a/Makefile +++ b/Makefile @@ -135,11 +135,15 @@ docker-build-cross: --clean \ --snapshot +build-docker-localnet: + @docker build . --file Dockerfile.localnet -t ${IMAGE}:${TAG} +# localnet: build-docker +# IMAGE_TAG=$(SHORT_COMMIT)-$(IMAGE_ARCH) docker-compose -f docker-compose-localnet.yaml up -localnet: build-docker - IMAGE_TAG=$(SHORT_COMMIT)-$(IMAGE_ARCH) docker-compose -f docker-compose-localnet.yaml up +localnet: build-docker-localnet + IMAGE_TAG=${IMAGE}:${TAG} docker-compose -f docker-compose-localnet.yaml up # ------------------------------ Testnet ------------------------------ install-testnet-binary: From b9490c93d5b0d70c38d63e02e04dfdd901faa8d2 Mon Sep 17 00:00:00 2001 From: shreyasbhat0 Date: Fri, 13 Sep 2024 16:47:03 +0530 Subject: [PATCH 4/4] chore: update change log --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 673fd1d1..30af6cb6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,8 @@ Contains all the PRs that improved the code without changing the behaviors. - Updated Docs - Fixed Consumer in Directory Service - Fixed Regression Export +- Fixed localnet docker +- updated the genesis file # v1.0.0-Prerelease