Skip to content

Commit

Permalink
Add regtest for docker-compose
Browse files Browse the repository at this point in the history
Add full docker-compose
  • Loading branch information
rschifflin authored and brianvh committed Jan 3, 2022
1 parent 2926db3 commit 518a481
Show file tree
Hide file tree
Showing 5 changed files with 242 additions and 9,148 deletions.
10 changes: 10 additions & 0 deletions .docker/conf/regtest01.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
regtest=1
port=8333
connect=regtest02:8333
listen=1
rpcuser=regtestuser
rpcpassword=regtestpassword
rpcallowip=::/0
rpcport=8332
maxstackmemoryusageconsensus=7000000000
excessiveblocksize=10000000000
10 changes: 10 additions & 0 deletions .docker/conf/regtest02.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
regtest=1
port=8333
connect=regtest01:8333
listen=1
rpcuser=regtestuser
rpcpassword=regtestpassword
rpcallowip=::/0
rpcport=8332
maxstackmemoryusageconsensus=7000000000
excessiveblocksize=10000000000
59 changes: 59 additions & 0 deletions .docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
version: "3.9"
services:
app:
build: ../.
ports:
- "3010:3010"
configs:
- source: app_pool
target: "/src/pool_config.json"
- source: app_server
target: "/src/server_config.json"

redis:
image: redis

regtest01:
image: bitcoinsv/bitcoin-sv
entrypoint: "bitcoind -conf=/etc/bitcoin.conf -data-dir=/data"
configs:
- source: regtest01
target: "/etc/bitcoin.conf"
volumes:
- "regtest01:/data/"

regtest02:
image: bitcoinsv/bitcoin-sv
entrypoint: "bitcoind -conf=/etc/bitcoin.conf -data-dir=/data"
configs:
- source: regtest02
target: "/etc/bitcoin.conf"
volumes:
- "regtest02:/data/"

cpuminer:
image: tpruvot/cpuminer-multi
command: [
"-a", "sha256d",
"-o", "stratum+tcp://app:3010",
"-u", "mg3Brq4Kj9wDhEq4gkMFbTyJwp5yipKrkw.worker.1",
"-p", "pw.worker.1",
"-t", "4",
"--no-longpoll",
"--no-getwork",
"--no-gbt",
"-D",
"-P"]

volumes:
regtest01: {}
regtest02: {}
configs:
regtest01:
file: ./conf/regtest01.conf
regtest02:
file: ./conf/regtest02.conf
app_pool:
file: ./conf/pool_config.json
app_server:
file: ./conf/server_config.json
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

# Stage 1: Build deps from source including private github repos

FROM node:12
FROM node:14

# Create working directory
WORKDIR /src

# Update and download system dependencies
RUN apt-get update && apt-get install -y openssh-client awscli
RUN apt-get update && apt-get install -y openssh-client

# Create ssh directory
RUN mkdir -p -m 0700 ~/.ssh && ssh-keyscan github.com >> ~/.ssh/known_hosts
Expand All @@ -17,10 +17,10 @@ RUN mkdir -p -m 0700 ~/.ssh && ssh-keyscan github.com >> ~/.ssh/known_hosts
COPY . .

# Build deps using lockfile
RUN --mount=type=ssh,id=github npm ci --only=production
RUN npm ci --only=production

# Expose ports for stratum workers
EXPOSE 3010

# Run helper script as entrypoint to load configs based on environment
ENTRYPOINT exec ./init.sh
ENTRYPOINT node app.js
Loading

0 comments on commit 518a481

Please sign in to comment.