Ver Fonte

add geth's ipc endpoint and passphrase to cashierd config file

ghassmo há 4 anos atrás
pai
commit
c7656df4e8

+ 6 - 0
example/config/cashierd.toml

@@ -47,6 +47,12 @@ client_wallet_password = "TEST_PASSWORD"
 # Path to database
 database_path = "~/.config/darkfi/cashier_database.db"
 
+# Geth IPC endpoint 
+geth_socket= "~/.ethereum/ropsten/geth.ipc"
+
+# Geth passphrase 
+geth_passphrase= "TEST_PASS"
+
 # The configured networks to use.
 [[networks]]
 name = "sol"

+ 6 - 0
example/config_local/cashierd.toml

@@ -47,6 +47,12 @@ client_wallet_password = "TEST_PASSWORD"
 # Path to database
 database_path = "~/.config/darkfi/localdata/cashier_database.db"
 
+# Geth IPC endpoint 
+geth_socket= "~/.ethereum/ropsten/geth.ipc"
+
+# Geth passphrase 
+geth_passphrase= "TEST_PASS"
+
 # The configured networks to use.
 [[networks]]
 name = "sol"

+ 3 - 3
src/bin/cashierd.rs

@@ -499,7 +499,7 @@ impl Cashierd {
                     return Ok(Some(_token_id.to_string()));
                 }
                 Ok(None)
-            },
+            }
             #[cfg(feature = "btc")]
             NetworkName::Bitcoin => Ok(None),
             _ => Err(Error::NotSupportedNetwork),
@@ -572,10 +572,10 @@ impl Cashierd {
                     let main_keypairs =
                         self.cashier_wallet.get_main_keys(&NetworkName::Ethereum)?;
 
-                    let passphrase = String::from("TEST_PASS");
+                    let passphrase = self.config.geth_passphrase.clone();
 
                     let mut eth_client = EthClient::new(
-                        expand_path("~/.ethereum/ropsten/geth.ipc")?
+                        expand_path(&self.config.geth_socket)?
                             .to_str()
                             .unwrap()
                             .into(),

+ 4 - 0
src/cli/cli_config.rs

@@ -145,6 +145,10 @@ pub struct CashierdConfig {
     pub client_wallet_password: String,
     /// Path to database
     pub database_path: String,
+    /// Geth IPC endpoint 
+    pub geth_socket: String,
+    /// Geth passphrase 
+    pub geth_passphrase: String,
     /// The configured networks to use
     pub networks: Vec<FeatureNetwork>,
 }