Skip to content

Instantly share code, notes, and snippets.

@chessai
Created April 20, 2023 22:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chessai/8a0fc04b99874de5dc261270d2e9dba1 to your computer and use it in GitHub Desktop.
Save chessai/8a0fc04b99874de5dc261270d2e9dba1 to your computer and use it in GitHub Desktop.
# Images
CHAINWEB_NODE_IMAGE=ghcr.io/kadena-io/chainweb-node:sha-8a7ef72
# latest: ghcr.io/kadena-io/chainweb-node/ubuntu:latest
# openapi-validation: # ghcr.io/kadena-io/chainweb-node:sha-8a7ef72
MINING_CLIENT_IMAGE=ghcr.io/kadena-io/chainweb-mining-client:latest
# Ports that are exposed on the host system
HOST_SERVICE_PORT=8080
HOST_STRATUM_PORT=1917
# Miner keys
MINER_PUBLIC_KEY=f89ef46927f506c70b6a58fd322450a936311dc6ac91f4ec3d8ef949608dbf1f
MINER_PRIVATE_KEY=da81490c7efd5a95398a3846fa57fd17339bdf1b941d102f2d3217ad29785ff0
DISABLE_POW_VALIDATION=1
# Replica counts for different node types
COMMON_NODE_REPLICAS=1
MINING_NODE_REPLICAS=0
API_NODE_REPLICAS=1
version: "3.9"
# API Services are exposed on port 8080 on the host
# boostrap certificate fingerprint: YNo7pXthYQ9RQKv1bbpQf2R5LcLYA3ppx2BL2Hf8fIM
#
# Miner Keys:
# public: f89ef46927f506c70b6a58fd322450a936311dc6ac91f4ec3d8ef949608dbf1f
# secret: da81490c7efd5a95398a3846fa57fd17339bdf1b941d102f2d3217ad29785ff0
#
configs:
chainweb-node.common:
file: ${PWD}/config/chainweb-node.common.yaml
chainweb-node.logging:
file: ./config/chainweb-node.logging.yaml
volumes:
db-server-db: {}
services:
# ########################################################################## #
# Bootstrap Node
# For a minimal config, this is the only node we need
#
bootstrap-node:
extends:
file: node.yaml
service: node
labels:
com.chainweb.devnet.description: "Devnet Bootstrap Node"
com.chainweb.devnet.bootstrap-node: ""
volumes:
- ${PWD}/devnet-bootstrap-node.cert.pem:/chainweb/devnet-bootstrap-node.cert.pem:ro
- ${PWD}/devnet-bootstrap-node.key.pem:/chainweb/devnet-bootstrap-node.key.pem:ro
- ${PWD}/db:/chainweb/db
command:
- --p2p-certificate-chain-file=/chainweb/devnet-bootstrap-node.cert.pem
- --p2p-certificate-key-file=/chainweb/devnet-bootstrap-node.key.pem
- --p2p-hostname=bootstrap-node
- --bootstrap-reachability=1
- --cluster-id=devnet-minimal
# - --disable-mempool-p2p
- --p2p-max-session-count=2
- --mempool-p2p-max-session-count=2
- --known-peer-info=YNo7pXthYQ9RQKv1bbpQf2R5LcLYA3ppx2BL2Hf8fIM@bootstrap-node:1789
- --log-level=info
- --enable-mining-coordination
- --mining-public-key=${MINER_PUBLIC_KEY}
- --header-stream
- --rosetta
- --allowReadsInLocal
- --database-directory=/chainweb/db
- --enable-service-validate-spec
- --enable-validate-spec
expose:
- "1848"
- "1789"
environment:
- DISABLE_POW_VALIDATION
simulation-miner:
container_name: simulation-miner
image: "${MINING_CLIENT_IMAGE}"
restart: unless-stopped
depends_on:
bootstrap-node:
condition: service_healthy
entrypoint: "/chainweb-mining-client/chainweb-mining-client"
command:
- --public-key=${MINER_PUBLIC_KEY}
- --node=bootstrap-node:1848
- --worker=constant-delay
- --thread-count=1
- --log-level=info
- --no-tls
- --constant-delay-block-time=1
# ########################################################################## #
# Nginx API Proxy
api-proxy:
labels:
com.chainweb.devnet.description: "Devnet API Proxy"
com.chainweb.devnet.api-proxy: ""
depends_on:
bootstrap-node:
condition: service_healthy
image: nginx:latest
volumes:
- ${PWD}/config/nginx.api.minimal.conf:/etc/nginx/conf.d/default.conf
ports:
- target: 80
published: ${HOST_SERVICE_PORT}
protocol: tcp
# ########################################################################## #
# Test Container
#
# Mounts the test sub-directory into an ubuntu container.
# The default entrypoint of the container is /bin/bash.
# The container is build from ./test/Dockerfile.
#
test:
labels:
com.chainweb.devnet.description: "Devnet Testing"
com.chainweb.devnet.debug: ""
build:
context: ./test
dockerfile: Dockerfile
image: devnet-test
volumes:
- ${PWD}/test:/test
profiles: ["test"]
pact:
labels:
com.chainweb.devnet.description: "Devnet Testing"
com.chainweb.devnet.debug: ""
build:
context: ./test
dockerfile: pact.Dockerfile
image: devnet-pact
volumes:
- ${PWD}/test:/test
profiles: ["pact"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment