소스 검색

chore: fmt and fixed minor comments inconsistencies

skoupidi 1 년 전
부모
커밋
a671d43cee
41개의 변경된 파일117개의 추가작업 그리고 102개의 파일을 삭제
  1. 10 5
      bin/darkfid/src/main.rs
  2. 2 4
      bin/darkfid/src/tests/mod.rs
  3. 13 13
      bin/darkirc/src/main.rs
  4. 2 2
      bin/explorer/explorerd/src/main.rs
  5. 10 7
      bin/genev/genevd/src/main.rs
  6. 4 3
      bin/lilith/src/main.rs
  7. 9 8
      bin/minerd/src/lib.rs
  8. 2 1
      bin/minerd/src/main.rs
  9. 18 18
      bin/tau/taud/src/settings.rs
  10. 1 1
      contrib/localnet/darkfid-five-nodes/darkfid0.toml
  11. 1 1
      contrib/localnet/darkfid-five-nodes/darkfid1.toml
  12. 1 1
      contrib/localnet/darkfid-five-nodes/darkfid2.toml
  13. 1 1
      contrib/localnet/darkfid-five-nodes/darkfid3.toml
  14. 1 1
      contrib/localnet/darkfid-five-nodes/darkfid4.toml
  15. 1 1
      contrib/localnet/darkfid-single-node/darkfid.toml
  16. 1 1
      contrib/localnet/darkfid-small/darkfid0.toml
  17. 1 1
      contrib/localnet/darkfid-small/darkfid1.toml
  18. 1 1
      contrib/localnet/darkfid-small/darkfid2.toml
  19. 1 1
      contrib/localnet/darkirc-four-nodes/darkirc_full_node1.toml
  20. 1 1
      contrib/localnet/darkirc-four-nodes/darkirc_full_node2.toml
  21. 1 1
      contrib/localnet/darkirc-four-nodes/darkirc_full_node3.toml
  22. 1 1
      contrib/localnet/darkirc-four-nodes/darkirc_full_node4.toml
  23. 1 1
      contrib/localnet/darkirc-four-nodes/seed.toml
  24. 1 1
      contrib/localnet/dchatd-four-nodes/dchat1.toml
  25. 1 1
      contrib/localnet/dchatd-four-nodes/dchat2.toml
  26. 1 1
      contrib/localnet/dchatd-four-nodes/dchat3.toml
  27. 1 1
      contrib/localnet/dchatd-four-nodes/dchat4.toml
  28. 1 1
      contrib/localnet/dchatd-four-nodes/seed.toml
  29. 1 1
      contrib/localnet/taud-four-nodes/seed.toml
  30. 1 1
      contrib/localnet/taud-four-nodes/taud_full_node1.toml
  31. 1 1
      contrib/localnet/taud-four-nodes/taud_full_node2.toml
  32. 1 1
      contrib/localnet/taud-four-nodes/taud_full_node3.toml
  33. 1 1
      contrib/localnet/taud-four-nodes/taud_full_node4.toml
  34. 1 1
      doc/src/learn/dchat/creating-dchatd/accept-addr.md
  35. 1 1
      example/dchat/dchatd/dchatd_config.toml
  36. 3 2
      example/dchat/dchatd/src/main.rs
  37. 6 6
      script/evgrd/bin/evgrd.rs
  38. 1 1
      script/research/dhtd/src/main.rs
  39. 1 1
      src/rpc/mod.rs
  40. 9 1
      src/rpc/server.rs
  41. 1 4
      src/rpc/settings.rs

+ 10 - 5
bin/darkfid/src/main.rs

@@ -74,10 +74,10 @@ struct Args {
     verbose: u8,
 }
 
-/// Defines a blockchain network configuration.
-/// Default values correspond to a local network.
 #[derive(Clone, Debug, serde::Deserialize, structopt::StructOpt, structopt_toml::StructOptToml)]
 #[structopt()]
