diff --git a/.editorconfig b/.editorconfig
index 47fde53b690b5b86037ede8cbf0337db8a472d7d..2b40ec32fac3e935b4f85e70bf339224d5e8f8b0 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -14,3 +14,9 @@ indent_style=space
indent_size=2
tab_width=8
end_of_line=lf
+
+[*.sh]
+indent_style=space
+indent_size=2
+tab_width=8
+end_of_line=lf
diff --git a/.github/ISSUE_TEMPLATE/release.md b/.github/ISSUE_TEMPLATE/release.md
new file mode 100644
index 0000000000000000000000000000000000000000..6067dbf12fa70ab43a3065e59e7e68375b721049
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/release.md
@@ -0,0 +1,9 @@
+---
+title: Release failure for {{ ref }}
+---
+
+Pipeline for release {{ ref }} failed. Please investigate.
+
+If the pipeline has failed before pushing to crates.io, delete the release tag
+and fix the release as necessary, retagging after complete. If the pipeline has
+failed after pushing to crates.io, create a new tag incrementing the version.
diff --git a/.github/workflows/check-gitlab-pipeline.yml b/.github/workflows/check-gitlab-pipeline.yml
new file mode 100644
index 0000000000000000000000000000000000000000..c87f17c2f732e447cacf297cfe41e7b266a4bc99
--- /dev/null
+++ b/.github/workflows/check-gitlab-pipeline.yml
@@ -0,0 +1,30 @@
+# A github action to track the status of the gitlab pipeline for tagged
+# releases, and cancel the release/create a new issue if it fails
+
+name: Monitor gitlab pipeline status
+
+on:
+ push:
+ tags:
+ - v*
+ - ci-release-*
+
+jobs:
+ monitor:
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v2
+ - name: Monitor pipeline
+ run: env; ./.maintain/github/check_gitlab_pipeline.sh
+ id: monitor_pipeline
+ env:
+ TAGGER: ${{ github.event.pusher.name }}
+ - name: Create Issue
+ if: failure()
+ uses: JasonEtco/create-an-issue@v2
+ with:
+ filename: .github/ISSUE_TEMPLATE/release.md
+ assignees: ${{ github.event.pusher.name }}
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/trigger-review-pipeline.yml b/.github/workflows/trigger-review-pipeline.yml
new file mode 100644
index 0000000000000000000000000000000000000000..af54ec4358b438b7cd53513c33e661fef833aa94
--- /dev/null
+++ b/.github/workflows/trigger-review-pipeline.yml
@@ -0,0 +1,20 @@
+name: Trigger pipeline for review
+
+on:
+ pull_request:
+ types: [ready_for_review]
+
+jobs:
+ trigger:
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Trigger pipeline
+ run: |
+ curl -X POST \
+ -F token="$TOKEN" \
+ -F ref="$REF" \
+ https://gitlab.parity.io/api/v4/projects/145/trigger/pipeline
+ env:
+ REF: ${{ github.event.number }}
+ TOKEN: ${{ secrets.GITLAB_TRIGGER_TOKEN }}
diff --git a/.gitignore b/.gitignore
index 6398c09fe796278130978c2a8598ee9270399388..353d49df28f34b896567b0aa91bb08e056a5832c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -21,3 +21,4 @@ rls*.log
.local
**/hfuzz_target/
**/hfuzz_workspace/
+.cargo/
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 5af113f64897adf8692b438e330684fc7abb6c19..0944ec8cdefc630854618cc4283d6dfa7a45b192 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -24,6 +24,7 @@
stages:
- test
- build
+ - post-build-test
- publish
- kubernetes
- flaming-fir
@@ -31,7 +32,6 @@ stages:
variables:
GIT_STRATEGY: fetch
GIT_DEPTH: 100
- CARGO_HOME: "/ci-cache/${CI_PROJECT_NAME}/cargo/${CI_JOB_NAME}"
SCCACHE_DIR: "/ci-cache/${CI_PROJECT_NAME}/sccache"
CARGO_INCREMENTAL: 0
CI_SERVER_NAME: "GitLab CI"
@@ -39,7 +39,10 @@ variables:
ARCH: "x86_64"
# FIXME set to release
CARGO_UNLEASH_INSTALL_PARAMS: "--version 1.0.0-alpha.10"
- CARGO_UNLEASH_PKG_DEF: "--skip node node-* pallet-template pallet-example pallet-example-* subkey chain-spec-builder sp-arithmetic-fuzzer"
+ CARGO_UNLEASH_PKG_DEF: "--skip node node-* pallet-template pallet-example pallet-example-* subkey chain-spec-builder"
+ CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_RUNNER: "wasm-bindgen-test-runner"
+ WASM_BINDGEN_TEST_TIMEOUT: 120
+ CHROMEDRIVER_ARGS: "--log-level=INFO --whitelisted-ips=127.0.0.1"
.collect-artifacts: &collect-artifacts
@@ -86,7 +89,16 @@ variables:
- /^pre-v[0-9]+\.[0-9]+-[0-9a-f]+$/
- web
+#### stage: .pre
+skip-if-draft:
+ image: parity/tools:latest
+ <<: *kubernetes-build
+ stage: .pre
+ only:
+ - /^[0-9]+$/ # Pull requests
+ script:
+ - ./.maintain/gitlab/skip_if_draft.sh
#### stage: test
@@ -109,7 +121,7 @@ check-signed-tag:
image: parity/tools:latest
<<: *kubernetes-build
only:
- - tags
+ - /^ci-release-.*$/
- /^v[0-9]+\.[0-9]+\.[0-9]+.*$/
script:
- ./.maintain/gitlab/check_signed.sh
@@ -126,16 +138,14 @@ check-line-width:
interruptible: true
allow_failure: true
-
-check-polkadot:
+check-polkadot-companion-build:
stage: build
<<: *docker-env
script:
- - ./.maintain/gitlab/check_polkadot.sh
+ - ./.maintain/gitlab/check_polkadot_companion_build.sh
interruptible: true
allow_failure: true
-
cargo-audit:
stage: test
<<: *docker-env
@@ -165,9 +175,10 @@ cargo-check-benches:
<<: *docker-env
script:
- BUILD_DUMMY_WASM_BINARY=1 time cargo +nightly check --benches --all
+ - cargo run --release -p node-bench -- ::node::import::native::sr25519::transfer_keep_alive::paritydb::small
+ - cargo run --release -p node-bench -- ::trie::read::small
- sccache -s
-
cargo-check-subkey:
stage: test
<<: *docker-env
@@ -178,29 +189,19 @@ cargo-check-subkey:
- BUILD_DUMMY_WASM_BINARY=1 time cargo check --release
- sccache -s
-
test-linux-stable: &test-linux
stage: test
<<: *docker-env
variables:
# Enable debug assertions since we are running optimized builds for testing
# but still want to have debug assertions.
- RUSTFLAGS: -Cdebug-assertions=y
+ RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings"
except:
variables:
- $DEPLOY_TAG
script:
- - WASM_BUILD_NO_COLOR=1 time cargo test --all --release --verbose --locked |&
- tee output.log
+ - WASM_BUILD_NO_COLOR=1 time cargo test --all --release --verbose --locked
- sccache -s
- after_script:
- - echo "___Collecting warnings for check_warnings job___"
- - awk '/^warning:/,/^$/ { print }' output.log > ${CI_COMMIT_SHORT_SHA}_warnings.log
- artifacts:
- name: $CI_COMMIT_SHORT_SHA
- expire_in: 3 days
- paths:
- - ${CI_COMMIT_SHORT_SHA}_warnings.log
test-dependency-rules:
stage: test
@@ -234,7 +235,7 @@ test-frame-staking:
- $DEPLOY_TAG
script:
- cd frame/staking/
- - WASM_BUILD_NO_COLOR=1 time cargo test --release --verbose --no-default-features --features std
+ - WASM_BUILD_NO_COLOR=1 time cargo test --release --verbose --no-default-features --features "std"
- sccache -s
test-frame-examples-compile-to-wasm:
@@ -284,7 +285,7 @@ test-runtime-benchmarks:
- $DEPLOY_TAG
script:
- cd bin/node/cli
- - BUILD_DUMMY_WASM_BINARY=1 time cargo check --verbose --features runtime-benchmarks
+ - WASM_BUILD_NO_COLOR=1 time cargo test --release --verbose --features runtime-benchmarks
- sccache -s
test-linux-stable-int:
@@ -310,7 +311,6 @@ test-linux-stable-int:
paths:
- ${CI_COMMIT_SHORT_SHA}_int_failure.log
-
check-web-wasm:
stage: test
<<: *docker-env
@@ -322,13 +322,12 @@ check-web-wasm:
- time cargo build --target=wasm32-unknown-unknown -p sp-io
- time cargo build --target=wasm32-unknown-unknown -p sp-runtime
- time cargo build --target=wasm32-unknown-unknown -p sp-std
- - time cargo build --target=wasm32-unknown-unknown -p sc-client
- time cargo build --target=wasm32-unknown-unknown -p sc-consensus-aura
- time cargo build --target=wasm32-unknown-unknown -p sc-consensus-babe
- time cargo build --target=wasm32-unknown-unknown -p sp-consensus
- time cargo build --target=wasm32-unknown-unknown -p sc-telemetry
# Note: the command below is a bit weird because several Cargo issues prevent us from compiling the node in a more straight-forward way.
- - time cargo +nightly build --manifest-path=bin/node/cli/Cargo.toml --no-default-features --features "browser" --target=wasm32-unknown-unknown -Z features=itarget
+ - time cargo +nightly build --manifest-path=bin/node/cli/Cargo.toml --no-default-features --features browser --target=wasm32-unknown-unknown -Z features=itarget
- sccache -s
test-full-crypto-feature:
@@ -349,9 +348,26 @@ test-full-crypto-feature:
- time cargo +nightly build --verbose --no-default-features --features full_crypto
- sccache -s
+cargo-check-macos:
+ stage: test
+ <<: *docker-env
+ script:
+ - BUILD_DUMMY_WASM_BINARY=1 time cargo check --release
+ - sccache -s
+ tags:
+ - osx
#### stage: build
+test-browser-node:
+ stage: build
+ <<: *docker-env
+ needs:
+ - job: check-web-wasm
+ artifacts: false
+ script:
+ - cargo +nightly test --target wasm32-unknown-unknown -p node-browser-testing -Z features=itarget
+
build-linux-substrate: &build-binary
stage: build
<<: *collect-artifacts
@@ -370,7 +386,7 @@ build-linux-substrate: &build-binary
echo "${CI_COMMIT_TAG}" | tee ./artifacts/substrate/VERSION;
else
./artifacts/substrate/substrate --version |
- sed -n -r 's/^substrate ([0-9.]+.*-[0-9a-f]{7,13})-.*$/\1/p' |
+ sed -n -E 's/^substrate ([0-9.]+.*-[0-9a-f]{7,13})-.*$/\1/p' |
tee ./artifacts/substrate/VERSION;
fi
- sha256sum ./artifacts/substrate/substrate | tee ./artifacts/substrate/substrate.sha256
@@ -379,7 +395,8 @@ build-linux-substrate: &build-binary
- cp -r .maintain/docker/substrate.Dockerfile ./artifacts/substrate/
- sccache -s
-build-linux-subkey:
+
+build-linux-subkey: &build-subkey
<<: *build-binary
before_script:
- mkdir -p ./artifacts/subkey
@@ -390,12 +407,20 @@ build-linux-subkey:
- mv ./target/release/subkey ./artifacts/subkey/.
- echo -n "Subkey version = "
- ./artifacts/subkey/subkey --version |
- sed -n -r 's/^subkey ([0-9.]+.*)/\1/p' |
+ sed -n -E 's/^subkey ([0-9.]+.*)/\1/p' |
tee ./artifacts/subkey/VERSION;
- sha256sum ./artifacts/subkey/subkey | tee ./artifacts/subkey/subkey.sha256
- cp -r .maintain/docker/subkey.Dockerfile ./artifacts/subkey/
- sccache -s
+build-macos-subkey:
+ <<: *build-subkey
+ only:
+ - master
+ - /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1
+ tags:
+ - osx
+
build-rust-doc-release:
stage: build
<<: *docker-env
@@ -414,24 +439,14 @@ build-rust-doc-release:
- echo "" > ./crate-docs/index.html
- sccache -s
-check_warnings:
- stage: build
- <<: *docker-env
- except:
- variables:
- - $DEPLOY_TAG
- variables:
- GIT_STRATEGY: none
- needs:
- - job: test-linux-stable
- artifacts: true
+check-polkadot-companion-status:
+ stage: post-build-test
+ image: parity/tools:latest
+ <<: *kubernetes-build
+ only:
+ - /^[0-9]+$/
script:
- - if [ -s ${CI_COMMIT_SHORT_SHA}_warnings.log ]; then
- cat ${CI_COMMIT_SHORT_SHA}_warnings.log;
- exit 1;
- else
- echo "___No warnings___";
- fi
+ - ./.maintain/gitlab/check_polkadot_companion_status.sh
trigger-contracts-ci:
@@ -555,51 +570,11 @@ publish-s3-doc:
- aws s3 ls s3://${BUCKET}/${PREFIX}/
--human-readable --summarize
-
-publish-gh-doc:
- stage: publish
- image: parity/tools:latest
- allow_failure: true
- dependencies:
- - build-rust-doc-release
- cache: {}
- <<: *build-only
- <<: *kubernetes-build
- variables:
- GIT_STRATEGY: none
- GITHUB_API: "https://api.github.com"
- script:
- - test -r ./crate-docs/index.html || (
- echo "./crate-docs/index.html not present, build:rust:doc:release job not complete";
- exit 1
- )
- - test "${GITHUB_USER}" -a "${GITHUB_EMAIL}" -a "${GITHUB_TOKEN}" || (
- echo "environment variables for github insufficient";
- exit 1
- )
- - |
- cat > ${HOME}/.gitconfig <&1 | sed -r "s|(${GITHUB_USER}):[a-f0-9]+@|\1:REDACTED@|g"
- after_script:
- - rm -vrf ${HOME}/.gitconfig
-
publish-draft-release:
stage: publish
image: parity/tools:latest
only:
- - tags
+ - /^ci-release-.*$/
- /^v[0-9]+\.[0-9]+\.[0-9]+.*$/
script:
- ./.maintain/gitlab/publish_draft_release.sh
@@ -610,8 +585,8 @@ publish-to-crates-io:
stage: publish
<<: *docker-env
only:
- - tags
- /^ci-release-.*$/
+ - /^v[0-9]+\.[0-9]+\.[0-9]+.*$/
script:
- cargo install cargo-unleash ${CARGO_UNLEASH_INSTALL_PARAMS}
- cargo unleash em-dragons --no-check ${CARGO_UNLEASH_PKG_DEF}
diff --git a/.maintain/github/check_gitlab_pipeline.sh b/.maintain/github/check_gitlab_pipeline.sh
new file mode 100755
index 0000000000000000000000000000000000000000..4e02dfdb2a428cda4a4a6dc224d69b383693e4ce
--- /dev/null
+++ b/.maintain/github/check_gitlab_pipeline.sh
@@ -0,0 +1,37 @@
+#!/bin/bash
+SUBSTRATE_API_BASEURL="https://gitlab.parity.io/api/v4/projects/145"
+
+TAG_NAME=$(echo "$GITHUB_REF" | sed -E 's_refs/tags/(.*)_\1_')
+PIPELINE_ID=$(curl -s $SUBSTRATE_API_BASEURL/pipelines | jq -r "map(select(.ref==\"$TAG_NAME\")) | .[0] | .id")
+if [ "$PIPELINE_ID" == "null" ]; then
+ echo "[!] Pipeline for $TAG_NAME not found. Exiting."
+ exit 1
+fi
+
+echo "[+] Pipeline path: https://gitlab.parity.io/parity/substrate/pipelines/$PIPELINE_ID"
+
+# 130 minute job max
+for (( c=0; c < 180; c++ )); do
+ out=$(curl -s "$SUBSTRATE_API_BASEURL/pipelines/$PIPELINE_ID" | jq -r .status)
+ case $out in
+ "success")
+ echo "[+] Pipeline $PIPELINE_ID for $TAG_NAME succeeded!"
+ exit 0
+ ;;
+ "failed")
+ echo "[!] Pipeline $PIPELINE_ID for $TAG_NAME failed. Cannot proceed. Check job output on gitlab!"
+ exit 1
+ ;;
+ "cancelled")
+ echo "[!] Pipeline $PIPELINE_ID for $TAG_NAME was cancelled. Cannot proceed!"
+ exit 1
+ ;;
+ "running")
+ echo "[-] Pipeline $PIPELINE_ID for $TAG_NAME still in progress..."
+ esac
+ sleep 60
+done
+# If we reach here, we timed out after 30 minutes
+echo "[!] Pipeline $PIPELINE_ID for $TAG_NAME timed out! Cannot proceed"
+echo "::set-output name=pipeline_status::timedout"
+exit 1
diff --git a/.maintain/gitlab/check_line_width.sh b/.maintain/gitlab/check_line_width.sh
index f382d630b183c6396115cc1e76e77dfab4c20047..85092260b6a649187de6d03c0936cb0d54fc751e 100755
--- a/.maintain/gitlab/check_line_width.sh
+++ b/.maintain/gitlab/check_line_width.sh
@@ -2,47 +2,49 @@
#
# check if line width of rust source files is not beyond x characters
#
+set -e
+set -o pipefail
+BASE_ORIGIN="origin"
+BASE_BRANCH_NAME="master"
+LINE_WIDTH="120"
+GOOD_LINE_WIDTH="100"
+BASE_BRANCH="${BASE_ORIGIN}/${BASE_BRANCH_NAME}"
-BASE_BRANCH="origin/master"
-LINE_WIDTH="121"
-GOOD_LINE_WIDTH="101"
-
-
-git diff --name-only ${BASE_BRANCH}...${CI_COMMIT_SHA} \*.rs | ( while read file
+git fetch ${BASE_ORIGIN} ${BASE_BRANCH_NAME} --depth 1
+git diff --name-only ${BASE_BRANCH} -- \*.rs | ( while read file
do
if [ ! -f ${file} ];
then
echo "Skipping removed file."
- elif git diff ${BASE_BRANCH}...${CI_COMMIT_SHA} ${file} | grep -q "^+.\{${LINE_WIDTH}\}"
+ elif git diff ${BASE_BRANCH} -- ${file} | grep -q "^+.\{$(( $LINE_WIDTH + 1 ))\}"
then
if [ -z "${FAIL}" ]
then
- echo "| warning!"
- echo "| Lines should not be longer than 120 characters."
+ echo "| error!"
+ echo "| Lines must not be longer than ${LINE_WIDTH} characters."
echo "| "
echo "| see more https://wiki.parity.io/Substrate-Style-Guide"
echo "|"
FAIL="true"
fi
echo "| file: ${file}"
- git diff ${BASE_BRANCH}...${CI_COMMIT_SHA} ${file} \
- | grep -n "^+.\{${LINE_WIDTH}\}"
+ git diff ${BASE_BRANCH} -- ${file} \
+ | grep -n "^+.\{$(( $LINE_WIDTH + 1))\}"
echo "|"
else
- if git diff ${BASE_BRANCH}...${CI_COMMIT_SHA} ${file} | grep -q "^+.\{${GOOD_LINE_WIDTH}\}"
+ if git diff ${BASE_BRANCH} -- ${file} | grep -q "^+.\{$(( $GOOD_LINE_WIDTH + 1 ))\}"
then
if [ -z "${FAIL}" ]
then
echo "| warning!"
- echo "| Lines should be longer than 100 characters only in exceptional circumstances!"
+ echo "| Lines should be longer than ${GOOD_LINE_WIDTH} characters only in exceptional circumstances!"
echo "| "
echo "| see more https://wiki.parity.io/Substrate-Style-Guide"
echo "|"
fi
echo "| file: ${file}"
- git diff ${BASE_BRANCH}...${CI_COMMIT_SHA} ${file} \
- | grep -n "^+.\{${LINE_WIDTH}\}"
+ git diff ${BASE_BRANCH} -- ${file} | grep -n "^+.\{$(( $GOOD_LINE_WIDTH + 1 ))\}"
echo "|"
fi
fi
diff --git a/.maintain/gitlab/check_polkadot.sh b/.maintain/gitlab/check_polkadot_companion_build.sh
similarity index 62%
rename from .maintain/gitlab/check_polkadot.sh
rename to .maintain/gitlab/check_polkadot_companion_build.sh
index 0df940ffe2038b308f750539875a392115fde635..281fa8e1e8d4621a253fb4bdf0815a1859564dcb 100755
--- a/.maintain/gitlab/check_polkadot.sh
+++ b/.maintain/gitlab/check_polkadot_companion_build.sh
@@ -12,7 +12,7 @@
github_api_substrate_pull_url="https://api.github.com/repos/paritytech/substrate/pulls"
# use github api v3 in order to access the data without authentication
-github_header="Accept: application/vnd.github.v3+json"
+github_header="Authorization: token ${GITHUB_PR_TOKEN}"
boldprint () { printf "|\n| \033[1m${@}\033[0m\n|\n" ; }
boldcat () { printf "|\n"; while read l; do printf "| \033[1m${l}\033[0m\n"; done; printf "|\n" ; }
@@ -22,59 +22,82 @@ boldcat () { printf "|\n"; while read l; do printf "| \033[1m${l}\033[0m\n"; don
boldcat <<-EOT
-check_polkadot
-==============
+check_polkadot_companion_build
+==============================
this job checks if there is a string in the description of the pr like
polkadot companion: paritytech/polkadot#567
-it will then run cargo check from this polkadot's branch with substrate code
-from this pull request. in absence of that string it will check if a polkadot
-pr is mentioned and will use the last one instead. if none of the above can be
-found it will check the build against polkadot:master.
+it will then run cargo check from this polkadot's branch with substrate code
+from this pull request. in absence of that string it will check if a polkadot
+pr is mentioned and will use the last one instead. if none of the above can be
+found it will check if polkadot has a branch of the exact same name than the
+substrate's branch. if it can't find anything, it will uses master instead
EOT
-
+# Set the user name and email to make merging work
+git config --global user.name 'CI system'
+git config --global user.email '<>'
SUBSTRATE_PATH=$(pwd)
+# Merge master into our branch before building Polkadot to make sure we don't miss
+# any commits that are required by Polkadot.
+git merge origin/master
+
# Clone the current Polkadot master branch into ./polkadot.
git clone --depth 1 https://github.com/paritytech/polkadot.git
cd polkadot
-# either it's a pull request then check for a companion otherwise use
+# either it's a pull request then check for a companion otherwise use
# polkadot:master
if expr match "${CI_COMMIT_REF_NAME}" '^[0-9]\+$' >/dev/null
then
boldprint "this is pull request no ${CI_COMMIT_REF_NAME}"
+
+ pr_data_file="$(mktemp)"
# get the last reference to a pr in polkadot
- pr_body="$(curl -H "${github_header}" -s ${github_api_substrate_pull_url}/${CI_COMMIT_REF_NAME} \
- | sed -n -r 's/^[[:space:]]+"body": (".*")[^"]+$/\1/p')"
+ curl -sSL -H "${github_header}" -o "${pr_data_file}" \
+ "${github_api_substrate_pull_url}/${CI_COMMIT_REF_NAME}"
+
+ pr_body="$(sed -n -r 's/^[[:space:]]+"body": (".*")[^"]+$/\1/p' "${pr_data_file}")"
pr_companion="$(echo "${pr_body}" | sed -n -r \
-e 's;^.*polkadot companion: paritytech/polkadot#([0-9]+).*$;\1;p' \
-e 's;^.*polkadot companion: https://github.com/paritytech/polkadot/pull/([0-9]+).*$;\1;p' \
| tail -n 1)"
+
if [ -z "${pr_companion}" ]
then
pr_companion="$(echo "${pr_body}" | sed -n -r \
- 's;^.*https://github.com/paritytech/polkadot/pull/([0-9]+).*$;\1;p' \
+ -e 's;^.*paritytech/polkadot/#([0-9]+).*$;\1;p' \
+ -e 's;^.*https://github.com/paritytech/polkadot/pull/([0-9]+).*$;\1;p' \
| tail -n 1)"
fi
if [ "${pr_companion}" ]
then
boldprint "companion pr specified/detected: #${pr_companion}"
- git fetch --depth 1 origin refs/pull/${pr_companion}/head:pr/${pr_companion}
+ git fetch origin refs/pull/${pr_companion}/head:pr/${pr_companion}
git checkout pr/${pr_companion}
+ git merge origin/master
else
- boldprint "no companion pr found - building polkadot:master"
+ pr_ref="$(grep -Po '"ref"\s*:\s*"\K(?!master)[^"]*' "${pr_data_file}")"
+ if git fetch origin "$pr_ref":branch/"$pr_ref" 2>/dev/null
+ then
+ boldprint "companion branch detected: $pr_ref"
+ git checkout branch/"$pr_ref"
+ git merge origin/master
+ else
+ boldprint "no companion branch found - building polkadot:master"
+ fi
fi
+ rm -f "${pr_data_file}"
else
boldprint "this is not a pull request - building polkadot:master"
fi
diff --git a/.maintain/gitlab/check_polkadot_companion_status.sh b/.maintain/gitlab/check_polkadot_companion_status.sh
new file mode 100755
index 0000000000000000000000000000000000000000..b781831055b6d500d133425fe7c0860a807938cb
--- /dev/null
+++ b/.maintain/gitlab/check_polkadot_companion_status.sh
@@ -0,0 +1,100 @@
+#!/bin/sh
+#
+# check for a polkadot companion pr and ensure it has approvals and is
+# mergeable
+#
+
+github_api_substrate_pull_url="https://api.github.com/repos/paritytech/substrate/pulls"
+github_api_polkadot_pull_url="https://api.github.com/repos/paritytech/polkadot/pulls"
+# use github api v3 in order to access the data without authentication
+github_header="Authorization: token ${GITHUB_PR_TOKEN}"
+
+boldprint () { printf "|\n| \033[1m${@}\033[0m\n|\n" ; }
+boldcat () { printf "|\n"; while read l; do printf "| \033[1m${l}\033[0m\n"; done; printf "|\n" ; }
+
+
+
+boldcat <<-EOT
+
+
+check_polkadot_companion_status
+===============================
+
+this job checks if there is a string in the description of the pr like
+
+polkadot companion: paritytech/polkadot#567
+
+or any other polkadot pr is mentioned in this pr's description and checks its
+status.
+
+
+EOT
+
+
+if ! [ "${CI_COMMIT_REF_NAME}" -gt 0 2>/dev/null ]
+then
+ boldprint "this doesn't seem to be a pull request"
+ exit 1
+fi
+
+boldprint "this is pull request no ${CI_COMMIT_REF_NAME}"
+
+pr_body="$(curl -H "${github_header}" -s ${github_api_substrate_pull_url}/${CI_COMMIT_REF_NAME} \
+ | sed -n -r 's/^[[:space:]]+"body": (".*")[^"]+$/\1/p')"
+
+# get companion if explicitly specified
+pr_companion="$(echo "${pr_body}" | sed -n -r \
+ -e 's;^.*polkadot companion: paritytech/polkadot#([0-9]+).*$;\1;p' \
+ -e 's;^.*polkadot companion: https://github.com/paritytech/polkadot/pull/([0-9]+).*$;\1;p' \
+ | tail -n 1)"
+
+# get companion mentioned in the description
+if [ -z "${pr_companion}" ]
+then
+ pr_companion="$(echo "${pr_body}" | sed -n -r \
+ 's;^.*https://github.com/paritytech/polkadot/pull/([0-9]+).*$;\1;p' \
+ | tail -n 1)"
+fi
+
+if [ -z "${pr_companion}" ]
+then
+ boldprint "no companion pr found"
+ exit 0
+fi
+
+boldprint "companion pr: #${pr_companion}"
+
+# check the status of that pull request - needs to be
+# mergable and approved
+
+curl -H "${github_header}" -sS -o companion_pr.json \
+ ${github_api_polkadot_pull_url}/${pr_companion}
+
+if jq -e .merged < companion_pr.json >/dev/null
+then
+ boldprint "polkadot pr #${pr_companion} already merged"
+ exit 0
+fi
+
+if jq -e '.mergeable' < companion_pr.json >/dev/null
+then
+ boldprint "polkadot pr #${pr_companion} mergeable"
+else
+ boldprint "polkadot pr #${pr_companion} not mergeable"
+ exit 1
+fi
+
+curl -H "${github_header}" -sS -o companion_pr_reviews.json \
+ ${github_api_polkadot_pull_url}/${pr_companion}/reviews
+
+if [ -n "$(jq -r -e '.[].state | select(. == "CHANGES_REQUESTED")' < companion_pr_reviews.json)" ] && \
+ [ -z "$(jq -r -e '.[].state | select(. == "APPROVED")' < companion_pr_reviews.json)" ]
+then
+ boldprint "polkadot pr #${pr_companion} not APPROVED"
+ exit 1
+fi
+
+boldprint "polkadot pr #${pr_companion} state APPROVED"
+exit 0
+
+
diff --git a/.maintain/gitlab/skip_if_draft.sh b/.maintain/gitlab/skip_if_draft.sh
new file mode 100755
index 0000000000000000000000000000000000000000..cf6ea6a5b31155da9d6ac0c09079f4dffcec2dfa
--- /dev/null
+++ b/.maintain/gitlab/skip_if_draft.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+url="https://api.github.com/repos/paritytech/substrate/pulls/${CI_COMMIT_REF_NAME}"
+echo "[+] API URL: $url"
+
+draft_state=$(curl -H "Authorization: token ${GITHUB_PR_TOKEN}" "$url" | jq -r .draft)
+echo "[+] Draft state: $draft_state"
+
+if [ "$draft_state" = 'true' ]; then
+ echo "[!] PR is currently a draft, stopping pipeline"
+ exit 1
+else
+ echo "[+] PR is not a draft. Proceeding with CI pipeline"
+ exit 0
+fi
diff --git a/.maintain/monitoring/alerting-rules/alerting-rules.yaml b/.maintain/monitoring/alerting-rules/alerting-rules.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..cb5b3c271dd14e1fb8222ab9e3b7da54bc0d8b1f
--- /dev/null
+++ b/.maintain/monitoring/alerting-rules/alerting-rules.yaml
@@ -0,0 +1,113 @@
+groups:
+- name: polkadot.rules
+ rules:
+
+ ##############################################################################
+ # Resource usage
+ ##############################################################################
+
+ - alert: HighCPUUsage
+ expr: polkadot_cpu_usage_percentage >= 100
+ for: 5m
+ labels:
+ severity: warning
+ annotations:
+ message: 'The node {{ $labels.instance }} has a CPU usage higher than 100% for more than 5 minutes'
+
+ ##############################################################################
+ # Block production
+ ##############################################################################
+
+ - alert: LowNumberOfNewBlocks
+ annotations:
+ message: 'Less than one new block per minute on instance {{ $labels.instance }}.'
+ expr: increase(polkadot_block_height{status="best"}[1m]) < 1
+ for: 3m
+ labels:
+ severity: warning
+ - alert: LowNumberOfNewBlocks
+ annotations:
+ message: 'Less than one new block per minute on instance {{ $labels.instance }}.'
+ expr: increase(polkadot_block_height{status="best"}[1m]) < 1
+ for: 10m
+ labels:
+ severity: critical
+
+ ##############################################################################
+ # Block finalization
+ ##############################################################################
+
+ - alert: BlockFinalizationSlow
+ expr: increase(polkadot_block_height{status="finalized"}[1m]) < 1
+ for: 3m
+ labels:
+ severity: warning
+ annotations:
+ message: 'Finalized block on instance {{ $labels.instance }} increases by less than 1 per minute.'
+ - alert: BlockFinalizationSlow
+ expr: increase(polkadot_block_height{status="finalized"}[1m]) < 1
+ for: 10m
+ labels:
+ severity: critical
+ annotations:
+ message: 'Finalized block on instance {{ $labels.instance }} increases by less than 1 per minute.'
+ - alert: BlockFinalizationLaggingBehind
+ # Under the assumption of an average block production of 6 seconds,
+ # "best" and "finalized" being more than 10 blocks apart would imply
+ # more than a 1 minute delay between block production and finalization.
+ expr: (polkadot_block_height_number{status="best"} - ignoring(status) polkadot_block_height_number{status="finalized"}) > 10
+ for: 8m
+ labels:
+ severity: critical
+ annotations:
+ message: "Block finalization on instance {{ $labels.instance }} is behind block production by {{ $value }} for more than 8m"
+
+ ##############################################################################
+ # Transaction queue
+ ##############################################################################
+
+ - alert: TransactionQueueSize
+ expr: polkadot_sub_txpool_validations_scheduled - polkadot_sub_txpool_validations_finished > 10
+ for: 10m
+ labels:
+ severity: warning
+ annotations:
+ message: 'The node {{ $labels.instance }} has more than 10 transactions in the queue for more than 10 minutes'
+ - alert: TransactionQueueSize
+ expr: polkadot_sub_txpool_validations_scheduled - polkadot_sub_txpool_validations_finished > 10
+ for: 30m
+ labels:
+ severity: critical
+ annotations:
+ message: 'The node {{ $labels.instance }} has more than 10 transactions in the queue for more than 30 minutes'
+
+ ##############################################################################
+ # Networking
+ ##############################################################################
+
+ - alert: LowNumberOfPeers
+ expr: polkadot_sub_libp2p_peers_count < 3
+ for: 3m
+ labels:
+ severity: warning
+ annotations:
+ message: 'The node {{ $labels.instance }} has less than 3 peers for more than 3 minutes'
+ - alert: LowNumberOfPeers
+ expr: polkadot_sub_libp2p_peers_count < 3
+ for: 15m
+ labels:
+ severity: critical
+ annotations:
+ message: 'The node {{ $labels.instance }} has less than 3 peers for more than 15 minutes'
+
+ ##############################################################################
+ # Others
+ ##############################################################################
+
+ - alert: AuthorityDiscoveryHighDiscoveryFailure
+ expr: polkadot_authority_discovery_handle_value_found_event_failure / ignoring(name) polkadot_authority_discovery_dht_event_received{name="value_found"} > 0.5
+ for: 2h
+ labels:
+ severity: warning
+ annotations:
+ message: "Authority discovery on node {{ $labels.instance }} fails to process more than 50 % of the values found on the DHT."
diff --git a/.maintain/monitoring/grafana-dashboards/README_dashboard.md b/.maintain/monitoring/grafana-dashboards/README_dashboard.md
new file mode 100644
index 0000000000000000000000000000000000000000..37bebc6f8eaae0e9430a612d7bc9676ac666e648
--- /dev/null
+++ b/.maintain/monitoring/grafana-dashboards/README_dashboard.md
@@ -0,0 +1,14 @@
+## Substrate Dashboard
+
+Shared templated Grafana dashboards.
+
+To import the dashboards follow the [Grafana
+documentation](https://grafana.com/docs/grafana/latest/reference/export_import/).
+You can see an example setup [here](../../../.maintain/sentry-node).
+
+#### Required labels on Prometheus metrics
+
+- `instance` referring to a single scrape target (see [Prometheus docs for
+ details](https://prometheus.io/docs/concepts/jobs_instances/)).
+
+- `network` referring to the Blockchain network e.g. Kusama.
diff --git a/.maintain/monitoring/grafana-dashboards/substrate-dashboard.json b/.maintain/monitoring/grafana-dashboards/substrate-dashboard.json
new file mode 100644
index 0000000000000000000000000000000000000000..629b22617b22a970eb1f439179f62711d1bac9b4
--- /dev/null
+++ b/.maintain/monitoring/grafana-dashboards/substrate-dashboard.json
@@ -0,0 +1,1650 @@
+{
+ "annotations": {
+ "list": [
+ {
+ "$$hashKey": "object:15",
+ "builtIn": 1,
+ "datasource": "-- Grafana --",
+ "enable": true,
+ "hide": true,
+ "iconColor": "rgba(0, 211, 255, 1)",
+ "name": "Annotations & Alerts",
+ "type": "dashboard"
+ }
+ ]
+ },
+ "editable": true,
+ "gnetId": null,
+ "graphTooltip": 0,
+ "iteration": 1586424254170,
+ "links": [
+ {
+ "icon": "external link",
+ "tags": [],
+ "targetBlank": true,
+ "title": "With love from ColmenaLabs",
+ "tooltip": "",
+ "type": "link",
+ "url": "https://colmenalabs.org"
+ },
+ {
+ "icon": "external link",
+ "tags": [],
+ "targetBlank": true,
+ "title": "Polkastats.io",
+ "tooltip": "",
+ "type": "link",
+ "url": "https://polkastats.io"
+ }
+ ],
+ "panels": [
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": null,
+ "description": "",
+ "fill": 1,
+ "fillGradient": 0,
+ "gridPos": {
+ "h": 6,
+ "w": 6,
+ "x": 0,
+ "y": 0
+ },
+ "hiddenSeries": false,
+ "id": 8,
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": true,
+ "total": false,
+ "values": false
+ },
+ "lines": true,
+ "linewidth": 1,
+ "nullPointMode": "null",
+ "options": {
+ "dataLinks": []
+ },
+ "percentage": false,
+ "pointradius": 2,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "rate([[metric_namespace]]_block_height{status=\"finalized\",instance=\"[[instance]]\",network=\"[[network]]\"}[10m])/rate([[metric_namespace]]_block_height{status=\"finalized\",instance=\"[[instance]]\",network=\"[[network]]\"}[1m])",
+ "intervalFactor": 1,
+ "legendFormat": "rate[10m] / rate[1m]",
+ "refId": "A"
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "Relative Block Production Speed",
+ "tooltip": {
+ "shared": true,
+ "sort": 0,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ],
+ "yaxis": {
+ "align": false,
+ "alignLevel": null
+ }
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": null,
+ "description": "",
+ "fill": 1,
+ "fillGradient": 0,
+ "gridPos": {
+ "h": 6,
+ "w": 6,
+ "x": 6,
+ "y": 0
+ },
+ "hiddenSeries": false,
+ "id": 15,
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": true,
+ "total": false,
+ "values": false
+ },
+ "lines": true,
+ "linewidth": 1,
+ "nullPointMode": "null",
+ "options": {
+ "dataLinks": []
+ },
+ "percentage": false,
+ "pointradius": 2,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "[[metric_namespace]]_sub_libp2p_peers_count{instance=\"[[instance]]\",network=\"[[network]]\"}",
+ "legendFormat": "{{instance}}",
+ "refId": "A"
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "Peers count",
+ "tooltip": {
+ "shared": true,
+ "sort": 0,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ],
+ "yaxis": {
+ "align": false,
+ "alignLevel": null
+ }
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "cacheTimeout": null,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": null,
+ "description": "",
+ "fill": 1,
+ "fillGradient": 0,
+ "gridPos": {
+ "h": 6,
+ "w": 6,
+ "x": 12,
+ "y": 0
+ },
+ "hiddenSeries": false,
+ "id": 17,
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": true,
+ "total": false,
+ "values": false
+ },
+ "lines": true,
+ "linewidth": 1,
+ "links": [],
+ "nullPointMode": "null",
+ "options": {
+ "dataLinks": []
+ },
+ "percentage": false,
+ "pluginVersion": "6.4.1",
+ "pointradius": 2,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "scalar([[metric_namespace]]_block_height{status=\"best\",instance=\"[[instance]]\",network=\"[[network]]\"})-scalar([[metric_namespace]]_block_height{status=\"finalized\",instance=\"[[instance]]\",network=\"[[network]]\"})",
+ "intervalFactor": 2,
+ "legendFormat": "[[hostname]]",
+ "refId": "A"
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "Diff -> ( Best Block - Finalized )",
+ "tooltip": {
+ "shared": true,
+ "sort": 0,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ],
+ "yaxis": {
+ "align": false,
+ "alignLevel": null
+ }
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "cacheTimeout": null,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": null,
+ "description": "",
+ "fill": 1,
+ "fillGradient": 0,
+ "gridPos": {
+ "h": 6,
+ "w": 6,
+ "x": 18,
+ "y": 0
+ },
+ "hiddenSeries": false,
+ "id": 18,
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": true,
+ "total": false,
+ "values": false
+ },
+ "lines": true,
+ "linewidth": 1,
+ "links": [],
+ "nullPointMode": "null",
+ "options": {
+ "dataLinks": []
+ },
+ "percentage": false,
+ "pointradius": 2,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "rate([[metric_namespace]]_block_height{status=\"finalized\",instance=\"[[instance]]\",network=\"[[network]]\"}[10m])*60",
+ "intervalFactor": 10,
+ "legendFormat": "{{instance}} Blocks / minute",
+ "refId": "A"
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "Block rate",
+ "tooltip": {
+ "shared": true,
+ "sort": 0,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ],
+ "yaxis": {
+ "align": false,
+ "alignLevel": null
+ }
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": null,
+ "description": "",
+ "fill": 1,
+ "fillGradient": 0,
+ "gridPos": {
+ "h": 6,
+ "w": 6,
+ "x": 0,
+ "y": 6
+ },
+ "hiddenSeries": false,
+ "id": 10,
+ "interval": "",
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": true,
+ "total": false,
+ "values": false
+ },
+ "lines": true,
+ "linewidth": 1,
+ "nullPointMode": "null",
+ "options": {
+ "dataLinks": []
+ },
+ "percentage": false,
+ "pointradius": 2,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "increase([[metric_namespace]]_block_height{instance=\"[[instance]]\",network=\"[[network]]\",status=~\"finalized|sync_target\"}[1m])",
+ "intervalFactor": 5,
+ "legendFormat": "{{status}}",
+ "refId": "A"
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "Blocks Av per min",
+ "tooltip": {
+ "shared": true,
+ "sort": 0,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ],
+ "yaxis": {
+ "align": false,
+ "alignLevel": null
+ }
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": null,
+ "description": "",
+ "fill": 1,
+ "fillGradient": 0,
+ "gridPos": {
+ "h": 6,
+ "w": 6,
+ "x": 6,
+ "y": 6
+ },
+ "hiddenSeries": false,
+ "id": 14,
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": true,
+ "total": false,
+ "values": false
+ },
+ "lines": true,
+ "linewidth": 1,
+ "nullPointMode": "null",
+ "options": {
+ "dataLinks": []
+ },
+ "percentage": false,
+ "pointradius": 2,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "[[metric_namespace]]_block_height{instance=\"[[instance]]\",network=\"[[network]]\",status=~\"finalized|sync_target\"}",
+ "legendFormat": "{{instance}} {{status}}",
+ "refId": "A"
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "Block Finalized",
+ "tooltip": {
+ "shared": true,
+ "sort": 0,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ],
+ "yaxis": {
+ "align": false,
+ "alignLevel": null
+ }
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": null,
+ "description": "",
+ "fill": 1,
+ "fillGradient": 0,
+ "gridPos": {
+ "h": 6,
+ "w": 6,
+ "x": 12,
+ "y": 6
+ },
+ "hiddenSeries": false,
+ "id": 13,
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": true,
+ "total": false,
+ "values": false
+ },
+ "lines": true,
+ "linewidth": 1,
+ "nullPointMode": "null",
+ "options": {
+ "dataLinks": []
+ },
+ "percentage": false,
+ "pointradius": 2,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "[[metric_namespace]]_block_height{status=\"best\",instance=\"[[instance]]\",network=\"[[network]]\"}",
+ "legendFormat": "{{instance}}",
+ "refId": "A"
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "Block height",
+ "tooltip": {
+ "shared": true,
+ "sort": 0,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ],
+ "yaxis": {
+ "align": false,
+ "alignLevel": null
+ }
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": "Prometheus",
+ "description": "",
+ "fill": 1,
+ "fillGradient": 0,
+ "gridPos": {
+ "h": 6,
+ "w": 6,
+ "x": 18,
+ "y": 6
+ },
+ "hiddenSeries": false,
+ "id": 20,
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": true,
+ "total": false,
+ "values": false
+ },
+ "lines": true,
+ "linewidth": 1,
+ "nullPointMode": "null",
+ "options": {
+ "dataLinks": []
+ },
+ "percentage": false,
+ "pointradius": 2,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "data": "",
+ "expr": "[[metric_namespace]]_ready_transactions_number{instance=\"[[instance]]\",network=\"[[network]]\"}",
+ "hide": false,
+ "legendFormat": "{{instance}}",
+ "refId": "A",
+ "target": "txcount",
+ "type": "timeseries"
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "TXs Count",
+ "tooltip": {
+ "shared": true,
+ "sort": 0,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ],
+ "yaxis": {
+ "align": false,
+ "alignLevel": null
+ }
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": null,
+ "fill": 1,
+ "fillGradient": 0,
+ "gridPos": {
+ "h": 6,
+ "w": 6,
+ "x": 0,
+ "y": 12
+ },
+ "hiddenSeries": false,
+ "id": 23,
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": true,
+ "total": false,
+ "values": false
+ },
+ "lines": true,
+ "linewidth": 1,
+ "nullPointMode": "null",
+ "options": {
+ "dataLinks": []
+ },
+ "percentage": false,
+ "pointradius": 2,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "[[metric_namespace]]_sync_extra_finality_proofs_active{instance=\"[[instance]]\",network=\"[[network]]\"}",
+ "legendFormat": "{{instance}} active",
+ "refId": "A"
+ },
+ {
+ "expr": "[[metric_namespace]]_sync_extra_finality_proofs_failed{instance=\"[[instance]]\",network=\"[[network]]\"}",
+ "legendFormat": "{{instance}} failed",
+ "refId": "B"
+ },
+ {
+ "expr": "[[metric_namespace]]_sync_extra_finality_proofs_importing{instance=\"[[instance]]\",network=\"[[network]]\"}",
+ "legendFormat": "{{instance}} importing",
+ "refId": "C"
+ },
+ {
+ "expr": "[[metric_namespace]]_sync_extra_finality_proofs_pending{instance=\"[[instance]]\",network=\"[[network]]\"}",
+ "legendFormat": "{{instance}} pending",
+ "refId": "D"
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "Sync Proof",
+ "tooltip": {
+ "shared": true,
+ "sort": 0,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ],
+ "yaxis": {
+ "align": false,
+ "alignLevel": null
+ }
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": null,
+ "fill": 1,
+ "fillGradient": 0,
+ "gridPos": {
+ "h": 6,
+ "w": 6,
+ "x": 6,
+ "y": 12
+ },
+ "hiddenSeries": false,
+ "id": 22,
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": true,
+ "total": false,
+ "values": false
+ },
+ "lines": true,
+ "linewidth": 1,
+ "nullPointMode": "null",
+ "options": {
+ "dataLinks": []
+ },
+ "percentage": false,
+ "pointradius": 2,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "[[metric_namespace]]_sync_extra_justifications_active{instance=\"[[instance]]\",network=\"[[network]]\"}",
+ "legendFormat": "{{instance}} active",
+ "refId": "A"
+ },
+ {
+ "expr": "[[metric_namespace]]_sync_extra_justifications_failed{instance=\"[[instance]]\",network=\"[[network]]\"}",
+ "legendFormat": "{{instance}} failed",
+ "refId": "B"
+ },
+ {
+ "expr": "[[metric_namespace]]_sync_extra_justifications_importing{instance=\"[[instance]]\",network=\"[[network]]\"}",
+ "legendFormat": "{{instance}} importing",
+ "refId": "C"
+ },
+ {
+ "expr": "[[metric_namespace]]_sync_extra_justifications_pending{instance=\"[[instance]]\",network=\"[[network]]\"}",
+ "legendFormat": "{{instance}} pending",
+ "refId": "D"
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "Sync justifications",
+ "tooltip": {
+ "shared": true,
+ "sort": 0,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ],
+ "yaxis": {
+ "align": false,
+ "alignLevel": null
+ }
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": null,
+ "description": "",
+ "fill": 1,
+ "fillGradient": 0,
+ "gridPos": {
+ "h": 6,
+ "w": 6,
+ "x": 12,
+ "y": 12
+ },
+ "hiddenSeries": false,
+ "id": 24,
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": true,
+ "total": false,
+ "values": false
+ },
+ "lines": true,
+ "linewidth": 1,
+ "nullPointMode": "null",
+ "options": {
+ "dataLinks": []
+ },
+ "percentage": false,
+ "pointradius": 2,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "[[metric_namespace]]_sub_libp2p_connections{instance=\"[[instance]]\",network=\"[[network]]\"}",
+ "hide": false,
+ "legendFormat": "{{instance}} connections",
+ "refId": "A"
+ },
+ {
+ "expr": "[[metric_namespace]]_sub_libp2p_is_major_syncing{instance=\"[[instance]]\",network=\"[[network]]\"}",
+ "hide": false,
+ "legendFormat": "{{instance}} syncing",
+ "refId": "B"
+ },
+ {
+ "expr": "[[metric_namespace]]_sub_libp2p_kbuckets_num_nodes{instance=\"[[instance]]\",network=\"[[network]]\"}",
+ "hide": false,
+ "legendFormat": "{{instance}} num_nodes",
+ "refId": "C"
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "sub_libp2p",
+ "tooltip": {
+ "shared": true,
+ "sort": 0,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ],
+ "yaxis": {
+ "align": false,
+ "alignLevel": null
+ }
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": null,
+ "description": "",
+ "fill": 1,
+ "fillGradient": 0,
+ "gridPos": {
+ "h": 6,
+ "w": 6,
+ "x": 18,
+ "y": 12
+ },
+ "hiddenSeries": false,
+ "id": 26,
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": true,
+ "total": false,
+ "values": false
+ },
+ "lines": true,
+ "linewidth": 1,
+ "nullPointMode": "null",
+ "options": {
+ "dataLinks": []
+ },
+ "percentage": false,
+ "pointradius": 2,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "[[metric_namespace]]_sub_libp2p_notifications_total{instance=\"[[instance]]\",network=\"[[network]]\",protocol=\"FRNK\",direction=\"in\"}",
+ "hide": false,
+ "legendFormat": "{{instance}} FRNK in",
+ "refId": "A"
+ },
+ {
+ "expr": "[[metric_namespace]]_sub_libp2p_notifications_total{instance=\"[[instance]]\",network=\"[[network]]\",protocol=\"FRNK\",direction=\"out\"}",
+ "hide": false,
+ "legendFormat": "{{instance}} FRNK out",
+ "refId": "B"
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "libp2p_notifications",
+ "tooltip": {
+ "shared": true,
+ "sort": 0,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ],
+ "yaxis": {
+ "align": false,
+ "alignLevel": null
+ }
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": null,
+ "description": "",
+ "fill": 1,
+ "fillGradient": 0,
+ "gridPos": {
+ "h": 6,
+ "w": 6,
+ "x": 0,
+ "y": 18
+ },
+ "hiddenSeries": false,
+ "id": 28,
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": true,
+ "total": false,
+ "values": false
+ },
+ "lines": true,
+ "linewidth": 1,
+ "nullPointMode": "null",
+ "options": {
+ "dataLinks": []
+ },
+ "percentage": false,
+ "pointradius": 2,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "[[metric_namespace]]_cpu_usage_percentage{instance=\"[[instance]]\",network=\"[[network]]\"}",
+ "legendFormat": "{{instance}}",
+ "refId": "A"
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "CPU usage %",
+ "tooltip": {
+ "shared": true,
+ "sort": 0,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ],
+ "yaxis": {
+ "align": false,
+ "alignLevel": null
+ }
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": null,
+ "fill": 1,
+ "fillGradient": 0,
+ "gridPos": {
+ "h": 6,
+ "w": 6,
+ "x": 6,
+ "y": 18
+ },
+ "hiddenSeries": false,
+ "id": 27,
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": true,
+ "total": false,
+ "values": false
+ },
+ "lines": true,
+ "linewidth": 1,
+ "nullPointMode": "null",
+ "options": {
+ "dataLinks": []
+ },
+ "percentage": false,
+ "pointradius": 2,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "[[metric_namespace]]_memory_usage_bytes{instance=\"[[instance]]\",network=\"[[network]]\"}",
+ "legendFormat": "{{instance}} Mem bytes",
+ "refId": "A"
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "Memory",
+ "tooltip": {
+ "shared": true,
+ "sort": 0,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "decimals": 2,
+ "format": "bytes",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": false
+ }
+ ],
+ "yaxis": {
+ "align": false,
+ "alignLevel": null
+ }
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": null,
+ "description": "",
+ "fill": 1,
+ "fillGradient": 0,
+ "gridPos": {
+ "h": 6,
+ "w": 6,
+ "x": 12,
+ "y": 18
+ },
+ "hiddenSeries": false,
+ "id": 25,
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": true,
+ "total": false,
+ "values": false
+ },
+ "lines": true,
+ "linewidth": 1,
+ "nullPointMode": "null",
+ "options": {
+ "dataLinks": []
+ },
+ "percentage": false,
+ "pointradius": 2,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "[[metric_namespace]]_sub_libp2p_network_per_sec_bytes",
+ "hide": false,
+ "legendFormat": "{{instance}}",
+ "refId": "A"
+ },
+ {
+ "expr": "[[metric_namespace]]_sub_libp2p_notifications_total",
+ "hide": true,
+ "legendFormat": "{{instance}}",
+ "refId": "B"
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "libp2p_network_per_sec_bytes",
+ "tooltip": {
+ "shared": true,
+ "sort": 0,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ],
+ "yaxis": {
+ "align": false,
+ "alignLevel": null
+ }
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "cacheTimeout": null,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": null,
+ "description": "",
+ "fill": 1,
+ "fillGradient": 0,
+ "gridPos": {
+ "h": 6,
+ "w": 6,
+ "x": 18,
+ "y": 18
+ },
+ "hiddenSeries": false,
+ "id": 29,
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": true,
+ "total": false,
+ "values": false
+ },
+ "lines": true,
+ "linewidth": 1,
+ "links": [],
+ "nullPointMode": "null",
+ "options": {
+ "dataLinks": []
+ },
+ "percentage": false,
+ "pluginVersion": "6.5.2",
+ "pointradius": 2,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "[[metric_namespace]]_sub_libp2p_notifications_total{instance=\"[[instance]]\",network=\"[[network]]\",protocol=\"dot1\",direction=\"in\"}",
+ "hide": false,
+ "legendFormat": "{{instance}} dot1 in",
+ "refId": "B"
+ },
+ {
+ "expr": "[[metric_namespace]]_sub_libp2p_notifications_total{instance=\"[[instance]]\",network=\"[[network]]\",protocol=\"dot2\",direction=\"in\"}",
+ "hide": false,
+ "legendFormat": "{{instance}} dot2 in",
+ "refId": "C"
+ },
+ {
+ "expr": "[[metric_namespace]]_sub_libp2p_notifications_total{instance=\"[[instance]]\",network=\"[[network]]\",protocol=\"dot2\",direction=\"out\"}",
+ "hide": false,
+ "legendFormat": "{{instance}} dot2 out",
+ "refId": "A"
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeRegions": [],
+ "timeShift": null,
+ "title": "libp2p_notifications",
+ "tooltip": {
+ "shared": true,
+ "sort": 0,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ],
+ "yaxis": {
+ "align": false,
+ "alignLevel": null
+ }
+ }
+ ],
+ "refresh": "5s",
+ "schemaVersion": 22,
+ "style": "dark",
+ "tags": [],
+ "templating": {
+ "list": [
+ {
+ "allValue": null,
+ "current": {
+ "selected": true,
+ "text": "substrate",
+ "value": "substrate"
+ },
+ "hide": 0,
+ "includeAll": false,
+ "label": null,
+ "multi": false,
+ "name": "metric_namespace",
+ "options": [
+ {
+ "selected": true,
+ "text": "substrate",
+ "value": "substrate"
+ },
+ {
+ "selected": false,
+ "text": "polkadot",
+ "value": "polkadot"
+ }
+ ],
+ "query": "substrate, polkadot",
+ "skipUrlSync": false,
+ "type": "custom"
+ },
+ {
+ "allValue": null,
+ "current": {
+ "selected": true,
+ "text": "dev",
+ "value": "dev"
+ },
+ "datasource": "Prometheus",
+ "definition": "label_values(network)",
+ "hide": 0,
+ "includeAll": false,
+ "index": -1,
+ "label": null,
+ "multi": false,
+ "name": "network",
+ "options": [],
+ "query": "label_values(network)",
+ "refresh": 1,
+ "regex": "",
+ "skipUrlSync": false,
+ "sort": 0,
+ "tagValuesQuery": "",
+ "tags": [],
+ "tagsQuery": "",
+ "type": "query",
+ "useTags": false
+ },
+ {
+ "allValue": null,
+ "current": {
+ "selected": false,
+ "text": "validator-a:9615",
+ "value": "validator-a:9615"
+ },
+ "datasource": "Prometheus",
+ "definition": "label_values(instance)",
+ "hide": 0,
+ "includeAll": false,
+ "index": -1,
+ "label": null,
+ "multi": false,
+ "name": "instance",
+ "options": [],
+ "query": "label_values(instance)",
+ "refresh": 1,
+ "regex": "",
+ "skipUrlSync": false,
+ "sort": 0,
+ "tagValuesQuery": "",
+ "tags": [],
+ "tagsQuery": "",
+ "type": "query",
+ "useTags": false
+ }
+ ]
+ },
+ "time": {
+ "from": "now-1h",
+ "to": "now"
+ },
+ "timepicker": {
+ "refresh_intervals": [
+ "5s",
+ "10s",
+ "30s",
+ "1m",
+ "5m",
+ "15m",
+ "30m",
+ "1h",
+ "2h",
+ "1d"
+ ]
+ },
+ "timezone": "",
+ "title": "Substrate Dashboard",
+ "uid": "ColmenaLabs",
+ "variables": {
+ "list": []
+ },
+ "version": 2
+}
diff --git a/.maintain/sentry-node/docker-compose.yml b/.maintain/sentry-node/docker-compose.yml
index db835b057969642c9da77a4bde57c3178745bbd3..376538dde5786e15d1524dc8f75072aa4c1cb59d 100644
--- a/.maintain/sentry-node/docker-compose.yml
+++ b/.maintain/sentry-node/docker-compose.yml
@@ -19,6 +19,9 @@
# - validator-a: localhost:9944
# - validator-b: localhost:9945
# - sentry-a: localhost:9946
+# - grafana: localhost:3001
+# - prometheus: localhost:9090
+
version: "3.7"
services:
@@ -79,13 +82,12 @@ services:
- "--chain=local"
- "--port"
- "30333"
- - "--charlie"
- - "--bootnodes"
+ - "--sentry"
- "/dns4/validator-a/tcp/30333/p2p/QmRpheLN4JWdAnY7HGJfWFNbfkQCb6tFf4vvA6hgjMZKrR"
- - "--bootnodes"
- - "/dns4/validator-b/tcp/30333/p2p/QmSVnNf9HwVMT1Y4cK1P6aoJcEZjmoTXpjKBmAABLMnZEk"
- "--reserved-nodes"
- "/dns4/validator-a/tcp/30333/p2p/QmRpheLN4JWdAnY7HGJfWFNbfkQCb6tFf4vvA6hgjMZKrR"
+ - "--bootnodes"
+ - "/dns4/validator-b/tcp/30333/p2p/QmSVnNf9HwVMT1Y4cK1P6aoJcEZjmoTXpjKBmAABLMnZEk"
- "--no-telemetry"
- "--rpc-cors"
- "all"
@@ -94,7 +96,7 @@ services:
- "--unsafe-rpc-external"
- "--log"
- "sub-authority-discovery=trace"
- - "--sentry"
+ - "--prometheus-external"
validator-b:
image: parity/substrate
@@ -127,12 +129,43 @@ services:
- "--unsafe-rpc-external"
- "--log"
- "sub-authority-discovery=trace"
+ - "--prometheus-external"
ui:
image: polkadot-js/apps
ports:
- "3000:80"
+ prometheus:
+ image: prom/prometheus
+ networks:
+ - network-a
+ - internet
+ ports:
+ - "9090:9090"
+ links:
+ - validator-a:validator-a
+ - sentry-a:sentry-a
+ - validator-b:validator-b
+ volumes:
+ - ./prometheus/:/etc/prometheus/
+ restart: always
+
+ grafana:
+ image: grafana/grafana
+ user: "104"
+ depends_on:
+ - prometheus
+ networks:
+ - network-a
+ - internet
+ ports:
+ - 3001:3000
+ volumes:
+ - ./grafana/provisioning/:/etc/grafana/provisioning
+ - ../monitoring/grafana-dashboards/:/etc/grafana/provisioning/dashboard-definitions
+ restart: always
+
networks:
network-a:
internet:
diff --git a/.maintain/sentry-node/grafana/provisioning/dashboards/dashboards.yml b/.maintain/sentry-node/grafana/provisioning/dashboards/dashboards.yml
new file mode 100644
index 0000000000000000000000000000000000000000..ad9164fd8ea01023a2b5736fdea9bfc0259f1eed
--- /dev/null
+++ b/.maintain/sentry-node/grafana/provisioning/dashboards/dashboards.yml
@@ -0,0 +1,11 @@
+apiVersion: 1
+
+providers:
+- name: 'Prometheus'
+ orgId: 1
+ folder: ''
+ type: file
+ disableDeletion: false
+ editable: false
+ options:
+ path: /etc/grafana/provisioning/dashboard-definitions
diff --git a/.maintain/sentry-node/grafana/provisioning/datasources/datasource.yml b/.maintain/sentry-node/grafana/provisioning/datasources/datasource.yml
new file mode 100644
index 0000000000000000000000000000000000000000..c02bb38b3d378112480b0772855e79b0f02cb02f
--- /dev/null
+++ b/.maintain/sentry-node/grafana/provisioning/datasources/datasource.yml
@@ -0,0 +1,50 @@
+# config file version
+apiVersion: 1
+
+# list of datasources that should be deleted from the database
+deleteDatasources:
+ - name: Prometheus
+ orgId: 1
+
+# list of datasources to insert/update depending
+# whats available in the database
+datasources:
+ # name of the datasource. Required
+- name: Prometheus
+ # datasource type. Required
+ type: prometheus
+ # access mode. direct or proxy. Required
+ access: proxy
+ # org id. will default to orgId 1 if not specified
+ orgId: 1
+ # url
+ url: http://prometheus:9090
+ # database password, if used
+ password:
+ # database user, if used
+ user:
+ # database name, if used
+ database:
+ # enable/disable basic auth
+ basicAuth: false
+ # basic auth username, if used
+ basicAuthUser:
+ # basic auth password, if used
+ basicAuthPassword:
+ # enable/disable with credentials headers
+ withCredentials:
+ # mark as default datasource. Max one per org
+ isDefault: true
+ #