params-regtest.go raw

   1  package chaincfg
   2  
   3  import (
   4  	"github.com/p9c/p9/pkg/wire"
   5  )
   6  
   7  // RegressionTestParams defines the network parameters for the regression test Bitcoin network. Not to be confused with
   8  // the test Bitcoin network (version 3), this network is sometimes simply called "testnet".
   9  var RegressionTestParams = Params{
  10  	Name:        "regtest",
  11  	Net:         wire.TestNet,
  12  	DefaultPort: "31047",
  13  	DNSSeeds:    []DNSSeed{},
  14  	// Chain parameters
  15  	GenesisBlock:     &regTestGenesisBlock,
  16  	GenesisHash:      &regTestGenesisHash,
  17  	PowLimit:         regressionPowLimit,
  18  	PowLimitBits:     0x207fffff,
  19  	CoinbaseMaturity: 100,
  20  	// BIP0034Height:            100000000, // Not active - Permit ver 1 blocks
  21  	// BIP0065Height:            100000000, // Used by regression tests
  22  	// BIP0066Height:            100000000, // Used by regression tests
  23  	SubsidyReductionInterval: 150,
  24  	TargetTimespan:           30000, // 14 days
  25  	TargetTimePerBlock:       300,   // 5 minutes
  26  	RetargetAdjustmentFactor: 2,     // 50% less, 200% more
  27  	ReduceMinDifficulty:      true,
  28  	MinDiffReductionTime:     300 * 2,
  29  	GenerateSupported:        true,
  30  	// Checkpoints ordered from oldest to newest.
  31  	Checkpoints: nil,
  32  	// Consensus rule change deployments.
  33  	//
  34  	// The miner confirmation window is defined as:
  35  	//   target proof of work timespan / target proof of work spacing
  36  	RuleChangeActivationThreshold: 108, // 75%  of MinerConfirmationWindow
  37  	MinerConfirmationWindow:       144,
  38  	// Deployments: [DefinedDeployments]ConsensusDeployment{
  39  	// 	DeploymentTestDummy: {
  40  	// 		BitNumber:  28,
  41  	// 		StartTime:  0,             // Always available for vote
  42  	// 		ExpireTime: math.MaxInt64, // Never expires
  43  	// 	},
  44  	// 	DeploymentCSV: {
  45  	// 		BitNumber:  0,
  46  	// 		StartTime:  0,             // Always available for vote
  47  	// 		ExpireTime: math.MaxInt64, // Never expires
  48  	// 	},
  49  	// 	DeploymentSegwit: {
  50  	// 		BitNumber:  1,
  51  	// 		StartTime:  0,             // Always available for vote
  52  	// 		ExpireTime: math.MaxInt64, // Never expires.
  53  	// 	},
  54  	// },
  55  	// Mempool parameters
  56  	RelayNonStdTxs: true,
  57  	// Human-readable part for Bech32 encoded segwit addresses, as defined in
  58  	// // BIP 173.
  59  	// Bech32HRPSegwit: "bcrt", // always bcrt for reg test net
  60  	// Address encoding magics
  61  	PubKeyHashAddrID: 0x00,
  62  	ScriptHashAddrID: 0x05,
  63  	PrivateKeyID:     0x80,
  64  	// BIP32 hierarchical deterministic extended key magics
  65  	HDPrivateKeyID: [4]byte{0x04, 0x35, 0x83, 0x94}, // starts with tprv
  66  	HDPublicKeyID:  [4]byte{0x04, 0x35, 0x87, 0xcf}, // starts with tpub
  67  	// BIP44 coin type used in the hierarchical deterministic path for address generation.
  68  	HDCoinType: 1,
  69  	// Parallelcoin specific difficulty adjustment parameters
  70  	Interval:                Interval,
  71  	AveragingInterval:       10, // Extend to target timespan to adjust better to hashpower (30000/300=100) post hardfork
  72  	AveragingTargetTimespan: AveragingTargetTimespan,
  73  	MaxAdjustDown:           MaxAdjustDown,
  74  	MaxAdjustUp:             MaxAdjustUp,
  75  	TargetTimespanAdjDown:   AveragingTargetTimespan * (Interval + MaxAdjustDown) / Interval,
  76  	MinActualTimespan:       AveragingTargetTimespan * (Interval - MaxAdjustUp) / Interval,
  77  	MaxActualTimespan:       AveragingTargetTimespan * (Interval + MaxAdjustDown) / Interval,
  78  	ScryptPowLimit:          &scryptPowLimit,
  79  	ScryptPowLimitBits:      ScryptPowLimitBits,
  80  	RPCClientPort:           "31048",
  81  	WalletRPCServerPort:     "31046",
  82  }
  83