Skip to content

Commit

Permalink
diff --git a/GNUmakefile b/GNUmakefile
Browse files Browse the repository at this point in the history
index 3d1595f..3de654d 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -190,15 +190,15 @@ dashboard-install:## 	dashboard-install
 lightning-search:## 	lightning-search
 ##lightning-search
 ##	build and install lightning-search
-	cargo build --release --manifest-path ./src/bin/lightning_search/Cargo.toml
-	cargo install --path ./src/bin/lightning_search
+	#cargo build --release --manifest-path ./src/bin/lightning_search/Cargo.toml
+	#cargo install --path ./src/bin/lightning_search
 ## 	:

 mempool-space_dashboard:## 	mempool-space_dashboard
 ##mempool-space_dashboard
 ##	build and install mempool-space_dashboard
-	cargo build --release --manifest-path ./src/bin/mempool-space_dashboard/Cargo.toml
-	cargo install --path ./src/bin/mempool-space_dashboard
+	#cargo build --release --manifest-path ./src/bin/mempool-space_dashboard/Cargo.toml
+	#cargo install --path ./src/bin/mempool-space_dashboard
 ## 	:

 .PHONY:docs
diff --git a/README.md b/README.md
index 3340142..6b44a44 100755
--- a/README.md
+++ b/README.md
@@ -436,15 +436,25 @@ pub fn run(args: Args) -> Result<()> {
     Ok(())
 }

