# Faraday

Welcome to the API reference documentation for Faraday.

Faraday is a suite of tools built to help node operators and businesses run [lnd](https://github.com/lightningnetwork/lnd), the leading implementation of the [Lightning Network](https://github.com/lightningnetwork/lightning-rfc). Faraday’s tools decrease the operational overhead of running a Lightning node and make it easier to build businesses on Lightning. The current features in the Faraday suite provide insight into node channel performance and support for accounting with both on-chain and off-chain reports for lnd.

## Usage

Learn how to install, configure, and use Faraday by viewing the documentation in the [Builder's Guide](https://docs.lightning.engineering/lightning-network-tools/faraday/get-started).

## Summary

This site features the documentation for `frcli` (CLI), and the API documentation for Python and JavaScript clients in order to communicate with a local `faraday` instance through gRPC.

## gRPC

The code samples assume that there is a local `faraday` instance running and listening for gRPC connections on port `8465`. `FARADAY_DIR` will be used as a placeholder to denote the base directory of the `faraday` instance. By default, this is `~/.faraday` on Linux and `~/Library/Application Support/Faraday` on macOS.

At the time of writing this documentation, two things are needed in order to make a gRPC request to a `faraday` instance: a TLS/SSL connection and a macaroon used for RPC authentication. The code samples will show how these can be used in order to make a successful, secure, and authenticated gRPC request.

The original `*.proto` files from which the gRPC documentation was generated can be found here:

- [`faraday.proto`](https://github.com/lightninglabs/faraday/blob/cc63a340ead288c5a4ff71b9708fd404121a2325/frdrpc/faraday.proto)

## REST

View a listing of all REST URLs on the [REST Endpoints](/content/api-docs/api/faraday/rest-endpoints/index.html) page.

The code samples assume that there is a local `faraday` instance running and listening for REST connections on port `8082`. `FARADAY_DIR` will be used as a placeholder to denote the base directory of the `faraday` instance. By default, this is `~/.faraday` on Linux and `~/Library/Application Support/Faraday` on macOS.

At the time of writing this documentation, two things are needed in order to make an HTTP request to a `faraday` instance: a TLS/SSL connection and a macaroon used for RPC authentication. The code samples will show how these can be used in order to make a successful, secure, and authenticated HTTP request.

The original `*.swagger.json` files from which the gRPC documentation was generated can be found here:

- [`faraday.swagger.json`](https://github.com/lightninglabs/faraday/blob/cc63a340ead288c5a4ff71b9708fd404121a2325/frdrpc/faraday.swagger.json)

### REST Encoding

**NOTE**: The `byte` field type must be set as the base64 encoded string representation of a raw byte array. Also, any time this must be used in a URL path (ie. `/v1/abc/xyz/{payment_hash}`) the base64 string must be encoded using a [URL and Filename Safe Alphabet](https://tools.ietf.org/html/rfc4648#section-5). This means you must replace `+` with `-`, `/` with `_`, and keep the trailing `=` as is. Url encoding (ie. `%2F`) will not work.

This documentation was [generated automatically](https://github.com/lightninglabs/lightning-api-ng) against commit [`cc63a340ead288c5a4ff71b9708fd404121a2325`](https://github.com/lightninglabs/faraday/tree/cc63a340ead288c5a4ff71b9708fd404121a2325).
