Skip to content

Commit

Permalink
Build bitcoin-abc v0.27
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-genev committed May 15, 2024
1 parent 42c86c2 commit 5c80cb7
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ podTemplate(label: 'docker-bitcoin-abc', containers: [
stage('Build Image') {
container('docker') {
def scmVars = checkout scm
def VERSION = "bchn-26.1"
def VERSION = "bchn-27"
def VERSION_MINOR = "${VERSION}.0"
dir("${VERSION}") {
sh "docker build -t santiment/bitcoin-abc:${VERSION_MINOR} -t santiment/bitcoin-abc:${VERSION} ."
Expand Down
33 changes: 33 additions & 0 deletions bchn-27/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
FROM ubuntu:22.04

RUN groupadd -r bitcoin && useradd -r -m -g bitcoin bitcoin

RUN set -ex \
&& apt-get update \
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu gpg wget \
&& rm -rf /var/lib/apt/lists/*

ENV BITCOIN_VERSION 27.0.0
ENV BITCOIN_URL "https://github.com/bitcoin-cash-node/bitcoin-cash-node/releases/download/v$BITCOIN_VERSION/bitcoin-cash-node-$BITCOIN_VERSION-x86_64-linux-gnu.tar.gz"
ENV BITCOIN_SHA256 65307b1b13142defb5d4239a84c53b9f5ce7b7baca6ed8f899782ec7a9be4a72

# install bitcoin binaries
RUN set -ex \
&& cd /tmp \
&& wget -qO bitcoin.tar.gz "$BITCOIN_URL" \
&& echo "$BITCOIN_SHA256 bitcoin.tar.gz" | sha256sum -c - \
&& tar -xzvf bitcoin.tar.gz -C /usr/local --strip-components=1 --exclude=*-qt \
&& rm -rf /tmp/*

# create data directory
ENV BITCOIN_DATA /data
RUN mkdir "$BITCOIN_DATA" \
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
VOLUME /data

COPY docker-entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh", "bitcoind"]

EXPOSE 8332 8333 18332 18333
27 changes: 27 additions & 0 deletions bchn-27/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash
set -e

if [[ "$1" == "bitcoin-cli" || "$1" == "bitcoin-tx" || "$1" == "bitcoind" || "$1" == "test_bitcoin" ]]; then
mkdir -p "$BITCOIN_DATA"

if [[ ! -s "$BITCOIN_DATA/bitcoin.conf" ]]; then
cat <<-EOF > "$BITCOIN_DATA/bitcoin.conf"
printtoconsole=1
rpcallowip=::/0
rpcpassword=${BITCOIN_RPC_PASSWORD:-password}
rpcuser=${BITCOIN_RPC_USER:-bitcoin}
EOF
chown bitcoin:bitcoin "$BITCOIN_DATA/bitcoin.conf"
fi

# ensure correct ownership and linking of data directory
# we do not update group ownership here, in case users want to mount
# a host directory and still retain access to it
chown -R bitcoin "$BITCOIN_DATA"
ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin
chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin

exec gosu bitcoin "$@"
fi

exec "$@"

0 comments on commit 5c80cb7

Please sign in to comment.