Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: validator script and docker compose #302

Merged
merged 2 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ Contains all the PRs that improved the code without changing the behaviors.
- Fixed code lint
- Fixed ws client issue with event stream
- Fixed swagger issue
- Docker files and scripts

# v1.0.2-Prerelease

Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.localnet
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ RUN make install
#
# Main
#
FROM ubuntu:lunar
FROM ubuntu:22.04

# hadolint ignore=DL3008,DL4006
RUN apt-get update -y && \
Expand Down
6 changes: 3 additions & 3 deletions docker/docker-compose-localnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -17,5 +17,5 @@ services:
- 26657:26657
- 26656:26656
volumes:
- ./scripts:/scripts:z
- ../scripts:/scripts:z
working_dir: /scripts
34 changes: 23 additions & 11 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -76,7 +85,8 @@ services:
init-directory-db:
image: arkeo
build:
dockerfile: ./Dockerfile
context: ..
dockerfile: ./Dockerfile.indexer
entrypoint: []
command:
- "tern"
Expand All @@ -88,15 +98,16 @@ services:
env_file:
- ./docker-directory.env
volumes:
- ./directory/tern:/directory/tern
- ../directory/tern:/directory/tern
depends_on:
directory-postgres:
condition: service_healthy

directory-indexer:
image: arkeo
build:
dockerfile: ./Dockerfile
context: ..
dockerfile: ./Dockerfile.indexer
entrypoint: []
command:
- "indexer"
Expand All @@ -109,7 +120,8 @@ services:
directory-api:
image: arkeo
build:
dockerfile: ./Dockerfile
context: ..
dockerfile: ./Dockerfile.api
entrypoint: []
command:
- "api"
Expand Down
19 changes: 13 additions & 6 deletions scripts/validator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,18 @@ 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}"

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

Expand All @@ -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 <staking amount>uarkeo --pubkey $(arkeod tendermint show-validator) --moniker "<yourvalidator-name>" --from <your-wallet-name> --fees="5000uarkeo" --yes
fi

arkeod start
Loading