mirror of
https://github.com/lightninglabs/faraday.git
synced 2026-08-13 12:33:35 +02:00
multi: faraday rename
This commit is contained in:
parent
cf4fc1fb94
commit
df836c2d21
30 changed files with 239 additions and 239 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
|
@ -1,2 +1,2 @@
|
|||
/governator
|
||||
/gvncli
|
||||
/faraday
|
||||
/frcli
|
||||
|
|
|
|||
14
Dockerfile
14
Dockerfile
|
|
@ -4,14 +4,14 @@ FROM golang:1.13-alpine as builder
|
|||
# queries required to connect to linked containers succeed.
|
||||
ENV GODEBUG netdns=cgo
|
||||
|
||||
ADD . /go/src/github.com/lightninglabs/governator
|
||||
ADD . /go/src/github.com/lightninglabs/faraday
|
||||
|
||||
# Install dependencies and build the binaries.
|
||||
RUN apk add --no-cache --update alpine-sdk \
|
||||
git \
|
||||
make \
|
||||
gcc \
|
||||
&& cd /go/src/github.com/lightninglabs/governator \
|
||||
&& cd /go/src/github.com/lightninglabs/faraday \
|
||||
&& make \
|
||||
&& make install
|
||||
|
||||
|
|
@ -24,12 +24,12 @@ RUN apk --no-cache add \
|
|||
ca-certificates
|
||||
|
||||
# Copy the binaries from the builder image.
|
||||
COPY --from=builder /go/bin/governator /bin/
|
||||
COPY --from=builder /go/bin/gvncli /bin/
|
||||
COPY --from=builder /go/bin/faraday /bin/
|
||||
COPY --from=builder /go/bin/frcli /bin/
|
||||
|
||||
# Expose governator ports (rpc).
|
||||
# Expose faraday ports (rpc).
|
||||
EXPOSE 8465
|
||||
|
||||
# Specify the start command and entrypoint as the governator daemon.
|
||||
ENTRYPOINT ["governator"]
|
||||
# Specify the start command and entrypoint as the faraday daemon.
|
||||
ENTRYPOINT ["faraday"]
|
||||
|
||||
|
|
|
|||
24
Makefile
24
Makefile
|
|
@ -1,5 +1,5 @@
|
|||
PKG := github.com/lightninglabs/governator
|
||||
ESCPKG := github.com\/lightninglabs\/governator
|
||||
PKG := github.com/lightninglabs/faraday
|
||||
ESCPKG := github.com\/lightninglabs\/faraday
|
||||
|
||||
LINT_PKG := github.com/golangci/golangci-lint/cmd/golangci-lint
|
||||
GOVERALLS_PKG := github.com/mattn/goveralls
|
||||
|
|
@ -59,14 +59,14 @@ $(GOACC_BIN):
|
|||
# ============
|
||||
|
||||
build:
|
||||
@$(call print, "Building governator.")
|
||||
$(GOBUILD) $(LDFLAGS) $(PKG)/cmd/governator
|
||||
$(GOBUILD) $(LDFLAGS) $(PKG)/cmd/gvncli
|
||||
@$(call print, "Building faraday.")
|
||||
$(GOBUILD) $(LDFLAGS) $(PKG)/cmd/faraday
|
||||
$(GOBUILD) $(LDFLAGS) $(PKG)/cmd/frcli
|
||||
|
||||
install:
|
||||
@$(call print, "Installing governator.")
|
||||
$(GOINSTALL) $(LDFLAGS) $(PKG)/cmd/governator
|
||||
$(GOINSTALL) $(LDFLAGS) $(PKG)/cmd/gvncli
|
||||
@$(call print, "Installing faraday.")
|
||||
$(GOINSTALL) $(LDFLAGS) $(PKG)/cmd/faraday
|
||||
$(GOINSTALL) $(LDFLAGS) $(PKG)/cmd/frcli
|
||||
|
||||
scratch: build
|
||||
|
||||
|
|
@ -94,7 +94,7 @@ goveralls: $(GOVERALLS_BIN)
|
|||
|
||||
rpc:
|
||||
@$(call print, "Compiling protos.")
|
||||
cd ./gvnrpc; ./gen_protos.sh
|
||||
cd ./frdrpc; ./gen_protos.sh
|
||||
|
||||
travis-race: lint unit-race
|
||||
|
||||
|
|
@ -123,12 +123,12 @@ lint: $(LINT_BIN)
|
|||
|
||||
list:
|
||||
@$(call print, "Listing commands.")
|
||||
@$(MAKE) -qp | \
|
||||
@$(MAKE) -qp | \
|
||||
awk -F':' '/^[a-zA-Z0-9][^$$#\/\t=]*:([^=]|$$)/ {split($$1,A,/ /);for(i in A)print A[i]}' | \
|
||||
grep -v Makefile | \
|
||||
sort
|
||||
clean:
|
||||
@$(call print, "Cleaning source.$(NC)")
|
||||
$(RM) ./governator
|
||||
$(RM) ./gvncli
|
||||
$(RM) ./faraday
|
||||
$(RM) ./frcli
|
||||
$(RM) coverage.txt
|
||||
|
|
|
|||
26
README.md
26
README.md
|
|
@ -1,15 +1,15 @@
|
|||
# governator
|
||||
# faraday
|
||||
|
||||
[](https://github.com/lightninglabs/governator/blob/master/LICENSE)
|
||||
[](https://github.com/lightninglabs/faraday/blob/master/LICENSE)
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
## Installation
|
||||
A [Makefile](https://github.com/lightninglabs/governator/blob/master/Makefile) is provided. To install governator and al its dependencies, run:
|
||||
A [Makefile](https://github.com/lightninglabs/faraday/blob/master/Makefile) is provided. To install faraday and all its dependencies, run:
|
||||
|
||||
```
|
||||
go get -d github.com/lightninglabs/governator
|
||||
cd $GOPATH/src/github.com/lightninglabs/governator
|
||||
go get -d github.com/lightninglabs/faraday
|
||||
cd $GOPATH/src/github.com/lightninglabs/faraday
|
||||
make && make install
|
||||
```
|
||||
|
||||
|
|
@ -21,28 +21,28 @@ make check
|
|||
```
|
||||
|
||||
## Usage
|
||||
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.
|
||||
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.
|
||||
```
|
||||
./governator \
|
||||
./faraday \
|
||||
--macaroondir={directory containing macaroon} \
|
||||
--macaroonfile={macaroon with read permissions} \
|
||||
--tlscertpath={path to lnd cert} \
|
||||
--rpserver={host:port of lnd's rpserver}
|
||||
```
|
||||
|
||||
By default, governator runs on mainnet. The `--testnet`, `--simnet` or `--regtest` flags can be used to run in test environments.
|
||||
By default, faraday runs on mainnet. The `--testnet`, `--simnet` or `--regtest` flags can be used to run in test environments.
|
||||
|
||||
#### RPCServer
|
||||
Governator serves requests over grpc by default on `localhost:8465`. This default can be overwritten:
|
||||
Faraday serves requests over grpc by default on `localhost:8465`. This default can be overwritten:
|
||||
```
|
||||
--rpclisten={host:port to listen for requests}
|
||||
```
|
||||
|
||||
#### Cli Tool
|
||||
The RPC server can be conveniently accessed using a command line tool.
|
||||
1. Run governator as detailed above
|
||||
1. Run faraday as detailed above
|
||||
```
|
||||
./gvncli {command}
|
||||
./frcli {command}
|
||||
```
|
||||
|
||||
##### Commands
|
||||
|
|
@ -52,7 +52,7 @@ The RPC server can be conveniently accessed using a command line tool.
|
|||
- `threshold`: close recommendations based on thresholds a variety of metrics.
|
||||
|
||||
#### Metrics currently tracked
|
||||
The following metrics are tracked in governator and exposed via `insights` and used for `outliers` and `threshold` close recommendations.
|
||||
The following metrics are tracked in faraday and exposed via `insights` and used for `outliers` and `threshold` close recommendations.
|
||||
- Uptime
|
||||
- Revenue
|
||||
- Total Volume
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ package main
|
|||
|
||||
import (
|
||||
"github.com/btcsuite/btclog"
|
||||
"github.com/lightninglabs/governator"
|
||||
"github.com/lightninglabs/faraday"
|
||||
"github.com/lightningnetwork/lnd/build"
|
||||
)
|
||||
|
||||
|
|
@ -13,7 +13,7 @@ var (
|
|||
|
||||
func init() {
|
||||
setSubLogger("GVNR", log, nil)
|
||||
addSubLogger(governator.Subsystem, governator.UseLogger)
|
||||
addSubLogger(faraday.Subsystem, faraday.UseLogger)
|
||||
}
|
||||
|
||||
// addSubLogger is a helper method to conveniently create and register the
|
||||
|
|
@ -3,14 +3,14 @@ package main
|
|||
import (
|
||||
"os"
|
||||
|
||||
"github.com/lightninglabs/governator"
|
||||
"github.com/lightninglabs/faraday"
|
||||
)
|
||||
|
||||
// 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 := governator.Main(); err != nil {
|
||||
log.Infof("Error starting governator: %v", err)
|
||||
if err := faraday.Main(); err != nil {
|
||||
log.Infof("Error starting faraday: %v", err)
|
||||
}
|
||||
|
||||
os.Exit(1)
|
||||
|
|
@ -3,7 +3,7 @@ package main
|
|||
import (
|
||||
"context"
|
||||
|
||||
"github.com/lightninglabs/governator/gvnrpc"
|
||||
"github.com/lightninglabs/faraday/frdrpc"
|
||||
"github.com/urfave/cli"
|
||||
)
|
||||
|
||||
|
|
@ -18,7 +18,7 @@ var channelInsightsCommand = cli.Command{
|
|||
// insightsResp is used to display additional information that is calculated
|
||||
// from the channel insight in the cli response.
|
||||
type insightsResp struct {
|
||||
*gvnrpc.ChannelInsight
|
||||
*frdrpc.ChannelInsight
|
||||
UptimeRatio float64 `json:"uptime_ratio"`
|
||||
RevenuePerConfirmation float64 `json:"revenue_per_conf_msat"`
|
||||
VolumePerConfirmation float64 `json:"volume_per_conf_msat"`
|
||||
|
|
@ -32,7 +32,7 @@ func queryChannelInsights(ctx *cli.Context) error {
|
|||
|
||||
rpcCtx := context.Background()
|
||||
resp, err := client.ChannelInsights(
|
||||
rpcCtx, &gvnrpc.ChannelInsightsRequest{},
|
||||
rpcCtx, &frdrpc.ChannelInsightsRequest{},
|
||||
)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
@ -5,7 +5,7 @@ import (
|
|||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/lightninglabs/governator/gvnrpc"
|
||||
"github.com/lightninglabs/faraday/frdrpc"
|
||||
"github.com/urfave/cli"
|
||||
)
|
||||
|
||||
|
|
@ -110,8 +110,8 @@ func queryThresholdRecommendations(ctx *cli.Context) error {
|
|||
|
||||
// Set monitored value from cli values, this value will always be
|
||||
// non-zero because the flag has a default.
|
||||
req := &gvnrpc.ThresholdRecommendationsRequest{
|
||||
RecRequest: &gvnrpc.CloseRecommendationRequest{
|
||||
req := &frdrpc.ThresholdRecommendationsRequest{
|
||||
RecRequest: &frdrpc.CloseRecommendationRequest{
|
||||
MinimumMonitored: ctx.Int64("min_monitored"),
|
||||
},
|
||||
}
|
||||
|
|
@ -120,23 +120,23 @@ func queryThresholdRecommendations(ctx *cli.Context) error {
|
|||
switch {
|
||||
case ctx.IsSet("uptime"):
|
||||
req.ThresholdValue = float32(ctx.Float64("uptime"))
|
||||
req.RecRequest.Metric = gvnrpc.CloseRecommendationRequest_UPTIME
|
||||
req.RecRequest.Metric = frdrpc.CloseRecommendationRequest_UPTIME
|
||||
|
||||
case ctx.IsSet("revenue"):
|
||||
req.ThresholdValue = float32(ctx.Float64("revenue"))
|
||||
req.RecRequest.Metric = gvnrpc.CloseRecommendationRequest_REVENUE
|
||||
req.RecRequest.Metric = frdrpc.CloseRecommendationRequest_REVENUE
|
||||
|
||||
case ctx.IsSet("incoming"):
|
||||
req.ThresholdValue = float32(ctx.Float64("incoming"))
|
||||
req.RecRequest.Metric = gvnrpc.CloseRecommendationRequest_INCOMING_VOLUME
|
||||
req.RecRequest.Metric = frdrpc.CloseRecommendationRequest_INCOMING_VOLUME
|
||||
|
||||
case ctx.IsSet("outgoing"):
|
||||
req.ThresholdValue = float32(ctx.Float64("outgoing"))
|
||||
req.RecRequest.Metric = gvnrpc.CloseRecommendationRequest_OUTGOING_VOLUME
|
||||
req.RecRequest.Metric = frdrpc.CloseRecommendationRequest_OUTGOING_VOLUME
|
||||
|
||||
case ctx.IsSet("volume"):
|
||||
req.ThresholdValue = float32(ctx.Float64("volume"))
|
||||
req.RecRequest.Metric = gvnrpc.CloseRecommendationRequest_TOTAL_VOLUME
|
||||
req.RecRequest.Metric = frdrpc.CloseRecommendationRequest_TOTAL_VOLUME
|
||||
|
||||
default:
|
||||
return fmt.Errorf("threshold required")
|
||||
|
|
@ -170,8 +170,8 @@ func queryOutlierRecommendations(ctx *cli.Context) error {
|
|||
// outlier multiplier will be overwritten if the user provided it, and
|
||||
// the monitored value will always be non-zero because the flag has a
|
||||
// default value.
|
||||
req := &gvnrpc.OutlierRecommendationsRequest{
|
||||
RecRequest: &gvnrpc.CloseRecommendationRequest{
|
||||
req := &frdrpc.OutlierRecommendationsRequest{
|
||||
RecRequest: &frdrpc.CloseRecommendationRequest{
|
||||
MinimumMonitored: ctx.Int64("min_monitored"),
|
||||
},
|
||||
OutlierMultiplier: float32(defaultOutlierMultiplier),
|
||||
|
|
@ -185,19 +185,19 @@ func queryOutlierRecommendations(ctx *cli.Context) error {
|
|||
// Set metric based on uptime or revenue flags.
|
||||
switch {
|
||||
case ctx.IsSet("uptime"):
|
||||
req.RecRequest.Metric = gvnrpc.CloseRecommendationRequest_UPTIME
|
||||
req.RecRequest.Metric = frdrpc.CloseRecommendationRequest_UPTIME
|
||||
|
||||
case ctx.IsSet("revenue"):
|
||||
req.RecRequest.Metric = gvnrpc.CloseRecommendationRequest_REVENUE
|
||||
req.RecRequest.Metric = frdrpc.CloseRecommendationRequest_REVENUE
|
||||
|
||||
case ctx.IsSet("incoming_volume"):
|
||||
req.RecRequest.Metric = gvnrpc.CloseRecommendationRequest_INCOMING_VOLUME
|
||||
req.RecRequest.Metric = frdrpc.CloseRecommendationRequest_INCOMING_VOLUME
|
||||
|
||||
case ctx.IsSet("outgoing_volume"):
|
||||
req.RecRequest.Metric = gvnrpc.CloseRecommendationRequest_OUTGOING_VOLUME
|
||||
req.RecRequest.Metric = frdrpc.CloseRecommendationRequest_OUTGOING_VOLUME
|
||||
|
||||
case ctx.IsSet("volume"):
|
||||
req.RecRequest.Metric = gvnrpc.CloseRecommendationRequest_TOTAL_VOLUME
|
||||
req.RecRequest.Metric = frdrpc.CloseRecommendationRequest_TOTAL_VOLUME
|
||||
|
||||
default:
|
||||
return fmt.Errorf("uptime, revenue or volume realted flag " +
|
||||
|
|
@ -3,7 +3,7 @@ package main
|
|||
import (
|
||||
"os"
|
||||
|
||||
"github.com/lightninglabs/governator"
|
||||
"github.com/lightninglabs/faraday"
|
||||
"github.com/urfave/cli"
|
||||
)
|
||||
|
||||
|
|
@ -14,14 +14,14 @@ var (
|
|||
|
||||
func main() {
|
||||
app := cli.NewApp()
|
||||
app.Name = "gvncli"
|
||||
app.Usage = "command line tool for governator"
|
||||
app.Version = governator.Version()
|
||||
app.Name = "frcli"
|
||||
app.Usage = "command line tool for faraday"
|
||||
app.Version = faraday.Version()
|
||||
app.Flags = []cli.Flag{
|
||||
cli.StringFlag{
|
||||
Name: "rpcserver",
|
||||
Value: defaultRPCHostPort,
|
||||
Usage: "host:port of governator",
|
||||
Usage: "host:port of faraday",
|
||||
},
|
||||
}
|
||||
app.Commands = []cli.Command{
|
||||
|
|
@ -3,7 +3,7 @@ package main
|
|||
import (
|
||||
"context"
|
||||
|
||||
"github.com/lightninglabs/governator/gvnrpc"
|
||||
"github.com/lightninglabs/faraday/frdrpc"
|
||||
"github.com/urfave/cli"
|
||||
)
|
||||
|
||||
|
|
@ -48,7 +48,7 @@ func queryRevenueReport(ctx *cli.Context) error {
|
|||
|
||||
// Set start and end times from user specified values, defaulting
|
||||
// to zero if they are not set.
|
||||
req := &gvnrpc.RevenueReportRequest{
|
||||
req := &frdrpc.RevenueReportRequest{
|
||||
StartTime: uint64(ctx.Int64("start_time")),
|
||||
EndTime: uint64(ctx.Int64("end_time")),
|
||||
}
|
||||
|
|
@ -8,7 +8,7 @@ import (
|
|||
"net"
|
||||
"os"
|
||||
|
||||
"github.com/lightninglabs/governator/gvnrpc"
|
||||
"github.com/lightninglabs/faraday/frdrpc"
|
||||
"github.com/lightninglabs/protobuf-hex-display/jsonpb"
|
||||
"github.com/lightninglabs/protobuf-hex-display/proto"
|
||||
"github.com/lightningnetwork/lnd/lncfg"
|
||||
|
|
@ -24,7 +24,7 @@ var (
|
|||
|
||||
// fatal logs and error and exits.
|
||||
func fatal(err error) {
|
||||
_, _ = fmt.Fprintf(os.Stderr, "[gvncli] %v\n", err)
|
||||
_, _ = fmt.Fprintf(os.Stderr, "[frcli] %v\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
|
|
@ -57,8 +57,8 @@ func printJSON(resp interface{}) {
|
|||
_, _ = out.WriteTo(os.Stdout)
|
||||
}
|
||||
|
||||
// getClient returns a governator client.
|
||||
func getClient(ctx *cli.Context) (gvnrpc.GovernatorServerClient, func()) {
|
||||
// getClient returns a faraday client.
|
||||
func getClient(ctx *cli.Context) (frdrpc.FaradayServerClient, func()) {
|
||||
conn := getClientConn(ctx)
|
||||
|
||||
cleanUp := func() {
|
||||
|
|
@ -67,7 +67,7 @@ func getClient(ctx *cli.Context) (gvnrpc.GovernatorServerClient, func()) {
|
|||
}
|
||||
}
|
||||
|
||||
return gvnrpc.NewGovernatorServerClient(conn), cleanUp
|
||||
return frdrpc.NewFaradayServerClient(conn), cleanUp
|
||||
}
|
||||
|
||||
// getClientConn gets a client connection to the address provided by the
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package governator
|
||||
package faraday
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
|
@ -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 governator should use.
|
||||
// TLSCertPath is the path to the tls cert that faraday should use.
|
||||
TLSCertPath string `long:"tlscertpath" description:"Path to TLS cert"`
|
||||
|
||||
// TestNet is set to true when running on testnet.
|
||||
|
|
@ -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 governator and its subsystems."`
|
||||
DebugLevel string `long:"debuglevel" description:"Debug level for faraday and its subsystems."`
|
||||
|
||||
// RPCListen is the listen address for the governator rpc server.
|
||||
// RPCListen is the listen address for the faraday rpc server.
|
||||
RPCListen string `long:"rpclisten" description:"Address to listen on for gRPC clients"`
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,15 +1,15 @@
|
|||
// Package governator contains the main function for the governator.
|
||||
package governator
|
||||
// Package faraday contains the main function for faraday.
|
||||
package faraday
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/lightninglabs/governator/gvnrpc"
|
||||
"github.com/lightninglabs/faraday/frdrpc"
|
||||
"github.com/lightninglabs/loop/lndclient"
|
||||
"github.com/lightningnetwork/lnd/signal"
|
||||
)
|
||||
|
||||
// Main is the real entry point for governator. It is required to ensure that
|
||||
// Main is the real entry point for faraday. It is required to ensure that
|
||||
// defers are properly executed when os.Exit() is called.
|
||||
func Main() error {
|
||||
config, err := loadConfig()
|
||||
|
|
@ -30,9 +30,9 @@ func Main() error {
|
|||
err)
|
||||
}
|
||||
|
||||
// Instantiate the governator gRPC server.
|
||||
server := gvnrpc.NewRPCServer(
|
||||
&gvnrpc.Config{
|
||||
// Instantiate the faraday gRPC server.
|
||||
server := frdrpc.NewRPCServer(
|
||||
&frdrpc.Config{
|
||||
LightningClient: client,
|
||||
RPCListen: config.RPCListen,
|
||||
},
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
gvrpc
|
||||
frdrpc
|
||||
=====
|
||||
This package implements governator's RPC client and server.
|
||||
This package implements faraday'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/governator/tree/master/gvnrpc/gen_protos.sh) to generate new protobuf definitions.
|
||||
2. Run [`gen_protos.sh`](https://github.com/lightninglabs/faraday/tree/master/frdrpc/gen_protos.sh) to generate new protobuf definitions.
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
package gvnrpc
|
||||
package frdrpc
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/lightninglabs/governator/insights"
|
||||
"github.com/lightninglabs/governator/revenue"
|
||||
"github.com/lightninglabs/faraday/insights"
|
||||
"github.com/lightninglabs/faraday/revenue"
|
||||
"github.com/lightningnetwork/lnd/lnrpc"
|
||||
)
|
||||
|
||||
|
|
@ -1,12 +1,12 @@
|
|||
package gvnrpc
|
||||
package frdrpc
|
||||
|
||||
import (
|
||||
"context"
|
||||
"sort"
|
||||
"time"
|
||||
|
||||
"github.com/lightninglabs/governator/insights"
|
||||
"github.com/lightninglabs/governator/recommend"
|
||||
"github.com/lightninglabs/faraday/insights"
|
||||
"github.com/lightninglabs/faraday/recommend"
|
||||
)
|
||||
|
||||
// parseRecommendationRequest parses a close recommendation request and
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/sh
|
||||
|
||||
echo "Generating governator gRPC server protos"
|
||||
echo "Generating faraday gRPC server protos"
|
||||
|
||||
# Generate the protos.
|
||||
protoc -I/usr/local/include -I. \
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package gvnrpc
|
||||
package frdrpc
|
||||
|
||||
import (
|
||||
"github.com/btcsuite/btclog"
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
package gvnrpc
|
||||
package frdrpc
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/lightninglabs/governator/revenue"
|
||||
"github.com/lightninglabs/faraday/revenue"
|
||||
"github.com/lightningnetwork/lnd/lnrpc"
|
||||
)
|
||||
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// source: rpc.proto
|
||||
|
||||
package gvnrpc
|
||||
package frdrpc
|
||||
|
||||
import (
|
||||
context "context"
|
||||
|
|
@ -72,7 +72,7 @@ type CloseRecommendationRequest struct {
|
|||
//monitored to.
|
||||
//Revenue: the revenue that the channel has produced per block that its
|
||||
//funding transaction has been confirmed for.
|
||||
Metric CloseRecommendationRequest_Metric `protobuf:"varint,2,opt,name=metric,proto3,enum=gvnrpc.CloseRecommendationRequest_Metric" json:"metric,omitempty"`
|
||||
Metric CloseRecommendationRequest_Metric `protobuf:"varint,2,opt,name=metric,proto3,enum=frdrpc.CloseRecommendationRequest_Metric" json:"metric,omitempty"`
|
||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||
XXX_unrecognized []byte `json:"-"`
|
||||
XXX_sizecache int32 `json:"-"`
|
||||
|
|
@ -796,85 +796,86 @@ func (m *ChannelInsight) GetPrivate() bool {
|
|||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterEnum("gvnrpc.CloseRecommendationRequest_Metric", CloseRecommendationRequest_Metric_name, CloseRecommendationRequest_Metric_value)
|
||||
proto.RegisterType((*CloseRecommendationRequest)(nil), "gvnrpc.CloseRecommendationRequest")
|
||||
proto.RegisterType((*OutlierRecommendationsRequest)(nil), "gvnrpc.OutlierRecommendationsRequest")
|
||||
proto.RegisterType((*ThresholdRecommendationsRequest)(nil), "gvnrpc.ThresholdRecommendationsRequest")
|
||||
proto.RegisterType((*CloseRecommendationsResponse)(nil), "gvnrpc.CloseRecommendationsResponse")
|
||||
proto.RegisterType((*Recommendation)(nil), "gvnrpc.Recommendation")
|
||||
proto.RegisterType((*RevenueReportRequest)(nil), "gvnrpc.RevenueReportRequest")
|
||||
proto.RegisterType((*RevenueReportResponse)(nil), "gvnrpc.RevenueReportResponse")
|
||||
proto.RegisterType((*RevenueReport)(nil), "gvnrpc.RevenueReport")
|
||||
proto.RegisterMapType((map[string]*PairReport)(nil), "gvnrpc.RevenueReport.PairReportsEntry")
|
||||
proto.RegisterType((*PairReport)(nil), "gvnrpc.PairReport")
|
||||
proto.RegisterType((*ChannelInsightsRequest)(nil), "gvnrpc.ChannelInsightsRequest")
|
||||
proto.RegisterType((*ChannelInsightsResponse)(nil), "gvnrpc.ChannelInsightsResponse")
|
||||
proto.RegisterType((*ChannelInsight)(nil), "gvnrpc.ChannelInsight")
|
||||
proto.RegisterEnum("frdrpc.CloseRecommendationRequest_Metric", CloseRecommendationRequest_Metric_name, CloseRecommendationRequest_Metric_value)
|
||||
proto.RegisterType((*CloseRecommendationRequest)(nil), "frdrpc.CloseRecommendationRequest")
|
||||
proto.RegisterType((*OutlierRecommendationsRequest)(nil), "frdrpc.OutlierRecommendationsRequest")
|
||||
proto.RegisterType((*ThresholdRecommendationsRequest)(nil), "frdrpc.ThresholdRecommendationsRequest")
|
||||
proto.RegisterType((*CloseRecommendationsResponse)(nil), "frdrpc.CloseRecommendationsResponse")
|
||||
proto.RegisterType((*Recommendation)(nil), "frdrpc.Recommendation")
|
||||
proto.RegisterType((*RevenueReportRequest)(nil), "frdrpc.RevenueReportRequest")
|
||||
proto.RegisterType((*RevenueReportResponse)(nil), "frdrpc.RevenueReportResponse")
|
||||
proto.RegisterType((*RevenueReport)(nil), "frdrpc.RevenueReport")
|
||||
proto.RegisterMapType((map[string]*PairReport)(nil), "frdrpc.RevenueReport.PairReportsEntry")
|
||||
proto.RegisterType((*PairReport)(nil), "frdrpc.PairReport")
|
||||
proto.RegisterType((*ChannelInsightsRequest)(nil), "frdrpc.ChannelInsightsRequest")
|
||||
proto.RegisterType((*ChannelInsightsResponse)(nil), "frdrpc.ChannelInsightsResponse")
|
||||
proto.RegisterType((*ChannelInsight)(nil), "frdrpc.ChannelInsight")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("rpc.proto", fileDescriptor_77a6da22d6a3feb1) }
|
||||
|
||||
var fileDescriptor_77a6da22d6a3feb1 = []byte{
|
||||
// 944 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0x41, 0x6f, 0xe3, 0x44,
|
||||
0x14, 0xc6, 0x71, 0x9b, 0x34, 0x2f, 0x9b, 0xc4, 0x3b, 0xdb, 0x2d, 0xa1, 0x6a, 0x69, 0x64, 0xed,
|
||||
0xb2, 0x41, 0x40, 0xba, 0x0a, 0x17, 0xc4, 0x89, 0xaa, 0x8a, 0x4a, 0x44, 0x93, 0x54, 0xb3, 0x49,
|
||||
0xb9, 0x20, 0x59, 0xc6, 0x99,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0x3b, 0x9c, 0xcc, 0x87, 0x4e, 0x05, 0x3d, 0x83, 0xf6, 0x68, 0x72, 0x39, 0x1d,
|
||||
0x8f, 0x26, 0x57, 0xde, 0xed, 0xf4, 0x7a, 0x3e, 0x1e, 0x3a, 0x76, 0x0a, 0x4e, 0xe7, 0xb3, 0xab,
|
||||
0xe9, 0x06, 0xb8, 0x87, 0x1c, 0x78, 0x32, 0x9b, 0xce, 0x2e, 0xae, 0x33, 0x64, 0xdf, 0xfd, 0xcd,
|
||||
0x82, 0xd3, 0x69, 0x22, 0x57, 0x94, 0x88, 0xf2, 0xd9, 0xe2, 0xec, 0xf6, 0x97, 0xd0, 0x10, 0x24,
|
||||
0xf0, 0x84, 0x5e, 0xaa, 0x7b, 0x37, 0x06, 0xee, 0xe3, 0xb7, 0xc2, 0x20, 0x48, 0x90, 0x05, 0xf9,
|
||||
0x02, 0x10, 0xd7, 0x2e, 0x5e, 0x98, 0xac, 0x24, 0x8d, 0xd2, 0x4f, 0x95, 0xa1, 0x0a, 0x7e, 0x6a,
|
||||
0x98, 0x71, 0x4e, 0xb8, 0xbf, 0x5a, 0x70, 0x36, 0xbb, 0x13, 0x24, 0xbe, 0xe3, 0xab, 0xc5, 0xff,
|
||||
0x79, 0xae, 0x57, 0xd0, 0x96, 0x99, 0x8f, 0xb7, 0xf6, 0x57, 0x09, 0x31, 0x87, 0x6a, 0xe5, 0xf0,
|
||||
0x6d, 0x8a, 0xba, 0xbf, 0x5b, 0x70, 0xb2, 0x23, 0x66, 0x8c, 0x49, 0x1c, 0x71, 0x16, 0x13, 0xf4,
|
||||
0x12, 0x5a, 0x92, 0x4b, 0x7f, 0xe5, 0x05, 0x77, 0x3e, 0x63, 0x64, 0x15, 0xab, 0x13, 0xed, 0xe3,
|
||||
0xa6, 0x42, 0x2f, 0x0d, 0x88, 0xce, 0xe1, 0x59, 0xc0, 0x59, 0x4c, 0x17, 0x44, 0x90, 0x45, 0xa1,
|
||||
0xad, 0x28, 0x2d, 0x2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, 0xf3, 0xc7, 0xaa, 0xfa, 0x37,
|
||||
0xf4, 0xe5, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x6d, 0x9a, 0x34, 0x4e, 0x40, 0x09, 0x00, 0x00,
|
||||
// 945 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xc1, 0x6e, 0xe3, 0x36,
|
||||
0x13, 0xfe, 0x65, 0x25, 0x4e, 0x32, 0x5e, 0xdb, 0x5a, 0x6e, 0x36, 0xbf, 0x1b, 0x24, 0x8d, 0x21,
|
||||
0xec, 0x76, 0x5d, 0xb4, 0x75, 0x16, 0xee, 0xa5, 0xe8, 0xa9, 0x41, 0xe0, 0x6e, 0x8d, 0xc6, 0x76,
|
||||
0xc0, 0xb5, 0xd3, 0x4b, 0x01, 0x41, 0x95, 0x18, 0x87, 0xad, 0x45, 0x6a, 0x29, 0xca, 0x40, 0xce,
|
||||
0x7d, 0x80, 0x1e, 0xfa, 0x32, 0x7d, 0x88, 0x5e, 0x7a, 0xe8, 0xbb, 0xf4, 0x58, 0x88, 0xa4, 0x24,
|
||||
0xcb, 0x75, 0x36, 0xbd, 0xf4, 0x26, 0x7e, 0xdf, 0xc7, 0xf9, 0xc8, 0x99, 0x31, 0xc7, 0x70, 0x20,
|
||||
0xe2, 0xa0, 0x1f, 0x0b, 0x2e, 0x39, 0xaa, 0xdf, 0x8a, 0x50, 0xc4, 0xc1, 0xf1, 0xc9, 0x82, 0xf3,
|
||||
0xc5, 0x92, 0x9c, 0xfb, 0x31, 0x3d, 0xf7, 0x19, 0xe3, 0xd2, 0x97, 0x94, 0xb3, 0x44, 0xab, 0xdc,
|
||||
0xbf, 0x2c, 0x38, 0xbe, 0x5c, 0xf2, 0x84, 0x60, 0x12, 0xf0, 0x28, 0x22, 0x2c, 0x54, 0x34, 0x26,
|
||||
0xef, 0x52, 0x92, 0x48, 0xf4, 0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 0xb8, 0x20, 0xdc, 0x5f, 0x2c, 0x38, 0x9b, 0xdd, 0x09, 0x92, 0xdc, 0xf1, 0x65,
|
||||
0xf8, 0x5f, 0x9e, 0xeb, 0x15, 0xb4, 0x65, 0xee, 0xe3, 0xad, 0xfc, 0x65, 0x4a, 0xcc, 0xa1, 0x5a,
|
||||
0x05, 0x7c, 0x93, 0xa1, 0xee, 0x6f, 0x16, 0x9c, 0x6c, 0x89, 0x99, 0x60, 0x92, 0xc4, 0x9c, 0x25,
|
||||
0x04, 0xbd, 0x84, 0x96, 0xe4, 0xd2, 0x5f, 0x7a, 0xc1, 0x9d, 0xcf, 0x18, 0x59, 0x26, 0xea, 0x44,
|
||||
0xbb, 0xb8, 0xa9, 0xd0, 0x4b, 0x03, 0xa2, 0x73, 0x78, 0x16, 0x70, 0x96, 0xd0, 0x90, 0x08, 0x12,
|
||||
0x96, 0xda, 0x9a, 0xd2, 0xa2, 0x92, 0x2a, 0x36, 0x7c, 0x05, 0x6d, 0x51, 0xb5, 0xec, 0xd8, 0x5d,
|
||||
0xbb, 0xd7, 0x18, 0x1c, 0xe5, 0x57, 0xdd, 0xb8, 0xe5, 0xa6, 0xdc, 0x65, 0xd0, 0xaa, 0x4a, 0xd0,
|
||||
0x29, 0x40, 0xe6, 0xec, 0xc5, 0x9c, 0x32, 0x9d, 0xb9, 0x03, 0x7c, 0x90, 0x21, 0xd7, 0x19, 0x80,
|
||||
0x0e, 0x61, 0x77, 0x3d, 0x15, 0x7a, 0x91, 0xa5, 0xaa, 0x88, 0xec, 0x05, 0x59, 0x2a, 0x3a, 0x76,
|
||||
0xd7, 0xea, 0xed, 0xe3, 0x56, 0x01, 0xab, 0x04, 0xb9, 0xef, 0xe0, 0x10, 0x93, 0x15, 0x61, 0x29,
|
||||
0xc1, 0x24, 0xe6, 0x42, 0xe6, 0xb9, 0x3e, 0x83, 0x46, 0xe9, 0x9a, 0xa5, 0xc7, 0xee, 0x1d, 0x60,
|
||||
0x28, 0x6c, 0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|
||||
0xb6, 0xa1, 0xf9, 0xb5, 0x2f, 0xfc, 0xd0, 0xbf, 0x7f, 0x4b, 0xc4, 0x8a, 0x08, 0x44, 0xe0, 0x68,
|
||||
0xfb, 0x4c, 0x42, 0x2f, 0xf3, 0x42, 0xbd, 0x77, 0x66, 0x1d, 0xbf, 0x78, 0xcf, 0x18, 0x28, 0xfb,
|
||||
0x81, 0x42, 0xe7, 0xa1, 0x21, 0x83, 0x5e, 0xe5, 0x11, 0x1e, 0x19, 0x43, 0xff, 0xd2, 0xea, 0x6a,
|
||||
0xf3, 0x55, 0x39, 0xd9, 0xfe, 0x0e, 0x99, 0xa0, 0xa7, 0x0f, 0xb0, 0x26, 0x1a, 0x86, 0xf6, 0x46,
|
||||
0x8f, 0xa3, 0x0f, 0xb7, 0x77, 0x70, 0x71, 0xcc, 0xb3, 0x07, 0x79, 0x1d, 0xf3, 0x87, 0xba, 0xfa,
|
||||
0x2b, 0xf4, 0xf9, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x58, 0xfa, 0x74, 0x8e, 0x3d, 0x09, 0x00,
|
||||
0x00,
|
||||
}
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
|
|
@ -885,163 +886,163 @@ var _ grpc.ClientConn
|
|||
// is compatible with the grpc package it is being compiled against.
|
||||
const _ = grpc.SupportPackageIsVersion4
|
||||
|
||||
// GovernatorServerClient is the client API for GovernatorServer service.
|
||||
// FaradayServerClient is the client API for FaradayServer service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
|
||||
type GovernatorServerClient interface {
|
||||
type FaradayServerClient interface {
|
||||
OutlierRecommendations(ctx context.Context, in *OutlierRecommendationsRequest, opts ...grpc.CallOption) (*CloseRecommendationsResponse, error)
|
||||
ThresholdRecommendations(ctx context.Context, in *ThresholdRecommendationsRequest, opts ...grpc.CallOption) (*CloseRecommendationsResponse, error)
|
||||
RevenueReport(ctx context.Context, in *RevenueReportRequest, opts ...grpc.CallOption) (*RevenueReportResponse, error)
|
||||
ChannelInsights(ctx context.Context, in *ChannelInsightsRequest, opts ...grpc.CallOption) (*ChannelInsightsResponse, error)
|
||||
}
|
||||
|
||||
type governatorServerClient struct {
|
||||
type faradayServerClient struct {
|
||||
cc *grpc.ClientConn
|
||||
}
|
||||
|
||||
func NewGovernatorServerClient(cc *grpc.ClientConn) GovernatorServerClient {
|
||||
return &governatorServerClient{cc}
|
||||
func NewFaradayServerClient(cc *grpc.ClientConn) FaradayServerClient {
|
||||
return &faradayServerClient{cc}
|
||||
}
|
||||
|
||||
func (c *governatorServerClient) OutlierRecommendations(ctx context.Context, in *OutlierRecommendationsRequest, opts ...grpc.CallOption) (*CloseRecommendationsResponse, error) {
|
||||
func (c *faradayServerClient) OutlierRecommendations(ctx context.Context, in *OutlierRecommendationsRequest, opts ...grpc.CallOption) (*CloseRecommendationsResponse, error) {
|
||||
out := new(CloseRecommendationsResponse)
|
||||
err := c.cc.Invoke(ctx, "/gvnrpc.GovernatorServer/OutlierRecommendations", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, "/frdrpc.FaradayServer/OutlierRecommendations", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *governatorServerClient) ThresholdRecommendations(ctx context.Context, in *ThresholdRecommendationsRequest, opts ...grpc.CallOption) (*CloseRecommendationsResponse, error) {
|
||||
func (c *faradayServerClient) ThresholdRecommendations(ctx context.Context, in *ThresholdRecommendationsRequest, opts ...grpc.CallOption) (*CloseRecommendationsResponse, error) {
|
||||
out := new(CloseRecommendationsResponse)
|
||||
err := c.cc.Invoke(ctx, "/gvnrpc.GovernatorServer/ThresholdRecommendations", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, "/frdrpc.FaradayServer/ThresholdRecommendations", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *governatorServerClient) RevenueReport(ctx context.Context, in *RevenueReportRequest, opts ...grpc.CallOption) (*RevenueReportResponse, error) {
|
||||
func (c *faradayServerClient) RevenueReport(ctx context.Context, in *RevenueReportRequest, opts ...grpc.CallOption) (*RevenueReportResponse, error) {
|
||||
out := new(RevenueReportResponse)
|
||||
err := c.cc.Invoke(ctx, "/gvnrpc.GovernatorServer/RevenueReport", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, "/frdrpc.FaradayServer/RevenueReport", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *governatorServerClient) ChannelInsights(ctx context.Context, in *ChannelInsightsRequest, opts ...grpc.CallOption) (*ChannelInsightsResponse, error) {
|
||||
func (c *faradayServerClient) ChannelInsights(ctx context.Context, in *ChannelInsightsRequest, opts ...grpc.CallOption) (*ChannelInsightsResponse, error) {
|
||||
out := new(ChannelInsightsResponse)
|
||||
err := c.cc.Invoke(ctx, "/gvnrpc.GovernatorServer/ChannelInsights", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, "/frdrpc.FaradayServer/ChannelInsights", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// GovernatorServerServer is the server API for GovernatorServer service.
|
||||
type GovernatorServerServer interface {
|
||||
// FaradayServerServer is the server API for FaradayServer service.
|
||||
type FaradayServerServer interface {
|
||||
OutlierRecommendations(context.Context, *OutlierRecommendationsRequest) (*CloseRecommendationsResponse, error)
|
||||
ThresholdRecommendations(context.Context, *ThresholdRecommendationsRequest) (*CloseRecommendationsResponse, error)
|
||||
RevenueReport(context.Context, *RevenueReportRequest) (*RevenueReportResponse, error)
|
||||
ChannelInsights(context.Context, *ChannelInsightsRequest) (*ChannelInsightsResponse, error)
|
||||
}
|
||||
|
||||
func RegisterGovernatorServerServer(s *grpc.Server, srv GovernatorServerServer) {
|
||||
s.RegisterService(&_GovernatorServer_serviceDesc, srv)
|
||||
func RegisterFaradayServerServer(s *grpc.Server, srv FaradayServerServer) {
|
||||
s.RegisterService(&_FaradayServer_serviceDesc, srv)
|
||||
}
|
||||
|
||||
func _GovernatorServer_OutlierRecommendations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _FaradayServer_OutlierRecommendations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(OutlierRecommendationsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(GovernatorServerServer).OutlierRecommendations(ctx, in)
|
||||
return srv.(FaradayServerServer).OutlierRecommendations(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/gvnrpc.GovernatorServer/OutlierRecommendations",
|
||||
FullMethod: "/frdrpc.FaradayServer/OutlierRecommendations",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(GovernatorServerServer).OutlierRecommendations(ctx, req.(*OutlierRecommendationsRequest))
|
||||
return srv.(FaradayServerServer).OutlierRecommendations(ctx, req.(*OutlierRecommendationsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _GovernatorServer_ThresholdRecommendations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _FaradayServer_ThresholdRecommendations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ThresholdRecommendationsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(GovernatorServerServer).ThresholdRecommendations(ctx, in)
|
||||
return srv.(FaradayServerServer).ThresholdRecommendations(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/gvnrpc.GovernatorServer/ThresholdRecommendations",
|
||||
FullMethod: "/frdrpc.FaradayServer/ThresholdRecommendations",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(GovernatorServerServer).ThresholdRecommendations(ctx, req.(*ThresholdRecommendationsRequest))
|
||||
return srv.(FaradayServerServer).ThresholdRecommendations(ctx, req.(*ThresholdRecommendationsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _GovernatorServer_RevenueReport_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _FaradayServer_RevenueReport_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RevenueReportRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(GovernatorServerServer).RevenueReport(ctx, in)
|
||||
return srv.(FaradayServerServer).RevenueReport(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/gvnrpc.GovernatorServer/RevenueReport",
|
||||
FullMethod: "/frdrpc.FaradayServer/RevenueReport",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(GovernatorServerServer).RevenueReport(ctx, req.(*RevenueReportRequest))
|
||||
return srv.(FaradayServerServer).RevenueReport(ctx, req.(*RevenueReportRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _GovernatorServer_ChannelInsights_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _FaradayServer_ChannelInsights_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ChannelInsightsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(GovernatorServerServer).ChannelInsights(ctx, in)
|
||||
return srv.(FaradayServerServer).ChannelInsights(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/gvnrpc.GovernatorServer/ChannelInsights",
|
||||
FullMethod: "/frdrpc.FaradayServer/ChannelInsights",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(GovernatorServerServer).ChannelInsights(ctx, req.(*ChannelInsightsRequest))
|
||||
return srv.(FaradayServerServer).ChannelInsights(ctx, req.(*ChannelInsightsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
var _GovernatorServer_serviceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "gvnrpc.GovernatorServer",
|
||||
HandlerType: (*GovernatorServerServer)(nil),
|
||||
var _FaradayServer_serviceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "frdrpc.FaradayServer",
|
||||
HandlerType: (*FaradayServerServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "OutlierRecommendations",
|
||||
Handler: _GovernatorServer_OutlierRecommendations_Handler,
|
||||
Handler: _FaradayServer_OutlierRecommendations_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ThresholdRecommendations",
|
||||
Handler: _GovernatorServer_ThresholdRecommendations_Handler,
|
||||
Handler: _FaradayServer_ThresholdRecommendations_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "RevenueReport",
|
||||
Handler: _GovernatorServer_RevenueReport_Handler,
|
||||
Handler: _FaradayServer_RevenueReport_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ChannelInsights",
|
||||
Handler: _GovernatorServer_ChannelInsights_Handler,
|
||||
Handler: _FaradayServer_ChannelInsights_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
|
|
@ -2,9 +2,9 @@ syntax = "proto3";
|
|||
|
||||
import "google/api/annotations.proto";
|
||||
|
||||
package gvnrpc;
|
||||
package frdrpc;
|
||||
|
||||
service GovernatorServer {
|
||||
service FaradayServer {
|
||||
rpc OutlierRecommendations (OutlierRecommendationsRequest) returns (CloseRecommendationsResponse);
|
||||
rpc ThresholdRecommendations (ThresholdRecommendationsRequest) returns (CloseRecommendationsResponse);
|
||||
rpc RevenueReport (RevenueReportRequest) returns (RevenueReportResponse);
|
||||
|
|
@ -1,14 +1,13 @@
|
|||
// Package gvrpc contains the proto files, generated code and server logic
|
||||
// for the governator's grpc server which serves requests for close
|
||||
// recommendations.
|
||||
// Package frdrpc contains the proto files, generated code and server logic
|
||||
// for faraday's grpc server which serves requests for close recommendations.
|
||||
//
|
||||
// The Governator server interface is implemented by the RPCServer struct.
|
||||
// The Faraday server interface is implemented by the RPCServer struct.
|
||||
// To keep this file readable, each function implemented by the interface
|
||||
// has a file named after the function call which contains rpc parsing
|
||||
// code for the request and response. If the call requires extensive
|
||||
// additional logic, and unexported function with the same name should
|
||||
// be created in this file as well.
|
||||
package gvnrpc
|
||||
package frdrpc
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
|
@ -17,13 +16,13 @@ import (
|
|||
"sync"
|
||||
"sync/atomic"
|
||||
|
||||
"github.com/lightninglabs/governator/recommend"
|
||||
"github.com/lightninglabs/governator/revenue"
|
||||
"github.com/lightninglabs/faraday/recommend"
|
||||
"github.com/lightninglabs/faraday/revenue"
|
||||
"github.com/lightningnetwork/lnd/lnrpc"
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
// RPCServer implements the governator service, serving requests over grpc.
|
||||
// RPCServer implements the faraday service, serving requests over grpc.
|
||||
type RPCServer struct {
|
||||
// To be used atomically.
|
||||
started int32
|
||||
|
|
@ -103,7 +102,7 @@ func (s *RPCServer) Start() error {
|
|||
}
|
||||
s.rpcListener = grpcListener
|
||||
|
||||
RegisterGovernatorServerServer(s.grpcServer, s)
|
||||
RegisterFaradayServerServer(s.grpcServer, s)
|
||||
|
||||
s.wg.Add(1)
|
||||
go func() {
|
||||
2
go.mod
2
go.mod
|
|
@ -1,4 +1,4 @@
|
|||
module github.com/lightninglabs/governator
|
||||
module github.com/lightninglabs/faraday
|
||||
|
||||
require (
|
||||
github.com/btcsuite/btcd v0.20.1-beta
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ package insights
|
|||
import (
|
||||
"time"
|
||||
|
||||
"github.com/lightninglabs/governator/revenue"
|
||||
"github.com/lightninglabs/faraday/revenue"
|
||||
"github.com/lightningnetwork/lnd/lnrpc"
|
||||
"github.com/lightningnetwork/lnd/lnwire"
|
||||
)
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/lightninglabs/governator/revenue"
|
||||
"github.com/lightninglabs/faraday/revenue"
|
||||
"github.com/lightningnetwork/lnd/lnrpc"
|
||||
"github.com/lightningnetwork/lnd/lnwire"
|
||||
)
|
||||
|
|
|
|||
12
log.go
12
log.go
|
|
@ -1,11 +1,11 @@
|
|||
package governator
|
||||
package faraday
|
||||
|
||||
import (
|
||||
"github.com/btcsuite/btclog"
|
||||
"github.com/lightninglabs/governator/dataset"
|
||||
"github.com/lightninglabs/governator/gvnrpc"
|
||||
"github.com/lightninglabs/governator/recommend"
|
||||
"github.com/lightninglabs/governator/revenue"
|
||||
"github.com/lightninglabs/faraday/dataset"
|
||||
"github.com/lightninglabs/faraday/frdrpc"
|
||||
"github.com/lightninglabs/faraday/recommend"
|
||||
"github.com/lightninglabs/faraday/revenue"
|
||||
"github.com/lightningnetwork/lnd/build"
|
||||
)
|
||||
|
||||
|
|
@ -26,7 +26,7 @@ func init() {
|
|||
setSubLogger(Subsystem, log, nil)
|
||||
addSubLogger(recommend.Subsystem, recommend.UseLogger)
|
||||
addSubLogger(dataset.Subsystem, dataset.UseLogger)
|
||||
addSubLogger(gvnrpc.Subsystem, gvnrpc.UseLogger)
|
||||
addSubLogger(frdrpc.Subsystem, frdrpc.UseLogger)
|
||||
addSubLogger(revenue.Subsystem, revenue.UseLogger)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,8 +18,8 @@ import (
|
|||
"errors"
|
||||
"time"
|
||||
|
||||
"github.com/lightninglabs/governator/dataset"
|
||||
"github.com/lightninglabs/governator/insights"
|
||||
"github.com/lightninglabs/faraday/dataset"
|
||||
"github.com/lightninglabs/faraday/insights"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/lightninglabs/governator/dataset"
|
||||
"github.com/lightninglabs/governator/insights"
|
||||
"github.com/lightninglabs/faraday/dataset"
|
||||
"github.com/lightninglabs/faraday/insights"
|
||||
)
|
||||
|
||||
// TestCloseRecommendations tests CloseRecommendations for error cases where
|
||||
|
|
|
|||
10
release.sh
10
release.sh
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Simple bash script to build basic governator tools for all the platforms
|
||||
# Simple bash script to build basic faraday tools for all the platforms
|
||||
# we support with the golang cross-compiler.
|
||||
#
|
||||
# Copyright (c) 2016 Company 0, LLC.
|
||||
|
|
@ -20,7 +20,7 @@ fi
|
|||
go mod vendor
|
||||
tar -cvzf vendor.tar.gz vendor
|
||||
|
||||
PACKAGE=governator
|
||||
PACKAGE=faraday
|
||||
MAINDIR=$PACKAGE-$TAG
|
||||
mkdir -p $MAINDIR
|
||||
|
||||
|
|
@ -39,7 +39,7 @@ cd $MAINDIR
|
|||
SYS=${GOVBUILDSYS:-"windows-386 windows-amd64 openbsd-386 openbsd-amd64 linux-386 linux-amd64 linux-armv6 linux-armv7 linux-arm64 darwin-386 darwin-amd64 dragonfly-amd64 freebsd-386 freebsd-amd64 freebsd-arm netbsd-386 netbsd-amd64 linux-mips64 linux-mips64le linux-ppc64"}
|
||||
|
||||
# Set package and current commit.
|
||||
PKG="github.com/lightninglabs/governator"
|
||||
PKG="github.com/lightninglabs/faraday"
|
||||
COMMIT=$(git describe --abbrev=40 --dirty)
|
||||
COMMITFLAGS="-X $PKG.Commit=$COMMIT"
|
||||
|
||||
|
|
@ -60,8 +60,8 @@ for i in $SYS; do
|
|||
cd $PACKAGE-$i-$TAG
|
||||
|
||||
echo "Building:" $OS $ARCH $ARM
|
||||
env GOOS=$OS GOARCH=$ARCH GOARM=$ARM go build -v -ldflags "$COMMITFLAGS" github.com/lightninglabs/governator/cmd/governator
|
||||
env GOOS=$OS GOARCH=$ARCH GOARM=$ARM go build -v -ldflags "$COMMITFLAGS" github.com/lightninglabs/governator/cmd/gvncli
|
||||
env GOOS=$OS GOARCH=$ARCH GOARM=$ARM go build -v -ldflags "$COMMITFLAGS" github.com/lightninglabs/faraday/cmd/faraday
|
||||
env GOOS=$OS GOARCH=$ARCH GOARM=$ARM go build -v -ldflags "$COMMITFLAGS" github.com/lightninglabs/faraday/cmd/frcli
|
||||
cd ..
|
||||
|
||||
if [[ $OS = "windows" ]]; then
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
// Heavily inspired by https://github.com/btcsuite/btcd/blob/master/version.go
|
||||
// Copyright (C) 2015-2020 The Lightning Network Developers
|
||||
|
||||
package governator
|
||||
package faraday
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue