Skip to content

Commit d761832

Browse files
committed
build BIP-110 node client
1 parent 9186e62 commit d761832

5 files changed

Lines changed: 149 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,32 @@ jobs:
4545
sbom: false
4646
targets: knots
4747

48+
build-bip110:
49+
name: Build BIP-110 node on ${{ matrix.runner }}
50+
runs-on: ${{ matrix.runner }}
51+
strategy:
52+
fail-fast: false
53+
matrix:
54+
runner:
55+
- "ubuntu-24.04"
56+
- "ubuntu-24.04-arm"
57+
env:
58+
RUNNER: ${{ matrix.runner }}
59+
steps:
60+
- uses: actions/checkout@v6
61+
- uses: docker/setup-buildx-action@v3
62+
- uses: docker/login-action@v3
63+
with:
64+
registry: ghcr.io
65+
username: ${{ github.actor }}
66+
password: ${{ secrets.GITHUB_TOKEN }}
67+
- uses: docker/bake-action@v6
68+
with:
69+
provenance: false
70+
push: true
71+
sbom: false
72+
targets: bip110
73+
4874
merge:
4975
name: Merge v${{ matrix.knots_version }}
5076
runs-on: ubuntu-latest
@@ -78,11 +104,29 @@ jobs:
78104
-t 1maa/bitcoin:latest \
79105
1maa/bitcoin:v${{ matrix.knots_version }}
80106
107+
merge-bip110:
108+
name: Merge v${{ matrix.knots_version }}
109+
runs-on: ubuntu-latest
110+
needs:
111+
- build-bip110
112+
steps:
113+
- uses: docker/setup-buildx-action@v3
114+
- uses: docker/login-action@v3
115+
with:
116+
username: 1maa
117+
password: ${{ secrets.DOCKER_HUB_PASS }}
118+
- run: |
119+
docker buildx imagetools create \
120+
-t 1maa/bitcoin:v29.2.knots20251110+bip110-v0.1rc3 \
121+
ghcr.io/bcnbitcoinonly/bitcoin:v29.2.knots20251110+bip110-v0.1rc3-ubuntu-24.04 \
122+
ghcr.io/bcnbitcoinonly/bitcoin:v29.2.knots20251110+bip110-v0.1rc3-ubuntu-24.04-arm
123+
81124
cleanup:
82125
name: Cleanup old GHCR tags
83126
runs-on: ubuntu-latest
84127
needs:
85128
- merge
129+
- merge-bip110
86130
steps:
87131
- uses: docker/login-action@v3
88132
with:

autotools/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ RUN make -C ./build install
7979

