faraday

package module
v0.1.0-alpha Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 30, 2020 License: MIT Imports: 13 Imported by: 2

README

faraday

MIT licensed

Faraday is an external service intended to be run in conjunction with the lnd implementation of the Lightning Network. It queries LND for information about its existing channels and provides channel close recommendations if channels are under-performing.

Installation

A Makefile is provided. To install faraday and all its dependencies, run:

go get -d github.com/lightninglabs/faraday
cd $GOPATH/src/github.com/lightninglabs/faraday
make && make install
Tests

To run all the unit tests in the repo, use:

make check

Usage

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.

./faraday                                    \
--macaroondir={directory containing macaroon}   \
--macaroonfile={macaroon with read permissions} \
--tlscertpath={path to lnd cert}                \
--rpserver={host:port of lnd's rpserver} 

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

RPCServer

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 faraday as detailed above
./frcli {command}
Commands
  • insights: expose metrics gathered for one or many channels.
  • revenue: generate a revenue report over a time period for one or many channels.
  • outliers: close recommendations based whether channels are outliers based on a variety of metrics.
  • threshold: close recommendations based on thresholds a variety of metrics.
Metrics currently tracked

The following metrics are tracked in faraday and exposed via insights and used for outliers and threshold close recommendations.

  • Uptime
  • Revenue
  • Total Volume
  • Incoming Volume
  • Outgoing Volume

Documentation

Overview

Package faraday contains the main function for faraday.

Index

Constants

View Source
const Subsystem = "FRDY"

Subsystem defines the logging code for this subsystem.

Variables

View Source
var Commit string

Commit stores the current commit hash of this build, this should be set using the -ldflags during compilation.

Functions

func Main

func Main() error

Main is the real entry point for faraday. It is required to ensure that defers are properly executed when os.Exit() is called.

func UseLogger

func UseLogger(logger btclog.Logger)

UseLogger uses a specified Logger to output package logging info. This should be used in preference to SetLogWriter if the caller is also using btclog.

func Version

func Version() string

Version returns the application version as a properly formed string per the semantic versioning 2.0.0 spec (http://semver.org/).

Types

This section is empty.

Directories

Path Synopsis
cmd
Package dataset provides a basic dataset type which provides functionality for detecting inter-quartile range outliers.
Package dataset provides a basic dataset type which provides functionality for detecting inter-quartile range outliers.
Package frdrpc contains the proto files, generated code and server logic for faraday'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.
Package recommend provides recommendations for closing channels with the constraints provided in its close recommendation config.
Package recommend provides recommendations for closing channels with the constraints provided in its close recommendation config.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL