Fix unused `Result` in tests
[rapid-gossip-sync-server] / README.md
1 # rapid-gossip-sync-server
2
3 This is a server that connects to peers on the Lightning network and calculates compact rapid sync
4 gossip data.
5
6 These are the components it's comprised of.
7
8 ## Modules
9
10 ### config
11
12 A config file where the Postgres credentials and Lightning peers can be adjusted. Most adjustments
13 can be made by setting environment variables, whose usage is as follows:
14
15 | Name                                       | Default             | Description                                                                                                |
16 |:-------------------------------------------|:--------------------|:-----------------------------------------------------------------------------------------------------------|
17 | RAPID_GOSSIP_SYNC_SERVER_DB_HOST           | localhost           | Domain of the Postgres database                                                                            |
18 | RAPID_GOSSIP_SYNC_SERVER_DB_USER           | alice               | Username to access Postgres                                                                                |
19 | RAPID_GOSSIP_SYNC_SERVER_DB_PASSWORD       | _None_              | Password to access Postgres                                                                                |
20 | RAPID_GOSSIP_SYNC_SERVER_DB_NAME           | ln_graph_sync       | Name of the database to be used for gossip storage                                                         |
21 | RAPID_GOSSIP_SYNC_SERVER_NETWORK           | mainnet             | Network to operate in. Possible values are mainnet, testnet, signet, regtest                               |
22 | RAPID_GOSSIP_SYNC_SERVER_SNAPSHOT_INTERVAL | 10800               | The interval in seconds between snapshots                                                                  |
23 | BITCOIN_REST_DOMAIN                        | 127.0.0.1           | Domain of the [bitcoind REST server](https://github.com/bitcoin/bitcoin/blob/master/doc/REST-interface.md) |
24 | BITCOIN_REST_PORT                          | 8332                | HTTP port of the bitcoind REST server                                                                      |
25 | BITCOIN_REST_PATH                          | /rest/              | Path infix to access the bitcoind REST endpoints                                                           |
26 | LN_PEERS                                   | _Wallet of Satoshi_ | Comma separated list of LN peers to use for retrieving gossip                                              |
27
28 ### downloader
29
30 The module responsible for initiating the scraping of the network graph from its peers.
31
32 ### persistence
33
34 The module responsible for persisting all the downloaded graph data to Postgres.
35
36 ### snapshot
37
38 The snapshotting module is responsible for calculating and storing snapshots. It's started up
39 as soon as the first full graph sync completes, and then keeps updating the snapshots at a
40 configurable interval with a 3-hour-default.
41
42 ### lookup
43
44 The lookup module is responsible for fetching the latest data from the network graph and Postgres,
45 and reconciling it into an actionable delta set that the server can return in a serialized format.
46
47 It works by collecting all the channels that are currently in the network graph, and gathering
48 announcements as well as updates for each of them. For the updates specifically, the last update
49 seen prior to the given timestamp, the latest known updates, and, if necessary, all intermediate
50 updates are collected.
51
52 Then, any channel that has only had an announcement but never an update is dropped. Additionally,
53 every channel whose first update was seen after the given timestamp is collected alongside its
54 announcement.
55
56 Finally, all channel update transitions are evaluated and collected into either a full or an
57 incremental update.
58
59 ## License
60
61 [Apache 2.0](LICENSE-APACHE.md) or [MIT](LICENSE-MIT.md), [at your option](LICENSE.md).