<<  >> (p.4)
    Author Topic: testnet4 in a container  (Read 524 times)
    mocacinno (OP)
    Legendary
    *
    Offline

    Activity: 4060
    Merit: 5541


    ♻️ Automatic Exchange


    View Profile WWW
    May 15, 2024, 07:46:39 AM
    Last edit: June 26, 2024, 07:54:57 AM by mocacinno
    Merited by LoyceV (42), vapourminer (10), pooya87 (10), DaveF (5), DdmrDdmr (4), seoincorporation (3), ABCbits (2)
     #1

    I decided to completely re-design the containers to make them (even more) safe and to make them easyer to maintain. In order not to clutter this discussion and focus on the new container images, i started a new thread: https://bt.irlbtc.com/view/5501093
    If you have any questions about this old discussion that isn't solved in the new thread, shoot me a PM or switch to the new thread instead!


    Hi guys, tought i would share my work (in progress)  Grin

    I was part of this discussion: https://bt.irlbtc.com/view/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...

    Code:
    FROM ubuntu:22.04 AS builder
    #start.sh sets proxy for apt, needed for my env...
    #COPY start.shusr/local/bin/
    #RUN chmod +xusr/local/bin/start.sh
    #RUNusr/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.gitbitcoin
    WORKDIRbitcoin
    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))"
    WORKDIRbitcoin/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=builderbitcoin/src/bitcoin-utilusr/local/bin
    COPY --from=builderbitcoin/src/bitcoin-cliusr/local/bin
    COPY --from=builderbitcoin/src/bitcoin-txusr/local/bin
    COPY --from=builderbitcoin/src/bitcoindusr/local/bin
    COPY --from=builderbitcoin/src/qt/bitcoin-qtusr/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_testnet4

    Afterwards, create a simple docker-compose.yml
    Code:
    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 Smiley

    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:
    Code:
    docker exec -it bitcoindbin/bash
    bitcoin-cli -testnet4 -rpcuser=demo -rpcpassword=demo createwallet mywally

    a (testnet4) tipping address: tb1qumlhr8tn9gsdyujy464jkk4c5r488u8kxteyx5  (only send testnet4 tBTC!!!) Tongue

    ░░░░▄▄████████████▄
    ▄████████████████▀
    ▄████████████████▀▄█▄
    ▄██████▀▀░░▄███▀▄████▄
    ▄██████▀░░░▄███▀▀██████▄
    ██████▀░░▄████▄░░░▀██████
    ██████░░▀▀▀▀▄▄▄▄░░██████
    ██████▄░░░▀████▀░░▄██████
    ▀██████▄▄███▀░░░▄██████▀
    ▀████▀▄████░░▄▄███████▀
    ▀█▀▄████████████████▀
    ▄████████████████▀
    ▀████████████▀▀░░░░
     
     CCECASH 
     
        ANN THREAD    
     
          TUTORIAL      
Page 3
Viewing Page: 4