Skip to content

Commit 8ae5241

Browse files
authored
Merge pull request #52 from dappnode/hector/fix-issues
Add ARM support, fix P2P en var in entrypoint
2 parents a3c6d50 + eb93da0 commit 8ae5241

5 files changed

Lines changed: 43 additions & 21 deletions

File tree

‎.gitignore‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
build/
1+
# DAppNodeSDK release directories
2+
build_*
3+
docker-compose-tmp.yml

‎dappnode_package.json‎

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,24 @@
77
"shortDescription": "Support the Bitcoin network, run your own node",
88
"description": "The Bitcoin Core daemon. Bitcoind is a program that implements the Bitcoin protocol for remote procedure call (RPC) use.",
99
"type": "service",
10+
"architectures": [
11+
"linux/amd64",
12+
"linux/arm64"
13+
],
1014
"chain": "bitcoin",
1115
"author": "DAppNode Association <admin@dappnode.io> (https://github.com/dappnode)",
1216
"contributors": [
1317
"Abel Boldú (@vdo)",
1418
"Eduardo Antuña <eduadiez@gmail.com> (https://github.com/eduadiez)",
1519
"Loco del Bitcoin <ellocodelbitcoin@gmail.com>"
1620
],
17-
"categories": ["Blockchain"],
18-
"keywords": ["bitcoin", "btc"],
21+
"categories": [
22+
"Blockchain"
23+
],
24+
"keywords": [
25+
"bitcoin",
26+
"btc"
27+
],
1928
"links": {
2029
"homepage": "https://github.com/dappnode/DAppNodePackage-bitcoin#readme",
2130
"endpoint": "http://bitcoin.dappnode:8332"
@@ -28,4 +37,4 @@
2837
"url": "https://github.com/dappnode/DAppNodePackage-bitcoin/issues"
2938
},
3039
"license": "GPL-3.0"
31-
}
40+
}

‎releases.json‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,11 @@
66
"dappnode": "Mon, 25 Nov 2019 16:12:52 GMT"
77
},
88
"link": "http://my.dappnode/#/sdk/publish/r=bitcoin.dnp.dappnode.eth&v=0.1.5&h=%2Fipfs%2FQmWzNqeGK7BZ2L3J5yeA6FmTPscuub2qYiWKoQo4ia8ZVJ"
9+
},
10+
"0.1.10": {
11+
"hash": "/ipfs/QmSfeBp7tL8MH3vrPkfj7T5EkS7xm8DimU5cgVAqL8wCh9",
12+
"uploadedTo": {
13+
"dappnode": "Thu, 14 Aug 2025 10:32:51 GMT"
14+
}
915
}
10-
}
16+
}

‎src/Dockerfile‎

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,28 @@ FROM debian:bullseye-slim as binary
66
# To fix this incongruation it is removed the first char from the env UPSTREA_VERSION to download the binary and
77
# keep the CI in github to bumpo the version with the sdk bot
88

9-
ARG UPSTREAM_VERSION
109

1110
RUN apt-get update && apt-get install curl -y
1211

13-
RUN curl https://bitcoincore.org/bin/bitcoin-core-${UPSTREAM_VERSION}/bitcoin-${UPSTREAM_VERSION}-x86_64-linux-gnu.tar.gz -o bitcoin-${UPSTREAM_VERSION}-x86_64-linux-gnu.tar.gz
14-
15-
RUN expected_256checksum=$(curl https://bitcoincore.org/bin/bitcoin-core-${UPSTREAM_VERSION}/SHA256SUMS | grep bitcoin-${UPSTREAM_VERSION}-x86_64-linux-gnu.tar.gz | awk '{print $1}') \
16-
&& if [ sha256sum /bitcoin-${UPSTREAM_VERSION}-x86_64-linux-gnu.tar.gz | awk '{print $1}' != "$expected_256checksum" ]; then \
17-
tar xzvf /bitcoin-${UPSTREAM_VERSION}-x86_64-linux-gnu.tar.gz; \
18-
mv /bitcoin-${UPSTREAM_VERSION} /bitcoin; \
19-
echo "Checksum verification failed."; \
20-
else \
21-
tar xzvf /bitcoin-${UPSTREAM_VERSION}-x86_64-linux-gnu.tar.gz; \
22-
mv /bitcoin-${UPSTREAM_VERSION} /bitcoin; \
23-
fi
24-
25-
12+
ARG UPSTREAM_VERSION
13+
ARG TARGETARCH
14+
# map Docker arch to Core tarball arch names + verify checksum and extract
15+
RUN set -eux; \
16+
VERSION_NO_V="${UPSTREAM_VERSION#v}"; \
17+
case "$TARGETARCH" in \
18+
amd64) CORE_ARCH="x86_64" ;; \
19+
arm64) CORE_ARCH="aarch64" ;; \
20+
*) echo "Unsupported arch: $TARGETARCH" >&2; exit 1 ;; \
21+
esac; \
22+
BASE_URL="https://bitcoincore.org/bin/bitcoin-core-${VERSION_NO_V}"; \
23+
TARBALL="bitcoin-${VERSION_NO_V}-${CORE_ARCH}-linux-gnu.tar.gz"; \
24+
curl -fsSL "${BASE_URL}/${TARBALL}" -o /tmp/bitcoin.tar.gz; \
25+
curl -fsSL "${BASE_URL}/SHA256SUMS" -o /tmp/SHA256SUMS; \
26+
EXPECTED="$(grep " ${TARBALL}\$" /tmp/SHA256SUMS | awk '{print $1}')"; \
27+
ACTUAL="$(sha256sum /tmp/bitcoin.tar.gz | awk '{print $1}')"; \
28+
test -n "$EXPECTED"; \
29+
[ "$EXPECTED" = "$ACTUAL" ] || { echo "SHA256 mismatch: expected=$EXPECTED actual=$ACTUAL" >&2; exit 1; }; \
30+
mkdir -p /bitcoin && tar -xzf /tmp/bitcoin.tar.gz -C /bitcoin --strip-components=1
2631

2732
FROM debian:bullseye-slim AS final
2833

@@ -33,4 +38,4 @@ COPY --from=binary /bitcoin/bin/bitcoind /usr/local/bin/
3338
ADD ./docker_entrypoint.sh /usr/local/bin/docker_entrypoint.sh
3439
RUN chmod a+x /usr/local/bin/docker_entrypoint.sh
3540

36-
ENTRYPOINT ["/usr/local/bin/docker_entrypoint.sh"]
41+
ENTRYPOINT ["/usr/local/bin/docker_entrypoint.sh"]

‎src/docker_entrypoint.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ EOF
6464
#fi
6565

6666
if [ $# -eq 0 ]; then
67-
exec bitcoind -datadir=${BITCOIN_DIR} -conf=${BITCOIN_CONF} -port={P2P_PORT}
67+
exec bitcoind -datadir=${BITCOIN_DIR} -conf=${BITCOIN_CONF} -port=${P2P_PORT:-8333}
6868
else
6969
exec "$@"
7070
fi

0 commit comments

Comments
 (0)