Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Groestlcoin Core 27.0 & 28.0 #103

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions Groestlcoin/27.0/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#!/bin/bash
set -e

if [[ "$1" == "groestlcoin-cli" || "$1" == "groestlcoin-tx" || "$1" == "groestlcoind" || "$1" == "test_groestlcoin" ]]; then
mkdir -p "$GROESTLCOIN_DATA"

CONFIG_PREFIX=""
if [[ "${GROESTLCOIN_NETWORK}" == "regtest" ]]; then
CONFIG_PREFIX=$'regtest=1\n[regtest]'
elif [[ "${GROESTLCOIN_NETWORK}" == "testnet" ]]; then
CONFIG_PREFIX=$'testnet=1\n[test]'
elif [[ "${GROESTLCOIN_NETWORK}" == "mainnet" ]]; then
CONFIG_PREFIX=$'mainnet=1\n[main]'
elif [[ "${GROESTLCOIN_NETWORK}" == "signet" ]]; then
CONFIG_PREFIX=$'signet=1\n[signet]'
else
GROESTLCOIN_NETWORK="mainnet"
CONFIG_PREFIX=$'mainnet=1\n[main]'
fi

if [[ "$GROESTLCOIN_WALLETDIR" ]] && [[ "$GROESTLCOIN_NETWORK" ]]; then
NL=$'\n'
WALLETDIR="$GROESTLCOIN_WALLETDIR/${GROESTLCOIN_NETWORK}"
WALLETFILE="${WALLETDIR}/wallet.dat"
mkdir -p "$WALLETDIR"
chown -R groestlcoin:groestlcoin "$WALLETDIR"
CONFIG_PREFIX="${CONFIG_PREFIX}${NL}walletdir=${WALLETDIR}${NL}"
: "${CREATE_WALLET:=true}"
if ! [[ -f "${WALLETFILE}" ]] && [[ "${CREATE_WALLET}" != "false" ]]; then
echo "The wallet does not exists, creating it at ${WALLETDIR}..."
gosu groestlcoin groestlcoin-wallet "-datadir=${WALLETDIR}" "-legacy" "-wallet=" create
fi
fi

cat <<-EOF > "$GROESTLCOIN_DATA/groestlcoin.conf"
${CONFIG_PREFIX}
printtoconsole=1
rpcallowip=::/0
${GROESTLCOIN_EXTRA_ARGS}
EOF
chown groestlcoin:groestlcoin "$GROESTLCOIN_DATA/groestlcoin.conf"

if [[ "${GROESTLCOIN_TORCONTROL}" ]]; then
# Because groestlcoind only accept torcontrol= host as an ip only, we resolve it here and add to config
TOR_CONTROL_HOST=$(echo ${GROESTLCOIN_TORCONTROL} | cut -d ':' -f 1)
TOR_CONTROL_PORT=$(echo ${GROESTLCOIN_TORCONTROL} | cut -d ':' -f 2)
if [[ "$TOR_CONTROL_HOST" ]] && [[ "$TOR_CONTROL_PORT" ]]; then
TOR_IP=$(getent hosts $TOR_CONTROL_HOST | cut -d ' ' -f 1)
echo "torcontrol=$TOR_IP:$TOR_CONTROL_PORT" >> "$GROESTLCOIN_DATA/groestlcoin.conf"
echo "Added "torcontrol=$TOR_IP:$TOR_CONTROL_PORT" to $GROESTLCOIN_DATA/groestlcoin.conf"
else
echo "Invalid GROESTLCOIN_TORCONTROL"
fi
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 groestlcoin "$GROESTLCOIN_DATA"
ln -sfn "$GROESTLCOIN_DATA" /home/groestlcoin/.groestlcoin
chown -h groestlcoin:groestlcoin /home/groestlcoin/.groestlcoin
rm -f /home/groestlcoin/.groestlcoin/settings.json

exec gosu groestlcoin "$@"
else
exec "$@"
fi
47 changes: 47 additions & 0 deletions Groestlcoin/27.0/linuxamd64.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
FROM debian:bookworm-slim as builder

RUN set -ex \
&& apt-get update \
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget

