2015-12-01 19:44:58 +01:00
|
|
|
// Copyright (c) 2013-2015 The btcsuite developers
|
|
|
|
// Use of this source code is governed by an ISC
|
|
|
|
// license that can be found in the LICENSE file.
|
2015-11-25 06:21:40 +01:00
|
|
|
|
|
|
|
package netparams
|
|
|
|
|
2021-03-04 16:07:01 +01:00
|
|
|
import (
|
2021-08-26 00:58:28 +02:00
|
|
|
"github.com/lbryio/lbcd/chaincfg"
|
|
|
|
"github.com/lbryio/lbcd/wire"
|
2021-03-04 16:07:01 +01:00
|
|
|
)
|
2015-11-25 06:21:40 +01:00
|
|
|
|
|
|
|
// Params is used to group parameters for various networks such as the main
|
|
|
|
// network and test networks.
|
|
|
|
type Params struct {
|
|
|
|
*chaincfg.Params
|
|
|
|
RPCClientPort string
|
|
|
|
RPCServerPort string
|
|
|
|
}
|
|
|
|
|
2021-08-26 00:58:28 +02:00
|
|
|
// MainNetParams contains parameters specific running lbcwallet and
|
|
|
|
// on the main network (wire.MainNet).
|
2015-11-25 06:21:40 +01:00
|
|
|
var MainNetParams = Params{
|
|
|
|
Params: &chaincfg.MainNetParams,
|
2021-09-06 19:48:23 +02:00
|
|
|
RPCClientPort: "9245",
|
|
|
|
RPCServerPort: "9244",
|
2015-11-25 06:21:40 +01:00
|
|
|
}
|
|
|
|
|
2021-08-26 00:58:28 +02:00
|
|
|
// TestNet3Params contains parameters specific running lbcwallet and
|
|
|
|
// on the test network (version 3) (wire.TestNet3).
|
2015-11-25 06:21:40 +01:00
|
|
|
var TestNet3Params = Params{
|
|
|
|
Params: &chaincfg.TestNet3Params,
|
2021-09-06 19:48:23 +02:00
|
|
|
RPCClientPort: "19245",
|
|
|
|
RPCServerPort: "19244",
|
|
|
|
}
|
|
|
|
|
|
|
|
// RegNetParams contains parameters specific to the regression test network
|
|
|
|
// (wire.RegNet).
|
|
|
|
var RegTestParams = Params{
|
|
|
|
Params: &chaincfg.RegressionNetParams,
|
|
|
|
RPCClientPort: "29245",
|
|
|
|
RPCServerPort: "29244",
|
2015-11-25 06:21:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// SimNetParams contains parameters specific to the simulation test network
|
|
|
|
// (wire.SimNet).
|
|
|
|
var SimNetParams = Params{
|
|
|
|
Params: &chaincfg.SimNetParams,
|
2021-09-06 19:48:23 +02:00
|
|
|
RPCClientPort: "39245",
|
|
|
|
RPCServerPort: "39244",
|
2015-11-25 06:21:40 +01:00
|
|
|
}
|
2021-03-04 16:07:01 +01:00
|
|
|
|
|
|
|
// SigNetParams contains parameters specific to the signet test network
|
|
|
|
// (wire.SigNet).
|
|
|
|
var SigNetParams = Params{
|
|
|
|
Params: &chaincfg.SigNetParams,
|
2021-09-06 19:48:23 +02:00
|
|
|
RPCClientPort: "49245",
|
|
|
|
RPCServerPort: "49244",
|
2021-03-04 16:07:01 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// SigNetWire is a helper function that either returns the given chain
|
|
|
|
// parameter's net value if the parameter represents a signet network or 0 if
|
|
|
|
// it's not. This is necessary because there can be custom signet networks that
|
|
|
|
// have a different net value.
|
|
|
|
func SigNetWire(params *chaincfg.Params) wire.BitcoinNet {
|
|
|
|
if params.Name == chaincfg.SigNetParams.Name {
|
|
|
|
return params.Net
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0
|
|
|
|
}
|