diff --git a/.env b/.env deleted file mode 100644 index bcb8aee..0000000 --- a/.env +++ /dev/null @@ -1,3 +0,0 @@ -NETWORK=testnet4 -SV2_INTERVAL=60 -LOG_LEVEL=info diff --git a/.gitignore b/.gitignore index fccb68f..62aa3c9 100644 --- a/.gitignore +++ b/.gitignore @@ -2,5 +2,5 @@ debug/ target/ *-DB/ - -Cargo.lock \ No newline at end of file +/.env +/custom-configs/sv1-pool/.env \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..3a92d08 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,3786 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "aead" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0" +dependencies = [ + "crypto-common", + "generic-array", +] + +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + +[[package]] +name = "aes-gcm" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "831010a0f742e1209b3bcea8fab6a8e149051ba6099432c8cb2cc117dec3ead1" +dependencies = [ + "aead", + "aes", + "cipher", + "ctr", + "ghash", + "subtle", +] + +[[package]] +name = "ahash" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "aho-corasick" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" +dependencies = [ + "memchr", +] + +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "anstream" +version = "0.6.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43d5b281e737544384e969a5ccad3f1cdd24b48086a0fc1b2a5262a26b8f4f4a" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5192cca8006f1fd4f7237516f40fa183bb07f8fbdfedaa0036de5ea9b0b45e78" + +[[package]] +name = "anstyle-parse" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" +dependencies = [ + "anstyle", + "once_cell_polyfill", + "windows-sys 0.61.2", +] + +[[package]] +name = "arraydeque" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d902e3d592a523def97af8f317b08ce16b7ab854c1985a0c671e6f15cebc236" + +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + +[[package]] +name = "async-channel" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" +dependencies = [ + "concurrent-queue", + "event-listener", + "futures-core", +] + +[[package]] +name = "async-trait" +version = "0.1.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + +[[package]] +name = "autocfg" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" + +[[package]] +name = "base58ck" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c8d66485a3a2ea485c1913c4572ce0256067a5377ac8c75c4960e1cda98605f" +dependencies = [ + "bitcoin-internals 0.3.0", + "bitcoin_hashes 0.14.1", +] + +[[package]] +name = "base64" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "bech32" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32637268377fc7b10a8c6d51de3e7fba1ce5dd371a96e342b34e6078db558e7f" + +[[package]] +name = "binary_sv2" +version = "5.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2ca1060634594eb03b4a76527e661391d6433d360ed6643bbe35590a4e01e91" +dependencies = [ + "buffer_sv2", + "derive_codec_sv2", +] + +[[package]] +name = "bitcoin" +version = "0.32.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e499f9fc0407f50fe98af744ab44fa67d409f76b6772e1689ec8485eb0c0f66" +dependencies = [ + "base58ck", + "bech32", + "bitcoin-internals 0.3.0", + "bitcoin-io", + "bitcoin-units", + "bitcoin_hashes 0.14.1", + "hex-conservative 0.2.2", + "hex_lit", + "secp256k1 0.29.1", +] + +[[package]] +name = "bitcoin-internals" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9425c3bf7089c983facbae04de54513cce73b41c7f9ff8c845b54e7bc64ebbfb" + +[[package]] +name = "bitcoin-internals" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30bdbe14aa07b06e6cfeffc529a1f099e5fbe249524f8125358604df99a4bed2" + +[[package]] +name = "bitcoin-io" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dee39a0ee5b4095224a0cfc6bf4cc1baf0f9624b96b367e53b66d974e51d953" + +[[package]] +name = "bitcoin-units" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5285c8bcaa25876d07f37e3d30c303f2609179716e11d688f51e8f1fe70063e2" +dependencies = [ + "bitcoin-internals 0.3.0", +] + +[[package]] +name = "bitcoin_hashes" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1930a4dabfebb8d7d9992db18ebe3ae2876f0a305fab206fd168df931ede293b" +dependencies = [ + "bitcoin-internals 0.2.0", + "hex-conservative 0.1.2", +] + +[[package]] +name = "bitcoin_hashes" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26ec84b80c482df901772e931a9a681e26a1b9ee2302edeff23cb30328745c8b" +dependencies = [ + "bitcoin-io", + "hex-conservative 0.2.2", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3" +dependencies = [ + "serde_core", +] + +[[package]] +name = "bitvec" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] + +[[package]] +name = "block-buffer" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +dependencies = [ + "generic-array", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bollard" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d41711ad46fda47cd701f6908e59d1bd6b9a2b7464c0d0aeab95c6d37096ff8a" +dependencies = [ + "base64 0.22.1", + "bollard-stubs", + "bytes", + "futures-core", + "futures-util", + "hex", + "http 1.4.0", + "http-body-util", + "hyper 1.8.1", + "hyper-named-pipe", + "hyper-util", + "hyperlocal", + "log", + "pin-project-lite", + "serde", + "serde_derive", + "serde_json", + "serde_repr", + "serde_urlencoded", + "thiserror", + "tokio", + "tokio-util", + "tower-service", + "url", + "winapi", +] + +[[package]] +name = "bollard-stubs" +version = "1.45.0-rc.26.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d7c5415e3a6bc6d3e99eff6268e488fd4ee25e7b28c10f08fa6760bd9de16e4" +dependencies = [ + "serde", + "serde_repr", + "serde_with", +] + +[[package]] +name = "bs58" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" +dependencies = [ + "sha2 0.9.9", +] + +[[package]] +name = "buffer_sv2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19781425841d2e217eb7ded68089b693b47c8f756eb02231c92122dbf505bcf0" +dependencies = [ + "aes-gcm", +] + +[[package]] +name = "bumpalo" +version = "3.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dd9dc738b7a8311c7ade152424974d8115f2cdad61e8dab8dac9f2362298510" + +[[package]] +name = "byte-slice-cast" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7575182f7272186991736b70173b0ea045398f984bf5ebbb3804736ce1330c9d" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b35204fbdc0b3f4446b89fc1ac2cf84a8a68971995d0bf2e925ec7cd960f9cb3" + +[[package]] +name = "cc" +version = "1.2.52" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd4932aefd12402b36c60956a4fe0035421f544799057659ff86f923657aada3" +dependencies = [ + "find-msvc-tools", + "shlex", +] + +[[package]] +name = "cfg-if" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" + +[[package]] +name = "chacha20" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3613f74bd2eac03dad61bd53dbe620703d4371614fe0bc3b9f04dd36fe4e818" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + +[[package]] +name = "chacha20poly1305" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10cd79432192d1c0f4e1a0fef9527696cc039165d729fb41b3f4f4f354c2dc35" +dependencies = [ + "aead", + "chacha20", + "cipher", + "poly1305", + "zeroize", +] + +[[package]] +name = "channels_sv2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8126fb7fa964e389bb4c58a4f30a0b40bffbc4e19e1daf97bd30479333aaf03" +dependencies = [ + "binary_sv2", + "bitcoin", + "common_messages_sv2", + "job_declaration_sv2", + "mining_sv2", + "primitive-types", + "template_distribution_sv2", + "tracing", +] + +[[package]] +name = "chrono" +version = "0.4.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "145052bdd345b87320e369255277e3fb5152762ad123a901ef5c262dd38fe8d2" +dependencies = [ + "iana-time-zone", + "num-traits", + "serde", + "windows-link", +] + +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", + "zeroize", +] + +[[package]] +name = "clap" +version = "4.5.54" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6e6ff9dcd79cff5cd969a17a545d79e84ab086e444102a591e288a8aa3ce394" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.5.54" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa42cf4d2b7a41bc8f663a7cab4031ebafa1bf3875705bfaf8466dc60ab52c00" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.5.49" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a0b5487afeab2deb2ff4e03a807ad1a03ac532ff5a2cee5d86884440c7f7671" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "clap_lex" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d728cc89cf3aee9ff92b05e62b19ee65a02b5702cff7d5a377e32c6ae29d8d" + +[[package]] +name = "codec_sv2" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b49f810da79b58afa272d92de8fc2d660f2cff4ff59e79f3c79e93fc14eaa30" +dependencies = [ + "binary_sv2", + "buffer_sv2", + "framing_sv2", + "noise_sv2", + "rand", + "tracing", +] + +[[package]] +name = "colorchoice" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" + +[[package]] +name = "common_messages_sv2" +version = "6.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d69c5482a3113af07ccc05b2379f6ec33a305d28a380ddefdaa8390f39d2737" +dependencies = [ + "binary_sv2", +] + +[[package]] +name = "concurrent-queue" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "config" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68578f196d2a33ff61b27fae256c3164f65e36382648e30666dde05b8cc9dfdf" +dependencies = [ + "async-trait", + "convert_case", + "json5", + "nom", + "pathdiff", + "ron", + "rust-ini", + "serde", + "serde_json", + "toml", + "yaml-rust2", +] + +[[package]] +name = "const-random" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87e00182fe74b066627d63b85fd550ac2998d4b0bd86bfed477a0ae4c7c71359" +dependencies = [ + "const-random-macro", +] + +[[package]] +name = "const-random-macro" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9d839f2a20b0aee515dc581a6172f2321f96cab76c1a38a4c584a194955390e" +dependencies = [ + "getrandom", + "once_cell", + "tiny-keccak", +] + +[[package]] +name = "const_format" +version = "0.2.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7faa7469a93a566e9ccc1c73fe783b4a65c274c5ace346038dca9c39fe0030ad" +dependencies = [ + "const_format_proc_macros", +] + +[[package]] +name = "const_format_proc_macros" +version = "0.2.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d57c2eccfb16dbac1f4e61e206105db5820c9d26c3c472bc17c774259ef7744" +dependencies = [ + "proc-macro2", + "quote", + "unicode-xid", +] + +[[package]] +name = "convert_case" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" + +[[package]] +name = "crunchy" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" + +[[package]] +name = "crypto-common" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "ctr" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" +dependencies = [ + "cipher", +] + +[[package]] +name = "data-encoding" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a2330da5de22e8a3cb63252ce2abb30116bf5265e89c0e01bc17015ce30a476" + +[[package]] +name = "deranged" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ececcb659e7ba858fb4f10388c250a7252eb0a27373f1a72b8748afdd248e587" +dependencies = [ + "powerfmt", + "serde_core", +] + +[[package]] +name = "derive_codec_sv2" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40d67b9d87d96ca3b35000ad98ac7d940ebf8f93527229c5fc0938b0a013ea9e" + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer 0.10.4", + "crypto-common", +] + +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "dlv-list" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "442039f5147480ba31067cb00ada1adae6892028e40e45fc5de7b7df6dcc1b5f" +dependencies = [ + "const-random", +] + +[[package]] +name = "dotenv" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f" + +[[package]] +name = "dyn-clone" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555" + +[[package]] +name = "encoding_rs" +version = "0.8.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "env_filter" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bf3c259d255ca70051b30e2e95b5446cdb8949ac4cd22c0d7fd634d89f568e2" +dependencies = [ + "log", + "regex", +] + +[[package]] +name = "env_logger" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c863f0904021b108aa8b2f55046443e6b1ebde8fd4a15c399893aae4fa069f" +dependencies = [ + "anstream", + "anstyle", + "env_filter", + "jiff", + "log", +] + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "errno" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "event-listener" +version = "2.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" + +[[package]] +name = "extensions_sv2" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52676d4f06dcff3e023691931244c6502adc100c2071fd55e05086f9a984613f" +dependencies = [ + "binary_sv2", +] + +[[package]] +name = "filetime" +version = "0.2.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc0505cd1b6fa6580283f6bdf70a73fcf4aba1184038c90902b92b3dd0df63ed" +dependencies = [ + "cfg-if", + "libc", + "libredox", + "windows-sys 0.60.2", +] + +[[package]] +name = "find-msvc-tools" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f449e6c6c08c865631d4890cfacf252b3d396c9bcc83adb6623cdb02a8336c41" + +[[package]] +name = "fixed-hash" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" +dependencies = [ + "byteorder", + "rand", + "rustc-hex", + "static_assertions", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "form_urlencoded" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "framing_sv2" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcb9bc71fc9a58bf9a204fb495e7df918be2ca90a63eb361d0c940a1ebc73ce4" +dependencies = [ + "binary_sv2", + "buffer_sv2", + "noise_sv2", +] + +[[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + +[[package]] +name = "futures" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" + +[[package]] +name = "futures-executor" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" + +[[package]] +name = "futures-macro" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "futures-sink" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" + +[[package]] +name = "futures-task" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" + +[[package]] +name = "futures-util" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "ghash" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0d8a4362ccb29cb0b265253fb0a2728f592895ee6854fd9bc13f2ffda266ff1" +dependencies = [ + "opaque-debug", + "polyval", +] + +[[package]] +name = "h2" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0beca50380b1fc32983fc1cb4587bfa4bb9e78fc259aad4a0032d2080309222d" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http 0.2.12", + "indexmap 2.13.0", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "handlers_sv2" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b73e08225626d04daa23a46fa9e072d962e0fbcfd1a0a75e31cfdd19e771c7ef" +dependencies = [ + "binary_sv2", + "common_messages_sv2", + "extensions_sv2", + "framing_sv2", + "job_declaration_sv2", + "mining_sv2", + "parsers_sv2", + "template_distribution_sv2", + "trait-variant", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash", + "allocator-api2", +] + +[[package]] +name = "hashbrown" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" + +[[package]] +name = "hashlink" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" +dependencies = [ + "hashbrown 0.14.5", +] + +[[package]] +name = "headers" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06683b93020a07e3dbcf5f8c0f6d40080d725bea7936fc01ad345c01b97dc270" +dependencies = [ + "base64 0.21.7", + "bytes", + "headers-core", + "http 0.2.12", + "httpdate", + "mime", + "sha1", +] + +[[package]] +name = "headers-core" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7f66481bfee273957b1f20485a4ff3362987f85b2c236580d81b4eb7a326429" +dependencies = [ + "http 0.2.12", +] + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hex-conservative" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "212ab92002354b4819390025006c897e8140934349e8635c9b077f47b4dcbd20" + +[[package]] +name = "hex-conservative" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fda06d18ac606267c40c04e41b9947729bf8b9efe74bd4e82b61a5f26a510b9f" +dependencies = [ + "arrayvec", +] + +[[package]] +name = "hex-conservative" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "366fa3443ac84474447710ec17bb00b05dfbd096137817981e86f992f21a2793" + +[[package]] +name = "hex_lit" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3011d1213f159867b13cfd6ac92d2cd5f1345762c63be3554e84092d85a50bbd" + +[[package]] +name = "http" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3ba2a386d7f85a81f119ad7498ebe444d2e22c2af0b86b069416ace48b3311a" +dependencies = [ + "bytes", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +dependencies = [ + "bytes", + "http 0.2.12", + "pin-project-lite", +] + +[[package]] +name = "http-body" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +dependencies = [ + "bytes", + "http 1.4.0", +] + +[[package]] +name = "http-body-util" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" +dependencies = [ + "bytes", + "futures-core", + "http 1.4.0", + "http-body 1.0.1", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "hyper" +version = "0.14.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41dfc780fdec9373c01bae43289ea34c972e40ee3c9f6b3c8801a35f35586ce7" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http 0.2.12", + "http-body 0.4.6", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2 0.5.10", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ab2d4f250c3d7b1c9fcdff1cece94ea4e2dfbec68614f7b87cb205f24ca9d11" +dependencies = [ + "atomic-waker", + "bytes", + "futures-channel", + "futures-core", + "http 1.4.0", + "http-body 1.0.1", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "pin-utils", + "smallvec", + "tokio", + "want", +] + +[[package]] +name = "hyper-named-pipe" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73b7d8abf35697b81a825e386fc151e0d503e8cb5fcb93cc8669c376dfd6f278" +dependencies = [ + "hex", + "hyper 1.8.1", + "hyper-util", + "pin-project-lite", + "tokio", + "tower-service", + "winapi", +] + +[[package]] +name = "hyper-rustls" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" +dependencies = [ + "futures-util", + "http 0.2.12", + "hyper 0.14.32", + "rustls", + "tokio", + "tokio-rustls", +] + +[[package]] +name = "hyper-util" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "727805d60e7938b76b826a6ef209eb70eaa1812794f9424d4a4e2d740662df5f" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "http 1.4.0", + "http-body 1.0.1", + "hyper 1.8.1", + "libc", + "pin-project-lite", + "socket2 0.6.1", + "tokio", + "tower-service", + "tracing", +] + +[[package]] +name = "hyperlocal" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "986c5ce3b994526b3cd75578e62554abd09f0899d6206de48b3e96ab34ccc8c7" +dependencies = [ + "hex", + "http-body-util", + "hyper 1.8.1", + "hyper-util", + "pin-project-lite", + "tokio", + "tower-service", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33e57f83510bb73707521ebaffa789ec8caf86f9657cad665b092b581d40e9fb" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "log", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "icu_collections" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c6b649701667bbe825c3b7e6388cb521c23d88644678e83c0c4d0a621a34b43" +dependencies = [ + "displaydoc", + "potential_utf", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locale_core" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edba7861004dd3714265b4db54a3c390e880ab658fec5f7db895fae2046b5bb6" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_normalizer" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f6c8828b67bf8908d82127b2054ea1b4427ff0230ee9141c54251934ab1b599" +dependencies = [ + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7aedcccd01fc5fe81e6b489c15b247b8b0690feb23304303a9e560f37efc560a" + +[[package]] +name = "icu_properties" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "020bfc02fe870ec3a66d93e677ccca0562506e5872c650f893269e08615d74ec" +dependencies = [ + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "616c294cf8d725c6afcd8f55abc17c56464ef6211f9ed59cccffe534129c77af" + +[[package]] +name = "icu_provider" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85962cf0ce02e1e0a629cc34e7ca3e373ce20dda4c4d7294bbd0bf1fdb59e614" +dependencies = [ + "displaydoc", + "icu_locale_core", + "writeable", + "yoke", + "zerofrom", + "zerotrie", + "zerovec", +] + +[[package]] +name = "idna" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "impl-codec" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d40b9d5e17727407e55028eafc22b2dc68781786e6d7eb8a21103f5058e3a14" +dependencies = [ + "parity-scale-codec", +] + +[[package]] +name = "impl-trait-for-tuples" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0eb5a3343abf848c0984fe4604b2b105da9539376e24fc0a3b0007411ae4fd9" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", + "serde", +] + +[[package]] +name = "indexmap" +version = "2.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017" +dependencies = [ + "equivalent", + "hashbrown 0.16.1", + "serde", + "serde_core", +] + +[[package]] +name = "inout" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" +dependencies = [ + "generic-array", +] + +[[package]] +name = "ipnet" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" + +[[package]] +name = "itoa" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2" + +[[package]] +name = "jiff" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e67e8da4c49d6d9909fe03361f9b620f58898859f5c7aded68351e85e71ecf50" +dependencies = [ + "jiff-static", + "log", + "portable-atomic", + "portable-atomic-util", + "serde_core", +] + +[[package]] +name = "jiff-static" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0c84ee7f197eca9a86c6fd6cb771e55eb991632f15f2bc3ca6ec838929e6e78" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "job_declaration_sv2" +version = "5.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85d646bc73f60256a3e4d838cfd5cded1b65f6b43890f5755ec37d9e85ed9512" +dependencies = [ + "binary_sv2", +] + +[[package]] +name = "js-sys" +version = "0.3.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "464a3709c7f55f1f721e5389aa6ea4e3bc6aba669353300af094b29ffbdde1d8" +dependencies = [ + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "json5" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96b0db21af676c1ce64250b5f40f3ce2cf27e4e47cb91ed91eb6fe9350b430c1" +dependencies = [ + "pest", + "pest_derive", + "serde", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "libc" +version = "0.2.180" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcc35a38544a891a5f7c865aca548a982ccb3b8650a5b06d0fd33a10283c56fc" + +[[package]] +name = "libredox" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d0b95e02c851351f877147b7deea7b1afb1df71b63aa5f8270716e0c5720616" +dependencies = [ + "bitflags 2.10.0", + "libc", + "redox_syscall 0.7.0", +] + +[[package]] +name = "linux-raw-sys" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039" + +[[package]] +name = "litemap" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6373607a59f0be73a39b6fe456b8192fcc3585f602af20751600e974dd455e77" + +[[package]] +name = "lock_api" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" +dependencies = [ + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" + +[[package]] +name = "log-server" +version = "0.1.0" +dependencies = [ + "bollard", + "dotenv", + "env_logger", + "log", + "reqwest", + "serde", + "tar", + "tokio", + "warp", +] + +[[package]] +name = "matchers" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1525a2a28c7f4fa0fc98bb91ae755d1e2d1505079e05539e35bc876b5d65ae9" +dependencies = [ + "regex-automata", +] + +[[package]] +name = "memchr" +version = "2.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "mime_guess" +version = "2.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" +dependencies = [ + "mime", + "unicase", +] + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "mining_sv2" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9e59f7d006e171860993d1e964910560e6c7fe7e7f0faa3b07cfdefcb3e330d" +dependencies = [ + "binary_sv2", +] + +[[package]] +name = "miniscript" +version = "13.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "867b1f11e0545ad5ebbddd8a9f18756d9657a6758bf10d96cf15ddd0b726b650" +dependencies = [ + "bech32", + "bitcoin", + "hex-conservative 1.0.1", +] + +[[package]] +name = "mio" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a69bcab0ad47271a0234d9422b131806bf3968021e5dc9328caf2d4cd58557fc" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.61.2", +] + +[[package]] +name = "multer" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01acbdc23469fd8fe07ab135923371d5f5a422fbf9c522158677c8eb15bc51c2" +dependencies = [ + "bytes", + "encoding_rs", + "futures-util", + "http 0.2.12", + "httparse", + "log", + "memchr", + "mime", + "spin", + "version_check", +] + +[[package]] +name = "noise_sv2" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30964f9fbc4572bb5a1b0046176331d20e9ce6de0ca18afc3cfd42c6e91a94aa" +dependencies = [ + "aes-gcm", + "chacha20poly1305", + "rand", + "rand_chacha", + "secp256k1 0.28.2", +] + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "nu-ansi-term" +version = "0.50.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" + +[[package]] +name = "once_cell_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" + +[[package]] +name = "opaque-debug" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" + +[[package]] +name = "ordered-multimap" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49203cdcae0030493bad186b28da2fa25645fa276a51b6fec8010d281e02ef79" +dependencies = [ + "dlv-list", + "hashbrown 0.14.5", +] + +[[package]] +name = "parity-scale-codec" +version = "3.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "799781ae679d79a948e13d4824a40970bfa500058d245760dd857301059810fa" +dependencies = [ + "arrayvec", + "bitvec", + "byte-slice-cast", + "const_format", + "impl-trait-for-tuples", + "parity-scale-codec-derive", + "rustversion", + "serde", +] + +[[package]] +name = "parity-scale-codec-derive" +version = "3.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34b4653168b563151153c9e4c08ebed57fb8262bebfa79711552fa983c623e7a" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "parking_lot" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall 0.5.18", + "smallvec", + "windows-link", +] + +[[package]] +name = "parsers_sv2" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7b1e117075e18644dbf72fbaf7a668c2997fb35676fbe5923409aaf2216d021" +dependencies = [ + "binary_sv2", + "common_messages_sv2", + "extensions_sv2", + "framing_sv2", + "job_declaration_sv2", + "mining_sv2", + "template_distribution_sv2", +] + +[[package]] +name = "pathdiff" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df94ce210e5bc13cb6651479fa48d14f601d9858cfe0467f43ae157023b938d3" + +[[package]] +name = "percent-encoding" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" + +[[package]] +name = "pest" +version = "2.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c9eb05c21a464ea704b53158d358a31e6425db2f63a1a7312268b05fe2b75f7" +dependencies = [ + "memchr", + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68f9dbced329c441fa79d80472764b1a2c7e57123553b8519b36663a2fb234ed" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3bb96d5051a78f44f43c8f712d8e810adb0ebf923fc9ed2655a7f66f63ba8ee5" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "pest_meta" +version = "2.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "602113b5b5e8621770cfd490cfd90b9f84ab29bd2b0e49ad83eb6d186cef2365" +dependencies = [ + "pest", + "sha2 0.10.9", +] + +[[package]] +name = "pin-project" +version = "1.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677f1add503faace112b9f1373e43e9e054bfdd22ff1a63c1bc485eaec6a6a8a" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "poly1305" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8159bd90725d2df49889a078b54f4f79e87f1f8a8444194cdca81d38f5393abf" +dependencies = [ + "cpufeatures", + "opaque-debug", + "universal-hash", +] + +[[package]] +name = "polyval" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d1fe60d06143b2430aa532c94cfe9e29783047f06c0d7fd359a9a51b729fa25" +dependencies = [ + "cfg-if", + "cpufeatures", + "opaque-debug", + "universal-hash", +] + +[[package]] +name = "pools-latency-calculator" +version = "0.1.1" +dependencies = [ + "env_logger", + "log", + "prometheus", + "serde", + "serde_json", + "tokio", + "warp", +] + +[[package]] +name = "portable-atomic" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f89776e4d69bb58bc6993e99ffa1d11f228b839984854c7daeb5d37f87cbe950" + +[[package]] +name = "portable-atomic-util" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8a2f0d8d040d7848a709caf78912debcc3f33ee4b3cac47d73d1e1069e83507" +dependencies = [ + "portable-atomic", +] + +[[package]] +name = "potential_utf" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b73949432f5e2a09657003c25bca5e19a0e9c84f8058ca374f49e0ebe605af77" +dependencies = [ + "zerovec", +] + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "primitive-types" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d15600a7d856470b7d278b3fe0e311fe28c2526348549f8ef2ff7db3299c87f5" +dependencies = [ + "fixed-hash", + "impl-codec", + "uint", +] + +[[package]] +name = "proc-macro-crate" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "219cb19e96be00ab2e37d6e299658a0cfa83e52429179969b0f0121b4ac46983" +dependencies = [ + "toml_edit 0.23.10+spec-1.0.0", +] + +[[package]] +name = "proc-macro2" +version = "1.0.105" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "535d180e0ecab6268a3e718bb9fd44db66bbbc256257165fc699dadf70d16fe7" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "prometheus" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d33c28a30771f7f96db69893f78b857f7450d7e0237e9c8fc6427a81bae7ed1" +dependencies = [ + "cfg-if", + "fnv", + "lazy_static", + "memchr", + "parking_lot", + "protobuf", + "thiserror", +] + +[[package]] +name = "protobuf" +version = "2.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "106dd99e98437432fed6519dedecfade6a06a73bb7b2a1e019fdd2bee5778d94" + +[[package]] +name = "quote" +version = "1.0.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc74d9a594b72ae6656596548f56f667211f8a97b3d4c3d467150794690dc40a" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "redox_syscall" +version = "0.5.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" +dependencies = [ + "bitflags 2.10.0", +] + +[[package]] +name = "redox_syscall" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f3fe0889e69e2ae9e41f4d6c4c0181701d00e4697b356fb1f74173a5e0ee27" +dependencies = [ + "bitflags 2.10.0", +] + +[[package]] +name = "ref-cast" +version = "1.0.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f354300ae66f76f1c85c5f84693f0ce81d747e2c3f21a45fef496d89c960bf7d" +dependencies = [ + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7186006dcb21920990093f30e3dea63b7d6e977bf1256be20c3563a5db070da" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "regex" +version = "1.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "843bc0191f75f3e22651ae5f1e72939ab2f72a4bc30fa80a066bd66edefc24d4" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5276caf25ac86c8d810222b3dbb938e512c55c6831a10f3e6ed1c93b84041f1c" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58" + +[[package]] +name = "reqwest" +version = "0.11.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" +dependencies = [ + "base64 0.21.7", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http 0.2.12", + "http-body 0.4.6", + "hyper 0.14.32", + "hyper-rustls", + "ipnet", + "js-sys", + "log", + "mime", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls", + "rustls-pemfile", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper", + "system-configuration", + "tokio", + "tokio-rustls", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "webpki-roots", + "winreg", +] + +[[package]] +name = "ring" +version = "0.17.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" +dependencies = [ + "cc", + "cfg-if", + "getrandom", + "libc", + "untrusted", + "windows-sys 0.52.0", +] + +[[package]] +name = "ron" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b91f7eff05f748767f183df4320a63d6936e9c6107d97c9e6bdd9784f4289c94" +dependencies = [ + "base64 0.21.7", + "bitflags 2.10.0", + "serde", + "serde_derive", +] + +[[package]] +name = "rust-ini" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e0698206bcb8882bf2a9ecb4c1e7785db57ff052297085a6efd4fe42302068a" +dependencies = [ + "cfg-if", + "ordered-multimap", +] + +[[package]] +name = "rustc-hex" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" + +[[package]] +name = "rustix" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "146c9e247ccc180c1f61615433868c99f3de3ae256a30a43b49f67c2d9171f34" +dependencies = [ + "bitflags 2.10.0", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.61.2", +] + +[[package]] +name = "rustls" +version = "0.21.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" +dependencies = [ + "log", + "ring", + "rustls-webpki", + "sct", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +dependencies = [ + "base64 0.21.7", +] + +[[package]] +name = "rustls-webpki" +version = "0.101.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "rustversion" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" + +[[package]] +name = "ryu" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a50f4cf475b65d88e057964e0e9bb1f0aa9bbb2036dc65c64596b42932536984" + +[[package]] +name = "schemars" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd191f9397d57d581cddd31014772520aa448f65ef991055d7f61582c65165f" +dependencies = [ + "dyn-clone", + "ref-cast", + "serde", + "serde_json", +] + +[[package]] +name = "schemars" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54e910108742c57a770f492731f99be216a52fadd361b06c8fb59d74ccc267d2" +dependencies = [ + "dyn-clone", + "ref-cast", + "serde", + "serde_json", +] + +[[package]] +name = "scoped-tls" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "sct" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "secp256k1" +version = "0.28.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d24b59d129cdadea20aea4fb2352fa053712e5d713eee47d700cd4b2bc002f10" +dependencies = [ + "bitcoin_hashes 0.13.0", + "rand", + "secp256k1-sys 0.9.2", +] + +[[package]] +name = "secp256k1" +version = "0.29.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9465315bc9d4566e1724f0fffcbcc446268cb522e60f9a27bcded6b19c108113" +dependencies = [ + "bitcoin_hashes 0.14.1", + "secp256k1-sys 0.10.1", +] + +[[package]] +name = "secp256k1-sys" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5d1746aae42c19d583c3c1a8c646bfad910498e2051c551a7f2e3c0c9fbb7eb" +dependencies = [ + "cc", +] + +[[package]] +name = "secp256k1-sys" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4387882333d3aa8cb20530a17c69a3752e97837832f34f6dccc760e715001d9" +dependencies = [ + "cc", +] + +[[package]] +name = "serde" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.149" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" +dependencies = [ + "itoa", + "memchr", + "serde", + "serde_core", + "zmij", +] + +[[package]] +name = "serde_repr" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "175ee3e80ae9982737ca543e96133087cbd9a485eecc3bc4de9c1a37b47ea59c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_spanned" +version = "0.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_with" +version = "3.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fa237f2807440d238e0364a218270b98f767a00d3dada77b1c53ae88940e2e7" +dependencies = [ + "base64 0.22.1", + "chrono", + "hex", + "indexmap 1.9.3", + "indexmap 2.13.0", + "schemars 0.9.0", + "schemars 1.2.0", + "serde_core", + "serde_json", + "time", +] + +[[package]] +name = "sha1" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.7", +] + +[[package]] +name = "sha2" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if", + "cpufeatures", + "digest 0.9.0", + "opaque-debug", +] + +[[package]] +name = "sha2" +version = "0.10.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.7", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signal-hook-registry" +version = "1.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b" +dependencies = [ + "errno", + "libc", +] + +[[package]] +name = "slab" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589" + +[[package]] +name = "smallvec" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" + +[[package]] +name = "socket2" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e22376abed350d73dd1cd119b57ffccad95b4e585a7cda43e286245ce23c0678" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "socket2" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17129e116933cf371d018bb80ae557e889637989d8638274fb25622827b03881" +dependencies = [ + "libc", + "windows-sys 0.60.2", +] + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + +[[package]] +name = "stable_deref_trait" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "stratum-apps" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa8635e5ecbad8baae30be53a4509862d9cd0d602f211d09da29ddbfd57d0a71" +dependencies = [ + "async-channel", + "bs58", + "clap", + "config", + "futures", + "generic-array", + "miniscript", + "rand", + "rustversion", + "secp256k1 0.28.2", + "serde", + "stratum-core", + "tokio", + "tokio-util", + "tracing", + "tracing-subscriber", +] + +[[package]] +name = "stratum-core" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "076131541157a4992aafb852a166008c234c3d7e0bd5c78bdb77fcbf4500ae71" +dependencies = [ + "binary_sv2", + "bitcoin", + "buffer_sv2", + "channels_sv2", + "codec_sv2", + "common_messages_sv2", + "extensions_sv2", + "framing_sv2", + "handlers_sv2", + "job_declaration_sv2", + "mining_sv2", + "noise_sv2", + "parsers_sv2", + "template_distribution_sv2", +] + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "sv1-custom-proxy" +version = "0.1.0" +dependencies = [ + "env_logger", + "hex", + "hyper 0.14.32", + "log", + "prometheus", + "reqwest", + "serde", + "serde_json", + "tokio", + "tracing", + "tracing-subscriber", + "urlencoding", + "warp", +] + +[[package]] +name = "sv2-custom-proxy" +version = "0.2.0" +dependencies = [ + "dotenv", + "env_logger", + "hex", + "log", + "prometheus", + "reqwest", + "serde_json", + "stratum-apps", + "tokio", + "warp", +] + +[[package]] +name = "syn" +version = "2.0.114" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4d107df263a3013ef9b1879b0df87d706ff80f65a86ea879bd9c31f9b307c2a" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sync_wrapper" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + +[[package]] +name = "synstructure" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "system-configuration" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + +[[package]] +name = "tar" +version = "0.4.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d863878d212c87a19c1a610eb53bb01fe12951c0501cf5a0d65f724914a667a" +dependencies = [ + "filetime", + "libc", + "xattr", +] + +[[package]] +name = "template_distribution_sv2" +version = "4.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19035b2f7e6532d3c8a865f78c641865b8acf6e688a4a0cec4c1f1a036f82876" +dependencies = [ + "binary_sv2", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "thread_local" +version = "1.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f60246a4944f24f6e018aa17cdeffb7818b76356965d03b07d6a9886e8962185" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "time" +version = "0.3.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e7d9e3bb61134e77bde20dd4825b97c010155709965fedf0f49bb138e52a9d" +dependencies = [ + "deranged", + "itoa", + "num-conv", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40868e7c1d2f0b8d73e4a8c7f0ff63af4f6d19be117e90bd73eb1d62cf831c6b" + +[[package]] +name = "time-macros" +version = "0.2.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30cfb0125f12d9c277f35663a0a33f8c30190f4e4574868a330595412d34ebf3" +dependencies = [ + "num-conv", + "time-core", +] + +[[package]] +name = "tiny-keccak" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" +dependencies = [ + "crunchy", +] + +[[package]] +name = "tinystr" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42d3e9c45c09de15d06dd8acf5f4e0e399e85927b7f00711024eb7ae10fa4869" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tokio" +version = "1.49.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72a2903cd7736441aac9df9d7688bd0ce48edccaadf181c3b90be801e81d3d86" +dependencies = [ + "bytes", + "libc", + "mio", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2 0.6.1", + "tokio-macros", + "tracing", + "windows-sys 0.61.2", +] + +[[package]] +name = "tokio-macros" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af407857209536a95c8e56f8231ef2c2e2aff839b22e07a1ffcbc617e9db9fa5" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tokio-rustls" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +dependencies = [ + "rustls", + "tokio", +] + +[[package]] +name = "tokio-tungstenite" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c83b561d025642014097b66e6c1bb422783339e0909e4429cde4749d1990bc38" +dependencies = [ + "futures-util", + "log", + "tokio", + "tungstenite", +] + +[[package]] +name = "tokio-util" +version = "0.7.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ae9cec805b01e8fc3fd2fe289f89149a9b66dd16786abd8b19cfa7b48cb0098" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "toml" +version = "0.8.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime 0.6.11", + "toml_edit 0.22.27", +] + +[[package]] +name = "toml_datetime" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_datetime" +version = "0.7.5+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92e1cfed4a3038bc5a127e35a2d360f145e1f4b971b551a2ba5fd7aedf7e1347" +dependencies = [ + "serde_core", +] + +[[package]] +name = "toml_edit" +version = "0.22.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" +dependencies = [ + "indexmap 2.13.0", + "serde", + "serde_spanned", + "toml_datetime 0.6.11", + "toml_write", + "winnow", +] + +[[package]] +name = "toml_edit" +version = "0.23.10+spec-1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84c8b9f757e028cee9fa244aea147aab2a9ec09d5325a9b01e0a49730c2b5269" +dependencies = [ + "indexmap 2.13.0", + "toml_datetime 0.7.5+spec-1.1.0", + "toml_parser", + "winnow", +] + +[[package]] +name = "toml_parser" +version = "1.0.6+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3198b4b0a8e11f09dd03e133c0280504d0801269e9afa46362ffde1cbeebf44" +dependencies = [ + "winnow", +] + +[[package]] +name = "toml_write" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801" + +[[package]] +name = "tower-service" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" + +[[package]] +name = "tracing" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" +dependencies = [ + "log", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tracing-core" +version = "0.1.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f30143827ddab0d256fd843b7a66d164e9f271cfa0dde49142c5ca0ca291f1e" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex-automata", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", +] + +[[package]] +name = "trait-variant" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70977707304198400eb4835a78f6a9f928bf41bba420deb8fdb175cd965d77a7" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "tungstenite" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ef1a641ea34f399a848dea702823bbecfb4c486f911735368f1f137cb8257e1" +dependencies = [ + "byteorder", + "bytes", + "data-encoding", + "http 1.4.0", + "httparse", + "log", + "rand", + "sha1", + "thiserror", + "url", + "utf-8", +] + +[[package]] +name = "typenum" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb" + +[[package]] +name = "ucd-trie" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" + +[[package]] +name = "uint" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "909988d098b2f738727b161a106cfc7cab00c539c2687a8836f8e565976fb53e" +dependencies = [ + "byteorder", + "crunchy", + "hex", + "static_assertions", +] + +[[package]] +name = "unicase" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbc4bc3a9f746d862c45cb89d705aa10f187bb96c76001afab07a0d35ce60142" + +[[package]] +name = "unicode-ident" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" + +[[package]] +name = "unicode-segmentation" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" + +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + +[[package]] +name = "universal-hash" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" +dependencies = [ + "crypto-common", + "subtle", +] + +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "url" +version = "2.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", +] + +[[package]] +name = "urlencoding" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" + +[[package]] +name = "utf-8" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "valuable" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[package]] +name = "warp" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4378d202ff965b011c64817db11d5829506d3404edeadb61f190d111da3f231c" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "headers", + "http 0.2.12", + "hyper 0.14.32", + "log", + "mime", + "mime_guess", + "multer", + "percent-encoding", + "pin-project", + "scoped-tls", + "serde", + "serde_json", + "serde_urlencoded", + "tokio", + "tokio-tungstenite", + "tokio-util", + "tower-service", + "tracing", +] + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "wasm-bindgen" +version = "0.2.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d759f433fa64a2d763d1340820e46e111a7a5ab75f993d1852d70b03dbb80fd" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "836d9622d604feee9e5de25ac10e3ea5f2d65b41eac0d9ce72eb5deae707ce7c" +dependencies = [ + "cfg-if", + "js-sys", + "once_cell", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48cb0d2638f8baedbc542ed444afc0644a29166f1595371af4fecf8ce1e7eeb3" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cefb59d5cd5f92d9dcf80e4683949f15ca4b511f4ac0a6e14d4e1ac60c6ecd40" +dependencies = [ + "bumpalo", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbc538057e648b67f72a982e708d485b2efa771e1ac05fec311f9f63e5800db4" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "web-sys" +version = "0.3.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b32828d774c412041098d182a8b38b16ea816958e07cf40eec2bc080ae137ac" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki-roots" +version = "0.25.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-core" +version = "0.62.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-link", + "windows-result", + "windows-strings", +] + +[[package]] +name = "windows-implement" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-interface" +version = "0.59.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-result" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.60.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" +dependencies = [ + "windows-targets 0.53.5", +] + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm 0.52.6", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.53.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" +dependencies = [ + "windows-link", + "windows_aarch64_gnullvm 0.53.1", + "windows_aarch64_msvc 0.53.1", + "windows_i686_gnu 0.53.1", + "windows_i686_gnullvm 0.53.1", + "windows_i686_msvc 0.53.1", + "windows_x86_64_gnu 0.53.1", + "windows_x86_64_gnullvm 0.53.1", + "windows_x86_64_msvc 0.53.1", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_i686_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" + +[[package]] +name = "winnow" +version = "0.7.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a5364e9d77fcdeeaa6062ced926ee3381faa2ee02d3eb83a5c27a8825540829" +dependencies = [ + "memchr", +] + +[[package]] +name = "winreg" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +dependencies = [ + "cfg-if", + "windows-sys 0.48.0", +] + +[[package]] +name = "writeable" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9" + +[[package]] +name = "wyz" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] + +[[package]] +name = "xattr" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32e45ad4206f6d2479085147f02bc2ef834ac85886624a23575ae137c8aa8156" +dependencies = [ + "libc", + "rustix", +] + +[[package]] +name = "yaml-rust2" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8902160c4e6f2fb145dbe9d6760a75e3c9522d8bf796ed7047c85919ac7115f8" +dependencies = [ + "arraydeque", + "encoding_rs", + "hashlink", +] + +[[package]] +name = "yoke" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72d6e5c6afb84d73944e5cedb052c4680d5657337201555f9f2a16b7406d4954" +dependencies = [ + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b659052874eb698efe5b9e8cf382204678a0086ebf46982b79d6ca3182927e5d" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zerocopy" +version = "0.8.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "668f5168d10b9ee831de31933dc111a459c97ec93225beb307aed970d1372dfd" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c7962b26b0a8685668b671ee4b54d007a67d4eaf05fda79ac0ecf41e32270f1" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zerofrom" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zeroize" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" + +[[package]] +name = "zerotrie" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a59c17a5562d507e4b54960e8569ebee33bee890c70aa3fe7b97e85a9fd7851" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.11.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c28719294829477f525be0186d13efa9a3c602f7ec202ca9e353d310fb9a002" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eadce39539ca5cb3985590102671f2567e659fca9666581ad3411d59207951f3" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zmij" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fc5a66a20078bf1251bde995aa2fdcc4b800c70b5d92dd2c62abc5c60f679f8" diff --git a/README.md b/README.md index 0256804..1042aaf 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,7 @@ To promote the adoption of Stratum V2, a comprehensive benchmarking tool is need ## 🐳 Prerequisites 1. Install Docker on your system: https://docs.docker.com/engine/install/ +2. The tool will build Bitcoin Core v30 from source during the first setup (this may take some time) ## ⛏️ Getting Started @@ -58,7 +59,16 @@ For the easiest setup, use the provided script to automatically configure and st ./run-benchmarking-tool.sh ``` - The script will guide you through the process, allowing you to select configurations, networks, and other parameters interactively. + The script will guide you through the process, allowing you to: + - Select configuration (A or C) + - Choose network (mainnet, testnet3, or testnet4) + - Set hashrate for SV2 + - Configure custom Bitcoin address for coinbase transactions + - Customize pool signature + - Set minimum interval for template updates (default: 30 seconds) + - Choose log level + + The script will automatically generate a `.env` file with all the necessary environment variables. ### Manual Setup 🛠 @@ -71,37 +81,25 @@ If you prefer to set up the benchmarking tool manually, follow these detailed st ``` 2. **Configure the benchmarking parameters**: - To configure the benchmarking tool, you'll need to update several parameters based on your specific requirements: - - *Network*: choose between `mainnet`, `testnet3`, or `testnet4` - - Edit the `NETWORK` parameter in [.env](.env) and enter the network you want to use for the benchmarks - - 🚨 If you are going to use `mainnet`, you need to leave an empty string there --> `NETWORK=` + The benchmarking tool will prompt you for all configuration parameters when you run it. The `.env` file is automatically generated by the script based on your inputs. - - *SV2 block templates refresh interval*: specify frequency in which you will get refreshed block templates for SV2 - - Edit the `SV2_INTERVAL` parameter in [.env](.env) and enter the number of seconds you desire + When you run `./run-benchmarking-tool.sh`, you will be prompted for: - 🚨 The `SV1 Pool` used in the benchmarking tool will generate a new block template every 60 seconds. Note that this value will affect the bandwidth used and tracked (especially in `configuration C`) - - - *Hashrate*: specify the hashrate you're going to point to the tool for SV2 - - Edit the `min_individual_miner_hashrate` and `channel_nominal_hashrate` parameters placed in: - - [custom-configs/config-a/sri-roles/tproxy-config-a-docker-example.toml](custom-configs/sri-roles/config-a/tproxy-config-a-docker-example.toml) - - [custom-configs/config-c/sri-roles/tproxy-config-c-docker-example.toml](custom-configs/sri-roles/config-c/tproxy-config-c-docker-example.toml) + - *Configuration*: Choose between `A` (JDC - Job Declaration Client) or `C` (Pool-only) + - *Network*: Choose between `mainnet`, `testnet3`, or `testnet4` + - 🚨 If you are going to use `mainnet`, leave it empty when prompted + + - *Hashrate*: Specify the real hashrate of your miner that will connect to Stratum V2 + - 👉 E.g. for a 100 Th/s machine, enter: `100000000000000` or `100_000_000_000_000` - 👉 E.g. for a 100 Th/s machine, you will need to set `100_000_000_000_000.0` + - *Template Provider Interval*: Minimum time (in seconds) between block template updates (default: 60) - - *Coinbase tx output*: enter your custom `public key` (or `redeem script`) with the `script_type` to be used as output in the coinbase transaction - - Edit the `coinbase_output` parameter placed in: - - [custom-configs/sri-roles/config-a/jds-config-a-docker-example.toml](custom-configs/sri-roles/config-a/jds-config-a-docker-example.toml) - - [custom-configs/sri-roles/config-a/jdc-config-a-docker-example.toml](custom-configs/sri-roles/config-a/jdc-config-a-docker-example.toml) - - [custom-configs/sri-roles/config-c/pool-config-c-docker-example.toml](custom-configs/sri-roles/config-c/pool-config-c-docker-example.toml) + - *Bitcoin Address*: Optionally configure a custom Bitcoin address for coinbase transactions + - Use the format: `addr(your_bitcoin_address)` - 💡 If you still don't have a public key, setup a new wallet and extract the extended public key it provides. At this point, you can derive the child public key using this script: https://github.com/stratum-mining/stratum/tree/dev/utils/bip32-key-derivation + - *Pool Signature*: Optionally customize the pool signature string (default: "Stratum V2 SRI Pool") - - *Pool signature*: enter a custom string to be inserted into the coinbase transaction (if you don't like the default one `"Stratum V2 SRI Pool"`) - - Edit the `pool_signature` parameter placed in: - - [custom-configs/sri-roles/config-a/pool-config-a-docker-example.toml](custom-configs/sri-roles/config-a/pool-config-a-docker-example.toml) - - [custom-configs/sri-roles/config-a/jdc-config-a-docker-example.toml](custom-configs/sri-roles/config-a/jdc-config-a-docker-example.toml) - - [custom-configs/sri-roles/config-c/pool-config-c-docker-example.toml](custom-configs/sri-roles/config-c/pool-config-c-docker-example.toml) + - *Log Level*: Choose the log level (info, debug, error, or warn, default: info) 3. **Start the benchmarking tool**: After updating the configuration files, start the benchmarking tool using Docker Compose with the appropriate configuration file. diff --git a/bitcoin-core.dockerfile b/bitcoin-core.dockerfile new file mode 100644 index 0000000..71c74bb --- /dev/null +++ b/bitcoin-core.dockerfile @@ -0,0 +1,78 @@ +# Build Bitcoin Core from source +FROM debian:stable-slim AS builder + +# Install build dependencies +# According to https://github.com/bitcoin/bitcoin/blob/master/doc/build-unix.md +RUN apt-get update && apt-get install -y \ + build-essential \ + cmake \ + pkgconf \ + python3 \ + git \ + ca-certificates \ + && rm -rf /var/lib/apt/lists/* + +# Set Bitcoin Core version +ENV BITCOIN_VERSION=30.0 +ENV BITCOIN_DIR=/bitcoin + +# Clone Bitcoin Core repository +WORKDIR /tmp +RUN git clone https://github.com/bitcoin/bitcoin.git bitcoin-core + +# Checkout the specific version +WORKDIR /tmp/bitcoin-core +RUN git checkout v${BITCOIN_VERSION} + +RUN apt-get update && apt-get install -y \ + libevent-dev \ + libboost-dev \ + libzmq3-dev \ + libcapnp-dev \ + capnproto \ + && rm -rf /var/lib/apt/lists/* + +# Build Bitcoin Core using CMake +# According to https://github.com/bitcoin/bitcoin/blob/master/doc/build-unix.md +RUN cmake -B build \ + -DCMAKE_INSTALL_PREFIX=${BITCOIN_DIR} \ + -DENABLE_WALLET=OFF \ + -DWITH_MULTIPROCESS=ON && \ + cmake --build build -j$(nproc) && \ + cmake --install build + +# Final stage +FROM debian:stable-slim + +# Install runtime dependencies +RUN apt-get update && apt-get install -y \ + libboost-system1.83.0 \ + libboost-filesystem1.83.0 \ + libboost-chrono1.83.0 \ + libboost-thread1.83.0 \ + libevent-2.1-7t64 \ + libevent-core-2.1-7t64 \ + libevent-extra-2.1-7t64 \ + libevent-pthreads-2.1-7t64 \ + libzmq5 \ + libssl3t64 \ + capnproto \ + ca-certificates \ + wget \ + curl \ + jq \ + && rm -rf /var/lib/apt/lists/* + +# Copy Bitcoin Core binaries from builder +COPY --from=builder /bitcoin/bin/* /usr/local/bin/ +COPY --from=builder /bitcoin/libexec/* /usr/local/libexec/ + +# Create volume for blockchain data +VOLUME ["/root/.bitcoin"] + +# Set working directory +WORKDIR /root + +# Default command - launch node with IPC support +CMD ["bitcoin", "-m", "node", "-ipcbind=unix"] + diff --git a/containers-scripts/update-mainnet-chainstate.sh b/containers-scripts/update-mainnet-chainstate.sh index 8d434e9..9d9d85e 100755 --- a/containers-scripts/update-mainnet-chainstate.sh +++ b/containers-scripts/update-mainnet-chainstate.sh @@ -17,9 +17,8 @@ CHAINSTATE_DIR="/root/.bitcoin/chainstate" EXTRACTION_COMPLETION_FLAG="/root/.bitcoin/extraction_completion.flag" # Path for the integrity flag INTEGRITY_FLAG="$SNAPSHOT_DIR/integrity.flag" -# Backup URL and interval settings +# Backup URL settings BACKUP_BASE_URL="http://75.119.150.111/backup" -DOWNLOAD_INTERVAL_DAYS=1 # 1 day = 24 hours # Maximum retries for downloading MAX_RETRIES=30 RETRY_INTERVAL=60 # 1 minute retry interval @@ -49,7 +48,7 @@ download_snapshot() { while [ $retry_count -lt $MAX_RETRIES ]; do echo "Attempt $((retry_count + 1)) of $MAX_RETRIES to download the snapshot..." - BACKUP_FILE_NAME="backup_mainnet_blocks_chainstate_$(date -u +"%Y-%m-%d_%H-UTC").tar.gz" + BACKUP_FILE_NAME="backup_mainnet_blocks_chainstate_2025-12-02_14-UTC.tar.gz" BACKUP_HASH_FILE_NAME="$BACKUP_FILE_NAME.sha256" BACKUP_URL="$BACKUP_BASE_URL/$BACKUP_FILE_NAME" BACKUP_HASH_URL="$BACKUP_URL.sha256" @@ -99,43 +98,29 @@ extract_snapshot() { fi } -# Check if the local chainstate directory is updated and integrity verified for this container -if [ -d "$CHAINSTATE_DIR" ]; then - CHAINSTATE_MOD_TIME=$(stat -c %Y "$CHAINSTATE_DIR") - CURRENT_TIME=$(date +%s) - TIME_DIFF=$(( (CURRENT_TIME - CHAINSTATE_MOD_TIME) / 86400 )) - - if [ "$TIME_DIFF" -lt "$DOWNLOAD_INTERVAL_DAYS" ] && [ -f "$EXTRACTION_COMPLETION_FLAG" ]; then +# Check if the local chainstate directory is already extracted and verified for this container +if [ -d "$CHAINSTATE_DIR" ] && [ -f "$EXTRACTION_COMPLETION_FLAG" ]; then FLAG_VALUE=$(cat "$EXTRACTION_COMPLETION_FLAG" | tr -d '\n') if [ "$FLAG_VALUE" = "true" ]; then - echo "Container chainstate is updated and extraction is complete. Exiting." + echo "Container chainstate is already extracted and verified. Exiting." exit 0 else echo "EXTRACTION_COMPLETION_FLAG is not set to true. Proceeding with further checks." fi - fi - else - echo "No local chainstate found. Proceeding with snapshot download check." + echo "No local chainstate found or extraction flag missing. Proceeding with snapshot check." fi -# Check if a recent and verified snapshot already exists +# Check if a verified snapshot already exists (regardless of age, since there's only one unique snapshot) LATEST_BACKUP_FILE=$(find "$SNAPSHOT_DIR" -maxdepth 1 -name "backup_mainnet_blocks_chainstate_*.tar.gz" -type f -printf "%T@ %p\n" | sort -n | tail -1 | cut -d' ' -f2) -if [ -f "$LATEST_BACKUP_FILE" ]; then - BACKUP_MOD_TIME=$(stat -c %Y "$LATEST_BACKUP_FILE") - TIME_DIFF=$(( (CURRENT_TIME - BACKUP_MOD_TIME) / 86400 )) - - if [ "$TIME_DIFF" -lt "$DOWNLOAD_INTERVAL_DAYS" ] && [ -f "$INTEGRITY_FLAG" ] && grep -q "true" "$INTEGRITY_FLAG"; then - echo "Recent snapshot with verified integrity found. Proceeding to extraction." +if [ -f "$LATEST_BACKUP_FILE" ] && [ -f "$INTEGRITY_FLAG" ] && grep -q "true" "$INTEGRITY_FLAG"; then + echo "Verified snapshot found. Proceeding to extraction." # Set the extraction completion flag to false before extraction echo "false" > "$EXTRACTION_COMPLETION_FLAG" extract_snapshot exit 0 - else - echo "No recent or verified snapshot found. Proceeding with download." - fi fi # Use flock for the lock file to prevent concurrent downloads diff --git a/custom-configs/sri-roles/bitcoin-sv1-node-pool.conf b/custom-configs/sri-apps/bitcoin-sv1-node-pool.conf similarity index 100% rename from custom-configs/sri-roles/bitcoin-sv1-node-pool.conf rename to custom-configs/sri-apps/bitcoin-sv1-node-pool.conf diff --git a/custom-configs/sri-roles/bitcoin-tp-miner.conf b/custom-configs/sri-apps/bitcoin-tp-miner.conf similarity index 100% rename from custom-configs/sri-roles/bitcoin-tp-miner.conf rename to custom-configs/sri-apps/bitcoin-tp-miner.conf diff --git a/custom-configs/sri-roles/bitcoin-tp-pool.conf b/custom-configs/sri-apps/bitcoin-tp-pool.conf similarity index 100% rename from custom-configs/sri-roles/bitcoin-tp-pool.conf rename to custom-configs/sri-apps/bitcoin-tp-pool.conf diff --git a/custom-configs/sri-apps/jdc-config.toml.template b/custom-configs/sri-apps/jdc-config.toml.template new file mode 100644 index 0000000..c0a0de7 --- /dev/null +++ b/custom-configs/sri-apps/jdc-config.toml.template @@ -0,0 +1,73 @@ +# SRI JDC config +listening_address = "10.5.0.22:34265" + +# Version support +max_supported_version = 2 +min_supported_version = 2 + +# Auth keys for open encrypted connection downstream +authority_public_key = "9auqWEzQDVyd2oe1JVGFLMLHZtCo2FFqZwtKA5gd9xbuEu7PH72" +authority_secret_key = "mkDLTBBRxdBv998612qipDYoTK3YUrqLe8uWw7gu3iXbSrn2n" +cert_validity_sec = 3600 + + +# User identity/username for pool connection +user_identity = "JDC" + +# How many shares we expect to receive in a minute (determines difficulty targets) +shares_per_minute = 6.0 + +# How many shares do we want to acknowledge in a batch +share_batch_size = 1 + +# JDC supports two modes: +# "FULLTEMPLATE" - full template mining +# "COINBASEONLY" - coinbase-only mining +mode = "FULLTEMPLATE" + +# string to be added into the Coinbase scriptSig +jdc_signature = "JDC" + +# Solo Mining config +# Coinbase output used to build the coinbase tx in case of Solo Mining (as last-resort solution of the pools fallback system) +# +# Coinbase outputs are specified as descriptors. A full list of descriptors is available at +# https://github.com/bitcoin/bips/blob/master/bip-0380.mediawiki#appendix-b-index-of-script-expressions +# Although the `musig` descriptor is not yet supported and the legacy `combo` descriptor never +# will be. If you have an address, embed it in a descriptor like `addr(
)`. +coinbase_reward_script = "addr(bc1q9f9vj7spn8h7qda6pn8d4g4j99f0mn9lhwz55j)" + +# Enable this option to set a predefined log file path. +# When enabled, logs will always be written to this file. +# The CLI option --log-file (or -f) will override this setting if provided. +# log_file = "./jd-client.log" + +# Protocol Extensions Configuration +# Extensions that the JDC supports (will accept if requested by downstream clients) +# Comment/uncomment to enable/disable specific extensions: +supported_extensions = [ + # 0x0002, # Worker-Specific Hashrate Tracking +] + +# Extensions that the JDC requires (downstream clients must support these to connect) +# Use with caution - requiring extensions may prevent some clients from connecting +required_extensions = [ + # Example: require Worker-Specific Hashrate Tracking + # 0x0002, +] + +# Monitoring HTTP server address for exposing channel data (optional) +monitoring_address = "0.0.0.0:9091" + +# List of upstreams (JDS) used as backup endpoints +# In case of shares refused by the JDS, the fallback system will propose the same job to the next upstream in this list +[[upstreams]] +authority_pubkey = "9auqWEzQDVyd2oe1JVGFLMLHZtCo2FFqZwtKA5gd9xbuEu7PH72" +pool_address = "10.5.0.34" +pool_port = 34252 +jds_address = "10.5.0.21" +jds_port = 34264 + +# Local Sv2 Template Provider config +[template_provider_type.Sv2Tp] +address = "10.5.0.31:8440" diff --git a/custom-configs/sri-apps/jds-config.toml.template b/custom-configs/sri-apps/jds-config.toml.template new file mode 100644 index 0000000..c77ae25 --- /dev/null +++ b/custom-configs/sri-apps/jds-config.toml.template @@ -0,0 +1,31 @@ +# If set to true, JDS require JDC to reveal the transactions they are going to mine on +full_template_mode_required = true + +# SRI Pool config +authority_public_key = "9auqWEzQDVyd2oe1JVGFLMLHZtCo2FFqZwtKA5gd9xbuEu7PH72" +authority_secret_key = "mkDLTBBRxdBv998612qipDYoTK3YUrqLe8uWw7gu3iXbSrn2n" +cert_validity_sec = 3600 + +# Coinbase outputs are specified as descriptors. A full list of descriptors is available at +# https://github.com/bitcoin/bips/blob/master/bip-0380.mediawiki#appendix-b-index-of-script-expressions +# Although the `musig` descriptor is not yet supported and the legacy `combo` descriptor never +# will be. If you have an address, embed it in a descriptor like `addr(
)`. +coinbase_reward_script = "${JDS_COINBASE_REWARD_SCRIPT}" + +# Enable this option to set a predefined log file path. +# When enabled, logs will always be written to this file. +# The CLI option --log-file (or -f) will override this setting if provided. +# log_file = "./jd-server.log" + +# SRI Pool JD config +listen_jd_address = "10.5.0.21:34264" +# RPC config for mempool (it can be also the same TP if correctly configured) +core_rpc_url = "http://10.5.0.2" +core_rpc_port = 18332 +core_rpc_user = "username" +core_rpc_pass = "password" +# Time interval used for JDS mempool update +[mempool_update_interval] +unit = "secs" +value = 1 + diff --git a/custom-configs/sri-apps/pool-config.toml.template b/custom-configs/sri-apps/pool-config.toml.template new file mode 100644 index 0000000..6c5e890 --- /dev/null +++ b/custom-configs/sri-apps/pool-config.toml.template @@ -0,0 +1,48 @@ +# SRI Pool config +authority_public_key = "9auqWEzQDVyd2oe1JVGFLMLHZtCo2FFqZwtKA5gd9xbuEu7PH72" +authority_secret_key = "mkDLTBBRxdBv998612qipDYoTK3YUrqLe8uWw7gu3iXbSrn2n" +cert_validity_sec = 3600 +listen_address = "0.0.0.0:34254" + +# Coinbase outputs are specified as descriptors. A full list of descriptors is available at +# https://github.com/bitcoin/bips/blob/master/bip-0380.mediawiki#appendix-b-index-of-script-expressions +# Although the `musig` descriptor is not yet supported and the legacy `combo` descriptor never +# will be. If you have an address, embed it in a descriptor like `addr(
)`. +coinbase_reward_script = "${POOL_COINBASE_REWARD_SCRIPT}" + +# Server Id (number to guarantee unique search space allocation across different Pool servers) +server_id = 1 + +# Pool signature (string to be included in coinbase tx) +pool_signature = "${POOL_SIGNATURE}" + +# Enable this option to set a predefined log file path. +# When enabled, logs will always be written to this file. +# The CLI option --log-file (or -f) will override this setting if provided. +# log_file = "./pool.log" + +# How many shares we expect to receive in a minute (determines difficulty targets) +shares_per_minute = 6.0 +# How many shares do we want to acknowledge in a batch +share_batch_size = 10 + +# Protocol Extensions Configuration +# Extensions that the pool supports (will accept if requested by clients) +# Comment/uncomment to enable/disable specific extensions: +supported_extensions = [ + # 0x0002, # Worker-Specific Hashrate Tracking +] + +# Extensions that the pool requires (clients must support these to connect) +# Use with caution - requiring extensions may prevent some clients from connecting +required_extensions = [ + # Example: require Worker-Specific Hashrate Tracking + # 0x0002, +] + +# Monitoring HTTP server address for exposing channel data +monitoring_address = "0.0.0.0:9090" + +# Local Sv2 Template Provider config +[template_provider_type.Sv2Tp] +address = "${TP_POOL_ADDRESS}" diff --git a/custom-configs/sri-apps/translator-proxy-config.toml.template b/custom-configs/sri-apps/translator-proxy-config.toml.template new file mode 100644 index 0000000..00e45f0 --- /dev/null +++ b/custom-configs/sri-apps/translator-proxy-config.toml.template @@ -0,0 +1,59 @@ +# Local Mining Device Downstream Connection +downstream_address = "0.0.0.0" +downstream_port = 34256 + +# Version support +max_supported_version = 2 +min_supported_version = 2 + +# Extranonce2 size for downstream connections +# This controls the rollable part of the extranonce for downstream miners +# Max value for CGminer: 8 +# Min value: 2 +downstream_extranonce2_size = 4 + +# User identity/username for pool connection +# This will be appended with a counter for each mining client (e.g., username.miner1, username.miner2) +user_identity = "tProxy" + +# Aggregate channels: if true, all miners share one upstream channel; if false, each miner gets its own channel +aggregate_channels = false + +# Enable this option to set a predefined log file path. +# When enabled, logs will always be written to this file. +# The CLI option --log-file (or -f) will override this setting if provided. +# log_file = "./tproxy.log" + +# Protocol extensions configuration +# Extensions that the translator supports (will request if required by server) +# Example: supported_extensions = [0x0002, 0x0003] +supported_extensions = [ + # 0x0002, # Worker-Specific Hashrate Tracking +] + +# Extensions that the translator requires (server must support these) +# If the upstream server doesn't support these, the translator will fail over to another upstream +required_extensions = [ + # 0x0002, # Worker-Specific Hashrate Tracking +] + +# Monitoring HTTP server address for exposing channel data +monitoring_address = "0.0.0.0:9092" + +# Difficulty params +[downstream_difficulty_config] +# hashes/s of the weakest miner that will be connecting (e.g.: 10 Th/s = 10_000_000_000_000.0) +min_individual_miner_hashrate= ${TPROXY_MIN_INDIVIDUAL_MINER_HASHRATE} +# target number of shares per minute the miner should be sending +shares_per_minute = 6.0 +# disable variable difficulty adjustment when using with JDC (JDC handles vardiff) +enable_vardiff = true +# Interval in seconds for sending keepalive jobs to prevent miner timeout during low upstream activity (set to 0 to disable) +job_keepalive_interval_secs = 60 + + +[[upstreams]] +address = "${TRANSLATOR_UPSTREAM_ADDRESS}" +port = ${TRANSLATOR_UPSTREAM_PORT} +authority_pubkey = "9auqWEzQDVyd2oe1JVGFLMLHZtCo2FFqZwtKA5gd9xbuEu7PH72" + diff --git a/custom-configs/sri-roles/config-a/jdc-config-a-docker-example.toml b/custom-configs/sri-roles/config-a/jdc-config-a-docker-example.toml deleted file mode 100644 index 61f3a89..0000000 --- a/custom-configs/sri-roles/config-a/jdc-config-a-docker-example.toml +++ /dev/null @@ -1,62 +0,0 @@ -# SRI JDC config -listening_address = "10.5.0.6:34265" - -# Version support -max_supported_version = 2 -min_supported_version = 2 - -# Withhold -withhold = false - -# Auth keys for open encrypted connection downstream -authority_public_key = "9auqWEzQDVyd2oe1JVGFLMLHZtCo2FFqZwtKA5gd9xbuEu7PH72" -authority_secret_key = "mkDLTBBRxdBv998612qipDYoTK3YUrqLe8uWw7gu3iXbSrn2n" -cert_validity_sec = 3600 - -# How many time the JDC try to reinitialize itself after a failure -retry = 10 - -# Template Provider config -# Local TP (this is pointing to localhost so you must run a TP locally for this configuration to work) -tp_address = "10.5.0.20:8440" -# Hosted testnet TP -# tp_address = "75.119.150.111:8442" - -# string to be added into `extranonce_prefix` -# note: these bytes are fixed and they effectively reduce the search space available for the extranonce -# the bigger this field, the smaller the search space available for downstream -jdc_signature = "JDC" - -# Solo Mining config -# List of coinbase outputs used to build the coinbase tx in case of Solo Mining (as last-resort solution of the pools fallback system) -# ! Put your Extended Public Key or Script as output_script_value ! -# ! Right now only one output is supported, so comment all the ones you don't need ! -# For P2PK, P2PKH, P2WPKH, P2TR a public key is needed. For P2SH and P2WSH, a redeem script is needed. -coinbase_outputs = [ - #{ output_script_type = "P2PK", output_script_value = "0372c47307e5b75ce365daf835f226d246c5a7a92fe24395018d5552123354f086" }, - #{ output_script_type = "P2PKH", output_script_value = "0372c47307e5b75ce365daf835f226d246c5a7a92fe24395018d5552123354f086" }, - #{ output_script_type = "P2SH", output_script_value = "00142ef89234bc95136eb9e6fee9d32722ebd8c1f0ab" }, - #{ output_script_type = "P2WSH", output_script_value = "00142ef89234bc95136eb9e6fee9d32722ebd8c1f0ab" }, - { output_script_type = "P2WPKH", output_script_value = "036adc3bdf21e6f9a0f0fb0066bf517e5b7909ed1563d6958a10993849a7554075" }, - #{ output_script_type = "P2TR", output_script_value = "036adc3bdf21e6f9a0f0fb0066bf517e5b7909ed1563d6958a10993849a7554075" }, -] - -[timeout] -unit = "secs" -value = 1 - -# List of upstreams (JDS) used as backup endpoints -# In case of shares refused by the JDS, the fallback system will propose the same job to the next upstream in this list -[[upstreams]] -authority_pubkey = "9auqWEzQDVyd2oe1JVGFLMLHZtCo2FFqZwtKA5gd9xbuEu7PH72" -pool_address = "10.5.0.4:34254" -jd_address = "10.5.0.5:34264" -# Pool signature (string to be included in coinbase tx) -pool_signature = "Stratum V2 SRI Pool" - -# [[upstreams]] -# authority_pubkey = "2di19GHYQnAZJmEpoUeP7C3Eg9TCcksHr23rZCC83dvUiZgiDL" -# pool_address = "10.5.0.3:34254" -# jd_address = "10.5.0.4:34264" -# Pool signature (string to be included in coinbase tx) -# pool_signature = "Stratum V2 SRI Pool" diff --git a/custom-configs/sri-roles/config-a/jds-config-a-docker-example.toml b/custom-configs/sri-roles/config-a/jds-config-a-docker-example.toml deleted file mode 100644 index 080d3f7..0000000 --- a/custom-configs/sri-roles/config-a/jds-config-a-docker-example.toml +++ /dev/null @@ -1,28 +0,0 @@ -# SRI Pool config -authority_public_key = "9auqWEzQDVyd2oe1JVGFLMLHZtCo2FFqZwtKA5gd9xbuEu7PH72" -authority_secret_key = "mkDLTBBRxdBv998612qipDYoTK3YUrqLe8uWw7gu3iXbSrn2n" -cert_validity_sec = 3600 - -# List of coinbase outputs used to build the coinbase tx -# ! Right now only one output is supported, so comment all the ones you don't need ! -# For P2PK, P2PKH, P2WPKH, P2TR a public key is needed. For P2SH and P2WSH, a redeem script is needed. -coinbase_outputs = [ - #{ output_script_type = "P2PK", output_script_value = "0372c47307e5b75ce365daf835f226d246c5a7a92fe24395018d5552123354f086" }, - #{ output_script_type = "P2PKH", output_script_value = "0372c47307e5b75ce365daf835f226d246c5a7a92fe24395018d5552123354f086" }, - #{ output_script_type = "P2SH", output_script_value = "00142ef89234bc95136eb9e6fee9d32722ebd8c1f0ab" }, - #{ output_script_type = "P2WSH", output_script_value = "00142ef89234bc95136eb9e6fee9d32722ebd8c1f0ab" }, - { output_script_type = "P2WPKH", output_script_value = "036adc3bdf21e6f9a0f0fb0066bf517e5b7909ed1563d6958a10993849a7554075" }, - #{ output_script_type = "P2TR", output_script_value = "036adc3bdf21e6f9a0f0fb0066bf517e5b7909ed1563d6958a10993849a7554075" }, -] - -# SRI Pool JD config -listen_jd_address = "10.5.0.5:34264" -# RPC config for mempool (it can be also the same TP if correctly configured) -core_rpc_url = "http://10.5.0.2" -core_rpc_port = 18332 -core_rpc_user = "username" -core_rpc_pass = "password" -# Time interval used for JDS mempool update -[mempool_update_interval] -unit = "secs" -value = 1 diff --git a/custom-configs/sri-roles/config-a/pool-config-a-docker-example.toml b/custom-configs/sri-roles/config-a/pool-config-a-docker-example.toml deleted file mode 100644 index 9e58eb2..0000000 --- a/custom-configs/sri-roles/config-a/pool-config-a-docker-example.toml +++ /dev/null @@ -1,28 +0,0 @@ -# SRI Pool config -authority_public_key = "9auqWEzQDVyd2oe1JVGFLMLHZtCo2FFqZwtKA5gd9xbuEu7PH72" -authority_secret_key = "mkDLTBBRxdBv998612qipDYoTK3YUrqLe8uWw7gu3iXbSrn2n" -#authority_secret_key = "7qbpUjScc865jyX2kiB4NVJANoC7GA7TAJupdzXWkc62" -cert_validity_sec = 3600 -test_only_listen_adress_plain = "0.0.0.0:34250" -listen_address = "10.5.0.4:34254" - -# List of coinbase outputs used to build the coinbase tx -# ! Right now only one output is supported, so comment all the ones you don't need ! -# For P2PK, P2PKH, P2WPKH, P2TR a public key is needed. For P2SH and P2WSH, a redeem script is needed. -coinbase_outputs = [ - #{ output_script_type = "P2PK", output_script_value = "0372c47307e5b75ce365daf835f226d246c5a7a92fe24395018d5552123354f086" }, - #{ output_script_type = "P2PKH", output_script_value = "0372c47307e5b75ce365daf835f226d246c5a7a92fe24395018d5552123354f086" }, - #{ output_script_type = "P2SH", output_script_value = "00142ef89234bc95136eb9e6fee9d32722ebd8c1f0ab" }, - #{ output_script_type = "P2WSH", output_script_value = "00142ef89234bc95136eb9e6fee9d32722ebd8c1f0ab" }, - { output_script_type = "P2WPKH", output_script_value = "036adc3bdf21e6f9a0f0fb0066bf517e5b7909ed1563d6958a10993849a7554075" }, - #{ output_script_type = "P2TR", output_script_value = "036adc3bdf21e6f9a0f0fb0066bf517e5b7909ed1563d6958a10993849a7554075" }, -] - -# Pool signature (string to be included in coinbase tx) -pool_signature = "Stratum V2 SRI Pool" - -# Template Provider config -# Local TP (this is pointing to localhost so you must run a TP locally for this configuration to work) -tp_address = "10.5.0.2:8442" - -shares_per_minute = 1.0 \ No newline at end of file diff --git a/custom-configs/sri-roles/config-a/tproxy-config-a-docker-example.toml b/custom-configs/sri-roles/config-a/tproxy-config-a-docker-example.toml deleted file mode 100644 index 410e0d2..0000000 --- a/custom-configs/sri-roles/config-a/tproxy-config-a-docker-example.toml +++ /dev/null @@ -1,36 +0,0 @@ -# Braiins Pool Upstream Connection -# upstream_authority_pubkey = "u95GEReVMjK6k5YqiSFNqqTnKU4ypU2Wm8awa6tmbmDmk1bWt" -# upstream_address = "18.196.32.109" -# upstream_port = 3336 - -# Local SRI JDC Upstream Connection -upstream_address = "10.5.0.17" -upstream_port = 34251 -upstream_authority_pubkey = "9auqWEzQDVyd2oe1JVGFLMLHZtCo2FFqZwtKA5gd9xbuEu7PH72" - -# Local Mining Device Downstream Connection -downstream_address = "10.5.0.7" -downstream_port = 34256 - -# Version support -max_supported_version = 2 -min_supported_version = 2 - -# Minimum extranonce2 size for downstream -# Max value: 16 (leaves 0 bytes for search space splitting of downstreams) -# Max value for CGminer: 8 -# Min value: 2 -min_extranonce2_size = 4 - -# Difficulty params -[downstream_difficulty_config] -# hashes/s of the weakest miner that will be connecting (e.g.: 10 Th/s = 10_000_000_000_000.0) -min_individual_miner_hashrate = 10_000_000_000_000.0 -# target number of shares per minute the miner should be sending -shares_per_minute = 6.0 - -[upstream_difficulty_config] -# interval in seconds to elapse before updating channel hashrate with the pool -channel_diff_update_interval = 60 -# estimated accumulated hashrate of all downstream miners (e.g.: 10 Th/s = 10_000_000_000_000.0) -channel_nominal_hashrate = 10_000_000_000_000.0 diff --git a/custom-configs/sri-roles/config-c/pool-config-c-docker-example.toml b/custom-configs/sri-roles/config-c/pool-config-c-docker-example.toml deleted file mode 100644 index 19a8598..0000000 --- a/custom-configs/sri-roles/config-c/pool-config-c-docker-example.toml +++ /dev/null @@ -1,28 +0,0 @@ -# SRI Pool config -authority_public_key = "9auqWEzQDVyd2oe1JVGFLMLHZtCo2FFqZwtKA5gd9xbuEu7PH72" -authority_secret_key = "mkDLTBBRxdBv998612qipDYoTK3YUrqLe8uWw7gu3iXbSrn2n" -#authority_secret_key = "7qbpUjScc865jyX2kiB4NVJANoC7GA7TAJupdzXWkc62" -cert_validity_sec = 3600 -test_only_listen_adress_plain = "0.0.0.0:34250" -listen_address = "10.5.0.4:34254" - -# List of coinbase outputs used to build the coinbase tx -# ! Right now only one output is supported, so comment all the ones you don't need ! -# For P2PK, P2PKH, P2WPKH, P2TR a public key is needed. For P2SH and P2WSH, a redeem script is needed. -coinbase_outputs = [ - #{ output_script_type = "P2PK", output_script_value = "0372c47307e5b75ce365daf835f226d246c5a7a92fe24395018d5552123354f086" }, - #{ output_script_type = "P2PKH", output_script_value = "0372c47307e5b75ce365daf835f226d246c5a7a92fe24395018d5552123354f086" }, - #{ output_script_type = "P2SH", output_script_value = "00142ef89234bc95136eb9e6fee9d32722ebd8c1f0ab" }, - #{ output_script_type = "P2WSH", output_script_value = "00142ef89234bc95136eb9e6fee9d32722ebd8c1f0ab" }, - { output_script_type = "P2WPKH", output_script_value = "036adc3bdf21e6f9a0f0fb0066bf517e5b7909ed1563d6958a10993849a7554075" }, - #{ output_script_type = "P2TR", output_script_value = "036adc3bdf21e6f9a0f0fb0066bf517e5b7909ed1563d6958a10993849a7554075" }, -] - -# Pool signature (string to be included in coinbase tx) -pool_signature = "Stratum V2 SRI Pool" - -# Template Provider config -# Local TP (this is pointing to localhost so you must run a TP locally for this configuration to work) -tp_address = "10.5.0.20:8441" - -shares_per_minute = 1.0 \ No newline at end of file diff --git a/custom-configs/sri-roles/config-c/tproxy-config-c-docker-example.toml b/custom-configs/sri-roles/config-c/tproxy-config-c-docker-example.toml deleted file mode 100644 index 516d5fd..0000000 --- a/custom-configs/sri-roles/config-c/tproxy-config-c-docker-example.toml +++ /dev/null @@ -1,36 +0,0 @@ -# Braiins Pool Upstream Connection -# upstream_authority_pubkey = "u95GEReVMjK6k5YqiSFNqqTnKU4ypU2Wm8awa6tmbmDmk1bWt" -# upstream_address = "18.196.32.109" -# upstream_port = 3336 - -# Local SRI Pool Upstream Connection -upstream_address = "10.5.0.17" -upstream_port = 34251 -upstream_authority_pubkey = "9auqWEzQDVyd2oe1JVGFLMLHZtCo2FFqZwtKA5gd9xbuEu7PH72" - -# Local Mining Device Downstream Connection -downstream_address = "10.5.0.7" -downstream_port = 34256 - -# Version support -max_supported_version = 2 -min_supported_version = 2 - -# Minimum extranonce2 size for downstream -# Max value: 16 (leaves 0 bytes for search space splitting of downstreams) -# Max value for CGminer: 8 -# Min value: 2 -min_extranonce2_size = 4 - -# Difficulty params -[downstream_difficulty_config] -# hashes/s of the weakest miner that will be connecting (e.g.: 10 Th/s = 10_000_000_000_000.0) -min_individual_miner_hashrate = 10_000_000_000_000.0 -# target number of shares per minute the miner should be sending -shares_per_minute = 6.0 - -[upstream_difficulty_config] -# interval in seconds to elapse before updating channel hashrate with the pool -channel_diff_update_interval = 60 -# estimated accumulated hashrate of all downstream miners (e.g.: 10 Th/s = 10_000_000_000_000.0) -channel_nominal_hashrate = 10_000_000_000_000.0 diff --git a/custom-configs/sv1-pool/.env b/custom-configs/sv1-pool/.env index 2b1bd97..52e0cef 100644 --- a/custom-configs/sv1-pool/.env +++ b/custom-configs/sv1-pool/.env @@ -1,5 +1,5 @@ # bitcoin node running in your private network 192.168.1.0/24 -BITCOIN_RPC_URL=http://10.5.0.21 +BITCOIN_RPC_URL=http://10.5.0.42 # bitcoin node running undockered on the same PC # needs to add rpcallowip=172.16.0.0/12 to your bitcoin.conf @@ -37,4 +37,4 @@ ENABLE_PROXY=false BRAIINS_ACCESS_TOKEN= -PROXY_PORT=3333 +PROXY_PORT=3333 \ No newline at end of file diff --git a/docker-compose-config-a.yaml b/docker-compose-config-a.yaml index ad134a7..d95a9f7 100644 --- a/docker-compose-config-a.yaml +++ b/docker-compose-config-a.yaml @@ -16,26 +16,23 @@ networks: gateway: 10.5.0.1 services: - common-template-provider-builder: + # ============================================================================ + # BUILDER SERVICES + # ============================================================================ + + bitcoin-core-builder: build: - dockerfile: ./template-provider.dockerfile - container_name: common-template-provider-builder - image: template-provider-builder-image - command: echo "common-template-provider build completed" + dockerfile: ./bitcoin-core.dockerfile + container_name: bitcoin-core-builder + image: bitcoin-core-builder-image + command: echo "Bitcoin Core build completed" - sv2-roles-builder: + sv2-tp-builder: build: - dockerfile: ./sv2-roles.dockerfile - container_name: sv2-roles-builder - image: sv2-roles-builder-image - command: echo "SRI build completed" - - log-server-builder: - build: - dockerfile: ./log-server/Dockerfile - container_name: log-server-builder - image: log-server-builder-image - command: echo "log-server-builder build completed" + dockerfile: ./sv2-tp.dockerfile + container_name: sv2-tp-builder + image: sv2-tp-builder-image + command: echo "sv2-tp build completed" sv2-custom-proxy-builder: build: @@ -58,57 +55,88 @@ services: image: pools-latency-calculator-builder-image command: echo "pools-latency-calculator build completed" - template-provider-pool-side: + log-server-builder: + build: + dockerfile: ./log-server/Dockerfile + container_name: log-server-builder + image: log-server-builder-image + command: echo "log-server-builder build completed" + + # ============================================================================ + # BITCOIN CORE NODES (10.5.0.2-10.5.0.4) + # ============================================================================ + + bitcoin-core-pool-side: labels: logging: "config-a" - image: template-provider-builder-image - entrypoint: ["/bin/sh", "-c", "./scripts/update-mainnet-chainstate.sh ${NETWORK} && /bitcoin/bin/bitcoind -sv2 -sv2port=8442 -sv2interval=${SV2_INTERVAL} -sv2feedelta=0 -debug=sv2 -loglevel=sv2:debug -sv2bind=0.0.0.0 -${NETWORK}"] + image: bitcoin-core-builder-image + entrypoint: + - /bin/sh + - -c + - | + /scripts/update-mainnet-chainstate.sh ${NETWORK} + if [ -z "${NETWORK}" ]; then + exec bitcoin -m node -ipcbind=unix + else + exec bitcoin -m node -ipcbind=unix -${NETWORK} + fi + depends_on: + - bitcoin-core-builder ports: - - "8442:8442" - "18333:48333" - "8332:8332" - "18332:18332" - container_name: sv2-tp-pool-side - depends_on: - - common-template-provider-builder + container_name: bitcoin-core-pool-side volumes: - bitcoin_pool_side_data:/root/.bitcoin - - shared-mainnet-snapshot-volume:/shared_volume # Shared volume for mainnet snapshot - - ./custom-configs/sri-roles/bitcoin-tp-pool.conf:/root/.bitcoin/bitcoin.conf - - ./containers-scripts:/scripts + - shared-mainnet-snapshot-volume:/shared_volume + - ./custom-configs/sri-apps/bitcoin-tp-pool.conf:/root/.bitcoin/bitcoin.conf + - ./containers-scripts:/scripts restart: unless-stopped networks: sv2-net: ipv4_address: 10.5.0.2 + environment: + - NETWORK=${NETWORK} healthcheck: - test: ["CMD", "./scripts/healthcheck.sh", "http://127.0.0.1:18332"] + test: ["CMD", "/scripts/healthcheck.sh", "http://127.0.0.1:18332"] interval: 2m timeout: 30s retries: 100 start_period: 1m - template-provider-miner-side: + bitcoin-core-miner-side: labels: logging: "config-a" - image: template-provider-builder-image - entrypoint: ["/bin/sh", "-c", "./scripts/update-mainnet-chainstate.sh ${NETWORK} && /bitcoin/bin/bitcoind -sv2 -sv2port=8443 -sv2interval=${SV2_INTERVAL} -sv2feedelta=0 -debug=sv2 -loglevel=sv2:debug -sv2bind=0.0.0.0 -${NETWORK}"] + image: bitcoin-core-builder-image + entrypoint: + - /bin/sh + - -c + - | + /scripts/update-mainnet-chainstate.sh ${NETWORK} + if [ -z "${NETWORK}" ]; then + exec bitcoin -m node -ipcbind=unix + else + exec bitcoin -m node -ipcbind=unix -${NETWORK} + fi + depends_on: + - bitcoin-core-builder ports: - - "8443:8443" - "28333:18333" - container_name: sv2-tp-miner-side - depends_on: - - common-template-provider-builder + container_name: bitcoin-core-miner-side volumes: - bitcoin_miner_side_data:/root/.bitcoin - - shared-mainnet-snapshot-volume:/shared_volume # Shared volume for mainnet snapshot - - ./custom-configs/sri-roles/bitcoin-tp-miner.conf:/root/.bitcoin/bitcoin.conf + - shared-mainnet-snapshot-volume:/shared_volume + - ./custom-configs/sri-apps/bitcoin-tp-miner.conf:/root/.bitcoin/bitcoin.conf - ./containers-scripts:/scripts restart: unless-stopped networks: sv2-net: ipv4_address: 10.5.0.3 + environment: + - NETWORK=${NETWORK} healthcheck: - test: ["CMD", "./scripts/healthcheck.sh", "http://127.0.0.1:18332"] + test: ["CMD", "/scripts/healthcheck.sh", "http://127.0.0.1:18332"] interval: 2m timeout: 30s retries: 100 @@ -117,192 +145,324 @@ services: sv1-node-pool-side: labels: logging: "config-a" - image: template-provider-builder-image - entrypoint: ["/bin/sh", "-c", "./scripts/update-mainnet-chainstate.sh ${NETWORK} && /bitcoin/bin/bitcoind -${NETWORK}"] + image: bitcoin-core-builder-image + entrypoint: + - /bin/sh + - -c + - | + /scripts/update-mainnet-chainstate.sh ${NETWORK} + if [ -z "${NETWORK}" ]; then + exec bitcoin -m node -ipcbind=unix + else + exec bitcoin -m node -ipcbind=unix -${NETWORK} + fi + depends_on: + - bitcoin-core-builder ports: - "38333:18333" - "28332:18332" - "18443:18443" container_name: sv1-node-pool-side - depends_on: - - common-template-provider-builder volumes: - bitcoin_sv1_pool_side_data:/root/.bitcoin - - shared-mainnet-snapshot-volume:/shared_volume # Shared volume for mainnet snapshot - - ./custom-configs/sri-roles/bitcoin-sv1-node-pool.conf:/root/.bitcoin/bitcoin.conf + - shared-mainnet-snapshot-volume:/shared_volume + - ./custom-configs/sri-apps/bitcoin-sv1-node-pool.conf:/root/.bitcoin/bitcoin.conf - ./containers-scripts:/scripts restart: unless-stopped networks: sv2-net: - ipv4_address: 10.5.0.16 + ipv4_address: 10.5.0.4 environment: - NETWORK=${NETWORK} healthcheck: - test: ["CMD", "./scripts/healthcheck.sh", "http://127.0.0.1:18332"] + test: ["CMD", "/scripts/healthcheck.sh", "http://127.0.0.1:18332"] interval: 2m timeout: 30s retries: 100 start_period: 1m + # ============================================================================ + # SV2 TEMPLATE PROVIDERS (10.5.0.10-10.5.0.12) + # ============================================================================ + + sv2-tp-pool-side: + labels: + logging: "config-a" + image: sv2-tp-builder-image + container_name: sv2-tp-pool-side + ports: + - "8441:8441" + environment: + - RUST_LOG=${LOG_LEVEL} + - NETWORK=${NETWORK} + volumes: + - bitcoin_pool_side_data:/root/.bitcoin + depends_on: + bitcoin-core-pool-side: + condition: service_healthy + restart: true + sv2-tp-builder: + condition: service_started + restart: unless-stopped + networks: + sv2-net: + ipv4_address: 10.5.0.10 + command: > + sh -c ' + if [ -z "${NETWORK}" ] || [ "${NETWORK}" = "mainnet" ]; then + sv2-tp -ipcconnect=unix -sv2bind=0.0.0.0:8441 -sv2interval=${TP_MIN_INTERVAL} -debug=sv2 -loglevel=sv2:trace + else + sv2-tp -chain=${NETWORK} -ipcconnect=unix -sv2bind=0.0.0.0:8441 -sv2interval=${TP_MIN_INTERVAL} -debug=sv2 -loglevel=sv2:trace + fi + ' + + sv2-tp-miner-side: + labels: + logging: "config-a" + image: sv2-tp-builder-image + container_name: sv2-tp-miner-side + ports: + - "8442:8442" + environment: + - RUST_LOG=${LOG_LEVEL} + - NETWORK=${NETWORK} + volumes: + - bitcoin_miner_side_data:/root/.bitcoin + depends_on: + bitcoin-core-miner-side: + condition: service_healthy + restart: true + sv2-tp-builder: + condition: service_started + restart: unless-stopped + networks: + sv2-net: + ipv4_address: 10.5.0.11 + command: > + sh -c ' + if [ -z "${NETWORK}" ] || [ "${NETWORK}" = "mainnet" ]; then + sv2-tp -ipcconnect=unix -sv2bind=0.0.0.0:8442 -sv2interval=${TP_MIN_INTERVAL} -debug=sv2 -loglevel=sv2:trace + else + sv2-tp -chain=${NETWORK} -ipcconnect=unix -sv2bind=0.0.0.0:8442 -sv2interval=${TP_MIN_INTERVAL} -debug=sv2 -loglevel=sv2:trace + fi + ' + + # ============================================================================ + # SV2 CORE SERVICES (10.5.0.20-10.5.0.24) + # ============================================================================ + pool: - image: sv2-roles-builder-image + image: stratumv2/pool_sv2:v0.2.0 labels: logging: "config-a" - command: ["/bin/sh", "-c", "./monitor_and_apply_latency.sh 10.5.0.6 2 & exec ./pool_sv2 -c pool/config-examples/pool-config-a-docker-example.toml"] + env_file: + - .env + entrypoint: > + sh -c ' + (apk add --no-cache curl iproute2 iptables 2>/dev/null || apt-get update -qq && apt-get install -y -qq curl iproute2 iptables 2>/dev/null || true) && + /app/monitor_and_apply_latency.sh 10.5.0.34 2 & + envsubst < /app/pool-config.toml.template > /app/pool-config.toml && + exec /app/pool_sv2 -c /app/pool-config.toml + ' ports: - "34254:34254" environment: - RUST_LOG=${LOG_LEVEL} + - TP_POOL_ADDRESS=10.5.0.10:8441 container_name: sv2-pool depends_on: - template-provider-pool-side: - condition: service_healthy - restart: true - sv2-roles-builder: + sv2-tp-pool-side: condition: service_started volumes: - - ./custom-configs/sri-roles/config-a:/usr/local/bin/pool/config-examples/ + - ./custom-configs/sri-apps/pool-config.toml.template:/app/pool-config.toml.template:ro + - ./pools-latency-calculator/monitor_and_apply_latency.sh:/app/monitor_and_apply_latency.sh:ro restart: unless-stopped networks: sv2-net: - ipv4_address: 10.5.0.4 + ipv4_address: 10.5.0.20 cap_add: - NET_ADMIN jd-server: - image: sv2-roles-builder-image + image: stratumv2/jd_server:v0.2.0 labels: logging: "config-a" - command: - [ - "/bin/sh", - "-c", - "./monitor_and_apply_latency.sh 10.5.0.6 2 & exec ./jd_server -c jd-server/config-examples/jds-config-a-docker-example.toml", - ] + env_file: + - .env + entrypoint: > + sh -c ' + (apk add --no-cache curl iproute2 iptables 2>/dev/null || apt-get update -qq && apt-get install -y -qq curl iproute2 iptables 2>/dev/null || true) && + /app/monitor_and_apply_latency.sh 10.5.0.22 2 & + envsubst < /app/jds-config.toml.template > /app/jds-config.toml && + exec /app/jd_server -c /app/jds-config.toml + ' ports: - "34264:34264" environment: - RUST_LOG=${LOG_LEVEL} container_name: sv2-jds depends_on: - template-provider-pool-side: - condition: service_healthy - restart: true - sv2-roles-builder: + sv2-tp-pool-side: condition: service_started volumes: - - ./custom-configs/sri-roles/config-a:/usr/local/bin/jd-server/config-examples/ + - ./custom-configs/sri-apps/jds-config.toml.template:/app/jds-config.toml.template:ro + - ./pools-latency-calculator/monitor_and_apply_latency.sh:/app/monitor_and_apply_latency.sh:ro restart: unless-stopped networks: sv2-net: - ipv4_address: 10.5.0.5 + ipv4_address: 10.5.0.21 + extra_hosts: + - "host.docker.internal:host-gateway" cap_add: - NET_ADMIN jd-client: - image: sv2-roles-builder-image + image: stratumv2/jd_client_sv2:v0.2.0 labels: logging: "config-a" - command: - [ - "/bin/sh", - "-c", - "./monitor_and_apply_latency.sh 10.5.0.4 2 10.5.0.5 & exec ./jd_client -c jd-client/config-examples/jdc-config-a-docker-example.toml", - ] + env_file: + - .env + entrypoint: > + sh -c ' + (apk add --no-cache curl iproute2 iptables 2>/dev/null || apt-get update -qq && apt-get install -y -qq curl iproute2 iptables 2>/dev/null || true) && + /app/monitor_and_apply_latency.sh 10.5.0.34 2 10.5.0.21 & + envsubst < /app/jdc-config.toml.template > /app/jdc-config.toml && + exec /app/jd_client_sv2 -c /app/jdc-config.toml + ' ports: - "34265:34265" environment: - RUST_LOG=${LOG_LEVEL} container_name: sv2-jdc volumes: - - ./custom-configs/sri-roles/config-a:/usr/local/bin/jd-client/config-examples/ + - ./custom-configs/sri-apps/jdc-config.toml.template:/app/jdc-config.toml.template:ro + - ./pools-latency-calculator/monitor_and_apply_latency.sh:/app/monitor_and_apply_latency.sh:ro restart: unless-stopped depends_on: - - jd-server - - sv2-tp-jdc-proxy - - pool + sv2-tp-miner-side: + condition: service_started + jd-server: + condition: service_started + pool: + condition: service_started networks: sv2-net: - ipv4_address: 10.5.0.6 + ipv4_address: 10.5.0.22 cap_add: - NET_ADMIN translator: - image: sv2-roles-builder-image + image: stratumv2/translator_sv2:v0.2.0 labels: logging: "config-a" - command: - [ - "./translator_sv2", - "-c", - "translator/config-examples/tproxy-config-a-docker-example.toml", - ] + env_file: + - .env + entrypoint: > + sh -c ' + envsubst < /app/proxy-config.toml.template > /app/proxy-config.toml && + exec /app/translator_sv2 -c /app/proxy-config.toml + ' ports: - "34256:34256" environment: - RUST_LOG=${LOG_LEVEL} + - TRANSLATOR_UPSTREAM_ADDRESS=10.5.0.32 + - TRANSLATOR_UPSTREAM_PORT=34266 container_name: sv2-translator depends_on: - - sv2-jdc-translator-proxy + - jd-client + - sv2-jdc-translator-sniffer volumes: - - ./custom-configs/sri-roles/config-a:/usr/local/bin/translator/config-examples/ + - ./custom-configs/sri-apps/translator-proxy-config.toml.template:/app/proxy-config.toml.template:ro restart: unless-stopped networks: sv2-net: - ipv4_address: 10.5.0.7 + ipv4_address: 10.5.0.23 - sv2-jdc-translator-proxy: + # ============================================================================ + # SV2 PROXIES FOR MONITORING (10.5.0.31-10.5.0.34) + # ============================================================================ + + sv2-tp-jdc-sniffer: image: sv2-custom-proxy-builder-image labels: logging: "config-a" command: ["./sv2-custom-proxy"] ports: - - "34253:34254" - - "34251:34251" - - "3456:3456" + - "8440:8440" + - "5678:5678" environment: - - SERVER=10.5.0.6:34265 - - CLIENT=10.5.0.17:34251 - - PROM_ADDRESS=10.5.0.17:3456 - - PROXY_TYPE=jdc-translator + - SERVER=10.5.0.11:8442 + - CLIENT=10.5.0.31:8440 + - PROM_ADDRESS=10.5.0.31:5678 + - PROXY_TYPE=tp-jdc + - NETWORK=${NETWORK} + - RUST_LOG=${LOG_LEVEL} + container_name: sv2-tp-jdc-sniffer + depends_on: + sv2-tp-miner-side: + condition: service_started + sv2-custom-proxy-builder: + condition: service_started + prometheus: + condition: service_started + restart: unless-stopped + networks: + sv2-net: + ipv4_address: 10.5.0.31 + + sv2-pool-jdc-sniffer: + image: sv2-custom-proxy-builder-image + labels: + logging: "config-a" + command: + [ + "/bin/sh", + "-c", + "./monitor_and_apply_latency.sh 10.5.0.20 2 & exec ./sv2-custom-proxy", + ] + ports: + - "34252:34252" + - "3457:3457" + environment: + - SERVER=10.5.0.20:34254 + - CLIENT=0.0.0.0:34252 + - PROM_ADDRESS=10.5.0.34:3457 + - PROXY_TYPE=pool-jdc - RUST_LOG=${LOG_LEVEL} - container_name: sv2-jdc-translator-proxy + container_name: sv2-pool-jdc-sniffer depends_on: - sv2-custom-proxy-builder - - jd-client + - pool restart: unless-stopped networks: sv2-net: - ipv4_address: 10.5.0.17 + ipv4_address: 10.5.0.34 + cap_add: + - NET_ADMIN - sv2-tp-jdc-proxy: + sv2-jdc-translator-sniffer: image: sv2-custom-proxy-builder-image labels: logging: "config-a" command: ["./sv2-custom-proxy"] ports: - - "8440:8440" - - "5678:5678" + - "34266:34266" + - "3458:3458" environment: - - SERVER=10.5.0.3:8443 - - CLIENT=10.5.0.20:8440 - - PROM_ADDRESS=10.5.0.20:5678 - - PROXY_TYPE=tp-jdc - - NETWORK=${NETWORK} + - SERVER=10.5.0.22:34265 + - CLIENT=0.0.0.0:34266 + - PROM_ADDRESS=10.5.0.32:3458 + - PROXY_TYPE=jdc-translator - RUST_LOG=${LOG_LEVEL} - container_name: sv2-tp-jdc-proxy + container_name: sv2-jdc-translator-sniffer depends_on: - template-provider-miner-side: - condition: service_healthy - restart: true - sv2-custom-proxy-builder: - condition: service_started - prometheus: - condition: service_started + - sv2-custom-proxy-builder + - jd-client restart: unless-stopped networks: sv2-net: - ipv4_address: 10.5.0.20 + ipv4_address: 10.5.0.32 sv2-translator-miner-proxy: image: sv1-custom-proxy-builder-image @@ -314,8 +474,8 @@ services: - "5676:5676" environment: - SERVER=0.0.0.0:34255 - - CLIENT=10.5.0.7:34256 - - PROM_ADDRESS=10.5.0.23:5676 + - CLIENT=10.5.0.23:34256 + - PROM_ADDRESS=10.5.0.33:5676 - PROXY_TYPE=translator-miner - RUST_LOG=${LOG_LEVEL} container_name: sv2-translator-miner-proxy @@ -325,7 +485,11 @@ services: restart: unless-stopped networks: sv2-net: - ipv4_address: 10.5.0.23 + ipv4_address: 10.5.0.33 + + # ============================================================================ + # SV1 SERVICES (10.5.0.40-10.5.0.43) + # ============================================================================ sv1-pool: container_name: sv1-pool @@ -340,7 +504,7 @@ services: volumes: - "./testnet-DB:/public-pool/DB" - "./custom-configs/sv1-pool/.env:/public-pool/.env:ro" - - "./custom-configs/sv1-pool/rpc.js:/public-pool/node_modules/rpc-bitcoin/build/src/rpc.js" # to fix rpc-version field issue + - "./custom-configs/sv1-pool/rpc.js:/public-pool/node_modules/rpc-bitcoin/build/src/rpc.js" restart: unless-stopped environment: - NODE_ENV=production @@ -348,7 +512,7 @@ services: - sv1-node-pool-proxy networks: sv2-net: - ipv4_address: 10.5.0.8 + ipv4_address: 10.5.0.40 cap_add: - NET_ADMIN @@ -360,15 +524,15 @@ services: [ "/bin/sh", "-c", - "./monitor_and_apply_latency.sh 10.5.0.8 2 & exec ./sv1-custom-proxy", + "./monitor_and_apply_latency.sh 10.5.0.40 2 & exec ./sv1-custom-proxy", ] ports: - "3333:3333" - "2345:2345" environment: - - SERVER=10.5.0.8:3332 + - SERVER=10.5.0.40:3332 - CLIENT=0.0.0.0:3333 - - PROM_ADDRESS=10.5.0.19:2345 + - PROM_ADDRESS=10.5.0.41:2345 - PROXY_TYPE=pool-miner - RUST_LOG=${LOG_LEVEL} container_name: sv1-pool-miner-proxy @@ -378,7 +542,7 @@ services: restart: unless-stopped networks: sv2-net: - ipv4_address: 10.5.0.19 + ipv4_address: 10.5.0.41 cap_add: - NET_ADMIN @@ -391,9 +555,9 @@ services: - "48330:48330" - "4567:4567" environment: - - SERVER=http://10.5.0.16:18332 + - SERVER=http://10.5.0.4:18332 - CLIENT=0.0.0.0:48330 - - PROM_ADDRESS=10.5.0.21:4567 + - PROM_ADDRESS=10.5.0.42:4567 - PROXY_TYPE=node-pool - RUST_LOG=${LOG_LEVEL} container_name: sv1-node-pool-proxy @@ -406,16 +570,11 @@ services: restart: unless-stopped networks: sv2-net: - ipv4_address: 10.5.0.21 + ipv4_address: 10.5.0.42 - monitor-traffic-tcpdump: - image: inzania/network-traffic-metrics:latest - network_mode: host - container_name: monitor-traffic-tcpdump - platform: linux/amd64 - environment: - - "NTM_INTERFACE=any" - - "NTM_FILTERS=" + # ============================================================================ + # MONITORING SERVICES (10.5.0.50-10.5.0.56) + # ============================================================================ prometheus: image: prom/prometheus:v2.36.2 @@ -436,7 +595,7 @@ services: - cadvisor networks: sv2-net: - ipv4_address: 10.5.0.9 + ipv4_address: 10.5.0.50 deploy: placement: constraints: @@ -462,26 +621,29 @@ services: container_name: node-exporter networks: sv2-net: - ipv4_address: 10.5.0.10 + ipv4_address: 10.5.0.51 deploy: mode: global restart_policy: condition: on-failure cadvisor: - image: gcr.io/cadvisor/cadvisor + image: gcr.io/cadvisor/cadvisor:v0.55.1 + privileged: true volumes: - /:/rootfs:ro - #- /var/run:/var/run:rw - - /var/run/docker.sock:/var/run/docker.sock:rw + - /var/run:/var/run:ro - /sys:/sys:ro - /var/lib/docker/:/var/lib/docker:ro + - /dev/disk/:/dev/disk:ro ports: - "8080:8080" container_name: cadvisor + devices: + - /dev/kmsg:/dev/kmsg networks: sv2-net: - ipv4_address: 10.5.0.12 + ipv4_address: 10.5.0.52 deploy: mode: global restart_policy: @@ -511,7 +673,7 @@ services: - ./grafana/config.monitoring networks: sv2-net: - ipv4_address: 10.5.0.13 + ipv4_address: 10.5.0.53 user: "472" deploy: placement: @@ -531,7 +693,7 @@ services: - "8686:8686" networks: sv2-net: - ipv4_address: 10.5.0.14 + ipv4_address: 10.5.0.54 renderer: image: grafana/grafana-image-renderer:latest @@ -542,7 +704,16 @@ services: - "8081:8081" networks: sv2-net: - ipv4_address: 10.5.0.15 + ipv4_address: 10.5.0.55 + + monitor-traffic-tcpdump: + image: inzania/network-traffic-metrics:latest + network_mode: host + container_name: monitor-traffic-tcpdump + platform: linux/amd64 + environment: + - "NTM_INTERFACE=any" + - "NTM_FILTERS=net 10.5.0.0/24 and ip" pools-latency-calculator: image: pools-latency-calculator-builder-image @@ -555,7 +726,11 @@ services: restart: unless-stopped networks: sv2-net: - ipv4_address: 10.5.0.18 + ipv4_address: 10.5.0.56 + + # ============================================================================ + # LOGGING SERVICES (10.5.0.60-10.5.0.62) + # ============================================================================ loki: image: grafana/loki:2.9.8 @@ -565,7 +740,7 @@ services: restart: unless-stopped networks: sv2-net: - ipv4_address: 10.5.0.30 + ipv4_address: 10.5.0.60 aliases: - loki volumes: @@ -585,10 +760,9 @@ services: - loki networks: sv2-net: - ipv4_address: 10.5.0.31 + ipv4_address: 10.5.0.61 aliases: - promtail - log-server: image: log-server-builder-image @@ -606,4 +780,4 @@ services: restart: unless-stopped networks: sv2-net: - ipv4_address: 10.5.0.32 \ No newline at end of file + ipv4_address: 10.5.0.62 diff --git a/docker-compose-config-c.yaml b/docker-compose-config-c.yaml index 059b113..41d916c 100644 --- a/docker-compose-config-c.yaml +++ b/docker-compose-config-c.yaml @@ -15,19 +15,23 @@ networks: gateway: 10.5.0.1 services: - common-template-provider-builder: + # ============================================================================ + # BUILDER SERVICES + # ============================================================================ + + bitcoin-core-builder: build: - dockerfile: ./template-provider.dockerfile - container_name: common-template-provider-builder - image: template-provider-builder-image - command: echo "common-template-provider build completed" + dockerfile: ./bitcoin-core.dockerfile + container_name: bitcoin-core-builder + image: bitcoin-core-builder-image + command: echo "Bitcoin Core build completed" - sv2-roles-builder: + sv2-tp-builder: build: - dockerfile: ./sv2-roles.dockerfile - container_name: sv2-roles-builder - image: sv2-roles-builder-image - command: echo "SRI build completed" + dockerfile: ./sv2-tp.dockerfile + container_name: sv2-tp-builder + image: sv2-tp-builder-image + command: echo "sv2-tp build completed" sv2-custom-proxy-builder: build: @@ -43,6 +47,13 @@ services: image: sv1-custom-proxy-builder-image command: echo "sv1-custom-proxy build completed" + pools-latency-calculator-builder: + build: + dockerfile: ./pools-latency-calculator/Dockerfile + container_name: pools-latency-calculator-builder + image: pools-latency-calculator-builder-image + command: echo "pools-latency-calculator build completed" + log-server-builder: build: dockerfile: ./log-server/Dockerfile @@ -50,37 +61,42 @@ services: image: log-server-builder-image command: echo "log-server-builder build completed" - pools-latency-calculator-builder: - build: - dockerfile: ./pools-latency-calculator/Dockerfile - container_name: pools-latency-calculator-builder - image: pools-latency-calculator-builder-image - command: echo "pools-latency-calculator build completed" + # ============================================================================ + # BITCOIN CORE NODES (10.5.0.2-10.5.0.4) + # ============================================================================ - template-provider-pool-side: + bitcoin-core-pool-side: labels: logging: "config-c" - image: template-provider-builder-image - entrypoint: ["/bin/sh", "-c", "./scripts/update-mainnet-chainstate.sh ${NETWORK} && /bitcoin/bin/bitcoind -sv2 -sv2port=8442 -sv2interval=${SV2_INTERVAL} -sv2feedelta=0 -debug=sv2 -loglevel=sv2:debug -sv2bind=0.0.0.0 -${NETWORK}"] + image: bitcoin-core-builder-image + entrypoint: + - /bin/sh + - -c + - | + /scripts/update-mainnet-chainstate.sh ${NETWORK} + if [ -z "${NETWORK}" ]; then + exec bitcoin -m node -ipcbind=unix + else + exec bitcoin -m node -ipcbind=unix -${NETWORK} + fi + depends_on: + - bitcoin-core-builder ports: - - "8442:8442" - - "18333:48333" - - "8332:8332" - "18332:18332" - container_name: sv2-tp-pool-side - depends_on: - - common-template-provider-builder + container_name: bitcoin-core-pool-side volumes: - bitcoin_pool_side_data:/root/.bitcoin - - shared-mainnet-snapshot-volume:/shared_volume # Shared volume for mainnet snapshot - - ./custom-configs/sri-roles/bitcoin-tp-pool.conf:/root/.bitcoin/bitcoin.conf + - shared-mainnet-snapshot-volume:/shared_volume + - ./custom-configs/sri-apps/bitcoin-tp-pool.conf:/root/.bitcoin/bitcoin.conf - ./containers-scripts:/scripts restart: unless-stopped networks: sv2-net: ipv4_address: 10.5.0.2 + environment: + - NETWORK=${NETWORK} healthcheck: - test: [ "CMD", "./scripts/healthcheck.sh", "http://127.0.0.1:18332" ] + test: ["CMD", "/scripts/healthcheck.sh", "http://127.0.0.1:18332"] interval: 2m timeout: 30s retries: 100 @@ -89,87 +105,175 @@ services: sv1-node-pool-side: labels: logging: "config-c" - image: template-provider-builder-image - entrypoint: ["/bin/sh", "-c", "./scripts/update-mainnet-chainstate.sh ${NETWORK} && /bitcoin/bin/bitcoind -${NETWORK}"] + image: bitcoin-core-builder-image + entrypoint: + - /bin/sh + - -c + - | + /scripts/update-mainnet-chainstate.sh ${NETWORK} + if [ -z "${NETWORK}" ]; then + exec bitcoin -m node -ipcbind=unix + else + exec bitcoin -m node -ipcbind=unix -${NETWORK} + fi + depends_on: + - bitcoin-core-builder ports: - "38333:18333" - "28332:18332" - "18443:18443" container_name: sv1-node-pool-side - depends_on: - - common-template-provider-builder volumes: - bitcoin_sv1_pool_side_data:/root/.bitcoin - - shared-mainnet-snapshot-volume:/shared_volume # Shared volume for mainnet snapshot - - ./custom-configs/sri-roles/bitcoin-sv1-node-pool.conf:/root/.bitcoin/bitcoin.conf + - shared-mainnet-snapshot-volume:/shared_volume + - ./custom-configs/sri-apps/bitcoin-sv1-node-pool.conf:/root/.bitcoin/bitcoin.conf - ./containers-scripts:/scripts restart: unless-stopped networks: sv2-net: - ipv4_address: 10.5.0.16 + ipv4_address: 10.5.0.3 environment: - NETWORK=${NETWORK} healthcheck: - test: [ "CMD", "./scripts/healthcheck.sh", "http://127.0.0.1:18332" ] + test: ["CMD", "/scripts/healthcheck.sh", "http://127.0.0.1:18332"] interval: 2m timeout: 30s retries: 100 start_period: 1m + # ============================================================================ + # SV2 TEMPLATE PROVIDERS (10.5.0.10) + # ============================================================================ + + sv2-tp-pool-side: + labels: + logging: "config-c" + image: sv2-tp-builder-image + container_name: sv2-tp-pool-side + ports: + - "8441:8441" + environment: + - RUST_LOG=${LOG_LEVEL} + - NETWORK=${NETWORK} + volumes: + - bitcoin_pool_side_data:/root/.bitcoin + depends_on: + bitcoin-core-pool-side: + condition: service_healthy + restart: true + sv2-tp-builder: + condition: service_started + restart: unless-stopped + networks: + sv2-net: + ipv4_address: 10.5.0.10 + command: > + sh -c ' + if [ -z "${NETWORK}" ] || [ "${NETWORK}" = "mainnet" ]; then + sv2-tp -ipcconnect=unix -sv2bind=0.0.0.0:8441 -sv2interval=${TP_MIN_INTERVAL} -debug=sv2 -loglevel=sv2:trace + else + sv2-tp -chain=${NETWORK} -ipcconnect=unix -sv2bind=0.0.0.0:8441 -sv2interval=${TP_MIN_INTERVAL} -debug=sv2 -loglevel=sv2:trace + fi + ' + + # ============================================================================ + # SV2 CORE SERVICES (10.5.0.20-10.5.0.21) + # ============================================================================ + pool: - image: sv2-roles-builder-image + image: stratumv2/pool_sv2:v0.2.0 labels: logging: "config-c" - command: - [ - "./pool_sv2", - "-c", - "pool/config-examples/pool-config-c-docker-example.toml", - ] + env_file: + - .env + entrypoint: > + sh -c ' + (apk add --no-cache curl iproute2 iptables 2>/dev/null || apt-get update -qq && apt-get install -y -qq curl iproute2 iptables 2>/dev/null || true) && + /app/monitor_and_apply_latency.sh 10.5.0.31 2 & + envsubst < /app/pool-config.toml.template > /app/pool-config.toml && + exec /app/pool_sv2 -c /app/pool-config.toml + ' ports: - "34254:34254" environment: - RUST_LOG=${LOG_LEVEL} + - TP_POOL_ADDRESS=10.5.0.30:8439 container_name: sv2-pool depends_on: - - sv2-roles-builder - - sv2-tp-pool-proxy + sv2-tp-pool-sniffer: + condition: service_started volumes: - - ./custom-configs/sri-roles/config-c:/usr/local/bin/pool/config-examples/ + - ./custom-configs/sri-apps/pool-config.toml.template:/app/pool-config.toml.template:ro + - ./pools-latency-calculator/monitor_and_apply_latency.sh:/app/monitor_and_apply_latency.sh:ro restart: unless-stopped networks: sv2-net: - ipv4_address: 10.5.0.4 + ipv4_address: 10.5.0.20 cap_add: - NET_ADMIN translator: - image: sv2-roles-builder-image + image: stratumv2/translator_sv2:v0.2.0 labels: logging: "config-c" - command: - [ - "/bin/sh", - "-c", - "./monitor_and_apply_latency.sh 10.5.0.23 2 & exec ./translator_sv2 -c translator/config-examples/tproxy-config-c-docker-example.toml", - ] + env_file: + - .env + entrypoint: > + sh -c ' + envsubst < /app/proxy-config.toml.template > /app/proxy-config.toml && + exec /app/translator_sv2 -c /app/proxy-config.toml + ' ports: - "34256:34256" environment: - RUST_LOG=${LOG_LEVEL} + - TRANSLATOR_UPSTREAM_ADDRESS=10.5.0.31 + - TRANSLATOR_UPSTREAM_PORT=34251 container_name: sv2-translator depends_on: - - sv2-pool-translator-proxy + - sv2-pool-translator-sniffer volumes: - - ./custom-configs/sri-roles/config-c:/usr/local/bin/translator/config-examples/ + - ./custom-configs/sri-apps/translator-proxy-config.toml.template:/app/proxy-config.toml.template:ro restart: unless-stopped networks: sv2-net: - ipv4_address: 10.5.0.7 + ipv4_address: 10.5.0.21 cap_add: - NET_ADMIN - sv2-pool-translator-proxy: + # ============================================================================ + # SV2 PROXIES FOR MONITORING (10.5.0.30-10.5.0.32) + # ============================================================================ + + sv2-tp-pool-sniffer: + image: sv2-custom-proxy-builder-image + labels: + logging: "config-c" + command: ["./sv2-custom-proxy"] + ports: + - "8439:8439" + - "5677:5677" + environment: + - SERVER=10.5.0.10:8441 + - CLIENT=10.5.0.30:8439 + - PROM_ADDRESS=10.5.0.30:5677 + - PROXY_TYPE=tp-pool + - NETWORK=${NETWORK} + - RUST_LOG=${LOG_LEVEL} + container_name: sv2-tp-pool-sniffer + depends_on: + sv2-tp-pool-side: + condition: service_started + sv2-custom-proxy-builder: + condition: service_started + prometheus: + condition: service_started + restart: unless-stopped + networks: + sv2-net: + ipv4_address: 10.5.0.30 + + sv2-pool-translator-sniffer: image: sv2-custom-proxy-builder-image labels: logging: "config-c" @@ -177,58 +281,29 @@ services: [ "/bin/sh", "-c", - "./monitor_and_apply_latency.sh 10.5.0.4 2 -proxy-type=pool-translator & exec ./sv2-custom-proxy", + "./monitor_and_apply_latency.sh 10.5.0.20 2 & exec ./sv2-custom-proxy", ] ports: - "34253:34254" - "34251:34251" - "3456:3456" environment: - - SERVER=10.5.0.4:34254 - - CLIENT=10.5.0.17:34251 - - PROM_ADDRESS=10.5.0.17:3456 + - SERVER=10.5.0.20:34254 + - CLIENT=10.5.0.31:34251 + - PROM_ADDRESS=10.5.0.31:3456 - PROXY_TYPE=pool-translator - RUST_LOG=${LOG_LEVEL} - container_name: sv2-pool-translator-proxy + container_name: sv2-pool-translator-sniffer depends_on: - sv2-custom-proxy-builder - pool restart: unless-stopped networks: sv2-net: - ipv4_address: 10.5.0.17 + ipv4_address: 10.5.0.31 cap_add: - NET_ADMIN - sv2-tp-pool-proxy: - image: sv2-custom-proxy-builder-image - labels: - logging: "config-c" - command: ["./sv2-custom-proxy"] - ports: - - "8441:8441" - - "5678:5678" - environment: - - SERVER=10.5.0.2:8442 - - CLIENT=10.5.0.20:8441 - - PROM_ADDRESS=10.5.0.20:5678 - - PROXY_TYPE=tp-pool - - NETWORK=${NETWORK} - - RUST_LOG=${LOG_LEVEL} - container_name: sv2-tp-pool-proxy - depends_on: - template-provider-pool-side: - condition: service_healthy - restart: true - sv2-custom-proxy-builder: - condition: service_started - prometheus: - condition: service_started - restart: unless-stopped - networks: - sv2-net: - ipv4_address: 10.5.0.20 - sv2-translator-miner-proxy: image: sv1-custom-proxy-builder-image labels: @@ -239,8 +314,8 @@ services: - "5676:5676" environment: - SERVER=0.0.0.0:34255 - - CLIENT=10.5.0.7:34256 - - PROM_ADDRESS=10.5.0.23:5676 + - CLIENT=10.5.0.21:34256 + - PROM_ADDRESS=10.5.0.32:5676 - PROXY_TYPE=translator-miner - RUST_LOG=${LOG_LEVEL} container_name: sv2-translator-miner-proxy @@ -250,7 +325,11 @@ services: restart: unless-stopped networks: sv2-net: - ipv4_address: 10.5.0.23 + ipv4_address: 10.5.0.32 + + # ============================================================================ + # SV1 SERVICES (10.5.0.40-10.5.0.42) + # ============================================================================ sv1-pool: container_name: sv1-pool @@ -265,7 +344,7 @@ services: volumes: - "./testnet-DB:/public-pool/DB" - "./custom-configs/sv1-pool/.env:/public-pool/.env:ro" - - "./custom-configs/sv1-pool/rpc.js:/public-pool/node_modules/rpc-bitcoin/build/src/rpc.js" # to fix rpc-version field issue + - "./custom-configs/sv1-pool/rpc.js:/public-pool/node_modules/rpc-bitcoin/build/src/rpc.js" restart: unless-stopped environment: - NODE_ENV=production @@ -273,7 +352,7 @@ services: - sv1-node-pool-proxy networks: sv2-net: - ipv4_address: 10.5.0.8 + ipv4_address: 10.5.0.40 cap_add: - NET_ADMIN @@ -285,15 +364,15 @@ services: [ "/bin/sh", "-c", - "./monitor_and_apply_latency.sh 10.5.0.8 2 & exec ./sv1-custom-proxy", + "./monitor_and_apply_latency.sh 10.5.0.40 2 & exec ./sv1-custom-proxy", ] ports: - "3333:3333" - "2345:2345" environment: - - SERVER=10.5.0.8:3332 + - SERVER=10.5.0.40:3332 - CLIENT=0.0.0.0:3333 - - PROM_ADDRESS=10.5.0.19:2345 + - PROM_ADDRESS=10.5.0.41:2345 - PROXY_TYPE=pool-miner - RUST_LOG=${LOG_LEVEL} container_name: sv1-pool-miner-proxy @@ -303,7 +382,7 @@ services: restart: unless-stopped networks: sv2-net: - ipv4_address: 10.5.0.19 + ipv4_address: 10.5.0.41 cap_add: - NET_ADMIN @@ -316,9 +395,9 @@ services: - "48330:48330" - "4567:4567" environment: - - SERVER=http://10.5.0.16:18332 + - SERVER=http://10.5.0.3:18332 - CLIENT=0.0.0.0:48330 - - PROM_ADDRESS=10.5.0.21:4567 + - PROM_ADDRESS=10.5.0.42:4567 - PROXY_TYPE=node-pool - RUST_LOG=${LOG_LEVEL} container_name: sv1-node-pool-proxy @@ -331,16 +410,11 @@ services: restart: unless-stopped networks: sv2-net: - ipv4_address: 10.5.0.21 + ipv4_address: 10.5.0.42 - monitor-traffic-tcpdump: - image: inzania/network-traffic-metrics:latest - network_mode: host - container_name: monitor-traffic-tcpdump - platform: linux/amd64 - environment: - - "NTM_INTERFACE=any" - - "NTM_FILTERS=" + # ============================================================================ + # MONITORING SERVICES (10.5.0.50-10.5.0.56) + # ============================================================================ prometheus: image: prom/prometheus:v2.36.2 @@ -361,7 +435,7 @@ services: - cadvisor networks: sv2-net: - ipv4_address: 10.5.0.9 + ipv4_address: 10.5.0.50 deploy: placement: constraints: @@ -387,26 +461,29 @@ services: container_name: node-exporter networks: sv2-net: - ipv4_address: 10.5.0.10 + ipv4_address: 10.5.0.51 deploy: mode: global restart_policy: condition: on-failure cadvisor: - image: gcr.io/cadvisor/cadvisor + image: gcr.io/cadvisor/cadvisor:v0.55.1 + privileged: true volumes: - /:/rootfs:ro - #- /var/run:/var/run:rw - - /var/run/docker.sock:/var/run/docker.sock:rw + - /var/run:/var/run:ro - /sys:/sys:ro - /var/lib/docker/:/var/lib/docker:ro + - /dev/disk/:/dev/disk:ro ports: - "8080:8080" container_name: cadvisor + devices: + - /dev/kmsg:/dev/kmsg networks: sv2-net: - ipv4_address: 10.5.0.12 + ipv4_address: 10.5.0.52 deploy: mode: global restart_policy: @@ -437,7 +514,7 @@ services: - ./grafana/config.monitoring networks: sv2-net: - ipv4_address: 10.5.0.13 + ipv4_address: 10.5.0.53 user: "472" deploy: placement: @@ -457,7 +534,7 @@ services: - "8686:8686" networks: sv2-net: - ipv4_address: 10.5.0.14 + ipv4_address: 10.5.0.54 renderer: image: grafana/grafana-image-renderer:latest @@ -468,7 +545,16 @@ services: - "8081:8081" networks: sv2-net: - ipv4_address: 10.5.0.15 + ipv4_address: 10.5.0.55 + + monitor-traffic-tcpdump: + image: inzania/network-traffic-metrics:latest + network_mode: host + container_name: monitor-traffic-tcpdump + platform: linux/amd64 + environment: + - "NTM_INTERFACE=any" + - "NTM_FILTERS=net 10.5.0.0/24 and ip" pools-latency-calculator: image: pools-latency-calculator-builder-image @@ -481,7 +567,11 @@ services: restart: unless-stopped networks: sv2-net: - ipv4_address: 10.5.0.18 + ipv4_address: 10.5.0.56 + + # ============================================================================ + # LOGGING SERVICES (10.5.0.60-10.5.0.62) + # ============================================================================ loki: image: grafana/loki:2.9.8 @@ -491,7 +581,7 @@ services: restart: unless-stopped networks: sv2-net: - ipv4_address: 10.5.0.30 + ipv4_address: 10.5.0.60 aliases: - loki volumes: @@ -511,7 +601,7 @@ services: - loki networks: sv2-net: - ipv4_address: 10.5.0.31 + ipv4_address: 10.5.0.61 aliases: - promtail @@ -531,4 +621,4 @@ services: restart: unless-stopped networks: sv2-net: - ipv4_address: 10.5.0.32 \ No newline at end of file + ipv4_address: 10.5.0.62 diff --git a/grafana/provisioning/dashboards/config-a/Docker Prometheus Monitoring-1571332751387.json b/grafana/provisioning/dashboards/config-a/Docker Prometheus Monitoring-1571332751387.json index dad87d8..9a2fe65 100644 --- a/grafana/provisioning/dashboards/config-a/Docker Prometheus Monitoring-1571332751387.json +++ b/grafana/provisioning/dashboards/config-a/Docker Prometheus Monitoring-1571332751387.json @@ -37,13 +37,13 @@ "asDropdown": false, "icon": "external link", "includeVars": false, - "keepTime": false, + "keepTime": true, "tags": [], "targetBlank": false, "title": "Download Logs", - "tooltip": "", + "tooltip": "Download logs for the selected time range", "type": "link", - "url": "http://localhost:7420" + "url": "http://localhost:7420?from=${__from}&to=${__to}" } ], "liveNow": false, @@ -53,7 +53,7 @@ "h": 1, "w": 24, "x": 0, - "y": 0 + "y": 10 }, "id": 76, "title": "Shares, blocks and templates stats", @@ -120,33 +120,54 @@ "value": 80 } ] - } + }, + "unit": "sats" }, "overrides": [ { "matcher": { - "id": "byName", - "options": "Acceptance rate %" + "id": "byRegexp", + "options": ".*SV1.*" }, "properties": [ { - "id": "unit", - "value": "percent" + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "red" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": ".*SV2.*" + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "blue" + } } ] } ] }, "gridPos": { - "h": 10, - "w": 9, + "h": 9, + "w": 24, "x": 0, - "y": 1 + "y": 21 }, - "id": 77, + "id": 96, + "interval": "15s", "options": { "legend": { "calcs": [ + "mean", "lastNotNull" ], "displayMode": "table", @@ -167,11 +188,11 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "sv1_submitted_shares", + "expr": "sv1_block_template_value", "hide": false, "interval": "", "intervalFactor": 1, - "legendFormat": "Submitted shares", + "legendFormat": "SV1 - block template value", "metric": "container_network_receive_bytes_total", "range": true, "refId": "A", @@ -183,57 +204,32 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "sv1_valid_shares", + "expr": "sv2_block_template_value", "hide": false, "interval": "", "intervalFactor": 1, - "legendFormat": "Valid shares", + "legendFormat": "SV2 - block template value", "metric": "container_network_receive_bytes_total", "range": true, "refId": "B", "step": 10 - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sv1_stale_shares", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "Stale shares", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "C", - "step": 10 - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "disableTextWrap": false, - "editorMode": "code", - "exemplar": false, - "expr": "(sv1_valid_shares * 100) / sv1_submitted_shares", - "fullMetaSearch": false, - "hide": false, - "includeNullMetadata": true, - "instant": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "Acceptance rate %", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "D", - "step": 10, - "useBackend": false } ], - "title": "SV1 shares", - "type": "timeseries" + "title": "SV1 vs SV2 - block templates value", + "transformations": [], + "type": "timeseries", + "description": "Block template value in satoshis for SV1 and SV2 protocols. Higher values indicate more valuable block templates." + }, + { + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 54 + }, + "id": 71, + "title": "Latency and time measurements", + "type": "row" }, { "datasource": { @@ -243,7 +239,43 @@ "fieldConfig": { "defaults": { "color": { - "mode": "thresholds" + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "left", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 1, + "pointSize": 1, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } }, "fieldMinMax": false, "links": [], @@ -254,40 +286,41 @@ { "color": "green", "value": null + }, + { + "color": "red", + "value": 80 } ] - } + }, + "unit": "ms" }, "overrides": [] }, "gridPos": { - "h": 10, - "w": 3, - "x": 9, - "y": 1 + "h": 7, + "w": 24, + "x": 0, + "y": 39 }, - "id": 82, + "id": 75, "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "percentChangeColorMode": "standard", - "reduceOptions": { + "legend": { "calcs": [ + "mean", "lastNotNull" ], - "fields": "", - "values": false - }, - "showPercentChange": false, - "text": { - "valueSize": 50 + "displayMode": "table", + "placement": "bottom", + "showLegend": true }, - "textMode": "auto", - "wideLayout": true + "tooltip": { + "maxHeight": 600, + "mode": "multi", + "sort": "none" + } }, - "pluginVersion": "11.2.0", + "pluginVersion": "10.4.1", "targets": [ { "datasource": { @@ -295,19 +328,20 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "sv1_mined_blocks", + "expr": "average_pool_subscription_latency_milliseconds", "hide": false, "interval": "", "intervalFactor": 1, - "legendFormat": "SV1 mined blocks", + "legendFormat": "Average latency with major pools (RTT)", "metric": "container_network_receive_bytes_total", "range": true, "refId": "A", "step": 10 } ], - "title": "SV1 mined blocks", - "type": "stat" + "title": "Average latency with major pools (RTT)", + "type": "timeseries", + "description": "Round-trip time (RTT) latency measurements to major Bitcoin mining pools. Lower values indicate better network connectivity." }, { "datasource": { @@ -370,33 +404,54 @@ "value": 80 } ] - } + }, + "unit": "ms" }, "overrides": [ { "matcher": { - "id": "byName", - "options": "Acceptance rate %" + "id": "byRegexp", + "options": ".*SV1.*" }, "properties": [ { - "id": "unit", - "value": "percent" + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "red" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": ".*SV2.*" + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "blue" + } } ] } ] }, "gridPos": { - "h": 10, - "w": 9, - "x": 12, - "y": 1 + "h": 9, + "w": 24, + "x": 0, + "y": 46 }, - "id": 80, + "id": 93, + "interval": "15s", "options": { "legend": { "calcs": [ + "mean", "lastNotNull" ], "displayMode": "table", @@ -417,11 +472,11 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "sv2_submitted_shares", + "expr": "sv1_new_job_latency", "hide": false, "interval": "", "intervalFactor": 1, - "legendFormat": "Submitted shares", + "legendFormat": "SV1 - time to get a new job from Pool", "metric": "container_network_receive_bytes_total", "range": true, "refId": "A", @@ -433,57 +488,21 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "sv2_valid_shares", + "expr": "new_job_jdc_new_template", "hide": false, "interval": "", "intervalFactor": 1, - "legendFormat": "Valid shares", + "legendFormat": "SV2 - time to get a new job from JDC", "metric": "container_network_receive_bytes_total", "range": true, "refId": "B", "step": 10 - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sv2_stale_shares", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "Stale shares", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "C", - "step": 10 - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "disableTextWrap": false, - "editorMode": "code", - "exemplar": false, - "expr": "(sv2_valid_shares * 100) / sv2_submitted_shares", - "fullMetaSearch": false, - "hide": false, - "includeNullMetadata": true, - "instant": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "Acceptance rate %", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "D", - "step": 10, - "useBackend": false } ], - "title": "SV2 shares", - "type": "timeseries" + "title": "SV1 vs SV2 - time to get a new job from Pool/JDC", + "transformations": [], + "type": "timeseries", + "description": "Time taken to receive a new mining job from the pool (SV1) or job distribution coordinator (SV2). Measured in milliseconds." }, { "datasource": { @@ -493,81 +512,7 @@ "fieldConfig": { "defaults": { "color": { - "mode": "thresholds" - }, - "fieldMinMax": false, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 3, - "x": 21, - "y": 1 - }, - "id": 84, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "percentChangeColorMode": "standard", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showPercentChange": false, - "text": { - "valueSize": 50 - }, - "textMode": "auto", - "wideLayout": true - }, - "pluginVersion": "11.2.0", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sv2_mined_blocks", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "SV2 mined blocks", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "A", - "step": 10 - } - ], - "title": "SV2 mined blocks", - "type": "stat" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" + "mode": "palette-classic" }, "custom": { "axisBorderShow": false, @@ -576,7 +521,6 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, - "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -612,8 +556,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -621,18 +564,36 @@ } ] }, - "unit": "sats" + "unit": "ms" }, "overrides": [ { "matcher": { - "id": "byName", - "options": "SV2 delta %" + "id": "byRegexp", + "options": ".*SV1.*" }, "properties": [ { - "id": "unit", - "value": "percent" + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "red" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": ".*SV2.*" + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "blue" + } } ] } @@ -640,11 +601,11 @@ }, "gridPos": { "h": 9, - "w": 12, + "w": 24, "x": 0, - "y": 11 + "y": 55 }, - "id": 98, + "id": 94, "interval": "15s", "options": { "legend": { @@ -670,19 +631,37 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "sv1_block_template_value", + "expr": "sv1_new_job_prev_hash_latency", "hide": false, "interval": "", "intervalFactor": 1, - "legendFormat": "SV1 - block template value", + "legendFormat": "SV1 - time to get a new job (after a new block found) from Pool", "metric": "container_network_receive_bytes_total", "range": true, "refId": "A", "step": 10 + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "new_job_prev_hash_throught_sv2_jdc", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "SV2 - time to get a new job (after a new block found) from JDC", + "metric": "container_network_receive_bytes_total", + "range": true, + "refId": "B", + "step": 10 } ], - "title": "SV1 - block templates value", - "type": "timeseries" + "title": "SV1 vs SV2 - time to get a new job (after a new block found) from Pool/JDC", + "transformations": [], + "type": "timeseries", + "description": "Time taken to receive a new job after a block is found on the network. This measures how quickly the system adapts to new blocks. Measured in milliseconds." }, { "datasource": { @@ -701,7 +680,6 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, - "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -737,8 +715,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -746,18 +723,36 @@ } ] }, - "unit": "sats" + "unit": "ms" }, "overrides": [ { "matcher": { - "id": "byName", - "options": "SV2 delta %" + "id": "byRegexp", + "options": ".*SV1.*" + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "red" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": ".*SV2.*" }, "properties": [ { - "id": "unit", - "value": "percent" + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "blue" + } } ] } @@ -765,11 +760,11 @@ }, "gridPos": { "h": 9, - "w": 12, - "x": 12, - "y": 11 + "w": 24, + "x": 0, + "y": 64 }, - "id": 99, + "id": 95, "interval": "15s", "options": { "legend": { @@ -795,19 +790,50 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "sv2_block_template_value", + "expr": "block_propagation_time_through_sv1_pool", "hide": false, "interval": "", "intervalFactor": 1, - "legendFormat": "SV2 - block template value", + "legendFormat": "SV1 - block propagation time", "metric": "container_network_receive_bytes_total", "range": true, "refId": "A", "step": 10 + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "block_propagation_time_through_sv2_jdc", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "SV2 - block propagation time", + "metric": "container_network_receive_bytes_total", + "range": true, + "refId": "B", + "step": 10 } ], - "title": "SV2 - block templates value", - "type": "timeseries" + "title": "SV1 vs SV2 - block propagation time", + "transformations": [], + "type": "timeseries", + "description": "Time elapsed from when a share is produced until the corresponding valid block is broadcasted by the Bitcoin node. Measured in milliseconds." + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 110 + }, + "id": 56, + "panels": [], + "title": "Bandwidth Usage - Miner-Side", + "type": "row" }, { "datasource": { @@ -826,7 +852,6 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, - "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -841,7 +866,7 @@ "fill": "solid" }, "lineWidth": 1, - "pointSize": 1, + "pointSize": 3, "scaleDistribution": { "type": "linear" }, @@ -862,8 +887,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -871,35 +895,122 @@ } ] }, - "unit": "sats" + "unit": "binBps" }, "overrides": [ { "matcher": { - "id": "byName", - "options": "SV2 delta %" + "id": "byRegexp", + "options": ".*SV1.*bandwidth.*" + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "red" + } + }, + { + "id": "custom.axisPlacement", + "value": "left" + }, + { + "id": "custom.axisLabel", + "value": "Bandwidth (bytes/sec)" + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": ".*SV2.*bandwidth.*" + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "blue" + } + }, + { + "id": "custom.axisPlacement", + "value": "left" + }, + { + "id": "custom.axisLabel", + "value": "Bandwidth (bytes/sec)" + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": ".*SV1.*total bytes.*" + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "orange" + } + }, + { + "id": "custom.axisPlacement", + "value": "right" + }, + { + "id": "custom.axisLabel", + "value": "Total Bytes" + }, + { + "id": "unit", + "value": "decbytes" + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": ".*SV2.*total bytes.*" }, "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "cyan" + } + }, + { + "id": "custom.axisPlacement", + "value": "right" + }, + { + "id": "custom.axisLabel", + "value": "Total Bytes" + }, { "id": "unit", - "value": "percent" + "value": "decbytes" } ] } ] }, "gridPos": { - "h": 9, - "w": 24, + "h": 10, + "w": 12, "x": 0, - "y": 20 + "y": 111 }, - "id": 96, + "id": 69, "interval": "15s", "options": { "legend": { "calcs": [ - "mean", "lastNotNull" ], "displayMode": "table", @@ -920,14 +1031,40 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "sv1_block_template_value", + "expr": "sum(rate(ntm_bytes_total{src=\"10.5.0.41\", dst=\"10.5.0.40\",proto=\"tcp\"}[5m]))", + "hide": false, + "instant": false, + "legendFormat": "SV1 (miner to pool) (bandwidth)", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "sum(ntm_bytes_total{src=\"10.5.0.41\", dst=\"10.5.0.40\",proto=\"tcp\"})", + "hide": false, + "instant": false, + "legendFormat": "SV1 (miner to pool) (total bytes)", + "range": true, + "refId": "A_total" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "sum(rate(ntm_bytes_total{src=\"10.5.0.22\", dst=\"10.5.0.34\",proto=\"tcp\"}[5m])) + sum(rate(ntm_bytes_total{src=\"10.5.0.22\", dst=\"10.5.0.21\",proto=\"tcp\"}[5m]))", "hide": false, "interval": "", "intervalFactor": 1, - "legendFormat": "SV1 - block template value", + "legendFormat": "SV2 (jdc to pool + jdc to jds) (bandwidth)", "metric": "container_network_receive_bytes_total", "range": true, - "refId": "A", + "refId": "B", "step": 10 }, { @@ -936,39 +1073,24 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "sv2_block_template_value", + "expr": "sum(ntm_bytes_total{src=\"10.5.0.22\", dst=\"10.5.0.34\",proto=\"tcp\"})", "hide": false, "interval": "", "intervalFactor": 1, - "legendFormat": "SV2 - block template value", + "legendFormat": "SV2 (jdc to pool + jdc to jds) (total bytes)", "metric": "container_network_receive_bytes_total", "range": true, - "refId": "B", + "refId": "B_total", "step": 10 } ], - "title": "SV1 vs SV2 - block templates value", - "transformations": [ - { - "id": "calculateField", - "options": { - "alias": "SV2 delta", - "mode": "reduceRow", - "reduce": { - "include": [ - "SV1 - block template value", - "SV2 - block template value" - ], - "reducer": "diff" - } - } - } - ], - "type": "timeseries" + "title": "SV1 vs SV2 - Network Tx (miner-side)", + "transformations": [], + "type": "timeseries", + "description": "Network transmission (outgoing) bandwidth and total bytes transmitted from the miner side for SV1 and SV2 protocols. Bandwidth (rate) is shown on the left Y-axis, total bytes on the right Y-axis." }, { "datasource": { - "default": true, "type": "prometheus", "uid": "PBFA97CFB590B2093" }, @@ -984,7 +1106,6 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, - "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -999,7 +1120,7 @@ "fill": "solid" }, "lineWidth": 1, - "pointSize": 1, + "pointSize": 3, "scaleDistribution": { "type": "linear" }, @@ -1020,8 +1141,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -1029,35 +1149,122 @@ } ] }, - "unit": "sats" + "unit": "binBps" }, "overrides": [ { "matcher": { - "id": "byName", - "options": "SV2 delta %" + "id": "byRegexp", + "options": ".*SV1.*bandwidth.*" + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "red" + } + }, + { + "id": "custom.axisPlacement", + "value": "left" + }, + { + "id": "custom.axisLabel", + "value": "Bandwidth (bytes/sec)" + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": ".*SV2.*bandwidth.*" }, "properties": [ { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "blue" + } + }, + { + "id": "custom.axisPlacement", + "value": "left" + }, + { + "id": "custom.axisLabel", + "value": "Bandwidth (bytes/sec)" + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": ".*SV1.*total bytes.*" + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "orange" + } + }, + { + "id": "custom.axisPlacement", + "value": "right" + }, + { + "id": "custom.axisLabel", + "value": "Total Bytes" + }, + { "id": "unit", - "value": "percent" + "value": "decbytes" + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": ".*SV2.*total bytes.*" + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "cyan" + } + }, + { + "id": "custom.axisPlacement", + "value": "right" + }, + { + "id": "custom.axisLabel", + "value": "Total Bytes" + }, + { + "id": "unit", + "value": "decbytes" } ] } ] }, "gridPos": { - "h": 9, - "w": 24, - "x": 0, - "y": 29 + "h": 10, + "w": 12, + "x": 12, + "y": 111 }, - "id": 97, + "id": 70, "interval": "15s", "options": { "legend": { "calcs": [ - "mean", "lastNotNull" ], "displayMode": "table", @@ -1078,15 +1285,25 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "last_block_mined_value", + "expr": "sum(rate(ntm_bytes_total{src=\"10.5.0.40\", dst=\"10.5.0.41\",proto=\"tcp\"}[5m]))", "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "Network - block template value", - "metric": "container_network_receive_bytes_total", + "instant": false, + "legendFormat": "SV1 (pool to miner) (bandwidth)", "range": true, - "refId": "A", - "step": 10 + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "sum(ntm_bytes_total{src=\"10.5.0.40\", dst=\"10.5.0.41\",proto=\"tcp\"})", + "hide": false, + "instant": false, + "legendFormat": "SV1 (pool to miner) (total bytes)", + "range": true, + "refId": "A_total" }, { "datasource": { @@ -1094,11 +1311,11 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "last_sv2_template_value", + "expr": "sum(rate(ntm_bytes_total{src=\"10.5.0.34\", dst=\"10.5.0.22\",proto=\"tcp\"}[5m])) + sum(rate(ntm_bytes_total{src=\"10.5.0.21\", dst=\"10.5.0.22\",proto=\"tcp\"}[5m]))", "hide": false, "interval": "", "intervalFactor": 1, - "legendFormat": "SV2 - block template value", + "legendFormat": "SV2 (pool to jdc + jds to jdc) (bandwidth)", "metric": "container_network_receive_bytes_total", "range": true, "refId": "B", @@ -1110,29 +1327,33 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "(last_sv2_template_value - last_block_mined_value) / last_block_mined_value * 100", + "expr": "sum(ntm_bytes_total{src=\"10.5.0.34\", dst=\"10.5.0.22\",proto=\"tcp\"})", "hide": false, "interval": "", "intervalFactor": 1, - "legendFormat": "SV2 delta %", + "legendFormat": "SV2 (pool to jdc + jds to jdc) (total bytes)", "metric": "container_network_receive_bytes_total", "range": true, - "refId": "C", + "refId": "B_total", "step": 10 } ], - "title": "SV2 - block templates value - comparison with mined blocks on the network", - "type": "timeseries" + "title": "SV1 vs SV2 - Network Rx (miner-side)", + "transformations": [], + "type": "timeseries", + "description": "Network reception (incoming) bandwidth and total bytes received on the miner side for SV1 and SV2 protocols. Bandwidth (rate) is shown on the left Y-axis, total bytes on the right Y-axis." }, { + "collapsed": false, "gridPos": { "h": 1, "w": 24, "x": 0, - "y": 38 + "y": 151 }, - "id": 71, - "title": "Latency and time measurements", + "id": 55, + "panels": [], + "title": "Bandwidth Usage - pool-side", "type": "row" }, { @@ -1152,7 +1373,6 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, - "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -1167,7 +1387,7 @@ "fill": "solid" }, "lineWidth": 1, - "pointSize": 1, + "pointSize": 3, "scaleDistribution": { "type": "linear" }, @@ -1188,8 +1408,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -1197,21 +1416,122 @@ } ] }, - "unit": "ms" + "unit": "binBps" }, - "overrides": [] + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": ".*SV1.*bandwidth.*" + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "red" + } + }, + { + "id": "custom.axisPlacement", + "value": "left" + }, + { + "id": "custom.axisLabel", + "value": "Bandwidth (bytes/sec)" + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": ".*SV2.*bandwidth.*" + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "blue" + } + }, + { + "id": "custom.axisPlacement", + "value": "left" + }, + { + "id": "custom.axisLabel", + "value": "Bandwidth (bytes/sec)" + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": ".*SV1.*total bytes.*" + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "orange" + } + }, + { + "id": "custom.axisPlacement", + "value": "right" + }, + { + "id": "custom.axisLabel", + "value": "Total Bytes" + }, + { + "id": "unit", + "value": "decbytes" + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": ".*SV2.*total bytes.*" + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "cyan" + } + }, + { + "id": "custom.axisPlacement", + "value": "right" + }, + { + "id": "custom.axisLabel", + "value": "Total Bytes" + }, + { + "id": "unit", + "value": "decbytes" + } + ] + } + ] }, "gridPos": { - "h": 7, - "w": 24, + "h": 10, + "w": 12, "x": 0, - "y": 39 + "y": 152 }, - "id": 75, + "id": 67, + "interval": "15s", "options": { "legend": { "calcs": [ - "mean", "lastNotNull" ], "displayMode": "table", @@ -1232,19 +1552,63 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "average_pool_subscription_latency_milliseconds", + "expr": "sum(rate(ntm_bytes_total{src=\"10.5.0.40\", dst=\"10.5.0.41\",proto=\"tcp\"}[5m]))", + "hide": false, + "instant": false, + "legendFormat": "SV1 (pool to miner) (bandwidth)", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "sum(ntm_bytes_total{src=\"10.5.0.40\", dst=\"10.5.0.41\",proto=\"tcp\"})", + "hide": false, + "instant": false, + "legendFormat": "SV1 (pool to miner) (total bytes)", + "range": true, + "refId": "A_total" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "sum(rate(ntm_bytes_total{src=\"10.5.0.20\", dst=\"10.5.0.34\",proto=\"tcp\"}[5m])) + sum(rate(ntm_bytes_total{src=\"10.5.0.21\", dst=\"10.5.0.22\",proto=\"tcp\"}[5m]))", "hide": false, "interval": "", "intervalFactor": 1, - "legendFormat": "Average latency with major pools (RTT)", + "legendFormat": "SV2 (pool to jdc + jds to jdc) (bandwidth)", "metric": "container_network_receive_bytes_total", "range": true, - "refId": "A", + "refId": "B", + "step": 10 + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "sum(ntm_bytes_total{src=\"10.5.0.20\", dst=\"10.5.0.34\",proto=\"tcp\"})", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "SV2 (pool to jdc + jds to jdc) (total bytes)", + "metric": "container_network_receive_bytes_total", + "range": true, + "refId": "B_total", "step": 10 } ], - "title": "Average latency with major pools (RTT)", - "type": "timeseries" + "title": "SV1 vs SV2 - Network Tx (pool-side)", + "transformations": [], + "type": "timeseries", + "description": "Network transmission (outgoing) bandwidth and total bytes transmitted from the pool side for SV1 and SV2 protocols. Bandwidth (rate) is shown on the left Y-axis, total bytes on the right Y-axis." }, { "datasource": { @@ -1263,7 +1627,6 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, - "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -1278,7 +1641,7 @@ "fill": "solid" }, "lineWidth": 1, - "pointSize": 1, + "pointSize": 3, "scaleDistribution": { "type": "linear" }, @@ -1299,8 +1662,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -1308,25 +1670,125 @@ } ] }, - "unit": "ms" + "unit": "binBps" }, - "overrides": [] - }, - "gridPos": { - "h": 7, - "w": 12, - "x": 0, - "y": 46 - }, - "id": 88, - "interval": "15s", - "options": { - "legend": { - "calcs": [ - "mean", - "lastNotNull" - ], - "displayMode": "table", + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": ".*SV1.*bandwidth.*" + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "red" + } + }, + { + "id": "custom.axisPlacement", + "value": "left" + }, + { + "id": "custom.axisLabel", + "value": "Bandwidth (bytes/sec)" + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": ".*SV2.*bandwidth.*" + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "blue" + } + }, + { + "id": "custom.axisPlacement", + "value": "left" + }, + { + "id": "custom.axisLabel", + "value": "Bandwidth (bytes/sec)" + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": ".*SV1.*total bytes.*" + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "orange" + } + }, + { + "id": "custom.axisPlacement", + "value": "right" + }, + { + "id": "custom.axisLabel", + "value": "Total Bytes" + }, + { + "id": "unit", + "value": "decbytes" + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": ".*SV2.*total bytes.*" + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "cyan" + } + }, + { + "id": "custom.axisPlacement", + "value": "right" + }, + { + "id": "custom.axisLabel", + "value": "Total Bytes" + }, + { + "id": "unit", + "value": "decbytes" + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 152 + }, + "id": 68, + "interval": "15s", + "options": { + "legend": { + "calcs": [ + "lastNotNull" + ], + "displayMode": "table", "placement": "bottom", "showLegend": true }, @@ -1344,19 +1806,76 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "sv1_new_job_latency", + "expr": "sum(rate(ntm_bytes_total{src=\"10.5.0.41\", dst=\"10.5.0.40\",proto=\"tcp\"}[5m]))", + "hide": false, + "instant": false, + "legendFormat": "SV1 (miner to pool) (bandwidth)", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "sum(ntm_bytes_total{src=\"10.5.0.41\", dst=\"10.5.0.40\",proto=\"tcp\"})", + "hide": false, + "instant": false, + "legendFormat": "SV1 (miner to pool) (total bytes)", + "range": true, + "refId": "A_total" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "sum(rate(ntm_bytes_total{src=\"10.5.0.34\", dst=\"10.5.0.20\",proto=\"tcp\"}[5m])) + sum(rate(ntm_bytes_total{src=\"10.5.0.22\", dst=\"10.5.0.21\",proto=\"tcp\"}[5m]))", "hide": false, "interval": "", "intervalFactor": 1, - "legendFormat": "SV1 - time to get a new job from Pool", + "legendFormat": "SV2 (jdc to pool + jdc to jds) (bandwidth)", "metric": "container_network_receive_bytes_total", "range": true, - "refId": "A", + "refId": "B", + "step": 10 + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "sum(ntm_bytes_total{src=\"10.5.0.34\", dst=\"10.5.0.20\",proto=\"tcp\"})", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "SV2 (jdc to pool + jdc to jds) (total bytes)", + "metric": "container_network_receive_bytes_total", + "range": true, + "refId": "B_total", "step": 10 } ], - "title": "SV1 - time to get a new job from Pool", - "type": "timeseries" + "title": "SV1 vs SV2 - Network Rx (pool-side)", + "transformations": [], + "type": "timeseries", + "description": "Network reception (incoming) bandwidth and total bytes received on the pool side for SV1 and SV2 protocols. Bandwidth (rate) is shown on the left Y-axis, total bytes on the right Y-axis." + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 192 + }, + "id": 50, + "panels": [], + "title": "SV1 apps performances (per container)", + "type": "row" }, { "datasource": { @@ -1375,7 +1894,6 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, - "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -1390,7 +1908,7 @@ "fill": "solid" }, "lineWidth": 1, - "pointSize": 1, + "pointSize": 3, "scaleDistribution": { "type": "linear" }, @@ -1411,8 +1929,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -1420,18 +1937,17 @@ } ] }, - "unit": "ms" + "unit": "percentunit" }, "overrides": [] }, "gridPos": { - "h": 7, - "w": 12, - "x": 12, - "y": 46 + "h": 10, + "w": 6, + "x": 0, + "y": 193 }, - "id": 89, - "interval": "15s", + "id": 51, "options": { "legend": { "calcs": [ @@ -1456,19 +1972,42 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "new_job_jdc_new_template", + "expr": "sum(rate(container_cpu_usage_seconds_total{name=~\"sv1-pool\"}[1m])) by (name) \n", "hide": false, "interval": "", "intervalFactor": 1, - "legendFormat": "SV2 - time to get a new job from JDC", + "legendFormat": "{{ name }}", "metric": "container_network_receive_bytes_total", "range": true, "refId": "A", "step": 10 + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "sum(rate(container_cpu_usage_seconds_total{name=~\"sv1-node-pool-side\"}[1m])) by (name) \n", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "{{ name }}", + "metric": "container_network_receive_bytes_total", + "range": true, + "refId": "B", + "step": 10 + } + ], + "title": "Pool apps (SV1) - CPU Usage ", + "transformations": [ + { + "id": "calculateField", + "options": {} } ], - "title": "SV2 - time to get a new job from JDC", - "type": "timeseries" + "type": "timeseries", + "description": "CPU usage percentage for all SV1 pool-related applications and services." }, { "datasource": { @@ -1487,7 +2026,6 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, - "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -1502,7 +2040,7 @@ "fill": "solid" }, "lineWidth": 1, - "pointSize": 1, + "pointSize": 3, "scaleDistribution": { "type": "linear" }, @@ -1523,8 +2061,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -1532,18 +2069,17 @@ } ] }, - "unit": "ms" + "unit": "bytes" }, "overrides": [] }, "gridPos": { - "h": 7, - "w": 12, - "x": 0, - "y": 53 + "h": 10, + "w": 6, + "x": 6, + "y": 193 }, - "id": 90, - "interval": "15s", + "id": 52, "options": { "legend": { "calcs": [ @@ -1568,19 +2104,68 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "sv1_new_job_prev_hash_latency", + "expr": "container_memory_usage_bytes{name=~\"sv1-pool\"}\n", "hide": false, "interval": "", "intervalFactor": 1, - "legendFormat": "SV1 - time to get a new job (after a new block found) from Pool", + "legendFormat": "{{ name }}", "metric": "container_network_receive_bytes_total", "range": true, "refId": "A", "step": 10 + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "container_memory_usage_bytes{name=~\"sv1-node-pool-side\"}\n", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "{{ name }}", + "metric": "container_network_receive_bytes_total", + "range": true, + "refId": "B", + "step": 10 + } + ], + "title": "Pool apps (SV1) - Memory Usage", + "transformations": [ + { + "id": "calculateField", + "options": {} + } + ], + "type": "timeseries", + "description": "Memory usage in bytes for all SV1 pool-related applications and services." + }, + { + "collapsed": false, + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 203 + }, + "id": 19, + "panels": [], + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "refId": "A" } ], - "title": "SV1 - time to get a new job (after a new block found) from Pool", - "type": "timeseries" + "title": "SV2 apps performances (per container)", + "type": "row" }, { "datasource": { @@ -1599,7 +2184,6 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, - "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -1614,7 +2198,7 @@ "fill": "solid" }, "lineWidth": 1, - "pointSize": 1, + "pointSize": 3, "scaleDistribution": { "type": "linear" }, @@ -1635,8 +2219,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -1644,18 +2227,17 @@ } ] }, - "unit": "ms" + "unit": "percentunit" }, "overrides": [] }, "gridPos": { - "h": 7, - "w": 12, - "x": 12, - "y": 53 + "h": 10, + "w": 6, + "x": 0, + "y": 204 }, - "id": 92, - "interval": "15s", + "id": 45, "options": { "legend": { "calcs": [ @@ -1664,7 +2246,9 @@ ], "displayMode": "table", "placement": "bottom", - "showLegend": true + "showLegend": true, + "sortBy": "name", + "sortDesc": false }, "tooltip": { "maxHeight": 600, @@ -1680,19 +2264,38 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "new_job_prev_hash_throught_sv2_jdc", + "expr": "sum(rate(container_cpu_usage_seconds_total{name=~\"sv2-tp-pool-side|sv2-pool|sv2-jds|bitcoin-core-pool-side\"}[1m])) by (name)", "hide": false, "interval": "", "intervalFactor": 1, - "legendFormat": "SV2 - time to get a new job (after a new block found) from JDC", + "legendFormat": "{{ name }}", "metric": "container_network_receive_bytes_total", "range": true, "refId": "A", "step": 10 } ], - "title": "SV2 - time to get a new job (after a new block found) from JDC", - "type": "timeseries" + "title": "Pool apps (SV2) - CPU Usage ", + "transformations": [ + { + "id": "calculateField", + "options": {} + }, + { + "id": "sortBy", + "options": { + "fields": {}, + "sort": [ + { + "field": "name", + "desc": false + } + ] + } + } + ], + "type": "timeseries", + "description": "CPU usage percentage for all SV2 pool-related applications and services." }, { "datasource": { @@ -1711,7 +2314,6 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, - "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -1726,7 +2328,7 @@ "fill": "solid" }, "lineWidth": 1, - "pointSize": 1, + "pointSize": 3, "scaleDistribution": { "type": "linear" }, @@ -1747,8 +2349,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -1756,18 +2357,17 @@ } ] }, - "unit": "ms" + "unit": "bytes" }, "overrides": [] }, "gridPos": { - "h": 7, - "w": 12, - "x": 0, - "y": 60 + "h": 10, + "w": 6, + "x": 6, + "y": 204 }, - "id": 85, - "interval": "15s", + "id": 44, "options": { "legend": { "calcs": [ @@ -1776,7 +2376,9 @@ ], "displayMode": "table", "placement": "bottom", - "showLegend": true + "showLegend": true, + "sortBy": "name", + "sortDesc": false }, "tooltip": { "maxHeight": 600, @@ -1792,19 +2394,38 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "block_propagation_time_through_sv1_pool", + "expr": "container_memory_usage_bytes{name=~\"sv2-tp-pool-side|sv2-pool|sv2-jds|bitcoin-core-pool-side\"}", "hide": false, "interval": "", "intervalFactor": 1, - "legendFormat": "SV1 block propagation time", + "legendFormat": "{{ name }}", "metric": "container_network_receive_bytes_total", "range": true, "refId": "A", "step": 10 } ], - "title": "SV1 block propagation time", - "type": "timeseries" + "title": "Pool apps (SV2) - Memory Usage ", + "transformations": [ + { + "id": "calculateField", + "options": {} + }, + { + "id": "sortBy", + "options": { + "fields": {}, + "sort": [ + { + "field": "name", + "desc": false + } + ] + } + } + ], + "type": "timeseries", + "description": "Memory usage in bytes for all SV2 pool-related applications and services." }, { "datasource": { @@ -1823,7 +2444,6 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, - "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -1838,7 +2458,7 @@ "fill": "solid" }, "lineWidth": 1, - "pointSize": 1, + "pointSize": 3, "scaleDistribution": { "type": "linear" }, @@ -1859,8 +2479,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -1868,18 +2487,17 @@ } ] }, - "unit": "ms" + "unit": "percentunit" }, "overrides": [] }, "gridPos": { - "h": 7, - "w": 12, - "x": 12, - "y": 60 + "h": 10, + "w": 6, + "x": 0, + "y": 214 }, - "id": 86, - "interval": "15s", + "id": 46, "options": { "legend": { "calcs": [ @@ -1888,7 +2506,9 @@ ], "displayMode": "table", "placement": "bottom", - "showLegend": true + "showLegend": true, + "sortBy": "name", + "sortDesc": false }, "tooltip": { "maxHeight": 600, @@ -1904,19 +2524,38 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "block_propagation_time_through_sv2_jdc", + "expr": "sum(rate(container_cpu_usage_seconds_total{name=~\"sv2-tp-miner-side|sv2-jdc|sv2-translator|bitcoin-core-miner-side\"}[1m])) by (name)", "hide": false, "interval": "", "intervalFactor": 1, - "legendFormat": "SV2 block propagation time", + "legendFormat": "{{ name }}", "metric": "container_network_receive_bytes_total", "range": true, "refId": "A", "step": 10 } ], - "title": "SV2 block propagation time ", - "type": "timeseries" + "title": "Miner apps (SV2) - CPU Usage", + "transformations": [ + { + "id": "calculateField", + "options": {} + }, + { + "id": "sortBy", + "options": { + "fields": {}, + "sort": [ + { + "field": "name", + "desc": false + } + ] + } + } + ], + "type": "timeseries", + "description": "CPU usage percentage for SV2 miner-side applications and services." }, { "datasource": { @@ -1935,7 +2574,6 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, - "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -1950,7 +2588,7 @@ "fill": "solid" }, "lineWidth": 1, - "pointSize": 1, + "pointSize": 3, "scaleDistribution": { "type": "linear" }, @@ -1971,8 +2609,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -1980,18 +2617,17 @@ } ] }, - "unit": "ms" + "unit": "bytes" }, "overrides": [] }, "gridPos": { - "h": 9, - "w": 24, - "x": 0, - "y": 67 + "h": 10, + "w": 6, + "x": 6, + "y": 214 }, - "id": 93, - "interval": "15s", + "id": 47, "options": { "legend": { "calcs": [ @@ -2000,7 +2636,9 @@ ], "displayMode": "table", "placement": "bottom", - "showLegend": true + "showLegend": true, + "sortBy": "name", + "sortDesc": false }, "tooltip": { "maxHeight": 600, @@ -2016,15 +2654,29 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "sv1_new_job_latency", + "expr": "container_memory_usage_bytes{name=\"bitcoin-core-miner-side\"}", "hide": false, "interval": "", "intervalFactor": 1, - "legendFormat": "SV1 - time to get a new job from Pool", + "legendFormat": "{{ name }}", "metric": "container_network_receive_bytes_total", "range": true, - "refId": "A", - "step": 10 + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "container_memory_usage_bytes{name=\"sv2-jdc\"}", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "{{ name }}", + "metric": "container_network_receive_bytes_total", + "range": true, + "refId": "B" }, { "datasource": { @@ -2032,35 +2684,66 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "new_job_jdc_new_template", + "expr": "container_memory_usage_bytes{name=\"sv2-tp-miner-side\"}", "hide": false, "interval": "", "intervalFactor": 1, - "legendFormat": "SV2 - time to get a new job from JDC", + "legendFormat": "{{ name }}", "metric": "container_network_receive_bytes_total", "range": true, - "refId": "B", - "step": 10 + "refId": "C" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "container_memory_usage_bytes{name=\"sv2-translator\"}", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "{{ name }}", + "metric": "container_network_receive_bytes_total", + "range": true, + "refId": "D" } ], - "title": "SV1 vs SV2 - time to get a new job from Pool/JDC", + "title": "Miner apps (SV2) - Memory Usage", "transformations": [ { "id": "calculateField", - "options": { - "alias": "SV2 delta", - "mode": "reduceRow", - "reduce": { - "include": [ - "SV1 - time to get a new job from Pool", - "SV2 - time to get a new job from JDC" - ], - "reducer": "diff" - } - } + "options": {} + } + ], + "type": "timeseries", + "description": "Memory usage in bytes for SV2 miner-side applications and services." + }, + { + "collapsed": false, + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 224 + }, + "id": 17, + "panels": [], + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "refId": "A" } ], - "type": "timeseries" + "title": "Host Info", + "type": "row" }, { "datasource": { @@ -2070,46 +2753,19 @@ "fieldConfig": { "defaults": { "color": { - "mode": "palette-classic" + "mode": "thresholds" }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "left", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "opacity", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 1, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" } - }, - "fieldMinMax": false, - "links": [], - "mappings": [], + ], "thresholds": { "mode": "absolute", "steps": [ @@ -2122,87 +2778,51 @@ } ] }, - "unit": "ms" + "unit": "s" }, "overrides": [] }, "gridPos": { - "h": 9, - "w": 24, + "h": 7, + "w": 3, "x": 0, - "y": 76 + "y": 225 }, - "id": 94, - "interval": "15s", + "id": 15, + "maxDataPoints": 100, "options": { - "legend": { + "colorMode": "none", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "percentChangeColorMode": "standard", + "reduceOptions": { "calcs": [ - "mean", "lastNotNull" ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true + "fields": "", + "values": false }, - "tooltip": { - "maxHeight": 600, - "mode": "multi", - "sort": "none" - } + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true }, - "pluginVersion": "10.4.1", + "pluginVersion": "11.1.3", "targets": [ { "datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" }, - "editorMode": "code", - "expr": "sv1_new_job_prev_hash_latency", - "hide": false, - "interval": "", + "expr": "time() - process_start_time_seconds{job=\"prometheus\"}", + "format": "time_series", "intervalFactor": 1, - "legendFormat": "SV1 - time to get a new job (after a new block found) from Pool", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "A", - "step": 10 - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "new_job_prev_hash_throught_sv2_jdc", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "SV2 - time to get a new job (after a new block found) from JDC", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "B", - "step": 10 - } - ], - "title": "SV1 vs SV2 - time to get a new job (after a new block found) from Pool/JDC", - "transformations": [ - { - "id": "calculateField", - "options": { - "alias": "SV2 delta", - "mode": "reduceRow", - "reduce": { - "include": [ - "SV1 - time to get a new job (after a new block found) from Pool", - "SV2 - time to get a new job (after a new block found) from JDC" - ], - "reducer": "diff" - } - } + "refId": "A" } ], - "type": "timeseries" + "title": "Uptime", + "type": "stat", + "description": "System uptime showing how long the host system has been running continuously." }, { "datasource": { @@ -2212,46 +2832,19 @@ "fieldConfig": { "defaults": { "color": { - "mode": "palette-classic" + "mode": "thresholds" }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "left", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "opacity", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 1, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" } - }, - "fieldMinMax": false, - "links": [], - "mappings": [], + ], "thresholds": { "mode": "absolute", "steps": [ @@ -2264,35 +2857,36 @@ } ] }, - "unit": "ms" + "unit": "short" }, "overrides": [] }, "gridPos": { - "h": 9, - "w": 24, - "x": 0, - "y": 85 + "h": 7, + "w": 3, + "x": 3, + "y": 225 }, - "id": 95, - "interval": "15s", + "id": 35, + "maxDataPoints": 100, "options": { - "legend": { + "colorMode": "none", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "percentChangeColorMode": "standard", + "reduceOptions": { "calcs": [ - "mean", "lastNotNull" ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true + "fields": "", + "values": false }, - "tooltip": { - "maxHeight": 600, - "mode": "multi", - "sort": "none" - } + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true }, - "pluginVersion": "10.4.1", + "pluginVersion": "11.1.3", "targets": [ { "datasource": { @@ -2300,64 +2894,14 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "block_propagation_time_through_sv1_pool", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "SV1 - block propagation time", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "A", - "step": 10 - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "block_propagation_time_through_sv2_jdc", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "SV2 - block propagation time", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "B", - "step": 10 - } - ], - "title": "SV1 vs SV2 - block propagation time", - "transformations": [ - { - "id": "calculateField", - "options": { - "alias": "SV2 delta", - "mode": "reduceRow", - "reduce": { - "include": [ - "SV1 - block propagation time", - "SV2 - block propagation time" - ], - "reducer": "diff" - } - } + "expr": "count(count(node_cpu_seconds_total{mode=\"idle\"}) by (cpu))", + "instant": true, + "refId": "A" } ], - "type": "timeseries" - }, - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 94 - }, - "id": 56, - "panels": [], - "title": "Bandwidth Usage - Mining Farm Level", - "type": "row" + "title": "CPU Cores", + "type": "stat", + "description": "Number of CPU cores available on the host system." }, { "datasource": { @@ -2367,87 +2911,66 @@ "fieldConfig": { "defaults": { "color": { - "mode": "palette-classic" + "mode": "thresholds" }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "left", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "opacity", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 3, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" + "decimals": 2, + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" } - }, - "fieldMinMax": false, - "links": [], - "mappings": [], + ], + "max": 100, + "min": 0, "thresholds": { "mode": "absolute", "steps": [ { - "color": "green" + "color": "rgba(50, 172, 45, 0.97)" }, { - "color": "red", - "value": 80 + "color": "rgba(237, 129, 40, 0.89)", + "value": 65 + }, + { + "color": "rgba(245, 54, 54, 0.9)", + "value": 90 } ] }, - "unit": "binBps" + "unit": "percent" }, "overrides": [] }, "gridPos": { - "h": 10, - "w": 12, - "x": 0, - "y": 95 + "h": 7, + "w": 3, + "x": 6, + "y": 225 }, - "id": 65, - "interval": "15s", + "id": 6, + "maxDataPoints": 100, "options": { - "legend": { + "minVizHeight": 75, + "minVizWidth": 75, + "orientation": "horizontal", + "reduceOptions": { "calcs": [ - "mean", "lastNotNull" ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true + "fields": "", + "values": false }, - "tooltip": { - "maxHeight": 600, - "mode": "multi", - "sort": "none" - } + "showThresholdLabels": false, + "showThresholdMarkers": true, + "sizing": "auto" }, - "pluginVersion": "10.4.1", + "pluginVersion": "11.1.3", "targets": [ { "datasource": { @@ -2455,32 +2978,19 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "sum by (id, name) (rate(ntm_bytes_total{dst=\"10.5.0.8\", src=\"10.5.0.19\"}[20s]))", - "hide": false, - "interval": "", + "expr": "100 - (avg(irate(node_cpu_seconds_total{mode=\"idle\"}[5m])) * 100)", + "format": "time_series", + "interval": "1m", "intervalFactor": 1, - "legendFormat": "Mining Farm Network Interface", - "metric": "container_network_receive_bytes_total", + "legendFormat": "", "range": true, "refId": "A", "step": 10 } ], - "title": "SV1 - Network Tx (farm level)", - "transformations": [ - { - "id": "calculateField", - "options": { - "alias": "Total (farm level)", - "mode": "reduceRow", - "reduce": { - "reducer": "sum" - }, - "replaceFields": false - } - } - ], - "type": "timeseries" + "title": "CPU usage", + "type": "gauge", + "description": "Overall CPU usage percentage for the host system." }, { "datasource": { @@ -2490,46 +3000,19 @@ "fieldConfig": { "defaults": { "color": { - "mode": "palette-classic" + "mode": "thresholds" }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "left", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "opacity", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 3, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" } - }, - "fieldMinMax": false, - "links": [], - "mappings": [], + ], "thresholds": { "mode": "absolute", "steps": [ @@ -2542,35 +3025,36 @@ } ] }, - "unit": "binBps" + "unit": "decbytes" }, "overrides": [] }, "gridPos": { - "h": 10, - "w": 12, - "x": 12, - "y": 95 + "h": 7, + "w": 3, + "x": 9, + "y": 225 }, - "id": 60, - "interval": "15s", + "id": 37, + "maxDataPoints": 100, "options": { - "legend": { + "colorMode": "none", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "percentChangeColorMode": "standard", + "reduceOptions": { "calcs": [ - "mean", "lastNotNull" ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true + "fields": "", + "values": false }, - "tooltip": { - "maxHeight": 600, - "mode": "multi", - "sort": "none" - } + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true }, - "pluginVersion": "10.4.1", + "pluginVersion": "11.1.3", "targets": [ { "datasource": { @@ -2578,69 +3062,14 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "sum by (id, name) (rate(ntm_bytes_total{src=\"10.5.0.17\", dst=\"10.5.0.6\"}[20s]))", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "Translator", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "A", - "step": 10 - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sum by (id, name) (rate(ntm_bytes_total{src=\"10.5.0.6\", dst=\"10.5.0.5\"}[20s]))", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "Job Declarator Client (JDC)", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "B", - "step": 10 - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sum by (id, name) (rate(ntm_bytes_total{src=\"10.5.0.3\", dst!=\"10.5.0.20\", dst!=\"192.168.65.1\", dst!=\"10.5.0.6\"}[20s]))", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "Template Provider (TP)", - "metric": "container_network_receive_bytes_total", + "expr": "node_memory_MemTotal_bytes", "range": true, - "refId": "C", - "step": 10 - } - ], - "title": "SV2 - Network Tx (farm level)", - "transformations": [ - { - "id": "calculateField", - "options": { - "alias": "Total (farm level)", - "mode": "reduceRow", - "reduce": { - "include": [ - "Job Declarator Client (JDC)", - "Template Provider (TP)", - "Translator" - ], - "reducer": "sum" - }, - "replaceFields": false - } + "refId": "A" } ], - "type": "timeseries" + "title": "Host Memory", + "type": "stat", + "description": "Total memory capacity of the host system." }, { "datasource": { @@ -2650,119 +3079,82 @@ "fieldConfig": { "defaults": { "color": { - "mode": "palette-classic" + "mode": "thresholds" }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "left", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "opacity", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 3, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" } - }, - "fieldMinMax": false, - "links": [], - "mappings": [], + ], + "max": 100, + "min": 0, "thresholds": { "mode": "absolute", "steps": [ { - "color": "green" + "color": "rgba(50, 172, 45, 0.97)" }, { - "color": "red", - "value": 80 + "color": "rgba(237, 129, 40, 0.89)", + "value": 65 + }, + { + "color": "rgba(245, 54, 54, 0.9)", + "value": 90 } ] }, - "unit": "binBps" + "unit": "percent" }, "overrides": [] }, "gridPos": { - "h": 10, - "w": 12, - "x": 0, - "y": 105 + "h": 7, + "w": 3, + "x": 12, + "y": 225 }, - "id": 64, - "interval": "15s", + "id": 4, + "maxDataPoints": 100, "options": { - "legend": { + "minVizHeight": 75, + "minVizWidth": 75, + "orientation": "horizontal", + "reduceOptions": { "calcs": [ - "mean", "lastNotNull" ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true + "fields": "", + "values": false }, - "tooltip": { - "maxHeight": 600, - "mode": "multi", - "sort": "none" - } + "showThresholdLabels": false, + "showThresholdMarkers": true, + "sizing": "auto" }, - "pluginVersion": "10.4.1", + "pluginVersion": "11.1.3", "targets": [ { "datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" }, - "editorMode": "code", - "expr": "sum by (id, name) (rate(ntm_bytes_total{src=\"10.5.0.8\", dst=\"10.5.0.19\"}[20s]))", - "hide": false, - "interval": "", + "expr": "(sum(node_memory_MemTotal_bytes) - sum(node_memory_MemFree_bytes +node_memory_Buffers_bytes + node_memory_Cached_bytes) ) / sum(node_memory_MemTotal_bytes) * 100", + "format": "time_series", + "interval": "10s", "intervalFactor": 1, - "legendFormat": "Mining Farm Network Interface", - "metric": "container_network_receive_bytes_total", - "range": true, "refId": "A", "step": 10 } ], - "title": "SV1 - Network Rx (farm level)", - "transformations": [ - { - "id": "calculateField", - "options": { - "alias": "Total (farm level)", - "mode": "reduceRow", - "reduce": { - "reducer": "sum" - } - } - } - ], - "type": "timeseries" + "title": "Memory usage", + "type": "gauge", + "description": "Current memory usage on the host system." }, { "datasource": { @@ -2772,145 +3164,83 @@ "fieldConfig": { "defaults": { "color": { - "mode": "palette-classic" + "mode": "thresholds" }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "left", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "opacity", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 3, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" + "decimals": 2, + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" } - }, - "fieldMinMax": false, - "links": [], - "mappings": [], + ], + "max": 100, + "min": 0, "thresholds": { "mode": "absolute", "steps": [ { - "color": "green" + "color": "rgba(50, 172, 45, 0.97)" }, { - "color": "red", - "value": 80 + "color": "rgba(237, 129, 40, 0.89)", + "value": 65 + }, + { + "color": "rgba(245, 54, 54, 0.9)", + "value": 90 } ] }, - "unit": "binBps" + "unit": "percent" }, "overrides": [] }, "gridPos": { - "h": 10, - "w": 12, - "x": 12, - "y": 105 + "h": 7, + "w": 3, + "x": 15, + "y": 225 }, - "id": 59, - "interval": "15s", + "id": 7, + "maxDataPoints": 100, "options": { - "legend": { + "minVizHeight": 75, + "minVizWidth": 75, + "orientation": "horizontal", + "reduceOptions": { "calcs": [ - "mean", "lastNotNull" ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true + "fields": "", + "values": false }, - "tooltip": { - "maxHeight": 600, - "mode": "multi", - "sort": "none" - } + "showThresholdLabels": false, + "showThresholdMarkers": true, + "sizing": "auto" }, - "pluginVersion": "10.4.1", + "pluginVersion": "11.1.3", "targets": [ { "datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" }, - "editorMode": "code", - "expr": "sum by (id, name) (rate(ntm_bytes_total{dst=\"10.5.0.17\", src=\"10.5.0.6\"}[20s]))", - "hide": false, - "interval": "", + "expr": "avg( node_filesystem_avail_bytes {mountpoint=\"/\"} / node_filesystem_size_bytes{mountpoint=\"/\"})", + "interval": "10s", "intervalFactor": 1, - "legendFormat": "Translator", - "metric": "container_network_receive_bytes_total", - "range": true, + "metric": "", "refId": "A", "step": 10 - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sum by (id, name) (rate(ntm_bytes_total{dst=\"10.5.0.6\", src=\"10.5.0.5\"}[20s]))", - "hide": false, - "instant": false, - "legendFormat": "Job Declarator Client (JDC)", - "range": true, - "refId": "B" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sum by (id, name) (rate(ntm_bytes_total{dst=\"10.5.0.3\", src!=\"10.5.0.20\", src!=\"192.168.65.1\", src!=\"10.5.0.6\"}[20s]))", - "hide": false, - "instant": false, - "legendFormat": "Template Provider (TP)", - "range": true, - "refId": "C" - } - ], - "title": "SV2 - Network Rx (farm level)", - "transformations": [ - { - "id": "calculateField", - "options": { - "alias": "Total (farm level)", - "mode": "reduceRow", - "reduce": { - "reducer": "sum" - } - } } ], - "type": "timeseries" + "title": "Filesystem usage", + "type": "gauge", + "description": "Disk space usage for mounted filesystems on the host system." }, { "datasource": { @@ -2927,37 +3257,33 @@ "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", - "axisPlacement": "left", + "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "opacity", + "fillOpacity": 30, + "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, - "lineInterpolation": "smooth", - "lineStyle": { - "fill": "solid" - }, + "lineInterpolation": "linear", "lineWidth": 1, - "pointSize": 3, + "pointSize": 5, "scaleDistribution": { "type": "linear" }, - "showPoints": "auto", - "spanNulls": true, + "showPoints": "never", + "spanNulls": false, "stacking": { "group": "A", - "mode": "none" + "mode": "normal" }, "thresholdsStyle": { "mode": "off" } }, - "fieldMinMax": false, "links": [], "mappings": [], "thresholds": { @@ -2972,25 +3298,52 @@ } ] }, - "unit": "binBps" + "unit": "decbytes" }, - "overrides": [] + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Available Memory" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#508642", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Used Memory" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#bf1b00", + "mode": "fixed" + } + } + ] + } + ] }, "gridPos": { - "h": 10, - "w": 24, - "x": 0, - "y": 115 + "h": 7, + "w": 6, + "x": 18, + "y": 225 }, - "id": 69, - "interval": "15s", + "id": 27, "options": { "legend": { - "calcs": [ - "mean", - "lastNotNull" - ], - "displayMode": "table", + "calcs": [], + "displayMode": "list", "placement": "bottom", "showLegend": true }, @@ -3000,56 +3353,36 @@ "sort": "none" } }, - "pluginVersion": "10.4.1", + "pluginVersion": "10.3.3", "targets": [ { "datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" }, - "editorMode": "code", - "expr": "sum by (id, name) (rate(ntm_bytes_total{dst=\"10.5.0.8\", src=\"10.5.0.19\"}[20s]))", - "hide": false, - "instant": false, - "legendFormat": "SV1 (farm net interface)", - "range": true, - "refId": "A" + "expr": "sum(node_memory_MemTotal_bytes) - sum(node_memory_MemAvailable_bytes)", + "format": "time_series", + "interval": "2m", + "intervalFactor": 2, + "legendFormat": "Used Memory", + "refId": "B" }, { "datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" }, - "editorMode": "code", - "expr": "sum by (id, name) (rate(ntm_bytes_total{src=\"10.5.0.17\", dst=\"10.5.0.6\"}[20s])) + sum by (id, name) (rate(ntm_bytes_total{src=\"10.5.0.6\", dst=\"10.5.0.5\"}[20s])) + sum by (id, name) (rate(ntm_bytes_total{src=\"10.5.0.3\", dst!=\"10.5.0.20\", dst!=\"192.168.65.1\", dst!=\"10.5.0.6\"}[20s]))", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "SV2 (translator + jdc + tp)", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "B", - "step": 10 - } - ], - "title": "SV1 vs SV2 - Network Tx (farm level)", - "transformations": [ - { - "id": "calculateField", - "options": { - "alias": "SV2 delta", - "mode": "reduceRow", - "reduce": { - "include": [ - "SV1 (farm net interface)", - "SV2 (translator + jdc + tp)" - ], - "reducer": "diff" - } - } + "expr": "sum(node_memory_MemAvailable_bytes)", + "format": "time_series", + "interval": "2m", + "intervalFactor": 2, + "legendFormat": "Available Memory", + "refId": "A" } ], - "type": "timeseries" + "title": "Node Mermory", + "type": "timeseries", + "description": "Memory usage for Bitcoin node processes. Note: 'Mermory' is a typo in the original panel title." }, { "datasource": { @@ -3068,8 +3401,9 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", - "fillOpacity": 10, + "fillOpacity": 20, "gradientMode": "opacity", "hideFrom": { "legend": false, @@ -3082,11 +3416,11 @@ "fill": "solid" }, "lineWidth": 1, - "pointSize": 3, + "pointSize": 5, "scaleDistribution": { "type": "linear" }, - "showPoints": "auto", + "showPoints": "never", "spanNulls": true, "stacking": { "group": "A", @@ -3103,2956 +3437,324 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "red", + "value": null }, { - "color": "red", + "color": "yellow", "value": 80 + }, + { + "color": "green", + "value": 90 } ] }, - "unit": "binBps" + "unit": "percent" }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 24, - "x": 0, - "y": 125 - }, - "id": 70, - "interval": "15s", - "options": { - "legend": { - "calcs": [ - "mean", - "lastNotNull" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "maxHeight": 600, - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.4.1", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sum by (id, name) (rate(ntm_bytes_total{src=\"10.5.0.8\", dst=\"10.5.0.19\"}[20s]))", - "hide": false, - "instant": false, - "legendFormat": "SV1 (farm net interface)", - "range": true, - "refId": "A" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sum by (id, name) (rate(ntm_bytes_total{dst=\"10.5.0.17\", src=\"10.5.0.6\"}[20s])) + sum by (id, name) (rate(ntm_bytes_total{dst=\"10.5.0.6\", src=\"10.5.0.5\"}[20s])) + sum by (id, name) (rate(ntm_bytes_total{dst=\"10.5.0.3\", src!=\"10.5.0.20\", src!=\"192.168.65.1\", src!=\"10.5.0.6\"}[20s]))", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "SV2 (translator + jdc + tp)", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "B", - "step": 10 - } - ], - "title": "SV1 vs SV2 - Network Rx (farm level)", - "transformations": [ - { - "id": "calculateField", - "options": { - "alias": "SV2 delta", - "mode": "reduceRow", - "reduce": { - "include": [ - "SV1 (farm net interface)", - "SV2 (translator + jdc + tp)" - ], - "reducer": "diff" - } - } - } - ], - "type": "timeseries" - }, - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 135 - }, - "id": 55, - "panels": [], - "title": "Bandwidth Usage - Pool Level", - "type": "row" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "left", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "opacity", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 3, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "fieldMinMax": false, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "binBps" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 0, - "y": 136 - }, - "id": 63, - "interval": "15s", - "options": { - "legend": { - "calcs": [ - "mean", - "lastNotNull" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "maxHeight": 600, - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.4.1", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sum by (id, name) (rate(ntm_bytes_total{src=\"10.5.0.8\", dst=\"10.5.0.19\"}[20s]))", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "Pool", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "A", - "step": 10 - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sum by (id, name) (rate(ntm_bytes_total{src=\"10.5.0.16\", dst!=\"10.5.0.21\", dst!=\"192.168.65.1\", dst!=\"192.168.65.7\", dst!=\"10.5.0.8\"}[20s]))", - "hide": false, - "instant": false, - "legendFormat": "Bitcoin Node", - "range": true, - "refId": "B" - } - ], - "title": "SV1 - Network Tx (pool level)", - "transformations": [ - { - "id": "calculateField", - "options": { - "alias": "Total (pool level)", - "mode": "reduceRow", - "reduce": { - "reducer": "sum" - }, - "replaceFields": false - } - } - ], - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "left", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "opacity", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 3, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "fieldMinMax": false, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "binBps" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 12, - "y": 136 - }, - "id": 57, - "interval": "15s", - "options": { - "legend": { - "calcs": [ - "mean", - "lastNotNull" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "maxHeight": 600, - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.4.1", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sum by (id, name) (rate(ntm_bytes_total{src=\"10.5.0.4\", dst=\"10.5.0.6\"}[20s]))", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "Pool", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "A", - "step": 10 - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sum by (id, name) (rate(ntm_bytes_total{src=\"10.5.0.5\", dst=\"10.5.0.6\"}[20s]))", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "Job Declarator Server (JDS)", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "B", - "step": 10 - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sum by (id, name) (rate(ntm_bytes_total{src=\"10.5.0.2\", dst!=\"192.168.65.1\", dst!=\"192.168.65.7\", dst!=\"10.5.0.4\", dst!=\"10.5.0.5\"}[20s]))", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "Template Provider (TP)", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "C", - "step": 10 - } - ], - "title": "SV2 - Network Tx (pool level)", - "transformations": [ - { - "id": "calculateField", - "options": { - "alias": "Total (pool level)", - "mode": "reduceRow", - "reduce": { - "reducer": "sum" - } - } - } - ], - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "left", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "opacity", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 3, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "fieldMinMax": false, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "binBps" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 0, - "y": 146 - }, - "id": 66, - "interval": "15s", - "options": { - "legend": { - "calcs": [ - "mean", - "lastNotNull" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "maxHeight": 600, - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.4.1", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sum by (id, name) (rate(ntm_bytes_total{dst=\"10.5.0.8\", src=\"10.5.0.19\"}[20s]))", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "Pool", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "A", - "step": 10 - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sum by (id, name) (rate(ntm_bytes_total{dst=\"10.5.0.16\", src!=\"10.5.0.21\", src!=\"192.168.65.1\", src!=\"192.168.65.7\", src!=\"10.5.0.8\"}[20s]))", - "hide": false, - "instant": false, - "legendFormat": "Bitcoin Node", - "range": true, - "refId": "B" - } - ], - "title": "SV1 - Network Rx (pool level) ", - "transformations": [ - { - "id": "calculateField", - "options": { - "alias": "Total (pool level)", - "mode": "reduceRow", - "reduce": { - "reducer": "sum" - } - } - } - ], - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "left", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "opacity", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 3, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "fieldMinMax": false, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "binBps" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 12, - "y": 146 - }, - "id": 62, - "interval": "15s", - "options": { - "legend": { - "calcs": [ - "mean", - "lastNotNull" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "maxHeight": 600, - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.4.1", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sum by (id, name) (rate(ntm_bytes_total{dst=\"10.5.0.4\", src=\"10.5.0.6\"}[20s]))", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "Pool", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "A", - "step": 10 - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sum by (id, name) (rate(ntm_bytes_total{dst=\"10.5.0.5\", src=\"10.5.0.6\"}[20s]))", - "hide": false, - "instant": false, - "legendFormat": "Job Declarator Server (JDS)", - "range": true, - "refId": "B" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sum by (id, name) (rate(ntm_bytes_total{dst=\"10.5.0.2\", src!=\"192.168.65.1\", src!=\"192.168.65.7\", src!=\"10.5.0.4\", src!=\"10.5.0.5\"}[20s]))", - "hide": false, - "instant": false, - "legendFormat": "Template Provider (TP)", - "range": true, - "refId": "C" - } - ], - "title": "SV2 - Network Rx (pool level)", - "transformations": [ - { - "id": "calculateField", - "options": { - "alias": "Total (pool level)", - "mode": "reduceRow", - "reduce": { - "reducer": "sum" - } - } - } - ], - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "left", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "opacity", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 3, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "fieldMinMax": false, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "binBps" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 24, - "x": 0, - "y": 156 - }, - "id": 67, - "interval": "15s", - "options": { - "legend": { - "calcs": [ - "mean", - "lastNotNull" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "maxHeight": 600, - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.4.1", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sum by (id, name) (rate(ntm_bytes_total{src=\"10.5.0.8\", dst=\"10.5.0.19\"}[20s])) + sum by (id, name) (rate(ntm_bytes_total{src=\"10.5.0.16\", dst!=\"10.5.0.21\", dst!=\"192.168.65.1\", dst!=\"192.168.65.7\", dst!=\"10.5.0.8\"}[20s]))", - "hide": false, - "instant": false, - "legendFormat": "SV1 (pool + bitcoin node)", - "range": true, - "refId": "A" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sum by (id, name) (rate(ntm_bytes_total{src=\"10.5.0.4\", dst=\"10.5.0.6\"}[20s])) + sum by (id, name) (rate(ntm_bytes_total{src=\"10.5.0.5\", dst=\"10.5.0.6\"}[20s]))\n+ sum by (id, name) (rate(ntm_bytes_total{src=\"10.5.0.2\", dst!=\"192.168.65.1\", dst!=\"192.168.65.7\", dst!=\"10.5.0.4\", dst!=\"10.5.0.5\"}[20s]))", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "SV2 (pool + jds + tp)", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "B", - "step": 10 - } - ], - "title": "SV1 vs SV2 - Network Tx (pool level)", - "transformations": [ - { - "id": "calculateField", - "options": { - "alias": "SV2 delta", - "mode": "reduceRow", - "reduce": { - "include": [ - "SV1 (pool + bitcoin node)", - "SV2 (pool + jds + tp)" - ], - "reducer": "diff" - } - } - } - ], - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "left", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "opacity", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 3, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "fieldMinMax": false, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "binBps" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 24, - "x": 0, - "y": 166 - }, - "id": 68, - "interval": "15s", - "options": { - "legend": { - "calcs": [ - "mean", - "lastNotNull" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "maxHeight": 600, - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.4.1", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sum by (id, name) (rate(ntm_bytes_total{dst=\"10.5.0.8\", src=\"10.5.0.19\"}[20s])) + sum by (id, name) (rate(ntm_bytes_total{dst=\"10.5.0.16\", src!=\"10.5.0.21\", src!=\"192.168.65.1\", src!=\"192.168.65.7\", src!=\"10.5.0.8\"}[20s]))", - "hide": false, - "instant": false, - "legendFormat": "SV1 (pool + bitcoin node)", - "range": true, - "refId": "A" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sum by (id, name) (rate(ntm_bytes_total{dst=\"10.5.0.4\", src=\"10.5.0.6\"}[20s])) + sum by (id, name) (rate(ntm_bytes_total{dst=\"10.5.0.5\", src=\"10.5.0.6\"}[20s])) + sum by (id, name) (rate(ntm_bytes_total{dst=\"10.5.0.2\", src!=\"192.168.65.1\", src!=\"192.168.65.7\", src!=\"10.5.0.4\", src!=\"10.5.0.5\"}[20s]))", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "SV2 (pool + jds + tp)", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "B", - "step": 10 - } - ], - "title": "SV1 vs SV2 - Network Rx (pool level)", - "transformations": [ - { - "id": "calculateField", - "options": { - "alias": "SV2 delta", - "mode": "reduceRow", - "reduce": { - "include": [ - "SV1 (pool + bitcoin node)", - "SV2 (pool + jds + tp)" - ], - "reducer": "diff" - } - } - } - ], - "type": "timeseries" - }, - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 176 - }, - "id": 50, - "panels": [], - "title": "SV1 roles performances (per container)", - "type": "row" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "left", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "opacity", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 3, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "fieldMinMax": false, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "percentunit" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 6, - "x": 0, - "y": 177 - }, - "id": 51, - "options": { - "legend": { - "calcs": [ - "mean", - "lastNotNull" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "maxHeight": 600, - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.4.1", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sum(rate(container_cpu_usage_seconds_total{name=~\"sv1-pool\"}[1m])) by (id, name) \n", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "{{ name }}", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "A", - "step": 10 - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sum(rate(container_cpu_usage_seconds_total{name=~\"sv1-node-pool-side\"}[1m])) by (id, name) \n", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "{{ name }}", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "B", - "step": 10 - } - ], - "title": "Pool Roles (SV1) - CPU Usage ", - "transformations": [ - { - "id": "calculateField", - "options": {} - } - ], - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "left", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "opacity", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 3, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "fieldMinMax": false, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "bytes" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 6, - "x": 6, - "y": 177 - }, - "id": 52, - "options": { - "legend": { - "calcs": [ - "mean", - "lastNotNull" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "maxHeight": 600, - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.4.1", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "container_memory_usage_bytes{name=~\"sv1-pool\"}\n", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "{{ name }}", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "A", - "step": 10 - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "container_memory_usage_bytes{name=~\"sv1-node-pool-side\"}\n", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "{{ name }}", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "B", - "step": 10 - } - ], - "title": "Pool Roles (SV1) - Memory Usage", - "transformations": [ - { - "id": "calculateField", - "options": {} - } - ], - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "left", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "opacity", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 3, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "fieldMinMax": false, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "binBps" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 6, - "x": 12, - "y": 177 - }, - "id": 53, - "options": { - "legend": { - "calcs": [ - "mean", - "lastNotNull" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "maxHeight": 600, - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.4.1", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sum by (id, name) (irate(container_network_transmit_bytes_total{name=~\"sv1-pool\"}[5m]))\n", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "{{ name }}", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "A", - "step": 10 - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sum by (id, name) (irate(container_network_transmit_bytes_total{name=~\"sv1-node-pool-side\"}[5m]))\n", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "{{ name }}", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "B", - "step": 10 - } - ], - "title": "Pool Roles (SV1) - Network Tx", - "transformations": [ - { - "id": "calculateField", - "options": {} - } - ], - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "left", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "opacity", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 3, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "fieldMinMax": false, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "binBps" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 6, - "x": 18, - "y": 177 - }, - "id": 8, - "options": { - "legend": { - "calcs": [ - "mean", - "lastNotNull" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "maxHeight": 600, - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.4.1", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sum by (id, name) (irate(container_network_receive_bytes_total{name=~\"sv1-pool\"}[5m]))\n", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "{{ name }}", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "A", - "step": 10 - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sum by (id, name) (irate(container_network_receive_bytes_total{name=~\"sv1-node-pool-side\"}[5m]))\n", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "{{ name }}", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "B", - "step": 10 - } - ], - "title": "Pool Roles (SV1) - Network Rx ", - "transformations": [ - { - "id": "calculateField", - "options": {} - } - ], - "type": "timeseries" - }, - { - "collapsed": false, - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 187 - }, - "id": 19, - "panels": [], - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "refId": "A" - } - ], - "title": "SV2 roles performances (per container)", - "type": "row" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "left", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "opacity", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 3, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "fieldMinMax": false, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "percentunit" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 6, - "x": 0, - "y": 188 - }, - "id": 45, - "options": { - "legend": { - "calcs": [ - "mean", - "lastNotNull" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "maxHeight": 600, - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.4.1", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sum(rate(container_cpu_usage_seconds_total{name=~\"sv2-tp-pool-side|sv2-pool|sv2-jds\"}[1m])) by (id, name) \n", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "{{ name }}", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "A", - "step": 10 - } - ], - "title": "Pool Roles (SV2) - CPU Usage ", - "transformations": [ - { - "id": "calculateField", - "options": {} - } - ], - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "left", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "opacity", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 3, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "fieldMinMax": false, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "bytes" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 6, - "x": 6, - "y": 188 - }, - "id": 44, - "options": { - "legend": { - "calcs": [ - "mean", - "lastNotNull" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "maxHeight": 600, - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.4.1", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "container_memory_usage_bytes{name=~\"sv2-tp-pool-side|sv2-pool|sv2-jds\"}\n", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "{{ name }}", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "A", - "step": 10 - } - ], - "title": "Pool Roles (SV2) - Memory Usage ", - "transformations": [ - { - "id": "calculateField", - "options": {} - } - ], - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "left", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "opacity", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 3, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "fieldMinMax": false, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "binBps" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 6, - "x": 12, - "y": 188 - }, - "id": 43, - "options": { - "legend": { - "calcs": [ - "mean", - "lastNotNull" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "maxHeight": 600, - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.4.1", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sum by (id, name) (irate(container_network_transmit_bytes_total{name=~\"sv2-tp-pool-side|sv2-pool|sv2-jds\"}[10s]))\n", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "{{ name }}", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "A", - "step": 10 - } - ], - "title": "Pool Roles (SV2) - Network Tx ", - "transformations": [ - { - "id": "calculateField", - "options": {} - } - ], - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "left", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "opacity", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 3, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "fieldMinMax": false, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "binBps" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 6, - "x": 18, - "y": 188 - }, - "id": 58, - "options": { - "legend": { - "calcs": [ - "mean", - "lastNotNull" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "maxHeight": 600, - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.4.1", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sum by (id, name) (irate(container_network_receive_bytes_total{name=~\"sv2-tp-pool-side|sv2-pool|sv2-jds\"}[10s]))\n", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "{{ name }}", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "A", - "step": 10 - } - ], - "title": "Pool Roles (SV2) - Network Rx ", - "transformations": [ - { - "id": "calculateField", - "options": {} - } - ], - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "left", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "opacity", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 3, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "fieldMinMax": false, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "percentunit" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 6, - "x": 0, - "y": 198 - }, - "id": 46, - "options": { - "legend": { - "calcs": [ - "mean", - "lastNotNull" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "maxHeight": 600, - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.4.1", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sum(rate(container_cpu_usage_seconds_total{name=~\"sv2-tp-miner-side|sv2-jdc|sv2-translator\"}[1m])) by (id, name) \n", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "{{ name }}", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "A", - "step": 10 - } - ], - "title": "Miner Roles (SV2) - CPU Usage", - "transformations": [ - { - "id": "calculateField", - "options": {} - } - ], - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "left", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "opacity", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 3, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "fieldMinMax": false, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "bytes" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 6, - "x": 6, - "y": 198 - }, - "id": 47, - "options": { - "legend": { - "calcs": [ - "mean", - "lastNotNull" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "maxHeight": 600, - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.4.1", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "container_memory_usage_bytes{name=~\"sv2-tp-miner-side|sv2-jdc|sv2-translator\"}\n", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "{{ name }}", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "A", - "step": 10 - } - ], - "title": "Miner Roles (SV2) - Memory Usage", - "transformations": [ - { - "id": "calculateField", - "options": {} - } - ], - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "left", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "opacity", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 3, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "fieldMinMax": false, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "binBps" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 6, - "x": 12, - "y": 198 - }, - "id": 48, - "options": { - "legend": { - "calcs": [ - "mean", - "lastNotNull" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "maxHeight": 600, - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.4.1", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sum by (id, name) (irate(container_network_transmit_bytes_total{name=~\"sv2-tp-miner-side|sv2-jdc|sv2-translator\"}[10s]))\n", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "{{ name }}", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "A", - "step": 10 - } - ], - "title": "Miner Roles (SV2) - Network Tx", - "transformations": [ - { - "id": "calculateField", - "options": {} - } - ], - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "left", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "opacity", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 3, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "fieldMinMax": false, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "SV1 - Submitted shares" + }, + "properties": [ { - "color": "green" + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "orange" + } }, { - "color": "red", - "value": 80 - } - ] - }, - "unit": "binBps" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 6, - "x": 18, - "y": 198 - }, - "id": 49, - "options": { - "legend": { - "calcs": [ - "mean", - "lastNotNull" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "maxHeight": 600, - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.4.1", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sum by (id, name) (irate(container_network_receive_bytes_total{name=~\"sv2-tp-miner-side|sv2-jdc|sv2-translator\"}[10s]))\n", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "{{ name }}", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "A", - "step": 10 - } - ], - "title": "Miner Roles (SV2) - Network Rx", - "transformations": [ - { - "id": "calculateField", - "options": {} - } - ], - "type": "timeseries" - }, - { - "collapsed": false, - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 208 - }, - "id": 17, - "panels": [], - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "refId": "A" - } - ], - "title": "Host Info", - "type": "row" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [ - { - "options": { - "match": "null", - "result": { - "text": "N/A" - } + "id": "custom.axisPlacement", + "value": "right" }, - "type": "special" - } - ], - "thresholds": { - "mode": "absolute", - "steps": [ { - "color": "green" + "id": "custom.axisLabel", + "value": "Shares Count" }, { - "color": "red", - "value": 80 + "id": "unit", + "value": "short" } ] }, - "unit": "s" - }, - "overrides": [] - }, - "gridPos": { - "h": 7, - "w": 3, - "x": 0, - "y": 209 - }, - "id": 15, - "maxDataPoints": 100, - "options": { - "colorMode": "none", - "graphMode": "none", - "justifyMode": "auto", - "orientation": "horizontal", - "percentChangeColorMode": "standard", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showPercentChange": false, - "textMode": "auto", - "wideLayout": true - }, - "pluginVersion": "11.1.3", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "expr": "time() - process_start_time_seconds{job=\"prometheus\"}", - "format": "time_series", - "intervalFactor": 1, - "refId": "A" - } - ], - "title": "Uptime", - "type": "stat" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [ - { - "options": { - "match": "null", - "result": { - "text": "N/A" + { + "matcher": { + "id": "byName", + "options": "SV1 - Stale shares" + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "orange" } }, - "type": "special" - } - ], - "thresholds": { - "mode": "absolute", - "steps": [ { - "color": "green" + "id": "custom.axisPlacement", + "value": "right" }, { - "color": "red", - "value": 80 + "id": "custom.axisLabel", + "value": "Shares Count" + }, + { + "id": "unit", + "value": "short" } ] }, - "unit": "short" - }, - "overrides": [] - }, - "gridPos": { - "h": 7, - "w": 3, - "x": 3, - "y": 209 - }, - "id": 35, - "maxDataPoints": 100, - "options": { - "colorMode": "none", - "graphMode": "none", - "justifyMode": "auto", - "orientation": "horizontal", - "percentChangeColorMode": "standard", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showPercentChange": false, - "textMode": "auto", - "wideLayout": true - }, - "pluginVersion": "11.1.3", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "count(count(node_cpu_seconds_total{mode=\"idle\"}) by (cpu))", - "instant": true, - "refId": "A" - } - ], - "title": "CPU Cores", - "type": "stat" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "decimals": 2, - "mappings": [ - { - "options": { - "match": "null", - "result": { - "text": "N/A" + { + "matcher": { + "id": "byName", + "options": "SV1 - Acceptance rate %" + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "red" } }, - "type": "special" - } - ], - "max": 100, - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ { - "color": "rgba(50, 172, 45, 0.97)" + "id": "custom.axisPlacement", + "value": "left" }, { - "color": "rgba(237, 129, 40, 0.89)", - "value": 65 + "id": "custom.axisLabel", + "value": "Acceptance Rate (%)" }, { - "color": "rgba(245, 54, 54, 0.9)", - "value": 90 + "id": "unit", + "value": "percent" } ] }, - "unit": "percent" - }, - "overrides": [] - }, - "gridPos": { - "h": 7, - "w": 3, - "x": 6, - "y": 209 - }, - "id": 6, - "maxDataPoints": 100, - "options": { - "minVizHeight": 75, - "minVizWidth": 75, - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showThresholdLabels": false, - "showThresholdMarkers": true, - "sizing": "auto" - }, - "pluginVersion": "11.1.3", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "100 - (avg(irate(node_cpu_seconds_total{mode=\"idle\"}[5m])) * 100)", - "format": "time_series", - "interval": "1m", - "intervalFactor": 1, - "legendFormat": "", - "range": true, - "refId": "A", - "step": 10 - } - ], - "title": "CPU usage", - "type": "gauge" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [ - { - "options": { - "match": "null", - "result": { - "text": "N/A" + { + "matcher": { + "id": "byName", + "options": "SV2 - Submitted shares" + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "cyan" } }, - "type": "special" - } - ], - "thresholds": { - "mode": "absolute", - "steps": [ { - "color": "green" + "id": "custom.axisPlacement", + "value": "right" }, { - "color": "red", - "value": 80 + "id": "custom.axisLabel", + "value": "Shares Count" + }, + { + "id": "unit", + "value": "short" } ] }, - "unit": "decbytes" - }, - "overrides": [] - }, - "gridPos": { - "h": 7, - "w": 3, - "x": 9, - "y": 209 - }, - "id": 37, - "maxDataPoints": 100, - "options": { - "colorMode": "none", - "graphMode": "none", - "justifyMode": "auto", - "orientation": "horizontal", - "percentChangeColorMode": "standard", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showPercentChange": false, - "textMode": "auto", - "wideLayout": true - }, - "pluginVersion": "11.1.3", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "node_memory_MemTotal_bytes", - "range": true, - "refId": "A" - } - ], - "title": "Host Memory", - "type": "stat" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [ - { - "options": { - "match": "null", - "result": { - "text": "N/A" + { + "matcher": { + "id": "byName", + "options": "SV2 - Stale shares" + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "cyan" } }, - "type": "special" - } - ], - "max": 100, - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ { - "color": "rgba(50, 172, 45, 0.97)" + "id": "custom.axisPlacement", + "value": "right" }, { - "color": "rgba(237, 129, 40, 0.89)", - "value": 65 + "id": "custom.axisLabel", + "value": "Shares Count" }, { - "color": "rgba(245, 54, 54, 0.9)", - "value": 90 + "id": "unit", + "value": "short" } ] }, - "unit": "percent" - }, - "overrides": [] - }, - "gridPos": { - "h": 7, - "w": 3, - "x": 12, - "y": 209 - }, - "id": 4, - "maxDataPoints": 100, - "options": { - "minVizHeight": 75, - "minVizWidth": 75, - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showThresholdLabels": false, - "showThresholdMarkers": true, - "sizing": "auto" - }, - "pluginVersion": "11.1.3", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "expr": "(sum(node_memory_MemTotal_bytes) - sum(node_memory_MemFree_bytes +node_memory_Buffers_bytes + node_memory_Cached_bytes) ) / sum(node_memory_MemTotal_bytes) * 100", - "format": "time_series", - "interval": "10s", - "intervalFactor": 1, - "refId": "A", - "step": 10 - } - ], - "title": "Memory usage", - "type": "gauge" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "decimals": 2, - "mappings": [ - { - "options": { - "match": "null", - "result": { - "text": "N/A" - } - }, - "type": "special" - } - ], - "max": 100, - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ + { + "matcher": { + "id": "byName", + "options": "SV2 - Acceptance rate %" + }, + "properties": [ { - "color": "rgba(50, 172, 45, 0.97)" + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "blue" + } }, { - "color": "rgba(237, 129, 40, 0.89)", - "value": 65 + "id": "custom.axisPlacement", + "value": "left" }, { - "color": "rgba(245, 54, 54, 0.9)", - "value": 90 + "id": "custom.axisLabel", + "value": "Acceptance Rate (%)" + }, + { + "id": "unit", + "value": "percent" } ] - }, - "unit": "percent" - }, - "overrides": [] + } + ] }, "gridPos": { - "h": 7, - "w": 3, - "x": 15, - "y": 209 + "h": 10, + "w": 24, + "x": 0, + "y": 11 }, - "id": 7, - "maxDataPoints": 100, + "id": 98, + "interval": "15s", "options": { - "minVizHeight": 75, - "minVizWidth": 75, - "orientation": "horizontal", - "reduceOptions": { + "legend": { "calcs": [ "lastNotNull" ], - "fields": "", - "values": false + "displayMode": "table", + "placement": "bottom", + "showLegend": true }, - "showThresholdLabels": false, - "showThresholdMarkers": true, - "sizing": "auto" + "tooltip": { + "maxHeight": 600, + "mode": "multi", + "sort": "desc" + } }, - "pluginVersion": "11.1.3", + "pluginVersion": "10.4.1", "targets": [ { "datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" }, - "expr": "avg( node_filesystem_avail_bytes {mountpoint=\"/\"} / node_filesystem_size_bytes{mountpoint=\"/\"})", - "interval": "10s", + "editorMode": "code", + "expr": "sv1_submitted_shares", + "hide": false, + "interval": "", "intervalFactor": 1, - "metric": "", + "legendFormat": "SV1 - Submitted shares", + "metric": "container_network_receive_bytes_total", + "range": true, "refId": "A", "step": 10 + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "sv1_stale_shares", + "hide": true, + "interval": "", + "intervalFactor": 1, + "legendFormat": "SV1 - Stale shares", + "metric": "container_network_receive_bytes_total", + "range": true, + "refId": "C", + "step": 10 + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "disableTextWrap": false, + "editorMode": "code", + "exemplar": false, + "expr": "((sv1_submitted_shares - sv1_stale_shares) * 100) / sv1_submitted_shares", + "fullMetaSearch": false, + "hide": false, + "includeNullMetadata": true, + "instant": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "SV1 - Acceptance rate %", + "metric": "container_network_receive_bytes_total", + "range": true, + "refId": "D", + "step": 10, + "useBackend": false + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "sv2_submitted_shares", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "SV2 - Submitted shares", + "metric": "container_network_receive_bytes_total", + "range": true, + "refId": "E", + "step": 10 + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "sv2_stale_shares", + "hide": true, + "interval": "", + "intervalFactor": 1, + "legendFormat": "SV2 - Stale shares", + "metric": "container_network_receive_bytes_total", + "range": true, + "refId": "G", + "step": 10 + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "disableTextWrap": false, + "editorMode": "code", + "exemplar": false, + "expr": "((sv2_submitted_shares - sv2_stale_shares) * 100) / sv2_submitted_shares", + "fullMetaSearch": false, + "hide": false, + "includeNullMetadata": true, + "instant": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "SV2 - Acceptance rate %", + "metric": "container_network_receive_bytes_total", + "range": true, + "refId": "H", + "step": 10, + "useBackend": false } ], - "title": "Filesystem usage", - "type": "gauge" + "title": "SV1 vs SV2 - shares", + "transformations": [], + "type": "timeseries", + "description": "Submitted shares and acceptance rate for both SV1 and SV2 protocols. Submitted shares are shown on the right Y-axis, acceptance rate on the left Y-axis." }, { "datasource": { @@ -6062,83 +3764,47 @@ "fieldConfig": { "defaults": { "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 30, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "normal" - }, - "thresholdsStyle": { - "mode": "off" - } + "mode": "thresholds" }, - "links": [], "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { - "color": "green" - }, - { - "color": "red", - "value": 80 + "color": "green", + "value": null } ] }, - "unit": "decbytes" + "unit": "short" }, "overrides": [ { "matcher": { - "id": "byName", - "options": "Available Memory" + "id": "byRegexp", + "options": ".*SV1.*" }, "properties": [ { "id": "color", "value": { - "fixedColor": "#508642", - "mode": "fixed" + "mode": "fixed", + "fixedColor": "red" } } ] }, { "matcher": { - "id": "byName", - "options": "Used Memory" + "id": "byRegexp", + "options": ".*SV2.*" }, "properties": [ { "id": "color", "value": { - "fixedColor": "#bf1b00", - "mode": "fixed" + "mode": "fixed", + "fixedColor": "blue" } } ] @@ -6146,54 +3812,71 @@ ] }, "gridPos": { - "h": 7, - "w": 6, - "x": 18, - "y": 209 + "h": 6, + "w": 12, + "x": 0, + "y": 1 }, - "id": 27, + "id": 99, + "interval": "15s", "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true + "colorMode": "value", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false }, - "tooltip": { - "maxHeight": 600, - "mode": "multi", - "sort": "none" - } + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true }, - "pluginVersion": "10.3.3", + "pluginVersion": "10.4.1", "targets": [ { "datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" }, - "expr": "sum(node_memory_MemTotal_bytes) - sum(node_memory_MemAvailable_bytes)", - "format": "time_series", - "interval": "2m", - "intervalFactor": 2, - "legendFormat": "Used Memory", - "refId": "B" + "editorMode": "code", + "expr": "sv1_mined_blocks", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "SV1 - mined blocks", + "metric": "container_network_receive_bytes_total", + "range": false, + "refId": "A", + "step": 10, + "instant": true }, { "datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" }, - "expr": "sum(node_memory_MemAvailable_bytes)", - "format": "time_series", - "interval": "2m", - "intervalFactor": 2, - "legendFormat": "Available Memory", - "refId": "A" + "editorMode": "code", + "expr": "sv2_mined_blocks", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "SV2 - mined blocks", + "metric": "container_network_receive_bytes_total", + "range": false, + "refId": "B", + "step": 10, + "instant": true } ], - "title": "Node Mermory", - "type": "timeseries" + "title": "SV1 vs SV2 - mined blocks", + "transformations": [], + "type": "stat", + "description": "Number of blocks successfully mined by SV1 and SV2 protocols over time." } ], "refresh": "5s", diff --git a/grafana/provisioning/dashboards/config-c/Docker Prometheus Monitoring-1571332751387.json b/grafana/provisioning/dashboards/config-c/Docker Prometheus Monitoring-1571332751387.json index 2abab52..8bf927f 100644 --- a/grafana/provisioning/dashboards/config-c/Docker Prometheus Monitoring-1571332751387.json +++ b/grafana/provisioning/dashboards/config-c/Docker Prometheus Monitoring-1571332751387.json @@ -37,13 +37,13 @@ "asDropdown": false, "icon": "external link", "includeVars": false, - "keepTime": false, + "keepTime": true, "tags": [], "targetBlank": false, "title": "Download logs", - "tooltip": "", + "tooltip": "Download logs for the selected time range", "type": "link", - "url": "http://localhost:7420" + "url": "http://localhost:7420?from=${__from}&to=${__to}" } ], "liveNow": false, @@ -80,7 +80,7 @@ "barAlignment": 0, "barWidthFactor": 0.6, "drawStyle": "line", - "fillOpacity": 10, + "fillOpacity": 20, "gradientMode": "opacity", "hideFrom": { "legend": false, @@ -93,11 +93,11 @@ "fill": "solid" }, "lineWidth": 1, - "pointSize": 1, + "pointSize": 5, "scaleDistribution": { "type": "linear" }, - "showPoints": "auto", + "showPoints": "never", "spanNulls": true, "stacking": { "group": "A", @@ -114,23 +114,178 @@ "mode": "absolute", "steps": [ { - "color": "green", + "color": "red", "value": null }, { - "color": "red", + "color": "yellow", "value": 80 + }, + { + "color": "green", + "value": 90 } ] - } + }, + "unit": "percent" }, "overrides": [ { "matcher": { "id": "byName", - "options": "Acceptance rate %" + "options": "SV1 - Submitted shares" + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "orange" + } + }, + { + "id": "custom.axisPlacement", + "value": "right" + }, + { + "id": "custom.axisLabel", + "value": "Shares Count" + }, + { + "id": "unit", + "value": "short" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "SV1 - Stale shares" + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "orange" + } + }, + { + "id": "custom.axisPlacement", + "value": "right" + }, + { + "id": "custom.axisLabel", + "value": "Shares Count" + }, + { + "id": "unit", + "value": "short" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "SV1 - Acceptance rate %" + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "red" + } + }, + { + "id": "custom.axisPlacement", + "value": "left" + }, + { + "id": "custom.axisLabel", + "value": "Acceptance Rate (%)" + }, + { + "id": "unit", + "value": "percent" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "SV2 - Submitted shares" + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "cyan" + } + }, + { + "id": "custom.axisPlacement", + "value": "right" + }, + { + "id": "custom.axisLabel", + "value": "Shares Count" + }, + { + "id": "unit", + "value": "short" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "SV2 - Stale shares" + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "cyan" + } + }, + { + "id": "custom.axisPlacement", + "value": "right" + }, + { + "id": "custom.axisLabel", + "value": "Shares Count" + }, + { + "id": "unit", + "value": "short" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "SV2 - Acceptance rate %" }, "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "blue" + } + }, + { + "id": "custom.axisPlacement", + "value": "left" + }, + { + "id": "custom.axisLabel", + "value": "Acceptance Rate (%)" + }, { "id": "unit", "value": "percent" @@ -141,11 +296,12 @@ }, "gridPos": { "h": 10, - "w": 9, + "w": 24, "x": 0, - "y": 1 + "y": 11 }, - "id": 77, + "id": 98, + "interval": "15s", "options": { "legend": { "calcs": [ @@ -158,7 +314,7 @@ "tooltip": { "maxHeight": 600, "mode": "multi", - "sort": "none" + "sort": "desc" } }, "pluginVersion": "10.4.1", @@ -173,7 +329,7 @@ "hide": false, "interval": "", "intervalFactor": 1, - "legendFormat": "Submitted shares", + "legendFormat": "SV1 - Submitted shares", "metric": "container_network_receive_bytes_total", "range": true, "refId": "A", @@ -185,14 +341,14 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "sv1_valid_shares", - "hide": false, + "expr": "sv1_stale_shares", + "hide": true, "interval": "", "intervalFactor": 1, - "legendFormat": "Valid shares", + "legendFormat": "SV1 - Stale shares", "metric": "container_network_receive_bytes_total", "range": true, - "refId": "B", + "refId": "C", "step": 10 }, { @@ -200,15 +356,53 @@ "type": "prometheus", "uid": "PBFA97CFB590B2093" }, + "disableTextWrap": false, "editorMode": "code", - "expr": "sv1_stale_shares", + "exemplar": false, + "expr": "((sv1_submitted_shares - sv1_stale_shares) * 100) / sv1_submitted_shares", + "fullMetaSearch": false, "hide": false, + "includeNullMetadata": true, + "instant": false, "interval": "", "intervalFactor": 1, - "legendFormat": "Stale shares", + "legendFormat": "SV1 - Acceptance rate %", "metric": "container_network_receive_bytes_total", "range": true, - "refId": "C", + "refId": "D", + "step": 10, + "useBackend": false + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "sv2_submitted_shares", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "SV2 - Submitted shares", + "metric": "container_network_receive_bytes_total", + "range": true, + "refId": "E", + "step": 10 + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "sv2_stale_shares", + "hide": true, + "interval": "", + "intervalFactor": 1, + "legendFormat": "SV2 - Stale shares", + "metric": "container_network_receive_bytes_total", + "range": true, + "refId": "G", "step": 10 }, { @@ -219,23 +413,25 @@ "disableTextWrap": false, "editorMode": "code", "exemplar": false, - "expr": "(sv1_valid_shares * 100) / sv1_submitted_shares", + "expr": "((sv2_submitted_shares - sv2_stale_shares) * 100) / sv2_submitted_shares", "fullMetaSearch": false, "hide": false, "includeNullMetadata": true, "instant": false, "interval": "", "intervalFactor": 1, - "legendFormat": "Acceptance rate %", + "legendFormat": "SV2 - Acceptance rate %", "metric": "container_network_receive_bytes_total", "range": true, - "refId": "D", + "refId": "H", "step": 10, "useBackend": false } ], - "title": "SV1 shares", - "type": "timeseries" + "title": "SV1 vs SV2 - shares", + "transformations": [], + "type": "timeseries", + "description": "Submitted shares and acceptance rate for both SV1 and SV2 protocols. Submitted shares are shown on the right Y-axis, acceptance rate on the left Y-axis." }, { "datasource": { @@ -247,8 +443,6 @@ "color": { "mode": "thresholds" }, - "fieldMinMax": false, - "links": [], "mappings": [], "thresholds": { "mode": "absolute", @@ -258,20 +452,53 @@ "value": null } ] - } + }, + "unit": "short" }, - "overrides": [] + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": ".*SV1.*" + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "red" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": ".*SV2.*" + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "blue" + } + } + ] + } + ] }, "gridPos": { - "h": 10, - "w": 3, - "x": 9, + "h": 6, + "w": 12, + "x": 0, "y": 1 }, - "id": 81, + "id": 99, + "interval": "15s", "options": { "colorMode": "value", - "graphMode": "area", + "graphMode": "none", "justifyMode": "auto", "orientation": "auto", "percentChangeColorMode": "standard", @@ -283,13 +510,10 @@ "values": false }, "showPercentChange": false, - "text": { - "valueSize": 50 - }, "textMode": "auto", "wideLayout": true }, - "pluginVersion": "11.2.0", + "pluginVersion": "10.4.1", "targets": [ { "datasource": { @@ -301,15 +525,35 @@ "hide": false, "interval": "", "intervalFactor": 1, - "legendFormat": "SV1 mined blocks", + "legendFormat": "SV1 - mined blocks", "metric": "container_network_receive_bytes_total", - "range": true, + "range": false, "refId": "A", - "step": 10 + "step": 10, + "instant": true + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "sv2_mined_blocks", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "SV2 - mined blocks", + "metric": "container_network_receive_bytes_total", + "range": false, + "refId": "B", + "step": 10, + "instant": true } ], - "title": "SV1 mined blocks", - "type": "stat" + "title": "SV1 vs SV2 - mined blocks", + "transformations": [], + "type": "stat", + "description": "Number of blocks successfully mined by SV1 and SV2 protocols over time." }, { "datasource": { @@ -372,33 +616,54 @@ "value": 80 } ] - } + }, + "unit": "sats" }, "overrides": [ { "matcher": { - "id": "byName", - "options": "Acceptance rate %" + "id": "byRegexp", + "options": ".*SV1.*" }, "properties": [ { - "id": "unit", - "value": "percent" + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "red" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": ".*SV2.*" + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "blue" + } } ] } ] }, "gridPos": { - "h": 10, - "w": 9, - "x": 12, - "y": 1 + "h": 9, + "w": 24, + "x": 0, + "y": 19 }, - "id": 80, + "id": 94, + "interval": "15s", "options": { "legend": { "calcs": [ + "mean", "lastNotNull" ], "displayMode": "table", @@ -419,11 +684,11 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "sv2_submitted_shares", + "expr": "sv1_block_template_value", "hide": false, "interval": "", "intervalFactor": 1, - "legendFormat": "Submitted shares", + "legendFormat": "SV1 - block template value", "metric": "container_network_receive_bytes_total", "range": true, "refId": "A", @@ -435,131 +700,34 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "sv2_valid_shares", + "expr": "sv2_block_template_value", "hide": false, "interval": "", "intervalFactor": 1, - "legendFormat": "Valid shares", + "legendFormat": "SV2 - block template value", "metric": "container_network_receive_bytes_total", "range": true, "refId": "B", "step": 10 - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sv2_stale_shares", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "Stale shares", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "C", - "step": 10 - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "disableTextWrap": false, - "editorMode": "code", - "exemplar": false, - "expr": "(sv2_valid_shares * 100) / sv2_submitted_shares", - "fullMetaSearch": false, - "hide": false, - "includeNullMetadata": true, - "instant": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "Acceptance rate %", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "D", - "step": 10, - "useBackend": false } ], - "title": "SV2 shares", - "type": "timeseries" + "title": "SV1 vs SV2 - block template value", + "transformations": [], + "type": "timeseries", + "description": "Block template value in satoshis for SV1 and SV2 protocols. Higher values indicate more valuable block templates." }, { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "fieldMinMax": false, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - } - ] - } - }, - "overrides": [] - }, + "collapsed": false, "gridPos": { - "h": 10, - "w": 3, - "x": 21, - "y": 1 - }, - "id": 82, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "percentChangeColorMode": "standard", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showPercentChange": false, - "text": { - "valueSize": 50 - }, - "textMode": "auto", - "wideLayout": true + "h": 1, + "w": 24, + "x": 0, + "y": 37 }, - "pluginVersion": "11.2.0", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sv2_mined_blocks", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "SV2 mined blocks", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "A", - "step": 10 - } - ], - "title": "SV2 mined blocks", - "type": "stat" + "id": 71, + "panels": [], + "title": "Latency and time measurements", + "type": "row" }, { "datasource": { @@ -623,21 +791,21 @@ } ] }, - "unit": "sats" + "unit": "ms" }, "overrides": [] }, "gridPos": { - "h": 8, - "w": 12, + "h": 7, + "w": 24, "x": 0, - "y": 11 + "y": 38 }, - "id": 75, - "interval": "15s", + "id": 92, "options": { "legend": { "calcs": [ + "mean", "lastNotNull" ], "displayMode": "table", @@ -658,19 +826,20 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "sv1_block_template_value", + "expr": "average_pool_subscription_latency_milliseconds", "hide": false, "interval": "", "intervalFactor": 1, - "legendFormat": "SV1 - block template value", + "legendFormat": "Average latency with major pools (RTT)", "metric": "container_network_receive_bytes_total", "range": true, "refId": "A", "step": 10 } ], - "title": "SV1 - block templates value", - "type": "timeseries" + "title": "Average latency with major pools (RTT)", + "type": "timeseries", + "description": "Round-trip time (RTT) latency measurements to major Bitcoin mining pools. Lower values indicate better network connectivity." }, { "datasource": { @@ -734,21 +903,53 @@ } ] }, - "unit": "sats" + "unit": "ms" }, - "overrides": [] + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": ".*SV1.*" + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "red" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": ".*SV2.*" + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "blue" + } + } + ] + } + ] }, "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 11 + "h": 9, + "w": 24, + "x": 0, + "y": 46 }, "id": 93, "interval": "15s", "options": { "legend": { "calcs": [ + "mean", "lastNotNull" ], "displayMode": "table", @@ -769,19 +970,37 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "sv2_block_template_value", + "expr": "sv1_new_job_latency", "hide": false, "interval": "", "intervalFactor": 1, - "legendFormat": "SV2 - block template value", + "legendFormat": "SV1 - time to get a new job from Pool", "metric": "container_network_receive_bytes_total", "range": true, "refId": "A", "step": 10 + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "new_job_pool_new_template", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "SV2 - time to get a new job from Pool", + "metric": "container_network_receive_bytes_total", + "range": true, + "refId": "B", + "step": 10 } ], - "title": "SV2 - block templates value", - "type": "timeseries" + "title": "SV1 vs SV2 - time to get a new job from Pool", + "transformations": [], + "type": "timeseries", + "description": "Time taken to receive a new mining job from the pool for both SV1 and SV2 protocols. Measured in milliseconds." }, { "datasource": { @@ -800,7 +1019,6 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, - "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -836,8 +1054,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -845,17 +1062,48 @@ } ] }, - "unit": "sats" + "unit": "ms" }, - "overrides": [] + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": ".*SV1.*" + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "red" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": ".*SV2.*" + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "blue" + } + } + ] + } + ] }, "gridPos": { "h": 9, "w": 24, "x": 0, - "y": 19 + "y": 55 }, - "id": 94, + "id": 97, "interval": "15s", "options": { "legend": { @@ -881,11 +1129,11 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "sv1_block_template_value", + "expr": "sv1_new_job_prev_hash_latency", "hide": false, "interval": "", "intervalFactor": 1, - "legendFormat": "SV1 - block template value", + "legendFormat": "SV1 - time to get a new job (after a new block found) from Pool", "metric": "container_network_receive_bytes_total", "range": true, "refId": "A", @@ -897,39 +1145,24 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "sv2_block_template_value", + "expr": "new_job_prev_hash_through_sv2_pool", "hide": false, "interval": "", "intervalFactor": 1, - "legendFormat": "SV2 - block template value", + "legendFormat": "SV2 - time to get a new job (after a new block found) from Pool", "metric": "container_network_receive_bytes_total", "range": true, "refId": "B", "step": 10 } ], - "title": "SV1 vs SV2 - block template value", - "transformations": [ - { - "id": "calculateField", - "options": { - "alias": "SV2 delta", - "mode": "reduceRow", - "reduce": { - "include": [ - "SV1 - block template value", - "SV2 - block template value" - ], - "reducer": "diff" - } - } - } - ], - "type": "timeseries" + "title": "SV1 vs SV2 - time to get a new job (after a new block found) from Pool", + "transformations": [], + "type": "timeseries", + "description": "Time taken to receive a new job after a block is found on the network for both SV1 and SV2 protocols." }, { "datasource": { - "default": true, "type": "prometheus", "uid": "PBFA97CFB590B2093" }, @@ -945,7 +1178,6 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, - "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -981,8 +1213,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -990,18 +1221,36 @@ } ] }, - "unit": "sats" + "unit": "ms" }, "overrides": [ { "matcher": { - "id": "byName", - "options": "SV2 delta %" + "id": "byRegexp", + "options": ".*SV1.*" }, "properties": [ { - "id": "unit", - "value": "percent" + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "red" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": ".*SV2.*" + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "blue" + } } ] } @@ -1011,7 +1260,7 @@ "h": 9, "w": 24, "x": 0, - "y": 28 + "y": 64 }, "id": 95, "interval": "15s", @@ -1039,11 +1288,11 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "last_block_mined_value", + "expr": "block_propagation_time_through_sv1_pool", "hide": false, "interval": "", "intervalFactor": 1, - "legendFormat": "Network - block template value", + "legendFormat": "SV1 - block propagation time", "metric": "container_network_receive_bytes_total", "range": true, "refId": "A", @@ -1055,3065 +1304,34 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "last_sv2_template_value ", + "expr": "block_propagation_time_through_sv2_pool", "hide": false, "interval": "", "intervalFactor": 1, - "legendFormat": "SV2 - block template value", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "B", - "step": 10 - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "(last_sv2_template_value - last_block_mined_value) / last_block_mined_value * 100", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "SV2 delta %", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "C", - "step": 10 - } - ], - "title": "SV2 - block template value - comparison with mined blocks on the network", - "type": "timeseries" - }, - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 37 - }, - "id": 71, - "panels": [], - "title": "Latency and time measurements", - "type": "row" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "left", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "opacity", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 1, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "fieldMinMax": false, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "ms" - }, - "overrides": [] - }, - "gridPos": { - "h": 7, - "w": 24, - "x": 0, - "y": 38 - }, - "id": 92, - "options": { - "legend": { - "calcs": [ - "mean", - "lastNotNull" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "maxHeight": 600, - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.4.1", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "average_pool_subscription_latency_milliseconds", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "Average latency with major pools (RTT)", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "A", - "step": 10 - } - ], - "title": "Average latency with major pools (RTT)", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "left", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "opacity", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 1, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "fieldMinMax": false, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "ms" - }, - "overrides": [] - }, - "gridPos": { - "h": 7, - "w": 12, - "x": 0, - "y": 45 - }, - "id": 83, - "interval": "15s", - "options": { - "legend": { - "calcs": [ - "mean", - "lastNotNull" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "maxHeight": 600, - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.4.1", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sv1_new_job_latency", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "SV1 - time to get a new job from Pool", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "A", - "step": 10 - } - ], - "title": "SV1 - time to get a new job from Pool", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "left", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "opacity", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 1, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "fieldMinMax": false, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "ms" - }, - "overrides": [] - }, - "gridPos": { - "h": 7, - "w": 12, - "x": 12, - "y": 45 - }, - "id": 84, - "interval": "15s", - "options": { - "legend": { - "calcs": [ - "mean", - "lastNotNull" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "maxHeight": 600, - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.4.1", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "new_job_pool_new_template", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "SV2 - time to get a new job from Pool", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "A", - "step": 10 - } - ], - "title": "SV2 - time to get a new job from Pool", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "left", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "opacity", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 1, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "fieldMinMax": false, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "ms" - }, - "overrides": [] - }, - "gridPos": { - "h": 7, - "w": 12, - "x": 0, - "y": 52 - }, - "id": 85, - "interval": "15s", - "options": { - "legend": { - "calcs": [ - "mean", - "lastNotNull" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "maxHeight": 600, - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.4.1", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sv1_new_job_prev_hash_latency", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "SV1 - time to get a new job (after a new block found) from Pool", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "A", - "step": 10 - } - ], - "title": "SV1 - time to get a new job (after a new block found) from Pool", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "left", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "opacity", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 1, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "fieldMinMax": false, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "ms" - }, - "overrides": [] - }, - "gridPos": { - "h": 7, - "w": 12, - "x": 12, - "y": 52 - }, - "id": 86, - "interval": "15s", - "options": { - "legend": { - "calcs": [ - "mean", - "lastNotNull" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "maxHeight": 600, - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.4.1", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "new_job_prev_hash_through_sv2_pool", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "SV2 - time to get a new job (after a new block found) from Pool", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "A", - "step": 10 - } - ], - "title": "SV2 - time to get a new job (after a new block found) from Pool", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "left", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "opacity", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 1, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "fieldMinMax": false, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "ms" - }, - "overrides": [] - }, - "gridPos": { - "h": 7, - "w": 12, - "x": 0, - "y": 59 - }, - "id": 87, - "interval": "15s", - "options": { - "legend": { - "calcs": [ - "mean", - "lastNotNull" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "maxHeight": 600, - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.4.1", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "block_propagation_time_through_sv1_pool", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "SV1 - block propagation time", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "A", - "step": 10 - } - ], - "title": "SV1 - block propagation time", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "left", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "opacity", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 1, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "fieldMinMax": false, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "ms" - }, - "overrides": [] - }, - "gridPos": { - "h": 7, - "w": 12, - "x": 12, - "y": 59 - }, - "id": 88, - "interval": "15s", - "options": { - "legend": { - "calcs": [ - "mean", - "lastNotNull" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "maxHeight": 600, - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.4.1", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "block_propagation_time_through_sv2_pool", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "SV2 - block propagation time", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "A", - "step": 10 - } - ], - "title": "SV2 - block propagation time", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "left", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "opacity", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 1, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "fieldMinMax": false, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "ms" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 24, - "x": 0, - "y": 66 - }, - "id": 89, - "interval": "15s", - "options": { - "legend": { - "calcs": [ - "mean", - "lastNotNull" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "maxHeight": 600, - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.4.1", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sv1_new_job_latency", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "SV1 - time to get a new job from Pool", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "A", - "step": 10 - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "new_job_pool_new_template", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "SV2 - time to get a new job from Pool", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "B", - "step": 10 - } - ], - "title": "SV1 vs SV2 - time to get a new job from Pool", - "transformations": [ - { - "id": "calculateField", - "options": { - "alias": "SV2 delta", - "mode": "reduceRow", - "reduce": { - "include": [ - "SV1 - time to get a new job from Pool", - "SV2 - time to get a new job from Pool" - ], - "reducer": "diff" - } - } - } - ], - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "left", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "opacity", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 1, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "fieldMinMax": false, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "ms" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 24, - "x": 0, - "y": 76 - }, - "id": 90, - "interval": "15s", - "options": { - "legend": { - "calcs": [ - "mean", - "lastNotNull" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "maxHeight": 600, - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.4.1", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sv1_new_job_prev_hash_latency", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "SV1 - time to get a new job (after a new block found) from Pool", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "A", - "step": 10 - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "new_job_prev_hash_through_sv2_pool", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "SV2 - time to get a new job (after a new block found) from Pool", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "B", - "step": 10 - } - ], - "title": "SV1 vs SV2 - time to get a new job (after a new block found) from Pool", - "transformations": [ - { - "id": "calculateField", - "options": { - "alias": "SV2 delta", - "mode": "reduceRow", - "reduce": { - "include": [ - "SV1 - time to get a new job (after a new block found) from Pool", - "SV2 - time to get a new job (after a new block found) from Pool" - ], - "reducer": "diff" - } - } - } - ], - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "left", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "opacity", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 1, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "fieldMinMax": false, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "ms" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 24, - "x": 0, - "y": 86 - }, - "id": 91, - "interval": "15s", - "options": { - "legend": { - "calcs": [ - "mean", - "lastNotNull" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "maxHeight": 600, - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.4.1", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "block_propagation_time_through_sv1_pool", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "SV1 - block propagation time", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "A", - "step": 10 - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "block_propagation_time_through_sv2_pool", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "SV2 - block propagation time", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "B", - "step": 10 - } - ], - "title": "SV1 vs SV2 - block propagation time", - "transformations": [ - { - "id": "calculateField", - "options": { - "alias": "SV2 delta", - "mode": "reduceRow", - "reduce": { - "include": [ - "SV1 - block propagation time", - "SV2 - block propagation time" - ], - "reducer": "diff" - } - } - } - ], - "type": "timeseries" - }, - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 96 - }, - "id": 56, - "panels": [], - "title": "Bandwidth Usage - Mining Farm Level", - "type": "row" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "left", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "opacity", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 3, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "fieldMinMax": false, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "binBps" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 0, - "y": 97 - }, - "id": 65, - "interval": "15s", - "options": { - "legend": { - "calcs": [ - "mean", - "lastNotNull" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "maxHeight": 600, - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.4.1", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "max(\n sum by (id, name) (rate(ntm_bytes_total{dst=\"10.5.0.8\", src=\"10.5.0.19\"}[20s])) or vector(0)\n)", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "Mining Farm Network Interface", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "A", - "step": 10 - } - ], - "title": "SV1 - Network Tx (farm level)", - "transformations": [ - { - "id": "calculateField", - "options": { - "alias": "Total (farm level)", - "mode": "reduceRow", - "reduce": { - "reducer": "sum" - }, - "replaceFields": false - } - } - ], - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "left", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "opacity", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 3, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "fieldMinMax": false, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "binBps" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 12, - "y": 97 - }, - "id": 60, - "interval": "15s", - "options": { - "legend": { - "calcs": [ - "mean", - "lastNotNull" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "maxHeight": 600, - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.4.1", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sum by (id, name) (rate(ntm_bytes_total{src=\"10.5.0.17\", dst=\"10.5.0.4\"}[20s]))", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "Translator", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "A", - "step": 10 - } - ], - "title": "SV2 - Network Tx (farm level)", - "transformations": [ - { - "id": "calculateField", - "options": { - "alias": "Total (farm level)", - "mode": "reduceRow", - "reduce": { - "reducer": "sum" - }, - "replaceFields": false - } - } - ], - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "left", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "opacity", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 3, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "fieldMinMax": false, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "binBps" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 0, - "y": 107 - }, - "id": 64, - "interval": "15s", - "options": { - "legend": { - "calcs": [ - "mean", - "lastNotNull" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "maxHeight": 600, - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.4.1", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "max(\n sum by (id, name) (rate(ntm_bytes_total{src=\"10.5.0.8\", dst=\"10.5.0.19\"}[20s]))or vector(0)\n)", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "Mining Farm Network Interface", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "A", - "step": 10 - } - ], - "title": "SV1 - Network Rx (farm level)", - "transformations": [ - { - "id": "calculateField", - "options": { - "alias": "Total (farm level)", - "mode": "reduceRow", - "reduce": { - "reducer": "sum" - } - } - } - ], - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "left", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "opacity", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 3, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "fieldMinMax": false, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "binBps" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 12, - "y": 107 - }, - "id": 59, - "interval": "15s", - "options": { - "legend": { - "calcs": [ - "mean", - "lastNotNull" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "maxHeight": 600, - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.4.1", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sum by (id, name) (rate(ntm_bytes_total{dst=\"10.5.0.17\", src=\"10.5.0.4\"}[20s]))", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "Translator", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "A", - "step": 10 - } - ], - "title": "SV2 - Network Rx (farm level)", - "transformations": [ - { - "id": "calculateField", - "options": { - "alias": "Total (farm level)", - "mode": "reduceRow", - "reduce": { - "reducer": "sum" - } - } - } - ], - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "left", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "opacity", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 3, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "fieldMinMax": false, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "binBps" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 24, - "x": 0, - "y": 117 - }, - "id": 69, - "interval": "15s", - "options": { - "legend": { - "calcs": [ - "mean", - "lastNotNull" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "maxHeight": 600, - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.4.1", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "max(\n sum by (id, name) (rate(ntm_bytes_total{dst=\"10.5.0.8\", src=\"10.5.0.19\"}[20s])) or vector(0)\n)", - "hide": false, - "instant": false, - "legendFormat": "SV1 (farm net interface)", - "range": true, - "refId": "A" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sum by (id, name) (rate(ntm_bytes_total{src=\"10.5.0.17\", dst=\"10.5.0.4\"}[20s]))", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "SV2 (translator)", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "B", - "step": 10 - } - ], - "title": "SV1 vs SV2 - Network Tx (farm level)", - "transformations": [ - { - "id": "calculateField", - "options": { - "alias": "SV2 delta", - "mode": "reduceRow", - "reduce": { - "include": [ - "SV1 (farm net interface)", - "SV2 (translator)" - ], - "reducer": "diff" - } - } - } - ], - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "left", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "opacity", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 3, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "fieldMinMax": false, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "binBps" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 24, - "x": 0, - "y": 127 - }, - "id": 70, - "interval": "15s", - "options": { - "legend": { - "calcs": [ - "mean", - "lastNotNull" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "maxHeight": 600, - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.4.1", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "max(\n sum by (id, name) (rate(ntm_bytes_total{src=\"10.5.0.8\", dst=\"10.5.0.19\"}[20s]))or vector(0)\n)", - "hide": false, - "instant": false, - "legendFormat": "SV1 (farm net interface)", - "range": true, - "refId": "A" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sum by (id, name) (rate(ntm_bytes_total{dst=\"10.5.0.17\", src=\"10.5.0.4\"}[20s]))", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "SV2 (translator)", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "B", - "step": 10 - } - ], - "title": "SV1 vs SV2 - Network Rx (farm level)", - "transformations": [ - { - "id": "calculateField", - "options": { - "alias": "SV2 delta", - "mode": "reduceRow", - "reduce": { - "include": [ - "SV1 (farm net interface)", - "SV2 (translator)" - ], - "reducer": "diff" - } - } - } - ], - "type": "timeseries" - }, - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 137 - }, - "id": 55, - "panels": [], - "title": "Bandwidth Usage - Pool Level", - "type": "row" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "left", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "opacity", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 3, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "fieldMinMax": false, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "binBps" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 0, - "y": 138 - }, - "id": 63, - "interval": "15s", - "options": { - "legend": { - "calcs": [ - "mean", - "lastNotNull" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "maxHeight": 600, - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.4.1", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sum by (id, name) (rate(ntm_bytes_total{src=\"10.5.0.8\", dst=\"10.5.0.19\"}[20s]))", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "Pool", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "A", - "step": 10 - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sum by (id, name) (rate(ntm_bytes_total{src=\"10.5.0.16\", dst!=\"192.168.65.1\", dst!=\"10.5.0.8\", dst!=\"10.5.0.21\", dst!=\"192.168.65.7\"}[20s]))", - "hide": false, - "instant": false, - "legendFormat": "Bitcoin Node", - "range": true, - "refId": "B" - } - ], - "title": "SV1 - Network Tx (pool level)", - "transformations": [ - { - "id": "calculateField", - "options": { - "alias": "Total (pool level)", - "mode": "reduceRow", - "reduce": { - "include": [ - "Bitcoin Node", - "Pool" - ], - "reducer": "sum" - }, - "replaceFields": false - } - } - ], - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "left", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "opacity", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 3, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "fieldMinMax": false, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "binBps" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 12, - "y": 138 - }, - "id": 57, - "interval": "15s", - "options": { - "legend": { - "calcs": [ - "mean", - "lastNotNull" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "maxHeight": 600, - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.4.1", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sum by (id, name) (rate(ntm_bytes_total{src=\"10.5.0.4\", dst=\"10.5.0.17\"}[20s]))", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "Pool", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "A", - "step": 10 - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sum by (id, name) (rate(ntm_bytes_total{src=\"10.5.0.2\", dst!=\"192.168.65.1\", dst!=\"10.5.0.4\", dst!=\"10.5.0.5\", dst!=\"10.5.0.20\", dst!=\"192.168.65.7\"}[20s]))", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "Template Provider (TP)", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "B", - "step": 10 - } - ], - "title": "SV2 - Network Tx (pool level)", - "transformations": [ - { - "id": "calculateField", - "options": { - "alias": "Total (pool level)", - "mode": "reduceRow", - "reduce": { - "include": [ - "Template Provider (TP)", - "Pool" - ], - "reducer": "sum" - } - } - } - ], - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "left", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "opacity", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 3, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "fieldMinMax": false, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "binBps" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 0, - "y": 148 - }, - "id": 66, - "interval": "15s", - "options": { - "legend": { - "calcs": [ - "mean", - "lastNotNull" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "maxHeight": 600, - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.4.1", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sum by (id, name) (rate(ntm_bytes_total{dst=\"10.5.0.8\", src=\"10.5.0.19\"}[20s]))", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "Pool", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "A", - "step": 10 - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sum by (id, name) (rate(ntm_bytes_total{dst=\"10.5.0.16\", src!=\"192.168.65.1\", src!=\"10.5.0.8\", src!=\"10.5.0.21\", src!=\"192.168.65.7\"}[20s]))", - "hide": false, - "instant": false, - "legendFormat": "Bitcoin Node", - "range": true, - "refId": "B" - } - ], - "title": "SV1 - Network Rx (pool level)", - "transformations": [ - { - "id": "calculateField", - "options": { - "alias": "Total (pool level)", - "mode": "reduceRow", - "reduce": { - "include": [ - "Bitcoin Node", - "Pool" - ], - "reducer": "sum" - } - } - } - ], - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "left", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "opacity", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 3, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "fieldMinMax": false, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "binBps" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 12, - "x": 12, - "y": 148 - }, - "id": 62, - "interval": "15s", - "options": { - "legend": { - "calcs": [ - "mean", - "lastNotNull" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "maxHeight": 600, - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.4.1", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sum by (id, name) (rate(ntm_bytes_total{dst=\"10.5.0.4\", src=\"10.5.0.17\"}[20s]))", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "Pool", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "A", - "step": 10 - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sum by (id, name) (rate(ntm_bytes_total{dst=\"10.5.0.2\", src!=\"192.168.65.1\", src!=\"10.5.0.4\", src!=\"10.5.0.5\", src!=\"10.5.0.20\", src!=\"192.168.65.7\"}[20s]))", - "hide": false, - "instant": false, - "legendFormat": "Template Provider (TP)", - "range": true, - "refId": "C" - } - ], - "title": "SV2 - Network Rx (pool level)", - "transformations": [ - { - "id": "calculateField", - "options": { - "alias": "Total (pool level)", - "mode": "reduceRow", - "reduce": { - "include": [ - "Template Provider (TP)", - "Pool" - ], - "reducer": "sum" - } - } - } - ], - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "left", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "opacity", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 3, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "fieldMinMax": false, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "binBps" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 24, - "x": 0, - "y": 158 - }, - "id": 67, - "interval": "15s", - "options": { - "legend": { - "calcs": [ - "mean", - "lastNotNull" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "maxHeight": 600, - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.4.1", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "max(\n sum by (id, name) (rate(ntm_bytes_total{src=\"10.5.0.8\", dst=\"10.5.0.19\"}[20s])) or vector(0)\n)\n+ \nsum by (id, name) (rate(ntm_bytes_total{src=\"10.5.0.16\", dst!=\"192.168.65.1\", dst!=\"10.5.0.8\", dst!=\"10.5.0.21\", dst!=\"192.168.65.7\"}[20s]))", - "hide": false, - "instant": false, - "legendFormat": "SV1 (pool + bitcoin node)", - "range": true, - "refId": "A" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sum by (id, name) (rate(ntm_bytes_total{src=\"10.5.0.4\", dst=\"10.5.0.17\"}[20s])) + sum by (id, name) (rate(ntm_bytes_total{src=\"10.5.0.2\", dst!=\"192.168.65.1\", dst!=\"10.5.0.4\", dst!=\"10.5.0.5\", dst!=\"10.5.0.20\", dst!=\"192.168.65.7\"}[20s]))", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "SV2 (pool + tp)", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "B", - "step": 10 - } - ], - "title": "SV1 vs SV2 - Network Tx (pool level)", - "transformations": [ - { - "id": "calculateField", - "options": { - "alias": "SV2 delta", - "mode": "reduceRow", - "reduce": { - "include": [ - "SV1 (pool + bitcoin node)", - "SV2 (pool + tp)" - ], - "reducer": "diff" - } - } - } - ], - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "left", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "opacity", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 3, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "fieldMinMax": false, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "binBps" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 24, - "x": 0, - "y": 168 - }, - "id": 68, - "interval": "15s", - "options": { - "legend": { - "calcs": [ - "mean", - "lastNotNull" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "maxHeight": 600, - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.4.1", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "max(\n sum by (id, name) (rate(ntm_bytes_total{dst=\"10.5.0.8\", src=\"10.5.0.19\"}[20s])) or vector(0)\n)\n+\nsum by (id, name) (rate(ntm_bytes_total{dst=\"10.5.0.16\", src!=\"192.168.65.1\", src!=\"10.5.0.8\", src!=\"10.5.0.21\", src!=\"192.168.65.7\"}[20s]))", - "hide": false, - "instant": false, - "legendFormat": "SV1 (pool + bitcoin node)", - "range": true, - "refId": "A" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sum by (id, name) (rate(ntm_bytes_total{dst=\"10.5.0.4\", src=\"10.5.0.17\"}[20s])) + sum by (id, name) (rate(ntm_bytes_total{dst=\"10.5.0.2\", src!=\"192.168.65.1\", src!=\"10.5.0.4\", src!=\"10.5.0.5\", src!=\"10.5.0.20\", src!=\"192.168.65.7\"}[20s]))", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "SV2 (pool + tp)", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "B", - "step": 10 - } - ], - "title": "SV1 vs SV2 - Network Rx (pool level)", - "transformations": [ - { - "id": "calculateField", - "options": { - "alias": "SV2 delta", - "mode": "reduceRow", - "reduce": { - "include": [ - "SV1 (pool + bitcoin node)", - "SV2 (pool + tp)" - ], - "reducer": "diff" - } - } - } - ], - "type": "timeseries" - }, - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 178 - }, - "id": 50, - "panels": [], - "title": "SV1 roles performances (per container)", - "type": "row" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "left", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "opacity", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 3, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "fieldMinMax": false, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "percentunit" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 6, - "x": 0, - "y": 179 - }, - "id": 51, - "options": { - "legend": { - "calcs": [ - "mean", - "lastNotNull" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "maxHeight": 600, - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.4.1", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sum(rate(container_cpu_usage_seconds_total{name=~\"sv1-pool\"}[1m])) by (id, name) \n", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "{{ name }}", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "A", - "step": 10 - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "editorMode": "code", - "expr": "sum(rate(container_cpu_usage_seconds_total{name=~\"sv1-node-pool-side\"}[1m])) by (id, name) \n", - "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "{{ name }}", + "legendFormat": "SV2 - block propagation time", "metric": "container_network_receive_bytes_total", "range": true, "refId": "B", "step": 10 } ], - "title": "Pool Roles (SV1) - CPU Usage ", - "transformations": [ - { - "id": "calculateField", - "options": {} - } - ], - "type": "timeseries" + "title": "SV1 vs SV2 - block propagation time", + "transformations": [], + "type": "timeseries", + "description": "Time elapsed from when a share is produced until the corresponding valid block is broadcasted by the Bitcoin node. Measured in milliseconds." + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 96 + }, + "id": 56, + "panels": [], + "title": "Bandwidth Usage - Miner-Side", + "type": "row" }, { "datasource": { @@ -4132,7 +1350,6 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, - "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -4168,8 +1385,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -4177,21 +1393,122 @@ } ] }, - "unit": "bytes" + "unit": "binBps" }, - "overrides": [] + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": ".*SV1.*bandwidth.*" + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "red" + } + }, + { + "id": "custom.axisPlacement", + "value": "left" + }, + { + "id": "custom.axisLabel", + "value": "Bandwidth (bytes/sec)" + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": ".*SV2.*bandwidth.*" + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "blue" + } + }, + { + "id": "custom.axisPlacement", + "value": "left" + }, + { + "id": "custom.axisLabel", + "value": "Bandwidth (bytes/sec)" + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": ".*SV1.*total bytes.*" + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "orange" + } + }, + { + "id": "custom.axisPlacement", + "value": "right" + }, + { + "id": "custom.axisLabel", + "value": "Total Bytes" + }, + { + "id": "unit", + "value": "decbytes" + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": ".*SV2.*total bytes.*" + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "cyan" + } + }, + { + "id": "custom.axisPlacement", + "value": "right" + }, + { + "id": "custom.axisLabel", + "value": "Total Bytes" + }, + { + "id": "unit", + "value": "decbytes" + } + ] + } + ] }, "gridPos": { "h": 10, - "w": 6, - "x": 6, - "y": 179 + "w": 12, + "x": 0, + "y": 97 }, - "id": 52, + "id": 69, + "interval": "15s", "options": { "legend": { "calcs": [ - "mean", "lastNotNull" ], "displayMode": "table", @@ -4212,15 +1529,12 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "container_memory_usage_bytes{name=~\"sv1-pool\"}\n", + "expr": "sum(rate(ntm_bytes_total{src=\"10.5.0.41\", dst=\"10.5.0.40\",proto=\"tcp\"}[5m]))", "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "{{ name }}", - "metric": "container_network_receive_bytes_total", + "instant": false, + "legendFormat": "SV1 (miner to pool) (bandwidth)", "range": true, - "refId": "A", - "step": 10 + "refId": "A" }, { "datasource": { @@ -4228,131 +1542,27 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "container_memory_usage_bytes{name=~\"sv1-node-pool-side\"}\n", + "expr": "sum(ntm_bytes_total{src=\"10.5.0.41\", dst=\"10.5.0.40\",proto=\"tcp\"})", "hide": false, - "interval": "", - "intervalFactor": 1, - "legendFormat": "{{ name }}", - "metric": "container_network_receive_bytes_total", + "instant": false, + "legendFormat": "SV1 (miner to pool) (total bytes)", "range": true, - "refId": "B", - "step": 10 - } - ], - "title": "Pool Roles (SV1) - Memory Usage", - "transformations": [ - { - "id": "calculateField", - "options": {} - } - ], - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "left", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "opacity", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 3, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "fieldMinMax": false, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "binBps" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 6, - "x": 12, - "y": 179 - }, - "id": 53, - "options": { - "legend": { - "calcs": [ - "mean", - "lastNotNull" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true + "refId": "A_total" }, - "tooltip": { - "maxHeight": 600, - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.4.1", - "targets": [ { "datasource": { "type": "prometheus", "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "sum by (id, name) (irate(container_network_transmit_bytes_total{name=~\"sv1-pool\"}[5m]))\n", + "expr": "sum(rate(ntm_bytes_total{src=\"10.5.0.31\", dst=\"10.5.0.20\",proto=\"tcp\"}[5m]))", "hide": false, "interval": "", "intervalFactor": 1, - "legendFormat": "{{ name }}", + "legendFormat": "SV2 (pool-translator-sniffer to pool) (bandwidth)", "metric": "container_network_receive_bytes_total", "range": true, - "refId": "A", + "refId": "B", "step": 10 }, { @@ -4361,25 +1571,21 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "sum by (id, name) (irate(container_network_transmit_bytes_total{name=~\"sv1-node-pool-side\"}[5m]))\n", + "expr": "sum(ntm_bytes_total{src=\"10.5.0.31\", dst=\"10.5.0.20\",proto=\"tcp\"})", "hide": false, "interval": "", "intervalFactor": 1, - "legendFormat": "{{ name }}", - "metric": "container_network_receive_bytes_total", - "range": true, - "refId": "B", - "step": 10 - } - ], - "title": "Pool Roles (SV1) - Network Tx", - "transformations": [ - { - "id": "calculateField", - "options": {} + "legendFormat": "SV2 (pool-translator-sniffer to pool) (total bytes)", + "metric": "container_network_receive_bytes_total", + "range": true, + "refId": "B_total", + "step": 10 } ], - "type": "timeseries" + "title": "SV1 vs SV2 - Network Tx (miner-side)", + "transformations": [], + "type": "timeseries", + "description": "Network transmission (outgoing) bandwidth and total bytes transmitted from the miner side for SV1 and SV2 protocols. Bandwidth (rate) is shown on the left Y-axis, total bytes on the right Y-axis." }, { "datasource": { @@ -4398,7 +1604,6 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, - "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -4434,8 +1639,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -4445,19 +1649,120 @@ }, "unit": "binBps" }, - "overrides": [] + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": ".*SV1.*bandwidth.*" + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "red" + } + }, + { + "id": "custom.axisPlacement", + "value": "left" + }, + { + "id": "custom.axisLabel", + "value": "Bandwidth (bytes/sec)" + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": ".*SV2.*bandwidth.*" + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "blue" + } + }, + { + "id": "custom.axisPlacement", + "value": "left" + }, + { + "id": "custom.axisLabel", + "value": "Bandwidth (bytes/sec)" + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": ".*SV1.*total bytes.*" + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "orange" + } + }, + { + "id": "custom.axisPlacement", + "value": "right" + }, + { + "id": "custom.axisLabel", + "value": "Total Bytes" + }, + { + "id": "unit", + "value": "decbytes" + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": ".*SV2.*total bytes.*" + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "cyan" + } + }, + { + "id": "custom.axisPlacement", + "value": "right" + }, + { + "id": "custom.axisLabel", + "value": "Total Bytes" + }, + { + "id": "unit", + "value": "decbytes" + } + ] + } + ] }, "gridPos": { "h": 10, - "w": 6, - "x": 18, - "y": 179 + "w": 12, + "x": 12, + "y": 97 }, - "id": 8, + "id": 70, + "interval": "15s", "options": { "legend": { "calcs": [ - "mean", "lastNotNull" ], "displayMode": "table", @@ -4478,14 +1783,40 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "sum by (id, name) (irate(container_network_receive_bytes_total{name=~\"sv1-pool\"}[5m]))\n", + "expr": "sum(rate(ntm_bytes_total{src=\"10.5.0.40\", dst=\"10.5.0.41\",proto=\"tcp\"}[5m]))", + "hide": false, + "instant": false, + "legendFormat": "SV1 (pool to miner-proxy) (bandwidth)", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "sum(ntm_bytes_total{src=\"10.5.0.40\", dst=\"10.5.0.41\",proto=\"tcp\"})", + "hide": false, + "instant": false, + "legendFormat": "SV1 (pool to miner-proxy) (total bytes)", + "range": true, + "refId": "A_total" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "sum(rate(ntm_bytes_total{src=\"10.5.0.20\", dst=\"10.5.0.31\",proto=\"tcp\"}[5m]))", "hide": false, "interval": "", "intervalFactor": 1, - "legendFormat": "{{ name }}", + "legendFormat": "SV2 (pool to pool-translator-sniffer) (bandwidth)", "metric": "container_network_receive_bytes_total", "range": true, - "refId": "A", + "refId": "B", "step": 10 }, { @@ -4494,50 +1825,33 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "sum by (id, name) (irate(container_network_receive_bytes_total{name=~\"sv1-node-pool-side\"}[5m]))\n", + "expr": "sum(ntm_bytes_total{src=\"10.5.0.20\", dst=\"10.5.0.31\",proto=\"tcp\"})", "hide": false, "interval": "", "intervalFactor": 1, - "legendFormat": "{{ name }}", + "legendFormat": "SV2 (pool to pool-translator-sniffer) (total bytes)", "metric": "container_network_receive_bytes_total", "range": true, - "refId": "B", + "refId": "B_total", "step": 10 } ], - "title": "Pool Roles (SV1) - Network Rx ", - "transformations": [ - { - "id": "calculateField", - "options": {} - } - ], - "type": "timeseries" + "title": "SV1 vs SV2 - Network Rx (miner-side)", + "transformations": [], + "type": "timeseries", + "description": "Network reception (incoming) bandwidth and total bytes received on the miner side for SV1 and SV2 protocols. Bandwidth (rate) is shown on the left Y-axis, total bytes on the right Y-axis." }, { "collapsed": false, - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, "gridPos": { "h": 1, "w": 24, "x": 0, - "y": 189 + "y": 137 }, - "id": 19, + "id": 55, "panels": [], - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "PBFA97CFB590B2093" - }, - "refId": "A" - } - ], - "title": "SV2 roles performances (per container)", + "title": "Bandwidth Usage - pool-side", "type": "row" }, { @@ -4557,7 +1871,6 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, - "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -4593,8 +1906,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -4602,21 +1914,122 @@ } ] }, - "unit": "percentunit" + "unit": "binBps" }, - "overrides": [] + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": ".*SV1.*bandwidth.*" + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "red" + } + }, + { + "id": "custom.axisPlacement", + "value": "left" + }, + { + "id": "custom.axisLabel", + "value": "Bandwidth (bytes/sec)" + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": ".*SV2.*bandwidth.*" + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "blue" + } + }, + { + "id": "custom.axisPlacement", + "value": "left" + }, + { + "id": "custom.axisLabel", + "value": "Bandwidth (bytes/sec)" + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": ".*SV1.*total bytes.*" + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "orange" + } + }, + { + "id": "custom.axisPlacement", + "value": "right" + }, + { + "id": "custom.axisLabel", + "value": "Total Bytes" + }, + { + "id": "unit", + "value": "decbytes" + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": ".*SV2.*total bytes.*" + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "cyan" + } + }, + { + "id": "custom.axisPlacement", + "value": "right" + }, + { + "id": "custom.axisLabel", + "value": "Total Bytes" + }, + { + "id": "unit", + "value": "decbytes" + } + ] + } + ] }, "gridPos": { "h": 10, - "w": 6, + "w": 12, "x": 0, - "y": 190 + "y": 138 }, - "id": 45, + "id": 67, + "interval": "15s", "options": { "legend": { "calcs": [ - "mean", "lastNotNull" ], "displayMode": "table", @@ -4637,25 +2050,63 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "sum(rate(container_cpu_usage_seconds_total{name=~\"sv2-tp-pool-side|sv2-pool|sv2-jds\"}[1m])) by (id, name) \n", + "expr": "sum(rate(ntm_bytes_total{src=\"10.5.0.40\", dst=\"10.5.0.41\",proto=\"tcp\"}[5m]))", + "hide": false, + "instant": false, + "legendFormat": "SV1 (pool to miner) (bandwidth)", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "sum(ntm_bytes_total{src=\"10.5.0.40\", dst=\"10.5.0.41\",proto=\"tcp\"})", + "hide": false, + "instant": false, + "legendFormat": "SV1 (pool to miner) (total bytes)", + "range": true, + "refId": "A_total" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "sum(rate(ntm_bytes_total{src=\"10.5.0.20\", dst=\"10.5.0.31\",proto=\"tcp\"}[5m]))", "hide": false, "interval": "", "intervalFactor": 1, - "legendFormat": "{{ name }}", + "legendFormat": "SV2 (pool to translator) (bandwidth)", "metric": "container_network_receive_bytes_total", "range": true, - "refId": "A", + "refId": "B", "step": 10 - } - ], - "title": "Pool Roles (SV2) - CPU Usage ", - "transformations": [ + }, { - "id": "calculateField", - "options": {} + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "sum(ntm_bytes_total{src=\"10.5.0.20\", dst=\"10.5.0.31\",proto=\"tcp\"})", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "SV2 (pool to translator) (total bytes)", + "metric": "container_network_receive_bytes_total", + "range": true, + "refId": "B_total", + "step": 10 } ], - "type": "timeseries" + "title": "SV1 vs SV2 - Network Tx (pool-side)", + "transformations": [], + "type": "timeseries", + "description": "Network transmission (outgoing) bandwidth and total bytes transmitted from the pool side for SV1 and SV2 protocols. Bandwidth (rate) is shown on the left Y-axis, total bytes on the right Y-axis." }, { "datasource": { @@ -4674,7 +2125,6 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, - "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -4710,8 +2160,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -4719,21 +2168,122 @@ } ] }, - "unit": "bytes" + "unit": "binBps" }, - "overrides": [] + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": ".*SV1.*bandwidth.*" + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "red" + } + }, + { + "id": "custom.axisPlacement", + "value": "left" + }, + { + "id": "custom.axisLabel", + "value": "Bandwidth (bytes/sec)" + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": ".*SV2.*bandwidth.*" + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "blue" + } + }, + { + "id": "custom.axisPlacement", + "value": "left" + }, + { + "id": "custom.axisLabel", + "value": "Bandwidth (bytes/sec)" + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": ".*SV1.*total bytes.*" + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "orange" + } + }, + { + "id": "custom.axisPlacement", + "value": "right" + }, + { + "id": "custom.axisLabel", + "value": "Total Bytes" + }, + { + "id": "unit", + "value": "decbytes" + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": ".*SV2.*total bytes.*" + }, + "properties": [ + { + "id": "color", + "value": { + "mode": "fixed", + "fixedColor": "cyan" + } + }, + { + "id": "custom.axisPlacement", + "value": "right" + }, + { + "id": "custom.axisLabel", + "value": "Total Bytes" + }, + { + "id": "unit", + "value": "decbytes" + } + ] + } + ] }, "gridPos": { "h": 10, - "w": 6, - "x": 6, - "y": 190 + "w": 12, + "x": 12, + "y": 138 }, - "id": 44, + "id": 68, + "interval": "15s", "options": { "legend": { "calcs": [ - "mean", "lastNotNull" ], "displayMode": "table", @@ -4754,25 +2304,76 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "container_memory_usage_bytes{name=~\"sv2-tp-pool-side|sv2-pool|sv2-jds\"}\n", + "expr": "sum(rate(ntm_bytes_total{src=\"10.5.0.41\", dst=\"10.5.0.40\",proto=\"tcp\"}[5m]))", + "hide": false, + "instant": false, + "legendFormat": "SV1 (miner to pool) (bandwidth)", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "sum(ntm_bytes_total{src=\"10.5.0.41\", dst=\"10.5.0.40\",proto=\"tcp\"})", + "hide": false, + "instant": false, + "legendFormat": "SV1 (miner to pool) (total bytes)", + "range": true, + "refId": "A_total" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "sum(rate(ntm_bytes_total{src=\"10.5.0.31\", dst=\"10.5.0.20\",proto=\"tcp\"}[5m]))", "hide": false, "interval": "", "intervalFactor": 1, - "legendFormat": "{{ name }}", + "legendFormat": "SV2 (translator to pool) (bandwidth)", "metric": "container_network_receive_bytes_total", "range": true, - "refId": "A", + "refId": "B", "step": 10 - } - ], - "title": "Pool Roles (SV2) - Memory Usage ", - "transformations": [ + }, { - "id": "calculateField", - "options": {} + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "sum(ntm_bytes_total{src=\"10.5.0.31\", dst=\"10.5.0.20\",proto=\"tcp\"})", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "SV2 (translator to pool) (total bytes)", + "metric": "container_network_receive_bytes_total", + "range": true, + "refId": "B_total", + "step": 10 } ], - "type": "timeseries" + "title": "SV1 vs SV2 - Network Rx (pool-side)", + "transformations": [], + "type": "timeseries", + "description": "Network reception (incoming) bandwidth and total bytes received on the pool side for SV1 and SV2 protocols. Bandwidth (rate) is shown on the left Y-axis, total bytes on the right Y-axis." + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 178 + }, + "id": 50, + "panels": [], + "title": "SV1 apps performances (per container)", + "type": "row" }, { "datasource": { @@ -4836,17 +2437,17 @@ } ] }, - "unit": "binBps" + "unit": "percentunit" }, "overrides": [] }, "gridPos": { "h": 10, "w": 6, - "x": 12, - "y": 190 + "x": 0, + "y": 179 }, - "id": 43, + "id": 51, "options": { "legend": { "calcs": [ @@ -4871,7 +2472,7 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "sum by (id, name) (irate(container_network_transmit_bytes_total{name=~\"sv2-tp-pool-side|sv2-pool|sv2-jds\"}[10s]))\n", + "expr": "sum(rate(container_cpu_usage_seconds_total{name=~\"sv1-pool\"}[1m])) by (id, name) \n", "hide": false, "interval": "", "intervalFactor": 1, @@ -4880,16 +2481,33 @@ "range": true, "refId": "A", "step": 10 + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "sum(rate(container_cpu_usage_seconds_total{name=~\"sv1-node-pool-side\"}[1m])) by (id, name) \n", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "{{ name }}", + "metric": "container_network_receive_bytes_total", + "range": true, + "refId": "B", + "step": 10 } ], - "title": "Pool Roles (SV2) - Network Tx ", + "title": "Pool apps (SV1) - CPU Usage ", "transformations": [ { "id": "calculateField", "options": {} } ], - "type": "timeseries" + "type": "timeseries", + "description": "CPU usage percentage for all SV1 pool-related applications and services." }, { "datasource": { @@ -4953,17 +2571,17 @@ } ] }, - "unit": "binBps" + "unit": "bytes" }, "overrides": [] }, "gridPos": { "h": 10, "w": 6, - "x": 18, - "y": 190 + "x": 6, + "y": 179 }, - "id": 58, + "id": 52, "options": { "legend": { "calcs": [ @@ -4988,7 +2606,7 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "sum by (id, name) (irate(container_network_receive_bytes_total{name=~\"sv2-tp-pool-side|sv2-pool|sv2-jds\"}[10s]))\n", + "expr": "container_memory_usage_bytes{name=~\"sv1-pool\"}\n", "hide": false, "interval": "", "intervalFactor": 1, @@ -4997,16 +2615,59 @@ "range": true, "refId": "A", "step": 10 + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "container_memory_usage_bytes{name=~\"sv1-node-pool-side\"}\n", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "{{ name }}", + "metric": "container_network_receive_bytes_total", + "range": true, + "refId": "B", + "step": 10 } ], - "title": "Pool Roles (SV2) - Network Rx ", + "title": "Pool apps (SV1) - Memory Usage", "transformations": [ { "id": "calculateField", "options": {} } ], - "type": "timeseries" + "type": "timeseries", + "description": "Memory usage in bytes for all SV1 pool-related applications and services." + }, + { + "collapsed": false, + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 189 + }, + "id": 19, + "panels": [], + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "refId": "A" + } + ], + "title": "SV2 apps performances (per container)", + "type": "row" }, { "datasource": { @@ -5078,9 +2739,9 @@ "h": 10, "w": 6, "x": 0, - "y": 200 + "y": 190 }, - "id": 46, + "id": 45, "options": { "legend": { "calcs": [ @@ -5089,7 +2750,9 @@ ], "displayMode": "table", "placement": "bottom", - "showLegend": true + "showLegend": true, + "sortBy": "name", + "sortDesc": false }, "tooltip": { "maxHeight": 600, @@ -5105,7 +2768,7 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "sum(rate(container_cpu_usage_seconds_total{name=~\"sv2-tp-miner-side|sv2-jdc|sv2-translator\"}[1m])) by (id, name) \n", + "expr": "sum(rate(container_cpu_usage_seconds_total{name=~\"sv2-tp-pool-side|sv2-pool|bitcoin-core-pool-side\"}[1m])) by (id, name) \n", "hide": false, "interval": "", "intervalFactor": 1, @@ -5116,14 +2779,27 @@ "step": 10 } ], - "title": "Miner Roles (SV2) - CPU Usage", + "title": "Pool apps (SV2) - CPU Usage ", "transformations": [ { "id": "calculateField", "options": {} + }, + { + "id": "sortBy", + "options": { + "fields": {}, + "sort": [ + { + "field": "name", + "desc": false + } + ] + } } ], - "type": "timeseries" + "type": "timeseries", + "description": "CPU usage percentage for all SV2 pool-related applications and services." }, { "datasource": { @@ -5195,9 +2871,9 @@ "h": 10, "w": 6, "x": 6, - "y": 200 + "y": 190 }, - "id": 47, + "id": 44, "options": { "legend": { "calcs": [ @@ -5206,7 +2882,9 @@ ], "displayMode": "table", "placement": "bottom", - "showLegend": true + "showLegend": true, + "sortBy": "name", + "sortDesc": false }, "tooltip": { "maxHeight": 600, @@ -5222,7 +2900,7 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "container_memory_usage_bytes{name=~\"sv2-tp-miner-side|sv2-jdc|sv2-translator\"}\n", + "expr": "container_memory_usage_bytes{name=~\"sv2-tp-pool-side|sv2-pool|bitcoin-core-pool-side\"}\n", "hide": false, "interval": "", "intervalFactor": 1, @@ -5233,14 +2911,27 @@ "step": 10 } ], - "title": "Miner Roles (SV2) - Memory Usage", + "title": "Pool apps (SV2) - Memory Usage ", "transformations": [ { "id": "calculateField", "options": {} + }, + { + "id": "sortBy", + "options": { + "fields": {}, + "sort": [ + { + "field": "name", + "desc": false + } + ] + } } ], - "type": "timeseries" + "type": "timeseries", + "description": "Memory usage in bytes for all SV2 pool-related applications and services." }, { "datasource": { @@ -5304,17 +2995,17 @@ } ] }, - "unit": "binBps" + "unit": "percentunit" }, "overrides": [] }, "gridPos": { "h": 10, "w": 6, - "x": 12, + "x": 0, "y": 200 }, - "id": 48, + "id": 46, "options": { "legend": { "calcs": [ @@ -5323,7 +3014,9 @@ ], "displayMode": "table", "placement": "bottom", - "showLegend": true + "showLegend": true, + "sortBy": "name", + "sortDesc": false }, "tooltip": { "maxHeight": 600, @@ -5339,7 +3032,7 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "sum by (id, name) (irate(container_network_transmit_bytes_total{name=~\"sv2-translator\"}[20s]))", + "expr": "sum(rate(container_cpu_usage_seconds_total{name=~\"sv2-translator\"}[1m])) by (id, name)", "hide": false, "interval": "", "intervalFactor": 1, @@ -5350,14 +3043,27 @@ "step": 10 } ], - "title": "Miner Roles (SV2) - Network Tx", + "title": "Miner apps (SV2) - CPU Usage", "transformations": [ { "id": "calculateField", "options": {} + }, + { + "id": "sortBy", + "options": { + "fields": {}, + "sort": [ + { + "field": "name", + "desc": false + } + ] + } } ], - "type": "timeseries" + "type": "timeseries", + "description": "CPU usage percentage for SV2 miner-side applications and services." }, { "datasource": { @@ -5421,17 +3127,17 @@ } ] }, - "unit": "binBps" + "unit": "bytes" }, "overrides": [] }, "gridPos": { "h": 10, "w": 6, - "x": 18, + "x": 6, "y": 200 }, - "id": 49, + "id": 47, "options": { "legend": { "calcs": [ @@ -5440,7 +3146,9 @@ ], "displayMode": "table", "placement": "bottom", - "showLegend": true + "showLegend": true, + "sortBy": "name", + "sortDesc": false }, "tooltip": { "maxHeight": 600, @@ -5456,25 +3164,25 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "sum by (id, name) (irate(container_network_receive_bytes_total{name=~\"sv2-tp-miner-side|sv2-jdc|sv2-translator\"}[10s]))\n", + "expr": "container_memory_usage_bytes{name=\"sv2-translator\"}", "hide": false, "interval": "", "intervalFactor": 1, "legendFormat": "{{ name }}", "metric": "container_network_receive_bytes_total", "range": true, - "refId": "A", - "step": 10 + "refId": "A" } ], - "title": "Miner Roles (SV2) - Network Rx", + "title": "Miner apps (SV2) - Memory Usage", "transformations": [ { "id": "calculateField", "options": {} } ], - "type": "timeseries" + "type": "timeseries", + "description": "Memory usage in bytes for SV2 miner-side applications and services." }, { "collapsed": false, @@ -5579,7 +3287,8 @@ } ], "title": "Uptime", - "type": "stat" + "type": "stat", + "description": "System uptime showing how long the host system has been running continuously." }, { "datasource": { @@ -5658,7 +3367,8 @@ } ], "title": "CPU Cores", - "type": "stat" + "type": "stat", + "description": "Number of CPU cores available on the host system." }, { "datasource": { @@ -5747,7 +3457,8 @@ } ], "title": "CPU usage", - "type": "gauge" + "type": "gauge", + "description": "Overall CPU usage percentage for the host system." }, { "datasource": { @@ -5826,7 +3537,8 @@ } ], "title": "Host Memory", - "type": "stat" + "type": "stat", + "description": "Total memory capacity of the host system." }, { "datasource": { @@ -5911,7 +3623,8 @@ } ], "title": "Memory usage", - "type": "gauge" + "type": "gauge", + "description": "Current memory usage on the host system." }, { "datasource": { @@ -5997,7 +3710,8 @@ } ], "title": "Filesystem usage", - "type": "gauge" + "type": "gauge", + "description": "Disk space usage for mounted filesystems on the host system." }, { "datasource": { @@ -6140,7 +3854,8 @@ } ], "title": "Node Mermory", - "type": "timeseries" + "type": "timeseries", + "description": "Memory usage for Bitcoin node processes. Note: 'Mermory' is a typo in the original panel title." } ], "refresh": "5s", diff --git a/log-server/Dockerfile b/log-server/Dockerfile index e1013a2..8ae05bd 100644 --- a/log-server/Dockerfile +++ b/log-server/Dockerfile @@ -1,11 +1,11 @@ # Build stage -FROM rust:1.82-alpine AS builder +FROM rust:1.83-alpine AS builder WORKDIR /usr/src/log-server COPY . . # Install necessary dependencies -RUN apk add musl-dev pkgconfig libressl-dev +RUN apk update && apk add --no-cache musl-dev pkgconf libressl-dev # Build the project in release mode RUN cargo build --release diff --git a/log-server/src/main.rs b/log-server/src/main.rs index 978b069..2e65145 100644 --- a/log-server/src/main.rs +++ b/log-server/src/main.rs @@ -36,18 +36,27 @@ async fn main() { let log_label = format!("logging={}", log_label); info!("Starting server with LOG_LABEL: {}", log_label); - let route = warp::path::end().and(warp::get()).and_then(move || { - let log_label = log_label.clone(); - async move { fetch_and_package_logs(&log_label).await } - }); + let route = warp::path::end() + .and(warp::get()) + .and(warp::query::>()) + .and_then(move |params: HashMap| { + let log_label = log_label.clone(); + async move { fetch_and_package_logs(&log_label, params).await } + }); warp::serve(route).run(([0, 0, 0, 0], 7420)).await; } -async fn fetch_and_package_logs(log_label: &str) -> Result { - info!("Fetching logs for label: {}", log_label); +async fn fetch_and_package_logs( + log_label: &str, + params: HashMap, +) -> Result { + info!( + "Fetching logs for label: {} with params: {:?}", + log_label, params + ); - match fetch_and_package_logs_impl(log_label).await { + match fetch_and_package_logs_impl(log_label, params).await { Ok(file) => { info!("Successfully fetched and packaged logs."); let response = Response::builder() @@ -70,12 +79,18 @@ async fn fetch_and_package_logs(log_label: &str) -> Result Result> { +async fn fetch_and_package_logs_impl( + log_label: &str, + params: HashMap, +) -> Result> { info!("Fetching logs for label: {}", log_label); let containers = get_containers(log_label).await?; info!("Found containers: {:?}", containers); + // Parse time range from query parameters (Grafana sends 'from' and 'to' in milliseconds) + let (start_time, end_time) = parse_time_range(¶ms); + let client = Client::new(); let mut tar_data = Vec::new(); { @@ -84,12 +99,14 @@ async fn fetch_and_package_logs_impl(log_label: &str) -> Result { let mut header = tar::Header::new_gnu(); header.set_size(logs.len() as u64); @@ -155,15 +172,57 @@ async fn get_containers(log_label: &str) -> Result, Box) -> (u64, u64) { + // Grafana sends 'from' and 'to' as milliseconds since epoch + // Loki expects nanoseconds since epoch + let now = std::time::SystemTime::now() + .duration_since(std::time::UNIX_EPOCH) + .expect("Time went backwards") + .as_millis() as u64; + + let end_time_ms = params + .get("to") + .and_then(|s| s.parse::().ok()) + .unwrap_or(now); + + let start_time_ms = params + .get("from") + .and_then(|s| s.parse::().ok()) + .unwrap_or_else(|| { + // Default to last 7 days if not provided + let hours_back = env::var("LOG_TIME_RANGE_HOURS") + .ok() + .and_then(|s| s.parse::().ok()) + .unwrap_or(168); // Default: 168 hours = 7 days + end_time_ms - (hours_back * 3600 * 1000) // Convert hours to milliseconds + }); + + // Convert milliseconds to nanoseconds for Loki + let start_time_ns = start_time_ms * 1_000_000; + let end_time_ns = end_time_ms * 1_000_000; + + info!( + "Time range: {} to {} ({} ms to {} ms)", + start_time_ms, end_time_ms, start_time_ns, end_time_ns + ); + + (start_time_ns, end_time_ns) +} + async fn fetch_logs( client: &Client, container: &str, + start_time: u64, + end_time: u64, ) -> Result> { let url = format!( - "http://loki:3100/loki/api/v1/query_range?query={{container=\"{}\"}}&limit=100000000", - container + "http://loki:3100/loki/api/v1/query_range?query={{container=\"{}\"}}&start={}&end={}&limit=100000000", + container, start_time, end_time + ); + info!( + "Fetching logs from Loki for container {}: {}", + container, url ); - info!("Fetching logs from Loki: {}", url); let response: LokiResponse = client.get(&url).send().await?.json().await?; let mut logs: Vec<(String, String)> = response diff --git a/pools-latency-calculator/Dockerfile b/pools-latency-calculator/Dockerfile index d308013..b228f84 100644 --- a/pools-latency-calculator/Dockerfile +++ b/pools-latency-calculator/Dockerfile @@ -1,10 +1,10 @@ # Build stage -FROM rust:1.82-alpine AS builder +FROM rust:1.83-alpine AS builder WORKDIR /usr/src/pools-latency-calculator # Install necessary dependencies for building -RUN apk add --no-cache musl-dev pkgconfig libressl-dev +RUN apk update && apk add --no-cache musl-dev pkgconf libressl-dev # Copy the source code into the container COPY pools-latency-calculator/ . diff --git a/pools-latency-calculator/monitor_and_apply_latency.sh b/pools-latency-calculator/monitor_and_apply_latency.sh index af17e0a..e12e934 100755 --- a/pools-latency-calculator/monitor_and_apply_latency.sh +++ b/pools-latency-calculator/monitor_and_apply_latency.sh @@ -1,26 +1,21 @@ #!/bin/sh if [ -z "$1" ] || [ -z "$2" ]; then - echo "Usage: $0 [TARGET_IP2] [-proxy-type=pool-translator]" + echo "Usage: $0 [TARGET_IP2]" exit 1 fi TARGET_IP1="$1" DIVISOR="$2" TARGET_IP2="" -PROXY_TYPE="" -# Process optional arguments -for ARG in "$@"; do - if [ "$ARG" = "-proxy-type=pool-translator" ]; then - PROXY_TYPE="$ARG" - elif [ "$ARG" != "$1" ] && [ "$ARG" != "$2" ]; then - TARGET_IP2="$ARG" - fi -done +# Process optional third argument (second target IP) +if [ -n "$3" ]; then + TARGET_IP2="$3" +fi # URL of the Prometheus query -PROMETHEUS_QUERY_URL="http://10.5.0.9:9090/api/v1/query?query=average_pool_subscription_latency_milliseconds" +PROMETHEUS_QUERY_URL="http://10.5.0.50:9090/api/v1/query?query=average_pool_subscription_latency_milliseconds" # Initialize the previous latency variable PREV_LATENCY="" @@ -32,37 +27,30 @@ while true; do # Check if LATENCY is empty if [ -z "$LATENCY" ]; then - echo "No latency value found, skipping this cycle." + echo "No latency value found from Prometheus, skipping this cycle." else # Compare the current latency with the previous latency if [ "$LATENCY" != "$PREV_LATENCY" ]; then # Set the latency using the tc command, dividing the value obtained from the query by the divisor ADJUSTED_LATENCY=$(echo "$LATENCY $DIVISOR" | awk '{print $1 / $2}') - echo "Setting latency to ${ADJUSTED_LATENCY}ms" - - if [ "$PROXY_TYPE" = "-proxy-type=pool-translator" ]; then - # Remove existing qdisc if any - tc qdisc del dev eth0 root 2>/dev/null - - # Apply latency to traffic going to TARGET_IP1 with pool-translator settings - tc qdisc add dev eth0 root handle 1: prio - tc qdisc add dev eth0 parent 1:1 handle 10: netem delay "${ADJUSTED_LATENCY}ms" - iptables -t mangle -F - iptables -t mangle -A OUTPUT -p tcp -s 10.5.0.17 -d "$TARGET_IP1" --tcp-flags PSH PSH -j MARK --set-mark 1 - tc filter add dev eth0 protocol ip parent 1:0 prio 1 handle 1 fw classid 1:1 - else - # Remove existing qdisc if any - tc qdisc del dev eth0 root 2>/dev/null + echo "Setting latency to ${ADJUSTED_LATENCY}ms for traffic to ${TARGET_IP1}" + if [ -n "$TARGET_IP2" ]; then + echo " Also applying latency to ${TARGET_IP2}" + fi - # Apply latency to traffic going to TARGET_IP1 - tc qdisc add dev eth0 root handle 1: prio - tc qdisc add dev eth0 parent 1:3 handle 30: netem delay "${ADJUSTED_LATENCY}ms" - tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip dst "$TARGET_IP1" flowid 1:3 - - # Apply to second target IP if provided - if [ -n "$TARGET_IP2" ]; then - tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip dst "$TARGET_IP2" flowid 1:3 - fi + # Remove existing qdisc if any + tc qdisc del dev eth0 root 2>/dev/null + + # Apply latency to traffic going to TARGET_IP1 + tc qdisc add dev eth0 root handle 1: prio + tc qdisc add dev eth0 parent 1:3 handle 30: netem delay "${ADJUSTED_LATENCY}ms" + tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip dst "$TARGET_IP1" flowid 1:3 + echo " Applied latency filter for destination ${TARGET_IP1}" + + # Apply to second target IP if provided + if [ -n "$TARGET_IP2" ]; then + tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip dst "$TARGET_IP2" flowid 1:3 + echo " Applied latency filter for destination ${TARGET_IP2}" fi # Update the previous latency value diff --git a/prometheus/prometheus.yml b/prometheus/prometheus.yml index a0375b8..2fcdd1d 100644 --- a/prometheus/prometheus.yml +++ b/prometheus/prometheus.yml @@ -70,38 +70,46 @@ scrape_configs: static_configs: - targets: ['sv1-node-pool-proxy:4567'] # The Network Traffic Metrics IP/port - - job_name: 'sv2-jdc-translator-proxy' + - job_name: 'sv2-jdc-translator-sniffer' # Override the global default and scrape targets from this job every 5 seconds. scrape_interval: 5s static_configs: - - targets: ['sv2-jdc-translator-proxy:3456'] # The Network Traffic Metrics IP/port + - targets: ['sv2-jdc-translator-sniffer:3458'] # The Network Traffic Metrics IP/port - - job_name: 'sv2-tp-jdc-proxy' + - job_name: 'sv2-tp-jdc-sniffer' # Override the global default and scrape targets from this job every 5 seconds. scrape_interval: 5s static_configs: - - targets: ['sv2-tp-jdc-proxy:5678'] # The Network Traffic Metrics IP/port + - targets: ['sv2-tp-jdc-sniffer:5678'] # The Network Traffic Metrics IP/port - - job_name: 'sv2-pool-translator-proxy' + - job_name: 'sv2-pool-jdc-sniffer' # Override the global default and scrape targets from this job every 5 seconds. scrape_interval: 5s static_configs: - - targets: ['sv2-pool-translator-proxy:3456'] # The Network Traffic Metrics IP/port + - targets: ['sv2-pool-jdc-sniffer:3457'] # The Network Traffic Metrics IP/port - - job_name: 'sv2-tp-pool-proxy' + - job_name: 'sv2-tp-pool-sniffer' # Override the global default and scrape targets from this job every 5 seconds. scrape_interval: 5s static_configs: - - targets: ['sv2-tp-pool-proxy:5678'] # The Network Traffic Metrics IP/port + - targets: ['sv2-tp-pool-sniffer:5677'] # The Network Traffic Metrics IP/port (config-c only) + + - job_name: 'sv2-pool-translator-sniffer' + + # Override the global default and scrape targets from this job every 5 seconds. + scrape_interval: 5s + + static_configs: + - targets: ['sv2-pool-translator-sniffer:3456'] # The Network Traffic Metrics IP/port (config-c only) - job_name: 'sv2-translator-miner-proxy' diff --git a/run-benchmarking-tool.sh b/run-benchmarking-tool.sh index 5e66771..6a6d0c6 100755 --- a/run-benchmarking-tool.sh +++ b/run-benchmarking-tool.sh @@ -4,12 +4,9 @@ DEFAULT_CONFIG="A" DEFAULT_NETWORK="testnet4" DEFAULT_HASHRATE="10_000_000_000_000.0" -DEFAULT_SCRIPT_TYPE="P2WPKH" DEFAULT_POOL_SIGNATURE="Stratum V2 SRI Pool" +DEFAULT_TP_MIN_INTERVAL="60" -# Default interval based on configuration -DEFAULT_INTERVAL_A="30" -DEFAULT_INTERVAL_C="60" # Path to .env file ENV_FILE=".env" @@ -20,200 +17,298 @@ DEFAULT_LOG_LEVEL="info" # Function to clean up Docker containers on error cleanup() { echo "" - echo "An error occurred during the setup process." - echo "Stopping any running Docker containers..." - docker compose -f "docker-compose-config-${CONFIG_LOWER}.yaml" down - echo "Docker containers stopped." - echo "Please try running the tool again with the command: ./run-benchmarking-tool.sh" - echo "🚨If the issue persists, please contact the support team for assistance on Discord: https://discord.com/channels/950687892169195530/1107964065936060467" + echo "${bg_red}${white}${bold}═══════════════════════════════════════════════════════════════════════════════${reset}" + echo "${bg_red}${white}${bold} ❌ Error: Setup Failed${reset}" + echo "${bg_red}${white}${bold}═══════════════════════════════════════════════════════════════════════════════${reset}" + echo "" + echo " An error occurred during the setup process." + echo " Stopping any running Docker containers..." + echo "" + docker compose -f "docker-compose-config-${CONFIG_LOWER}.yaml" down 2>/dev/null || true + echo "" + echo " ${bold}Next Steps:${reset}" + echo " 1. Try running the tool again: ${bold}./run-benchmarking-tool.sh${reset}" + echo " 2. Check Docker is running: ${bold}docker ps${reset}" + echo " 3. Review error messages above for details" + echo "" + echo " ${bold}Need Help?${reset}" + echo " Discord Support: https://discord.com/channels/950687892169195530/1107964065936060467" + echo "" + echo "═══════════════════════════════════════════════════════════════════════════════" + echo "" exit 1 } # Set up trap to catch errors and call cleanup trap 'cleanup' ERR -# Display a note about the configurations +# Color definitions bold=$(tput bold) underline=$(tput smul) reset=$(tput sgr0) + +# Text colors +red=$(tput setaf 1) +green=$(tput setaf 2) +yellow=$(tput setaf 3) +blue=$(tput setaf 4) +magenta=$(tput setaf 5) +cyan=$(tput setaf 6) +white=$(tput setaf 7) + +# Background colors (optional, for tiles) +bg_blue=$(tput setab 4) +bg_cyan=$(tput setab 6) +bg_green=$(tput setab 2) +bg_red=$(tput setab 1) +echo "" +echo "${cyan}${bold}═══════════════════════════════════════════════════════════════════════════════${reset}" +echo "${cyan}${bold} Stratum V2 Benchmarking Tool - Configuration Selection${reset}" +echo "${cyan}${bold}═══════════════════════════════════════════════════════════════════════════════${reset}" +echo "" +echo " ${cyan}${bold}Configuration A (JDC - Job Declaration Client):${reset}" +echo " ${green}•${reset} Runs all Stratum V2 apps (TP, Pool, JDS, JDC, Translator)" +echo " ${green}•${reset} Miners select transactions and create custom block templates" +echo " ${green}•${reset} Provides maximum decentralization and miner control" +echo "" +echo " ${magenta}${bold}Configuration C (Pool-only):${reset}" +echo " ${yellow}•${reset} Does NOT run Job Declaration Protocol (no JDC/JDS)" +echo " ${yellow}•${reset} Miners mine on Pool's block template (similar to Stratum V1)" +echo " ${yellow}•${reset} Simpler setup, but less decentralized" echo "" -echo -e "🚨 ${bold}Note:${reset}" -echo -e "${bold}Configuration A:${reset} it runs every role, selecting txs and mining on custom jobs" -echo -e "${bold}Configuration C:${reset} it doesn't run Job Declaration Protocol, so it will mine on Pool's block template" +echo " ${blue}${underline}Learn more:${reset} ${cyan}https://stratumprotocol.org${reset}" echo "" -echo "Please have a look at https://stratumprotocol.org to better understand the Stratum V2 configurations and decide which one to benchmark." +echo "${cyan}───────────────────────────────────────────────────────────────────────────────${reset}" echo "" # Prompt user to select configuration (A or C) with default value -read -p "Which Stratum V2 configuration do you want to benchmark? (Enter 'A' or 'C', default is 'A'): " CONFIG +read -p "${cyan}${bold}Select configuration to benchmark${reset} ${yellow}[A/C, default: A]:${reset} " CONFIG CONFIG=${CONFIG:-$DEFAULT_CONFIG} CONFIG=$(echo "$CONFIG" | tr '[:lower:]' '[:upper:]') # Validate the CONFIG input if [[ "$CONFIG" != "A" && "$CONFIG" != "C" ]]; then - echo "Invalid configuration choice. Please enter 'A' or 'C'." + echo "" + echo "${red}${bold}❌ Error:${reset} Invalid configuration. Please enter 'A' or 'C'." exit 1 fi -# Prompt user to select network (mainnet, testnet3, or testnet4) with default value echo "" -read -p "Do you want to use mainnet, testnet3, or testnet4? (Enter 'mainnet', 'testnet3', or 'testnet4', default is 'testnet4'): " NETWORK +echo "${green}✓${reset} Configuration ${cyan}${bold}${CONFIG}${reset} selected" +echo "" + +# Prompt user to select network (mainnet, testnet3, or testnet4) with default value +echo "${cyan}───────────────────────────────────────────────────────────────────────────────${reset}" +read -p "${cyan}${bold}Select Bitcoin network${reset} ${yellow}[mainnet/testnet3/testnet4, default: testnet4]:${reset} " NETWORK NETWORK=${NETWORK:-$DEFAULT_NETWORK} # Validate the NETWORK input if [[ "$NETWORK" != "mainnet" && "$NETWORK" != "testnet3" && "$NETWORK" != "testnet4" ]]; then - echo "Invalid network choice. Please enter 'mainnet', 'testnet3', or 'testnet4'." + echo "" + echo "${red}${bold}❌ Error:${reset} Invalid network. Please enter 'mainnet', 'testnet3', or 'testnet4'." exit 1 fi +echo "" +echo "${green}✓${reset} Network: ${cyan}${bold}${NETWORK}${reset}" +echo "" + # Prompt user for hashrate to use for SV2 with default value +echo "${cyan}───────────────────────────────────────────────────────────────────────────────${reset}" +echo " ${cyan}${bold}Hashrate Configuration${reset}" +echo " Enter the ${underline}real hashrate${reset} of your miner that will connect to Stratum V2" +echo " ${underline}Examples:${reset}" +echo " • 10 Th/s → enter: 10000000000000 or 10_000_000_000_000" +echo " • 100 GH/s → enter: 100000000000 or 100_000_000_000" +echo " • 1 PH/s → enter: 1000000000000000 or 1_000_000_000_000_000" +echo " ${underline}Note:${reset} You can enter the number with or without underscores/commas" echo "" -read -p "Enter the hashrate for SV2 (e.g.: for 10 Th/s you need to enter 10_000_000_000_000.0, default is '10_000_000_000_000.0'): " hashrate -hashrate=${hashrate:-$DEFAULT_HASHRATE} +read -p "${cyan}${bold}Enter your miner's hashrate${reset} ${yellow}[hashes/second, default: 10000000000000]:${reset} " hashrate_input +hashrate_input=${hashrate_input:-"10000000000000"} + +# Normalize hashrate input: remove all non-digit characters (underscores, commas, spaces, etc.) +hashrate_clean=$(echo "$hashrate_input" | tr -d '_' | tr -d ',' | tr -d ' ' | sed 's/[^0-9]//g') -# Validate the hashrate format (with underscores) -if ! [[ "$hashrate" =~ ^[0-9_]+\.0$ ]]; then - echo "Invalid hashrate format. Please use underscores for grouping digits (e.g., 10_000_000_000_000.0)." +# Validate that we have a valid number +if ! [[ "$hashrate_clean" =~ ^[0-9]+$ ]] || [[ -z "$hashrate_clean" ]]; then + echo "" + echo "${red}${bold}❌ Error:${reset} Invalid hashrate format." + echo " Please enter a valid number (e.g., 10000000000000 or 10_000_000_000_000)" exit 1 fi -# Prompt user to check if they want to configure the custom public key +# Format with underscores every 3 digits from right to left, then add .0 +# Use awk to format the number with underscores +hashrate=$(echo "$hashrate_clean" | awk '{ + len = length($0) + result = "" + pos = len + while (pos > 0) { + start = (pos - 3 > 0) ? pos - 2 : 1 + chunk = substr($0, start, pos - start + 1) + if (result == "") { + result = chunk + } else { + result = chunk "_" result + } + pos = start - 1 + } + print result ".0" +}') + echo "" -echo -e "🚨 To customize the coinbase transaction output, a custom public key (or redeem script) is required." +echo "${green}✓${reset} Hashrate: ${cyan}${bold}${hashrate}${reset} hashes/second" +echo "" + +# Prompt user to check if they want to configure a custom Bitcoin address +echo "${cyan}───────────────────────────────────────────────────────────────────────────────${reset}" +echo " ${cyan}${bold}Coinbase Transaction Configuration${reset}" +echo " The coinbase transaction is the first transaction in each block" +echo " ${underline}Note:${reset} A Bitcoin address is required to customize the coinbase output" echo "" -read -p "Do you want to configure your custom public key for the coinbase transaction? (yes/no, default is 'no'): " CONFIGURE_KEY -CONFIGURE_KEY=${CONFIGURE_KEY:-"no"} +read -p "${cyan}${bold}Configure custom Bitcoin address?${reset} ${yellow}[yes/no, default: no]:${reset} " CONFIGURE_ADDRESS +CONFIGURE_ADDRESS=${CONFIGURE_ADDRESS:-"no"} -# Validate the CONFIGURE_KEY input -if [[ "$CONFIGURE_KEY" != "yes" && "$CONFIGURE_KEY" != "no" ]]; then - echo "Invalid input. Please enter 'yes' or 'no'." +# Validate the CONFIGURE_ADDRESS input +if [[ "$CONFIGURE_ADDRESS" != "yes" && "$CONFIGURE_ADDRESS" != "no" ]]; then + echo "" + echo "${red}${bold}❌ Error:${reset} Invalid input. Please enter 'yes' or 'no'." exit 1 fi -# If the user wants to configure the key, prompt for public key and script type -if [[ "$CONFIGURE_KEY" == "yes" ]]; then - echo "" - echo -e "If you still don't have a public key, setup a new wallet and extract the extended public key it provides. At this point, you can derive the child public key using this script: https://github.com/stratum-mining/stratum/tree/dev/utils/bip32-key-derivation" +# If the user wants to configure the address, prompt for Bitcoin address +if [[ "$CONFIGURE_ADDRESS" == "yes" ]]; then echo "" - read -p "Now enter the public key (or redeem script) to use for generating the address in the coinbase transaction: " PUBLIC_KEY + echo " ${bold}Bitcoin Address Format:${reset}" + echo " • Mainnet: bc1q..., 1..., 3..." + echo " • Testnet: tb1q..., m..., n..." + echo " • The address will be formatted as: addr(your_address)" echo "" - read -p "Enter the script type (P2PK, P2PKH, P2SH, P2WSH, P2WPKH, P2TR, default is 'P2WPKH'): " SCRIPT_TYPE - SCRIPT_TYPE=${SCRIPT_TYPE:-$DEFAULT_SCRIPT_TYPE} - - # Validate the script type - VALID_SCRIPT_TYPES=("P2PK" "P2PKH" "P2SH" "P2WSH" "P2WPKH" "P2TR") - if [[ ! " ${VALID_SCRIPT_TYPES[@]} " =~ " ${SCRIPT_TYPE} " ]]; then - echo "Invalid script type. Please enter one of the following: P2PK, P2PKH, P2SH, P2WSH, P2WPKH, P2TR." + read -p "${bold}Enter Bitcoin address:${reset} " BITCOIN_ADDRESS + + # Basic validation for Bitcoin address format + if [[ -z "$BITCOIN_ADDRESS" ]]; then + echo "" + echo "${red}${bold}❌ Error:${reset} Bitcoin address cannot be empty." exit 1 fi + + # Check if it looks like a valid Bitcoin address (starts with common prefixes) + if ! [[ "$BITCOIN_ADDRESS" =~ ^(bc1|tb1|1|2|3|m|n|bc|tb) ]]; then + echo "" + echo "${yellow}${bold}⚠️ Warning:${reset} Address format doesn't match common Bitcoin patterns." + echo " Continuing anyway, but please verify the address is correct." + else + echo "" + echo "${green}✓${reset} Bitcoin address configured" + fi +else + echo "" + echo "${green}✓${reset} Using default testnet address: ${cyan}tb1qa0sm0hxzj0x25rh8gw5xlzwlsfvvyz8u96w3p8${reset}" fi # Prompt user to customize the pool signature echo "" -read -p "Default pool signature inscribed in coinbase tx is 'Stratum V2 SRI Pool'. Do you want to customize it? (yes/no, default is 'no'): " CUSTOMIZE_SIGNATURE +echo "${cyan}───────────────────────────────────────────────────────────────────────────────${reset}" +echo " ${cyan}${bold}Pool Signature Configuration${reset}" +echo " The pool signature is inscribed in the coinbase transaction" +echo " ${underline}Default:${reset} 'Stratum V2 SRI Pool'" +echo "" +read -p "${bold}Customize pool signature?${reset} [yes/no, default: no]: " CUSTOMIZE_SIGNATURE CUSTOMIZE_SIGNATURE=${CUSTOMIZE_SIGNATURE:-"no"} if [[ "$CUSTOMIZE_SIGNATURE" == "yes" ]]; then echo "" - read -p "Enter the custom pool signature to use (default is 'Stratum V2 SRI Pool'): " POOL_SIGNATURE + read -p "${bold}Enter custom pool signature${reset} [default: 'Stratum V2 SRI Pool']: " POOL_SIGNATURE POOL_SIGNATURE=${POOL_SIGNATURE:-$DEFAULT_POOL_SIGNATURE} + echo "" + echo "${green}✓${reset} Pool signature: ${cyan}${bold}${POOL_SIGNATURE}${reset}" else POOL_SIGNATURE=$DEFAULT_POOL_SIGNATURE + echo "" + echo "${green}✓${reset} Using default pool signature: ${cyan}${bold}${POOL_SIGNATURE}${reset}" fi -# Inform the user about the block template update interval and get the interval echo "" -if [[ "$CONFIG" == "A" ]]; then - echo "The SV1 pool used in the benchmarking tool will generate a new block template every 60 seconds." - read -p "How often do you want your local Job Declarator Client (JDC) to produce updated templates? (default is '30'): " SV2_INTERVAL - DEFAULT_INTERVAL=$DEFAULT_INTERVAL_A -else - echo "The SV1 pool used in the benchmarking tool will generate a new block template every 60 seconds." - read -p "How often do you want the SV2 pool to send updated block templates? This value will affect the bandwidth used. (default is '60'): " SV2_INTERVAL - DEFAULT_INTERVAL=$DEFAULT_INTERVAL_C +echo "${cyan}───────────────────────────────────────────────────────────────────────────────${reset}" +read -p "${cyan}${bold}Select log level${reset} ${yellow}[info/debug/error/warn, default: info]:${reset} " LOG_LEVEL +LOG_LEVEL=${LOG_LEVEL:-$DEFAULT_LOG_LEVEL} +if ! [[ "$LOG_LEVEL" =~ ^(info|debug|error|warn)$ ]]; then + echo "" + echo "${red}${bold}❌ Error:${reset} Invalid log level. Please enter: info, debug, error, or warn." + exit 1 fi -# Use default if no input is provided -SV2_INTERVAL=${SV2_INTERVAL:-$DEFAULT_INTERVAL} +echo "" +echo "${green}✓${reset} Log level: ${cyan}${bold}${LOG_LEVEL}${reset}" +echo "" + +# Prompt for template provider minimum interval +echo "${cyan}───────────────────────────────────────────────────────────────────────────────${reset}" +echo " ${cyan}${bold}Template Provider Update Interval${reset}" +echo " Minimum time (in seconds) between block template updates for Template Providers" +echo " ${underline}Note:${reset} Lower values = more frequent updates, higher CPU usage" +echo "" +read -p "${cyan}${bold}Enter template provider interval${reset} ${yellow}[seconds, default: 60]:${reset} " TP_MIN_INTERVAL +TP_MIN_INTERVAL=${TP_MIN_INTERVAL:-$DEFAULT_TP_MIN_INTERVAL} -# Validate the SV2_INTERVAL input (must be a positive integer) -if ! [[ "$SV2_INTERVAL" =~ ^[0-9]+$ ]]; then - echo "Invalid interval format. Please enter a positive integer." +# Validate the TP_MIN_INTERVAL input (must be a positive integer) +if ! [[ "$TP_MIN_INTERVAL" =~ ^[0-9]+$ ]]; then + echo "" + echo "${red}${bold}❌ Error:${reset} Invalid interval format. Please enter a positive integer." exit 1 fi echo "" -read -p "Choose the log level to display in the tool? (info, debug, error, or warn, default is 'info'): " LOG_LEVEL -LOG_LEVEL=${LOG_LEVEL:-$DEFAULT_LOG_LEVEL} -if ! [[ "$LOG_LEVEL" =~ ^(info|debug|error|warn)$ ]]; then - echo "Invalid log level. Please enter one of these: info, debug, error, or warn." - exit 1 -fi +echo "${green}✓${reset} Template provider interval: ${cyan}${bold}${TP_MIN_INTERVAL}${reset} seconds" +echo "" +echo "${bg_green}${white}───────────────────────────────────────────────────────────────────────────────${reset}" +echo "" +echo " ${green}${bold}Starting Docker containers...${reset}" +echo "" -# Define all the configuration files to update -CONFIG_FILES=( - "custom-configs/sri-roles/config-a/pool-config-a-docker-example.toml" - "custom-configs/sri-roles/config-a/jds-config-a-docker-example.toml" - "custom-configs/sri-roles/config-a/jdc-config-a-docker-example.toml" - "custom-configs/sri-roles/config-c/pool-config-c-docker-example.toml" -) - -HASHRATE_CONFIG_FILES=( - "custom-configs/sri-roles/config-a/tproxy-config-a-docker-example.toml" - "custom-configs/sri-roles/config-c/tproxy-config-c-docker-example.toml" -) - -# Update the TOML files with the new hashrate value, keeping underscores -for config_file in "${HASHRATE_CONFIG_FILES[@]}"; do - if [[ "$OSTYPE" == "darwin"* ]]; then - # macOS uses -i '' for in-place editing - sed -i '' "s/min_individual_miner_hashrate = [0-9_]*\.0/min_individual_miner_hashrate = $hashrate/" "$config_file" - sed -i '' "s/channel_nominal_hashrate = [0-9_]*\.0/channel_nominal_hashrate = $hashrate/" "$config_file" - else - # Linux uses -i for in-place editing - sed -i "s/min_individual_miner_hashrate = [0-9_]*\.0/min_individual_miner_hashrate = $hashrate/" "$config_file" - sed -i "s/channel_nominal_hashrate = [0-9_]*\.0/channel_nominal_hashrate = $hashrate/" "$config_file" - fi -done - -# Update JDC and Pool configs for custom public key and script type -if [[ "$CONFIGURE_KEY" == "yes" ]]; then - for config_file in "${CONFIG_FILES[@]}"; do - awk -v script_type="$SCRIPT_TYPE" -v new_value="$PUBLIC_KEY" ' - BEGIN { in_coinbase_outputs = 0 } - /coinbase_outputs = \[/ { in_coinbase_outputs = 1 } - in_coinbase_outputs && /\{ output_script_type =/ { - if ($0 ~ "output_script_type = \"" script_type "\"") { - print " { output_script_type = \"" script_type "\", output_script_value = \"" new_value "\" }," - } else { - print "#" $0 - } - next - } - /]/ { in_coinbase_outputs = 0 } - { print } - ' "$config_file" > temp_config && mv temp_config "$config_file" - done +# Initialize coinbase reward script +if [[ "$CONFIGURE_ADDRESS" == "yes" ]]; then + COINBASE_REWARD_SCRIPT="addr(${BITCOIN_ADDRESS})" +else + # Default address + COINBASE_REWARD_SCRIPT="addr(tb1qa0sm0hxzj0x25rh8gw5xlzwlsfvvyz8u96w3p8)" fi -# Update pool signature -for config_file in "${CONFIG_FILES[@]}"; do - if [[ "$OSTYPE" == "darwin"* ]]; then - # macOS uses -i '' for in-place editing - sed -i '' "s/pool_signature = \"[^\"]*\"/pool_signature = \"$POOL_SIGNATURE\"/" "$config_file" - else - # Linux uses -i for in-place editing - sed -i "s/pool_signature = \"[^\"]*\"/pool_signature = \"$POOL_SIGNATURE\"/" "$config_file" - fi -done - -# Update the .env file with the selected values +# Determine Bitcoin socket path based on network if [[ "$NETWORK" == "mainnet" ]]; then - echo -e "NETWORK=\nSV2_INTERVAL=$SV2_INTERVAL\nLOG_LEVEL=$LOG_LEVEL" > "$ENV_FILE" + BITCOIN_SOCKET_PATH="/root/.bitcoin/node.sock" else - echo -e "NETWORK=$NETWORK\nSV2_INTERVAL=$SV2_INTERVAL\nLOG_LEVEL=$LOG_LEVEL" > "$ENV_FILE" + BITCOIN_SOCKET_PATH="/root/.bitcoin/${NETWORK}/node.sock" fi +# Create/update the .env file with only the variables used in config templates +{ + echo "# Variables used in config templates" + echo "" + echo "# Pool Settings" + echo "POOL_COINBASE_REWARD_SCRIPT=${COINBASE_REWARD_SCRIPT}" + echo "POOL_SIGNATURE=${POOL_SIGNATURE}" + echo "" + echo "# JDS Settings" + echo "JDS_COINBASE_REWARD_SCRIPT=${COINBASE_REWARD_SCRIPT}" + echo "" + echo "# JDC Settings" + echo "JDC_COINBASE_REWARD_SCRIPT=${COINBASE_REWARD_SCRIPT}" + echo "" + echo "# Translator Proxy Settings" + echo "TPROXY_MIN_INDIVIDUAL_MINER_HASHRATE=${hashrate}" + echo "" + echo "# Docker Compose Environment Variables" + if [[ "$NETWORK" == "mainnet" ]]; then + echo "NETWORK=" + else + echo "NETWORK=${NETWORK}" + fi + echo "LOG_LEVEL=${LOG_LEVEL}" + echo "TP_MIN_INTERVAL=${TP_MIN_INTERVAL}" +} > "$ENV_FILE" + # Ensure SV1 pool configuration uses the correct network format SV1_POOL_ENV="custom-configs/sv1-pool/.env" if [[ -f "$SV1_POOL_ENV" ]]; then @@ -239,14 +334,40 @@ docker compose -f "docker-compose-config-${CONFIG_LOWER}.yaml" up -d # Display final messages echo "" -echo "${underline}Now point your miner(s) to the SV1 setup:${reset} stratum+tcp://:3333 ⛏️" -echo "${underline}And point your miner(s) to the SV2 setup:${reset} stratum+tcp://:34255 ⛏️" +echo "${green}${bold}═══════════════════════════════════════════════════════════════════════════════${reset}" +echo "${green}${bold} ✓ Benchmarking Tool Started Successfully!${reset}" +echo "${green}${bold}═══════════════════════════════════════════════════════════════════════════════${reset}" +echo "" +echo " ${cyan}${bold}Miner Connection Information:${reset}" +echo "" +echo " ${yellow}${underline}Stratum V1 (SV1):${reset}" +echo " ${bold}URL:${reset} ${green}stratum+tcp://:3333${reset}" +echo " ${underline}Username format:${reset} [bitcoin-address].[nickname]" +echo " ${underline}Example:${reset} ${cyan}tb1qa0sm0hxzj0x25rh8gw5xlzwlsfvvyz8u96w3p8.my-miner${reset}" +echo "" +echo " ${magenta}${underline}Stratum V2 (SV2):${reset}" +echo " ${bold}URL:${reset} ${green}stratum+tcp://:34255${reset}" +echo "" +echo " ${cyan}${bold}Example CPU Miner Command:${reset}" +echo " ${white}./minerd -a sha256d -o stratum+tcp://127.0.0.1:3333 \\${reset}" +echo " ${white} -q -D -P -u tb1qa0sm0hxzj0x25rh8gw5xlzwlsfvvyz8u96w3p8.my-miner${reset}" +echo "" +echo "${bg_blue}${white}───────────────────────────────────────────────────────────────────────────────${reset}" +echo "" +echo " ${cyan}${bold}📊 Monitoring Dashboard:${reset}" +echo " ${underline}Grafana:${reset} ${green}http://localhost:3000/d/64nrElFmk/sri-benchmarking-tool${reset}" +echo "" +echo " ${cyan}${bold}📄 Generate Benchmark Report:${reset}" +echo " 1. Open the Grafana dashboard" +echo " 2. Click the ${yellow}${bold}\"Report\"${reset} button in the top right corner" +echo " 3. Wait a few minutes for the PDF to generate" echo "" -echo "🚨 For SV1, you should use the address format [address].[nickname] as the username in your miner setup." -echo "💡 For example, to configure a CPU miner, you can use: ./minerd -a sha256d -o stratum+tcp://127.0.0.1:3333 -q -D -P -u tb1qa0sm0hxzj0x25rh8gw5xlzwlsfvvyz8u96w3p8.sv2-gitgab19" +echo "${bg_blue}${white}───────────────────────────────────────────────────────────────────────────────${reset}" echo "" -echo "📊 You can access the Grafana dashboard at the following link: http://localhost:3000/d/64nrElFmk/sri-benchmarking-tool" +echo " ${cyan}${bold}💡 Tips:${reset}" +echo " ${green}•${reset} Monitor container logs: ${yellow}docker compose -f docker-compose-config-${CONFIG_LOWER}.yaml logs -f${reset}" +echo " ${green}•${reset} Stop the tool: ${yellow}docker compose -f docker-compose-config-${CONFIG_LOWER}.yaml down${reset}" +echo " ${green}•${reset} View running containers: ${yellow}docker compose -f docker-compose-config-${CONFIG_LOWER}.yaml ps${reset}" echo "" -echo "📄 Remember to click on the \"Report\" button placed in the top right corner to download a detailed PDF containing your benchmarks data" -echo "↪️ (it will take some minutes to generate a complete PDF, so please be patient :) )" +echo "${green}═══════════════════════════════════════════════════════════════════════════════${reset}" echo "" diff --git a/sv1-custom-proxy/Cargo.toml b/sv1-custom-proxy/Cargo.toml index cdc0519..60fb5e5 100644 --- a/sv1-custom-proxy/Cargo.toml +++ b/sv1-custom-proxy/Cargo.toml @@ -16,3 +16,4 @@ hyper = { version = "0.14", features = ["full"] } reqwest = { version = "0.11", default-features = false, features = ["json", "rustls-tls"] } hex = "0.4.3" env_logger = "0.11.6" +urlencoding = "2.1" diff --git a/sv1-custom-proxy/Dockerfile b/sv1-custom-proxy/Dockerfile index ddbe13d..0d3d9e3 100644 --- a/sv1-custom-proxy/Dockerfile +++ b/sv1-custom-proxy/Dockerfile @@ -1,11 +1,11 @@ # Build stage -FROM rust:1.82-alpine AS builder +FROM rust:1.83-alpine AS builder WORKDIR /usr/src/sv1-custom-proxy COPY ./sv1-custom-proxy . # Install necessary dependencies for building -RUN apk add musl-dev pkgconfig libressl-dev +RUN apk update && apk add --no-cache musl-dev pkgconf libressl-dev # Build the project in release mode RUN cargo build --release diff --git a/sv1-custom-proxy/src/main.rs b/sv1-custom-proxy/src/main.rs index 1fc7bf0..f574e2a 100644 --- a/sv1-custom-proxy/src/main.rs +++ b/sv1-custom-proxy/src/main.rs @@ -15,6 +15,53 @@ use tokio::net::{TcpListener, TcpStream}; use tokio::time::{sleep, Duration}; use warp::Filter; +async fn fetch_latest_metric_from_sniffer( + sniffer_url: &str, + metric_name: &str, +) -> Result { + let client = reqwest::Client::new(); + log::info!( + "Fetching metric {} from sniffer: {}", + metric_name, + sniffer_url + ); + let response = client + .get(sniffer_url) + .send() + .await + .map_err(|e| e.to_string())?; + let body = response.text().await.map_err(|e| e.to_string())?; + + // Parse Prometheus text format + for line in body.lines() { + // Skip comments and help text + if line.starts_with('#') { + continue; + } + + // Look for the metric line (e.g., "sv2_new_job_timestamp_jdc{id="latest"} 1768319956725") + if line.starts_with(metric_name) { + // Extract the timestamp value (last space-separated token) + if let Some(timestamp_str) = line.split_whitespace().last() { + match timestamp_str.parse::() { + Ok(timestamp) => { + log::info!("Found {} = {} from sniffer", metric_name, timestamp); + return Ok(timestamp); + } + Err(e) => { + log::warn!("Failed to parse timestamp from {}: {}", line, e); + } + } + } + } + } + + Err(format!( + "Metric {} not found in sniffer response", + metric_name + )) +} + #[allow(clippy::too_many_arguments)] async fn transfer( mut inbound: TcpStream, @@ -100,7 +147,7 @@ async fn transfer( .expect("Time went backwards") .as_millis() as f64; - let prometheus_url = "http://10.5.0.21:4567/metrics"; + let prometheus_url = "http://10.5.0.42:4567/metrics"; let client = reqwest::Client::new(); if let Ok(response) = client.get(prometheus_url).send().await { if let Ok(body) = response.text().await { @@ -204,7 +251,7 @@ async fn handle_rpc_request( .duration_since(std::time::UNIX_EPOCH) .expect("Time went backwards") .as_millis() as f64; - let prometheus_url = "http://10.5.0.19:2345/metrics"; + let prometheus_url = "http://10.5.0.41:2345/metrics"; let client = reqwest::Client::new(); if let Ok(response) = client.get(prometheus_url).send().await { if let Ok(body) = response.text().await { @@ -360,6 +407,25 @@ async fn main() -> Result<(), Box> { let server = env::var("SERVER").expect("SERVER environment variable not set"); let prometheus_exporter_address = env::var("PROM_ADDRESS").expect("PROM_ADDRESS environment variable not set"); + // Prometheus address for querying SV2 metrics + // Hardcoded sniffer URLs - Use TP-side sniffers to measure full path from TP to Miner + // Try both and use whichever responds + let sniffer_urls = vec![ + "http://10.5.0.31:5678/metrics", // config-a: sv2-tp-jdc-sniffer (TP → JDC) + "http://10.5.0.30:5677/metrics", // config-c: sv2-tp-pool-sniffer (TP → Pool) + ]; + let mut sniffer_url = String::new(); + for url in &sniffer_urls { + if reqwest::Client::new().get(*url).send().await.is_ok() { + sniffer_url = url.to_string(); + log::info!("Using sniffer URL: {}", sniffer_url); + break; + } + } + if sniffer_url.is_empty() { + log::warn!("No sniffer URL responded, defaulting to config-a"); + sniffer_url = sniffer_urls[0].to_string(); + } tokio::spawn(async move { let metrics_route = warp::path("metrics").map(move || { @@ -512,17 +578,18 @@ async fn main() -> Result<(), Box> { register_gauge!("new_job_pool_new_template", "new job pool new template").unwrap(), ); - let listener = tokio::net::TcpListener::bind("0.0.0.0:34255") - .await - .unwrap(); - log::info!("SV2 proxy translation proxy started at 34255"); + let server_address: SocketAddr = server.parse().expect("Invalid server address"); + let listener = tokio::net::TcpListener::bind(server_address).await.unwrap(); + log::info!("SV2 proxy translation proxy started at {}", server_address); + let translator_address = client.clone(); loop { let (inbound, _) = listener.accept().await.unwrap(); - let outbound = TcpStream::connect("10.5.0.7:34256").await.unwrap(); + let outbound = TcpStream::connect(&translator_address).await.unwrap(); let new_job_jdc = new_job_prev_hash_throught_sv2_jdc.clone(); let new_job_pool = new_job_prev_hash_through_sv2_pool.clone(); let new_job_time_sv2_jdc = new_job_time_sv2_jdc.clone(); let new_job_time_sv2_pool = new_job_time_sv2_pool.clone(); + let sniffer_url_clone = sniffer_url.clone(); tokio::spawn(async move { if let Err(e) = transfer_new_job( inbound, @@ -531,6 +598,7 @@ async fn main() -> Result<(), Box> { new_job_pool, new_job_time_sv2_jdc, new_job_time_sv2_pool, + &sniffer_url_clone, ) .await { @@ -543,6 +611,7 @@ async fn main() -> Result<(), Box> { Ok(()) } +#[allow(clippy::too_many_arguments)] async fn transfer_new_job( mut inbound: tokio::net::TcpStream, mut outbound: tokio::net::TcpStream, @@ -550,6 +619,7 @@ async fn transfer_new_job( new_job_prev_hash_through_sv2_pool: Arc, new_job_time_sv2_jdc: Arc, new_job_time_sv2_pool: Arc, + sniffer_url: &str, ) -> std::io::Result<()> { let (mut ri, mut wi) = inbound.split(); @@ -602,51 +672,95 @@ async fn transfer_new_job( .as_millis() as f64; if json["method"] == "mining.notify" { if let Some(params) = json["params"].as_array() { - if let Some(_prevhash) = params.get(1) { - let prometheus_url = "http://10.5.0.20:5678/metrics"; - let client = reqwest::Client::new(); - if let Ok(response) = client.get(prometheus_url).send().await { - if let Ok(body) = response.text().await { - for line in body.lines() { - if let Some(start_index) = line.find("prevhash=") { - let start = start_index + "prevhash=\"".len(); - let _end = match line[start..].find('"') { - Some(index) => start + index, - None => { - log::error!("Failed to find end quote for prevhash in line: {}", line); - continue; - } - }; - if let Some((_, timestamp)) = line.rsplit_once(' ') - { - let new_job_timestamp = - timestamp.trim().parse::().unwrap(); - let delta = - current_timestamp - new_job_timestamp; - new_job_prev_hash_throught_sv2_jdc.set(delta); - new_job_prev_hash_through_sv2_pool.set(delta); - } else { - log::warn!("No timestamp value found."); - } - } - if line.contains("id=") { - if let Some((_, timestamp)) = line.rsplit_once(' ') - { - let new_job_timestamp = - timestamp.trim().parse::().unwrap(); - let delta = - current_timestamp - new_job_timestamp; - new_job_time_sv2_jdc.set(delta); - new_job_time_sv2_pool.set(delta); - } else { - log::warn!("No timestamp value found."); - } - } + let has_prevhash = params.get(1).is_some(); + + // Fetch job_id timestamp directly from sniffer for "new job from Pool/JDC" metric + // Try config-c metric first (pool), then config-a (jdc) + let mut found_timestamp = false; + + // Try sv2_new_job_timestamp_pool (config-c) + match fetch_latest_metric_from_sniffer( + sniffer_url, + "sv2_new_job_timestamp_pool", + ) + .await + { + Ok(new_job_timestamp) => { + let delta = current_timestamp - new_job_timestamp; + new_job_time_sv2_jdc.set(delta); + new_job_time_sv2_pool.set(delta); + log::info!("Computed new_job delta (pool): {} ms", delta); + found_timestamp = true; + } + Err(e) => { + log::debug!("No pool timestamp found: {}", e); + } + } + + // Try sv2_new_job_timestamp_jdc (config-a) if pool metric not found + if !found_timestamp { + log::info!("Querying sniffer for sv2_new_job_timestamp_jdc"); + match fetch_latest_metric_from_sniffer( + sniffer_url, + "sv2_new_job_timestamp_jdc", + ) + .await + { + Ok(new_job_timestamp) => { + let delta = current_timestamp - new_job_timestamp; + new_job_time_sv2_jdc.set(delta); + log::info!("Computed new_job delta (jdc): {} ms (current={}, sniffer={})", delta, current_timestamp, new_job_timestamp); + } + Err(e) => { + log::warn!("No jdc timestamp found in sniffer: {}", e); + } + } + } + + // Fetch prev_hash timestamp directly from sniffer for "after block found" metric + if has_prevhash { + let mut found_timestamp = false; + + // Try sv2_new_job_prev_hash_timestamp_pool (config-c) + match fetch_latest_metric_from_sniffer( + sniffer_url, + "sv2_new_job_prev_hash_timestamp_pool", + ) + .await + { + Ok(new_job_timestamp) => { + let delta = current_timestamp - new_job_timestamp; + new_job_prev_hash_throught_sv2_jdc.set(delta); + new_job_prev_hash_through_sv2_pool.set(delta); + log::info!("Computed prev_hash delta (pool): {} ms", delta); + found_timestamp = true; + } + Err(e) => { + log::debug!("No pool prev_hash timestamp found: {}", e); + } + } + + // Try sv2_new_job_prev_hash_timestamp_jdc (config-a) if pool metric not found + if !found_timestamp { + match fetch_latest_metric_from_sniffer( + sniffer_url, + "sv2_new_job_prev_hash_timestamp_jdc", + ) + .await + { + Ok(new_job_timestamp) => { + let delta = current_timestamp - new_job_timestamp; + new_job_prev_hash_throught_sv2_jdc.set(delta); + log::info!( + "Computed prev_hash delta (jdc): {} ms", + delta + ); + } + Err(e) => { + log::debug!("No jdc prev_hash timestamp found: {}", e); } } } - } else { - log::warn!("Prevhash not found in params"); } } else { log::warn!("Params is not an array"); diff --git a/sv1-public-pool.dockerfile b/sv1-public-pool.dockerfile index 4fb470c..951133a 100644 --- a/sv1-public-pool.dockerfile +++ b/sv1-public-pool.dockerfile @@ -54,4 +54,5 @@ COPY ./pools-latency-calculator/monitor_and_apply_latency.sh /usr/local/bin/moni RUN chmod +x /usr/local/bin/monitor_and_apply_latency.sh # Run the monitoring script in the background and start the main application -CMD ["/bin/sh", "-c", "/usr/local/bin/monitor_and_apply_latency.sh 10.5.0.19 2 & exec /usr/local/bin/node dist/main"] \ No newline at end of file +# Apply latency to traffic going to the sv1-pool-miner proxy (10.5.0.41) +CMD ["/bin/sh", "-c", "/usr/local/bin/monitor_and_apply_latency.sh 10.5.0.41 2 & exec /usr/local/bin/node dist/main"] \ No newline at end of file diff --git a/sv2-custom-proxy/Cargo.toml b/sv2-custom-proxy/Cargo.toml index 7dcbb35..fa6a82d 100644 --- a/sv2-custom-proxy/Cargo.toml +++ b/sv2-custom-proxy/Cargo.toml @@ -1,17 +1,23 @@ [package] name = "sv2-custom-proxy" -version = "0.1.0" +version = "0.2.0" edition = "2021" [dependencies] -demand-easy-sv2 = { version = "=0.6.0" } +# SV2 protocol libraries - using stratum-apps which re-exports everything +stratum-apps = { version = "0.1.0", features = ["network", "config", "with_buffer_pool", "core"] } + +# Async runtime +tokio = { version = "1.36.0", features = ["full", "tracing"] } + +# Metrics prometheus = "0.13" warp = "0.3" -tokio = { version = "1.36.0", features = ["full", "tracing"] } -dotenv = "0.15.0" + +# Utilities +log = "0.4.22" +env_logger = "0.11.6" reqwest = { version = "0.11", default-features = false, features = ["json", "rustls-tls"] } serde_json = "1.0.120" hex = "0.4.3" -log = "0.4.22" -env_logger = "0.11.6" -#serde = { version = "1.0.89", features = ["derive", "alloc"], default-features = false } +dotenv = "0.15.0" diff --git a/sv2-custom-proxy/Dockerfile b/sv2-custom-proxy/Dockerfile index 207a905..e94fcbc 100644 --- a/sv2-custom-proxy/Dockerfile +++ b/sv2-custom-proxy/Dockerfile @@ -1,14 +1,19 @@ # Build stage -FROM rust:1.82-alpine AS builder +FROM rust:1.83-alpine AS builder -WORKDIR /usr/src/sv2-custom-proxy -COPY ./sv2-custom-proxy . +WORKDIR /usr/src +# Create a minimal workspace Cargo.toml for Docker build (only sv2-custom-proxy) +RUN printf '[workspace]\nresolver="2"\nmembers = ["sv2-custom-proxy"]\n' > Cargo.toml +# Copy Cargo.lock if it exists +COPY Cargo.lock* ./ +# Copy the sv2-custom-proxy package +COPY ./sv2-custom-proxy ./sv2-custom-proxy # Install necessary dependencies for building -RUN apk add musl-dev pkgconfig libressl-dev +RUN apk update && apk add --no-cache musl-dev pkgconf libressl-dev -# Build the project in release mode -RUN cargo build --release +# Build the project in release mode from workspace root +RUN cargo build --package sv2-custom-proxy --release # Final stage FROM alpine:latest @@ -21,7 +26,7 @@ RUN apk update && apk add --no-cache \ curl # Copy the binary from the builder stage -COPY --from=builder /usr/src/sv2-custom-proxy/target/release/sv2-custom-proxy /usr/local/bin/sv2-custom-proxy +COPY --from=builder /usr/src/target/release/sv2-custom-proxy /usr/local/bin/sv2-custom-proxy # Set the working directory WORKDIR /usr/local/bin/ diff --git a/sv2-custom-proxy/src/main.rs b/sv2-custom-proxy/src/main.rs index 23e057e..77d90cd 100644 --- a/sv2-custom-proxy/src/main.rs +++ b/sv2-custom-proxy/src/main.rs @@ -1,10 +1,3 @@ -use demand_easy_sv2::const_sv2::{ - MESSAGE_TYPE_NEW_TEMPLATE, MESSAGE_TYPE_SET_NEW_PREV_HASH, MESSAGE_TYPE_SUBMIT_SHARES_ERROR, - MESSAGE_TYPE_SUBMIT_SHARES_EXTENDED, MESSAGE_TYPE_SUBMIT_SHARES_SUCCESS, - MESSAGE_TYPE_SUBMIT_SOLUTION, -}; -use demand_easy_sv2::roles_logic_sv2::parsers::{Mining, PoolMessages, TemplateDistribution}; -use demand_easy_sv2::{ProxyBuilder, Remote}; use prometheus::{ register_counter, register_gauge, register_gauge_vec, Counter, Encoder, Gauge, GaugeVec, TextEncoder, @@ -13,302 +6,47 @@ use reqwest::Client; use serde_json::Value; use std::env; use std::fmt::Write; -use std::net::ToSocketAddrs; -use std::time::SystemTime; -use tokio::net::TcpStream; -use tokio::time::{sleep, Duration}; +use std::net::SocketAddr; +use std::sync::Arc; +use tokio::{ + net::{TcpListener, TcpStream}, + select, + sync::mpsc::channel, + time::{sleep, Duration}, +}; use warp::Filter; -#[tokio::main] -async fn main() { - env_logger::Builder::from_env( - env_logger::Env::default() - .default_filter_or("coinswap=info") - .default_write_style_or("always"), - ) - .is_test(true) - .init(); - let client_address = env::var("CLIENT").expect("CLIENT environment variable not set"); - let server_address = env::var("SERVER").expect("SERVER environment variable not set"); - let proxy_type = env::var("PROXY_TYPE").expect("PROXY_TYPE environment variable not set"); - let prometheus_exporter_address = - env::var("PROM_ADDRESS").expect("PROM_ADDRESS environment variable not set"); - - let mut submitted_shares: Option = None; - let mut valid_shares: Option = None; - let mut stale_shares: Option = None; - let mut share_submission_timestamp: Option = None; - let mut sv2_new_job_prev_hash_timestamp_jdc: Option = None; - let mut sv2_new_job_prev_hash_timestamp_pool: Option = None; - let mut sv2_new_job_timestamp_jdc: Option = None; - let mut sv2_new_job_timestamp_pool: Option = None; - let mut sv2_block_template_value: Option = None; - let mut last_block_mined_value: Option = None; - let mut last_sv2_block_template_value: Option = None; - let mut block_propagation_time_through_sv2_jdc: Option = None; - let mut block_propagation_time_through_sv2_pool: Option = None; - let mut mined_blocks: Option = None; - - // Initialize metrics based on proxy_type - match proxy_type.as_str() { - "tp-jdc" => { - mined_blocks = Some( - register_counter!("sv2_mined_blocks", "Total number of SV2 blocks mined").unwrap(), - ); - block_propagation_time_through_sv2_jdc = Some( - register_gauge!( - "block_propagation_time_through_sv2_jdc", - "Time to submit a block through SV2 JDC in milliseconds" - ) - .unwrap(), - ); - sv2_new_job_prev_hash_timestamp_jdc = Some( - register_gauge_vec!( - "sv2_new_job_prev_hash_timestamp_jdc", - "Time taken for mining device to get notification of new prev hash via config a", - &["prevhash"] - ).unwrap() - ); - sv2_new_job_timestamp_jdc = Some( - register_gauge_vec!( - "sv2_new_job_timestamp_jdc", - "Time taken for mining device to get notification of new job via config a", - &["id"] - ) - .unwrap(), - ); - sv2_block_template_value = Some( - register_gauge!( - "sv2_block_template_value", - "Total reward of sats contained in the current SV2 block template" - ) - .unwrap(), - ); - last_block_mined_value = Some( - register_gauge!( - "last_block_mined_value", - "Total reward of sats contained in the last block mined" - ) - .unwrap(), - ); - last_sv2_block_template_value = Some( - register_gauge!( - "last_sv2_template_value", - "Total reward of sats contained in the last SV2 block template" - ) - .unwrap(), - ); - } - "tp-pool" => { - mined_blocks = Some( - register_counter!("sv2_mined_blocks", "Total number of SV2 blocks mined").unwrap(), - ); - block_propagation_time_through_sv2_pool = Some( - register_gauge!( - "block_propagation_time_through_sv2_pool", - "Time to submit a block through SV2 Pool in milliseconds" - ) - .unwrap(), - ); - sv2_new_job_prev_hash_timestamp_pool = Some( - register_gauge_vec!( - "sv2_new_job_prev_hash_timestamp_pool", - "Time taken for mining device to get notification of new prev via config c", - &["prevhash"] - ) - .unwrap(), - ); - sv2_new_job_timestamp_pool = Some( - register_gauge_vec!( - "sv2_new_job_timestamp_pool", - "Time taken for mining device to get notification of new job via config c", - &["id"] - ) - .unwrap(), - ); - sv2_block_template_value = Some( - register_gauge!( - "sv2_block_template_value", - "Total reward of sats contained in the current SV2 block template" - ) - .unwrap(), - ); - last_block_mined_value = Some( - register_gauge!( - "last_block_mined_value", - "Total reward of sats contained in the last block mined" - ) - .unwrap(), - ); - last_sv2_block_template_value = Some( - register_gauge!( - "last_sv2_template_value", - "Total reward of sats contained in the last SV2 block template" - ) - .unwrap(), - ); - } - "pool-translator" | "jdc-translator" => { - submitted_shares = Some( - register_counter!( - "sv2_submitted_shares", - "Total number of SV2 submitted shares" - ) - .unwrap(), - ); - valid_shares = Some( - register_counter!("sv2_valid_shares", "Total number of SV2 valid shares").unwrap(), - ); - stale_shares = Some( - register_counter!("sv2_stale_shares", "Total number of SV2 stale shares").unwrap(), - ); - share_submission_timestamp = Some( - register_gauge_vec!( - "share_submission_timestamp", - "Timestamp of the submitted share", - &["nonce"] - ) - .unwrap(), - ); - } - _ => panic!("Invalid PROXY_TYPE"), - } - - // Spawn the metrics endpoint - tokio::spawn(async move { - let metrics_route = warp::path("metrics").map(move || { - let encoder = TextEncoder::new(); - let metric_families = prometheus::gather(); - let mut buffer = Vec::new(); - encoder.encode(&metric_families, &mut buffer).unwrap(); - warp::http::Response::builder() - .header("Content-Type", encoder.format_type()) - .body(buffer) - }); - let addr: std::net::SocketAddr = prometheus_exporter_address - .parse() - .expect("Invalid address"); - warp::serve(metrics_route).run(addr).await; - }); - - let mut proxy_builder = ProxyBuilder::new(); - proxy_builder - .try_add_client(listen_for_client(&client_address).await) - .await - .unwrap() - .try_add_server(connect_to_server(&server_address).await) - .await - .unwrap(); - - // Handle proxy type specific logic - match proxy_type.as_str() { - "pool-translator" | "jdc-translator" => { - if let (Some(shares), Some(valid), Some(stale), Some(timestamp)) = ( - submitted_shares, - valid_shares, - stale_shares, - share_submission_timestamp, - ) { - intercept_submit_share_extended( - &mut proxy_builder, - shares.clone(), - timestamp.clone(), - ) - .await; - intercept_submit_share_success(&mut proxy_builder, valid.clone()).await; - intercept_submit_share_error(&mut proxy_builder, stale.clone()).await; - } - } - "tp-pool" => { - if let ( - Some(new_job_gauge_vec), - Some(last_block_mined_value), - Some(last_sv2_block_template_value), - ) = ( - sv2_new_job_prev_hash_timestamp_pool, - last_block_mined_value, - last_sv2_block_template_value, - ) { - intercept_prev_hash( - &mut proxy_builder, - new_job_gauge_vec, - last_block_mined_value, - last_sv2_block_template_value, - ) - .await; - } - if let (Some(pool_latency), Some(mined)) = - (block_propagation_time_through_sv2_pool, mined_blocks) - { - intercept_submit_solution(&mut proxy_builder, pool_latency, mined).await; - } - if let (Some(new_job_pool), Some(sv2_block_template_value)) = - (sv2_new_job_timestamp_pool, sv2_block_template_value) - { - intercept_new_template(&mut proxy_builder, new_job_pool, sv2_block_template_value) - .await; - } - } - "tp-jdc" => { - if let ( - Some(new_job_gauge_vec), - Some(last_block_mined_value), - Some(last_sv2_block_template_value), - ) = ( - sv2_new_job_prev_hash_timestamp_jdc, - last_block_mined_value, - last_sv2_block_template_value, - ) { - intercept_prev_hash( - &mut proxy_builder, - new_job_gauge_vec, - last_block_mined_value, - last_sv2_block_template_value, - ) - .await; - } - if let (Some(jdc_latency), Some(mined)) = - (block_propagation_time_through_sv2_jdc, mined_blocks) - { - intercept_submit_solution(&mut proxy_builder, jdc_latency, mined).await; - } - if let (Some(new_job_jdc), Some(sv2_block_template_value)) = - (sv2_new_job_timestamp_jdc, sv2_block_template_value) - { - intercept_new_template(&mut proxy_builder, new_job_jdc, sv2_block_template_value) - .await; - } - } - _ => { - panic!("Invalid PROXY_TYPE"); - } - } - - let proxy = proxy_builder.try_build().unwrap(); - let _ = proxy.start().await; -} - -async fn listen_for_client(client_address: &str) -> TcpStream { - let address = client_address.to_socket_addrs().unwrap().next().unwrap(); - let listener = tokio::net::TcpListener::bind(address).await.unwrap(); - if let Ok((stream, _)) = listener.accept().await { - stream - } else { - panic!() - } -} +// Import from stratum-apps +use stratum_apps::{ + key_utils::{Secp256k1PublicKey, Secp256k1SecretKey}, + network_helpers::noise_stream::NoiseTcpStream, + stratum_core::{ + binary_sv2::Deserialize, + codec_sv2::HandshakeRole, + framing_sv2::framing::Frame, + mining_sv2::{ + NewExtendedMiningJob, SubmitSharesExtended, MESSAGE_TYPE_NEW_EXTENDED_MINING_JOB, + MESSAGE_TYPE_SUBMIT_SHARES_ERROR, MESSAGE_TYPE_SUBMIT_SHARES_EXTENDED, + MESSAGE_TYPE_SUBMIT_SHARES_SUCCESS, + }, + noise_sv2::{Initiator, Responder}, + template_distribution_sv2::{ + NewTemplate, SetNewPrevHash, SubmitSolution, MESSAGE_TYPE_NEW_TEMPLATE, + MESSAGE_TYPE_SET_NEW_PREV_HASH, MESSAGE_TYPE_SUBMIT_SOLUTION, + }, + }, + utils::types::{Message, Sv2Frame}, +}; -async fn connect_to_server(server_address: &str) -> TcpStream { - let address = server_address.to_socket_addrs().unwrap().next().unwrap(); - TcpStream::connect(address).await.unwrap() -} +// Default authority keys (same as in demand-easy-sv2) +const DEFAULT_PUBKEY: &str = "9auqWEzQDVyd2oe1JVGFLMLHZtCo2FFqZwtKA5gd9xbuEu7PH72"; +const DEFAULT_SECKEY: &str = "mkDLTBBRxdBv998612qipDYoTK3YUrqLe8uWw7gu3iXbSrn2n"; -pub fn encode_hex(bytes: &[u8]) -> String { - let hex_string = bytes.iter().fold(String::new(), |mut acc, b| { - write!(&mut acc, "{:02x}", b).unwrap(); +fn encode_hex(bytes: &[u8]) -> String { + bytes.iter().fold(String::new(), |mut acc, b| { + write!(acc, "{:02x}", b).unwrap(); acc - }); - hex_string + }) } fn reverse_hash(hash: &str) -> String { @@ -404,7 +142,7 @@ async fn fetch_metric_from_prometheus( ) -> Result { let client = Client::new(); let url = format!( - "{}/api/v1/query?query={} &time={}", + "{}/api/v1/query?query={}&time={}", prometheus_address, metric_name, timestamp ); let response = client.get(&url).send().await.map_err(|e| e.to_string())?; @@ -425,194 +163,995 @@ async fn fetch_metric_from_prometheus( Ok(value) } -async fn intercept_prev_hash( - builder: &mut ProxyBuilder, - new_prev_hash_timestamp: GaugeVec, - last_block_mined_value: Gauge, - last_sv2_block_template_value: Gauge, -) { - let mut r = builder.add_handler( - demand_easy_sv2::Remote::Server, - MESSAGE_TYPE_SET_NEW_PREV_HASH, - ); +#[tokio::main] +async fn main() { + env_logger::Builder::from_env( + env_logger::Env::default() + .default_filter_or("info") + .default_write_style_or("always"), + ) + .is_test(true) + .init(); + + let client_address = env::var("CLIENT").expect("CLIENT environment variable not set"); + let server_address = env::var("SERVER").expect("SERVER environment variable not set"); + let proxy_type = env::var("PROXY_TYPE").expect("PROXY_TYPE environment variable not set"); + let prometheus_address = + env::var("PROM_ADDRESS").expect("PROM_ADDRESS environment variable not set"); + + log::info!("Starting SV2 transparent proxy"); + log::info!(" Type: {}", proxy_type); + log::info!(" Listen: {}", client_address); + log::info!(" Connect: {}", server_address); + log::info!(" Metrics: {}", prometheus_address); + + // Initialize metrics based on proxy type + let metrics = Arc::new(Metrics::new(&proxy_type)); + + // Start Prometheus exporter + let prom_addr: SocketAddr = prometheus_address + .parse() + .expect("Invalid prometheus address"); tokio::spawn(async move { - while let Some(PoolMessages::TemplateDistribution(TemplateDistribution::SetNewPrevHash( - m, - ))) = r.recv().await - { - let mut id = m.prev_hash; - let d = id.inner_as_mut(); - let prev_hash_hex = encode_hex(d); - let new_prev_hash_timestamp_clone = new_prev_hash_timestamp.clone(); - let last_block_mined_value_clone = last_block_mined_value.clone(); - let last_sv2_block_template_value_clone = last_sv2_block_template_value.clone(); - let current_time = std::time::SystemTime::now() - .duration_since(std::time::UNIX_EPOCH) - .expect("Time went backwards") - .as_millis() as f64; - new_prev_hash_timestamp_clone - .with_label_values(&[&prev_hash_hex]) - .set(current_time); - tokio::spawn(async move { - sleep(Duration::from_secs(1)).await; - // Remove the metric from Prometheus - let _ = new_prev_hash_timestamp_clone.remove_label_values(&[&prev_hash_hex]); - - let now = SystemTime::now() - .duration_since(std::time::UNIX_EPOCH) - .expect("Time went backwards") - .as_secs_f64(); - let timestamp = now - 2.0; - // Fetch the previous template value from Prometheus - let fetch_metric_result = fetch_metric_from_prometheus( - "http://10.5.0.9:9090", - "sv2_block_template_value", - timestamp, - ) - .await; - - // Fetch the last block reward and set last_block_mined_value - if let Ok(reward) = fetch_last_block_reward_with_retries( - &reverse_hash(&prev_hash_hex), - 24, - Duration::from_secs(5), - ) - .await - { - let reward_as_f64 = reward as f64; - last_block_mined_value_clone.set(reward_as_f64); - - // Set the fetched metric value for last_sv2_block_template_value - if let Ok(value) = fetch_metric_result { - last_sv2_block_template_value_clone.set(value); - } else { - log::error!("Error fetching metric"); + let metrics_route = warp::path!("metrics").map(move || { + let encoder = TextEncoder::new(); + let metric_families = prometheus::gather(); + let mut buffer = vec![]; + encoder.encode(&metric_families, &mut buffer).unwrap(); + String::from_utf8(buffer).unwrap() + }); + log::info!("Prometheus exporter listening on http://{}", prom_addr); + warp::serve(metrics_route).run(prom_addr).await; + }); + + // Start background tasks for specific proxy types + if proxy_type == "tp-jdc" || proxy_type == "tp-pool" { + let metrics_clone = metrics.clone(); + tokio::spawn(async move { + fetch_block_template_value(metrics_clone).await; + }); + } + + // Start the proxy server + let listener = TcpListener::bind(&client_address) + .await + .expect("Failed to bind to client address"); + log::info!("Proxy listening on {}", client_address); + + loop { + match listener.accept().await { + Ok((client_stream, client_addr)) => { + log::info!("New client connection from {}", client_addr); + let server_addr = server_address.clone(); + let proxy_type = proxy_type.clone(); + let metrics = metrics.clone(); + + tokio::spawn(async move { + if let Err(e) = + handle_connection(client_stream, &server_addr, &proxy_type, metrics).await + { + log::error!("Connection error: {:?}", e); } - } - }); + }); + } + Err(e) => { + log::error!("Failed to accept connection: {}", e); + } } - }); + } } -async fn intercept_new_template( - builder: &mut ProxyBuilder, - new_job_timestamp: GaugeVec, - sv2_block_template_value: Gauge, -) { - let mut r = builder.add_handler(demand_easy_sv2::Remote::Server, MESSAGE_TYPE_NEW_TEMPLATE); +async fn handle_connection( + client_stream: TcpStream, + server_address: &str, + proxy_type: &str, + metrics: Arc, +) -> Result<(), Box> { + // Connect to upstream server + let server_stream = TcpStream::connect(server_address).await?; + log::info!("Connected to upstream server at {}", server_address); + + // Perform Noise handshakes + // As responder for client (we are the server from client's perspective) + let authority_public_key: Secp256k1PublicKey = DEFAULT_PUBKEY + .parse() + .map_err(|e| format!("Failed to parse pubkey: {:?}", e))?; + let authority_secret_key: Secp256k1SecretKey = DEFAULT_SECKEY + .parse() + .map_err(|e| format!("Failed to parse seckey: {:?}", e))?; + + let responder = Responder::from_authority_kp( + &authority_public_key.into_bytes(), + &authority_secret_key.into_bytes(), + std::time::Duration::from_secs(10000), + ) + .map_err(|e| format!("Failed to create responder: {:?}", e))?; + + let client_noise_stream = + NoiseTcpStream::::new(client_stream, HandshakeRole::Responder(responder)) + .await + .map_err(|e| format!("Client Noise handshake failed: {:?}", e))?; + log::info!("Client Noise handshake completed"); + + // As initiator for server (we are the client from server's perspective) + let initiator = + Initiator::without_pk().map_err(|e| format!("Failed to create initiator: {:?}", e))?; + let server_noise_stream = + NoiseTcpStream::::new(server_stream, HandshakeRole::Initiator(initiator)) + .await + .map_err(|e| format!("Server Noise handshake failed: {:?}", e))?; + log::info!("Server Noise handshake completed"); + + // Split the Noise streams + let (mut client_reader, mut client_writer) = client_noise_stream.into_split(); + let (mut server_reader, mut server_writer) = server_noise_stream.into_split(); + + // Create channels for bidirectional communication + let (client_to_server_tx, mut client_to_server_rx) = channel::(100); + let (server_to_client_tx, mut server_to_client_rx) = channel::(100); + + // Spawn task to read from client and forward to server + let proxy_type_clone = proxy_type.to_string(); + let metrics_clone = metrics.clone(); tokio::spawn(async move { - while let Some(PoolMessages::TemplateDistribution(TemplateDistribution::NewTemplate(m))) = - r.recv().await - { - let id = m.template_id; - let current_time = std::time::SystemTime::now() - .duration_since(std::time::UNIX_EPOCH) - .expect("Time went backwards") - .as_millis() as f64; - let new_job_timestamp_clone = new_job_timestamp.clone(); - new_job_timestamp_clone - .with_label_values(&[&id.to_string()]) - .set(current_time); - tokio::spawn(async move { - sleep(Duration::from_secs(1)).await; - // Remove the metric from Prometheus - let _ = new_job_timestamp_clone.remove_label_values(&[&id.to_string()]); - }); - // Take the coinbase value and set the block template value metric - let sv2_block_template_value_clone = sv2_block_template_value.clone(); - let block_value = m.coinbase_tx_value_remaining; - sv2_block_template_value_clone.set(block_value as f64); + loop { + match client_reader.read_frame().await { + Ok(frame) => { + match frame { + Frame::HandShake(_) => { + log::warn!("Unexpected handshake frame from client"); + break; + } + Frame::Sv2(mut sv2_frame) => { + // Intercept specific message types + if let Some(header) = sv2_frame.get_header() { + let msg_type = header.msg_type(); + + // Parse the frame if it needs payload parsing + if msg_type == MESSAGE_TYPE_SUBMIT_SHARES_EXTENDED + || msg_type == MESSAGE_TYPE_SUBMIT_SOLUTION + { + let payload = sv2_frame.payload().to_vec(); // Clone the payload + intercept_client_message_with_payload( + msg_type, + payload, + &proxy_type_clone, + &metrics_clone, + ) + .await; + } else { + intercept_client_message( + msg_type, + &proxy_type_clone, + &metrics_clone, + ) + .await; + } + } + + // Forward to server + if client_to_server_tx.send(sv2_frame).await.is_err() { + break; + } + } + } + } + Err(e) => { + log::error!("Error reading from client: {:?}", e); + break; + } + } } }); -} -async fn intercept_submit_share_extended( - builder: &mut ProxyBuilder, - submitted_shares: Counter, - gauge: GaugeVec, -) { - let mut r = builder.add_handler(Remote::Client, MESSAGE_TYPE_SUBMIT_SHARES_EXTENDED); + // Spawn task to read from server and forward to client + let proxy_type_clone = proxy_type.to_string(); + let metrics_clone = metrics.clone(); tokio::spawn(async move { - while let Some(PoolMessages::Mining(Mining::SubmitSharesExtended(m))) = r.recv().await { - submitted_shares.inc(); - - let id = m.nonce; - let current_time = std::time::SystemTime::now() - .duration_since(std::time::UNIX_EPOCH) - .expect("Time went backwards") - .as_millis() as f64; - - let gauge_clone = gauge.clone(); - gauge_clone - .with_label_values(&[&id.to_string()]) - .set(current_time); - - tokio::spawn(async move { - sleep(Duration::from_secs(10)).await; - // Remove the metric from Prometheus - let _ = gauge_clone.remove_label_values(&[&id.to_string()]); - }); + loop { + match server_reader.read_frame().await { + Ok(frame) => { + match frame { + Frame::HandShake(_) => { + log::warn!("Unexpected handshake frame from server"); + break; + } + Frame::Sv2(mut sv2_frame) => { + // Intercept specific message types + if let Some(header) = sv2_frame.get_header() { + let msg_type = header.msg_type(); + + // Parse the frame if it needs payload parsing + if msg_type == MESSAGE_TYPE_NEW_TEMPLATE + || msg_type == MESSAGE_TYPE_SET_NEW_PREV_HASH + || msg_type == MESSAGE_TYPE_NEW_EXTENDED_MINING_JOB + { + let payload = sv2_frame.payload().to_vec(); // Clone the payload + intercept_server_message_with_payload( + msg_type, + payload, + &proxy_type_clone, + &metrics_clone, + ) + .await; + } else { + intercept_server_message( + msg_type, + &proxy_type_clone, + &metrics_clone, + ) + .await; + } + } + + // Forward to client + if server_to_client_tx.send(sv2_frame).await.is_err() { + break; + } + } + } + } + Err(e) => { + log::error!("Error reading from server: {:?}", e); + break; + } + } } }); + + // Forward messages between channels and streams + loop { + select! { + Some(sv2_frame) = client_to_server_rx.recv() => { + if let Err(e) = server_writer.write_frame(Frame::Sv2(sv2_frame)).await { + log::error!("Error writing to server: {:?}", e); + break; + } + } + Some(sv2_frame) = server_to_client_rx.recv() => { + if let Err(e) = client_writer.write_frame(Frame::Sv2(sv2_frame)).await { + log::error!("Error writing to client: {:?}", e); + break; + } + } + else => break, + } + } + + log::info!("Connection closed"); + Ok(()) } -async fn intercept_submit_share_success(builder: &mut ProxyBuilder, valid_shares: Counter) { - let mut r = builder.add_handler(Remote::Server, MESSAGE_TYPE_SUBMIT_SHARES_SUCCESS); - tokio::spawn(async move { - while let Some(PoolMessages::Mining(Mining::SubmitSharesSuccess(_m))) = r.recv().await { - valid_shares.inc(); +async fn intercept_client_message_with_payload( + msg_type: u8, + mut payload: Vec, + proxy_type: &str, + metrics: &Arc, +) { + match msg_type { + MESSAGE_TYPE_SUBMIT_SHARES_EXTENDED => { + log::debug!("Intercepted SubmitSharesExtended from client"); + // Try to parse the message to extract nonce + match SubmitSharesExtended::from_bytes(&mut payload) { + Ok(msg) => { + let nonce = msg.nonce; + log::info!("SubmitSharesExtended: nonce={}", nonce); + + if let Some(counter) = &metrics.submitted_shares { + counter.inc(); + log::info!( + "Metric recorded: sv2_submitted_shares incremented (nonce={})", + nonce + ); + } + + // Track timestamp + if let Some(gauge_vec) = &metrics.share_submission_timestamp { + let current_time = std::time::SystemTime::now() + .duration_since(std::time::UNIX_EPOCH) + .expect("Time went backwards") + .as_millis() as f64; + + let nonce_str = nonce.to_string(); + gauge_vec.with_label_values(&[&nonce_str]).set(current_time); + log::info!("Metric recorded: sv2_share_submission_timestamp set (nonce={}, timestamp={})", nonce, current_time); + + // Schedule cleanup + let gauge_clone = gauge_vec.clone(); + let nonce_clone = nonce_str.clone(); + tokio::spawn(async move { + sleep(Duration::from_secs(10)).await; + let _ = gauge_clone.remove_label_values(&[&nonce_clone]); + }); + } + } + Err(e) => { + log::warn!("Failed to parse SubmitSharesExtended: {:?}", e); + // Still increment counter even if parsing fails + if let Some(counter) = &metrics.submitted_shares { + counter.inc(); + log::info!( + "Metric recorded: sv2_submitted_shares incremented (parsing failed)" + ); + } + } + } } - }); + MESSAGE_TYPE_SUBMIT_SOLUTION => { + log::debug!("Intercepted SubmitSolution from client"); + // Try to parse the message to extract nonce + // Note: This is received by tp-jdc or tp-pool sniffer + // The share submission timestamp should have been recorded by jdc-translator or pool-translator sniffer + match SubmitSolution::from_bytes(&mut payload) { + Ok(msg) => { + let nonce = msg.header_nonce; + log::info!( + "SubmitSolution: header_nonce={}, template_id={}", + nonce, + msg.template_id + ); + + // Calculate block propagation time by looking up share submission timestamp + // First timestamp: recorded by jdc-translator or pool-translator sniffer when share was submitted + // Second timestamp: now (when tp-jdc or tp-pool sniffer receives SubmitSolution) + let current_time = std::time::SystemTime::now() + .duration_since(std::time::UNIX_EPOCH) + .expect("Time went backwards") + .as_millis() as f64; + + // Query Prometheus to find the share submission timestamp for this nonce + // This timestamp was recorded by jdc-translator or pool-translator sniffer + let prometheus_address = "http://10.5.0.50:9090"; + let nonce_str = nonce.to_string(); + let metric_name = + format!("sv2_share_submission_timestamp{{nonce=\"{}\"}}", nonce_str); + log::info!( + "Looking up share submission timestamp for nonce={} from Prometheus", + nonce_str + ); + + // Clone metrics for async task based on proxy type + let block_propagation_jdc = + metrics.block_propagation_time_through_sv2_jdc.clone(); + let block_propagation_pool = + metrics.block_propagation_time_through_sv2_pool.clone(); + let mined_blocks = metrics.mined_blocks.clone(); + let proxy_type_str = proxy_type.to_string(); + + tokio::spawn(async move { + // Try to fetch the share submission timestamp from Prometheus + let now = std::time::SystemTime::now() + .duration_since(std::time::UNIX_EPOCH) + .expect("Time went backwards") + .as_secs_f64(); + + // Try querying for the metric + match fetch_metric_from_prometheus(prometheus_address, &metric_name, now) + .await + { + Ok(share_timestamp) => { + if share_timestamp > 0.0 { + let latency = current_time - share_timestamp; + log::info!( + "Block propagation time calculated: {}ms (nonce={}, share_timestamp={}, block_timestamp={})", + latency, + nonce_str, + share_timestamp, + current_time + ); + + // Set the appropriate metric based on proxy type + match proxy_type_str.as_str() { + "tp-jdc" => { + if let Some(gauge) = &block_propagation_jdc { + gauge.set(latency); + log::info!( + "Metric recorded: block_propagation_time_through_sv2_jdc set (nonce={}, latency={}ms)", + nonce_str, + latency + ); + } + if let Some(counter) = &mined_blocks { + counter.inc(); + log::info!("Metric recorded: sv2_mined_blocks incremented (nonce={})", nonce_str); + } + } + "tp-pool" => { + if let Some(gauge) = &block_propagation_pool { + gauge.set(latency); + log::info!( + "Metric recorded: block_propagation_time_through_sv2_pool set (nonce={}, latency={}ms)", + nonce_str, + latency + ); + } + if let Some(counter) = &mined_blocks { + counter.inc(); + log::info!("Metric recorded: sv2_mined_blocks incremented (nonce={})", nonce_str); + } + } + _ => { + log::warn!( + "Block propagation time metrics not registered for proxy type: {}", + proxy_type_str + ); + } + } + } else { + log::warn!( + "Share submission timestamp not found for nonce={} (metric returned 0)", + nonce_str + ); + } + } + Err(e) => { + log::warn!( + "Failed to fetch share submission timestamp for nonce={}: {}", + nonce_str, + e + ); + } + } + }); + } + Err(e) => { + log::warn!("Failed to parse SubmitSolution: {:?}", e); + } + } + } + _ => { + log::trace!("Client message type with payload: {}", msg_type); + } + } } -async fn intercept_submit_share_error(builder: &mut ProxyBuilder, stale_shares: Counter) { - let mut r = builder.add_handler(Remote::Server, MESSAGE_TYPE_SUBMIT_SHARES_ERROR); - tokio::spawn(async move { - while let Some(PoolMessages::Mining(Mining::SubmitSharesError(m))) = r.recv().await { - log::error!("SubmitSharesError received --> {:?}", m); - stale_shares.inc(); +async fn intercept_client_message(msg_type: u8, _proxy_type: &str, _metrics: &Arc) { + { + log::trace!("Client message type: {}", msg_type); + } +} + +async fn intercept_server_message(msg_type: u8, _proxy_type: &str, metrics: &Arc) { + match msg_type { + MESSAGE_TYPE_SUBMIT_SHARES_SUCCESS => { + log::debug!("Intercepted SubmitSharesSuccess from server"); + // Valid shares are no longer tracked - acceptance rate is computed from submitted - stale } - }); + MESSAGE_TYPE_SUBMIT_SHARES_ERROR => { + log::debug!("Intercepted SubmitSharesError from server"); + if let Some(counter) = &metrics.stale_shares { + counter.inc(); + log::info!("Metric recorded: sv2_stale_shares incremented"); + } + } + _ => { + log::trace!("Server message type: {}", msg_type); + } + } } -async fn intercept_submit_solution( - builder: &mut ProxyBuilder, - block_propagation_time: Gauge, - mined_blocks: Counter, +async fn intercept_server_message_with_payload( + msg_type: u8, + mut payload: Vec, + _proxy_type: &str, + metrics: &Arc, ) { - let mut r = builder.add_handler(Remote::Client, MESSAGE_TYPE_SUBMIT_SOLUTION); + match msg_type { + MESSAGE_TYPE_SET_NEW_PREV_HASH => { + log::debug!("Intercepted SetNewPrevHash from server"); + // Try to parse the message + match SetNewPrevHash::from_bytes(&mut payload) { + Ok(msg) => { + // Extract the prev hash and convert to hex string + let prev_hash_bytes = msg.prev_hash.to_vec(); + let prev_hash_hex = encode_hex(&prev_hash_bytes); + + log::info!("SetNewPrevHash: prev_hash={}", prev_hash_hex); + + // Track prev hash timestamp + let current_time = std::time::SystemTime::now() + .duration_since(std::time::UNIX_EPOCH) + .expect("Time went backwards") + .as_millis() as f64; + + // Clone metrics for async tasks + let last_block_mined_value = metrics.last_block_mined_value.clone(); + let last_sv2_block_template_value = + metrics.last_sv2_block_template_value.clone(); + let hash_clone = prev_hash_hex.clone(); + + if let Some(gauge_vec) = &metrics.sv2_new_job_prev_hash_timestamp_jdc { + // Use fixed label "latest" to keep metric persistent + gauge_vec.with_label_values(&["latest"]).set(current_time); + log::info!("Metric recorded: sv2_new_job_prev_hash_timestamp_jdc set (prev_hash={}, timestamp={})", prev_hash_hex, current_time); + + // Schedule metric cleanup after 5 seconds + let gauge_vec_clone = gauge_vec.clone(); + tokio::spawn(async move { + sleep(Duration::from_secs(5)).await; + let _ = gauge_vec_clone.remove_label_values(&["latest"]); + log::debug!("Cleaned up sv2_new_job_prev_hash_timestamp_jdc metric"); + }); + + // Schedule fetching block reward/template value + let hash_clone = hash_clone.clone(); + let last_block_clone = last_block_mined_value.clone(); + let last_template_clone = last_sv2_block_template_value.clone(); + tokio::spawn(async move { + sleep(Duration::from_secs(1)).await; + + // Fetch the previous template value from Prometheus (2 seconds ago) + let now = std::time::SystemTime::now() + .duration_since(std::time::UNIX_EPOCH) + .expect("Time went backwards") + .as_secs_f64(); + let timestamp = now - 2.0; + let fetch_metric_result = fetch_metric_from_prometheus( + "http://10.5.0.50:9090", + "sv2_block_template_value", + timestamp, + ) + .await; + + // Fetch the last block reward and set last_block_mined_value + if let Ok(reward) = fetch_last_block_reward_with_retries( + &reverse_hash(&hash_clone), + 24, + Duration::from_secs(5), + ) + .await + { + let reward_as_f64 = reward as f64; + if let Some(gauge) = &last_block_clone { + gauge.set(reward_as_f64); + log::info!("Metric recorded: last_block_mined_value set (prev_hash={}, reward={})", hash_clone, reward_as_f64); + } + + // Set the fetched metric value for last_sv2_block_template_value + if let Ok(value) = fetch_metric_result { + if let Some(gauge) = &last_template_clone { + gauge.set(value); + log::info!("Metric recorded: last_sv2_template_value set (prev_hash={}, value={})", hash_clone, value); + } + } else { + log::error!( + "Error fetching previous template value from Prometheus" + ); + } + } + }); + } + if let Some(gauge_vec) = &metrics.sv2_new_job_prev_hash_timestamp_pool { + // Use fixed label "latest" to keep metric persistent + gauge_vec.with_label_values(&["latest"]).set(current_time); + log::info!("Metric recorded: sv2_new_job_prev_hash_timestamp_pool set (prev_hash={}, timestamp={})", prev_hash_hex, current_time); + + // Schedule metric cleanup after 5 seconds + let gauge_vec_clone = gauge_vec.clone(); + tokio::spawn(async move { + sleep(Duration::from_secs(2)).await; + let _ = gauge_vec_clone.remove_label_values(&["latest"]); + log::debug!("Cleaned up sv2_new_job_prev_hash_timestamp_pool metric"); + }); + + // Schedule fetching block reward/template value + let hash_clone = hash_clone.clone(); + let last_block_clone = last_block_mined_value.clone(); + let last_template_clone = last_sv2_block_template_value.clone(); + tokio::spawn(async move { + sleep(Duration::from_secs(1)).await; + + // Fetch the previous template value from Prometheus (2 seconds ago) + let now = std::time::SystemTime::now() + .duration_since(std::time::UNIX_EPOCH) + .expect("Time went backwards") + .as_secs_f64(); + let timestamp = now - 2.0; + let fetch_metric_result = fetch_metric_from_prometheus( + "http://10.5.0.50:9090", + "sv2_block_template_value", + timestamp, + ) + .await; + + // Fetch the last block reward and set last_block_mined_value + if let Ok(reward) = fetch_last_block_reward_with_retries( + &reverse_hash(&hash_clone), + 24, + Duration::from_secs(5), + ) + .await + { + let reward_as_f64 = reward as f64; + if let Some(gauge) = &last_block_clone { + gauge.set(reward_as_f64); + log::info!("Metric recorded: last_block_mined_value set (prev_hash={}, reward={})", hash_clone, reward_as_f64); + } + + // Set the fetched metric value for last_sv2_block_template_value + if let Ok(value) = fetch_metric_result { + if let Some(gauge) = &last_template_clone { + gauge.set(value); + log::info!("Metric recorded: last_sv2_template_value set (prev_hash={}, value={})", hash_clone, value); + } + } else { + log::error!( + "Error fetching previous template value from Prometheus" + ); + } + } + }); + } + } + Err(e) => { + log::warn!("Failed to parse SetNewPrevHash: {:?}", e); + } + } + } + MESSAGE_TYPE_NEW_TEMPLATE => { + log::debug!("Intercepted NewTemplate from server"); + // Try to parse the message to extract coinbase value + match NewTemplate::from_bytes(&mut payload) { + Ok(msg) => { + let template_id = msg.template_id; + let coinbase_value = msg.coinbase_tx_value_remaining; + let is_future = msg.future_template; + log::info!( + "NewTemplate: template_id={}, coinbase_value={}, is_future={}", + template_id, + coinbase_value, + is_future + ); + + // Update the block template value metric + if let Some(gauge) = &metrics.sv2_block_template_value { + gauge.set(coinbase_value as f64); + log::info!("Metric recorded: sv2_block_template_value set (template_id={}, value={})", template_id, coinbase_value); + } + + // Update the last template value metric + if let Some(gauge) = &metrics.last_sv2_block_template_value { + gauge.set(coinbase_value as f64); + log::info!("Metric recorded: last_sv2_template_value set (template_id={}, value={})", template_id, coinbase_value); + } + + // Track new template timestamp for "time to get a new job" metric (non-future templates only) + // This is recorded by tp-jdc and tp-pool proxies + if !is_future { + let current_time = std::time::SystemTime::now() + .duration_since(std::time::UNIX_EPOCH) + .expect("Time went backwards") + .as_millis() as f64; + + if let Some(gauge_vec) = &metrics.sv2_new_job_timestamp_jdc { + // Use a fixed label "latest" instead of template_id to keep metric persistent + gauge_vec.with_label_values(&["latest"]).set(current_time); + log::info!("Metric recorded: sv2_new_job_timestamp_jdc set (template_id={}, timestamp={} ms)", template_id, current_time); + + // Schedule metric cleanup after 2 seconds + let gauge_vec_clone = gauge_vec.clone(); + tokio::spawn(async move { + sleep(Duration::from_secs(2)).await; + let _ = gauge_vec_clone.remove_label_values(&["latest"]); + log::debug!("Cleaned up sv2_new_job_timestamp_jdc metric"); + }); + } + if let Some(gauge_vec) = &metrics.sv2_new_job_timestamp_pool { + // Use a fixed label "latest" instead of template_id to keep metric persistent + gauge_vec.with_label_values(&["latest"]).set(current_time); + log::info!("Metric recorded: sv2_new_job_timestamp_pool set (template_id={}, timestamp={} ms)", template_id, current_time); + + // Schedule metric cleanup after 2 seconds + let gauge_vec_clone = gauge_vec.clone(); + tokio::spawn(async move { + sleep(Duration::from_secs(2)).await; + let _ = gauge_vec_clone.remove_label_values(&["latest"]); + log::debug!("Cleaned up sv2_new_job_timestamp_pool metric"); + }); + } + } + } + Err(e) => { + log::warn!("Failed to parse NewTemplate: {:?}", e); + } + } + } + MESSAGE_TYPE_NEW_EXTENDED_MINING_JOB => { + log::debug!("Intercepted NewExtendedMiningJob from server"); + // Try to parse the message to extract job_id + match NewExtendedMiningJob::from_bytes(&mut payload) { + Ok(msg) => { + let job_id = msg.job_id; + log::info!("NewExtendedMiningJob: job_id={}", job_id); + + // Track new job timestamp - this is when Translator receives the new job from JDC/Pool + let current_time = std::time::SystemTime::now() + .duration_since(std::time::UNIX_EPOCH) + .expect("Time went backwards") + .as_millis() as f64; + + if let Some(gauge_vec) = &metrics.sv2_new_job_timestamp_jdc { + // Use a fixed label "latest" instead of job_id to keep metric persistent + gauge_vec.with_label_values(&["latest"]).set(current_time); + log::info!("Metric recorded: sv2_new_job_timestamp_jdc set (job_id={}, timestamp={} ms)", job_id, current_time); + + // Schedule metric cleanup after 2 seconds + let gauge_vec_clone = gauge_vec.clone(); + tokio::spawn(async move { + sleep(Duration::from_secs(2)).await; + let _ = gauge_vec_clone.remove_label_values(&["latest"]); + log::debug!("Cleaned up sv2_new_job_timestamp_jdc metric"); + }); + } + if let Some(gauge_vec) = &metrics.sv2_new_job_timestamp_pool { + // Use a fixed label "latest" to keep metric persistent (same as jdc) + gauge_vec.with_label_values(&["latest"]).set(current_time); + log::info!("Metric recorded: sv2_new_job_timestamp_pool set (job_id={}, timestamp={} ms)", job_id, current_time); + + // Schedule metric cleanup after 2 seconds + let gauge_vec_clone = gauge_vec.clone(); + tokio::spawn(async move { + sleep(Duration::from_secs(2)).await; + let _ = gauge_vec_clone.remove_label_values(&["latest"]); + log::debug!("Cleaned up sv2_new_job_timestamp_pool metric"); + }); + } + } + Err(e) => { + log::warn!("Failed to parse NewExtendedMiningJob: {:?}", e); + } + } + } + _ => { + log::trace!("Server message type: {}", msg_type); + } + } +} + +struct Metrics { + // Share metrics + submitted_shares: Option, + stale_shares: Option, + share_submission_timestamp: Option, + + // Template metrics + sv2_new_job_prev_hash_timestamp_jdc: Option, + sv2_new_job_prev_hash_timestamp_pool: Option, + sv2_new_job_timestamp_jdc: Option, + sv2_new_job_timestamp_pool: Option, + sv2_block_template_value: Option, + last_block_mined_value: Option, + last_sv2_block_template_value: Option, + + // Block metrics + block_propagation_time_through_sv2_jdc: Option, + block_propagation_time_through_sv2_pool: Option, + mined_blocks: Option, +} + +impl Metrics { + fn new(proxy_type: &str) -> Self { + let mut metrics = Self { + submitted_shares: None, + stale_shares: None, + share_submission_timestamp: None, + sv2_new_job_prev_hash_timestamp_jdc: None, + sv2_new_job_prev_hash_timestamp_pool: None, + sv2_new_job_timestamp_jdc: None, + sv2_new_job_timestamp_pool: None, + sv2_block_template_value: None, + last_block_mined_value: None, + last_sv2_block_template_value: None, + block_propagation_time_through_sv2_jdc: None, + block_propagation_time_through_sv2_pool: None, + mined_blocks: None, + }; + + // Initialize metrics based on proxy type + match proxy_type { + "pool-jdc" => { + // Track shares between JDC and Pool + metrics.submitted_shares = Some( + register_counter!( + "sv2_submitted_shares", + "Total number of SV2 submitted shares" + ) + .unwrap(), + ); + metrics.stale_shares = Some( + register_counter!("sv2_stale_shares", "Total number of SV2 stale shares") + .unwrap(), + ); + metrics.share_submission_timestamp = Some( + register_gauge_vec!( + "sv2_share_submission_timestamp", + "Timestamp of share submission", + &["nonce"] + ) + .unwrap(), + ); + } + "pool-translator" => { + // Proxy between Pool and Translator - tracks shares AND NewExtendedMiningJob + metrics.submitted_shares = Some( + register_counter!( + "sv2_submitted_shares", + "Total number of SV2 submitted shares" + ) + .unwrap(), + ); + metrics.stale_shares = Some( + register_counter!("sv2_stale_shares", "Total number of SV2 stale shares") + .unwrap(), + ); + metrics.share_submission_timestamp = Some( + register_gauge_vec!( + "sv2_share_submission_timestamp", + "Timestamp of share submission", + &["nonce"] + ) + .unwrap(), + ); + metrics.sv2_new_job_timestamp_pool = Some( + register_gauge_vec!( + "sv2_new_job_timestamp_pool", + "Time taken for mining device to get notification of new job via config c", + &["id"] + ) + .unwrap(), + ); + } + "tp-jdc" => { + metrics.mined_blocks = Some( + register_counter!("sv2_mined_blocks", "Total number of SV2 blocks mined") + .unwrap(), + ); + metrics.block_propagation_time_through_sv2_jdc = Some( + register_gauge!( + "block_propagation_time_through_sv2_jdc", + "Time to submit a block through SV2 JDC in milliseconds" + ) + .unwrap(), + ); + metrics.sv2_new_job_prev_hash_timestamp_jdc = Some( + register_gauge_vec!( + "sv2_new_job_prev_hash_timestamp_jdc", + "Time taken for mining device to get notification of new prev hash via config a", + &["prevhash"] + ) + .unwrap(), + ); + metrics.sv2_new_job_timestamp_jdc = Some( + register_gauge_vec!( + "sv2_new_job_timestamp_jdc", + "Time taken for mining device to get notification of new job via config a", + &["id"] + ) + .unwrap(), + ); + metrics.sv2_block_template_value = Some( + register_gauge!( + "sv2_block_template_value", + "Total reward of sats contained in the current SV2 block template" + ) + .unwrap(), + ); + metrics.last_block_mined_value = Some( + register_gauge!( + "last_block_mined_value", + "Total reward of sats contained in the last block mined" + ) + .unwrap(), + ); + metrics.last_sv2_block_template_value = Some( + register_gauge!( + "last_sv2_template_value", + "Total reward of sats contained in the last SV2 block template" + ) + .unwrap(), + ); + } + "tp-pool" => { + metrics.mined_blocks = Some( + register_counter!("sv2_mined_blocks", "Total number of SV2 blocks mined") + .unwrap(), + ); + metrics.block_propagation_time_through_sv2_pool = Some( + register_gauge!( + "block_propagation_time_through_sv2_pool", + "Time to submit a block through SV2 Pool in milliseconds" + ) + .unwrap(), + ); + metrics.sv2_new_job_prev_hash_timestamp_pool = Some( + register_gauge_vec!( + "sv2_new_job_prev_hash_timestamp_pool", + "Time taken for mining device to get notification of new prev hash via config c", + &["prevhash"] + ) + .unwrap(), + ); + metrics.sv2_new_job_timestamp_pool = Some( + register_gauge_vec!( + "sv2_new_job_timestamp_pool", + "Time taken for mining device to get notification of new job via config c", + &["id"] + ) + .unwrap(), + ); + metrics.sv2_block_template_value = Some( + register_gauge!( + "sv2_block_template_value", + "Total reward of sats contained in the current SV2 block template" + ) + .unwrap(), + ); + metrics.last_block_mined_value = Some( + register_gauge!( + "last_block_mined_value", + "Total reward of sats contained in the last block mined" + ) + .unwrap(), + ); + metrics.last_sv2_block_template_value = Some( + register_gauge!( + "last_sv2_template_value", + "Total reward of sats contained in the last SV2 block template" + ) + .unwrap(), + ); + } + "jdc-translator" => { + // Proxy between JDC and Translator - tracks NewExtendedMiningJob only + // Shares are tracked by pool-jdc sniffer instead + metrics.sv2_new_job_timestamp_jdc = Some( + register_gauge_vec!( + "sv2_new_job_timestamp_jdc", + "Time taken for mining device to get notification of new job via config a", + &["id"] + ) + .unwrap(), + ); + } + _ => { + log::warn!("Unknown proxy type: {}", proxy_type); + } + } + + metrics + } +} + +async fn fetch_block_template_value(metrics: Arc) { let client = Client::new(); + let prometheus_url = "http://10.5.0.50:9090"; // Updated IP - tokio::spawn(async move { - while let Some(PoolMessages::TemplateDistribution(TemplateDistribution::SubmitSolution( - m, - ))) = r.recv().await - { - let current_timestamp = std::time::SystemTime::now() - .duration_since(std::time::UNIX_EPOCH) - .expect("Time went backwards") - .as_millis() as f64; - let id = m.header_nonce; - let url = "http://10.5.0.17:3456/metrics".to_string(); - if let Ok(response) = client.get(&url).send().await { - if let Ok(body) = response.text().await { - // Simple parsing to find the metric for the specific nonce - for line in body.lines() { - if line.starts_with("share_submission_timestamp{nonce=\"") - && line.contains(&id.to_string()) - { - let parts: Vec<&str> = line.split_whitespace().collect(); - if let Some(timestamp_str) = parts.get(1) { - if let Ok(previous_timestamp) = timestamp_str.parse::() { - let latency = current_timestamp - previous_timestamp; - block_propagation_time.set(latency); - mined_blocks.inc(); + loop { + sleep(Duration::from_secs(60)).await; + + // Fetch the current block template value + let query = "sv2_block_template_value"; + let url = format!("{}/api/v1/query?query={}", prometheus_url, query); + + match client.get(&url).send().await { + Ok(response) => { + if let Ok(json) = response.json::().await { + if let Some(result) = json["data"]["result"].as_array() { + if let Some(first) = result.first() { + if let Some(value_str) = first["value"][1].as_str() { + if let Ok(value) = value_str.parse::() { + if let Some(gauge) = &metrics.last_sv2_block_template_value { + gauge.set(value); + } } } } } } } + Err(e) => { + log::debug!("Failed to fetch block template value: {}", e); + } } - }); + } } diff --git a/sv2-roles.dockerfile b/sv2-roles.dockerfile deleted file mode 100644 index aa92089..0000000 --- a/sv2-roles.dockerfile +++ /dev/null @@ -1,37 +0,0 @@ -# Build stage -FROM rust:1.75-alpine AS builder - -WORKDIR /usr/src/stratum/ - -# Install git and necessary build dependencies -RUN apk add --no-cache git musl-dev pkgconfig libressl-dev - -# Clone the repository and checkout the main branch -RUN git clone https://github.com/stratum-mining/stratum.git . - -# Build the project in release mode -WORKDIR /usr/src/stratum/roles/ -RUN cargo build --release - -# Final stage -FROM alpine:latest - -# Install necessary runtime dependencies -RUN apk update && apk add --no-cache \ - iproute2 \ - iputils-ping \ - iptables \ - curl - -# Copy only the compiled binaries from the builder stage -COPY --from=builder /usr/src/stratum/roles/target/release/pool_sv2 /usr/local/bin/pool_sv2 -COPY --from=builder /usr/src/stratum/roles/target/release/jd_server /usr/local/bin/jd_server -COPY --from=builder /usr/src/stratum/roles/target/release/jd_client /usr/local/bin/jd_client -COPY --from=builder /usr/src/stratum/roles/target/release/translator_sv2 /usr/local/bin/translator_sv2 - -# Set the working directory -WORKDIR /usr/local/bin/ - -# Copy the script and make it executable -COPY ./pools-latency-calculator/monitor_and_apply_latency.sh /usr/local/bin/monitor_and_apply_latency.sh -RUN chmod +x /usr/local/bin/monitor_and_apply_latency.sh \ No newline at end of file diff --git a/sv2-tp.dockerfile b/sv2-tp.dockerfile new file mode 100644 index 0000000..60fffdd --- /dev/null +++ b/sv2-tp.dockerfile @@ -0,0 +1,44 @@ +# Build stage for sv2-tp (Stratum V2 Template Provider) +FROM debian:bookworm-slim AS builder + +# Install build dependencies as per official docs +RUN apt-get update && apt-get install -y \ + build-essential \ + cmake \ + pkgconf \ + python3 \ + git \ + libboost-dev \ + libcapnp-dev \ + capnproto \ + && rm -rf /var/lib/apt/lists/* + +# Clone and build sv2-tp +WORKDIR /build +RUN git clone https://github.com/stratum-mining/sv2-tp.git +WORKDIR /build/sv2-tp +RUN git checkout v1.0.5 +RUN cmake -B build && \ + cmake --build build -j$(nproc) + +# Runtime stage +FROM debian:bookworm-slim + +# Install minimal runtime dependencies +RUN apt-get update && apt-get install -y \ + libboost-system1.74.0 \ + libboost-filesystem1.74.0 \ + libboost-thread1.74.0 \ + capnproto \ + ca-certificates \ + && rm -rf /var/lib/apt/lists/* + +# Copy built binary +COPY --from=builder /build/sv2-tp/build/bin/sv2-tp /usr/local/bin/sv2-tp + +# Create data directory +RUN mkdir -p /root/.bitcoin + +EXPOSE 8442 + +CMD ["sv2-tp", "-debug=sv2", "-loglevel=sv2:trace"] diff --git a/template-provider.dockerfile b/template-provider.dockerfile deleted file mode 100644 index f89c2e3..0000000 --- a/template-provider.dockerfile +++ /dev/null @@ -1,33 +0,0 @@ -FROM debian:stable-slim as build - -# Install & update base system -RUN apt-get update && apt-get upgrade -y - -# Install necessary tools -RUN apt-get install -y wget tar curl jq - -# Set environment variables for Bitcoin Core version and installation directory -ENV BITCOIN_VERSION=sv2-tp-0.1.9 -ENV BITCOIN_DIR=/bitcoin - -# Create the directory where Bitcoin Core will be installed -RUN mkdir -p $BITCOIN_DIR - -RUN ARCH=$(dpkg --print-architecture) && \ - if [ "$ARCH" = "amd64" ]; then \ - BITCOIN_URL=https://github.com/Sjors/bitcoin/releases/download/$BITCOIN_VERSION/bitcoin-$BITCOIN_VERSION-x86_64-linux-gnu.tar.gz; \ - elif [ "$ARCH" = "arm64" ]; then \ - BITCOIN_URL=https://github.com/Sjors/bitcoin/releases/download/$BITCOIN_VERSION/bitcoin-$BITCOIN_VERSION-aarch64-linux-gnu.tar.gz; \ - else \ - echo "Unsupported architecture"; exit 1; \ - fi && \ - wget $BITCOIN_URL -O /tmp/bitcoin.tar.gz - -# Extract the downloaded tarball -RUN tar -xzvf /tmp/bitcoin.tar.gz -C $BITCOIN_DIR --strip-components=1 - -# Cleanup -RUN rm /tmp/bitcoin.tar.gz - -# Create a volume for blockchain data and configuration files -VOLUME ["/root/.bitcoin"] \ No newline at end of file