ENV GROESTLCOIN_VERSION 27.0
ENV GROESTLCOIN_TARBALL groestlcoin-${GROESTLCOIN_VERSION}-x86_64-linux-gnu.tar.gz
ENV GROESTLCOIN_URL https://github.com/Groestlcoin/groestlcoin/releases/download/v$GROESTLCOIN_VERSION/$GROESTLCOIN_TARBALL
ENV GROESTLCOIN_SHA256 5189f036913e2033b5fe95ba8f3fc027e9c5bd286d2150e9133cd4a2fd69a7a0

# install groestlcoin binaries
RUN set -ex \
&& cd /tmp \
&& wget -qO $GROESTLCOIN_TARBALL "$GROESTLCOIN_URL" \
&& echo "$GROESTLCOIN_SHA256 $GROESTLCOIN_TARBALL" | sha256sum -c - \
&& mkdir bin \
&& tar -xzvf $GROESTLCOIN_TARBALL -C /tmp/bin --strip-components=2 "groestlcoin-$GROESTLCOIN_VERSION/bin/groestlcoin-cli" "groestlcoin-$GROESTLCOIN_VERSION/bin/groestlcoind" "groestlcoin-$GROESTLCOIN_VERSION/bin/groestlcoin-wallet" \
&& cd bin \
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.16/gosu-amd64" \
&& echo "3a4e1fc7430f9e7dd7b0cbbe0bfde26bf4a250702e84cf48a1eb2b631c64cf13 gosu" | sha256sum -c -

FROM debian:bookworm-slim
COPY --from=builder "/tmp/bin" /usr/local/bin

ARG GROESTLCOIN_USER_ID=999
ARG GROESTLCOIN_GROUP_ID=999

