-
Notifications
You must be signed in to change notification settings - Fork 208
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'lavanet:main' into main
- Loading branch information
Showing
6 changed files
with
134 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
|
||
services: | ||
|
||
lava-node-init: | ||
# Update with the most recent supported version of lavad | ||
image: ghcr.io/lavanet/lava/lavad:${LAVAD_VERSION:-v2.0.0} | ||
environment: | ||
- CHAIN_ID=${CHAIN_ID:-lava-testnet-2} | ||
- KEYRING_BACKEND=${KEYRING_BACKEND:-test} | ||
- MONIKER=${MONIKER:-DOCKER_COMPOSE_MONIKER} | ||
command: > | ||
config chain-id $$CHAIN_ID && \ | ||
lavad config keyring-backend $$KEYRING_BACKEND && \ | ||
lavad init $$MONIKER --chain-id $$CHAIN_ID | ||
volumes: | ||
- lava_data:/lava | ||
networks: | ||
- lava_network | ||
|
||
lava-node-config: | ||
image: ghcr.io/tomwright/dasel:v2.7.0 | ||
entrypoint: ["sh", "-c"] | ||
# Example variables for kjnodes nodes | ||
environment: | ||
- STATE_SYNC_RPC_1=${STATE_SYNC_RPC_1:-https://lava-testnet.rpc.kjnodes.com:443} | ||
- GENESIS_ADDRESS=${GENESIS_ADDRESS:-https://snapshots.kjnodes.com/lava-testnet/genesis.json} | ||
- ADDRBOOK_ADDRESS=${ADDRBOOK_ADDRESS:-https://snapshots.kjnodes.com/lava-testnet/addrbook.json} | ||
- NUM_BLOCKS=${NUM_BLOCKS:-1500} | ||
command: > | ||
" | ||
apt-get -y update && apt-get install -y jq curl && | ||
curl -Ls $$GENESIS_ADDRESS > /lava/.lava/config/genesis.json && | ||
curl -Ls $$ADDRBOOK_ADDRESS > /lava/.lava/config/addrbook.json && | ||
dasel put -f /lava/.lava/config/app.toml -t string -v 0ulava 'minimum-gas-prices' && | ||
dasel put -f /lava/.lava/config/app.toml -t string -v custom 'pruning' && | ||
dasel put -f /lava/.lava/config/app.toml -t string -v 100 'pruning-keep-recent' && | ||
dasel put -f /lava/.lava/config/app.toml -t string -v 0 'pruning-keep-every' && | ||
dasel put -f /lava/.lava/config/app.toml -t string -v 19 'pruning-interval' && | ||
dasel put -f /lava/.lava/config/app.toml -t string -v true 'api.enable' && | ||
LATEST_HEIGHT=$(curl -s $$STATE_SYNC_RPC_1/block | jq -r .result.block.header.height) && | ||
SYNC_BLOCK_HEIGHT=$(($$LATEST_HEIGHT - $$NUM_BLOCKS)) && | ||
SYNC_BLOCK_HASH=$(curl -s "$$STATE_SYNC_RPC_1/block?height=$$SYNC_BLOCK_HEIGHT" | jq -r .result.block_id.hash) && | ||
dasel put -f /lava/.lava/config/config.toml -t string -v true 'statesync.enable' && | ||
dasel put -f /lava/.lava/config/config.toml -t string -v \"$$STATE_SYNC_RPC_1,$$STATE_SYNC_RPC_1\" 'statesync.rpc_servers' && | ||
dasel put -f /lava/.lava/config/config.toml -t string -v \"$$SYNC_BLOCK_HEIGHT\" 'statesync.trust_height' && | ||
dasel put -f /lava/.lava/config/config.toml -t string -v \"$$SYNC_BLOCK_HASH\" 'statesync.trust_hash' && | ||
dasel put -f /lava/.lava/config/config.toml -t string -v \"tcp://0.0.0.0:26657\" 'rpc.laddr' | ||
" | ||
volumes: | ||
- lava_data:/lava | ||
networks: | ||
- lava_network | ||
depends_on: | ||
lava-node-init: | ||
condition: service_completed_successfully | ||
|
||
lava-node: | ||
# Update with the most recent supported version of lavad | ||
image: ghcr.io/lavanet/lava/lavad:${LAVAD_VERSION:-v2.0.0} | ||
container_name: lava-node | ||
command: ["start"] | ||
ports: | ||
- '${LAVA_NODE_PORT_API:-1317}:1317' | ||
- '${LAVA_NODE_PORT_GRPC:-9090}:9090' | ||
- '${LAVA_NODE_PORT_GRPC_WEB:-9091}:9091' | ||
- '${LAVA_NODE_PORT_P2P:-26656}:26656' | ||
- '${LAVA_NODE_PORT_RPC:-26657}:26657' | ||
volumes: | ||
- lava_data:/lava | ||
networks: | ||
- lava_network | ||
restart: always | ||
depends_on: | ||
lava-node-init: | ||
condition: service_completed_successfully | ||
lava-node-config: | ||
condition: service_completed_successfully | ||
|
||
volumes: | ||
lava_data: | ||
|
||
networks: | ||
lava_network: |