From 1d731ef48b00912340e0372b4d20e9d54b708fc9 Mon Sep 17 00:00:00 2001 From: Gabriele Vernetti Date: Wed, 25 Sep 2024 19:04:21 +0200 Subject: [PATCH] Shared mainnet snapshot volume + TP version bump to 0.1.9 + adjustments in dashboards --- .../update-mainnet-chainstate.sh | 210 ++++++++++++------ docker-compose-config-a.yaml | 4 + docker-compose-config-c.yaml | 5 + ...r Prometheus Monitoring-1571332751387.json | 128 +++++------ ...r Prometheus Monitoring-1571332751387.json | 117 +++++++--- template-provider.dockerfile | 2 +- 6 files changed, 294 insertions(+), 172 deletions(-) diff --git a/containers-scripts/update-mainnet-chainstate.sh b/containers-scripts/update-mainnet-chainstate.sh index eb3457d..c65d944 100755 --- a/containers-scripts/update-mainnet-chainstate.sh +++ b/containers-scripts/update-mainnet-chainstate.sh @@ -1,88 +1,158 @@ #!/bin/sh +# Input parameter for network (used for future expansion) NETWORK=$1 -TIMESTAMP_FILE="/root/.bitcoin/last_download_timestamp" + +# If NETWORK is not mainnet (""), exit the script +if [ "$NETWORK" != "" ]; then + echo "Script should only run when NETWORK is mainnet. Exiting." + exit 0 +fi + +# Shared volume path for snapshot storage +SNAPSHOT_DIR="/shared_volume" + +# Paths for chainstate directory in each container +CHAINSTATE_DIR="/root/.bitcoin/chainstate" + +# Paths for the timestamp file that marks when the snapshot was last downloaded +TIMESTAMP_FILE="$SNAPSHOT_DIR/last_download_timestamp" + +# Backup URL and interval settings BACKUP_BASE_URL="http://75.119.150.111/backup" DOWNLOAD_INTERVAL_DAYS=1 # 1 day = 24 hours -CHAINSTATE_DIR="/root/.bitcoin/chainstate" -MAX_RETRIES=30 # Number of attempts (1 per minute for 30 minutes) -RETRY_INTERVAL=60 # 60 seconds (1 minute) between attempts -if [ "$NETWORK" = "" ]; then - echo "Checking if mainnet snapshot update is needed..." +# Maximum retries for downloading +MAX_RETRIES=30 +RETRY_INTERVAL=60 # 1 minute retry interval - # Check if the chainstate directory exists - if [ -d "$CHAINSTATE_DIR" ]; then - CHAINSTATE_MOD_TIME=$(stat -c %Y "$CHAINSTATE_DIR") # Last modification time of chainstate directory - CURRENT_TIME=$(date +%s) # Current timestamp - TIME_DIFF=$(( (CURRENT_TIME - CHAINSTATE_MOD_TIME) / 86400 )) # Difference in days +# Check if the local chainstate directory is updated 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 )) - # Check if the chainstate directory was updated more than 24 hours ago - if [ "$TIME_DIFF" -ge "$DOWNLOAD_INTERVAL_DAYS" ]; then - echo "It has been more than $DOWNLOAD_INTERVAL_DAYS day(s) since the last node run. Proceeding with download..." - else - echo "Node has run recently (within $DOWNLOAD_INTERVAL_DAYS day(s)). Skipping download." - exit 0 + # Skip download if chainstate was updated recently + if [ "$TIME_DIFF" -lt "$DOWNLOAD_INTERVAL_DAYS" ]; then + echo "Container chainstate updated recently. Skipping download." + exit 0 fi - else - echo "Chainstate directory $CHAINSTATE_DIR does not exist. This is a new node. Proceeding with download." - fi - - # Get current UTC date and time in the format used by the backup files - CURRENT_UTC=$(date -u +"%Y-%m-%d_%H-UTC") - BACKUP_FILE_NAME="backup_mainnet_blocks_chainstate_$CURRENT_UTC.tar.gz" - BACKUP_URL="$BACKUP_BASE_URL/$BACKUP_FILE_NAME" - BACKUP_HASH_URL="$BACKUP_URL.sha256" - - # Paths for files - BACKUP_FILE="/tmp/$BACKUP_FILE_NAME" - BACKUP_HASH_FILE="/tmp/$BACKUP_FILE_NAME.sha256" - - retry_count=0 - success=0 - - # Retry downloading the backup every minute for up to MAX_RETRIES (30 minutes) - while [ $retry_count -lt $MAX_RETRIES ]; do - echo "Attempt $((retry_count + 1)) of $MAX_RETRIES to download the backup..." - - # Try to download the backup file - if wget $BACKUP_URL -O $BACKUP_FILE && wget $BACKUP_HASH_URL -O $BACKUP_HASH_FILE; then - echo "Download succeeded. Verifying the downloaded snapshot..." - - cd /tmp/ - # Check the hash - if sha256sum -c $BACKUP_HASH_FILE; then - echo "Hash verification succeeded." - success=1 - break - else - echo "Hash verification failed! Retrying..." - rm -f $BACKUP_FILE $BACKUP_HASH_FILE - fi - else - echo "Download failed! Retrying in $RETRY_INTERVAL seconds..." +else + echo "No local chainstate found. Proceeding with snapshot download check." +fi + +# Shared download logic - checking the shared snapshot area +CURRENT_UTC=$(date -u +"%Y-%m-%d_%H-UTC") +BACKUP_FILE_NAME="backup_mainnet_blocks_chainstate_$CURRENT_UTC.tar.gz" +BACKUP_URL="$BACKUP_BASE_URL/$BACKUP_FILE_NAME" +BACKUP_HASH_URL="$BACKUP_URL.sha256" + +BACKUP_FILE="$SNAPSHOT_DIR/$BACKUP_FILE_NAME" +BACKUP_HASH_FILE="$SNAPSHOT_DIR/$BACKUP_FILE_NAME.sha256" + +# Create a lock file to prevent concurrent downloads +LOCK_FILE="$SNAPSHOT_DIR/download.lock" + +# Function to clean up the lock file +cleanup() { + rm -rf "$LOCK_FILE" +} + +# Trap to ensure the lock file is removed on exit +trap cleanup EXIT + +# Check if there is an existing backup file in the shared volume +LATEST_BACKUP_FILE=$(find /shared_volume -maxdepth 1 -name "backup_mainnet_blocks_chainstate_*.tar.gz" -type f -printf "%T@ %p\n" | sort -n | tail -1 | cut -d' ' -f2) + +if [ -f "$TIMESTAMP_FILE" ]; then + TIMESTAMP_MOD_TIME=$(stat -c %Y "$TIMESTAMP_FILE") + TIME_DIFF=$(( (CURRENT_TIME - TIMESTAMP_MOD_TIME) / 86400 )) + + if [ "$TIME_DIFF" -lt "$DOWNLOAD_INTERVAL_DAYS" ]; then + # Check if the latest backup file exists before extraction + if [ -f "$LATEST_BACKUP_FILE" ]; then + echo "Snapshot was downloaded recently. Proceeding to extraction for this container." + tar -xzvf "$LATEST_BACKUP_FILE" -C /root/.bitcoin + echo "Extraction complete." + exit 0 + else + echo "Warning: No backup file found. Unable to proceed with extraction." + exit 1 + fi + fi +fi + +# Acquire the lock before downloading +if mkdir "$LOCK_FILE" 2>/dev/null; then + echo "Lock acquired. Proceeding with snapshot download..." + + # Remove any old backup files in the shared volume + echo "Removing old backup files from the shared volume..." + rm -f "$SNAPSHOT_DIR/backup_mainnet_blocks_chainstate_*.tar.gz" + rm -f "$SNAPSHOT_DIR/backup_mainnet_blocks_chainstate_*.tar.gz.sha256" + + # Retry downloading until successful or until maximum retries are reached + retry_count=0 + success=0 + + while [ $retry_count -lt $MAX_RETRIES ]; do + echo "Attempt $((retry_count + 1)) of $MAX_RETRIES to download the snapshot..." + + if wget "$BACKUP_URL" -O "$BACKUP_FILE" && wget "$BACKUP_HASH_URL" -O "$BACKUP_HASH_FILE"; then + echo "Download succeeded. Verifying the snapshot hash..." + + cd "$SNAPSHOT_DIR" + if sha256sum -c "$BACKUP_HASH_FILE"; then + echo "Hash verification succeeded." + success=1 + break + else + echo "Hash verification failed! Retrying..." + rm -f "$BACKUP_FILE" "$BACKUP_HASH_FILE" + fi + else + echo "Download failed! Retrying in $RETRY_INTERVAL seconds..." + fi + + retry_count=$((retry_count + 1)) + sleep $RETRY_INTERVAL + done + + if [ $success -eq 0 ]; then + echo "Failed to download the snapshot after $MAX_RETRIES attempts. Aborting." + cleanup # Clean up the lock file + exit 1 fi - retry_count=$((retry_count + 1)) - sleep $RETRY_INTERVAL - done + cleanup # Clean up the lock file - if [ $success -eq 0 ]; then - echo "Failed to download the backup after $MAX_RETRIES attempts. Aborting." - exit 1 - fi + # Extract the snapshot to the container's local chainstate directory + echo "Extracting the snapshot to the container's local chainstate..." + tar -xzvf "$BACKUP_FILE" -C /root/.bitcoin - echo "Extracting the snapshot into the bitcoin directory..." + # Update the timestamp file to mark the download time + touch "$TIMESTAMP_FILE" - tar -xzvf $BACKUP_FILE -C /root/.bitcoin + echo "Update and extraction completed successfully." +else + echo "Another container is currently downloading the snapshot. Waiting for it to complete..." - # Remove the downloaded files to save space - rm -f $BACKUP_FILE $BACKUP_HASH_FILE + # Wait for the download to finish and the lock to be released + while [ -d "$LOCK_FILE" ]; do + sleep 5 # Check every 5 seconds + done - # Update the timestamp file to the current time - touch $TIMESTAMP_FILE + # After the download, proceed with extraction + echo "Snapshot downloaded by another container. Checking for backup file..." - echo "Update completed." -else - echo "NETWORK is not set to 'mainnet'. Skipping update." + if [ -f "$BACKUP_HASH_FILE" ]; then + echo "Proceeding to extraction for this container." + tar -xzvf "$BACKUP_FILE" -C /root/.bitcoin + echo "Extraction complete." + else + echo "Expected backup file $BACKUP_FILE does not exist. Unable to proceed with extraction." + exit 1 + fi fi + +cleanup # Clean up the lock file if it was acquired diff --git a/docker-compose-config-a.yaml b/docker-compose-config-a.yaml index a275e59..a393df6 100644 --- a/docker-compose-config-a.yaml +++ b/docker-compose-config-a.yaml @@ -4,6 +4,7 @@ volumes: bitcoin_pool_side_data: bitcoin_miner_side_data: bitcoin_sv1_pool_side_data: + shared-mainnet-snapshot-volume: networks: monitor-net: @@ -72,6 +73,7 @@ services: - common-template-provider-builder 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 restart: unless-stopped @@ -98,6 +100,7 @@ services: - common-template-provider-builder 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 - ./containers-scripts:/scripts restart: unless-stopped @@ -125,6 +128,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 - ./custom-configs/sri-roles/bitcoin-sv1-node-pool.conf:/root/.bitcoin/bitcoin.conf - ./containers-scripts:/scripts restart: unless-stopped diff --git a/docker-compose-config-c.yaml b/docker-compose-config-c.yaml index 375be35..cd1c210 100644 --- a/docker-compose-config-c.yaml +++ b/docker-compose-config-c.yaml @@ -3,6 +3,7 @@ volumes: grafana_data_config_c: bitcoin_pool_side_data: bitcoin_sv1_pool_side_data: + shared-mainnet-snapshot-volume: networks: monitor-net: @@ -71,6 +72,7 @@ services: - common-template-provider-builder 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 restart: unless-stopped @@ -98,12 +100,15 @@ services: - 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 - ./containers-scripts:/scripts restart: unless-stopped networks: sv2-net: ipv4_address: 10.5.0.16 + environment: + - NETWORK=${NETWORK} healthcheck: test: [ "CMD", "./scripts/healthcheck.sh", "http://127.0.0.1:18332" ] interval: 2m 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 29904b0..dad87d8 100644 --- a/grafana/provisioning/dashboards/config-a/Docker Prometheus Monitoring-1571332751387.json +++ b/grafana/provisioning/dashboards/config-a/Docker Prometheus Monitoring-1571332751387.json @@ -76,6 +76,7 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -286,7 +287,7 @@ "textMode": "auto", "wideLayout": true }, - "pluginVersion": "11.1.3", + "pluginVersion": "11.2.0", "targets": [ { "datasource": { @@ -325,6 +326,7 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -535,7 +537,7 @@ "textMode": "auto", "wideLayout": true }, - "pluginVersion": "11.1.3", + "pluginVersion": "11.2.0", "targets": [ { "datasource": { @@ -574,6 +576,7 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -698,6 +701,7 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -822,6 +826,7 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -963,6 +968,7 @@ }, { "datasource": { + "default": true, "type": "prometheus", "uid": "PBFA97CFB590B2093" }, @@ -978,6 +984,7 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -1087,7 +1094,7 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "last_sv2_template_value > 0", + "expr": "last_sv2_template_value", "hide": false, "interval": "", "intervalFactor": 1, @@ -1103,7 +1110,7 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "(last_sv2_template_value > 0 - last_block_mined_value) / last_block_mined_value * 100", + "expr": "(last_sv2_template_value - last_block_mined_value) / last_block_mined_value * 100", "hide": false, "interval": "", "intervalFactor": 1, @@ -1145,6 +1152,7 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -1255,6 +1263,7 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -1366,6 +1375,7 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -1477,6 +1487,7 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -1588,6 +1599,7 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -1699,6 +1711,7 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -1810,6 +1823,7 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -1921,6 +1935,7 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -2099,8 +2114,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -2242,8 +2256,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -2398,8 +2411,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -2522,8 +2534,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -2683,8 +2694,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -2806,8 +2816,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -2955,8 +2964,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -3095,8 +3103,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -3248,8 +3255,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -3385,8 +3391,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -3540,8 +3545,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -3676,8 +3680,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -3825,8 +3828,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -3965,8 +3967,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -4118,8 +4119,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -4250,8 +4250,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -4382,8 +4381,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -4514,8 +4512,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -4672,8 +4669,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -4788,8 +4784,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -4904,8 +4899,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -5020,8 +5014,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -5136,8 +5129,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -5252,8 +5244,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -5368,8 +5359,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -5484,8 +5474,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -5599,8 +5588,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -5678,8 +5666,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -5760,8 +5747,7 @@ "mode": "absolute", "steps": [ { - "color": "rgba(50, 172, 45, 0.97)", - "value": null + "color": "rgba(50, 172, 45, 0.97)" }, { "color": "rgba(237, 129, 40, 0.89)", @@ -5846,8 +5832,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -5927,8 +5912,7 @@ "mode": "absolute", "steps": [ { - "color": "rgba(50, 172, 45, 0.97)", - "value": null + "color": "rgba(50, 172, 45, 0.97)" }, { "color": "rgba(237, 129, 40, 0.89)", @@ -6013,8 +5997,7 @@ "mode": "absolute", "steps": [ { - "color": "rgba(50, 172, 45, 0.97)", - "value": null + "color": "rgba(50, 172, 45, 0.97)" }, { "color": "rgba(237, 129, 40, 0.89)", @@ -6119,8 +6102,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -6226,7 +6208,7 @@ "list": [] }, "time": { - "from": "now-15m", + "from": "now-5m", "to": "now" }, "timepicker": { @@ -6257,6 +6239,6 @@ "timezone": "browser", "title": "SRI benchmarking tool", "uid": "64nrElFmk", - "version": 34, + "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 6b737d5..2abab52 100644 --- a/grafana/provisioning/dashboards/config-c/Docker Prometheus Monitoring-1571332751387.json +++ b/grafana/provisioning/dashboards/config-c/Docker Prometheus Monitoring-1571332751387.json @@ -78,6 +78,7 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -288,7 +289,7 @@ "textMode": "auto", "wideLayout": true }, - "pluginVersion": "11.1.3", + "pluginVersion": "11.2.0", "targets": [ { "datasource": { @@ -327,6 +328,7 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -537,7 +539,7 @@ "textMode": "auto", "wideLayout": true }, - "pluginVersion": "11.1.3", + "pluginVersion": "11.2.0", "targets": [ { "datasource": { @@ -576,6 +578,7 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -686,6 +689,7 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -796,6 +800,7 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -924,6 +929,7 @@ }, { "datasource": { + "default": true, "type": "prometheus", "uid": "PBFA97CFB590B2093" }, @@ -939,6 +945,7 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -1048,7 +1055,7 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "last_sv2_template_value > 0", + "expr": "last_sv2_template_value ", "hide": false, "interval": "", "intervalFactor": 1, @@ -1064,7 +1071,7 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "(last_sv2_template_value > 0 - last_block_mined_value) / last_block_mined_value * 100", + "expr": "(last_sv2_template_value - last_block_mined_value) / last_block_mined_value * 100", "hide": false, "interval": "", "intervalFactor": 1, @@ -1108,6 +1115,7 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -1218,6 +1226,7 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -1329,6 +1338,7 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -1440,6 +1450,7 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -1551,6 +1562,7 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -1662,6 +1674,7 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -1773,6 +1786,7 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -1884,6 +1898,7 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -2027,6 +2042,7 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -2170,6 +2186,7 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -2326,6 +2343,7 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -2450,6 +2468,7 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -2574,6 +2593,7 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -2697,6 +2717,7 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -2820,6 +2841,7 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -2960,6 +2982,7 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -3113,6 +3136,7 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -3254,6 +3278,7 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -3397,6 +3422,7 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -3537,6 +3563,7 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -3677,6 +3704,7 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -3817,6 +3845,7 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -3970,6 +3999,7 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -4102,6 +4132,7 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -4234,6 +4265,7 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -4366,6 +4398,7 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -4524,6 +4557,7 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -4559,7 +4593,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", @@ -4639,6 +4674,7 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -4674,7 +4710,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", @@ -4754,6 +4791,7 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -4789,7 +4827,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", @@ -4869,6 +4908,7 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -4904,7 +4944,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", @@ -4984,6 +5025,7 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -5019,7 +5061,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", @@ -5099,6 +5142,7 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -5134,7 +5178,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", @@ -5214,6 +5259,7 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -5249,7 +5295,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", @@ -5329,6 +5376,7 @@ "axisLabel": "", "axisPlacement": "left", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 10, "gradientMode": "opacity", @@ -5364,7 +5412,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", @@ -5478,7 +5527,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", @@ -5503,6 +5553,7 @@ "graphMode": "none", "justifyMode": "auto", "orientation": "horizontal", + "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" @@ -5514,7 +5565,7 @@ "textMode": "auto", "wideLayout": true }, - "pluginVersion": "11.0.0", + "pluginVersion": "11.2.0", "targets": [ { "datasource": { @@ -5555,7 +5606,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", @@ -5580,6 +5632,7 @@ "graphMode": "none", "justifyMode": "auto", "orientation": "horizontal", + "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" @@ -5591,7 +5644,7 @@ "textMode": "auto", "wideLayout": true }, - "pluginVersion": "11.0.0", + "pluginVersion": "11.2.0", "targets": [ { "datasource": { @@ -5635,7 +5688,8 @@ "mode": "absolute", "steps": [ { - "color": "rgba(50, 172, 45, 0.97)" + "color": "rgba(50, 172, 45, 0.97)", + "value": null }, { "color": "rgba(237, 129, 40, 0.89)", @@ -5674,7 +5728,7 @@ "showThresholdMarkers": true, "sizing": "auto" }, - "pluginVersion": "11.0.0", + "pluginVersion": "11.2.0", "targets": [ { "datasource": { @@ -5720,7 +5774,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", @@ -5745,6 +5800,7 @@ "graphMode": "none", "justifyMode": "auto", "orientation": "horizontal", + "percentChangeColorMode": "standard", "reduceOptions": { "calcs": [ "lastNotNull" @@ -5756,7 +5812,7 @@ "textMode": "auto", "wideLayout": true }, - "pluginVersion": "11.0.0", + "pluginVersion": "11.2.0", "targets": [ { "datasource": { @@ -5799,7 +5855,8 @@ "mode": "absolute", "steps": [ { - "color": "rgba(50, 172, 45, 0.97)" + "color": "rgba(50, 172, 45, 0.97)", + "value": null }, { "color": "rgba(237, 129, 40, 0.89)", @@ -5838,7 +5895,7 @@ "showThresholdMarkers": true, "sizing": "auto" }, - "pluginVersion": "11.0.0", + "pluginVersion": "11.2.0", "targets": [ { "datasource": { @@ -5884,7 +5941,8 @@ "mode": "absolute", "steps": [ { - "color": "rgba(50, 172, 45, 0.97)" + "color": "rgba(50, 172, 45, 0.97)", + "value": null }, { "color": "rgba(237, 129, 40, 0.89)", @@ -5923,7 +5981,7 @@ "showThresholdMarkers": true, "sizing": "auto" }, - "pluginVersion": "11.0.0", + "pluginVersion": "11.2.0", "targets": [ { "datasource": { @@ -5958,6 +6016,7 @@ "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, + "barWidthFactor": 0.6, "drawStyle": "line", "fillOpacity": 30, "gradientMode": "none", @@ -5989,7 +6048,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", @@ -6083,6 +6143,7 @@ "type": "timeseries" } ], + "refresh": "5s", "schemaVersion": 39, "tags": [ "docker", @@ -6094,7 +6155,7 @@ "list": [] }, "time": { - "from": "now-15m", + "from": "now-5m", "to": "now" }, "timepicker": { @@ -6125,6 +6186,6 @@ "timezone": "browser", "title": "SRI benchmarking tool", "uid": "64nrElFmk", - "version": 45, + "version": 1, "weekStart": "" -} +} \ No newline at end of file diff --git a/template-provider.dockerfile b/template-provider.dockerfile index 3bac126..f89c2e3 100644 --- a/template-provider.dockerfile +++ b/template-provider.dockerfile @@ -7,7 +7,7 @@ RUN apt-get update && apt-get upgrade -y 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.3 +ENV BITCOIN_VERSION=sv2-tp-0.1.9 ENV BITCOIN_DIR=/bitcoin # Create the directory where Bitcoin Core will be installed