Skip to content

Commit

Permalink
multi: rename terminator main package to governator
Browse files Browse the repository at this point in the history
  • Loading branch information
carlaKC committed Mar 5, 2020
1 parent f9d7d86 commit 36dfb58
Show file tree
Hide file tree
Showing 21 changed files with 52 additions and 52 deletions.
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PKG := github.com/lightninglabs/terminator
ESCPKG := github.com\/lightninglabs\/terminator
PKG := github.com/lightninglabs/governator
ESCPKG := github.com\/lightninglabs\/governator

LINT_PKG := github.com/golangci/golangci-lint/cmd/golangci-lint
GOVERALLS_PKG := github.com/mattn/goveralls
Expand Down Expand Up @@ -56,13 +56,13 @@ $(GOACC_BIN):
# ============

build:
@$(call print, "Building terminator.")
$(GOBUILD) $(PKG)/cmd/terminator
@$(call print, "Building governator.")
$(GOBUILD) $(PKG)/cmd/governator
$(GOBUILD) $(PKG)/cmd/trmcli

install:
@$(call print, "Installing terminator.")
$(GOINSTALL) $(PKG)/cmd/terminator
@$(call print, "Installing governator.")
$(GOINSTALL) $(PKG)/cmd/governator
$(GOINSTALL) $(PKG)/cmd/trmcli

scratch: build
Expand Down Expand Up @@ -126,6 +126,6 @@ list:
sort
clean:
@$(call print, "Cleaning source.$(NC)")
$(RM) ./terminator
$(RM) ./governator
$(RM) ./trmcli
$(RM) coverage.txt
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
## Terminator
## governator

