No description
Find a file
Joost Jager 3aad15ca27
itest: add itest setup with two lnd nodes and a single faraday instance
This commit adds an itest setup which can be used to test faraday's rpc.
The setup is largely copied from our existing loop server itests.
2020-08-12 11:42:09 +02:00
accounting accounting: export fee reference for itests 2020-08-12 11:37:42 +02:00
chain multi: optionally connect faraday to a bitcoin node 2020-06-27 14:47:20 +02:00
cmd frdrpc: surface bitcoin price and timestamp in report 2020-07-22 16:41:33 +02:00
dataset mutli: update line wrap to 80 2020-02-11 22:37:26 +02:00
fees multi: separate fees out into own package and move special case check 2020-08-12 11:14:53 +02:00
fiat multi: switchover fiat to use timestamped bitcoin prices and rename 2020-07-22 16:41:17 +02:00
frdrpc frdrpc: add logging for each rpc call 2020-08-12 11:37:43 +02:00
insights multi: point to new lndclient repo 2020-06-18 16:45:59 +02:00
itest itest: add itest setup with two lnd nodes and a single faraday instance 2020-08-12 11:42:09 +02:00
lndwrap multi: move lnd wrapping into package 2020-06-26 08:44:07 +02:00
make multi: Add makefile 2019-11-05 08:45:34 +02:00
paginater multi: extract pagination logic into separate pagination package 2020-05-25 13:49:20 +02:00
recommend multi: faraday rename 2020-03-30 09:25:46 +02:00
resolutions multi: separate fees out into own package and move special case check 2020-08-12 11:14:53 +02:00
revenue multi: point to new lndclient repo 2020-06-18 16:45:59 +02:00
scripts frdrpc+travis: update protobuf version to match lnd 2020-06-17 10:41:58 +02:00
utils utils: add time range validation function for general use 2020-04-29 09:17:08 +02:00
.gitignore itest: add itest setup with two lnd nodes and a single faraday instance 2020-08-12 11:42:09 +02:00
.golangci.yml terminator: query for recommendations on startup 2019-12-19 15:45:38 +02:00
.travis.yml makefile+travis: add mod check 2020-04-07 14:11:49 +02:00
config.go config: add version flag 2020-08-11 10:07:16 +02:00
Dockerfile multi: faraday rename 2020-03-30 09:25:46 +02:00
faraday.go accounting: add pending channels to on chain report 2020-08-12 11:14:49 +02:00
go.mod accounting: add pending channels to on chain report 2020-08-12 11:14:49 +02:00
go.sum accounting: add pending channels to on chain report 2020-08-12 11:14:49 +02:00
LICENSE readme: update license and remove status 2020-03-10 11:02:03 +02:00
log.go accounting: fallback to payment request for payments without htlcs 2020-06-29 10:56:20 +02:00
Makefile itest: add itest setup with two lnd nodes and a single faraday instance 2020-08-12 11:42:09 +02:00
README.md multi: connect faraday to lnd services rather than lnd client 2020-06-17 09:42:55 +02:00
release.sh multi: faraday rename 2020-03-30 09:25:46 +02:00
run_itest.sh itest: add itest setup with two lnd nodes and a single faraday instance 2020-08-12 11:42:09 +02:00
version.go version: bump to 0.2.0-alpha 2020-06-05 11:20:01 +02:00

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.

LND

Note that Faraday requires lnd to be built with all of its subservers and requires running at least v0.10.1. Please see the instructions in the lnd repo for more detailed installation instructions. You will need to build lnd with the following command to enable all the relevant subservers:

make install tags="signrpc walletrpc chainrpc invoicesrpc"

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 macaroons for each subserver 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}   \
--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