Add a stack with a compose file
This commit is contained in:
parent
5bc8318052
commit
55c22b6818
@ -1 +1,5 @@
|
|||||||
# bsc-stack
|
# bsc-stack
|
||||||
|
|
||||||
|
Stack definitions for BSC full node deployment.
|
||||||
|
|
||||||
|
[stack documentation](stack-orchestrator/stacks/bsc-node/README.md)
|
||||||
|
23
stack-orchestrator/compose/docker-compose-bsc-node.yml
Normal file
23
stack-orchestrator/compose/docker-compose-bsc-node.yml
Normal 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:
|
19
stack-orchestrator/config/docker-entrypoint.sh
Executable file
19
stack-orchestrator/config/docker-entrypoint.sh
Executable 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} "$@"
|
9
stack-orchestrator/stacks/bsc-node/README.md
Normal file
9
stack-orchestrator/stacks/bsc-node/README.md
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# bsc-node
|
||||||
|
|
||||||
|
Instructions for running a BSC node
|
||||||
|
|
||||||
|
## Prerequisite
|
||||||
|
|
||||||
|
Downloaded chain snapshot
|
||||||
|
|
||||||
|
<!-- TODO -->
|
Loading…
Reference in New Issue
Block a user