Browse Source

cmd+loopd: new cmd/loopd main method replacing the one now in ./loopd

This allows loopd to be used as a library by importing it and calling
Start.
pull/115/head
Johan T. Halseth 1 year ago
parent
commit
704bfff8f6
No known key found for this signature in database GPG Key ID: 15BAADA29DA20D26
2 changed files with 15 additions and 8 deletions
  1. +14
    -0
      cmd/loopd/main.go
  2. +1
    -8
      loopd/start.go

+ 14
- 0
cmd/loopd/main.go View File

@ -0,0 +1,14 @@
package main
import (
"fmt"
"github.com/lightninglabs/loop/loopd"
)
func main() {
err := loopd.Start()
if err != nil {
fmt.Println(err)
}
}

loopd/main.go → loopd/start.go View File

@ -26,14 +26,7 @@ var (
swapsLock sync.Mutex
)
func main() {
err := start()
if err != nil {
fmt.Println(err)
}
}
func start() error {
func Start() error {
config := defaultConfig
// Parse command line flags.

Loading…
Cancel
Save