Skip to content

Commit 2c449ab

Browse files
authored
Merge pull request #17 from lightninglabs/rename-faraday
multi: faraday rename
2 parents cf4fc1f + 00a0527 commit 2c449ab

30 files changed

+241
-243
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
/governator
2-
/gvncli
1+
/faraday
2+
/frcli

Dockerfile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ FROM golang:1.13-alpine as builder
44
# queries required to connect to linked containers succeed.
55
ENV GODEBUG netdns=cgo
66

7-
ADD . /go/src/github.com/lightninglabs/governator
7+
ADD . /go/src/github.com/lightninglabs/faraday
88

99
# Install dependencies and build the binaries.
1010
RUN apk add --no-cache --update alpine-sdk \
1111
git \
1212
make \
1313
gcc \
14-
&& cd /go/src/github.com/lightninglabs/governator \
14+
&& cd /go/src/github.com/lightninglabs/faraday \
1515
&& make \
1616
&& make install
1717

@@ -24,12 +24,12 @@ RUN apk --no-cache add \
2424
ca-certificates
2525

2626
# Copy the binaries from the builder image.
27-
COPY --from=builder /go/bin/governator /bin/
28-
COPY --from=builder /go/bin/gvncli /bin/
27+
COPY --from=builder /go/bin/faraday /bin/
28+
COPY --from=builder /go/bin/frcli /bin/
2929

30-
# Expose governator ports (rpc).
30+
# Expose faraday ports (rpc).
3131
EXPOSE 8465
3232

33-
# Specify the start command and entrypoint as the governator daemon.
34-
ENTRYPOINT ["governator"]
33+
# Specify the start command and entrypoint as the faraday daemon.
34+
ENTRYPOINT ["faraday"]
3535

Makefile

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
PKG := github.com/lightninglabs/governator
2-
ESCPKG := github.com\/lightninglabs\/governator
1+
PKG := github.com/lightninglabs/faraday
2+
ESCPKG := github.com\/lightninglabs\/faraday
33

44
LINT_PKG := github.com/golangci/golangci-lint/cmd/golangci-lint
55
GOVERALLS_PKG := github.com/mattn/goveralls
@@ -59,14 +59,14 @@ $(GOACC_BIN):
5959
# ============
6060

6161
build:
62-
@$(call print, "Building governator.")
63-
$(GOBUILD) $(LDFLAGS) $(PKG)/cmd/governator
64-
$(GOBUILD) $(LDFLAGS) $(PKG)/cmd/gvncli
62+
@$(call print, "Building faraday.")
63+
$(GOBUILD) $(LDFLAGS) $(PKG)/cmd/faraday
64+
$(GOBUILD) $(LDFLAGS) $(PKG)/cmd/frcli
6565

6666
install:
67-
@$(call print, "Installing governator.")
68-
$(GOINSTALL) $(LDFLAGS) $(PKG)/cmd/governator
69-
$(GOINSTALL) $(LDFLAGS) $(PKG)/cmd/gvncli
67+
@$(call print, "Installing faraday.")
68+
$(GOINSTALL) $(LDFLAGS) $(PKG)/cmd/faraday
69+
$(GOINSTALL) $(LDFLAGS) $(PKG)/cmd/frcli
7070

7171
scratch: build
7272

@@ -94,7 +94,7 @@ goveralls: $(GOVERALLS_BIN)
9494

9595
rpc:
9696
@$(call print, "Compiling protos.")
97-
cd ./gvnrpc; ./gen_protos.sh
97+
cd ./frdrpc; ./gen_protos.sh
9898

9999
travis-race: lint unit-race
100100

@@ -123,12 +123,12 @@ lint: $(LINT_BIN)
123123

124124
list:
125125
@$(call print, "Listing commands.")
126-
@$(MAKE) -qp | \
126+
@$(MAKE) -qp | \
127127
awk -F':' '/^[a-zA-Z0-9][^$$#\/\t=]*:([^=]|$$)/ {split($$1,A,/ /);for(i in A)print A[i]}' | \
128128
grep -v Makefile | \
129129
sort
130130
clean:
131131
@$(call print, "Cleaning source.$(NC)")
132-
$(RM) ./governator
133-
$(RM) ./gvncli
132+
$(RM) ./faraday
133+
$(RM) ./frcli
134134
$(RM) coverage.txt

