mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-12-11 21:32:06 +01:00
lnd: properly switch RPC port with target net change
With this commit, support for changing the target network (testnet, simnet, etc) has been finalized. Previously a command line option was present to swap networks, but the RPC port wouldn’t automatically be updated to reflect the network.
This commit is contained in:
33
params.go
Normal file
33
params.go
Normal file
@@ -0,0 +1,33 @@
|
||||
package main
|
||||
|
||||
import "github.com/roasbeef/btcd/chaincfg"
|
||||
|
||||
// activeNetParams is a pointer to the parameters specific to the currently
|
||||
// active bitcoin network.
|
||||
var activeNetParams = segNetParams
|
||||
|
||||
// netParams couples the p2p parameters of a network with the corresponding RPC
|
||||
// port of a daemon running on the particular network.
|
||||
type netParams struct {
|
||||
*chaincfg.Params
|
||||
rpcPort string
|
||||
}
|
||||
|
||||
// testNetParams contains parameters specific to the 3rd version of the test network.
|
||||
var testNetParams = netParams{
|
||||
Params: &chaincfg.TestNet3Params,
|
||||
rpcPort: "18334",
|
||||
}
|
||||
|
||||
// segNetParams contains parameters specific to the segregated witness test
|
||||
// network.
|
||||
var segNetParams = netParams{
|
||||
Params: &chaincfg.SegNet4Params,
|
||||
rpcPort: "28902",
|
||||
}
|
||||
|
||||
// simNetParams contains parameters specific to the simulation test network.
|
||||
var simNetParams = netParams{
|
||||
Params: &chaincfg.SimNetParams,
|
||||
rpcPort: "18556",
|
||||
}
|
||||
Reference in New Issue
Block a user