RUN apt-get update && \
apt-get install -qq --no-install-recommends xxd && \
rm -rf /var/lib/apt/lists/*
RUN chmod +x /usr/local/bin/gosu && groupadd -r -g $GROESTLCOIN_GROUP_ID groestlcoin && useradd -r -m -u $GROESTLCOIN_USER_ID -g groestlcoin groestlcoin

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

VOLUME /data

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

EXPOSE 1331 1441 17777 17766 18888 18443 31331 31441
CMD ["groestlcoind"]
52 changes: 52 additions & 0 deletions Groestlcoin/27.0/linuxarm32v7.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Use manifest image which support all architecture
FROM debian:bookworm-slim as builder

RUN set -ex \
&& apt-get update \
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
RUN apt-get install -qq --no-install-recommends qemu-user-static binfmt-support

ENV GROESTLCOIN_VERSION 27.0
ENV GROESTLCOIN_TARBALL groestlcoin-${GROESTLCOIN_VERSION}-arm-linux-gnueabihf.tar.gz
ENV GROESTLCOIN_URL https://github.com/Groestlcoin/groestlcoin/releases/download/v$GROESTLCOIN_VERSION/$GROESTLCOIN_TARBALL
ENV GROESTLCOIN_SHA256 61e29509efcd63e5acc666d0ed2d197d0448345549df168b0011f04d3081b760

# install groestlcoin binaries
RUN set -ex \
&& cd /tmp \
&& wget -qO $GROESTLCOIN_TARBALL "$GROESTLCOIN_URL" \
&& echo "$GROESTLCOIN_SHA256 $GROESTLCOIN_TARBALL" | sha256sum -c - \
&& mkdir bin \
&& tar -xzvf $GROESTLCOIN_TARBALL -C /tmp/bin --strip-components=2 "groestlcoin-$GROESTLCOIN_VERSION/bin/groestlcoin-cli" "groestlcoin-$GROESTLCOIN_VERSION/bin/groestlcoind" "groestlcoin-$GROESTLCOIN_VERSION/bin/groestlcoin-wallet" \
&& cd bin \
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.16/gosu-armhf" \
&& echo "1b670d5426e1ddbb14a14280afb6850a48c219189d4cfe7e6eb2cc08a4fc7785 gosu" | sha256sum -c -

# Making sure the builder build an arm image despite being x64
FROM arm32v7/debian:bookworm-slim

COPY --from=builder "/tmp/bin" /usr/local/bin
COPY --from=builder /usr/bin/qemu-arm-static /usr/bin/qemu-arm-static

ARG GROESTLCOIN_USER_ID=999
ARG GROESTLCOIN_GROUP_ID=999

RUN apt-get update && \
apt-get install -qq --no-install-recommends xxd && \
rm -rf /var/lib/apt/lists/*
RUN chmod +x /usr/local/bin/gosu && groupadd -r -g $GROESTLCOIN_GROUP_ID groestlcoin && useradd -r -m -u $GROESTLCOIN_USER_ID -g groestlcoin groestlcoin

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

VOLUME /data

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

EXPOSE 1331 1441 17777 17766 18888 18443 31331 31441
CMD ["groestlcoind"]
52 changes: 52 additions & 0 deletions Groestlcoin/27.0/linuxarm64v8.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Use manifest image which support all architecture
FROM debian:bookworm-slim as builder

RUN set -ex \
&& apt-get update \
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
RUN apt-get install -qq --no-install-recommends qemu-user-static binfmt-support

ENV GROESTLCOIN_VERSION 27.0
ENV GROESTLCOIN_TARBALL groestlcoin-${GROESTLCOIN_VERSION}-aarch64-linux-gnu.tar.gz
ENV GROESTLCOIN_URL https://github.com/Groestlcoin/groestlcoin/releases/download/v$GROESTLCOIN_VERSION/$GROESTLCOIN_TARBALL
ENV GROESTLCOIN_SHA256 95e1a4c4f4d50709df40e2d86c4b578db053d1cb475a3384862192c1298f9de6

# install groestlcoin binaries
RUN set -ex \
&& cd /tmp \
&& wget -qO $GROESTLCOIN_TARBALL "$GROESTLCOIN_URL" \
&& echo "$GROESTLCOIN_SHA256 $GROESTLCOIN_TARBALL" | sha256sum -c - \
&& mkdir bin \
&& tar -xzvf $GROESTLCOIN_TARBALL -C /tmp/bin --strip-components=2 "groestlcoin-$GROESTLCOIN_VERSION/bin/groestlcoin-cli" "groestlcoin-$GROESTLCOIN_VERSION/bin/groestlcoind" "groestlcoin-$GROESTLCOIN_VERSION/bin/groestlcoin-wallet" \
&& cd bin \
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.16/gosu-arm64" \
&& echo "23fa49907d5246d2e257de3bf883f57fba47fe1f559f7e732ff16c0f23d2b6a6 gosu" | sha256sum -c -

# Making sure the builder build an arm image despite being x64
FROM arm64v8/debian:bookworm-slim

COPY --from=builder "/tmp/bin" /usr/local/bin
COPY --from=builder /usr/bin/qemu-aarch64-static /usr/bin/qemu-aarch64-static

ARG GROESTLCOIN_USER_ID=999
ARG GROESTLCOIN_GROUP_ID=999

RUN apt-get update && \
apt-get install -qq --no-install-recommends xxd && \
rm -rf /var/lib/apt/lists/*
RUN chmod +x /usr/local/bin/gosu && groupadd -r -g $GROESTLCOIN_GROUP_ID groestlcoin && useradd -r -m -u $GROESTLCOIN_USER_ID -g groestlcoin groestlcoin

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

VOLUME /data

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

EXPOSE 1331 1441 17777 17766 18888 18443 31331 31441
CMD ["groestlcoind"]
67 changes: 67 additions & 0 deletions Groestlcoin/28.0/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#!/bin/bash
set -e

if [[ "$1" == "groestlcoin-cli" || "$1" == "groestlcoin-tx" || "$1" == "groestlcoind" || "$1" == "test_groestlcoin" ]]; then
mkdir -p "$GROESTLCOIN_DATA"

CONFIG_PREFIX=""
if [[ "${GROESTLCOIN_NETWORK}" == "regtest" ]]; then
CONFIG_PREFIX=$'regtest=1\n[regtest]'
elif [[ "${GROESTLCOIN_NETWORK}" == "testnet" ]]; then
CONFIG_PREFIX=$'testnet=1\n[test]'
elif [[ "${GROESTLCOIN_NETWORK}" == "mainnet" ]]; then
CONFIG_PREFIX=$'mainnet=1\n[main]'
elif [[ "${GROESTLCOIN_NETWORK}" == "signet" ]]; then
CONFIG_PREFIX=$'signet=1\n[signet]'
else
GROESTLCOIN_NETWORK="mainnet"
CONFIG_PREFIX=$'mainnet=1\n[main]'
fi

if [[ "$GROESTLCOIN_WALLETDIR" ]] && [[ "$GROESTLCOIN_NETWORK" ]]; then
NL=$'\n'
WALLETDIR="$GROESTLCOIN_WALLETDIR/${GROESTLCOIN_NETWORK}"
WALLETFILE="${WALLETDIR}/wallet.dat"
mkdir -p "$WALLETDIR"
chown -R groestlcoin:groestlcoin "$WALLETDIR"
CONFIG_PREFIX="${CONFIG_PREFIX}${NL}walletdir=${WALLETDIR}${NL}"
: "${CREATE_WALLET:=true}"
if ! [[ -f "${WALLETFILE}" ]] && [[ "${CREATE_WALLET}" != "false" ]]; then
echo "The wallet does not exists, creating it at ${WALLETDIR}..."
gosu groestlcoin groestlcoin-wallet "-datadir=${WALLETDIR}" "-legacy" "-wallet=" create
fi
fi

cat <<-EOF > "$GROESTLCOIN_DATA/groestlcoin.conf"
${CONFIG_PREFIX}
printtoconsole=1
rpcallowip=::/0
${GROESTLCOIN_EXTRA_ARGS}
EOF
chown groestlcoin:groestlcoin "$GROESTLCOIN_DATA/groestlcoin.conf"

if [[ "${GROESTLCOIN_TORCONTROL}" ]]; then
# Because groestlcoind only accept torcontrol= host as an ip only, we resolve it here and add to config
TOR_CONTROL_HOST=$(echo ${GROESTLCOIN_TORCONTROL} | cut -d ':' -f 1)
TOR_CONTROL_PORT=$(echo ${GROESTLCOIN_TORCONTROL} | cut -d ':' -f 2)
if [[ "$TOR_CONTROL_HOST" ]] && [[ "$TOR_CONTROL_PORT" ]]; then
TOR_IP=$(getent hosts $TOR_CONTROL_HOST | cut -d ' ' -f 1)
echo "torcontrol=$TOR_IP:$TOR_CONTROL_PORT" >> "$GROESTLCOIN_DATA/groestlcoin.conf"
echo "Added "torcontrol=$TOR_IP:$TOR_CONTROL_PORT" to $GROESTLCOIN_DATA/groestlcoin.conf"
else
echo "Invalid GROESTLCOIN_TORCONTROL"
fi
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 groestlcoin "$GROESTLCOIN_DATA"
ln -sfn "$GROESTLCOIN_DATA" /home/groestlcoin/.groestlcoin
chown -h groestlcoin:groestlcoin /home/groestlcoin/.groestlcoin
rm -f /home/groestlcoin/.groestlcoin/settings.json

exec gosu groestlcoin "$@"
else
exec "$@"
fi
47 changes: 47 additions & 0 deletions Groestlcoin/28.0/linuxamd64.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
FROM debian:bookworm-slim as builder

RUN set -ex \
&& apt-get update \
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget

ENV GROESTLCOIN_VERSION 28.0
ENV GROESTLCOIN_TARBALL groestlcoin-${GROESTLCOIN_VERSION}-x86_64-linux-gnu.tar.gz
ENV GROESTLCOIN_URL https://github.com/Groestlcoin/groestlcoin/releases/download/v$GROESTLCOIN_VERSION/$GROESTLCOIN_TARBALL
ENV GROESTLCOIN_SHA256 540d5d7c6bb0449763567ea7c2559e124d61b82a6b2798701d5759458d9c21d7

# install groestlcoin binaries
RUN set -ex \
&& cd /tmp \
&& wget -qO $GROESTLCOIN_TARBALL "$GROESTLCOIN_URL" \
&& echo "$GROESTLCOIN_SHA256 $GROESTLCOIN_TARBALL" | sha256sum -c - \
&& mkdir bin \
&& tar -xzvf $GROESTLCOIN_TARBALL -C /tmp/bin --strip-components=2 "groestlcoin-$GROESTLCOIN_VERSION/bin/groestlcoin-cli" "groestlcoin-$GROESTLCOIN_VERSION/bin/groestlcoind" "groestlcoin-$GROESTLCOIN_VERSION/bin/groestlcoin-wallet" \
&& cd bin \
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.16/gosu-amd64" \
&& echo "3a4e1fc7430f9e7dd7b0cbbe0bfde26bf4a250702e84cf48a1eb2b631c64cf13 gosu" | sha256sum -c -

FROM debian:bookworm-slim
COPY --from=builder "/tmp/bin" /usr/local/bin

ARG GROESTLCOIN_USER_ID=999
ARG GROESTLCOIN_GROUP_ID=999

RUN apt-get update && \
apt-get install -qq --no-install-recommends xxd && \
rm -rf /var/lib/apt/lists/*
RUN chmod +x /usr/local/bin/gosu && groupadd -r -g $GROESTLCOIN_GROUP_ID groestlcoin && useradd -r -m -u $GROESTLCOIN_USER_ID -g groestlcoin groestlcoin

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

VOLUME /data

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

EXPOSE 1331 1441 17777 17766 18888 18443 31331 31441
CMD ["groestlcoind"]
52 changes: 52 additions & 0 deletions Groestlcoin/28.0/linuxarm32v7.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Use manifest image which support all architecture
FROM debian:bookworm-slim as builder

RUN set -ex \
&& apt-get update \
&& apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu wget
RUN apt-get install -qq --no-install-recommends qemu-user-static binfmt-support

ENV GROESTLCOIN_VERSION 28.0
ENV GROESTLCOIN_TARBALL groestlcoin-${GROESTLCOIN_VERSION}-arm-linux-gnueabihf.tar.gz
ENV GROESTLCOIN_URL https://github.com/Groestlcoin/groestlcoin/releases/download/v$GROESTLCOIN_VERSION/$GROESTLCOIN_TARBALL
ENV GROESTLCOIN_SHA256 a66172e939d79b50d8201ca925d6dd0cce0ca478b0a92fbd459d9533fd360812

# install groestlcoin binaries
RUN set -ex \
&& cd /tmp \
&& wget -qO $GROESTLCOIN_TARBALL "$GROESTLCOIN_URL" \
&& echo "$GROESTLCOIN_SHA256 $GROESTLCOIN_TARBALL" | sha256sum -c - \
&& mkdir bin \
&& tar -xzvf $GROESTLCOIN_TARBALL -C /tmp/bin --strip-components=2 "groestlcoin-$GROESTLCOIN_VERSION/bin/groestlcoin-cli" "groestlcoin-$GROESTLCOIN_VERSION/bin/groestlcoind" "groestlcoin-$GROESTLCOIN_VERSION/bin/groestlcoin-wallet" \
&& cd bin \
&& wget -qO gosu "https://github.com/tianon/gosu/releases/download/1.16/gosu-armhf" \
&& echo "1b670d5426e1ddbb14a14280afb6850a48c219189d4cfe7e6eb2cc08a4fc7785 gosu" | sha256sum -c -

# Making sure the builder build an arm image despite being x64
FROM arm32v7/debian:bookworm-slim

COPY --from=builder "/tmp/bin" /usr/local/bin
COPY --from=builder /usr/bin/qemu-arm-static /usr/bin/qemu-arm-static

ARG GROESTLCOIN_USER_ID=999
ARG GROESTLCOIN_GROUP_ID=999

RUN apt-get update && \
apt-get install -qq --no-install-recommends xxd && \
rm -rf /var/lib/apt/lists/*
RUN chmod +x /usr/local/bin/gosu && groupadd -r -g $GROESTLCOIN_GROUP_ID groestlcoin && useradd -r -m -u $GROESTLCOIN_USER_ID -g groestlcoin groestlcoin

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

VOLUME /data

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

EXPOSE 1331 1441 17777 17766 18888 18443 31331 31441
CMD ["groestlcoind"]
Loading