From 0860d73db81e3c2d75b9a63ff8c5a6b0b18e58c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Loun=C3=A8s=20Ksouri?= Date: Fri, 21 Jun 2024 14:55:52 +0200 Subject: [PATCH] feat(bitcoin-regtest): change subsidy interval to 21000 blocks (#20) * feat(bitcoin-regtest): change subsidy interval to 21000 blocks * feat(bitcoin): update to v27.1 --- docker/bitcoin-regtest/Dockerfile | 83 +++++++++++++++++++++++++++++-- docker/bitcoin-regtest/image.hcl | 4 +- docker/bitcoin/image.hcl | 2 +- 3 files changed, 83 insertions(+), 6 deletions(-) diff --git a/docker/bitcoin-regtest/Dockerfile b/docker/bitcoin-regtest/Dockerfile index 493d4ee..2879570 100644 --- a/docker/bitcoin-regtest/Dockerfile +++ b/docker/bitcoin-regtest/Dockerfile @@ -1,11 +1,85 @@ +FROM lncm/berkeleydb:v4.8.30.NC AS berkleydb + +FROM alpine:3.18 AS builder + ARG VERSION -FROM lnmarkets/bitcoin:${VERSION} +WORKDIR /opt + +COPY --from=berkleydb /opt /opt + +RUN apk add --no-cache \ + autoconf \ + automake \ + boost-dev \ + sqlite-dev \ + build-base \ + chrpath \ + file \ + libevent-dev \ + libressl \ + libtool \ + linux-headers \ + zeromq-dev + +RUN wget https://bitcoincore.org/bin/bitcoin-core-${VERSION}/bitcoin-${VERSION}.tar.gz + +# Removed gpp signature verification +RUN wget https://bitcoincore.org/bin/bitcoin-core-${VERSION}/SHA256SUMS && \ + grep "bitcoin-${VERSION}.tar.gz\$" SHA256SUMS | sha256sum -c - + +RUN tar -xzf bitcoin-${VERSION}.tar.gz + +WORKDIR /opt/bitcoin-${VERSION} +# Change the default subsidy halving interval for regtest from 150 to 21 000 blocks +RUN sed -i 's/consensus.nSubsidyHalvingInterval = 150/consensus.nSubsidyHalvingInterval = 21000/g' src/kernel/chainparams.cpp + +RUN ./autogen.sh + +RUN ./configure \ + BDB_LIBS="-L/opt/db4/lib -ldb_cxx-4.8" \ + BDB_CFLAGS="-I/opt/db4/include" \ + CXXFLAGS="-O2" \ + --prefix=/opt/build \ + --enable-hardening \ + --disable-tests \ + --disable-bench \ + --disable-ccache \ + --disable-man \ + --enable-static \ + --enable-reduce-exports \ + --without-gui \ + --without-libs \ + --with-utils \ + --with-sqlite=yes \ + --with-daemon \ + --with-zmq + +RUN make -j $(nproc) install + +RUN strip /opt/build/bin/bitcoind && \ + strip /opt/build/bin/bitcoin-tx && \ + strip /opt/build/bin/bitcoin-wallet + +FROM lnmarkets/base-alpine:3.18 + +ENV DATA_PATH=/home/.bitcoin ENV MINING=true ENV MININING_INTERVAL=30 -RUN apk add --update --no-cache bash libcap +COPY --from=builder /opt/build/bin/* /bin/ + +RUN apk add --no-cache --update \ + boost-filesystem \ + boost-thread \ + libevent \ + libsodium \ + libstdc++ \ + libzmq \ + sqlite-libs \ + bash \ + libcap COPY --chown=satoshi:satoshi docker/bitcoin-regtest/bitcoin.conf /home/.bitcoin/bitcoin.conf @@ -13,7 +87,10 @@ COPY --chown=satoshi:satoshi docker/bitcoin-regtest/mine.sh /usr/bin/mine COPY --chown=satoshi:satoshi docker/bitcoin-regtest/entrypoint.sh /docker/entrypoint.sh -EXPOSE 18443 18444 28334 28335 +EXPOSE 8080 +EXPOSE 18333 18444 +EXPOSE 18332 18443 +EXPOSE 28334 28335 USER satoshi diff --git a/docker/bitcoin-regtest/image.hcl b/docker/bitcoin-regtest/image.hcl index 1336376..3760871 100644 --- a/docker/bitcoin-regtest/image.hcl +++ b/docker/bitcoin-regtest/image.hcl @@ -1,6 +1,6 @@ # Release version -VERSION="27.0" +VERSION="27.1" # Image config NAME="bitcoin-regtest" -DESCRIPTION="Bitcoin Core preconfigured for regtest, with convenience mining cron job" +DESCRIPTION="Bitcoin Core preconfigured for regtest, with convenience mining cron job and 21 000 blocks subsidy halving interval" diff --git a/docker/bitcoin/image.hcl b/docker/bitcoin/image.hcl index aecb528..ca1eb44 100644 --- a/docker/bitcoin/image.hcl +++ b/docker/bitcoin/image.hcl @@ -1,4 +1,4 @@ # Release version -VERSION="27.0" +VERSION="27.1" NAME="bitcoin" DESCRIPTION="Bitcoin Core"