Deploying Private Testnet #13591

issue zscole opened this issue on July 3, 2018
  1. zscole commented at 6:02 PM on July 3, 2018: none

    Trying to deploy a private testnet in a local environment. I'm coming over from the Ethereum side, so I'm used to how things run in geth where I can initialize a custom genesis file on node 1, indicate a data directory, and then create a static peers JSON file to allow separate nodes that I control to join the testnet. So far, I haven't found any way to do this.

    In chainparams.cpp, we commented out the DNS seeds (around lines 132-140) that are predefined and replaced them with our own.

    I then created a custom bitcoin.conf file which contains:

    connect=[node 1 ip addr]:8333 connect=[node 2 ip addr]:8333 connect=[node 3 ip addr]:8333 connect=[node 4 ip addr]:8333 Then I run the following command to start bitcoind:

    bitcoind -conf=/home/appo/bitcoin/bitcoin.conf -port=8333

    First problem: connect() to [node ip addr]:8333 failed after select(): Connection refused (111)

    I also notice that it's still loading peers from peers.dat even though I've disabled DNS seeding (I think) and it's also referencing the mainnet chain state, but I'd like to create a new genesis block.

    I'm trying to test in a local environment by essentially forking Bitcoin to allow me to run tests without any external dependancies, so TL;DR what I need is to be able to:

    1. Initialize a new genesis block so we don't need to reference any of the historical chain data and can create our own fork. This is so we can run functional performance tests in a controlled environment.
    2. Either manually peer or allow discovery of only specific nodes within our network that we control.

    Any help would be appreciated. Thanks!

  2. MarcoFalke commented at 6:34 PM on July 3, 2018: member

    You can use the regtest. See ./test/functional on how to set up a network

    On Tue, Jul 3, 2018, 19:03 Zak Cole notifications@github.com wrote:

    Trying to deploy a private testnet in a local environment. I'm coming over from the Ethereum side, so I'm used to how things run in geth where I can initialize a custom genesis file on node 1, indicate a data directory, and then create a static peers JSON file to allow separate nodes that I control to join the testnet. So far, I haven't found any way to do this.

    In chainparams.cpp, we commented out the DNS seeds (around lines 132-140) that are predefined and replaced them with our own.

    I then created a custom bitcoin.conf file which contains:

    connect=[node 1 ip addr]:8333 connect=[node 2 ip addr]:8333 connect=[node 3 ip addr]:8333 connect=[node 4 ip addr]:8333 Then I run the following command to start bitcoind:

    bitcoind -conf=/home/appo/bitcoin/bitcoin.conf -port=8333

    First problem: connect() to [node ip addr]:8333 failed after select(): Connection refused (111)

    I also notice that it's still loading peers from peers.dat even though I've disabled DNS seeding (I think) and it's also referencing the mainnet chain state, but I'd like to create a new genesis block.

    I'm trying to test in a local environment by essentially forking Bitcoin to allow me to run tests without any external dependancies, so TL;DR what I need is to be able to:

    1. Initialize a new genesis block so we don't need to reference any of the historical chain data and can create our own fork. This is so we can run functional performance tests in a controlled environment.
    2. Either manually peer or allow discovery of only specific nodes within our network that we control.

    Any help would be appreciated. Thanks!

    — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/bitcoin/bitcoin/issues/13591, or mute the thread https://github.com/notifications/unsubscribe-auth/AGGmv6m7L-5SvXulZfxCvvjxAPwjWRxWks5uC7H7gaJpZM4VBZZG .

  3. zscole commented at 8:35 PM on July 3, 2018: none

    I've been looking it over and it seems like regtest is still limited, IIUC. Does regtest allow for more than one node? Can I deploy a node on a separate machine and have it join the testnet or does it have to be done locally?

  4. sipa commented at 8:50 PM on July 3, 2018: member

    You can run as many nodes as you want in regtest, on different machines. You can connect them using -addnode / -connect.

  5. zscole commented at 9:02 PM on July 3, 2018: none

    Ok, great! Thanks a lot!

  6. fanquake added the label Questions and Help on Jul 4, 2018
  7. MarcoFalke closed this on Jul 10, 2018

  8. MarcoFalke locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-26 06:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me