8080
RUN upx --lzma /usr/local/bin/*
8181

82+
8283
FROM alpine:3.23 AS final
8384

8485
COPY --from=builder /usr/local/bin/* /usr/local/bin/

bip110/Dockerfile

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
FROM alpine:3.23 AS verifier
2+
3+
WORKDIR /tmp
4+
5+
RUN wget https://github.com/dathonohm/bitcoin/releases/download/v29.2.knots20251110%2Bbip110-v0.1rc3/SHA256SUMS \
6+
&& wget https://github.com/dathonohm/bitcoin/releases/download/v29.2.knots20251110%2Bbip110-v0.1rc3/SHA256SUMS.asc \
7+
&& wget https://github.com/dathonohm/bitcoin/releases/download/v29.2.knots20251110%2Bbip110-v0.1rc3/bitcoin-29.2.knots20251110+bip110-v0.1rc3.tar.gz
8+
9+
RUN apk add --no-cache \
10+
coreutils \
11+
curl \
12+
gnupg \
13+
jq \
14+
&& curl -s https://api.github.com/repos/dathonohm/guix.sigs/contents/builder-keys | jq -r '.[].download_url' | while read url; do curl -s "$url" | gpg --import; done \
15+
&& gpg --verify SHA256SUMS.asc SHA256SUMS \
16+
&& sha256sum --ignore-missing -c SHA256SUMS \
17+
&& mv bitcoin-29.2.knots20251110+bip110-v0.1rc3.tar.gz bitcoin.tar.gz
18+
19+
20+
FROM alpine:3.23 AS builder
21+
22+
WORKDIR /tmp
23+
24+
COPY --from=verifier /tmp/bitcoin.tar.gz .
25+
26+
RUN apk add --no-cache \
27+
bash \
28+
build-base \
29+
cmake \
30+
curl \
31+
linux-headers \
32+
pkgconf \
33+
upx
34+
35+
RUN tar zxf bitcoin.tar.gz
36+
37+
RUN make -C bitcoin-29.2.knots20251110+bip110-v0.1rc3/depends -j$(nproc) NO_QT=1 NO_NATPMP=1 NO_UPNP=1 NO_USDT=1
38+
39+
RUN cmake -S bitcoin-29.2.knots20251110+bip110-v0.1rc3 -B build \
40+
-DAPPEND_CPPFLAGS=-g0 \
41+
-DAPPEND_LDFLAGS=-Wl,--strip-all \
42+
-DBUILD_SHARED_LIBS=OFF \
43+
-DBUILD_TESTS=OFF \
44+
-DBUILD_TX=ON \
45+
-DBUILD_UTIL=ON \
46+
-DBUILD_WALLET_TOOL=ON \
47+
-DCMAKE_BUILD_TYPE=MinSizeRel \
48+
-DINSTALL_MAN=OFF \
49+
-DREDUCE_EXPORTS=ON \
50+
-DSECP256K1_APPEND_CFLAGS=-g0 \
51+
-DSECP256K1_APPEND_LDFLAGS=-Wl,--strip-all \
52+
-DWITH_BDB=ON \
53+
-DWITH_ZMQ=ON \
54+
--toolchain $(find /tmp/bitcoin-29.2.knots20251110+bip110-v0.1rc3/depends | grep -E "toolchain\.cmake$")
55+
56+
RUN cmake --build build -j $(nproc)
57+
58+
RUN cmake --install build
59+
60+
RUN upx --lzma /usr/local/bin/*
61+
62+
63+
FROM alpine:3.23 AS final
64+
65+
COPY --from=builder /usr/local/bin/* /usr/local/bin/
66+
67+
RUN apk add --no-cache \
68+
libgcc \
69+
libstdc++ \
70+
tor \
71+
&& adduser -D bitcoin \
72+
&& mkdir /home/bitcoin/.bitcoin \
73+
&& chown bitcoin:bitcoin /home/bitcoin/.bitcoin
74+
75+
USER bitcoin
76+
77+
VOLUME ["/home/bitcoin/.bitcoin"]
78+
79+
# REST interface
80+
EXPOSE 8080
81+
82+
# P2P network (mainnet, testnet, regtest & signet respectively)
83+
EXPOSE 8333 18333 18444 38333
84+
85+
# RPC interface (mainnet, testnet, regtest & signet respectively)
86+
EXPOSE 8332 18332 18443 38332
87+
88+
# ZMQ ports (for block hashes, raw blocks & raw transactions respectively)
89+
EXPOSE 8443 28332 28333
90+
91+
ENTRYPOINT ["/usr/local/bin/bitcoind", "-nodebuglogfile", "-zmqpubhashblock=tcp://0.0.0.0:8443", "-zmqpubrawblock=tcp://0.0.0.0:28332", "-zmqpubrawtx=tcp://0.0.0.0:28333"]

cmake/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ RUN cmake --install build
9797

9898
RUN upx --lzma /usr/local/bin/*
9999

100+
100101
FROM alpine:3.23 AS final
101102

102103
COPY --from=builder /usr/local/bin/* /usr/local/bin/

docker-bake.hcl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,15 @@ target "miner" {
6969
tags = ["1maa/bitcoin:signet-miner"]
7070
target = "signet-miner"
7171
}
72+
73+
target "bip110" {
74+
context = "bip110"
75+
cache-to = [{ type = "inline" }]
76+
cache-from = [
77+
{
78+
type = "registry"
79+
ref = "ghcr.io/bcnbitcoinonly/bitcoin:v29.2.knots20251110+bip110-v0.1rc3-${RUNNER}"
80+
}
81+
]
82+
tags = ["ghcr.io/bcnbitcoinonly/bitcoin:v29.2.knots20251110+bip110-v0.1rc3-${RUNNER}"]
83+
}

0 commit comments

Comments
 (0)