{"id":18396169,"url":"https://github.com/lightningdevkit/rapid-gossip-sync-server","last_synced_at":"2025-04-07T04:32:39.024Z","repository":{"id":41446428,"uuid":"494302037","full_name":"lightningdevkit/rapid-gossip-sync-server","owner":"lightningdevkit","description":null,"archived":false,"fork":false,"pushed_at":"2025-01-31T20:16:51.000Z","size":311,"stargazers_count":26,"open_issues_count":5,"forks_count":24,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-03-22T13:22:37.702Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lightningdevkit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-05-20T03:02:47.000Z","updated_at":"2025-03-19T15:49:51.000Z","dependencies_parsed_at":"2024-11-06T02:13:49.427Z","dependency_job_id":"c5c47c5a-517a-4807-80e5-dc0fb01389e4","html_url":"https://github.com/lightningdevkit/rapid-gossip-sync-server","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lightningdevkit%2Frapid-gossip-sync-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lightningdevkit%2Frapid-gossip-sync-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lightningdevkit%2Frapid-gossip-sync-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lightningdevkit%2Frapid-gossip-sync-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lightningdevkit","download_url":"https://codeload.github.com/lightningdevkit/rapid-gossip-sync-server/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247595068,"owners_count":20963939,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T02:13:01.523Z","updated_at":"2025-04-07T04:32:39.018Z","avatar_url":"https://github.com/lightningdevkit.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rapid-gossip-sync-server\n\nThis is a server that connects to peers on the Lightning network and calculates compact rapid sync\ngossip data.\n\nThese are the components it's comprised of.\n\n## Demo Server\n\nTo experiment with a local instance of the RGS server, navigate to the cache directory specified using\nthe `RAPID_GOSSIP_SYNC_SERVER_CACHES_PATH` environment variable (`./res` by default) and therein to the `symlinks`\nsubdirectory:\n\n```\n\u003ccache_path\u003e/symlinks\n```\n\nFrom there, simply run:\n\n```shell\npython3 -m http.server 8011\n```\n\nThe snapshots will be accessible via `http://localhost:8011/{timestamp}.bin`. The first timestamp value should be 0,\nand subsequent timestamps will be extracted from the snapshots themselves by the RGS client.\n\nNote that this is pretty much the same functionality you would need in a production environment, except hopefully using\nsomething more robust than Python's `http.server` module.\n\n## Modules\n\n### config\n\nA config file where the Postgres credentials and Lightning peers can be adjusted. Most adjustments\ncan be made by setting environment variables, whose usage is as follows:\n\n| Name                                       | Default             | Description                                                                                                |\n|:-------------------------------------------|:--------------------|:-----------------------------------------------------------------------------------------------------------|\n| RAPID_GOSSIP_SYNC_SERVER_DB_HOST           | localhost           | Domain of the Postgres database                                                                            |\n| RAPID_GOSSIP_SYNC_SERVER_DB_USER           | alice               | Username to access Postgres                                                                                |\n| RAPID_GOSSIP_SYNC_SERVER_DB_PASSWORD       | _None_              | Password to access Postgres                                                                                |\n| RAPID_GOSSIP_SYNC_SERVER_DB_NAME           | ln_graph_sync       | Name of the database to be used for gossip storage                                                         |\n| RAPID_GOSSIP_SYNC_SERVER_NETWORK           | mainnet             | Network to operate in. Possible values are mainnet, testnet, signet, regtest                               |\n| RAPID_GOSSIP_SYNC_SERVER_SNAPSHOT_INTERVAL | 10800               | The interval in seconds between snapshots                                                                  |\n| BITCOIN_REST_DOMAIN                        | 127.0.0.1           | Domain of the [bitcoind REST server](https://github.com/bitcoin/bitcoin/blob/master/doc/REST-interface.md) |\n| BITCOIN_REST_PORT                          | 8332                | HTTP port of the bitcoind REST server                                                                      |\n| BITCOIN_REST_PATH                          | /rest/              | Path infix to access the bitcoind REST endpoints                                                           |\n| LN_PEERS                                   | _Wallet of Satoshi_ | Comma separated list of LN peers to use for retrieving gossip                                              |\n\n### downloader\n\nThe module responsible for initiating the scraping of the network graph from its peers.\n\n### persistence\n\nThe module responsible for persisting all the downloaded graph data to Postgres.\n\n### snapshot\n\nThe snapshotting module is responsible for calculating and storing snapshots. It's started up\nas soon as the first full graph sync completes, and then keeps updating the snapshots at a\nconfigurable interval with a 3-hour-default.\n\n### lookup\n\nThe lookup module is responsible for fetching the latest data from the network graph and Postgres,\nand reconciling it into an actionable delta set that the server can return in a serialized format.\n\nIt works by collecting all the channels that are currently in the network graph, and gathering\nannouncements as well as updates for each of them. For the updates specifically, the last update\nseen prior to the given timestamp, the latest known updates, and, if necessary, all intermediate\nupdates are collected.\n\nThen, any channel that has only had an announcement but never an update is dropped. Additionally,\nevery channel whose first update was seen after the given timestamp is collected alongside its\nannouncement.\n\nFinally, all channel update transitions are evaluated and collected into either a full or an\nincremental update.\n\n## License\n\n[Apache 2.0](LICENSE-APACHE.md) or [MIT](LICENSE-MIT.md), [at your option](LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flightningdevkit%2Frapid-gossip-sync-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flightningdevkit%2Frapid-gossip-sync-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flightningdevkit%2Frapid-gossip-sync-server/lists"}