Skip to content

Commit c0a1b4e

Browse files
committed
cmd/loopd: point to testnet loop server for testnet mode
Fixes #20.
1 parent 769c69e commit c0a1b4e

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

cmd/loopd/config.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,14 @@ type config struct {
2121
View viewParameters `command:"view" alias:"v" description:"View all swaps in the database. This command can only be executed when loopd is not running."`
2222
}
2323

24+
const (
25+
mainnetServer = "swap.lightning.today:11009"
26+
testnetServer = "test.swap.lightning.today:11009"
27+
)
28+
2429
var defaultConfig = config{
2530
Network: "mainnet",
26-
SwapServer: "swap.lightning.today:11009",
31+
SwapServer: mainnetServer,
2732
RPCListen: "localhost:11010",
2833
RESTListen: "localhost:8081",
2934
Insecure: false,

cmd/loopd/daemon.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ func daemon(config *config) error {
2626
}
2727
defer lnd.Close()
2828

29+
// If the user is targeting the testnet network, then we'll point
30+
// towards the testnet swap server rather than the mainnet endpoint.
31+
if config.Network == "testnet" {
32+
config.SwapServer = testnetServer
33+
}
34+
2935
swapClient, cleanup, err := getClient(
3036
config.Network, config.SwapServer, config.Insecure, &lnd.LndServices,
3137
)

0 commit comments

Comments
 (0)