From e70fc169f38a428bdabd7658fb68943022b31f25 Mon Sep 17 00:00:00 2001 From: Joost Jager Date: Thu, 7 Mar 2019 11:48:55 +0100 Subject: [PATCH] loop: configurable loopd address --- cmd/loop/main.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cmd/loop/main.go b/cmd/loop/main.go index 73a4883c..9e44fb02 100644 --- a/cmd/loop/main.go +++ b/cmd/loop/main.go @@ -17,8 +17,6 @@ import ( ) var ( - loopdAddress = "localhost:11010" - // Define route independent max routing fees. We have currently no way // to get a reliable estimate of the routing fees. Best we can do is // the minimum routing fees, which is not very indicative. @@ -38,6 +36,13 @@ func main() { app.Version = "0.0.1" app.Name = "loop" app.Usage = "control plane for your loopd" + app.Flags = []cli.Flag{ + cli.StringFlag{ + Name: "loopd", + Value: "localhost:11010", + Usage: "loopd daemon address host:port", + }, + } app.Commands = []cli.Command{ loopOutCommand, termsCommand, monitorCommand, } @@ -49,6 +54,7 @@ func main() { } func getClient(ctx *cli.Context) (looprpc.SwapClientClient, func(), error) { + loopdAddress := ctx.GlobalString("loopd") conn, err := getClientConn(loopdAddress) if err != nil { return nil, nil, err