Add a stack with a compose file

This commit is contained in:
Prathamesh Musale 2024-06-04 11:34:09 +05:30
parent 5bc8318052
commit 55c22b6818
4 changed files with 56 additions and 1 deletions

View File

@ -1 +1,5 @@
# bsc-stack
# bsc-stack
Stack definitions for BSC full node deployment.
[stack documentation](stack-orchestrator/stacks/bsc-node/README.md)

View File

@ -0,0 +1,23 @@
services:
bsc:
image: ghcr.io/bnb-chain/bsc:1.4.8
restart: unless-stopped
environment:
volumes:
- ../config/docker-entrypoint.sh:/bsc/docker-entrypoint.sh
- data:/data
- config:/bsc/config
ports:
- 30311:30311
- 8545:8545
- 8546:8546
healthcheck:
test: ["CMD", "nc", "-vz", "localhost", "8545"]
interval: 5s
retries: 5
start_period: 10s
timeout: 3s
volumes:
data:
config:

View File

@ -0,0 +1,19 @@
#!/bin/bash
set -e
# TODO: Check for testnet flag
# TODO: Download and unzip the config files
BSC_CONFIG=${BSC_HOME}/config/config.toml
BSC_GENESIS=${BSC_HOME}/config/genesis.json
# Init genesis state if geth not exist
DATA_DIR=$(cat ${BSC_CONFIG} | grep -A1 '\[Node\]' | grep -oP '\"\K.*?(?=\")')
GETH_DIR=${DATA_DIR}/geth
if [ ! -d "$GETH_DIR" ]; then
geth --datadir ${DATA_DIR} init ${BSC_GENESIS}
fi
# TODO: Check for archive mode flag
exec "geth" "--config" ${BSC_CONFIG} "$@"

View File

@ -0,0 +1,9 @@
# bsc-node
Instructions for running a BSC node
## Prerequisite
Downloaded chain snapshot
<!-- TODO -->