Rename environment variables to reflect the name of this project.
authorArik Sosman <git@arik.io>
Tue, 23 Aug 2022 00:46:14 +0000 (17:46 -0700)
committerArik Sosman <git@arik.io>
Tue, 23 Aug 2022 02:58:02 +0000 (19:58 -0700)
README.md
src/config.rs

index 2efb27d3df0e1ee33d7b5c890960b2e6bf118c65..b8cbfe7deb48e1e7e5b162d8bbb25db501cab6be 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# rust-ln-sync
+# rapid-gossip-sync-server
 
 This is a server that connects to peers on the Lightning network and calculates compact rapid sync
 gossip data.
@@ -12,15 +12,15 @@ These are the components it's comprised of.
 A config file where the Postgres credentials and Lightning peers can be adjusted. Most adjustments
 can be made by setting environment variables, whose usage is as follows:
 
-| Name                     | Default       | Description                                                                                                |
-|:-------------------------|:--------------|:-----------------------------------------------------------------------------------------------------------|
-| RUST_LN_SYNC_DB_HOST     | localhost     | Domain of the Postgres database                                                                            |
-| RUST_LN_SYNC_DB_USER     | alice         | Username to access Postgres                                                                                |
-| RUST_LN_SYNC_DB_PASSWORD | _None_        | Password to access Postgres                                                                                |
-| RUST_LN_SYNC_DB_NAME     | ln_graph_sync | Name of the database to be used for gossip storage                                                         |
-| BITCOIN_REST_DOMAIN      | 127.0.0.1     | Domain of the [bitcoind REST server](https://github.com/bitcoin/bitcoin/blob/master/doc/REST-interface.md) |
-| BITCOIN_REST_PORT        | 80            | HTTP port of the bitcoind REST server                                                                      |
-| BITCOIN_REST_PATH        | /rest/        | Path infix to access the bitcoind REST endpoints                                                           |
+| Name                                 | Default       | Description                                                                                                |
+|:-------------------------------------|:--------------|:-----------------------------------------------------------------------------------------------------------|
+| RAPID_GOSSIP_SYNC_SERVER_DB_HOST     | localhost     | Domain of the Postgres database                                                                            |
+| RAPID_GOSSIP_SYNC_SERVER_DB_USER     | alice         | Username to access Postgres                                                                                |
+| RAPID_GOSSIP_SYNC_SERVER_DB_PASSWORD | _None_        | Password to access Postgres                                                                                |
+| RAPID_GOSSIP_SYNC_SERVER_DB_NAME     | ln_graph_sync | Name of the database to be used for gossip storage                                                         |
+| BITCOIN_REST_DOMAIN                  | 127.0.0.1     | Domain of the [bitcoind REST server](https://github.com/bitcoin/bitcoin/blob/master/doc/REST-interface.md) |
+| BITCOIN_REST_PORT                    | 80            | HTTP port of the bitcoind REST server                                                                      |
+| BITCOIN_REST_PATH                    | /rest/        | Path infix to access the bitcoind REST endpoints                                                           |
 
 Notably, one property needs to be modified in code, namely the `ln_peers()` method. It specifies how
 many and which peers to use for retrieving gossip.
index 4d44efe8e02ae7f43ec667dd9db35e3e605a8f45..9289945497255825f6673deb8e0745c19cb66779 100644 (file)
@@ -15,13 +15,13 @@ pub(crate) fn network_graph_cache_path() -> &'static str {
 
 pub(crate) fn db_connection_config() -> Config {
        let mut config = Config::new();
-       let host = env::var("RUST_LN_SYNC_DB_HOST").unwrap_or("localhost".to_string());
-       let user = env::var("RUST_LN_SYNC_DB_USER").unwrap_or("alice".to_string());
-       let db = env::var("RUST_LN_SYNC_DB_NAME").unwrap_or("ln_graph_sync".to_string());
+       let host = env::var("RAPID_GOSSIP_SYNC_SERVER_DB_HOST").unwrap_or("localhost".to_string());
+       let user = env::var("RAPID_GOSSIP_SYNC_SERVER_DB_USER").unwrap_or("alice".to_string());
+       let db = env::var("RAPID_GOSSIP_SYNC_SERVER_DB_NAME").unwrap_or("ln_graph_sync".to_string());
        config.host(&host);
        config.user(&user);
        config.dbname(&db);
-       if let Ok(password) = env::var("RUST_LN_SYNC_DB_PASSWORD") {
+       if let Ok(password) = env::var("RAPID_GOSSIP_SYNC_SERVER_DB_PASSWORD") {
                config.password(&password);
        }
        config