[![Build Status](https://img.shields.io/travis/lightningnetwork/lnd.svg)](https://travis-ci.org/lightningnetwork/lnd)
[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/lightningnetwork/lnd/blob/master/LICENSE)

The terminator is an external service intended to be run in conjunction with the [lnd](https://github.com/lightningnetwork/lnd) implementation of the [Lightning Network](https://lightning.network). It queries LND for information about its existing channels and provides channel close recommendations if channels are under-performing.
The governator is an external service intended to be run in conjunction with the [lnd](https://github.com/lightningnetwork/lnd) implementation of the [Lightning Network](https://lightning.network). It queries LND for information about its existing channels and provides channel close recommendations if channels are under-performing.

Future iterations of this project will automate the channel closing process.

### Installation
A [Makefile](https://github.com/lightninglabs/terminator/blob/master/Makefile) is provided. To install terminator and al its dependencies, run:
A [Makefile](https://github.com/lightninglabs/governator/blob/master/Makefile) is provided. To install governator and al its dependencies, run:

```
go get -d github.com/lightninglabs/terminator
cd $GOPATH/src/github.com/lightninglabs/terminator
go get -d github.com/lightninglabs/governator
cd $GOPATH/src/github.com/lightninglabs/governator
make && make install
```

Expand Down
8 changes: 4 additions & 4 deletions cmd/terminator/log.go → cmd/governator/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ package main

import (
"github.com/btcsuite/btclog"
"github.com/lightninglabs/terminator"
"github.com/lightninglabs/governator"
"github.com/lightningnetwork/lnd/build"
)

var (
logWriter = build.NewRotatingLogWriter()
log = build.NewSubLogger("TERMD", logWriter.GenSubLogger)
log = build.NewSubLogger("GVNR", logWriter.GenSubLogger)
)

func init() {
setSubLogger("TERMD", log, nil)
addSubLogger(terminator.Subsystem, terminator.UseLogger)
setSubLogger("GVNR", log, nil)
addSubLogger(governator.Subsystem, governator.UseLogger)
}

// addSubLogger is a helper method to conveniently create and register the
Expand Down
6 changes: 3 additions & 3 deletions cmd/terminator/main.go → cmd/governator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ package main
import (
"os"

"github.com/lightninglabs/terminator"
"github.com/lightninglabs/governator"
)

// main calls the "real" main function in a nested manner so that defers will be
// properly executed if os.Exit() is called.
func main() {
if err := terminator.Main(); err != nil {
log.Infof("Error starting termintor: %v", err)
if err := governator.Main(); err != nil {
log.Infof("Error starting governator: %v", err)
}

os.Exit(1)
Expand Down
2 changes: 1 addition & 1 deletion cmd/trmcli/channel_insights.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"context"

"github.com/lightninglabs/terminator/trmrpc"
"github.com/lightninglabs/governator/trmrpc"
"github.com/urfave/cli"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/trmcli/close_recommendations.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"time"

"github.com/lightninglabs/terminator/trmrpc"
"github.com/lightninglabs/governator/trmrpc"
"github.com/urfave/cli"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/trmcli/revenue_report.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"context"

"github.com/lightninglabs/terminator/trmrpc"
"github.com/lightninglabs/governator/trmrpc"
"github.com/urfave/cli"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/trmcli/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
"net"
"os"

"github.com/lightninglabs/governator/trmrpc"
"github.com/lightninglabs/protobuf-hex-display/jsonpb"
"github.com/lightninglabs/protobuf-hex-display/proto"
"github.com/lightninglabs/terminator/trmrpc"
"github.com/lightningnetwork/lnd/lncfg"
"github.com/urfave/cli"
"google.golang.org/grpc"
Expand Down
8 changes: 4 additions & 4 deletions config.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package terminator
package governator

import (
"fmt"
Expand Down Expand Up @@ -28,7 +28,7 @@ type config struct {
// MacaroonFile is the file name of the macaroon to use.
MacaroonFile string `long:"macaroonfile" description:"Macaroon file to use."`

// TLSCertPath is the path to the tls cert that terminator should use.
// TLSCertPath is the path to the tls cert that governator should use.
TLSCertPath string `long:"tlscertpath" description:"Path to TLS cert"`

// TestNet is set to true when running on testnet.
Expand All @@ -48,9 +48,9 @@ type config struct {

// DebugLevel is a string defining the log level for the service either
// for all subsystems the same or individual level by subsystem.
DebugLevel string `long:"debuglevel" description:"Debug level for termaintor and its subsystems."`
DebugLevel string `long:"debuglevel" description:"Debug level for governator and its subsystems."`

// RPCListen is the listen address for the terminator rpc server.
// RPCListen is the listen address for the governator rpc server.
RPCListen string `long:"rpclisten" description:"Address to listen on for gRPC clients"`
}

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/lightninglabs/terminator
module github.com/lightninglabs/governator

require (
github.com/btcsuite/btcd v0.20.1-beta
Expand Down
8 changes: 4 additions & 4 deletions terminator.go → governator.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// Package terminator contains the main function for the terminator.
package terminator
// Package governator contains the main function for the governator.
package governator

import (
"fmt"

"github.com/lightninglabs/governator/trmrpc"
"github.com/lightninglabs/loop/lndclient"
"github.com/lightninglabs/terminator/trmrpc"
"github.com/lightningnetwork/lnd/signal"
)

// Main is the real entry point for terminator. It is required to ensure that
// Main is the real entry point for governator. It is required to ensure that
// defers are properly executed when os.Exit() is called.
func Main() error {
config, err := loadConfig()
Expand Down
2 changes: 1 addition & 1 deletion insights/insights.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package insights
import (
"time"

"github.com/lightninglabs/terminator/revenue"
"github.com/lightninglabs/governator/revenue"
"github.com/lightningnetwork/lnd/lnrpc"
"github.com/lightningnetwork/lnd/lnwire"
)
Expand Down
2 changes: 1 addition & 1 deletion insights/insights_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"testing"
"time"

"github.com/lightninglabs/terminator/revenue"
"github.com/lightninglabs/governator/revenue"
"github.com/lightningnetwork/lnd/lnrpc"
"github.com/lightningnetwork/lnd/lnwire"
)
Expand Down
12 changes: 6 additions & 6 deletions log.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package terminator
package governator

import (
"github.com/btcsuite/btclog"
"github.com/lightninglabs/terminator/dataset"
"github.com/lightninglabs/terminator/recommend"
"github.com/lightninglabs/terminator/revenue"
"github.com/lightninglabs/terminator/trmrpc"
"github.com/lightninglabs/governator/dataset"
"github.com/lightninglabs/governator/recommend"
"github.com/lightninglabs/governator/revenue"
"github.com/lightninglabs/governator/trmrpc"
"github.com/lightningnetwork/lnd/build"
)

// Subsystem defines the logging code for this subsystem.
const Subsystem = "TERM"
const Subsystem = "GVRN"

var (
logWriter = build.NewRotatingLogWriter()
Expand Down
4 changes: 2 additions & 2 deletions recommend/recommend.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (
"errors"
"time"

"github.com/lightninglabs/terminator/dataset"
"github.com/lightninglabs/terminator/insights"
"github.com/lightninglabs/governator/dataset"
"github.com/lightninglabs/governator/insights"
)

var (
Expand Down
4 changes: 2 additions & 2 deletions recommend/recommend_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"testing"
"time"

"github.com/lightninglabs/terminator/dataset"
"github.com/lightninglabs/terminator/insights"
"github.com/lightninglabs/governator/dataset"
"github.com/lightninglabs/governator/insights"
)

// TestCloseRecommendations tests CloseRecommendations for error cases where
Expand Down
2 changes: 1 addition & 1 deletion trmrpc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ This package implements terminator's RPC client and server.
## Generate protobuf definitions
1. Follow the installation steps provided in lnd's [installation instructions](https://github.com/lightningnetwork/lnd/blob/master/lnrpc/README.md#generate-protobuf-definitions).

2. Run [`gen_protos.sh`](https://github.com/lightninglabs/terminator/tree/master/trmrpc/gen_protos.sh) to generate new protobuf definitions.
2. Run [`gen_protos.sh`](https://github.com/lightninglabs/governator/tree/master/trmrpc/gen_protos.sh) to generate new protobuf definitions.
4 changes: 2 additions & 2 deletions trmrpc/channel_insights.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"context"
"time"

"github.com/lightninglabs/terminator/insights"
"github.com/lightninglabs/terminator/revenue"
"github.com/lightninglabs/governator/insights"
"github.com/lightninglabs/governator/revenue"
"github.com/lightningnetwork/lnd/lnrpc"
)

Expand Down
4 changes: 2 additions & 2 deletions trmrpc/close_recommendations.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"sort"
"time"

"github.com/lightninglabs/terminator/insights"
"github.com/lightninglabs/terminator/recommend"
"github.com/lightninglabs/governator/insights"
"github.com/lightninglabs/governator/recommend"
)

// parseRecommendationRequest parses a close recommendation request and
Expand Down
2 changes: 1 addition & 1 deletion trmrpc/revenue_report.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"time"

"github.com/lightninglabs/terminator/revenue"
"github.com/lightninglabs/governator/revenue"
"github.com/lightningnetwork/lnd/lnrpc"
)

Expand Down
4 changes: 2 additions & 2 deletions trmrpc/rpcserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import (
"sync"
"sync/atomic"

"github.com/lightninglabs/terminator/recommend"
"github.com/lightninglabs/terminator/revenue"
"github.com/lightninglabs/governator/recommend"
"github.com/lightninglabs/governator/revenue"
"github.com/lightningnetwork/lnd/lnrpc"
"google.golang.org/grpc"
)
Expand Down

0 comments on commit 36dfb58

Please sign in to comment.