Skip to content

Commit 4dccab6

Browse files
committed
README: describe custom scoped macaroon
1 parent 28d3c34 commit 4dccab6

File tree

1 file changed

+26
-11
lines changed

1 file changed

+26
-11
lines changed

README.md

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,27 @@ Faraday is a suite of tools built to help node operators and businesses run [lnd
66
## LND
77
Note that Faraday requires lnd to be built with **all of its subservers** and requires running at least v0.11.1. Download the [official release binary](https://github.com/lightningnetwork/lnd/releases/tag/v0.11.1-beta) or see the [instructions](https://github.com/lightningnetwork/lnd/blob/master/docs/INSTALL.md) in the lnd repo for more detailed installation instructions. If you choose to build lnd from source, following command to enable all the relevant subservers:
88

9-
```
9+
```shell
1010
make install tags="signrpc walletrpc chainrpc invoicesrpc"
1111
```
1212

1313

1414
## Installation
1515
A [Makefile](https://github.com/lightninglabs/faraday/blob/master/Makefile) is provided. To install faraday and all its dependencies, run:
1616

17-
```
17+
```shell
1818
git clone https://github.com/lightninglabs/faraday.git
1919
cd faraday
2020
make && make install
2121
```
2222

2323
## Usage
24-
Faraday connects to a single instance of lnd. It requires access to `lnd`'s `admin.macaroon` and a valid TLS certificate. It will attempt to use the default `lnd` values if no command line flags are specified.
25-
```
24+
Faraday connects to a single instance of lnd. It requires access to `lnd`'s
25+
`admin.macaroon` (or a custom scoped macaroon, see below) and a valid TLS
26+
certificate. It will attempt to use the default `lnd` values if no command line
27+
flags are specified.
28+
29+
```shell
2630
./faraday \
2731
--lnd.macaroonpath={full path to lnd's admin.macaroon} \
2832
--lnd.tlscertpath={path to lnd cert} \
@@ -32,6 +36,17 @@ Faraday connects to a single instance of lnd. It requires access to `lnd`'s `adm
3236
By default, faraday runs on mainnet. The `--network` flag can be used to run in
3337
test environments.
3438

39+
### Baking a custom macaroon for Faraday
40+
41+
Faraday needs to derive a shared key with `lnd` to create an encryption password
42+
for its macaroon database. That's why on top of the permissions in the
43+
`readonly.macaroon` the `uri:/signrpc.Signer/DeriveSharedKey` is also required.
44+
A custom scoped macaroon just for Faraday can be baked with:
45+
46+
```shell
47+
lncli bakemacaroon onchain:read offchain:read address:read peers:read info:read invoices:read uri:/signrpc.Signer/DeriveSharedKey
48+
```
49+
3550
## Authentication and transport security
3651

3752
The gRPC and REST connections of `faraday` are encrypted with TLS and secured
@@ -56,15 +71,15 @@ cannot be used for both `faraday` and `lnd`.
5671
Faraday offers node accounting services which require access to a Bitcoin node with `--txindex` set so that it can perform transaction lookup. Currently the `CloseReport` endpoint requires this connection, and will fail if it is not present. It is *strongly recommended* to provide this connection when utilizing the `NodeAudit` endpoint, but it is not required. This connection is *optional*, and all other endpoints will function if it is not configured.
5772

5873
To connect Faraday to bitcoind:
59-
```
74+
```text
6075
--connect_bitcoin \
6176
--bitcoin.host={host:port of bitcoind} \
6277
--bitcoin.user={bitcoind username} \
6378
--bitcoin.password={bitcoind password}
6479
```
6580

6681
To connect Faraday to btcd:
67-
```
82+
```text
6883
--connect_bitcoin \
6984
--bitcoin.host={host:port of btcd} \
7085
--bitcoin.user={btcd username} \
@@ -75,14 +90,14 @@ To connect Faraday to btcd:
7590

7691
#### RPCServer
7792
Faraday serves requests over grpc by default on `localhost:8465`. This default can be overwritten:
78-
```
93+
```text
7994
--rpclisten={host:port to listen for requests}
8095
```
8196

8297
#### Cli Tool
8398
The RPC server can be conveniently accessed using a command line tool.
8499
1. Run faraday as detailed above
85-
```
100+
```shell
86101
./frcli {command}
87102
```
88103

@@ -108,15 +123,15 @@ If you would like to contribute to Faraday, please see our [issues page](https:/
108123

109124
### Tests
110125
To run all the unit tests in the repo:
111-
```
126+
```shell
112127
make check
113128
```
114129
To run Faraday's itests locally, you will need docker installed. To run all itests:
115-
```
130+
```shell
116131
make itest
117132
```
118133

119134
Individual itests can also be run using:
120-
```
135+
```shell
121136
./run_itest.sh {test name}
122137
```

0 commit comments

Comments
 (0)