From eefdf95fa52fa3c5222305b2a1d1db404177b029 Mon Sep 17 00:00:00 2001 From: shreyasbhat0 Date: Mon, 9 Dec 2024 12:56:06 +0530 Subject: [PATCH] fix: validator and docker compose --- docker/Dockerfile.localnet | 2 +- docker/docker-compose-localnet.yaml | 6 ++--- docker/docker-compose.yml | 34 +++++++++++++++++++---------- scripts/validator.sh | 19 +++++++++++----- 4 files changed, 40 insertions(+), 21 deletions(-) diff --git a/docker/Dockerfile.localnet b/docker/Dockerfile.localnet index cee42259..84f30635 100644 --- a/docker/Dockerfile.localnet +++ b/docker/Dockerfile.localnet @@ -30,7 +30,7 @@ RUN make install # # Main # -FROM ubuntu:lunar +FROM ubuntu:22.04 # hadolint ignore=DL3008,DL4006 RUN apt-get update -y && \ diff --git a/docker/docker-compose-localnet.yaml b/docker/docker-compose-localnet.yaml index dbca2e6e..80b7f6ec 100644 --- a/docker/docker-compose-localnet.yaml +++ b/docker/docker-compose-localnet.yaml @@ -4,8 +4,8 @@ services: node: image: ${IMAGE_TAG} build: - context: . - dockerfile: Dockerfile.localnet # Ensure the Dockerfile is correctly referenced + context: .. + dockerfile: docker/Dockerfile.localnet entrypoint: - bash - -c @@ -17,5 +17,5 @@ services: - 26657:26657 - 26656:26656 volumes: - - ./scripts:/scripts:z + - ../scripts:/scripts:z working_dir: /scripts diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 21281013..a69b200d 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -4,35 +4,43 @@ services: hostname: arkeod image: arkeo build: - dockerfile: ./Dockerfile + context: .. + dockerfile: docker/Dockerfile.localnet ports: - "1317:1317" - "26656:26656" - "26657:26657" volumes: - ".arkeo:/root/.arkeo:rw" + - ../scripts:/scripts:z environment: - NET: "mocknet" - entrypoint: /scripts/genesis.sh - command: arkeod start --pruning nothing + - NET=mocknet + + entrypoint: ["/bin/bash", "/scripts/genesis.sh"] arkeod-1: image: arkeo build: - dockerfile: ./Dockerfile + context: .. + dockerfile: docker/Dockerfile.localnet ports: - "1317" - "26657" environment: NET: "mocknet" PEER: arkeod + RPC: arkeod:26657 + SEED: arkeod:26656 + volumes: + - ../scripts:/scripts:z entrypoint: /scripts/validator.sh command: arkeod start sentinel: image: arkeo build: - dockerfile: ./Dockerfile + context: .. + dockerfile: ./Dockerfile.sentinel depends_on: - "arkeod" ports: @@ -50,11 +58,12 @@ services: FREE_RATE_LIMIT_DURATION: "1m" CLAIM_STORE_LOCATION: "/root/.arkeo/claims" CONTRACT_CONFIG_STORE_LOCATION: "/root/.arkeo/contract_configs" + PROVIDER_CONFIG_STORE_LOCATION: "/root/.arkeo/provider_configs" entrypoint: "/scripts/sentinel.sh" command: sentinel volumes: - ".sentinel:/root/.arkeo:rw" - - "./scripts:/scripts" + - ../scripts:/scripts:z directory-postgres: image: postgres:15.1-alpine @@ -76,7 +85,8 @@ services: init-directory-db: image: arkeo build: - dockerfile: ./Dockerfile + context: .. + dockerfile: ./Dockerfile.indexer entrypoint: [] command: - "tern" @@ -88,7 +98,7 @@ services: env_file: - ./docker-directory.env volumes: - - ./directory/tern:/directory/tern + - ../directory/tern:/directory/tern depends_on: directory-postgres: condition: service_healthy @@ -96,7 +106,8 @@ services: directory-indexer: image: arkeo build: - dockerfile: ./Dockerfile + context: .. + dockerfile: ./Dockerfile.indexer entrypoint: [] command: - "indexer" @@ -109,7 +120,8 @@ services: directory-api: image: arkeo build: - dockerfile: ./Dockerfile + context: .. + dockerfile: ./Dockerfile.api entrypoint: [] command: - "api" diff --git a/scripts/validator.sh b/scripts/validator.sh index 04caa917..d7b8ceb4 100755 --- a/scripts/validator.sh +++ b/scripts/validator.sh @@ -4,8 +4,8 @@ set -o pipefail set -ex CHAIN_ID="arkeo" -RPC="${RPC:=seed.arkeo.network:26657}" -SEED="${SEED:=seed.arkeo.network:26656}" +RPC="${RPC:=seed31.innovationtheory.com:26657}" +SEED="${SEED:=seed31.innovationtheory.com:26656}" PEER_ID=$(curl -sL http://$RPC/status | jq -r '.result.node_info.id') GENESIS="${GENESIS:=$RPC}" @@ -13,6 +13,9 @@ if [ ! -f ~/.arkeo/config/genesis.json ]; then echo "setting validator node" arkeod init local --chain-id "$CHAIN_ID" + arkeod config set client keyring-backend test + arkeod config set client chain-id arkeo-testnet-3 + rm -rf ~/.arkeo/config/genesis.json @@ -30,11 +33,15 @@ if [ ! -f ~/.arkeo/config/genesis.json ]; then # fetch genesis file from seed node curl -sL "$GENESIS/genesis" | jq '.result.genesis' >~/.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/seeds = \"\"/seeds = \"$PEER_ID@$SEED\"/g" ~/.arkeo/config/config.toml + sed -i -e "s/^pruning *=.*/pruning = \"custom\"/" $HOME/.arkeo/config/app.toml + sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"100\"/" $HOME/.arkeo/config/app.toml + sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"50\"/" $HOME/.arkeo/config/app.toml + sed -i -e "s|^minimum-gas-prices =.*|minimum-gas-prices = \"0.001uarkeo\"|g" $HOME/.arkeo/config/app.toml + sed -i -e "s|swagger =.*| swagger = true|g" $HOME/.arkeo/config/app.toml + sed -i -e "s/seeds = \"\"/seeds = \"$PEER_ID@$SEED\"/g" ~/.arkeo/config/config.toml + # TODO: create this one as a validator - # arkeod tx staking create-validator --amount=100000000000uarkeo --pubkey=$(arkeod tendermint show-validator) --moniker="validator 1" --from=bob --keyring-backend test --commission-rate="0.10" --commission-max-rate="0.20" --commission-max-change-rate="0.01" --min-self-delegation="1" + # arkeod tx staking create-validator --chain-id arkeo --commission-rate 0.05 --commission-max-rate 0.2 --commission-max-change-rate 0.1 --min-self-delegation "1" --amount uarkeo --pubkey $(arkeod tendermint show-validator) --moniker "" --from --fees="5000uarkeo" --yes fi arkeod start