mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
Merge pull request #25 from Roasbeef/testnet-server
cmd/loopd: point to testnet loop server for testnet mode
This commit is contained in:
commit
ec40647147
3 changed files with 19 additions and 4 deletions
10
README.md
10
README.md
|
|
@ -105,13 +105,17 @@ After you have lnd and the Loop client installed, you can execute a Loop swap.
|
|||
The Loop client needs its own short-lived daemon which will deal with the swaps
|
||||
in progress.
|
||||
|
||||
To run this:
|
||||
Command to start `loopd`::
|
||||
|
||||
```
|
||||
`loopd`
|
||||
loopd
|
||||
|
||||
// Or if you want to do everything in the same terminal and background loopd
|
||||
`loopd &`
|
||||
loopd &
|
||||
|
||||
// For testnet mode, you'll need to specify the network as mainnet is the
|
||||
default:
|
||||
loopd --network=testnet
|
||||
```
|
||||
|
||||
By default `loopd` attempts to connect to the lnd instance running on
|
||||
|
|
|
|||
|
|
@ -21,9 +21,14 @@ type config struct {
|
|||
View viewParameters `command:"view" alias:"v" description:"View all swaps in the database. This command can only be executed when loopd is not running."`
|
||||
}
|
||||
|
||||
const (
|
||||
mainnetServer = "swap.lightning.today:11009"
|
||||
testnetServer = "test.swap.lightning.today:11009"
|
||||
)
|
||||
|
||||
var defaultConfig = config{
|
||||
Network: "mainnet",
|
||||
SwapServer: "swap.lightning.today:11009",
|
||||
SwapServer: mainnetServer,
|
||||
RPCListen: "localhost:11010",
|
||||
RESTListen: "localhost:8081",
|
||||
Insecure: false,
|
||||
|
|
|
|||
|
|
@ -26,6 +26,12 @@ func daemon(config *config) error {
|
|||
}
|
||||
defer lnd.Close()
|
||||
|
||||
// If the user is targeting the testnet network, then we'll point
|
||||
// towards the testnet swap server rather than the mainnet endpoint.
|
||||
if config.Network == "testnet" {
|
||||
config.SwapServer = testnetServer
|
||||
}
|
||||
|
||||
swapClient, cleanup, err := getClient(
|
||||
config.Network, config.SwapServer, config.Insecure, &lnd.LndServices,
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue