Skip to content

Support signet and testnet networks #17

Closed

Description

@msgilligan

Currently, the bitcoind option network is read-only and defaults to mainnet. If the regtest option is set to true then network is set to regtest.

We should support signet and testnet4. This will support using bitcoinix to configure testnet nodes/stacks and will also make it easier to test bitcoinix services/transactions using signet and testnet.

I realize this is probably a non-trivial change and perhaps not the highest priority, but I think it should be on the roadmap.

Activity

  1. msgilligan commented on Oct 14, 2026

    @msgilligan
    CollaboratorAuthor

    I'm open to suggestions on what the best approach would be for adding this.

    But it seems like the first step would be to create a PR that enables additional networks for only the bitcoind service.

    network would be made settable, with the regtest boolean being settable, but deprecated. We'd add some form of network parameters attribute-set with the ports, etc. for each network. We could add assertions or failures for when modules don't support the configured network yet.

    Then we could add support for additional networks for individual services (or perhaps logical groups of services) in additional PRs.

  2. jaoleal commented on Oct 15, 2026

    @jaoleal

    Hi @msgilligan, Id like to help with this one as a way into the project. Happy to author or review.

    I went through the old nix-bitcoin threads on this (fort-nix/nix-bitcoin#642 and fort-nix/nix-bitcoin#532). After reading the code, I see three coupled problems:

    1. The current interface doesn’t fully express the network options as described in the issue body.
    2. The module structure doesn’t allow multiple bitcoind instances in the same NixOS configuration (e.g. a mainnet and a signet node side by side), unlike the nixpkgs services.bitcoind module.
    3. Services that consume bitcoind aren’t prepared for other networks: I haven’t gone through each module yet, but at a glance ~8 of them read bitcoind.network or makeNetworkName, so I expect a mix of simple renames and a few that need a closer look.

    I think 2 deserves its own issue, picking up prusnak’s suggestion in fort-nix/nix-bitcoin#532 (comment), since it changes the module’s shape and touches everything downstream. 1 and 3 could go in a single PR: a table-driven network enum in bitcoind.nix (ports, bitcoin.conf section, cookie dir. so testnet3 or a future testnet5 is one extra entry), the consumers updated, regtest = true kept as a deprecated alias via versioning.nix, and a signet scenario in tests.nix that checks evaluation and service start-up.

    If that split sounds right, I’d like to open an issue for 2 to gather opinions and look into drafting a PR for 1 + 3. WDYT? Are you already working on this?

  3. msgilligan commented on Oct 15, 2026

    @msgilligan
    CollaboratorAuthor

    @jaoleal Thanks for you interest. I'm waiting to hear from @seberm or @prusnak if they are interested in this feature and get any feedback or suggestions they have before I would start work.

    I agree that (2) should have its own issue but I personally don't think it should be prioritized -- I would vote for keeping bitcoinix simple and only allowing one bitcoind instance per host/container configuration. People that need multiple bitcoind instances can always use containers or VMs to get them.

  4. prusnak commented on Oct 16, 2026

    @prusnak
    Contributor

    I have to say that having the limitation which supports only one network on a single bitcoinix node seems simpler and probably less error prone - so you have a node where everything is set and configured to use a mainnet. If you want to run testnet/signet/etc. maybe you should spin up another bitcoinix node.

    What do you think? Is this the approach we want to do? I think it is my preference and seems less messy and easier to maintain.

  5. added
    area: modules
    type: feature
    on Oct 16, 2026
  6. msgilligan commented on Oct 20, 2026

    @msgilligan
    CollaboratorAuthor

    Sounds like we have enough agreement (concept ack) where it is worth creating a feature branch.

  7. prusnak commented on Oct 21, 2026

    @prusnak
    Contributor

    7. Sounds like we have enough agreement (concept ack) where it is worth creating a feature branch.

    ack, let's introduce testnet4 and signet network options

    (later we can introduce testnet5 once it is deployed)

  8. seberm commented on Oct 22, 2026

    @seberm
    Contributor

    Just to add my two cents: I'd prefer to see these changes split into smaller PRs.

    For example, we could start by adding testnet4 support and disabling any bitcoind-dependent services while testnet4 is active. From there, we can enable other services (such as electrs) either one by one or in batches in follow-up PRs.

    Of course, all changes must be covered by tests.

    Once that's in place, we can follow the same approach for signet support.

  9. msgilligan commented on Oct 22, 2026

    @msgilligan
    CollaboratorAuthor

    I'd prefer to see these changes split into smaller PRs.

    I agree.

    For example, we could start by adding testnet4 support
    

    My personal priority is testnet4 over signet (I want to use bitcoinix for our P2poolv2 testnet4 mining pool), so that sounds good to me.

    From there, we can enable other services (such as electrs) either one by one or in batches in follow-up PRs.
    Of course, all changes must be covered by tests.
    Once that's in place, we can follow the same approach for signet support.

    This all sounds great to me.

  10. added this to the v0.2.0 milestone on Nov 12, 2026
  11. prusnak commented on Nov 13, 2026

    @prusnak
    Contributor

    first PR in the series - which just changes services.bitcoind.regtest to services.bitcoind.network - #253 - targeted for 0.2.0

    further PRs incoming after this one is merged

  12. prusnak commented on Nov 23, 2026

    @prusnak
    Contributor

    closed via #307

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: modulestype: feature

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions