Skip to content

Commit

Permalink
feat(run): auto-detect PROJECT from CHAIN JSON via PROJECT_BIN (#671)
Browse files Browse the repository at this point in the history
* feat(run): auto-detect PROJECT from CHAIN JSON via PROJECT_BIN

* Set PROJECT from chain_name if unset

* Update generic env variables

---------

Co-authored-by: Tom Beynon <tom@tombeynon.co.uk>
  • Loading branch information
andy108369 and tombeynon authored Nov 13, 2023
1 parent 067fa8f commit bc3cd80
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
5 changes: 3 additions & 2 deletions generic/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ services:
- '1317:1317'
environment:
- MONIKER=node_1
- CHAIN_JSON=https://raw.githubusercontent.com/akash-network/net/main/edgenet/meta.json
- BINARY_ZIP_PATH=akash_0.15.0-rc14_linux_amd64/akash
- CHAIN_JSON=https://raw.githubusercontent.com/akash-network/net/main/mainnet/meta.json
- P2P_POLKACHU=1
- STATESYNC_POLKACHU=1
env_file:
- ../.env
volumes:
Expand Down
5 changes: 3 additions & 2 deletions generic/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ services:
image: ghcr.io/akash-network/cosmos-omnibus:v0.4.0-generic
env:
- MONIKER=my-moniker-1
- CHAIN_JSON=https://raw.githubusercontent.com/akash-network/net/main/edgenet/meta.json
- BINARY_ZIP_PATH=akash_0.15.0-rc14_linux_amd64/akash
- CHAIN_JSON=https://raw.githubusercontent.com/akash-network/net/main/mainnet/meta.json
- P2P_POLKACHU=1
- STATESYNC_POLKACHU=1
expose:
- port: 26657
as: 80
Expand Down
5 changes: 3 additions & 2 deletions generic/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ services:
- '1317:1317'
environment:
- MONIKER=node_1
- CHAIN_JSON=https://raw.githubusercontent.com/akash-network/net/main/edgenet/meta.json
- BINARY_ZIP_PATH=akash_0.15.0-rc14_linux_amd64/akash
- CHAIN_JSON=https://raw.githubusercontent.com/akash-network/net/main/mainnet/meta.json
- P2P_POLKACHU=1
- STATESYNC_POLKACHU=1
volumes:
- ./node-data:/root/.akash
1 change: 1 addition & 0 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ if [ -n "$CHAIN_JSON" ]; then
export P2P_PERSISTENT_PEERS="${P2P_PERSISTENT_PEERS:-$(echo $CHAIN_METADATA | jq -r '.peers.persistent_peers | map(.id+"@"+.address) | join(",")')}"
export GENESIS_URL="${GENESIS_URL:-$(echo $CHAIN_METADATA | jq -r '.codebase.genesis.genesis_url? // .genesis.genesis_url? // .genesis?')}"
export BINARY_URL="${BINARY_URL:-$(echo $CHAIN_METADATA | jq -r '.codebase.binaries."linux/amd64"?')}"
export PROJECT="${PROJECT:-$(echo $CHAIN_METADATA | jq -r '.chain_name?')}"
export PROJECT_BIN="${PROJECT_BIN:-$(echo $CHAIN_METADATA | jq -r '.codebase.daemon_name? // .daemon_name?')}"
if [ -z "$PROJECT_DIR" ]; then
FULL_DIR=$(echo $CHAIN_METADATA | jq -r '.codebase.node_home? // .node_home?')
Expand Down

0 comments on commit bc3cd80

Please sign in to comment.