1 // Copyright (c) 2013-2016 The btcsuite developers
2 // Use of this source code is governed by an ISC
3 // license that can be found in the LICENSE file.
8 "github.com/btcsuite/btcd/chaincfg"
9 "github.com/btcsuite/btcd/wire"
12 // activeNetParams is a pointer to the parameters specific to the
13 // currently active bitcoin network.
14 var activeNetParams = &mainNetParams
16 // params is used to group parameters for various networks such as the main
17 // network and test networks.
23 // mainNetParams contains parameters specific to the main network
24 // (wire.MainNet). NOTE: The RPC port is intentionally different than the
25 // reference implementation because btcd does not handle wallet requests. The
26 // separate wallet process listens on the well-known port and forwards requests
27 // it does not handle on to btcd. This approach allows the wallet process
28 // to emulate the full reference implementation RPC API.
29 var mainNetParams = params{
30 Params: &chaincfg.MainNetParams,
34 // regressionNetParams contains parameters specific to the regression test
35 // network (wire.TestNet). NOTE: The RPC port is intentionally different
36 // than the reference implementation - see the mainNetParams comment for
38 var regressionNetParams = params{
39 Params: &chaincfg.RegressionNetParams,
43 // testNet3Params contains parameters specific to the test network (version 3)
44 // (wire.TestNet3). NOTE: The RPC port is intentionally different than the
45 // reference implementation - see the mainNetParams comment for details.
46 var testNet3Params = params{
47 Params: &chaincfg.TestNet3Params,
51 // simNetParams contains parameters specific to the simulation test network
53 var simNetParams = params{
54 Params: &chaincfg.SimNetParams,
58 // netName returns the name used when referring to a bitcoin network. At the
59 // time of writing, btcd currently places blocks for testnet version 3 in the
60 // data and log directory "testnet", which does not match the Name field of the
61 // chaincfg parameters. This function can be used to override this directory
62 // name as "testnet" when the passed active network matches wire.TestNet3.
64 // A proper upgrade to move the data and log directories for this network to
65 // "testnet3" is planned for the future, at which point this function can be
66 // removed and the network parameter's name used instead.
67 func netName(chainParams *params) string {
68 switch chainParams.Net {
72 return chainParams.Name