-###  pub fn reachable()
+
+### 	pub fn reachable
+
 pub fn reachable() -> bool {
+
     use api::{blocking, URL};
+
     use std::time::Instant;
+
     let start = Instant::now();
+
     let blocks_tip_height = String::from("blocks/tip/height");
+
     let res = blocking(&blocks_tip_height);
+
     let mut reachable = false;
+
     if !res.unwrap().to_string().is_empty() {
+
         println!(
             "\n\n{:?}:\nGET {}/{:} {:?}\n\n",
             start,
@@ -454,30 +464,43 @@ pub fn reachable() -> bool {
         );
         reachable = true;
     }
+
     let start = Instant::now();
+
     let blocks_tip_height = String::from("blocks_tip_height");
+
     let res = api::api(&blocks_tip_height, "", false);
+
     if !res.is_empty() && reachable {
         println!("\n\n{:?}:\nAPI {}/{:} {:?}\n\n", start, URL[0], res, start.elapsed());
         reachable = true;
     } else {
         reachable = false;
     }
-
+
+
     reachable
 }

-###  pub fn wait(sleep: &str)
+
+### 	pub fn wait(sleep: &str)
+
 pub fn wait(sleep: &str) {
+
     use std::process::Command;
+
     let sleep_cmd = Command::new("sleep").arg(sleep).output().expect("wait:sleep failed");
+
     let _result = String::from_utf8(sleep_cmd.stdout)
         .map_err(|non_utf8| String::from_utf8_lossy(non_utf8.as_bytes()).into_owned())
         .unwrap();
+
     println!();
 }

-###  cargo test -- --nocapture
+
+### 	cargo test -- --nocapture
+

 #[cfg(test)]
 mod tests {
diff --git a/src/lib.rs b/src/lib.rs
index 7918a67..c19f8ad 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -436,15 +436,25 @@ pub fn run(args: Args) -> Result<()> {
     Ok(())
 }

-/// pub fn reachable()
+//
+///	pub fn reachable
+//
 pub fn reachable() -> bool {
+    //
     use api::{blocking, URL};
+    //
     use std::time::Instant;
+    //
     let start = Instant::now();
+    //
     let blocks_tip_height = String::from("blocks/tip/height");
+    //
     let res = blocking(&blocks_tip_height);
+    //
     let mut reachable = false;
+    //
     if !res.unwrap().to_string().is_empty() {
+    //
         println!(
             "\n\n{:?}:\nGET {}/{:} {:?}\n\n",
             start,
@@ -454,30 +464,43 @@ pub fn reachable() -> bool {
         );
         reachable = true;
     }
+    //
     let start = Instant::now();
+    //
     let blocks_tip_height = String::from("blocks_tip_height");
+    //
     let res = api::api(&blocks_tip_height, "", false);
+    //
     if !res.is_empty() && reachable {
         println!("\n\n{:?}:\nAPI {}/{:} {:?}\n\n", start, URL[0], res, start.elapsed());
         reachable = true;
     } else {
         reachable = false;
     }
-
+    //
+    //
     reachable
 }

-/// pub fn wait(sleep: &str)
+//
+///	pub fn wait(sleep: &str)
+//
 pub fn wait(sleep: &str) {
+    //
     use std::process::Command;
+    //
     let sleep_cmd = Command::new("sleep").arg(sleep).output().expect("wait:sleep failed");
+    //
     let _result = String::from_utf8(sleep_cmd.stdout)
         .map_err(|non_utf8| String::from_utf8_lossy(non_utf8.as_bytes()).into_owned())
         .unwrap();
+    //
     println!();
 }

-/// cargo test -- --nocapture
+//
+///	cargo test -- --nocapture
+//

 #[cfg(test)]
 mod tests {
  • Loading branch information
RandyMcMillan committed Nov 20, 2024
1 parent 343b5ba commit 4b59e39
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 12 deletions.
8 changes: 4 additions & 4 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -190,15 +190,15 @@ dashboard-install:## dashboard-install
lightning-search:## lightning-search
##lightning-search
## build and install lightning-search
cargo build --release --manifest-path ./src/bin/lightning_search/Cargo.toml
cargo install --path ./src/bin/lightning_search
#cargo build --release --manifest-path ./src/bin/lightning_search/Cargo.toml
#cargo install --path ./src/bin/lightning_search
## :

mempool-space_dashboard:## mempool-space_dashboard
##mempool-space_dashboard
## build and install mempool-space_dashboard
cargo build --release --manifest-path ./src/bin/mempool-space_dashboard/Cargo.toml
cargo install --path ./src/bin/mempool-space_dashboard
#cargo build --release --manifest-path ./src/bin/mempool-space_dashboard/Cargo.toml
#cargo install --path ./src/bin/mempool-space_dashboard
## :

.PHONY:docs
Expand Down
31 changes: 27 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -436,15 +436,25 @@ pub fn run(args: Args) -> Result<()> {
Ok(())
}

### pub fn reachable()

### pub fn reachable

pub fn reachable() -> bool {

use api::{blocking, URL};

use std::time::Instant;

let start = Instant::now();

let blocks_tip_height = String::from("blocks/tip/height");

let res = blocking(&blocks_tip_height);

let mut reachable = false;

if !res.unwrap().to_string().is_empty() {

println!(
"\n\n{:?}:\nGET {}/{:} {:?}\n\n",
start,
Expand All @@ -454,30 +464,43 @@ pub fn reachable() -> bool {
);
reachable = true;
}

let start = Instant::now();

let blocks_tip_height = String::from("blocks_tip_height");

let res = api::api(&blocks_tip_height, "", false);

if !res.is_empty() && reachable {
println!("\n\n{:?}:\nAPI {}/{:} {:?}\n\n", start, URL[0], res, start.elapsed());
reachable = true;
} else {
reachable = false;
}



reachable
}

### pub fn wait(sleep: &str)

### pub fn wait(sleep: &str)

pub fn wait(sleep: &str) {

use std::process::Command;

let sleep_cmd = Command::new("sleep").arg(sleep).output().expect("wait:sleep failed");

let _result = String::from_utf8(sleep_cmd.stdout)
.map_err(|non_utf8| String::from_utf8_lossy(non_utf8.as_bytes()).into_owned())
.unwrap();

println!();
}

### cargo test -- --nocapture

### cargo test -- --nocapture


#[cfg(test)]
mod tests {
Expand Down
31 changes: 27 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -436,15 +436,25 @@ pub fn run(args: Args) -> Result<()> {
Ok(())
}

/// pub fn reachable()
//
/// pub fn reachable
//
pub fn reachable() -> bool {
//
use api::{blocking, URL};
//
use std::time::Instant;
//
let start = Instant::now();
//
let blocks_tip_height = String::from("blocks/tip/height");
//
let res = blocking(&blocks_tip_height);
//
let mut reachable = false;
//
if !res.unwrap().to_string().is_empty() {
//
println!(
"\n\n{:?}:\nGET {}/{:} {:?}\n\n",
start,
Expand All @@ -454,30 +464,43 @@ pub fn reachable() -> bool {
);
reachable = true;
}
//
let start = Instant::now();
//
let blocks_tip_height = String::from("blocks_tip_height");
//
let res = api::api(&blocks_tip_height, "", false);
//
if !res.is_empty() && reachable {
println!("\n\n{:?}:\nAPI {}/{:} {:?}\n\n", start, URL[0], res, start.elapsed());
reachable = true;
} else {
reachable = false;
}

//
//
reachable
}

/// pub fn wait(sleep: &str)
//
/// pub fn wait(sleep: &str)
//
pub fn wait(sleep: &str) {
//
use std::process::Command;
//
let sleep_cmd = Command::new("sleep").arg(sleep).output().expect("wait:sleep failed");
//
let _result = String::from_utf8(sleep_cmd.stdout)
.map_err(|non_utf8| String::from_utf8_lossy(non_utf8.as_bytes()).into_owned())
.unwrap();
//
println!();
}

/// cargo test -- --nocapture
//
/// cargo test -- --nocapture
//

#[cfg(test)]
mod tests {
Expand Down

0 comments on commit 4b59e39

Please sign in to comment.