Skip to content

Regtest Configuration

Eric Voskuil edited this page Jul 15, 2018 · 17 revisions

The regression testing network is a local network which reduces mining difficulty to the lowest possible value. This allows for rapid creation of blockchains for automated testing.

The following configuration settings are used to configure regtest.

[network]
# The magic number for message headers.
identifier = 3669344250

# The port for incoming connections.
inbound_port = 18444

# Disable seeding, otherwise manually populate hosts.cache file.
host_pool_capacity = 0

# Optionally connect to one or more peers on a private regtest network.
peer = regtest1.bitware.co:18444
peer = regtest2.bitware.co:18444

[blockchain]
# Disable default (mainnet) checkpoints.
checkpoint = 0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206:0

[flags]
# Retarget difficulty, defaults to true (use false for regtest).
retarget = false

# Require coinbase input includes block height (disabled on satoshi client).
bip34 = false

The following are unique considerations for regtest.

  • flags.retarget = false requires at least version 3.4 (required for regtest).
  • bip90 assumes fixed activation heights for bip34, bip66 and bip65 and these are set to 0, 1251, and 1351 respectively, matching satoshi client behavior except for bip34.
  • flags.bip34 = false simulates satoshi client bip90 behavior (until height 100,000,000).
  • bip34, bip66 and bip65 are activated according to specification if bip90 is disabled.
  • bip16 is activated starting at header time stamp 0x4f3af580 (February 15, 2012).
  • bip30 is active until the assumed activation of bip34 by bip90 (due to an undocumented satoshi client hard fork of November 2015). Because this assumed height is 0, if bip90 is disabled then a duplicate coinbase hash is possible until bip34 activates.
  • bip68, bip112 and bip113 (check-sequence-verify) and bip141, bip143 and bip147 (segregated-witness) activate at genesis if enabled. However, on the satoshi client these follow a bip9-style activation which will activate them at height 432 if signaled accordingly.
Clone this wiki locally