+/// Defines a blockchain network configuration.
+/// Default values correspond to a local network.
 pub struct BlockchainNetwork {
     #[structopt(long, default_value = "~/.local/share/darkfi/darkfid/localnet")]
     /// Path to blockchain database
@@ -139,12 +139,12 @@ pub struct BlockchainNetwork {
     /// Garbage collection task transactions batch size
     txs_batch_size: Option<usize>,
 
-    /// P2P network settings
     #[structopt(flatten)]
+    /// P2P network settings
     net: SettingsOpt,
 
-    /// JSON-RPC settings
     #[structopt(flatten)]
+    /// JSON-RPC settings
     rpc: RpcSettingsOpt,
 }
 
@@ -231,7 +231,12 @@ async fn realmain(args: Args, ex: Arc<smol::Executor<'static>>) -> Result<()> {
         bootstrap,
     };
     daemon
-        .start(&ex, &blockchain_config.rpc.into(), &blockchain_config.mm_rpc.map(|mm_rpc_opts| mm_rpc_opts.into()), &config)
+        .start(
+            &ex,
+            &blockchain_config.rpc.into(),
+            &blockchain_config.mm_rpc.map(|mm_rpc_opts| mm_rpc_opts.into()),
+            &config,
+        )
         .await?;
 
     // Signal handling for graceful termination.

+ 2 - 4
bin/darkfid/src/tests/mod.rs

@@ -251,10 +251,8 @@ fn darkfid_programmatic_control() -> Result<()> {
     let sled_db = sled_overlay::sled::Config::new().temporary(true).open()?;
     let (_, vks) = darkfi_contract_test_harness::vks::get_cached_pks_and_vks()?;
     darkfi_contract_test_harness::vks::inject(&sled_db, &vks)?;
-    let rpc_settings = RpcSettings {
-        listen: Url::parse("tcp://127.0.0.1:8240")?,
-        ..RpcSettings::default()
-    };
+    let rpc_settings =
+        RpcSettings { listen: Url::parse("tcp://127.0.0.1:8240")?, ..RpcSettings::default() };
 
     // Create an executor and communication signals
     let ex = Arc::new(smol::Executor::new());

+ 13 - 13
bin/darkirc/src/main.rs

@@ -25,7 +25,7 @@ use darkfi::{
     rpc::{
         jsonrpc::JsonSubscriber,
         server::{listen_and_serve, RequestHandler},
-        settings::{RpcSettingsOpt, RpcSettings},
+        settings::{RpcSettings, RpcSettingsOpt},
     },
     system::{sleep, StoppableTask, StoppableTaskPtr, Subscription},
     util::path::{expand_path, get_config_path},
@@ -98,48 +98,48 @@ struct Args {
     /// Replay logs (DB) path
     replay_datastore: String,
 
-    /// Flag to store Sled DB instructions
     #[structopt(long)]
+    /// Flag to store Sled DB instructions
     replay_mode: bool,
 
-    /// Generate a new NaCl keypair and exit
     #[structopt(long)]
+    /// Generate a new NaCl keypair and exit
     gen_chacha_keypair: bool,
 
-    /// Generate a new encrypted channel NaCl secret and exit
     #[structopt(long)]
+    /// Generate a new encrypted channel NaCl secret and exit
     gen_channel_secret: bool,
 
-    /// Recover NaCl public key from a secret key
     #[structopt(long = "get-chacha-pubkey")]
+    /// Recover NaCl public key from a secret key
     chacha_secret: Option<String>,
 
-    /// Generate a new RLN identity
     #[structopt(long)]
+    /// Generate a new RLN identity
     gen_rln_identity: bool,
 
-    /// Flag to skip syncing the DAG (no history).
     #[structopt(long)]
+    /// Flag to skip syncing the DAG (no history)
     skip_dag_sync: bool,
 
-    /// IRC Password (Encrypted with bcrypt-2b)
     #[structopt(long)]
-    pub password: Option<String>,
+    /// IRC Password (Encrypted with bcrypt-2b)
+    password: Option<String>,
 
-    /// Encrypt a given password for the IRC server connection
     #[structopt(long)]
+    /// Encrypt a given password for the IRC server connection
     encrypt_password: bool,
 
-    /// List configured contacts.
     #[structopt(long)]
+    /// List configured contacts.
     list_contacts: bool,
 
-    /// P2P network settings
     #[structopt(flatten)]
+    /// P2P network settings
     net: SettingsOpt,
 
-    /// JSON-RPC settings
     #[structopt(flatten)]
+    /// JSON-RPC settings
     rpc: RpcSettingsOpt,
 }
 

+ 2 - 2
bin/explorer/explorerd/src/main.rs

@@ -37,7 +37,7 @@ use darkfi::{
     rpc::{
         client::RpcClient,
         server::{listen_and_serve, RequestHandler},
-        settings::RpcSettingsOpt
+        settings::RpcSettingsOpt,
     },
     system::{StoppableTask, StoppableTaskPtr},
     util::path::expand_path,
@@ -114,8 +114,8 @@ struct Args {
     /// Configuration file to use
     config: Option<String>,
 
-    /// JSON-RPC settings
     #[structopt(flatten)]
+    /// JSON-RPC settings
     rpc: RpcSettingsOpt,
 
     #[structopt(long, default_value = "~/.local/share/darkfi/explorerd/daemon.db")]

+ 10 - 7
bin/genev/genevd/src/main.rs

@@ -51,21 +51,23 @@ struct Args {
     config: Option<String>,
 
     #[structopt(flatten)]
-    pub rpc: RpcSettingsOpt,
+    /// JSON-RPC settings
+    rpc: RpcSettingsOpt,
 
     #[structopt(flatten)]
-    pub net: SettingsOpt,
+    /// P2P network settings
+    net: SettingsOpt,
 
-    /// Sets Datastore Path
     #[structopt(long, default_value = "~/.local/share/darkfi/genev_db")]
-    pub datastore: String,
+    /// Sets Datastore Path
+    datastore: String,
 
-    /// Replay logs (DB) path
     #[structopt(short, long, default_value = "~/.local/share/darkfi/replayed_genev_db")]
+    /// Replay logs (DB) path
     replay_datastore: String,
 
-    /// Flag to store Sled DB instructions
     #[structopt(long)]
+    /// Flag to store Sled DB instructions
     replay_mode: bool,
 
     #[structopt(short, long)]
@@ -73,7 +75,8 @@ struct Args {
     log: Option<String>,
 
     #[structopt(long)]
-    pub skip_dag_sync: bool,
+    /// Flag to skip syncing the DAG (no history)
+    skip_dag_sync: bool,
 
     #[structopt(short, parse(from_occurrences))]
     /// Increase verbosity (-vvv supported)

+ 4 - 3
bin/lilith/src/main.rs

@@ -58,11 +58,12 @@ const CONFIG_FILE_CONTENTS: &str = include_str!("../lilith_config.toml");
 #[structopt(name = "lilith", about = cli_desc!())]
 struct Args {
     #[structopt(flatten)]
-    pub rpc: RpcSettingsOpt,
+    /// JSON-RPC settings
+    rpc: RpcSettingsOpt,
 
     #[structopt(short, long)]
     /// Configuration file to use
-    pub config: Option<String>,
+    config: Option<String>,
 
     #[structopt(short, long)]
     /// Set log file to ouput into
@@ -70,7 +71,7 @@ struct Args {
 
     #[structopt(short, parse(from_occurrences))]
     /// Increase verbosity (-vvv supported)
-    pub verbose: u8,
+    verbose: u8,
 
     #[structopt(long, default_value = "120")]
     /// Interval after which to check whitelist peers

+ 9 - 8
bin/minerd/src/lib.rs

@@ -136,7 +136,6 @@ impl Minerd {
     }
 }
 
-
 #[cfg(test)]
 use url::Url;
 
@@ -166,10 +165,8 @@ fn minerd_programmatic_control() -> Result<()> {
 
     // Daemon configuration
     let threads = 4;
-    let rpc_settings = RpcSettings {
-        listen: Url::parse("tcp://127.0.0.1:28467")?,
-        ..RpcSettings::default()
-    };
+    let rpc_settings =
+        RpcSettings { listen: Url::parse("tcp://127.0.0.1:28467")?, ..RpcSettings::default() };
 
     // Create an executor and communication signals
     let ex = Arc::new(smol::Executor::new());
@@ -199,10 +196,14 @@ fn minerd_programmatic_control() -> Result<()> {
 
                 // Generate a JSON-RPC client to send mining jobs
                 let mut rpc_client =
-                    darkfi::rpc::client::RpcClient::new(rpc_settings.listen.clone(), ex.clone()).await;
+                    darkfi::rpc::client::RpcClient::new(rpc_settings.listen.clone(), ex.clone())
+                        .await;
                 while rpc_client.is_err() {
-                    rpc_client =
-                        darkfi::rpc::client::RpcClient::new(rpc_settings.listen.clone(), ex.clone()).await;
+                    rpc_client = darkfi::rpc::client::RpcClient::new(
+                        rpc_settings.listen.clone(),
+                        ex.clone(),
+                    )
+                    .await;
                 }
                 let rpc_client = rpc_client.unwrap();
 

+ 2 - 1
bin/minerd/src/main.rs

@@ -38,7 +38,8 @@ struct Args {
     config: Option<String>,
 
     #[structopt(flatten)]
-    pub rpc: RpcSettingsOpt,
+    /// JSON-RPC settings
+    rpc: RpcSettingsOpt,
 
     #[structopt(short, long, default_value = "4")]
     /// PoW miner number of threads to use

+ 18 - 18
bin/tau/taud/src/settings.rs

@@ -19,10 +19,7 @@
 use structopt::StructOpt;
 use structopt_toml::{serde::Deserialize, StructOptToml};
 
-use darkfi::{
-    net::settings::SettingsOpt,
-    rpc::settings::RpcSettingsOpt,
-};
+use darkfi::{net::settings::SettingsOpt, rpc::settings::RpcSettingsOpt};
 
 pub const CONFIG_FILE: &str = "taud_config.toml";
 pub const CONFIG_FILE_CONTENTS: &str = include_str!("../taud_config.toml");
@@ -32,66 +29,69 @@ pub const CONFIG_FILE_CONTENTS: &str = include_str!("../taud_config.toml");
 #[serde(default)]
 #[structopt(name = "taud")]
 pub struct Args {
-    /// Sets a custom config file
     #[structopt(long)]
+    /// Sets a custom config file
     pub config: Option<String>,
 
-    /// Sets Datastore Path
     #[structopt(long, default_value = "~/.local/share/darkfi/taud_db")]
+    /// Sets Datastore Path
     pub datastore: String,
 
-    /// Replay logs (DB) path
     #[structopt(long, default_value = "~/.local/share/darkfi/replayed_taud_db")]
+    /// Replay logs (DB) path
     pub replay_datastore: String,
 
-    /// Flag to store Sled DB instructions
     #[structopt(long)]
+    /// Flag to store Sled DB instructions
     pub replay_mode: bool,
 
     #[structopt(flatten)]
+    /// JSON-RPC settings
     pub rpc: RpcSettingsOpt,
 
     #[structopt(flatten)]
+    /// P2P network settings
     pub net: SettingsOpt,
 
-    /// Increase verbosity
     #[structopt(short, parse(from_occurrences))]
+    /// Increase verbosity
     pub verbose: u8,
 
-    /// Generate a new workspace
     #[structopt(long)]
+    /// Generate a new workspace
     pub generate: bool,
 
-    /// Secret Key To Encrypt/Decrypt tasks
     #[structopt(long)]
+    /// Secret Key To Encrypt/Decrypt tasks
     pub workspaces: Vec<String>,
 
-    /// Write access key
     #[structopt(long)]
+    /// Write access key
     pub write: Option<String>,
 
-    /// Password
     #[structopt(long)]
+    /// Password
     pub password: Option<String>,
 
-    ///  Clean all the local data in datastore path
-    /// (BE CAREFUL) Check the datastore path in the config file before running this
     #[structopt(long)]
+    /// Clean all the local data in datastore path
+    /// (BE CAREFUL) Check the datastore path in the config file before running this
     pub refresh: bool,
 
-    /// Current display name    
     #[structopt(long)]
+    /// Current display name
     pub nickname: Option<String>,
 
     #[structopt(long)]
+    /// Flag to skip syncing the DAG (no history)
     pub skip_dag_sync: bool,
 
-    /// Named pipe path
     #[structopt(long, default_value = "/tmp/tau_pipe")]
+    /// Named pipe path
     pub pipe_path: String,
 
-    // Whether to pipe notifications or not
     #[structopt(long)]
+    // Whether to pipe notifications or not
     pub piped: bool,
 
     #[structopt(short, long)]

+ 1 - 1
contrib/localnet/darkfid-five-nodes/darkfid0.toml

@@ -58,7 +58,7 @@ skip_fees = false
 rpc_listen = "tcp://127.0.0.1:48240"
 
 # Disabled RPC methods
-rpc_disabled_methods = ["p2p.get_info"]
+#rpc_disabled_methods = ["p2p.get_info"]
 
 ## Localnet P2P network settings
 [network_config."localnet".net]

+ 1 - 1
contrib/localnet/darkfid-five-nodes/darkfid1.toml

@@ -55,7 +55,7 @@ skip_fees = false
 rpc_listen = "tcp://127.0.0.1:48340"
 
 # Disabled RPC methods
-rpc_disabled_methods = ["p2p.get_info"]
+#rpc_disabled_methods = ["p2p.get_info"]
 
 ## Localnet P2P network settings
 [network_config."localnet".net]

+ 1 - 1
contrib/localnet/darkfid-five-nodes/darkfid2.toml

@@ -55,7 +55,7 @@ skip_fees = false
 rpc_listen = "tcp://127.0.0.1:48440"
 
 # Disabled RPC methods
-rpc_disabled_methods = ["p2p.get_info"]
+#rpc_disabled_methods = ["p2p.get_info"]
 
 ## Localnet P2P network settings
 [network_config."localnet".net]

+ 1 - 1
contrib/localnet/darkfid-five-nodes/darkfid3.toml

@@ -55,7 +55,7 @@ skip_fees = false
 rpc_listen = "tcp://127.0.0.1:48540"
 
 # Disabled RPC methods
-rpc_disabled_methods = ["p2p.get_info"]
+#rpc_disabled_methods = ["p2p.get_info"]
 
 ## Localnet P2P network settings
 [network_config."localnet".net]

+ 1 - 1
contrib/localnet/darkfid-five-nodes/darkfid4.toml

@@ -55,7 +55,7 @@ skip_fees = false
 rpc_listen = "tcp://127.0.0.1:48640"
 
 # Disabled RPC methods
-rpc_disabled_methods = ["p2p.get_info"]
+#rpc_disabled_methods = ["p2p.get_info"]
 
 ## Localnet P2P network settings
 [network_config."localnet".net]

+ 1 - 1
contrib/localnet/darkfid-single-node/darkfid.toml

@@ -58,7 +58,7 @@ skip_fees = false
 rpc_listen = "tcp://127.0.0.1:48240"
 
 # Disabled RPC methods
-rpc_disabled_methods = ["p2p.get_info"]
+#rpc_disabled_methods = ["p2p.get_info"]
 
 ## Localnet JSON-RPC settings for p2pool merge mining requests (optional)
 #[network_config."localnet".mm_rpc]

+ 1 - 1
contrib/localnet/darkfid-small/darkfid0.toml

@@ -55,7 +55,7 @@ skip_fees = false
 rpc_listen = "tcp://127.0.0.1:48240"
 
 # Disabled RPC methods
-rpc_disabled_methods = ["p2p.get_info"]
+#rpc_disabled_methods = ["p2p.get_info"]
 
 ## Localnet P2P network settings
 [network_config."localnet".net]

+ 1 - 1
contrib/localnet/darkfid-small/darkfid1.toml

@@ -63,7 +63,7 @@ skip_fees = false
 rpc_listen = "tcp://127.0.0.1:48340"
 
 # Disabled RPC methods
-rpc_disabled_methods = ["p2p.get_info"]
+#rpc_disabled_methods = ["p2p.get_info"]
 
 ## Localnet P2P network settings
 [network_config."localnet".net]

+ 1 - 1
contrib/localnet/darkfid-small/darkfid2.toml

@@ -44,7 +44,7 @@ skip_fees = false
 rpc_listen = "tcp://127.0.0.1:48440"
 
 # Disabled RPC methods
-rpc_disabled_methods = ["p2p.get_info"]
+#rpc_disabled_methods = ["p2p.get_info"]
 
 ## Localnet P2P network settings
 [network_config."localnet".net]

+ 1 - 1
contrib/localnet/darkirc-four-nodes/darkirc_full_node1.toml

@@ -18,7 +18,7 @@ autojoin = ["#dev", "#test"]
 rpc_listen = "tcp://127.0.0.1:8890"
 
 ## Disabled RPC methods
-rpc_disabled_methods = ["p2p.get_info"]
+#rpc_disabled_methods = ["p2p.get_info"]
 
 ## P2P net settings
 [net]

+ 1 - 1
contrib/localnet/darkirc-four-nodes/darkirc_full_node2.toml

@@ -18,7 +18,7 @@ autojoin = ["#dev", "#test"]
 rpc_listen = "tcp://127.0.0.1:8891"
 
 ## Disabled RPC methods
-rpc_disabled_methods = ["p2p.get_info"]
+#rpc_disabled_methods = ["p2p.get_info"]
 
 ## P2P net settings
 [net]

+ 1 - 1
contrib/localnet/darkirc-four-nodes/darkirc_full_node3.toml

@@ -18,7 +18,7 @@ autojoin = ["#dev", "#test"]
 rpc_listen = "tcp://127.0.0.1:8892"
 
 ## Disabled RPC methods
-rpc_disabled_methods = ["p2p.get_info"]
+#rpc_disabled_methods = ["p2p.get_info"]
 
 ## P2P net settings
 [net]

+ 1 - 1
contrib/localnet/darkirc-four-nodes/darkirc_full_node4.toml

@@ -18,7 +18,7 @@ autojoin = ["#dev", "#test"]
 rpc_listen = "tcp://127.0.0.1:8893"
 
 ## Disabled RPC methods
-rpc_disabled_methods = ["p2p.get_info"]
+#rpc_disabled_methods = ["p2p.get_info"]
 
 ## P2P net settings
 [net]

+ 1 - 1
contrib/localnet/darkirc-four-nodes/seed.toml

@@ -24,7 +24,7 @@ autojoin = ["#dev"]
 rpc_listen = "tcp://127.0.0.1:8888"
 
 ## Disabled RPC methods
-rpc_disabled_methods = ["p2p.get_info"]
+#rpc_disabled_methods = ["p2p.get_info"]
 
 ## P2P net settings
 [net]

+ 1 - 1
contrib/localnet/dchatd-four-nodes/dchat1.toml

@@ -6,7 +6,7 @@
 rpc_listen = "tcp://127.0.0.1:51345"
 
 ## Disabled RPC methods
-rpc_disabled_methods = ["p2p.get_info"]
+#rpc_disabled_methods = ["p2p.get_info"]
 
 [net]
 ## P2P accept addresses Required for inbound nodes.

+ 1 - 1
contrib/localnet/dchatd-four-nodes/dchat2.toml

@@ -6,7 +6,7 @@
 rpc_listen = "tcp://127.0.0.1:52345"
 
 ## Disabled RPC methods
-rpc_disabled_methods = ["p2p.get_info"]
+#rpc_disabled_methods = ["p2p.get_info"]
 
 [net]
 ## P2P accept addresses Required for inbound nodes.

+ 1 - 1
contrib/localnet/dchatd-four-nodes/dchat3.toml

@@ -6,7 +6,7 @@
 rpc_listen = "tcp://127.0.0.1:53345"
 
 ## Disabled RPC methods
-rpc_disabled_methods = ["p2p.get_info"]
+#rpc_disabled_methods = ["p2p.get_info"]
 
 [net]
 ## P2P accept addresses Required for inbound nodes.

+ 1 - 1
contrib/localnet/dchatd-four-nodes/dchat4.toml

@@ -6,7 +6,7 @@
 rpc_listen = "tcp://127.0.0.1:54325"
 
 ## Disabled RPC methods
-rpc_disabled_methods = ["p2p.get_info"]
+#rpc_disabled_methods = ["p2p.get_info"]
 
 [net]
 ## P2P accept addresses Required for inbound nodes.

+ 1 - 1
contrib/localnet/dchatd-four-nodes/seed.toml

@@ -6,7 +6,7 @@
 rpc_listen = "tcp://127.0.0.1:54448"
 
 ## Disabled RPC methods
-rpc_disabled_methods = ["p2p.get_info"]
+#rpc_disabled_methods = ["p2p.get_info"]
 
 [net]
 ## P2P accept addresses Required for inbound nodes.

+ 1 - 1
contrib/localnet/taud-four-nodes/seed.toml

@@ -49,7 +49,7 @@ write_public_key = "2LW4qXxR5QSybtMeRtX69GdqNWxgAbDVyMT6aWe37MT7"
 rpc_listen = "tcp://127.0.0.1:23340"
 
 ## Disabled RPC methods
-rpc_disabled_methods = ["p2p.get_info"]
+#rpc_disabled_methods = ["p2p.get_info"]
 
 # P2P network settings
 [net]

+ 1 - 1
contrib/localnet/taud-four-nodes/taud_full_node1.toml

@@ -49,7 +49,7 @@ write_public_key = "2LW4qXxR5QSybtMeRtX69GdqNWxgAbDVyMT6aWe37MT7"
 rpc_listen = "tcp://127.0.0.1:23341"
 
 ## Disabled RPC methods
-rpc_disabled_methods = ["p2p.get_info"]
+#rpc_disabled_methods = ["p2p.get_info"]
 
 # P2P network settings
 [net]

+ 1 - 1
contrib/localnet/taud-four-nodes/taud_full_node2.toml

@@ -49,7 +49,7 @@ write_public_key = "2LW4qXxR5QSybtMeRtX69GdqNWxgAbDVyMT6aWe37MT7"
 rpc_listen = "tcp://127.0.0.1:23342"
 
 ## Disabled RPC methods
-rpc_disabled_methods = ["p2p.get_info"]
+#rpc_disabled_methods = ["p2p.get_info"]
 
 # P2P network settings
 [net]

+ 1 - 1
contrib/localnet/taud-four-nodes/taud_full_node3.toml

@@ -49,7 +49,7 @@ write_public_key = "2LW4qXxR5QSybtMeRtX69GdqNWxgAbDVyMT6aWe37MT7"
 rpc_listen = "tcp://127.0.0.1:23343"
 
 ## Disabled RPC methods
-rpc_disabled_methods = ["p2p.get_info"]
+#rpc_disabled_methods = ["p2p.get_info"]
 
 # P2P network settings
 [net]

+ 1 - 1
contrib/localnet/taud-four-nodes/taud_full_node4.toml

@@ -49,7 +49,7 @@ write_public_key = "2LW4qXxR5QSybtMeRtX69GdqNWxgAbDVyMT6aWe37MT7"
 rpc_listen = "tcp://127.0.0.1:23344"
 
 ## Disabled RPC methods
-rpc_disabled_methods = ["p2p.get_info"]
+#rpc_disabled_methods = ["p2p.get_info"]
 
 # P2P network settings
 [net]

+ 1 - 1
doc/src/learn/dchat/creating-dchatd/accept-addr.md

@@ -23,7 +23,7 @@ config at `../dchatd_config.toml` as follows:
 rpc_listen = "tcp://127.0.0.1:51054"
 
 ## Disabled RPC methods
-rpc_disabled_methods = ["p2p.get_info"]
+#rpc_disabled_methods = ["p2p.get_info"]
 
 [net]
 ## P2P accept addresses Required for inbound nodes.

+ 1 - 1
example/dchat/dchatd/dchatd_config.toml

@@ -6,7 +6,7 @@
 rpc_listen = "tcp://127.0.0.1:51054"
 
 # Disabled RPC methods
-rpc_disabled_methods = ["p2p.get_info"]
+#rpc_disabled_methods = ["p2p.get_info"]
 
 [net]
 ## P2P accept addresses Required for inbound nodes.

+ 3 - 2
example/dchat/dchatd/src/main.rs

@@ -55,7 +55,8 @@ const CONFIG_FILE_CONTENTS: &str = include_str!("../dchatd_config.toml");
 #[structopt(name = "dchat", about = cli_desc!())]
 struct Args {
     #[structopt(flatten)]
-    pub rpc: RpcSettingsOpt,
+    /// JSON-RPC settings
+    rpc: RpcSettingsOpt,
 
     #[structopt(short, long)]
     /// Configuration file to use
@@ -69,8 +70,8 @@ struct Args {
     /// Increase verbosity (-vvv supported)
     verbose: u8,
 
-    /// P2P network settings
     #[structopt(flatten)]
+    /// P2P network settings
     net: SettingsOpt,
 }
 // ANCHOR_END: args

+ 6 - 6
script/evgrd/bin/evgrd.rs

@@ -81,28 +81,28 @@ struct Args {
     /// Replay logs (DB) path
     replay_datastore: String,
 
-    /// Flag to store Sled DB instructions
     #[structopt(long)]
+    /// Flag to store Sled DB instructions
     replay_mode: bool,
 
-    /// Flag to skip syncing the DAG (no history).
     #[structopt(long)]
+    /// Flag to skip syncing the DAG (no history)
     skip_dag_sync: bool,
 
-    /// Number of attempts to sync the DAG.
     #[structopt(long, default_value = "5")]
+    /// Number of attempts to sync the DAG
     sync_attempts: u8,
 
-    /// Number of seconds to wait before trying again if sync fails.
     #[structopt(long, default_value = "15")]
+    /// Number of seconds to wait before trying again if sync fails
     sync_timeout: u8,
 
-    /// P2P network settings
     #[structopt(flatten)]
+    /// P2P network settings
     net: NetSettingsOpt,
 
-    /// JSON-RPC settings
     #[structopt(flatten)]
+    /// JSON-RPC settings
     rpc: RpcSettingsOpt,
 }
 

+ 1 - 1
script/research/dhtd/src/main.rs

@@ -61,8 +61,8 @@ struct Args {
     /// Configuration file to use
     config: Option<String>,
 
-    /// JSON-RPC settings
     #[structopt(flatten)]
+    /// JSON-RPC settings
     rpc: RpcSettingsOpt,
 
     #[structopt(long)]

+ 1 - 1
src/rpc/mod.rs

@@ -41,4 +41,4 @@ pub mod p2p_method;
 pub mod util;
 
 /// JSON-RPC settings
-pub mod settings;
+pub mod settings;

+ 9 - 1
src/rpc/server.rs

@@ -377,7 +377,15 @@ async fn run_accept_loop<'a, T: 'a>(
                 let task_ = task.clone();
                 let ex_ = ex.clone();
                 task.clone().start(
-                    accept(reader, writer, url.clone(), rh.clone(), conn_limit, settings.clone(), ex_),
+                    accept(
+                        reader,
+                        writer,
+                        url.clone(),
+                        rh.clone(),
+                        conn_limit,
+                        settings.clone(),
+                        ex_,
+                    ),
                     |_| async move {
                         info!(target: "rpc::server", "[RPC] Closed conn from {}", url);
                         rh_.clone().unmark_connection(task_.clone()).await;

+ 1 - 4
src/rpc/settings.rs

@@ -36,10 +36,7 @@ impl RpcSettings {
 
 impl Default for RpcSettings {
     fn default() -> Self {
-        Self {
-            listen: Url::parse("tcp://127.0.0.1:22222").unwrap(),
-            disabled_methods: vec![],
-        }
+        Self { listen: Url::parse("tcp://127.0.0.1:22222").unwrap(), disabled_methods: vec![] }
     }
 }