Skip to content

Commit 50e70ba

Browse files
committed
custom signet blocktime
1 parent a608243 commit 50e70ba

File tree

5 files changed

+16
-8
lines changed

5 files changed

+16
-8
lines changed

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM debian:buster-slim as builder
22

3-
ARG BITCOIN_VERSION=${BITCOIN_VERSION:-c23afab47fbe}
3+
ARG BITCOIN_VERSION=${BITCOIN_VERSION:-d8434da3c14e}
44

55
ARG TARGETPLATFORM
66

@@ -14,7 +14,7 @@ WORKDIR /tmp
1414
linux/arm64) \
1515
echo "arm64" && export TRIPLET="aarch64-linux-gnu";; \
1616
esac && \
17-
BITCOIN_URL="https://github.com/benthecarman/bitcoin/releases/download/mutinynet-cat-lnhance/bitcoin-${BITCOIN_VERSION}-${TRIPLET}.tar.gz" && \
17+
BITCOIN_URL="https://github.com/benthecarman/bitcoin/releases/download/custom-signet-blocktime/bitcoin-${BITCOIN_VERSION}-${TRIPLET}.tar.gz" && \
1818
BITCOIN_FILE="bitcoin-${BITCOIN_VERSION}-${TRIPLET}.tar.gz" && \
1919
wget -qO "${BITCOIN_FILE}" "${BITCOIN_URL}" && \
2020
mkdir -p bin && \
@@ -49,7 +49,7 @@ ENV RPCBIND=${RPCBIND:-"0.0.0.0:38332"}
4949
ENV RPCALLOWIP=${RPCALLOWIP:-"0.0.0.0/0"}
5050
ENV WHITELIST=${WHITELIST:-"0.0.0.0/0"}
5151
ENV ADDNODE=${ADDNODE:-""}
52-
ENV BLOCKPRODUCTIONDELAY=${BLOCKPRODUCTIONDELAY:-"10"}
52+
ENV BLOCKPRODUCTIONDELAY=${BLOCKPRODUCTIONDELAY:-"30"}
5353
ENV MINERENABLED=${MINERENABLED:-"1"}
5454
ENV MINETO=${MINETO:-""}
5555
ENV EXTERNAL_IP=${EXTERNAL_IP:-""}

gen-bitcoind-conf.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,14 @@ if [[ "$EXTERNAL_IP" != "" ]]; then
2727
fi
2828

2929
echo "[signet]
30+
rest=1
3031
daemon=1
3132
listen=1
3233
server=1
34+
acceptnonstdtxn=1
35+
v2transport=1
3336
discover=1
37+
signetblocktime=$BLOCKPRODUCTIONDELAY
3438
signetchallenge=$SIGNETCHALLENGE
3539
zmqpubrawblock=$ZMQPUBRAWBLOCK
3640
zmqpubrawtx=$ZMQPUBRAWTX
@@ -60,4 +64,4 @@ fi
6064

6165
if [[ "$TORCONTROL" != "" ]]; then
6266
echo "torcontrol=$TORCONTROL"
63-
fi
67+
fi

mine.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22
NBITS=${NBITS:-"1e0377ae"} #minimum difficulty in signet
33

44
while true; do
5-
ADDR=${MINETO:-$(bitcoin-cli getnewaddress)}
5+
if [[ -f "${BITCOIN_DIR}/MINE_ADDRESS.txt" ]]; then
6+
ADDR=$(cat ~/.bitcoin/MINE_ADDRESS.txt)
7+
else
8+
ADDR=${MINETO:-$(bitcoin-cli getnewaddress)}
9+
fi
610
if [[ -f "${BITCOIN_DIR}/BLOCKPRODUCTIONDELAY.txt" ]]; then
711
BLOCKPRODUCTIONDELAY_OVERRIDE=$(cat ~/.bitcoin/BLOCKPRODUCTIONDELAY.txt)
812
echo "Delay OVERRIDE before next block" $BLOCKPRODUCTIONDELAY_OVERRIDE "seconds."
@@ -16,4 +20,4 @@ while true; do
1620
fi
1721
echo "Mine To:" $ADDR
1822
miner --cli="bitcoin-cli" generate --grind-cmd="bitcoin-util grind" --address=$ADDR --nbits=$NBITS --set-block-time=$(date +%s)
19-
done
23+
done

run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22

33
# run bitcoind
4-
bitcoind --daemonwait
4+
bitcoind --daemonwait -deprecatedrpc=create_bdb
55
sleep 5
66
echo "get magic"
77
magic=$(cat /root/.bitcoin/signet/debug.log | grep -m1 magic)

setup-signet.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PRIVKEY=${PRIVKEY:-$(cat ~/.bitcoin/PRIVKEY.txt)}
22
DATADIR=${DATADIR:-~/.bitcoin/}
33
bitcoind -datadir=$DATADIR --daemonwait -persistmempool -deprecatedrpc=create_bdb
4-
bitcoin-cli -datadir=$DATADIR -named createwallet wallet_name="alpen_wallet" load_on_startup=true descriptors=false
4+
bitcoin-cli -datadir=$DATADIR -named createwallet wallet_name="custom_signet" load_on_startup=true descriptors=false
55

66
#only used in case of mining node
77
if [[ "$MINERENABLED" == "1" ]]; then

0 commit comments

Comments
 (0)