- out.write_all(b"\nNode counts by status:\n").expect("stdout broken?");
- out.write_all(format!("Untested: {}\n", store.get_node_count(AddressState::Untested)
- ).as_bytes()).expect("stdout broken?");
- out.write_all(format!("Low Block Count: {}\n", store.get_node_count(AddressState::LowBlockCount)
- ).as_bytes()).expect("stdout broken?");
- out.write_all(format!("High Block Count: {}\n", store.get_node_count(AddressState::HighBlockCount)
- ).as_bytes()).expect("stdout broken?");
- out.write_all(format!("Low Version: {}\n", store.get_node_count(AddressState::LowVersion)
- ).as_bytes()).expect("stdout broken?");
- out.write_all(format!("Bad Version: {}\n", store.get_node_count(AddressState::BadVersion)
- ).as_bytes()).expect("stdout broken?");
- out.write_all(format!("Not Full Node: {}\n", store.get_node_count(AddressState::NotFullNode)
- ).as_bytes()).expect("stdout broken?");
- out.write_all(format!("Protocol Violation: {}\n", store.get_node_count(AddressState::ProtocolViolation)
- ).as_bytes()).expect("stdout broken?");
- out.write_all(format!("Timeout: {}\n", store.get_node_count(AddressState::Timeout)
- ).as_bytes()).expect("stdout broken?");
- out.write_all(format!("Timeout During Request: {}\n", store.get_node_count(AddressState::TimeoutDuringRequest)
- ).as_bytes()).expect("stdout broken?");
- out.write_all(format!("Good: {}\n", store.get_node_count(AddressState::Good)
- ).as_bytes()).expect("stdout broken?");
- out.write_all(format!("WasGood: {}\n", store.get_node_count(AddressState::WasGood)
- ).as_bytes()).expect("stdout broken?");
-
- out.write_all(format!(
- "\nCurrent connections open/in progress: {}\n", stats.connection_count).as_bytes()).expect("stdout broken?");
- out.write_all(format!(
- "Connections opened each second: {} (\"c x\" to change to x seconds)\n", store.get_u64(U64Setting::ConnsPerSec)
- ).as_bytes()).expect("stdout broken?");
- out.write_all(format!(
- "Current block count: {}\n", stats.header_count).as_bytes()).expect("stdout broken?");
-
- out.write_all(format!(
- "Timeout for full run (in seconds): {} (\"t x\" to change to x seconds)\n", store.get_u64(U64Setting::RunTimeout)
- ).as_bytes()).expect("stdout broken?");
- out.write_all(format!(
- "Minimum protocol version: {} (\"v x\" to change value to x)\n", store.get_u64(U64Setting::MinProtocolVersion)
- ).as_bytes()).expect("stdout broken?");
- out.write_all(format!(
- "Subversion match regex: {} (\"s x\" to change value to x)\n", store.get_regex(RegexSetting::SubverRegex).as_str()
- ).as_bytes()).expect("stdout broken?");
-
- out.write_all(b"\nRetry times (in seconds):\n").expect("stdout broken?");
- out.write_all(format!(
- "Untested: {}\n", store.get_u64(U64Setting::RescanInterval(AddressState::Untested))
- ).as_bytes()).expect("stdout broken?");
- out.write_all(format!(
- "Low Block Count: {}\n", store.get_u64(U64Setting::RescanInterval(AddressState::LowBlockCount))
- ).as_bytes()).expect("stdout broken?");
- out.write_all(format!(
- "High Block Count {}\n", store.get_u64(U64Setting::RescanInterval(AddressState::HighBlockCount))
- ).as_bytes()).expect("stdout broken?");
- out.write_all(format!(
- "Low Version: {}\n", store.get_u64(U64Setting::RescanInterval(AddressState::LowVersion))
- ).as_bytes()).expect("stdout broken?");
- out.write_all(format!(
- "Bad Version: {}\n", store.get_u64(U64Setting::RescanInterval(AddressState::BadVersion))
- ).as_bytes()).expect("stdout broken?");
- out.write_all(format!(
- "Not Full Node: {}\n", store.get_u64(U64Setting::RescanInterval(AddressState::NotFullNode))
- ).as_bytes()).expect("stdout broken?");
- out.write_all(format!(
- "Protocol Violation: {}\n", store.get_u64(U64Setting::RescanInterval(AddressState::ProtocolViolation))
- ).as_bytes()).expect("stdout broken?");
- out.write_all(format!(
- "Timeout: {}\n", store.get_u64(U64Setting::RescanInterval(AddressState::Timeout))
- ).as_bytes()).expect("stdout broken?");
- out.write_all(format!(
- "Timeout During Request: {}\n", store.get_u64(U64Setting::RescanInterval(AddressState::TimeoutDuringRequest))
- ).as_bytes()).expect("stdout broken?");
- out.write_all(format!(
- "Good: {}\n", store.get_u64(U64Setting::RescanInterval(AddressState::Good))
- ).as_bytes()).expect("stdout broken?");
- out.write_all(format!(
- "Was Good: {}\n", store.get_u64(U64Setting::RescanInterval(AddressState::WasGood))
- ).as_bytes()).expect("stdout broken?");
-
- out.write_all(b"\nCommands:\n").expect("stdout broken?");
- out.write_all(b"q: quit\n").expect("stdout broken?");
- out.write_all(format!(
- "r x y: Change retry time for status x (int value, see retry times section for name mappings) to y (in seconds)\n"
- ).as_bytes()).expect("stdout broken?");
- out.write_all(format!(
- "w x: Change the amount of time a node is considered WAS_GOOD after it fails to x from {} (in seconds)\n",
- store.get_u64(U64Setting::WasGoodTimeout)
- ).as_bytes()).expect("stdout broken?");
- out.write_all(b"a x: Scan node x\n").expect("stdout broken?");
- out.write_all(b"\x1b[s").expect("stdout broken?"); // Save cursor position and provide a blank line before cursor
- out.write_all(b"\x1b[;H\x1b[2K").expect("stdout broken?");
- out.write_all(b"Most recent log:\n").expect("stdout broken?");
- out.write_all(b"\x1b[u").expect("stdout broken?"); // Restore cursor position and go up one line
-