Hi guys, tought i would share my work (
in progress)
I was part of this discussion:
https://bitcointalk.org/index.php?topic=5496329.0 It was about a potential switch to testnet4...
I quickly pointed out how to merge the pull request for testnet4, but last night i started to think: i want to do this in a reproducible way... So i created a docker image you could easily run yourself...
FROM ubuntu:22.04 AS builder
#start.sh sets proxy for apt, needed for my env...
#COPY start.sh /usr/local/bin/
#RUN chmod +x /usr/local/bin/start.sh
#RUN /usr/local/bin/start.sh
#install all prereqs
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata && apt-get -y install git autoconf pkg-config libtool build-essential bsdmainutils libevent-dev libdb-dev libdb++-dev clang python3 libssl-dev libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-test-dev libboost-thread-dev libminiupnpc-dev libzmq3-dev libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev protobuf-compiler libsqlite3-dev ccache
#pull pr
RUN git clone https://github.com/bitcoin/bitcoin.git /bitcoin
WORKDIR /bitcoin
RUN git fetch origin pull/29775/head:pr-29775 && git checkout pr-29775
#compile
RUN ./autogen.sh
RUN ./configure --with-incompatible-bdb CC=clang CXX=clang++
RUN make -j "$(($(nproc) + 1))"
WORKDIR /bitcoin/src
RUN strip bitcoin-util && strip bitcoind && strip bitcoin-cli && strip bitcoin-tx && strip qt/bitcoin-qt
#multistage
FROM ubuntu:22.04
RUN apt-get update && apt-get install -y libdb5.3++-dev libminiupnpc-dev libevent-dev libzmq3-dev libsqlite3-dev
COPY --from=builder /bitcoin/src/bitcoin-util /usr/local/bin
COPY --from=builder /bitcoin/src/bitcoin-cli /usr/local/bin
COPY --from=builder /bitcoin/src/bitcoin-tx /usr/local/bin
COPY --from=builder /bitcoin/src/bitcoind /usr/local/bin
COPY --from=builder /bitcoin/src/qt/bitcoin-qt /usr/local/bin
you can either build the image yourself (should be reproducible), or you can use the image i built:
https://hub.docker.com/r/mocacinno/btc_testnet4Afterwards, create a simple docker-compose.yml
version: '3'
services:
bitcoind:
image: mocacinno/btc_testnet4
privileged: true
container_name: bitcoind
volumes:
- /root/project/run_btc_testnet4/data:/root/.bitcoin/
command: ["bitcoind", "-testnet4", "-server", "-rpcuser=demo", "-rpcpassword=demo", "-rpcallowip=127.0.0.1"]
ports:
- "8333:8333"
- "48332:48332"
Ofcourse, change the volume path to a path that exists on your host, and change the rpc user and pass
Then it's just a matter of "docker-compose up -d" to pull the image and start bitcoind.
Connect to the running container and create a wallet:
docker exec -it bitcoind /bin/bash
bitcoin-cli -testnet4 -rpcuser=demo -rpcpassword=demo createwallet mywally
a (testnet4) tipping address: tb1qumlhr8tn9gsdyujy464jkk4c5r488u8kxteyx5 (only send testnet4 tBTC!!!)