README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
# governator
1+
# faraday
22

3-
[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/lightninglabs/governator/blob/master/LICENSE)
3+
[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/lightninglabs/faraday/blob/master/LICENSE)
44

5-
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.
5+
Faraday 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.
66

77
## Installation
8-
A [Makefile](https://github.com/lightninglabs/governator/blob/master/Makefile) is provided. To install governator and al its dependencies, run:
8+
A [Makefile](https://github.com/lightninglabs/faraday/blob/master/Makefile) is provided. To install faraday and all its dependencies, run:
99

1010
```
11-
go get -d github.com/lightninglabs/governator
12-
cd $GOPATH/src/github.com/lightninglabs/governator
11+
go get -d github.com/lightninglabs/faraday
12+
cd $GOPATH/src/github.com/lightninglabs/faraday
1313
make && make install
1414
```
1515

@@ -21,28 +21,28 @@ make check
2121
```
2222

2323
## Usage
24-
Governator connects to a single instance of lnd. It requires access to a macaroon with read permissions and a valid TLS certificate. It will attempt to use the default lnd values if no command line flags are specified.
24+
Faraday connects to a single instance of lnd. It requires access to a macaroon with read permissions and a valid TLS certificate. It will attempt to use the default lnd values if no command line flags are specified.
2525
```
26-
./governator \
26+
./faraday \
2727
--macaroondir={directory containing macaroon} \
2828
--macaroonfile={macaroon with read permissions} \
2929
--tlscertpath={path to lnd cert} \
3030
--rpserver={host:port of lnd's rpserver}
3131
```
3232

33-
By default, governator runs on mainnet. The `--testnet`, `--simnet` or `--regtest` flags can be used to run in test environments.
33+
By default, faraday runs on mainnet. The `--testnet`, `--simnet` or `--regtest` flags can be used to run in test environments.
3434

3535
#### RPCServer
36-
Governator serves requests over grpc by default on `localhost:8465`. This default can be overwritten:
36+
Faraday serves requests over grpc by default on `localhost:8465`. This default can be overwritten:
3737
```
3838
--rpclisten={host:port to listen for requests}
3939
```
4040

4141
#### Cli Tool
4242
The RPC server can be conveniently accessed using a command line tool.
43-
1. Run governator as detailed above
43+
1. Run faraday as detailed above
4444
```
45-
./gvncli {command}
45+
./frcli {command}
4646
```
4747

4848
##### Commands
@@ -52,7 +52,7 @@ The RPC server can be conveniently accessed using a command line tool.
5252
- `threshold`: close recommendations based on thresholds a variety of metrics.
5353

5454
#### Metrics currently tracked
55-
The following metrics are tracked in governator and exposed via `insights` and used for `outliers` and `threshold` close recommendations.
55+
The following metrics are tracked in faraday and exposed via `insights` and used for `outliers` and `threshold` close recommendations.
5656
- Uptime
5757
- Revenue
5858
- Total Volume

cmd/governator/log.go renamed to cmd/faraday/log.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package main
22

33
import (
44
"github.com/btcsuite/btclog"
5-
"github.com/lightninglabs/governator"
5+
"github.com/lightninglabs/faraday"
66
"github.com/lightningnetwork/lnd/build"
77
)
88

@@ -13,7 +13,7 @@ var (
1313

1414
func init() {
1515
setSubLogger("GVNR", log, nil)
16-
addSubLogger(governator.Subsystem, governator.UseLogger)
16+
addSubLogger(faraday.Subsystem, faraday.UseLogger)
1717
}
1818

1919
// addSubLogger is a helper method to conveniently create and register the

cmd/governator/main.go renamed to cmd/faraday/main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ package main
33
import (
44
"os"
55

6-
"github.com/lightninglabs/governator"
6+
"github.com/lightninglabs/faraday"
77
)
88

99
// main calls the "real" main function in a nested manner so that defers will be
1010
// properly executed if os.Exit() is called.
1111
func main() {
12-
if err := governator.Main(); err != nil {
13-
log.Infof("Error starting governator: %v", err)
12+
if err := faraday.Main(); err != nil {
13+
log.Infof("Error starting faraday: %v", err)
1414
}
1515

1616
os.Exit(1)

cmd/gvncli/channel_insights.go renamed to cmd/frcli/channel_insights.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package main
33
import (
44
"context"
55

6-
"github.com/lightninglabs/governator/gvnrpc"
6+
"github.com/lightninglabs/faraday/frdrpc"
77
"github.com/urfave/cli"
88
)
99

@@ -18,7 +18,7 @@ var channelInsightsCommand = cli.Command{
1818
// insightsResp is used to display additional information that is calculated
1919
// from the channel insight in the cli response.
2020
type insightsResp struct {
21-
*gvnrpc.ChannelInsight
21+
*frdrpc.ChannelInsight
2222
UptimeRatio float64 `json:"uptime_ratio"`
2323
RevenuePerConfirmation float64 `json:"revenue_per_conf_msat"`
2424
VolumePerConfirmation float64 `json:"volume_per_conf_msat"`
@@ -32,7 +32,7 @@ func queryChannelInsights(ctx *cli.Context) error {
3232

3333
rpcCtx := context.Background()
3434
resp, err := client.ChannelInsights(
35-
rpcCtx, &gvnrpc.ChannelInsightsRequest{},
35+
rpcCtx, &frdrpc.ChannelInsightsRequest{},
3636
)
3737
if err != nil {
3838
return err

cmd/gvncli/close_recommendations.go renamed to cmd/frcli/close_recommendations.go

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"fmt"
66
"time"
77

8-
"github.com/lightninglabs/governator/gvnrpc"
8+
"github.com/lightninglabs/faraday/frdrpc"
99
"github.com/urfave/cli"
1010
)
1111

@@ -110,8 +110,8 @@ func queryThresholdRecommendations(ctx *cli.Context) error {
110110

111111
// Set monitored value from cli values, this value will always be
112112
// non-zero because the flag has a default.
113-
req := &gvnrpc.ThresholdRecommendationsRequest{
114-
RecRequest: &gvnrpc.CloseRecommendationRequest{
113+
req := &frdrpc.ThresholdRecommendationsRequest{
114+
RecRequest: &frdrpc.CloseRecommendationRequest{
115115
MinimumMonitored: ctx.Int64("min_monitored"),
116116
},
117117
}
@@ -120,23 +120,23 @@ func queryThresholdRecommendations(ctx *cli.Context) error {
120120
switch {
121121
case ctx.IsSet("uptime"):
122122
req.ThresholdValue = float32(ctx.Float64("uptime"))
123-
req.RecRequest.Metric = gvnrpc.CloseRecommendationRequest_UPTIME
123+
req.RecRequest.Metric = frdrpc.CloseRecommendationRequest_UPTIME
124124

125125
case ctx.IsSet("revenue"):
126126
req.ThresholdValue = float32(ctx.Float64("revenue"))
127-
req.RecRequest.Metric = gvnrpc.CloseRecommendationRequest_REVENUE
127+
req.RecRequest.Metric = frdrpc.CloseRecommendationRequest_REVENUE
128128

129129
case ctx.IsSet("incoming"):
130130
req.ThresholdValue = float32(ctx.Float64("incoming"))
131-
req.RecRequest.Metric = gvnrpc.CloseRecommendationRequest_INCOMING_VOLUME
131+
req.RecRequest.Metric = frdrpc.CloseRecommendationRequest_INCOMING_VOLUME
132132

133133
case ctx.IsSet("outgoing"):
134134
req.ThresholdValue = float32(ctx.Float64("outgoing"))
135-
req.RecRequest.Metric = gvnrpc.CloseRecommendationRequest_OUTGOING_VOLUME
135+
req.RecRequest.Metric = frdrpc.CloseRecommendationRequest_OUTGOING_VOLUME
136136

137137
case ctx.IsSet("volume"):
138138
req.ThresholdValue = float32(ctx.Float64("volume"))
139-
req.RecRequest.Metric = gvnrpc.CloseRecommendationRequest_TOTAL_VOLUME
139+
req.RecRequest.Metric = frdrpc.CloseRecommendationRequest_TOTAL_VOLUME
140140

141141
default:
142142
return fmt.Errorf("threshold required")
@@ -170,8 +170,8 @@ func queryOutlierRecommendations(ctx *cli.Context) error {
170170
// outlier multiplier will be overwritten if the user provided it, and
171171
// the monitored value will always be non-zero because the flag has a
172172
// default value.
173-
req := &gvnrpc.OutlierRecommendationsRequest{
174-
RecRequest: &gvnrpc.CloseRecommendationRequest{
173+
req := &frdrpc.OutlierRecommendationsRequest{
174+
RecRequest: &frdrpc.CloseRecommendationRequest{
175175
MinimumMonitored: ctx.Int64("min_monitored"),
176176
},
177177
OutlierMultiplier: float32(defaultOutlierMultiplier),
@@ -185,19 +185,19 @@ func queryOutlierRecommendations(ctx *cli.Context) error {
185185
// Set metric based on uptime or revenue flags.
186186
switch {
187187
case ctx.IsSet("uptime"):
188-
req.RecRequest.Metric = gvnrpc.CloseRecommendationRequest_UPTIME
188+
req.RecRequest.Metric = frdrpc.CloseRecommendationRequest_UPTIME
189189

190190
case ctx.IsSet("revenue"):
191-
req.RecRequest.Metric = gvnrpc.CloseRecommendationRequest_REVENUE
191+
req.RecRequest.Metric = frdrpc.CloseRecommendationRequest_REVENUE
192192

193193
case ctx.IsSet("incoming_volume"):
194-
req.RecRequest.Metric = gvnrpc.CloseRecommendationRequest_INCOMING_VOLUME
194+
req.RecRequest.Metric = frdrpc.CloseRecommendationRequest_INCOMING_VOLUME
195195

196196
case ctx.IsSet("outgoing_volume"):
197-
req.RecRequest.Metric = gvnrpc.CloseRecommendationRequest_OUTGOING_VOLUME
197+
req.RecRequest.Metric = frdrpc.CloseRecommendationRequest_OUTGOING_VOLUME
198198

199199
case ctx.IsSet("volume"):
200-
req.RecRequest.Metric = gvnrpc.CloseRecommendationRequest_TOTAL_VOLUME
200+
req.RecRequest.Metric = frdrpc.CloseRecommendationRequest_TOTAL_VOLUME
201201

202202
default:
203203
return fmt.Errorf("uptime, revenue or volume realted flag " +

cmd/gvncli/main.go renamed to cmd/frcli/main.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package main
33
import (
44
"os"
55

6-
"github.com/lightninglabs/governator"
6+
"github.com/lightninglabs/faraday"
77
"github.com/urfave/cli"
88
)
99

@@ -14,14 +14,14 @@ var (
1414

1515
func main() {
1616
app := cli.NewApp()
17-
app.Name = "gvncli"
18-
app.Usage = "command line tool for governator"
19-
app.Version = governator.Version()
17+
app.Name = "frcli"
18+
app.Usage = "command line tool for faraday"
19+
app.Version = faraday.Version()
2020
app.Flags = []cli.Flag{
2121
cli.StringFlag{
2222
Name: "rpcserver",
2323
Value: defaultRPCHostPort,
24-
Usage: "host:port of governator",
24+
Usage: "host:port of faraday",
2525
},
2626
}
2727
app.Commands = []cli.Command{

cmd/gvncli/revenue_report.go renamed to cmd/frcli/revenue_report.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package main
33
import (
44
"context"
55

6-
"github.com/lightninglabs/governator/gvnrpc"
6+
"github.com/lightninglabs/faraday/frdrpc"
77
"github.com/urfave/cli"
88
)
99

@@ -48,7 +48,7 @@ func queryRevenueReport(ctx *cli.Context) error {
4848

4949
// Set start and end times from user specified values, defaulting
5050
// to zero if they are not set.
51-
req := &gvnrpc.RevenueReportRequest{
51+
req := &frdrpc.RevenueReportRequest{
5252
StartTime: uint64(ctx.Int64("start_time")),
5353
EndTime: uint64(ctx.Int64("end_time")),
5454
}

0 commit comments

Comments
 (0)