2016-01-07 16:01:51 +00:00
|
|
|
// Copyright (c) 2013-2016 The btcsuite developers
|
2018-08-08 11:22:06 +00:00
|
|
|
// Copyright (c) 2015-2018 The Decred developers
|
2013-08-06 21:55:22 +00:00
|
|
|
// Use of this source code is governed by an ISC
|
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
|
|
package main
|
|
|
|
|
|
|
|
|
|
import (
|
2016-01-20 21:46:42 +00:00
|
|
|
"github.com/decred/dcrd/chaincfg"
|
2013-08-06 21:55:22 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// activeNetParams is a pointer to the parameters specific to the
|
2018-03-01 23:23:35 +00:00
|
|
|
// currently active Decred network.
|
2014-05-23 04:14:36 +00:00
|
|
|
var activeNetParams = &mainNetParams
|
2013-08-06 21:55:22 +00:00
|
|
|
|
|
|
|
|
// params is used to group parameters for various networks such as the main
|
|
|
|
|
// network and test networks.
|
|
|
|
|
type params struct {
|
2015-02-06 05:18:27 +00:00
|
|
|
*chaincfg.Params
|
2015-11-09 22:21:16 +00:00
|
|
|
rpcPort string
|
2013-08-06 21:55:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// mainNetParams contains parameters specific to the main network
|
2015-02-05 21:16:39 +00:00
|
|
|
// (wire.MainNet). NOTE: The RPC port is intentionally different than the
|
2016-01-20 21:46:42 +00:00
|
|
|
// reference implementation because dcrd does not handle wallet requests. The
|
2013-10-16 20:01:43 +00:00
|
|
|
// separate wallet process listens on the well-known port and forwards requests
|
2016-01-20 21:46:42 +00:00
|
|
|
// it does not handle on to dcrd. This approach allows the wallet process
|
2013-10-16 20:01:43 +00:00
|
|
|
// to emulate the full reference implementation RPC API.
|
2013-08-06 21:55:22 +00:00
|
|
|
var mainNetParams = params{
|
2015-02-06 05:18:27 +00:00
|
|
|
Params: &chaincfg.MainNetParams,
|
2016-01-20 21:46:42 +00:00
|
|
|
rpcPort: "9109",
|
2013-08-06 21:55:22 +00:00
|
|
|
}
|
|
|
|
|
|
2018-08-08 11:23:15 +00:00
|
|
|
// testNet3Params contains parameters specific to the test network (version 3)
|
|
|
|
|
// (wire.TestNet3).
|
|
|
|
|
var testNet3Params = params{
|
|
|
|
|
Params: &chaincfg.TestNet3Params,
|
|
|
|
|
rpcPort: "19109",
|
|
|
|
|
}
|
|
|
|
|
|
2014-05-28 20:19:38 +00:00
|
|
|
// simNetParams contains parameters specific to the simulation test network
|
2015-02-05 21:16:39 +00:00
|
|
|
// (wire.SimNet).
|
2014-05-28 20:19:38 +00:00
|
|
|
var simNetParams = params{
|
2015-11-09 22:21:16 +00:00
|
|
|
Params: &chaincfg.SimNetParams,
|
2016-05-24 15:15:51 +00:00
|
|
|
rpcPort: "19556",
|
2014-05-28 20:19:38 +00:00
|
|
|
}
|
multi: Resurrect regression network.
This resurrects the regression test network that was removed before
initial launch although it really should not have been. The simulation
test network and the regression test network do not serve the same
purpose. Specifically, the regression test network is intended for unit
tests, RPC server tests, and consensus tests. On the other hand, the
simulation test network is intended for private use within a group of
individuals doing simulation testing and full integration tests between
different applications such as wallets, voting service providers, mining
pools, block explorers, and other services that build on Decred.
Keeping the concerns separate will allow the simulation test network to
be modified in ways such as activating consensus changes that have been
successfully voted into mainnet without also needing to vote them in on
the simulation test network while still preserving the ability for the
unit tests to properly test the voting semantics and handling to help
prevent regressions.
In addition to resurrecting the regression test network, this also fully
fleshes out new values for the various addresses prefixes (Rk, Rs, Re,
etc), HD key prefixes (rprv, rpub), and treasury multisig details.
As a part of resurrecting the network, a new CLI flag `--regnet` is
added to allow the RPC test harness connect to a running instance, the
areas of the code which involve votes have been modified to allow the
votes to apply to the new network, and tests have been added to the
relevant modules.
This bumps the affected module versions as follows:
- github.com/decred/dcrd/wire@v1.2.0
- github.com/decred/dcrd/chaincfg@v1.2.0
- github.com/decred/dcrd/dcrutil@v1.2.0
- github.com/decred/dcrd/hdkeychain@v1.1.1
The blockchain module is also affected, but since its version has
already been bumped since the last release tag, it is not bumped again.
Finally, this does not include switching unit tests or the RPC test
harness over the new network since that will be done in a separate
commit.
2018-10-05 04:46:56 +00:00
|
|
|
|
|
|
|
|
// regNetParams contains parameters specific to the regression test
|
|
|
|
|
// network (wire.RegNet).
|
|
|
|
|
var regNetParams = params{
|
|
|
|
|
Params: &chaincfg.RegNetParams,
|
|
|
|
|
rpcPort: "18656",
|
|
|
|
|
}
|