Skip to content

Latest commit

 

History

History
114 lines (84 loc) · 3.75 KB

File metadata and controls

114 lines (84 loc) · 3.75 KB

Mutinynet

This repo contains most of the deployment for Mutinynet. It originally is a fork of Plebnet but has grown to include a lot more.

The main deployment is done with docker-compose. It contains various services:

Most of these just pull the released docker images from dockerhub, but there are also some custom services:

  • bitcoind this is a custom build of bitcoind with soft forks and 30s block time. It also contains the scripts to mine signet blocks.
  • electrs this is a small fork of electrs to add a dockerfile and some fixes for signet, however these fixes ended up not being needed IIRC.
  • rapid-gossip-sync-server this is a fork of rapid-gossip-sync-server to allow for a 10m snapshot interval. At the time there was no way to change the interval in the project, now there is but is has worked so far so I have not updated it.

Versions prior to 29.0 were using BDB wallet, system will automatically update your wallet to new descriptor format. PRIVKEY prior to 29.0 was a WIF, now is descriptor on new wallets.

Running

To run the deployment, you need to have docker and docker-compose installed. Then you can run:

docker-compose up -d

This will start all the services. You can check the logs with:

docker-compose logs -f

You can also run the services individually:

docker-compose up -d bitcoind lnd rgs_server

You can create some aliases to make it easier to interact with bitcoind and lnd:

alias lncli="docker exec -it lnd /bin/lncli -n signet"
alias bitcoin-cli="docker exec -it bitcoind /usr/local/bin/bitcoin-cli"

Activating a soft fork

Bitcoin Inquisition "heretical" deployments lock in as soon as one block in the current 432-block signet period is mined with nVersion == signal_activate. The next period it becomes active.

signal_activate = 0x60000000 | binana_id, where binana_id = ((year % 32) << 22) | (number << 8) | revision from the deployment's src/binana/*.json entry. Use calc_nversion.py to compute it:

./calc_nversion.py 2026 1 0
# or from the binana JSON itself:
./calc_nversion.py path/to/bitcoin/src/binana/templatehash.json

For example, TEMPLATEHASH (BIP446, binana [2026, 1, 0]) gives 0x62800100.

The miner script inside bitcoind-miner already accepts --nversion, so we can mine one signalling block directly without modifying mine.sh. Signet blocks at min-difficulty solve fast enough to beat the next loop iteration:

docker exec bitcoind-miner sh -c '
  miner --debug \
        --cli="bitcoin-cli -datadir=/root/.bitcoin -rpcwallet=custom_signet" \
        generate \
        --grind-cmd="bitcoin-util grind" \
        --addr=tb1qd28npep0s8frcm3y7dxqajkcy2m40eysplyr9v \
        --nbits=1e0377ae \
        --nversion=0x62800100 \
        --set-block-time=$(date +%s)
'

Check the state transition with:

bitcoin-cli getdeploymentinfo | jq '.deployments.templatehash'

You should see current_state go startedlocked_inactive over the next two 432-block periods.

Updating

To update the deployment, you can run:

git pull
docker-compose pull

And then restart the services:

docker-compose up -d