Skip to content

Commit

Permalink
feat: cosmovisor 1.6.0 (#11)
Browse files Browse the repository at this point in the history
Signed-off-by: Artur Troian <[email protected]>
  • Loading branch information
troian authored Sep 15, 2024
1 parent 5a455f7 commit 64cfd39
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 18 deletions.
6 changes: 3 additions & 3 deletions .env
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
COSMOVISOR_VERSION=v1.5.0
GOVERSION=1.21.0
COSMOVISOR_VERSION=v1.6.0
GOVERSION=1.23.1
GO_GETTER_VERSION=v0.2.2
GIT_CHGLOG_VERSION=v0.15.0
GO_TEMPLATE_VERSION=v0.4.3
GO_TEMPLATE_VERSION=v0.5.0
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
ARG COSMOVISOR_VERSION
FROM ghcr.io/akash-network/cosmovisor-base:$COSMOVISOR_VERSION as cosmovisor
ARG COSMOVISOR_VERSION=v1.6.0

FROM ghcr.io/akash-network/cosmovisor-base:$COSMOVISOR_VERSION AS cosmovisor

FROM ubuntu:jammy AS base
LABEL "org.opencontainers.image.source"="https://github.com/akash-network/cosmovisor"
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.cosmovisor
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG GOVERSION
ARG GOVERSION=1.23.1

FROM golang:${GOVERSION}-bullseye as build
FROM golang:${GOVERSION}-bullseye AS build

ENV GO111MODULE=on
ENV GOPROXY=https://proxy.golang.org,direct
Expand Down
10 changes: 5 additions & 5 deletions examples/akash/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ services:
env_file: .env
environment:
# do not gossip validator's node id
CHAIN_P2P_PRIVATE_PEER_IDS: a2435fc8253647ac112cb3c21fa18ec6ff31f876
ADDITIONAL_P2P_PERSISTENT_PEERS: a2435fc8253647ac112cb3c21fa18ec6ff31f876@validator:26656
CHAIN_P2P_PRIVATE_PEER_IDS: "a2435fc8253647ac112cb3c21fa18ec6ff31f876"
ADDITIONAL_P2P_PERSISTENT_PEERS: "a2435fc8253647ac112cb3c21fa18ec6ff31f876@validator:26656"
ports:
- 26656:26656
- 26657:26657
- "26656:26656"
- "26657:26657"
volumes:
- rpc:/root/.chain
- ./rpc/node_key.json:/root/.chain/config/node_key.json:ro
Expand All @@ -24,7 +24,7 @@ services:
environment:

CONFIG_RESET_DATA: true
CHAIN_PRUNNING: everything
CHAIN_PRUNING: everything
CHAIN_P2P_PEX: false
CHAIN_P2P_SEEDS: ""
CHAIN_P2P_PERSISTENT_PEERS: 0edf5fb90569216e143fbdc441cd4fb628a19537@rpc:26656
Expand Down
28 changes: 22 additions & 6 deletions scripts/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ unset CHAIN_IMPORT_GENESIS
unset CHAIN_UNSAFE_RESET_ALL
unset SHELL_SET_PIPEFAIL

chain_type=${CHAIN_TYPE:-mainnet}

import_genesis=${CONFIG_FORCE_IMPORT_GENESIS:-false}
reset_data=${CONFIG_RESET_DATA:-false}
binary_url=${CONFIG_BINARY_URL:-}
Expand All @@ -22,6 +24,8 @@ peer_validation=${CONFIG_PEER_VALIDATION:-false}
overwrite_seeds=${CONFIG_OVERWRITE_SEEDS:-false}
snapshot_url=${CONFIG_SNAPSHOT_URL:-}
snapshot_dl=${CONFIG_SNAPSHOT_DL:-false}
snapshot_source=${CONFIG_SNAPSHOT_SOURCE:-polkachu}

wasm_dir=${CONFIG_WASM_DIR:-wasm}

CONFIG_S3_KEY=${CONFIG_S3_KEY:-}
Expand All @@ -38,16 +42,18 @@ unset CONFIG_PEER_VALIDATION
unset CONFIG_SNAPSHOT_URL
unset CONFIG_SNAPSHOT_HAS_DATA_DIR
unset CONFIG_SNAPSHOT_DL
unset CONFIG_SNAPSHOT_SOURCE
unset CONFIG_WASM_DIR
unset CHAIN_INIT
unset CHAIN_TYPE

UNSAFE_SKIP_BACKUP=${UNSAFE_SKIP_BACKUP:-false}

CHAIN_STATESYNC_ENABLE=${CHAIN_STATESYNC_ENABLE:-false}
CHAIN_STATESYNC_RPC_SERVERS=${CHAIN_STATESYNC_RPC_SERVERS:-}

GOTOOLCHAIN=${GOTOOLCHAIN:-"latest"}
GOVERSION=${GOVERSION:-"1.21.0"}
GOVERSION=${GOVERSION:-"1.23.0"}

export GOTOOLCHAIN
export AWS_ACCESS_KEY_ID=$CONFIG_S3_KEY
Expand Down Expand Up @@ -180,7 +186,15 @@ if [[ -z $config_url ]]; then
# shellcheck disable=SC2153
case "${CHAIN}" in
akash)
config_url=https://raw.githubusercontent.com/cosmos/chain-registry/master/akash/chain.json
case "${chain_type}" in
"")
;;&
mainnet)
config_url=https://raw.githubusercontent.com/cosmos/chain-registry/master/akash/chain.json
;;
sandbox)
;;
esac
;;
stride)
config_url=https://raw.githubusercontent.com/cosmos/chain-registry/master/stride/chain.json
Expand Down Expand Up @@ -532,11 +546,15 @@ fi

# Snapshot
if [ "$snapshot_dl" == true ]; then
if [ -z "${snapshot_url}" ]; then
snapshot_url=$(wget https://polkachu.com/api/v2/chain_snapshots/akash/mainnet -qO - 2>&1 | jq -r '.snapshot.url')
fi

if [ -n "${snapshot_url}" ]; then
rm -rf "$data_path"
rm -rf "$wasm_path"

pushd "$(pwd)"
pushd "$(pwd)" > /dev/null

mkdir -p "$data_path"
cd "$data_path"
Expand Down Expand Up @@ -582,9 +600,7 @@ if [ "$snapshot_dl" == true ]; then
mv wasm ../
fi

popd
else
echo "Snapshot URL not found"
popd > /dev/null
fi
fi

Expand Down

0 comments on commit 64cfd39

Please sign in to comment.