Skip to content

Commit

Permalink
remove daemonize from config
Browse files Browse the repository at this point in the history
  • Loading branch information
edouardparis committed Nov 18, 2024
1 parent c8112ab commit c14c55b
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 27 deletions.
3 changes: 0 additions & 3 deletions contrib/lianad_config_example.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# Whether to run the process as a UNIX daemon (double fork magic)
daemon = false

# (Optional) Path to the folder where we should store the application data.
# Defaults to `.lianad` in your home folder.
data_dir = "/home/wizardsardine/.lianad"
Expand Down
19 changes: 0 additions & 19 deletions liana/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,6 @@ fn default_poll_interval() -> Duration {
Duration::from_secs(30)
}

#[cfg(unix)]
fn default_daemon() -> bool {
false
}

/// Bitcoin backend config.
#[derive(Debug, Clone, Deserialize, Serialize)]
pub enum BitcoinBackend {
Expand Down Expand Up @@ -153,10 +148,6 @@ pub struct BitcoinConfig {
pub struct Config {
/// An optional custom data directory
pub data_dir: Option<PathBuf>,
/// Whether to daemonize the process
#[cfg(unix)]
#[serde(default = "default_daemon")]
pub daemon: bool,
/// What messages to log
#[serde(
deserialize_with = "deserialize_fromstr",
Expand Down Expand Up @@ -303,7 +294,6 @@ mod tests {
// A valid config
let toml_str = r#"
data_dir = "/home/wizardsardine/custom/folder/"
daemon = false
log_level = "debug"
main_descriptor = "wsh(andor(pk([aabbccdd]tpubDEN9WSToTyy9ZQfaYqSKfmVqmq1VVLNtYfj3Vkqh67et57eJ5sTKZQBkHqSwPUsoSskJeaYnPttHe2VrkCsKA27kUaN9SDc5zhqeLzKa1rr/<0;1>/*),older(10000),pk([aabbccdd]tpubD8LYfn6njiA2inCoxwM7EuN3cuLVcaHAwLYeups13dpevd3nHLRdK9NdQksWXrhLQVxcUZRpnp5CkJ1FhE61WRAsHxDNAkvGkoQkAeWDYjV/<0;1>/*)))#dw4ulnrs"
Expand All @@ -318,11 +308,9 @@ mod tests {
toml::from_str::<Config>(&toml_str).expect("Deserializing toml_str");

// A valid, round-tripping, config
#[cfg(unix)] // On non-UNIX there is no 'daemon' member.
{
let toml_str = r#"
data_dir = '/home/wizardsardine/custom/folder/'
daemon = false
log_level = 'TRACE'
main_descriptor = 'wsh(andor(pk([aabbccdd]tpubDEN9WSToTyy9ZQfaYqSKfmVqmq1VVLNtYfj3Vkqh67et57eJ5sTKZQBkHqSwPUsoSskJeaYnPttHe2VrkCsKA27kUaN9SDc5zhqeLzKa1rr/<0;1>/*),older(10000),pk([aabbccdd]tpubD8LYfn6njiA2inCoxwM7EuN3cuLVcaHAwLYeups13dpevd3nHLRdK9NdQksWXrhLQVxcUZRpnp5CkJ1FhE61WRAsHxDNAkvGkoQkAeWDYjV/<0;1>/*)))#dw4ulnrs'
Expand All @@ -340,12 +328,9 @@ mod tests {
}

// A valid, round-tripping, config for a Taproot descriptor.

#[cfg(unix)] // On non-UNIX there is no 'daemon' member.
{
let toml_str = r#"
data_dir = '/home/wizardsardine/custom/folder/'
daemon = false
log_level = 'TRACE'
main_descriptor = 'tr([abcdef01]xpub6Eze7yAT3Y1wGrnzedCNVYDXUqa9NmHVWck5emBaTbXtURbe1NWZbK9bsz1TiVE7Cz341PMTfYgFw1KdLWdzcM1UMFTcdQfCYhhXZ2HJvTW/<0;1>/*,and_v(v:pk([abcdef01]xpub688Hn4wScQAAiYJLPg9yH27hUpfZAUnmJejRQBCiwfP5PEDzjWMNW1wChcninxr5gyavFqbbDjdV1aK5USJz8NDVjUy7FRQaaqqXHh5SbXe/<0;1>/*),older(52560)))#0mt7e93c'
Expand All @@ -363,11 +348,9 @@ mod tests {
}

// A valid, round-tripping, config with `auth` instead of `cookie_path`
#[cfg(unix)] // On non-UNIX there is no 'daemon' member.
{
let toml_str = r#"
data_dir = '/home/wizardsardine/custom/folder/'
daemon = false
log_level = 'TRACE'
main_descriptor = 'wsh(andor(pk([aabbccdd]tpubDEN9WSToTyy9ZQfaYqSKfmVqmq1VVLNtYfj3Vkqh67et57eJ5sTKZQBkHqSwPUsoSskJeaYnPttHe2VrkCsKA27kUaN9SDc5zhqeLzKa1rr/<0;1>/*),older(10000),pk([aabbccdd]tpubD8LYfn6njiA2inCoxwM7EuN3cuLVcaHAwLYeups13dpevd3nHLRdK9NdQksWXrhLQVxcUZRpnp5CkJ1FhE61WRAsHxDNAkvGkoQkAeWDYjV/<0;1>/*)))#dw4ulnrs'
Expand All @@ -386,7 +369,6 @@ mod tests {

// Invalid desc checksum
let toml_str = r#"
daemon = false
log_level = "trace"
data_dir = "/home/wizardsardine/custom/folder/"
Expand All @@ -405,7 +387,6 @@ mod tests {

// Not enough parameters: missing the Bitcoin network
let toml_str = r#"
daemon = false
log_level = "trace"
data_dir = "/home/wizardsardine/custom/folder/"
Expand Down
2 changes: 0 additions & 2 deletions liana/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -827,8 +827,6 @@ mod tests {
bitcoin_config,
bitcoin_backend: Some(config::BitcoinBackend::Bitcoind(bitcoind_config)),
data_dir: Some(data_dir),
#[cfg(unix)]
daemon: false,
log_level: log::LevelFilter::Debug,
main_descriptor: desc,
};
Expand Down
2 changes: 0 additions & 2 deletions liana/src/testutils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -569,8 +569,6 @@ impl DummyLiana {
bitcoin_config,
bitcoin_backend: None,
data_dir: Some(data_dir),
#[cfg(unix)]
daemon: false,
log_level: log::LevelFilter::Debug,
main_descriptor: desc,
};
Expand Down
1 change: 0 additions & 1 deletion tests/test_framework/lianad.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ def __init__(

with open(self.conf_file, "w") as f:
f.write(f"data_dir = '{datadir}'\n")
f.write("daemon = false\n")
f.write(f"log_level = '{LOG_LEVEL}'\n")

f.write(f'main_descriptor = "{multi_desc}"\n')
Expand Down

0 comments on commit c14c55b

Please sign in to comment.