diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d7a36b5..127495c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -25,6 +25,7 @@ jobs: toolchain: stable profile: minimal override: true + components: clippy - name: Run Clippy run: cargo clippy --workspace --all-targets -- -D warnings @@ -45,6 +46,7 @@ jobs: toolchain: stable profile: minimal override: true + components: rustfmt - name: Run rustfmt run: cargo fmt -- --check diff --git a/containers-scripts/start-sv2-tp.sh b/containers-scripts/start-sv2-tp.sh new file mode 100755 index 0000000..1ced463 --- /dev/null +++ b/containers-scripts/start-sv2-tp.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +# Start bitcoin-node in the background with IPC binding +/bitcoin/bin/bitcoin-node -chain=testnet4 -ipcbind=unix -server=1 -rpcuser=username -rpcpassword=password -rpcbind=0.0.0.0:18332 -rpcallowip=0.0.0.0/0 & + +# Wait a moment for bitcoin to start +sleep 5 + +# Start sv2-tp in the foreground, connecting to the bitcoin node via IPC +exec /bitcoin/bin/sv2-tp -sv2port="$SV2_PORT" -sv2interval="$SV2_INTERVAL" -sv2feedelta=0 -debug=sv2 -loglevel=sv2:debug -sv2bind=0.0.0.0 -ipcconnect=unix:/root/.bitcoin/testnet4/node.sock \ No newline at end of file diff --git a/custom-configs/sri-roles/bitcoin-tp-miner.conf b/custom-configs/sri-roles/bitcoin-tp-miner.conf index 5f6a591..b7815a4 100644 --- a/custom-configs/sri-roles/bitcoin-tp-miner.conf +++ b/custom-configs/sri-roles/bitcoin-tp-miner.conf @@ -11,6 +11,7 @@ rpcuser=username rpcpassword=password rpcbind=0.0.0.0:18332 rpcallowip=0.0.0.0/0 +ipcbind=unix [testnet4] rpcbind=0.0.0.0:18332 diff --git a/custom-configs/sri-roles/bitcoin-tp-pool.conf b/custom-configs/sri-roles/bitcoin-tp-pool.conf index 5f6a591..b7815a4 100644 --- a/custom-configs/sri-roles/bitcoin-tp-pool.conf +++ b/custom-configs/sri-roles/bitcoin-tp-pool.conf @@ -11,6 +11,7 @@ rpcuser=username rpcpassword=password rpcbind=0.0.0.0:18332 rpcallowip=0.0.0.0/0 +ipcbind=unix [testnet4] rpcbind=0.0.0.0:18332 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 index 61f3a89..2eb9934 100644 --- 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 @@ -13,8 +13,24 @@ 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 +# User identity/username for pool connection +user_identity = "jdc_user" + +# target number of shares per minute applied to every downstream channel +shares_per_minute = 6.0 + +# Share batch size +share_batch_size = 1 + +# Minimum extranonce size for downstream connections +# This controls the minimum size of the extranonce field +# Min value: 2, Max value: 16 +min_extranonce_size = 4 + +# JDC supports two modes: +# "FULLTEMPLATE" - full template mining +# "COINBASEONLY" - coinbase-only mining +mode = "FULLTEMPLATE" # Template Provider config # Local TP (this is pointing to localhost so you must run a TP locally for this configuration to work) @@ -22,37 +38,26 @@ 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" +# string to be added into the Coinbase scriptSig +jdc_signature = "Sv2MinerSignature" # 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 +# 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(tb1q3z6v6ga372pqwej23r0akpx3v6n6xdffglhd72)" # 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" +pool_address = "10.5.0.4" +pool_port = 34254 +jds_address = "10.5.0.5" +jds_port = 34264 # [[upstreams]] # authority_pubkey = "2di19GHYQnAZJmEpoUeP7C3Eg9TCcksHr23rZCC83dvUiZgiDL" 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 index 080d3f7..35509bf 100644 --- 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 @@ -1,19 +1,20 @@ +# 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 -# 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" }, -] +# Version support +max_supported_version = 2 +min_supported_version = 2 + +# 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(tb1q3z6v6ga372pqwej23r0akpx3v6n6xdffglhd72)" # SRI Pool JD config listen_jd_address = "10.5.0.5:34264" @@ -26,3 +27,8 @@ core_rpc_pass = "password" [mempool_update_interval] unit = "secs" value = 1 + +# Additional v1.5.0 compliance settings +[timeout] +unit = "secs" +value = 30 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 index 9e58eb2..7cdd847 100644 --- 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 @@ -6,23 +6,30 @@ 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" }, -] +# Version support +max_supported_version = 2 +min_supported_version = 2 + +# 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(tb1q3z6v6ga372pqwej23r0akpx3v6n6xdffglhd72)" + +# 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 = "Stratum V2 SRI Pool" +pool_signature = "average-benchmark" # 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 +shares_per_minute = 1.0 +share_batch_size = 10 + +# Additional v1.5.0 compliance settings +[timeout] +unit = "secs" +value = 30 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 index 410e0d2..3292e21 100644 --- 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 @@ -3,24 +3,26 @@ # 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_address = "0.0.0.0" 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) +# Extranonce2 size for downstream connections +# This controls the rollable part of the extranonce for downstream miners # Max value for CGminer: 8 # Min value: 2 -min_extranonce2_size = 4 +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 = "translator_user" + +# Aggregate channels: if true, all miners share one upstream channel; if false, each miner gets its own channel +aggregate_channels = false # Difficulty params [downstream_difficulty_config] @@ -28,9 +30,10 @@ min_extranonce2_size = 4 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 +# disable variable difficulty adjustment when using with JDC (JDC handles vardiff) +enable_vardiff = false -[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 +[[upstreams]] +address = "10.5.0.17" +port = 34251 +authority_pubkey = "9auqWEzQDVyd2oe1JVGFLMLHZtCo2FFqZwtKA5gd9xbuEu7PH72" 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 index 19a8598..2fa3141 100644 --- 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 @@ -3,26 +3,33 @@ 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" +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" }, -] +# Version support +max_supported_version = 2 +min_supported_version = 2 + +# 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(tb1q3z6v6ga372pqwej23r0akpx3v6n6xdffglhd72)" + +# 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 = "Stratum V2 SRI Pool" +pool_signature = "average-benchmark" # 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 +shares_per_minute = 1.0 +share_batch_size = 10 + +# Additional v1.5.0 compliance settings +[timeout] +unit = "secs" +value = 30 \ 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 index 516d5fd..1eb2428 100644 --- 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 @@ -22,6 +22,9 @@ min_supported_version = 2 # Min value: 2 min_extranonce2_size = 4 +# Aggregate channels: if true, all miners share one upstream channel; if false, each miner gets its own channel +aggregate_channels = false + # 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) @@ -32,5 +35,3 @@ 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/docker-compose-config-a.yaml b/docker-compose-config-a.yaml index ad134a7..afcccf1 100644 --- a/docker-compose-config-a.yaml +++ b/docker-compose-config-a.yaml @@ -62,7 +62,10 @@ services: 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}"] + entrypoint: ["./scripts/start-sv2-tp.sh"] + environment: + - SV2_PORT=8442 + - SV2_INTERVAL=${SV2_INTERVAL} ports: - "8442:8442" - "18333:48333" @@ -73,9 +76,9 @@ services: - common-template-provider-builder volumes: - bitcoin_pool_side_data:/root/.bitcoin - - shared-mainnet-snapshot-volume:/shared_volume # Shared volume for mainnet snapshot + - 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 + - ./containers-scripts:/scripts restart: unless-stopped networks: sv2-net: @@ -91,7 +94,10 @@ services: 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}"] + entrypoint: ["./scripts/start-sv2-tp.sh"] + environment: + - SV2_PORT=8443 + - SV2_INTERVAL=${SV2_INTERVAL} ports: - "8443:8443" - "28333:18333" @@ -100,7 +106,7 @@ services: - common-template-provider-builder volumes: - bitcoin_miner_side_data:/root/.bitcoin - - shared-mainnet-snapshot-volume:/shared_volume # Shared volume for mainnet snapshot + - shared-mainnet-snapshot-volume:/shared_volume # Shared volume for mainnet snapshot - ./custom-configs/sri-roles/bitcoin-tp-miner.conf:/root/.bitcoin/bitcoin.conf - ./containers-scripts:/scripts restart: unless-stopped @@ -118,7 +124,13 @@ services: labels: logging: "config-a" image: template-provider-builder-image - entrypoint: ["/bin/sh", "-c", "./scripts/update-mainnet-chainstate.sh ${NETWORK} && /bitcoin/bin/bitcoind -${NETWORK}"] + entrypoint: + [ + "/bitcoin/bin/bitcoind", + "-${NETWORK}", + "-rpcbind=0.0.0.0", + "-rpcallowip=0.0.0.0/0", + ] ports: - "38333:18333" - "28332:18332" @@ -128,7 +140,7 @@ services: - common-template-provider-builder volumes: - bitcoin_sv1_pool_side_data:/root/.bitcoin - - shared-mainnet-snapshot-volume:/shared_volume # Shared volume for mainnet snapshot + - shared-mainnet-snapshot-volume:/shared_volume # Shared volume for mainnet snapshot - ./custom-configs/sri-roles/bitcoin-sv1-node-pool.conf:/root/.bitcoin/bitcoin.conf - ./containers-scripts:/scripts restart: unless-stopped @@ -148,14 +160,19 @@ services: image: sv2-roles-builder-image 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"] + 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", + ] ports: - "34254:34254" environment: - RUST_LOG=${LOG_LEVEL} container_name: sv2-pool depends_on: - template-provider-pool-side: + template-provider-pool-side: condition: service_healthy restart: true sv2-roles-builder: @@ -185,7 +202,7 @@ services: - RUST_LOG=${LOG_LEVEL} container_name: sv2-jds depends_on: - template-provider-pool-side: + template-provider-pool-side: condition: service_healthy restart: true sv2-roles-builder: @@ -292,7 +309,7 @@ services: - RUST_LOG=${LOG_LEVEL} container_name: sv2-tp-jdc-proxy depends_on: - template-provider-miner-side: + template-provider-miner-side: condition: service_healthy restart: true sv2-custom-proxy-builder: @@ -398,7 +415,7 @@ services: - RUST_LOG=${LOG_LEVEL} container_name: sv1-node-pool-proxy depends_on: - sv1-custom-proxy-builder: + sv1-custom-proxy-builder: condition: service_started sv1-node-pool-side: condition: service_healthy @@ -415,7 +432,7 @@ services: platform: linux/amd64 environment: - "NTM_INTERFACE=any" - - "NTM_FILTERS=" + - "NTM_FILTERS=" prometheus: image: prom/prometheus:v2.36.2 @@ -558,19 +575,19 @@ services: ipv4_address: 10.5.0.18 loki: - image: grafana/loki:2.9.8 - container_name: loki - ports: - - "3100:3100" - restart: unless-stopped - networks: - sv2-net: - ipv4_address: 10.5.0.30 - aliases: - - loki - volumes: - - ./loki-config.yaml:/etc/loki/loki-config.yaml - command: -config.file=/etc/loki/loki-config.yaml + image: grafana/loki:2.9.8 + container_name: loki + ports: + - "3100:3100" + restart: unless-stopped + networks: + sv2-net: + ipv4_address: 10.5.0.30 + aliases: + - loki + volumes: + - ./loki-config.yaml:/etc/loki/loki-config.yaml + command: -config.file=/etc/loki/loki-config.yaml promtail: image: grafana/promtail @@ -589,7 +606,6 @@ services: aliases: - promtail - log-server: image: log-server-builder-image command: ["./log-server"] @@ -606,4 +622,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.32 diff --git a/docker-compose-config-c.yaml b/docker-compose-config-c.yaml index 059b113..da5c28d 100644 --- a/docker-compose-config-c.yaml +++ b/docker-compose-config-c.yaml @@ -61,7 +61,10 @@ services: 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}"] + entrypoint: ["./scripts/start-sv2-tp.sh", "-${NETWORK}"] + environment: + - SV2_PORT=8442 + - SV2_INTERVAL=${SV2_INTERVAL} ports: - "8442:8442" - "18333:48333" @@ -90,7 +93,7 @@ services: labels: logging: "config-c" image: template-provider-builder-image - entrypoint: ["/bin/sh", "-c", "./scripts/update-mainnet-chainstate.sh ${NETWORK} && /bitcoin/bin/bitcoind -${NETWORK}"] + entrypoint: ["/bitcoin/bin/bitcoind", "-${NETWORK}"] ports: - "38333:18333" - "28332:18332" 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..cc221ca 100644 --- a/grafana/provisioning/dashboards/config-a/Docker Prometheus Monitoring-1571332751387.json +++ b/grafana/provisioning/dashboards/config-a/Docker Prometheus Monitoring-1571332751387.json @@ -6194,6 +6194,1566 @@ ], "title": "Node Mermory", "type": "timeseries" + }, + { + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 217 + }, + "id": 100, + "title": "JDC Performance Metrics", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "tooltip": false, + "viz": false, + "legend": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Success rate %" + }, + "properties": [ + { + "id": "unit", + "value": "percent" + } + ] + } + ] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 218 + }, + "id": 101, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "jdc_jobs_declared", + "legendFormat": "Jobs declared", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "jdc_jobs_declared_success", + "legendFormat": "Jobs declared successfully", + "range": true, + "refId": "B" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "jdc_jobs_declared_error", + "legendFormat": "Job declaration errors", + "range": true, + "refId": "C" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "(jdc_jobs_declared_success * 100) / jdc_jobs_declared", + "legendFormat": "Success rate %", + "range": true, + "refId": "D" + } + ], + "title": "JDC Job Declaration Performance", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "tooltip": false, + "viz": false, + "legend": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "ms" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 218 + }, + "id": 102, + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "jdc_job_declaration_latency", + "legendFormat": "Job declaration latency (job {{request_id}})", + "range": true, + "refId": "A" + } + ], + "title": "JDC Job Declaration Latency", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "tooltip": false, + "viz": false, + "legend": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 226 + }, + "id": 103, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "jdc_job_tokens_requested", + "legendFormat": "Tokens requested", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "jdc_job_tokens_allocated", + "legendFormat": "Tokens allocated", + "range": true, + "refId": "B" + } + ], + "title": "JDC Token Allocation", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "tooltip": false, + "viz": false, + "legend": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 226 + }, + "id": 104, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "jdc_missing_transactions_provided", + "legendFormat": "Missing transactions provided", + "range": true, + "refId": "A" + } + ], + "title": "JDC Missing Transactions (Full Template Mode)", + "type": "timeseries" + }, + { + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 234 + }, + "id": 105, + "title": "Mining Job Distribution", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "tooltip": false, + "viz": false, + "legend": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 235 + }, + "id": 106, + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "rate(mining_jobs_received[1m])", + "legendFormat": "Standard jobs per second", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "rate(extended_mining_jobs_received[1m])", + "legendFormat": "Extended jobs per second", + "range": true, + "refId": "B" + } + ], + "title": "Job Arrival Rate", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "tooltip": false, + "viz": false, + "legend": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "ms" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 235 + }, + "id": 107, + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "mining_job_latency", + "legendFormat": "Job latency (job {{job_id}})", + "range": true, + "refId": "A" + } + ], + "title": "Mining Job Distribution Latency", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "tooltip": false, + "viz": false, + "legend": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 243 + }, + "id": 108, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "rate(sv2_submitted_shares[5m])", + "legendFormat": "Extended shares/sec", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "rate(sv2_standard_shares_submitted[5m])", + "legendFormat": "Standard shares/sec", + "range": true, + "refId": "B" + } + ], + "title": "Share Type Distribution", + "type": "timeseries" + }, + { + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 251 + }, + "id": 109, + "title": "Channel Management", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "tooltip": false, + "viz": false, + "legend": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Channel closure rate" + }, + "properties": [ + { + "id": "unit", + "value": "cps" + } + ] + } + ] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 252 + }, + "id": 110, + "options": { + "legend": { + "calcs": [ + "lastNotNull" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "channels_opened", + "legendFormat": "Channels opened", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "channels_closed", + "legendFormat": "Channels closed", + "range": true, + "refId": "B" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "rate(channels_closed[5m])", + "legendFormat": "Channel closure rate", + "range": true, + "refId": "C" + } + ], + "title": "Channel Lifecycle", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "tooltip": false, + "viz": false, + "legend": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "ms" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 252 + }, + "id": 111, + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "channel_open_latency", + "legendFormat": "Channel open latency (channel {{channel_id}})", + "range": true, + "refId": "A" + } + ], + "title": "Channel Open Latency", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "tooltip": false, + "viz": false, + "legend": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 260 + }, + "id": 112, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "channel_updates", + "legendFormat": "Channel updates", + "range": true, + "refId": "A" + } + ], + "title": "Channel Updates (Hashrate Changes)", + "type": "timeseries" + }, + { + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 268 + }, + "id": 113, + "title": "Difficulty Management", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "tooltip": false, + "viz": false, + "legend": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 269 + }, + "id": 114, + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "min", + "max" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "current_target", + "legendFormat": "Current difficulty target", + "range": true, + "refId": "A" + } + ], + "title": "Difficulty Target History", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "tooltip": false, + "viz": false, + "legend": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 269 + }, + "id": 115, + "options": { + "legend": { + "calcs": [ + "lastNotNull" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "target_adjustments", + "legendFormat": "Target adjustments", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "rate(target_adjustments[10m])", + "legendFormat": "Adjustment rate (per 10m)", + "range": true, + "refId": "B" + } + ], + "title": "Target Adjustment Frequency", + "type": "timeseries" + }, + { + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 277 + }, + "id": 116, + "title": "Connection Health", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "tooltip": false, + "viz": false, + "legend": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 278 + }, + "id": 117, + "options": { + "legend": { + "calcs": [ + "lastNotNull" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "connection_errors", + "legendFormat": "Connection errors", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "rate(connection_errors[5m])", + "legendFormat": "Error rate (per 5m)", + "range": true, + "refId": "B" + } + ], + "title": "Connection Errors", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "tooltip": false, + "viz": false, + "legend": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 278 + }, + "id": 118, + "options": { + "legend": { + "calcs": [ + "lastNotNull" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "reconnects", + "legendFormat": "Reconnection events", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "rate(reconnects[5m])", + "legendFormat": "Reconnection rate (per 5m)", + "range": true, + "refId": "B" + } + ], + "title": "Reconnection Events", + "type": "timeseries" } ], "refresh": "5s", @@ -6241,4 +7801,4 @@ "uid": "64nrElFmk", "version": 1, "weekStart": "" -} \ No newline at end of file +} 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..9e9dd46 100644 --- a/grafana/provisioning/dashboards/config-c/Docker Prometheus Monitoring-1571332751387.json +++ b/grafana/provisioning/dashboards/config-c/Docker Prometheus Monitoring-1571332751387.json @@ -6141,6 +6141,1566 @@ ], "title": "Node Mermory", "type": "timeseries" + }, + { + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 217 + }, + "id": 100, + "title": "JDC Performance Metrics", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "tooltip": false, + "viz": false, + "legend": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Success rate %" + }, + "properties": [ + { + "id": "unit", + "value": "percent" + } + ] + } + ] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 218 + }, + "id": 101, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "jdc_jobs_declared", + "legendFormat": "Jobs declared", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "jdc_jobs_declared_success", + "legendFormat": "Jobs declared successfully", + "range": true, + "refId": "B" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "jdc_jobs_declared_error", + "legendFormat": "Job declaration errors", + "range": true, + "refId": "C" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "(jdc_jobs_declared_success * 100) / jdc_jobs_declared", + "legendFormat": "Success rate %", + "range": true, + "refId": "D" + } + ], + "title": "JDC Job Declaration Performance", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "tooltip": false, + "viz": false, + "legend": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "ms" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 218 + }, + "id": 102, + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "jdc_job_declaration_latency", + "legendFormat": "Job declaration latency (job {{request_id}})", + "range": true, + "refId": "A" + } + ], + "title": "JDC Job Declaration Latency", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "tooltip": false, + "viz": false, + "legend": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 226 + }, + "id": 103, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "jdc_job_tokens_requested", + "legendFormat": "Tokens requested", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "jdc_job_tokens_allocated", + "legendFormat": "Tokens allocated", + "range": true, + "refId": "B" + } + ], + "title": "JDC Token Allocation", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "tooltip": false, + "viz": false, + "legend": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 226 + }, + "id": 104, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "jdc_missing_transactions_provided", + "legendFormat": "Missing transactions provided", + "range": true, + "refId": "A" + } + ], + "title": "JDC Missing Transactions (Full Template Mode)", + "type": "timeseries" + }, + { + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 234 + }, + "id": 105, + "title": "Mining Job Distribution", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "tooltip": false, + "viz": false, + "legend": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 235 + }, + "id": 106, + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "rate(mining_jobs_received[1m])", + "legendFormat": "Standard jobs per second", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "rate(extended_mining_jobs_received[1m])", + "legendFormat": "Extended jobs per second", + "range": true, + "refId": "B" + } + ], + "title": "Job Arrival Rate", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "tooltip": false, + "viz": false, + "legend": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "ms" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 235 + }, + "id": 107, + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "mining_job_latency", + "legendFormat": "Job latency (job {{job_id}})", + "range": true, + "refId": "A" + } + ], + "title": "Mining Job Distribution Latency", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "tooltip": false, + "viz": false, + "legend": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 243 + }, + "id": 108, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "rate(sv2_submitted_shares[5m])", + "legendFormat": "Extended shares/sec", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "rate(sv2_standard_shares_submitted[5m])", + "legendFormat": "Standard shares/sec", + "range": true, + "refId": "B" + } + ], + "title": "Share Type Distribution", + "type": "timeseries" + }, + { + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 251 + }, + "id": 109, + "title": "Channel Management", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "tooltip": false, + "viz": false, + "legend": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Channel closure rate" + }, + "properties": [ + { + "id": "unit", + "value": "cps" + } + ] + } + ] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 252 + }, + "id": 110, + "options": { + "legend": { + "calcs": [ + "lastNotNull" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "channels_opened", + "legendFormat": "Channels opened", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "channels_closed", + "legendFormat": "Channels closed", + "range": true, + "refId": "B" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "rate(channels_closed[5m])", + "legendFormat": "Channel closure rate", + "range": true, + "refId": "C" + } + ], + "title": "Channel Lifecycle", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "tooltip": false, + "viz": false, + "legend": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "ms" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 252 + }, + "id": 111, + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "channel_open_latency", + "legendFormat": "Channel open latency (channel {{channel_id}})", + "range": true, + "refId": "A" + } + ], + "title": "Channel Open Latency", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "tooltip": false, + "viz": false, + "legend": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 260 + }, + "id": 112, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "channel_updates", + "legendFormat": "Channel updates", + "range": true, + "refId": "A" + } + ], + "title": "Channel Updates (Hashrate Changes)", + "type": "timeseries" + }, + { + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 268 + }, + "id": 113, + "title": "Difficulty Management", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "tooltip": false, + "viz": false, + "legend": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 269 + }, + "id": 114, + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "min", + "max" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "current_target", + "legendFormat": "Current difficulty target", + "range": true, + "refId": "A" + } + ], + "title": "Difficulty Target History", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "tooltip": false, + "viz": false, + "legend": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 269 + }, + "id": 115, + "options": { + "legend": { + "calcs": [ + "lastNotNull" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "target_adjustments", + "legendFormat": "Target adjustments", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "rate(target_adjustments[10m])", + "legendFormat": "Adjustment rate (per 10m)", + "range": true, + "refId": "B" + } + ], + "title": "Target Adjustment Frequency", + "type": "timeseries" + }, + { + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 277 + }, + "id": 116, + "title": "Connection Health", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "tooltip": false, + "viz": false, + "legend": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 278 + }, + "id": 117, + "options": { + "legend": { + "calcs": [ + "lastNotNull" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "connection_errors", + "legendFormat": "Connection errors", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "rate(connection_errors[5m])", + "legendFormat": "Error rate (per 5m)", + "range": true, + "refId": "B" + } + ], + "title": "Connection Errors", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "tooltip": false, + "viz": false, + "legend": false + }, + "insertNulls": false, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "auto", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 278 + }, + "id": 118, + "options": { + "legend": { + "calcs": [ + "lastNotNull" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "reconnects", + "legendFormat": "Reconnection events", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "rate(reconnects[5m])", + "legendFormat": "Reconnection rate (per 5m)", + "range": true, + "refId": "B" + } + ], + "title": "Reconnection Events", + "type": "timeseries" } ], "refresh": "5s", @@ -6188,4 +7748,4 @@ "uid": "64nrElFmk", "version": 1, "weekStart": "" -} \ No newline at end of file +} diff --git a/prometheus/prometheus.yml b/prometheus/prometheus.yml index a0375b8..5b5e444 100644 --- a/prometheus/prometheus.yml +++ b/prometheus/prometheus.yml @@ -87,21 +87,21 @@ scrape_configs: - targets: ['sv2-tp-jdc-proxy:5678'] # The Network Traffic Metrics IP/port - job_name: 'sv2-pool-translator-proxy' - + # 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-translator:3456'] # The Network Traffic Metrics IP/port - job_name: 'sv2-tp-pool-proxy' - + # 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-side:5678'] # The Network Traffic Metrics IP/port - job_name: 'sv2-translator-miner-proxy' diff --git a/run-benchmarking-tool.sh b/run-benchmarking-tool.sh index 5e66771..5fe6ceb 100755 --- a/run-benchmarking-tool.sh +++ b/run-benchmarking-tool.sh @@ -79,9 +79,10 @@ fi # Prompt user to check if they want to configure the custom public key echo "" -echo -e "🚨 To customize the coinbase transaction output, a custom public key (or redeem script) is required." +echo -e "🚨 To customize the coinbase transaction output, a Bitcoin address or descriptor is required." +echo -e " In SV2 v1.5.0, coinbase outputs use Bitcoin descriptors format." echo "" -read -p "Do you want to configure your custom public key for the coinbase transaction? (yes/no, default is 'no'): " CONFIGURE_KEY +read -p "Do you want to configure your custom address for the coinbase transaction? (yes/no, default is 'no'): " CONFIGURE_KEY CONFIGURE_KEY=${CONFIGURE_KEY:-"no"} # Validate the CONFIGURE_KEY input @@ -93,18 +94,35 @@ 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" + echo -e "You can provide either:" + echo -e " 1. A Bitcoin address (e.g., tb1qa0sm0hxzj0x25rh8gw5xlzwlsfvvyz8u96w3p8)" + echo -e " 2. A Bitcoin descriptor (e.g., wpkh(xpub...))" + echo -e " 3. A public key (will be converted to descriptor format)" echo "" - read -p "Now enter the public key (or redeem script) to use for generating the address in the coinbase transaction: " PUBLIC_KEY - 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." - exit 1 + read -p "Enter your Bitcoin address, descriptor, or public key: " PUBLIC_KEY + + # Check if it's already a descriptor or address + if [[ "$PUBLIC_KEY" =~ ^(addr|wpkh|sh|tr|pk)\( ]]; then + DESCRIPTOR="$PUBLIC_KEY" + elif [[ "$PUBLIC_KEY" =~ ^(tb1|bc1|[13]) ]]; then + # It's an address, wrap it in addr() descriptor + DESCRIPTOR="addr($PUBLIC_KEY)" + else + # It's a public key, ask for script type + echo "" + read -p "Enter the script type for your public key (P2PK, P2PKH, P2SH, P2WSH, P2WPKH, P2TR, default is 'P2WPKH'): " SCRIPT_TYPE + SCRIPT_TYPE=${SCRIPT_TYPE:-$DEFAULT_SCRIPT_TYPE} + + # Convert to descriptor + case "$SCRIPT_TYPE" in + "P2PK") DESCRIPTOR="pk($PUBLIC_KEY)" ;; + "P2PKH") DESCRIPTOR="pkh($PUBLIC_KEY)" ;; + "P2WPKH") DESCRIPTOR="wpkh($PUBLIC_KEY)" ;; + "P2SH") DESCRIPTOR="sh($PUBLIC_KEY)" ;; + "P2WSH") DESCRIPTOR="wsh($PUBLIC_KEY)" ;; + "P2TR") DESCRIPTOR="tr($PUBLIC_KEY)" ;; + *) echo "Invalid script type. Using P2WPKH as default."; DESCRIPTOR="wpkh($PUBLIC_KEY)" ;; + esac fi fi @@ -167,37 +185,37 @@ HASHRATE_CONFIG_FILES=( 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" + sed -i '' "s/min_individual_miner_hashrate[[:space:]]*=[[:space:]]*[0-9_]*\.0/min_individual_miner_hashrate = $hashrate/" "$config_file" + # Remove deprecated channel_nominal_hashrate field (removed in v1.5.0) + sed -i '' "/^[[:space:]]*channel_nominal_hashrate[[:space:]]*=/d" "$config_file" + sed -i '' "/^[[:space:]]*#.*channel_nominal_hashrate/d" "$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" + sed -i "s/min_individual_miner_hashrate[[:space:]]*=[[:space:]]*[0-9_]*\.0/min_individual_miner_hashrate = $hashrate/" "$config_file" + # Remove deprecated channel_nominal_hashrate field (removed in v1.5.0) + sed -i "/^[[:space:]]*channel_nominal_hashrate[[:space:]]*=/d" "$config_file" + sed -i "/^[[:space:]]*#.*channel_nominal_hashrate/d" "$config_file" fi done -# Update JDC and Pool configs for custom public key and script type +# Update JDC and Pool configs for custom address using new v1.5.0 descriptor format 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" + if [[ "$OSTYPE" == "darwin"* ]]; then + sed -i '' "s|coinbase_reward_script = \"[^\"]*\"|coinbase_reward_script = \"$DESCRIPTOR\"|" "$config_file" + else + sed -i "s|coinbase_reward_script = \"[^\"]*\"|coinbase_reward_script = \"$DESCRIPTOR\"|" "$config_file" + fi done fi -# Update pool signature -for config_file in "${CONFIG_FILES[@]}"; do +# Update pool signature (only for pool configs, not JDC/JDS in v1.5.0) +POOL_CONFIG_FILES=( + "custom-configs/sri-roles/config-a/pool-config-a-docker-example.toml" + "custom-configs/sri-roles/config-c/pool-config-c-docker-example.toml" +) + +for config_file in "${POOL_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" @@ -239,8 +257,25 @@ 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://