From 40762b6837c7dce73ee610efa566af4fce3c8680 Mon Sep 17 00:00:00 2001 From: nodebreaker-carlsagan Date: Thu, 28 Nov 2019 18:19:01 +0900 Subject: [PATCH 01/42] Refactor rebase master prometheus_v0.3 --- Cargo.lock | 705 ++++++++++++++++++---------- Cargo.toml | 1 + client/Cargo.toml | 1 + client/cli/Cargo.toml | 1 + client/cli/src/informant/display.rs | 7 +- client/cli/src/lib.rs | 8 +- client/cli/src/params.rs | 6 + client/prometheus/Cargo.toml | 16 + client/prometheus/README.md | 430 +++++++++++++++++ client/prometheus/src/lib.rs | 89 ++++ client/prometheus/src/metrics.rs | 78 +++ client/service/Cargo.toml | 1 + client/service/src/builder.rs | 23 +- client/service/src/config.rs | 3 + client/service/src/lib.rs | 2 - client/service/test/src/lib.rs | 1 + 16 files changed, 1124 insertions(+), 248 deletions(-) create mode 100644 client/prometheus/Cargo.toml create mode 100644 client/prometheus/README.md create mode 100644 client/prometheus/src/lib.rs create mode 100644 client/prometheus/src/metrics.rs diff --git a/Cargo.lock b/Cargo.lock index e53a3e440e17b..be90a016fb52c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -79,7 +79,7 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.25" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -138,22 +138,12 @@ name = "assert_matches" version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "async-macros" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "futures-core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "pin-utils 0.1.0-alpha.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "async-std" -version = "1.2.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "async-macros 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "async-task 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "async-task 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "broadcaster 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-channel 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-deque 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -175,10 +165,10 @@ dependencies = [ [[package]] name = "async-task" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -248,7 +238,7 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -376,7 +366,7 @@ dependencies = [ "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "regex-automata 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -394,7 +384,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "byte-slice-cast" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -424,7 +414,7 @@ dependencies = [ [[package]] name = "bytes" -version = "0.5.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -446,8 +436,8 @@ version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -500,7 +490,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -558,7 +548,7 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen 0.2.56 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -567,7 +557,7 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "web-sys 0.3.32 (registry+https://github.com/rust-lang/crates.io-index)", + "web-sys 0.3.33 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -593,6 +583,32 @@ name = "constant_time_eq" version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "cookie" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", + "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "cookie_store" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cookie 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "publicsuffix 1.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", + "try_from 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "core-foundation" version = "0.6.4" @@ -626,8 +642,8 @@ dependencies = [ "cranelift-codegen-shared 0.50.0 (registry+https://github.com/rust-lang/crates.io-index)", "cranelift-entity 0.50.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", - "smallvec 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "target-lexicon 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "thiserror 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -651,7 +667,7 @@ name = "cranelift-entity" version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -661,7 +677,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cranelift-codegen 0.50.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "smallvec 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "target-lexicon 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -684,7 +700,7 @@ dependencies = [ "cranelift-entity 0.50.0 (registry+https://github.com/rust-lang/crates.io-index)", "cranelift-frontend 0.50.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "thiserror 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", "wasmparser 0.39.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -714,12 +730,12 @@ dependencies = [ "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand_os 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "rand_xoshiro 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rayon 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rayon-core 1.6.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "rayon 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rayon-core 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", - "tinytemplate 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "tinytemplate 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "walkdir 2.2.9 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -739,11 +755,11 @@ dependencies = [ "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand_os 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "rand_xoshiro 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rayon 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "rayon 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", - "tinytemplate 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "tinytemplate 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "walkdir 2.2.9 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -806,9 +822,10 @@ dependencies = [ [[package]] name = "crossbeam-queue" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -854,7 +871,7 @@ dependencies = [ "csv-core 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "ryu 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -995,6 +1012,11 @@ name = "doc-comment" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "dtoa" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "ed25519-dalek" version = "1.0.0-pre.3" @@ -1019,6 +1041,14 @@ dependencies = [ "heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "encoding_rs" +version = "0.8.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "enumflags2" version = "0.6.2" @@ -1071,7 +1101,7 @@ name = "erased-serde" version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1093,6 +1123,14 @@ dependencies = [ "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "error-chain" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "evm" version = "0.14.1" @@ -1103,7 +1141,7 @@ dependencies = [ "evm-runtime 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)", "primitive-types 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "rlp 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "sha3 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1148,7 +1186,7 @@ name = "faerie" version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "anyhow 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", + "anyhow 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)", "goblin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "indexmap 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1219,7 +1257,7 @@ dependencies = [ [[package]] name = "fixed-hash" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1284,7 +1322,7 @@ dependencies = [ "pallet-indices 2.0.0", "pallet-transaction-payment 2.0.0", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", "sp-io 2.0.0", "sp-runtime 2.0.0", @@ -1296,7 +1334,7 @@ name = "frame-metadata" version = "2.0.0" dependencies = [ "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", "sp-std 2.0.0", ] @@ -1315,7 +1353,7 @@ dependencies = [ "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "paste 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "pretty_assertions 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "sp-arithmetic 2.0.0", "sp-core 2.0.0", "sp-inherents 2.0.0", @@ -1323,7 +1361,7 @@ dependencies = [ "sp-runtime 2.0.0", "sp-state-machine 2.0.0", "sp-std 2.0.0", - "tracing 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tracing 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1363,13 +1401,13 @@ dependencies = [ "frame-support 2.0.0", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "pretty_assertions 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", "sp-inherents 2.0.0", "sp-io 2.0.0", "sp-runtime 2.0.0", "sp-state-machine 2.0.0", - "trybuild 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", + "trybuild 1.0.19 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1381,7 +1419,7 @@ dependencies = [ "impl-trait-for-tuples 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", "sp-io 2.0.0", "sp-runtime 2.0.0", @@ -1629,7 +1667,7 @@ dependencies = [ "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "wasi 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen 0.2.56 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1680,7 +1718,7 @@ dependencies = [ name = "grafana-data-source" version = "2.0.0" dependencies = [ - "async-std 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "async-std 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "derive_more 0.99.2 (registry+https://github.com/rust-lang/crates.io-index)", "futures-timer 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1689,9 +1727,9 @@ dependencies = [ "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1726,7 +1764,7 @@ name = "h2" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bytes 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "futures-core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "futures-sink 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1735,7 +1773,7 @@ dependencies = [ "indexmap 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-util 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1793,7 +1831,7 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.1.3" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1855,7 +1893,7 @@ name = "http" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bytes 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1876,7 +1914,7 @@ name = "http-body" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bytes 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", "http 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1945,7 +1983,7 @@ name = "hyper" version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bytes 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", "futures-channel 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "futures-core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "futures-util 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1957,7 +1995,7 @@ dependencies = [ "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "pin-project 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "tower-service 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "want 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2031,7 +2069,7 @@ name = "impl-serde" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2100,10 +2138,10 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.32" +version = "0.3.33" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "wasm-bindgen 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen 0.2.56 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2118,7 +2156,7 @@ dependencies = [ "jsonrpc-core 14.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-pubsub 14.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", "tokio 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2132,8 +2170,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2178,7 +2216,7 @@ dependencies = [ "jsonrpc-core 14.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2285,9 +2323,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "lazy_static" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "spin 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", -] [[package]] name = "lazycell" @@ -2358,7 +2393,11 @@ dependencies = [ "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +<<<<<<< HEAD "libsecp256k1 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", +======= + "libsecp256k1 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", +>>>>>>> 9044da2b8... Refactor rebase master prometheus_v0.3 "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "multistream-select 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "parity-multiaddr 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2575,7 +2614,7 @@ dependencies = [ "ctr 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", "hmac 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", - "js-sys 0.3.32 (registry+https://github.com/rust-lang/crates.io-index)", + "js-sys 0.3.33 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "libp2p-core 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2589,9 +2628,9 @@ dependencies = [ "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", "twofish 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "untrusted 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen 0.2.56 (registry+https://github.com/rust-lang/crates.io-index)", "wasm-bindgen-futures 0.3.27 (registry+https://github.com/rust-lang/crates.io-index)", - "web-sys 0.3.32 (registry+https://github.com/rust-lang/crates.io-index)", + "web-sys 0.3.33 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2640,11 +2679,11 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "js-sys 0.3.32 (registry+https://github.com/rust-lang/crates.io-index)", + "js-sys 0.3.33 (registry+https://github.com/rust-lang/crates.io-index)", "libp2p-core 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)", "parity-send-wrapper 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen 0.2.56 (registry+https://github.com/rust-lang/crates.io-index)", "wasm-bindgen-futures 0.3.27 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2691,7 +2730,11 @@ dependencies = [ [[package]] name = "libsecp256k1" +<<<<<<< HEAD version = "0.3.4" +======= +version = "0.3.3" +>>>>>>> 9044da2b8... Refactor rebase master prometheus_v0.3 source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "arrayref 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2863,6 +2906,20 @@ dependencies = [ "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "mime" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "mime_guess" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "mime 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", + "unicase 2.6.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "miniz_oxide" version = "0.3.5" @@ -3004,7 +3061,7 @@ dependencies = [ "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "hex-literal 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "js-sys 0.3.32 (registry+https://github.com/rust-lang/crates.io-index)", + "js-sys 0.3.33 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-core 14.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "kvdb-memorydb 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "libp2p 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3041,7 +3098,7 @@ dependencies = [ "sc-service-test 2.0.0", "sc-telemetry 2.0.0", "sc-transaction-pool 2.0.0", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "sp-authority-discovery 2.0.0", "sp-consensus 0.8.0", "sp-consensus-babe 0.8.0", @@ -3059,7 +3116,7 @@ dependencies = [ "tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "tokio 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", "vergen 3.0.4 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen 0.2.56 (registry+https://github.com/rust-lang/crates.io-index)", "wasm-bindgen-futures 0.3.27 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3170,7 +3227,7 @@ dependencies = [ "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "sp-api 2.0.0", "sp-authority-discovery 2.0.0", "sp-block-builder 2.0.0", @@ -3240,7 +3297,7 @@ dependencies = [ "pallet-transaction-payment 2.0.0", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "sp-api 2.0.0", "sp-block-builder 2.0.0", "sp-consensus-aura 0.8.0", @@ -3313,6 +3370,11 @@ name = "nohash-hasher" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "nom" +version = "1.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "nom" version = "4.2.3" @@ -3365,7 +3427,7 @@ name = "num_cpus" version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "hermit-abi 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "hermit-abi 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3454,7 +3516,7 @@ dependencies = [ "frame-support 2.0.0", "frame-system 2.0.0", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", "sp-io 2.0.0", "sp-runtime 2.0.0", @@ -3472,7 +3534,7 @@ dependencies = [ "pallet-timestamp 2.0.0", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "sp-application-crypto 2.0.0", "sp-consensus-aura 0.8.0", "sp-core 2.0.0", @@ -3491,7 +3553,7 @@ dependencies = [ "frame-system 2.0.0", "pallet-session 2.0.0", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "sp-application-crypto 2.0.0", "sp-authority-discovery 2.0.0", "sp-core 2.0.0", @@ -3529,7 +3591,7 @@ dependencies = [ "pallet-timestamp 2.0.0", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "sp-consensus-babe 0.8.0", "sp-core 2.0.0", "sp-inherents 2.0.0", @@ -3551,7 +3613,7 @@ dependencies = [ "pallet-transaction-payment 2.0.0", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", "sp-io 2.0.0", "sp-runtime 2.0.0", @@ -3568,7 +3630,7 @@ dependencies = [ "pallet-balances 2.0.0", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", "sp-io 2.0.0", "sp-runtime 2.0.0", @@ -3589,7 +3651,7 @@ dependencies = [ "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-wasm 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", "pwasm-utils 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", "sp-io 2.0.0", "sp-runtime 2.0.0", @@ -3608,7 +3670,7 @@ dependencies = [ "jsonrpc-derive 14.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "pallet-contracts-rpc-runtime-api 2.0.0", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", "sp-blockchain 2.0.0", "sp-core 2.0.0", @@ -3635,7 +3697,7 @@ dependencies = [ "pallet-balances 2.0.0", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", "sp-io 2.0.0", "sp-runtime 2.0.0", @@ -3652,7 +3714,7 @@ dependencies = [ "pallet-balances 2.0.0", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", "sp-io 2.0.0", "sp-runtime 2.0.0", @@ -3668,7 +3730,7 @@ dependencies = [ "hex-literal 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "pallet-balances 2.0.0", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", "sp-io 2.0.0", "sp-phragmen 2.0.0", @@ -3689,7 +3751,7 @@ dependencies = [ "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "primitive-types 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "rlp 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "sha3 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", "sp-io 2.0.0", @@ -3705,7 +3767,7 @@ dependencies = [ "frame-system 2.0.0", "pallet-balances 2.0.0", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", "sp-io 2.0.0", "sp-runtime 2.0.0", @@ -3720,7 +3782,7 @@ dependencies = [ "frame-system 2.0.0", "impl-trait-for-tuples 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", "sp-finality-tracker 2.0.0", "sp-inherents 2.0.0", @@ -3736,7 +3798,7 @@ dependencies = [ "frame-support 2.0.0", "frame-system 2.0.0", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", "sp-io 2.0.0", "sp-runtime 2.0.0", @@ -3752,7 +3814,7 @@ dependencies = [ "pallet-finality-tracker 2.0.0", "pallet-session 2.0.0", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", "sp-finality-grandpa 2.0.0", "sp-io 2.0.0", @@ -3770,7 +3832,7 @@ dependencies = [ "frame-system 2.0.0", "pallet-balances 2.0.0", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", "sp-io 2.0.0", "sp-runtime 2.0.0", @@ -3786,7 +3848,7 @@ dependencies = [ "pallet-authorship 2.0.0", "pallet-session 2.0.0", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "sp-application-crypto 2.0.0", "sp-core 2.0.0", "sp-io 2.0.0", @@ -3803,7 +3865,7 @@ dependencies = [ "frame-system 2.0.0", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", "sp-io 2.0.0", "sp-keyring 2.0.0", @@ -3818,7 +3880,7 @@ dependencies = [ "frame-support 2.0.0", "frame-system 2.0.0", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", "sp-io 2.0.0", "sp-runtime 2.0.0", @@ -3833,7 +3895,7 @@ dependencies = [ "frame-system 2.0.0", "pallet-balances 2.0.0", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", "sp-io 2.0.0", "sp-runtime 2.0.0", @@ -3848,7 +3910,7 @@ dependencies = [ "frame-system 2.0.0", "pallet-balances 2.0.0", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", "sp-io 2.0.0", "sp-runtime 2.0.0", @@ -3878,7 +3940,7 @@ dependencies = [ "frame-system 2.0.0", "pallet-balances 2.0.0", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", "sp-io 2.0.0", "sp-runtime 2.0.0", @@ -3896,7 +3958,7 @@ dependencies = [ "pallet-timestamp 2.0.0", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "sp-application-crypto 2.0.0", "sp-core 2.0.0", "sp-io 2.0.0", @@ -3919,7 +3981,7 @@ dependencies = [ "pallet-timestamp 2.0.0", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", "sp-io 2.0.0", "sp-keyring 2.0.0", @@ -3948,7 +4010,7 @@ dependencies = [ "frame-support 2.0.0", "frame-system 2.0.0", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", "sp-io 2.0.0", "sp-runtime 2.0.0", @@ -3963,7 +4025,7 @@ dependencies = [ "frame-system 2.0.0", "impl-trait-for-tuples 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", "sp-inherents 2.0.0", "sp-io 2.0.0", @@ -3996,7 +4058,7 @@ dependencies = [ "jsonrpc-derive 14.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "pallet-transaction-payment-rpc-runtime-api 2.0.0", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "sp-blockchain 2.0.0", "sp-core 2.0.0", "sp-rpc 2.0.0", @@ -4009,7 +4071,7 @@ version = "2.0.0" dependencies = [ "frame-support 2.0.0", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", "sp-api 2.0.0", "sp-runtime 2.0.0", @@ -4024,7 +4086,7 @@ dependencies = [ "frame-system 2.0.0", "pallet-balances 2.0.0", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", "sp-io 2.0.0", "sp-runtime 2.0.0", @@ -4039,7 +4101,7 @@ dependencies = [ "frame-system 2.0.0", "pallet-balances 2.0.0", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", "sp-io 2.0.0", "sp-runtime 2.0.0", @@ -4063,7 +4125,7 @@ dependencies = [ "data-encoding 2.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "parity-multihash 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "unsigned-varint 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -4080,7 +4142,7 @@ dependencies = [ "data-encoding 2.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "parity-multihash 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "unsigned-varint 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "url 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -4120,9 +4182,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "arrayvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "bitvec 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)", - "byte-slice-cast 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "byte-slice-cast 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec-derive 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -4350,7 +4412,7 @@ name = "primitive-types" version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "fixed-hash 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "fixed-hash 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "impl-codec 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "impl-rlp 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "impl-serde 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4420,6 +4482,32 @@ dependencies = [ "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "procinfo" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", + "nom 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "prometheus" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", + "procinfo 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "protobuf 2.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "spin 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "prost" version = "0.5.0" @@ -4473,6 +4561,18 @@ name = "protobuf" version = "2.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "publicsuffix" +version = "1.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "error-chain 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)", + "idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "url 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "pwasm-utils" version = "0.12.0" @@ -4649,7 +4749,7 @@ dependencies = [ "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen 0.2.56 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -4708,21 +4808,21 @@ dependencies = [ [[package]] name = "rayon" -version = "1.2.1" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "crossbeam-deque 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)", - "rayon-core 1.6.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rayon-core 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rayon-core" -version = "1.6.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "crossbeam-deque 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-queue 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-queue 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4795,6 +4895,39 @@ dependencies = [ "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "reqwest" +version = "0.9.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "cookie 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cookie_store 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "encoding_rs 0.8.22 (registry+https://github.com/rust-lang/crates.io-index)", + "flate2 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", + "http 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.12.35 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper-tls 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "mime 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", + "mime_guess 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "native-tls 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_urlencoded 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-threadpool 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-timer 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)", + "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "uuid 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", + "winreg 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "ring" version = "0.16.9" @@ -4805,7 +4938,7 @@ dependencies = [ "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "spin 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "untrusted 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "web-sys 0.3.32 (registry+https://github.com/rust-lang/crates.io-index)", + "web-sys 0.3.33 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -4855,6 +4988,14 @@ name = "rustc-hex" version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "rustc_version" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "semver 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "rustc_version" version = "0.2.3" @@ -4993,7 +5134,7 @@ dependencies = [ "sc-chain-spec-derive 2.0.0", "sc-network 0.8.0", "sc-telemetry 2.0.0", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", "sp-runtime 2.0.0", @@ -5028,6 +5169,7 @@ dependencies = [ "rpassword 4.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "sc-client-api 2.0.0", "sc-network 0.8.0", + "sc-prometheus 2.0.0", "sc-service 2.0.0", "sc-telemetry 2.0.0", "sc-tracing 2.0.0", @@ -5041,7 +5183,7 @@ dependencies = [ "structopt 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -5062,6 +5204,7 @@ dependencies = [ "sc-block-builder 2.0.0", "sc-client-api 2.0.0", "sc-executor 2.0.0", + "sc-prometheus 2.0.0", "sc-telemetry 2.0.0", "sp-api 2.0.0", "sp-blockchain 2.0.0", @@ -5078,7 +5221,7 @@ dependencies = [ "sp-version 2.0.0", "substrate-test-runtime-client 2.0.0", "tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "tracing 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tracing 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -5287,7 +5430,11 @@ dependencies = [ "derive_more 0.99.2 (registry+https://github.com/rust-lang/crates.io-index)", "hex-literal 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +<<<<<<< HEAD "libsecp256k1 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", +======= + "libsecp256k1 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", +>>>>>>> 9044da2b8... Refactor rebase master prometheus_v0.3 "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-wasm 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5447,7 +5594,7 @@ dependencies = [ "sc-client 2.0.0", "sc-client-api 2.0.0", "sc-peerset 2.0.0", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", "slog 2.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "slog_derive 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5555,6 +5702,18 @@ dependencies = [ "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "sc-prometheus" +version = "2.0.0" +dependencies = [ + "hyper 0.12.35 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "prometheus 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "reqwest 0.9.24 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "sc-rpc" version = "2.0.0" @@ -5604,7 +5763,7 @@ dependencies = [ "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", "sp-rpc 2.0.0", @@ -5621,7 +5780,7 @@ dependencies = [ "jsonrpc-pubsub 14.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-ws-server 14.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", "sp-runtime 2.0.0", ] @@ -5661,12 +5820,13 @@ dependencies = [ "sc-keystore 2.0.0", "sc-network 0.8.0", "sc-offchain 2.0.0", + "sc-prometheus 2.0.0", "sc-rpc 2.0.0", "sc-rpc-server 2.0.0", "sc-telemetry 2.0.0", "sc-tracing 2.0.0", "sc-transaction-pool 2.0.0", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", "slog 2.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "sp-api 2.0.0", @@ -5686,7 +5846,7 @@ dependencies = [ "tokio 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-executor 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-timer 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)", - "tracing 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tracing 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -5732,7 +5892,7 @@ dependencies = [ "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "slog 2.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "slog-json 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "slog-scope 4.3.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5750,11 +5910,11 @@ dependencies = [ "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "sc-telemetry 2.0.0", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", "slog 2.5.2 (registry+https://github.com/rust-lang/crates.io-index)", - "tracing 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "tracing-core 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "tracing 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", + "tracing-core 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -5768,7 +5928,7 @@ dependencies = [ "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", "sp-runtime 2.0.0", "sp-transaction-pool 2.0.0", @@ -5876,6 +6036,11 @@ dependencies = [ "core-foundation-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "semver" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "semver" version = "0.6.0" @@ -5890,7 +6055,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -5905,15 +6070,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "serde" -version = "1.0.103" +version = "1.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde_derive 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "serde_derive" -version = "1.0.103" +version = "1.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5928,7 +6093,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "ryu 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "serde_urlencoded" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "dtoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", + "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -6004,7 +6180,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "erased-serde 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", "slog 2.5.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -6039,7 +6215,7 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -6117,7 +6293,7 @@ dependencies = [ "sp-state-machine 2.0.0", "sp-version 2.0.0", "substrate-test-runtime-client 2.0.0", - "trybuild 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", + "trybuild 1.0.19 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -6125,7 +6301,7 @@ name = "sp-application-crypto" version = "2.0.0" dependencies = [ "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", "sp-io 2.0.0", "sp-std 2.0.0", @@ -6151,7 +6327,7 @@ dependencies = [ "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "primitive-types 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "sp-debug-derive 2.0.0", "sp-std 2.0.0", ] @@ -6276,7 +6452,11 @@ dependencies = [ "hex-literal 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "impl-serde 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +<<<<<<< HEAD "libsecp256k1 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", +======= + "libsecp256k1 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", +>>>>>>> 9044da2b8... Refactor rebase master prometheus_v0.3 "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -6287,7 +6467,7 @@ dependencies = [ "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "schnorrkel 0.8.5 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", "sha2 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "sp-debug-derive 2.0.0", @@ -6327,7 +6507,7 @@ name = "sp-finality-grandpa" version = "2.0.0" dependencies = [ "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "sp-api 2.0.0", "sp-application-crypto 2.0.0", "sp-runtime 2.0.0", @@ -6359,7 +6539,11 @@ name = "sp-io" version = "2.0.0" dependencies = [ "hash-db 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)", +<<<<<<< HEAD "libsecp256k1 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", +======= + "libsecp256k1 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", +>>>>>>> 9044da2b8... Refactor rebase master prometheus_v0.3 "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", @@ -6401,7 +6585,7 @@ name = "sp-phragmen" version = "2.0.0" dependencies = [ "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "sp-io 2.0.0", "sp-runtime 2.0.0", "sp-std 2.0.0", @@ -6412,7 +6596,7 @@ dependencies = [ name = "sp-rpc" version = "2.0.0" dependencies = [ - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", ] @@ -6426,7 +6610,7 @@ dependencies = [ "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "paste 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", "sp-application-crypto 2.0.0", "sp-arithmetic 2.0.0", @@ -6453,7 +6637,7 @@ dependencies = [ "sp-std 2.0.0", "sp-wasm-interface 2.0.0", "static_assertions 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "trybuild 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", + "trybuild 1.0.19 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -6507,7 +6691,7 @@ dependencies = [ name = "sp-serializer" version = "2.0.0" dependencies = [ - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -6557,7 +6741,7 @@ name = "sp-storage" version = "2.0.0" dependencies = [ "impl-serde 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "sp-debug-derive 2.0.0", "sp-std 2.0.0", ] @@ -6567,7 +6751,7 @@ name = "sp-test-primitives" version = "2.0.0" dependencies = [ "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "sp-application-crypto 2.0.0", "sp-core 2.0.0", "sp-runtime 2.0.0", @@ -6593,7 +6777,7 @@ dependencies = [ "futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "sp-api 2.0.0", "sp-runtime 2.0.0", ] @@ -6621,7 +6805,7 @@ version = "2.0.0" dependencies = [ "impl-serde 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "sp-runtime 2.0.0", "sp-std 2.0.0", ] @@ -6670,7 +6854,7 @@ name = "string-interner" version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -6772,7 +6956,7 @@ dependencies = [ "jsonrpc-core 14.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "sc-rpc-api 2.0.0", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "sp-storage 2.0.0", "tokio 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -6791,7 +6975,7 @@ dependencies = [ "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "sc-client 2.0.0", "sc-transaction-pool 2.0.0", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "sp-blockchain 2.0.0", "sp-core 2.0.0", "sp-runtime 2.0.0", @@ -6834,7 +7018,7 @@ dependencies = [ "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "sc-client 2.0.0", "sc-executor 2.0.0", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "sp-api 2.0.0", "sp-application-crypto 2.0.0", "sp-block-builder 2.0.0", @@ -6955,7 +7139,7 @@ dependencies = [ "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "doc-comment 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", - "rayon 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rayon 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -7091,10 +7275,10 @@ dependencies = [ [[package]] name = "tinytemplate" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -7123,10 +7307,10 @@ dependencies = [ [[package]] name = "tokio" -version = "0.2.4" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bytes 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "pin-project-lite 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -7347,12 +7531,12 @@ name = "tokio-util" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bytes 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", "futures-core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "futures-sink 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "pin-project-lite 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -7360,7 +7544,7 @@ name = "toml" version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -7370,18 +7554,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "tracing" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "spin 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", - "tracing-attributes 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "tracing-core 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "tracing-attributes 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "tracing-core 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "tracing-attributes" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -7390,11 +7573,10 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "spin 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -7451,14 +7633,22 @@ name = "try-lock" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "try_from" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "trybuild" -version = "1.0.18" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "glob 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", "termcolor 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "toml 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -7532,7 +7722,7 @@ name = "unicode-normalization" version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "smallvec 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -7589,6 +7779,14 @@ dependencies = [ "percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "uuid" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "vcpkg" version = "0.2.8" @@ -7629,8 +7827,8 @@ name = "wabt" version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", "wabt-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -7681,16 +7879,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "wasm-bindgen" -version = "0.2.55" +version = "0.2.56" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen-macro 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-macro 0.2.56 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.55" +version = "0.2.56" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bumpalo 2.6.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -7699,7 +7897,7 @@ dependencies = [ "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen-shared 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-shared 0.2.56 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -7709,49 +7907,49 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "js-sys 0.3.32 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", - "web-sys 0.3.32 (registry+https://github.com/rust-lang/crates.io-index)", + "js-sys 0.3.33 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen 0.2.56 (registry+https://github.com/rust-lang/crates.io-index)", + "web-sys 0.3.33 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.55" +version = "0.2.56" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen-macro-support 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-macro-support 0.2.56 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.55" +version = "0.2.56" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen-backend 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen-shared 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-backend 0.2.56 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-shared 0.2.56 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.55" +version = "0.2.56" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "wasm-bindgen-webidl" -version = "0.2.55" +version = "0.2.56" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "anyhow 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", + "anyhow 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)", "heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen-backend 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-backend 0.2.56 (registry+https://github.com/rust-lang/crates.io-index)", "weedle 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -7771,11 +7969,11 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "js-sys 0.3.32 (registry+https://github.com/rust-lang/crates.io-index)", + "js-sys 0.3.33 (registry+https://github.com/rust-lang/crates.io-index)", "send_wrapper 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-timer 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", - "web-sys 0.3.32 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen 0.2.56 (registry+https://github.com/rust-lang/crates.io-index)", + "web-sys 0.3.33 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -7810,7 +8008,7 @@ name = "wasmtime-debug" version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "anyhow 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", + "anyhow 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)", "cranelift-codegen 0.50.0 (registry+https://github.com/rust-lang/crates.io-index)", "cranelift-entity 0.50.0 (registry+https://github.com/rust-lang/crates.io-index)", "cranelift-wasm 0.50.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -7841,8 +8039,8 @@ dependencies = [ "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "more-asserts 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rayon 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "rayon 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", "sha2 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "spin 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "thiserror 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", @@ -7857,7 +8055,7 @@ name = "wasmtime-jit" version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "anyhow 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", + "anyhow 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)", "cranelift-codegen 0.50.0 (registry+https://github.com/rust-lang/crates.io-index)", "cranelift-entity 0.50.0 (registry+https://github.com/rust-lang/crates.io-index)", "cranelift-frontend 0.50.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -7895,14 +8093,14 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.32" +version = "0.3.33" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "anyhow 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", - "js-sys 0.3.32 (registry+https://github.com/rust-lang/crates.io-index)", + "anyhow 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)", + "js-sys 0.3.33 (registry+https://github.com/rust-lang/crates.io-index)", "sourcefile 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen-webidl 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen 0.2.56 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-webidl 0.2.56 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -8032,6 +8230,14 @@ dependencies = [ "winapi-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "winreg" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "ws" version = "0.9.1" @@ -8150,7 +8356,7 @@ dependencies = [ "checksum aho-corasick 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)" = "58fb5e95d83b38284460a5fda7d6470aa0b8844d283a0b614b8535e880800d2d" "checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" "checksum ansi_term 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" -"checksum anyhow 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)" = "9267dff192e68f3399525901e709a48c1d3982c9c072fa32f2127a0cb0babf14" +"checksum anyhow 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)" = "7825f6833612eb2414095684fcf6c635becf3ce97fe48cf6421321e93bfbd53c" "checksum app_dirs 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e73a24bad9bd6a94d6395382a6c69fe071708ae4409f763c5475e14ee896313d" "checksum arc-swap 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "d7b8a9123b8027467bce0099fe556c628a53c8d83df0507084c31e9ba2e39aff" "checksum arrayref 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "0d382e583f07208808f6b1249e60848879ba3543f57c32277bf52d69c2f0f0ee" @@ -8159,9 +8365,8 @@ dependencies = [ "checksum asn1_der 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6fce6b6a0ffdafebd82c87e79e3f40e8d2c523e5fea5566ff6b90509bf98d638" "checksum asn1_der_derive 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0d0864d84b8e07b145449be9a8537db86bf9de5ce03b913214694643b4743502" "checksum assert_matches 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7deb0a829ca7bcfaf5da70b073a8d128619259a7be8216a355e23f00763059e5" -"checksum async-macros 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "644a5a8de80f2085a1e7e57cd1544a2a7438f6e003c0790999bd43b92a77cdb2" -"checksum async-std 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "513ee3c49800679a319912340f5601afda9e72848d7dea3a48bab489e8c1a46f" -"checksum async-task 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "de6bd58f7b9cc49032559422595c81cbfcf04db2f2133592f70af19e258a1ced" +"checksum async-std 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0bf6039b315300e057d198b9d3ab92ee029e31c759b7f1afae538145e6f18a3e" +"checksum async-task 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "abdb6048336bef96e8c8fc5573536c5cc5b391fbfd0980349959b7c3f7a40d19" "checksum atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "1803c647a3ec87095e7ae7acfca019e98de5ec9a7d01343f611cf3152ed71a90" "checksum autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" "checksum backtrace 0.3.40 (registry+https://github.com/rust-lang/crates.io-index)" = "924c76597f0d9ca25d762c25a4d369d51267536465dc5064bdf0eb073ed477ea" @@ -8187,12 +8392,12 @@ dependencies = [ "checksum bstr 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8d6c2c5b58ab920a4f5aeaaca34b4488074e8cc7596af94e6f8c6ff247c60245" "checksum build-helper 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "bdce191bf3fa4995ce948c8c83b4640a1745457a149e73c6db75b4ffe36aad5f" "checksum bumpalo 2.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ad807f2fc2bf185eeb98ff3a901bd46dc5ad58163d0fa4577ba0d25674d71708" -"checksum byte-slice-cast 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f6209f3b2c1edea170002e016d5ead6903d3bb0a846477f53bbeb614967a52a9" +"checksum byte-slice-cast 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "b0a5e3906bcbf133e33c1d4d95afc664ad37fbdb9f6568d8043e7ea8c27d93d3" "checksum byte-tools 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" "checksum byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0fc10e8cc6b2580fda3f36eb6dc5316657f812a3df879a44a66fc9f0fdbc4855" "checksum byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a7c3dd8985a7111efc5c80b44e23ecdd8c007de8ade3b96595387e812b957cf5" "checksum bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)" = "206fdffcfa2df7cbe15601ef46c813fce0965eb3286db6b56c583b814b51c81c" -"checksum bytes 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1c85319f157e4e26c703678e68e26ab71a46c0199286fa670b21cc9fec13d895" +"checksum bytes 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "10004c15deb332055f7a4a208190aed362cf9a7c2f6ab70a305fba50e1105f38" "checksum c2-chacha 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "214238caa1bf3a496ec3392968969cab8549f96ff30652c9e56885329315f6bb" "checksum c_linked_list 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4964518bd3b4a8190e832886cdc0da9794f12e8e6c1613a9e90ff331c4c8724b" "checksum cargo_metadata 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "46e3374c604fb39d1a2f35ed5e4a4e30e60d01fab49446e08f1b3e9a90aef202" @@ -8211,6 +8416,8 @@ dependencies = [ "checksum const-random 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7b641a8c9867e341f3295564203b1c250eb8ce6cb6126e007941f78c4d2ed7fe" "checksum const-random-macro 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c750ec12b83377637110d5a57f5ae08e895b06c4b16e2bdbf1a94ef717428c59" "checksum constant_time_eq 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "995a44c877f9212528ccc74b21a232f66ad69001e40ede5bcee2ac9ef2657120" +"checksum cookie 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "888604f00b3db336d2af898ec3c1d5d0ddf5e6d462220f2ededc33a87ac4bbd5" +"checksum cookie_store 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "46750b3f362965f197996c4448e4a0935e791bf7d6631bfce9ee0af3d24c919c" "checksum core-foundation 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "25b9e03f145fd4f2bf705e07b900cd41fc636598fe5dc452fd0db1441c3f496d" "checksum core-foundation-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e7ca8a5221364ef15ce201e8ed2f609fc312682a8f4e0e3d4aa5879764e0fa3b" "checksum cranelift-bforest 0.50.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bd05aac8cefcde54ce26178df8f36cb1f518ac691db650e7d2440c2b6b41c4dc" @@ -8230,7 +8437,7 @@ dependencies = [ "checksum crossbeam-deque 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c3aa945d63861bfe624b55d153a39684da1e8c0bc8fba932f7ee3a3c16cea3ca" "checksum crossbeam-epoch 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5064ebdbf05ce3cb95e45c8b086f72263f4166b29b97f6baff7ef7fe047b55ac" "checksum crossbeam-queue 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7c979cd6cfe72335896575c6b5688da489e420d36a27a0b9eb0c73db574b4a4b" -"checksum crossbeam-queue 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "dfd6515864a82d2f877b42813d4553292c6659498c9a2aa31bab5a15243c2700" +"checksum crossbeam-queue 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c695eeca1e7173472a32221542ae469b3e9aac3a4fc81f7696bcad82029493db" "checksum crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)" = "04973fa96e96579258a5091af6003abde64af786b860f18622b82e026cca60e6" "checksum crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ce446db02cdc3165b94ae73111e570793400d0794e46125cc4056c81cbb039f4" "checksum crunchy 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" @@ -8252,9 +8459,11 @@ dependencies = [ "checksum dirs-sys 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "afa0b23de8fd801745c471deffa6e12d248f962c9fd4b4c33787b055599bde7b" "checksum dns-parser 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c4d33be9473d06f75f58220f71f7a9317aca647dc061dbd3c361b0bef505fbea" "checksum doc-comment 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "923dea538cea0aa3025e8685b20d6ee21ef99c4f77e954a30febbaac5ec73a97" +"checksum dtoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "ea57b42383d091c85abcc2706240b94ab2a8fa1fc81c10ff23c4de06e2a90b5e" "checksum ed25519-dalek 1.0.0-pre.3 (registry+https://github.com/rust-lang/crates.io-index)" = "978710b352437433c97b2bff193f2fb1dfd58a093f863dd95e225a19baa599a2" "checksum either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3" "checksum elastic-array 0.10.3 (registry+https://github.com/rust-lang/crates.io-index)" = "580f3768bd6465780d063f5b8213a2ebd506e139b345e4a81eb301ceae3d61e1" +"checksum encoding_rs 0.8.22 (registry+https://github.com/rust-lang/crates.io-index)" = "cd8d03faa7fe0c1431609dfad7bbe827af30f82e1e2ae6f7ee4fca6bd764bc28" "checksum enumflags2 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "33121c8782ba948ba332dab29311b026a8716dc65a1599e5b88f392d38496af8" "checksum enumflags2_derive 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ecf634c5213044b8d54a46dd282cf5dd1f86bb5cb53e92c409cb4680a7fb9894" "checksum env_logger 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "aafcde04e90a5226a6443b7aabdb016ba2f8307c847d524724bd9b346dd1a2d3" @@ -8263,6 +8472,7 @@ dependencies = [ "checksum erased-serde 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "3beee4bc16478a1b26f2e80ad819a52d24745e292f521a63c16eea5f74b7eb60" "checksum errno 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "c2a071601ed01b988f896ab14b95e67335d1eeb50190932a1320f7fe3cadc84e" "checksum errno-dragonfly 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "14ca354e36190500e1e1fb267c647932382b54053c50b14970856c0b00a35067" +"checksum error-chain 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3ab49e9dcb602294bc42f9a7dfc9bc6e936fca4418ea300dbfb84fe16de0b7d9" "checksum evm 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)" = "32a2c6961fdc9952371fc5f0416f03a9d90378a9dfb6862f6a7a9a3b8986b8dd" "checksum evm-core 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3bcde5af3d542874ddeb53de0919302d57586ea04b3f76f54d865f8a6cdc70ae" "checksum evm-gasometer 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b82bc9f275cb59d2bcc05d85c98736ddfaba003a7ef7b73893fa7c1c1fab29dc" @@ -8276,7 +8486,7 @@ dependencies = [ "checksum fdlimit 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b1ee15a7050e5580b3712877157068ea713b245b080ff302ae2ca973cfcd9baa" "checksum file-per-thread-logger 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "8505b75b31ef7285168dd237c4a7db3c1f3e0927e7d314e670bc98e854272fe9" "checksum finality-grandpa 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4106eb29c7e092f4a6ce6e7632abbbfdf85d94e63035d3790d2d16eeae83d3f4" -"checksum fixed-hash 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "72fe7539e2c5692c6989f2f9c0457e42f1e5768f96b85c87d273574670ae459f" +"checksum fixed-hash 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "3367952ceb191f4ab95dd5685dc163ac539e36202f9fcfd0cb22f9f9c542fefc" "checksum fixedbitset 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "86d4de0081402f5e88cdac65c8dcdcc73118c1a7a465e2a05f0da05843a8ea33" "checksum flate2 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)" = "6bd6d6f4752952feb71363cffc9ebac9411b75b87c6ab6058c40c8900cf43c0f" "checksum fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3" @@ -8324,7 +8534,7 @@ dependencies = [ "checksum hashbrown 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8e6073d0ca812575946eb5f35ff68dbe519907b25c42530389ff946dc84c6ead" "checksum heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1679e6ea370dee694f91f1dc469bf94cf8f52051d147aec3e1f9497c6fc22461" "checksum heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205" -"checksum hermit-abi 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "307c3c9f937f38e3534b1d6447ecf090cafcc9744e4a6360e8b037b2cf5af120" +"checksum hermit-abi 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "f629dc602392d3ec14bfc8a09b5e644d7ffd725102b48b81e59f90f2633621d7" "checksum hex 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "023b39be39e3a2da62a94feb433e91e8bcd37676fbc8bea371daf52b7a769a3e" "checksum hex-literal 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "961de220ec9a91af2e1e5bd80d02109155695e516771762381ef8581317066e0" "checksum hex-literal-impl 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9d4c5c844e2fee0bf673d54c2c177f1713b3d2af2ff6e666b49cb7572e6cf42d" @@ -8355,7 +8565,7 @@ dependencies = [ "checksum itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f56a2d0bc861f9165be4eb3442afd3c236d8a98afd426f65d92324ae1091a484" "checksum itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "501266b7edd0174f8530248f87f99c88fbe60ca4ef3dd486835b8d8d53136f7f" "checksum jobserver 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)" = "f2b1d42ef453b30b7387e113da1c83ab1605d90c5b4e0eb8e96d016ed3b8c160" -"checksum js-sys 0.3.32 (registry+https://github.com/rust-lang/crates.io-index)" = "1c840fdb2167497b0bd0db43d6dfe61e91637fa72f9d061f8bd17ddc44ba6414" +"checksum js-sys 0.3.33 (registry+https://github.com/rust-lang/crates.io-index)" = "367647c532db6f1555d7151e619540ec5f713328235b8c062c6b4f63e84adfe3" "checksum jsonrpc-client-transports 14.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "0a9ae166c4d1f702d297cd76d4b55758ace80272ffc6dbb139fdc1bf810de40b" "checksum jsonrpc-core 14.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fe3b688648f1ef5d5072229e2d672ecb92cbff7d1c79bcf3fd5898f3f3df0970" "checksum jsonrpc-core-client 14.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "080dc110be17701097df238fad3c816d4a478a1899dfbcf8ec8957dd40ec7304" @@ -8397,7 +8607,11 @@ dependencies = [ "checksum libp2p-websocket 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0d74d4fc229ad7e8d1a973178786bdcd5dadbdd7b9822c4477c8687df6f82f66" "checksum libp2p-yamux 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1913eb7dd6eb5515957b6f1770296f6921968db87bc9b985f0e974b6657e1003" "checksum librocksdb-sys 6.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "0a0785e816e1e11e7599388a492c61ef80ddc2afc91e313e61662cce537809be" +<<<<<<< HEAD "checksum libsecp256k1 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "df6edf84fd62aad1c93932b39324eaeda3912c1d26bc18dfaee6293848e49a50" +======= +"checksum libsecp256k1 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "b0885ff5b8070cdafbf65b3d098a0b7daf4925a18a704d3c503996443b799cc2" +>>>>>>> 9044da2b8... Refactor rebase master prometheus_v0.3 "checksum libz-sys 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)" = "2eb5e43362e38e2bca2fd5f5134c4d4564a23a5c28e9b95411652021a8675ebe" "checksum linked-hash-map 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ae91b68aebc4ddb91978b11a1b02ddd8602a05ec19002801c5666000e05e0f83" "checksum linked_hash_set 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3c7c91c4c7bbeb4f2f7c4e5be11e6a05bd6830bc37249c47ce1ad86ad453ff9c" @@ -8418,6 +8632,8 @@ dependencies = [ "checksum memory_units 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "71d96e3f3c0b6325d8ccd83c33b28acb183edcb6c67938ba104ec546854b0882" "checksum merlin 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2b0942b357c1b4d0dc43ba724674ec89c3218e6ca2b3e8269e7cb53bcecd2f6e" "checksum mime 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ba626b8a6de5da682e1caa06bdb42a335aee5a84db8e5046a3e8ab17ba0a3ae0" +"checksum mime 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)" = "dd1d63acd1b78403cc0c325605908475dd9b9a3acbf65ed8bcab97e27014afcf" +"checksum mime_guess 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1a0ed03949aef72dbdf3116a383d7b38b4768e6f960528cd6a6044aa9ed68599" "checksum miniz_oxide 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6f3f74f726ae935c3f514300cc6773a0c9492abc5e972d42ba0c0ebb88757625" "checksum mio 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)" = "302dec22bcf6bae6dfb69c647187f4b4d0fb6f535521f7bc022430ce8e12008f" "checksum mio-extras 2.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "52403fe290012ce777c4626790c8951324a2b9e3316b3143779c72b029742f19" @@ -8432,6 +8648,7 @@ dependencies = [ "checksum nix 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6c722bee1037d430d0f8e687bbdbf222f27cc6e4e68d5caf630857bb2b6dbdce" "checksum nodrop 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" "checksum nohash-hasher 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4e657a6ec97f9a3ba46f6f7034ea6db9fcd5b71d25ef1074b7bc03da49be0e8e" +"checksum nom 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "a5b8c256fd9471521bcb84c3cdba98921497f1a331cbc15b8030fc63b82050ce" "checksum nom 4.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2ad2a91a8e869eeb30b9cb3119ae87773a8f4ae617f41b1eb9c154b2905f7bd6" "checksum num-bigint 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "f9c3f34cdd24f334cb265d9bf8bfa8a241920d026916785747a92f0e55541a1a" "checksum num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)" = "b85e541ef8255f6cf42bbfe4ef361305c6c135d10919ecc26126c4e5ae94bc09" @@ -8489,11 +8706,14 @@ dependencies = [ "checksum proc-macro-nested 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "369a6ed065f249a159e06c45752c780bda2fb53c995718f9e484d08daa9eb42e" "checksum proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)" = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" "checksum proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "9c9e470a8dc4aeae2dee2f335e8f533e2d4b347e1434e5671afc49b054592f27" +"checksum procinfo 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f42e8578852a3306838981aedad8c5642ba794929aa12af0c9eb6c072b77af6c" +"checksum prometheus 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5567486d5778e2c6455b1b90ff1c558f29e751fc018130fa182e15828e728af1" "checksum prost 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "96d14b1c185652833d24aaad41c5832b0be5616a590227c1fbff57c616754b23" "checksum prost-build 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "eb788126ea840817128183f8f603dce02cb7aea25c2a0b764359d8e20010702e" "checksum prost-derive 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5e7dc378b94ac374644181a2247cebf59a6ec1c88b49ac77f3a94b86b79d0e11" "checksum prost-types 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1de482a366941c8d56d19b650fac09ca08508f2a696119ee7513ad590c8bac6f" "checksum protobuf 2.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "40361836defdd5871ff7e84096c6f6444af7fc157f8ef1789f54f147687caa20" +"checksum publicsuffix 1.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3bbaa49075179162b49acac1c6aa45fb4dafb5f13cf6794276d77bc7fd95757b" "checksum pwasm-utils 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4f7a12f176deee919f4ba55326ee17491c8b707d0987aed822682c821b660192" "checksum quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9274b940887ce9addde99c4eee6b5c44cc494b182b97e73dc8ffdcb3397fd3f0" "checksum quickcheck 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d5ca504a2fdaa08d3517f442fbbba91ac24d1ec4c51ea68688a038765e3b2662" @@ -8519,8 +8739,8 @@ dependencies = [ "checksum rand_xoshiro 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "03b418169fb9c46533f326efd6eed2576699c44ca92d3052a066214a8d828929" "checksum rand_xoshiro 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0e18c91676f670f6f0312764c759405f13afb98d5d73819840cf72a518487bff" "checksum raw-cpuid 7.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "b4a349ca83373cfa5d6dbb66fd76e58b2cca08da71a5f6400de0a0a6a9bceeaf" -"checksum rayon 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "43739f8831493b276363637423d3622d4bd6394ab6f0a9c4a552e208aeb7fddd" -"checksum rayon-core 1.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f8bf17de6f23b05473c437eb958b9c850bfc8af0961fe17b4cc92d5a627b4791" +"checksum rayon 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "db6ce3297f9c85e16621bb8cca38a06779ffc31bb8184e1be4bed2be4678a098" +"checksum rayon-core 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "08a89b46efaf957e52b18062fb2f4660f8b8a4dde1807ca002690868ef2c85a9" "checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" "checksum redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)" = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" "checksum redox_users 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4ecedbca3bf205f8d8f5c2b44d83cd0690e39ee84b951ed649e9f1841132b66d" @@ -8529,6 +8749,7 @@ dependencies = [ "checksum regex-syntax 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)" = "11a7e20d1cce64ef2fed88b66d347f88bd9babb82845b2b858f3edbf59a4f716" "checksum region 2.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "448e868c6e4cfddfa49b6a72c95906c04e8547465e9536575b95c70a4044f856" "checksum remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4a83fa3702a688b9359eccba92d153ac33fd2e8462f9e0e3fdf155239ea7792e" +"checksum reqwest 0.9.24 (registry+https://github.com/rust-lang/crates.io-index)" = "f88643aea3c1343c804950d7bf983bd2067f5ab59db6d613a08e05572f2714ab" "checksum ring 0.16.9 (registry+https://github.com/rust-lang/crates.io-index)" = "6747f8da1f2b1fabbee1aaa4eb8a11abf9adef0bf58a41cee45db5d59cecdfac" "checksum rlp 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3a44d5ae8afcb238af8b75640907edc6c931efcfab2c854e81ed35fa080f84cd" "checksum rocksdb 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "12069b106981c6103d3eab7dd1c86751482d0779a520b7c14954c8b586c1e643" @@ -8536,6 +8757,7 @@ dependencies = [ "checksum rust-argon2 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4ca4eaef519b494d1f2848fc602d18816fed808a981aedf4f1f00ceb7c9d32cf" "checksum rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" "checksum rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "403bb3a286107a04825a5f82e1270acc1e14028d3d554d7a1e08914549575ab8" +"checksum rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "c5f5376ea5e30ce23c03eb77cbe4962b988deead10910c372b226388b594c084" "checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" "checksum rustls 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b25a18b1bf7387f0145e7f8324e700805aade3842dd3db2e74e4cdeb4677c09e" "checksum rustversion 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c48f91977f4ef3be5358c15d131d3f663f6b4d7a112555bf3bf52ad23b6659e5" @@ -8553,13 +8775,15 @@ dependencies = [ "checksum sct 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e3042af939fca8c3453b7af0f1c66e533a15a86169e39de2657310ade8f98d3c" "checksum security-framework 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8ef2429d7cefe5fd28bd1d2ed41c944547d4ff84776f5935b456da44593a16df" "checksum security-framework-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e31493fc37615debb8c5090a7aeb4a9730bc61e77ab10b9af59f1a202284f895" +"checksum semver 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)" = "d4f410fedcf71af0345d7607d246e7ad15faaadd49d240ee3b24e5dc21a820ac" "checksum semver 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a3186ec9e65071a2095434b1f5bb24838d4e8e130f584c790f6033c79943537" "checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" "checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" "checksum send_wrapper 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a0eddf2e8f50ced781f288c19f18621fa72a3779e3cb58dbf23b07469b0abeb4" -"checksum serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)" = "1217f97ab8e8904b57dd22eb61cde455fa7446a9c1cf43966066da047c1f3702" -"checksum serde_derive 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)" = "a8c6faef9a2e64b0064f48570289b4bf8823b7581f1d6157c1b52152306651d0" +"checksum serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)" = "414115f25f818d7dfccec8ee535d76949ae78584fc4f79a6f45a904bf8ab4449" +"checksum serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)" = "128f9e303a5a29922045a830221b8f78ec74a5f544944f3d5984f8ec3895ef64" "checksum serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)" = "48c575e0cc52bdd09b47f330f646cf59afc586e9c4e3ccd6fc1f625b8ea1dad7" +"checksum serde_urlencoded 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "642dd69105886af2efd227f75a520ec9b44a820d65bc133a9131f7d229fd165a" "checksum sha-1 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "23962131a91661d643c98940b20fcaffe62d776a823247be80a48fcb8b6fce68" "checksum sha1 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d" "checksum sha2 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7b4d8bfd0e469f417657573d8451fb33d16cfe0989359b93baf3a1ffc639543d" @@ -8572,7 +8796,7 @@ dependencies = [ "checksum slog-scope 4.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7c44c89dd8b0ae4537d1ae318353eaf7840b4869c536e31c41e963d1ea523ee6" "checksum slog_derive 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a945ec7f7ce853e89ffa36be1e27dce9a43e82ff9093bf3461c30d5da74ed11b" "checksum smallvec 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "f7b0758c52e15a8b5e3691eae6cc559f08eee9406e548a4477ba4e67770a82b6" -"checksum smallvec 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4ecf3b85f68e8abaa7555aa5abdb1153079387e60b718283d732f03897fcfc86" +"checksum smallvec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "44e59e0c9fa00817912ae6e4e6e3c4fe04455e75699d06eedc7d85917ed8e8f4" "checksum snow 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "afb767eee7d257ba202f0b9b08673bc13b22281632ef45267b19f13100accd2f" "checksum soketto 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "bceb1a3a15232d013d9a3b7cac9e5ce8e2313f348f01d4bc1097e5e53aa07095" "checksum sourcefile 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "4bf77cb82ba8453b42b6ae1d692e4cdc92f9a47beaf89a847c8be83f4e328ad3" @@ -8610,9 +8834,9 @@ dependencies = [ "checksum tiny-bip39 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c1c5676413eaeb1ea35300a0224416f57abc3bd251657e0fafc12c47ff98c060" "checksum tiny-keccak 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d8a021c69bb74a44ccedb824a046447e2c84a01df9e5c20779750acb38e11b2" "checksum tiny-keccak 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2953ca5148619bc99695c1274cb54c5275bbb913c6adad87e72eaf8db9787f69" -"checksum tinytemplate 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4574b75faccaacddb9b284faecdf0b544b80b6b294f3d062d325c5726a209c20" +"checksum tinytemplate 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "57a3c6667d3e65eb1bc3aed6fd14011c6cbc3a0665218ab7f5daf040b9ec371a" "checksum tokio 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)" = "5a09c0b5bb588872ab2f09afa13ee6e9dac11e10a0ec9e8e3ba39a5a5d530af6" -"checksum tokio 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "bcced6bb623d4bff3739c176c415f13c418f426395c169c9c3cd9a492c715b16" +"checksum tokio 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0e1bef565a52394086ecac0a6fa3b8ace4cb3a138ee1d96bd2b93283b56824e3" "checksum tokio-buf 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8fb220f46c53859a4b7ec083e41dec9778ff0b1851c0942b211edb89e0ccdc46" "checksum tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5c501eceaf96f0e1793cf26beb63da3d11c738c4a943fdf3746d81d64684c39f" "checksum tokio-current-thread 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "d16217cad7f1b840c5a97dfb3c43b0c871fef423a6e8d2118c604e843662a443" @@ -8634,16 +8858,17 @@ dependencies = [ "checksum tokio-util 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "571da51182ec208780505a32528fc5512a8fe1443ab960b3f2f3ef093cd16930" "checksum toml 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "01d1404644c8b12b16bfcffa4322403a91a451584daaaa7c28d3152e6cbc98cf" "checksum tower-service 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e987b6bf443f4b5b3b6f38704195592cca41c5bb7aedd3c3693c7081f8289860" -"checksum tracing 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "ff4e4f59e752cb3beb5b61c6d5e11191c7946231ba84faec2902c9efdd8691c5" -"checksum tracing-attributes 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "a4263b12c3d3c403274493eb805966093b53214124796552d674ca1dd5d27c2b" -"checksum tracing-core 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "bc913647c520c959b6d21e35ed8fa6984971deca9f0a2fcb8c51207e0c56af1d" +"checksum tracing 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "6de6a8590a29d3f401eab60470c699efa0adf7b4f0352055bf24df2b69849b40" +"checksum tracing-attributes 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "04cfd395def5a60236e187e1ff905cb55668a59f29928dec05e6e1b1fd2ac1f3" +"checksum tracing-core 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "d7fb511ac6ca1d031c5cfc26d8c38da9d88e91d2bd5b38b60cf8dc1b8b5c211f" "checksum traitobject 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "efd1f82c56340fdf16f2a953d7bda4f8fdffba13d93b00844c25572110b26079" "checksum trie-bench 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)" = "403d8ec7dbc4b46781ef18cd96b371bb9ce6ec394fe83ece75eb3bc755dfa69f" "checksum trie-db 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)" = "784a9813d23f18bccab728ab039c39b8a87d0d6956dcdece39e92f5cffe5076e" "checksum trie-root 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0b779f7c1c8fe9276365d9d5be5c4b5adeacf545117bb3f64c974305789c5c0b" "checksum trie-standardmap 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c3161ba520ab28cd8e6b68e1126f1009f6e335339d1a73b978139011703264c8" "checksum try-lock 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e604eb7b43c06650e854be16a2a03155743d3752dd1c943f6829e26b7a36e382" -"checksum trybuild 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)" = "b75e31d624df08744532e935f1d4bfedd319a277d5a162c5b15f6ced59307575" +"checksum try_from 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "283d3b89e1368717881a9d51dad843cc435380d8109c9e47d38780a324698d8b" +"checksum trybuild 1.0.19 (registry+https://github.com/rust-lang/crates.io-index)" = "987d6fdc45ddd7f3be5aa7386c8c8a844d1655c95b9ed948a9cd9cded8f2b79f" "checksum twofish 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712d261e83e727c8e2dbb75dacac67c36e35db36a958ee504f2164fc052434e1" "checksum twox-hash 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3bfd5b7557925ce778ff9b9ef90e3ade34c524b5ff10e239c69a42d546d2af56" "checksum typeable 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1410f6f91f21d1612654e7cc69193b0334f909dcf2c790c4826254fbb86f8887" @@ -8661,6 +8886,7 @@ dependencies = [ "checksum untrusted 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "60369ef7a31de49bcb3f6ca728d4ba7300d9a1658f94c727d4cab8c8d9f4aece" "checksum url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355a" "checksum url 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "75b414f6c464c879d7f9babf951f23bc3743fb7313c081b2e6ca719067ea9d61" +"checksum uuid 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)" = "90dbc611eb48397705a6b0f6e917da23ae517e4d127123d2cf7674206627d32a" "checksum vcpkg 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3fc439f2794e98976c88a2a2dafce96b930fe8010b0a256b3c2199a773933168" "checksum vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a" "checksum vergen 3.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "6aba5e34f93dc7051dfad05b98a18e9156f27e7b431fe1d2398cb6061c0a1dba" @@ -8673,13 +8899,13 @@ dependencies = [ "checksum want 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b6395efa4784b027708f7451087e647ec73cc74f5d9bc2e418404248d679a230" "checksum want 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" "checksum wasi 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b89c3ce4ce14bdc6fb6beaf9ec7928ca331de5df7e5ea278375642a2f478570d" -"checksum wasm-bindgen 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)" = "29ae32af33bacd663a9a28241abecf01f2be64e6a185c6139b04f18b6385c5f2" -"checksum wasm-bindgen-backend 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)" = "1845584bd3593442dc0de6e6d9f84454a59a057722f36f005e44665d6ab19d85" +"checksum wasm-bindgen 0.2.56 (registry+https://github.com/rust-lang/crates.io-index)" = "99de4b68939a880d530aed51289a7c7baee154e3ea8ac234b542c49da7134aaf" +"checksum wasm-bindgen-backend 0.2.56 (registry+https://github.com/rust-lang/crates.io-index)" = "b58e66a093a7b7571cb76409763c495b8741ac4319ac20acc2b798f6766d92ee" "checksum wasm-bindgen-futures 0.3.27 (registry+https://github.com/rust-lang/crates.io-index)" = "83420b37346c311b9ed822af41ec2e82839bfe99867ec6c54e2da43b7538771c" -"checksum wasm-bindgen-macro 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)" = "87fcc747e6b73c93d22c947a6334644d22cfec5abd8b66238484dc2b0aeb9fe4" -"checksum wasm-bindgen-macro-support 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)" = "3dc4b3f2c4078c8c4a5f363b92fcf62604c5913cbd16c6ff5aaf0f74ec03f570" -"checksum wasm-bindgen-shared 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)" = "ca0b78d6d3be8589b95d1d49cdc0794728ca734adf36d7c9f07e6459508bb53d" -"checksum wasm-bindgen-webidl 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)" = "3126356474ceb717c8fb5549ae387c9fbf4872818454f4d87708bee997214bb5" +"checksum wasm-bindgen-macro 0.2.56 (registry+https://github.com/rust-lang/crates.io-index)" = "a80f89daea7b0a67b11f6e9f911422ed039de9963dce00048a653b63d51194bf" +"checksum wasm-bindgen-macro-support 0.2.56 (registry+https://github.com/rust-lang/crates.io-index)" = "4f9dbc3734ad6cff6b76b75b7df98c06982becd0055f651465a08f769bca5c61" +"checksum wasm-bindgen-shared 0.2.56 (registry+https://github.com/rust-lang/crates.io-index)" = "d907984f8506b3554eab48b8efff723e764ddbf76d4cd4a3fe4196bc00c49a70" +"checksum wasm-bindgen-webidl 0.2.56 (registry+https://github.com/rust-lang/crates.io-index)" = "f85a3825a459cf6a929d03bacb54dca37a614d43032ad1343ef2d4822972947d" "checksum wasm-gc-api 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d0c32691b6c7e6c14e7f8fd55361a9088b507aa49620fcd06c09b3a1082186b9" "checksum wasm-timer 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "aa3e01d234bb71760e685cfafa5e2c96f8ad877c161a721646356651069e26ac" "checksum wasmi 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bf617d864d25af3587aa745529f7aaa541066c876d57e050c0d0c85c61c92aff" @@ -8689,7 +8915,7 @@ dependencies = [ "checksum wasmtime-environ 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a3947662a0b8e05b1418465e64f16de9114f9fec18cc3f56e0ed5aa7737b89d0" "checksum wasmtime-jit 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6ed7922689461a7b5bd0d9c7350cac526c8a520a23b3ffd7f5b446ac51dfc51f" "checksum wasmtime-runtime 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "781d6bb8b346efaa3dc39746386957cd79b8d841e8652ed9b02d77bcf64fb514" -"checksum web-sys 0.3.32 (registry+https://github.com/rust-lang/crates.io-index)" = "98405c0a2e722ed3db341b4c5b70eb9fe0021621f7350bab76df93b09b649bbf" +"checksum web-sys 0.3.33 (registry+https://github.com/rust-lang/crates.io-index)" = "2fb60433d0dc12c803b9b017b3902d80c9451bab78d27bc3210bf2a7b96593f1" "checksum webpki 0.21.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d7e664e770ac0110e2384769bcc59ed19e329d81f555916a6e072714957b81b4" "checksum webpki-roots 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a262ae37dd9d60f60dd473d1158f9fbebf110ba7b6a5051c8160460f6043718b" "checksum webpki-roots 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)" = "91cd5736df7f12a964a5067a12c62fa38e1bd8080aff1f80bc29be7c80d19ab4" @@ -8704,6 +8930,7 @@ dependencies = [ "checksum winapi-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7168bab6e1daee33b4557efd0e95d5ca70a03706d39fa5f3fe7a236f584b03c9" "checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" "checksum wincolor 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "96f5016b18804d24db43cebf3c77269e7569b8954a8464501c216cc5e070eaa9" +"checksum winreg 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b2986deb581c4fe11b621998a5e53361efe6b48a151178d0cd9eeffa4dc6acc9" "checksum ws 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c51a2c47b5798ccc774ffb93ff536aec7c4275d722fd9c740c83cdd1af1f2d94" "checksum ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" "checksum x25519-dalek 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7ee1585dc1484373cbc1cee7aafda26634665cf449436fd6e24bfd1fad230538" diff --git a/Cargo.toml b/Cargo.toml index 505cd299d9c71..722dd3508087b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -45,6 +45,7 @@ members = [ "client/service", "client/service/test", "client/state-db", + "client/prometheus", "client/telemetry", "client/transaction-pool", "client/transaction-pool/graph", diff --git a/client/Cargo.toml b/client/Cargo.toml index da4f5e3cc2c9b..bb88490e585a8 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -31,6 +31,7 @@ sp-state-machine = { version = "2.0.0", path = "../primitives/state-machine" } sc-telemetry = { version = "2.0.0", path = "telemetry" } sp-trie = { version = "2.0.0", path = "../primitives/trie" } tracing = "0.1.10" +sc-prometheus = { path = "prometheus" } [dev-dependencies] env_logger = "0.7.0" diff --git a/client/cli/Cargo.toml b/client/cli/Cargo.toml index 460cc2a05a32e..6dca93855d0a8 100644 --- a/client/cli/Cargo.toml +++ b/client/cli/Cargo.toml @@ -29,6 +29,7 @@ sp-core = { version = "2.0.0", path = "../../primitives/core" } sc-service = { version = "2.0.0", default-features = false, path = "../service" } sp-state-machine = { version = "2.0.0", path = "../../primitives/state-machine" } sc-telemetry = { version = "2.0.0", path = "../telemetry" } +sc-prometheus = { path = "../prometheus" } sp-keyring = { version = "2.0.0", path = "../../primitives/keyring" } names = "0.11.0" structopt = "=0.3.7" diff --git a/client/cli/src/informant/display.rs b/client/cli/src/informant/display.rs index 1742becb865c4..f0b6e61176de7 100644 --- a/client/cli/src/informant/display.rs +++ b/client/cli/src/informant/display.rs @@ -21,7 +21,7 @@ use sc_network::SyncState; use sp_runtime::traits::{Block as BlockT, CheckedDiv, NumberFor, Zero, Saturating}; use sc_service::NetworkStatus; use std::{convert::{TryFrom, TryInto}, fmt, time}; - +use sc_prometheus::prometheus_gauge; /// State of the informant display system. /// /// This is the system that handles the line that gets regularly printed and that looks something @@ -63,7 +63,10 @@ impl InformantDisplay { let (status, target) = match (net_status.sync_state, net_status.best_seen_block) { (SyncState::Idle, _) => ("Idle".into(), "".into()), (SyncState::Downloading, None) => (format!("Syncing{}", speed), "".into()), - (SyncState::Downloading, Some(n)) => (format!("Syncing{}", speed), format!(", target=#{}", n)), + (SyncState::Downloading, Some(n)) => { + prometheus_gauge!(TARGET_NUM => n.saturated_into().try_into().unwrap()); + (format!("Syncing{}", speed), format!(", target=#{}", n)) + } }; info!( diff --git a/client/cli/src/lib.rs b/client/cli/src/lib.rs index 19ee599e022d5..922c2d77896d9 100644 --- a/client/cli/src/lib.rs +++ b/client/cli/src/lib.rs @@ -941,7 +941,13 @@ where config.tracing_targets = cli.tracing_targets.into(); config.tracing_receiver = cli.tracing_receiver.into(); - + + match cli.prometheus_endpoint { + None => {config.prometheus_endpoint = None;}, + Some(x) => { + config.prometheus_endpoint = Some(parse_address(&format!("{}:{}", x, 33333), cli.prometheus_port)?); + } + } // Imply forced authoring on --dev config.force_authoring = cli.shared_params.dev || cli.force_authoring; diff --git a/client/cli/src/params.rs b/client/cli/src/params.rs index 780dcd49830b0..79de3384e3168 100644 --- a/client/cli/src/params.rs +++ b/client/cli/src/params.rs @@ -440,6 +440,12 @@ pub struct RunCmd { /// Use `--unsafe-ws-external` to suppress the warning if you understand the risks. #[structopt(long = "ws-external")] pub ws_external: bool, + /// Prometheus exporter TCP port. + #[structopt(long = "prometheus-port", value_name = "PORT")] + pub prometheus_port: Option, + /// Prometheus exporter IP addr. + #[structopt(long = "prometheus-addr", value_name = "Local IP address")] + pub prometheus_endpoint: Option, /// Listen to all Websocket interfaces. /// diff --git a/client/prometheus/Cargo.toml b/client/prometheus/Cargo.toml new file mode 100644 index 0000000000000..29d81c9e5fda8 --- /dev/null +++ b/client/prometheus/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "sc-prometheus" +version = "2.0.0" +authors = ["Parity Technologies "] +description = "prometheus utils" +edition = "2018" + +[dependencies] +hyper = "0.12" +lazy_static = "1.0" +log = "0.4" +prometheus = { version = "0.7", features = ["nightly", "process"]} +tokio = "0.1" + +[dev-dependencies] +reqwest = "0.9" \ No newline at end of file diff --git a/client/prometheus/README.md b/client/prometheus/README.md new file mode 100644 index 0000000000000..ced9730696e27 --- /dev/null +++ b/client/prometheus/README.md @@ -0,0 +1,430 @@ +# Substrate Prometheus Node Exporter + +## Introduction + +Prometheus is one of the most widely used monitoring tool for managing high availability services supported by [Cloud Native Computing Foundation](https://www.cncf.io/). By providing Prometheus exporter in substrate, node operators can easily adopt widely used display/alert tool such as Grafana without seting-up/operating external Prometheus agent through RPC connections. Easy access to such monitoring tools will benefit parachain develepers/operators and validators to have much higher availability quality of their services. + +## List of Contents + +Hack Prometheus in Substrate + - Prometheus starter + - CLI Config + - Metrics Add + +Metrics + - List of available metrics + +Start Prometheus + - Install prometheus + - Edit Prometheus config file + - Start Prometheus + +Start Grafana + - Install Grafana + +## Substrate Dev hack +### Prometheus starter + +Here is the entry point of prometheus core module in Parity Substrate. + +client/prometheus/src/lib.rs +```rust +#[macro_use] +extern crate lazy_static; +#[macro_use] +extern crate log; +use hyper::http::StatusCode; +use hyper::rt::Future; +use hyper::service::service_fn_ok; +use hyper::{Body, Request, Response, Server}; +pub use prometheus::{Encoder, HistogramOpts, Opts, TextEncoder}; +pub use prometheus::{Histogram, IntCounter, IntGauge, Result}; +pub use sr_primitives::traits::SaturatedConversion; +use std::net::SocketAddr; + +pub mod metrics; + +/// Initializes the metrics context, and starts an HTTP server +/// to serve metrics. +pub fn init_prometheus(prometheus_addr: SocketAddr) { + let addr = prometheus_addr; + let server = Server::bind(&addr) + .serve(|| { + // This is the `Service` that will handle the connection. + // `service_fn_ok` is a helper to convert a function that + // returns a Response into a `Service`. + service_fn_ok(move |req: Request| { + if req.uri().path() == "/metrics" { + let metric_families = prometheus::gather(); + let mut buffer = vec![]; + let encoder = TextEncoder::new(); + encoder.encode(&metric_families, &mut buffer).unwrap(); + Response::builder() + .status(StatusCode::OK) + .header("Content-Type", encoder.format_type()) + .body(Body::from(buffer)) + .expect("Sends OK(200) response with one or more data metrics") + } else { + Response::builder() + .status(StatusCode::NOT_FOUND) + .body(Body::from("Not found.")) + .expect("Sends NOT_FOUND(404) message with no data metric") + } + }) + }) + .map_err(|e| error!("server error: {}", e)); + + info!("Exporting metrics at http://{}/metrics", addr); + + let mut rt = tokio::runtime::Builder::new() + .core_threads(1) // one thread is sufficient + .build() + .expect("Builds one thread of tokio runtime exporter for prometheus"); + + std::thread::spawn(move || { + rt.spawn(server); + rt.shutdown_on_idle().wait().unwrap(); + }); +} + +#[macro_export] +macro_rules! prometheus_gauge( + ($($metric:expr => $value:expr),*) => { + use $crate::{metrics::*}; + $( + metrics::set_gauge(&$metric, $value); + )* + } +); + +#[macro_export] +macro_rules! prometheus_histogram( + ($($metric:expr => $value:expr),*) => { + use $crate::{metrics::*}; + $( + metrics::set_histogram(&$metric, $value); + )* + } +); + +#[macro_export] +macro_rules! prometheus_counter( + ($($metric:expr => $value:expr),*) => { + use $crate::{metrics::*}; + $( + metrics::set_counter(&$metric, $value); + )* + } +); + +/* +TODO: Make abstract type for all metrics(e.g. Gauge, Histogram, Counter) with generic traits so that all metrics can be set up with one function `set` +#[macro_export] +macro_rules! prometheus( + ($($a: expr; $metric:expr => $value:expr),*) => { + use $crate::{metrics::*}; + $( + metrics::set(#$a, &$metric, $value); + )* + } +); +*/ +``` + +Here is the dependancies of the module. +client/prometheus/Cargo.toml +```toml +[package] +name = "substrate-prometheus" +version = "2.0.0" +authors = ["Parity Technologies "] +description = "prometheus utils" +edition = "2018" + +[dependencies] +hyper = "0.12" +lazy_static = "1.0" +log = "0.4" +prometheus = { version = "0.7", features = ["nightly", "process"]} +tokio = "0.1" + +[dev-dependencies] +reqwest = "0.9" +``` + +**Abbreviation of the package in service manager of parity substrate** +client/service/Cargo.toml +```toml +.... +promet = { package = "substrate-prometheus", path="../../core/prometheus"} +.... +``` + +**Metrics builder as same as substrate-telemetry** +client/service/src/builder.rs +```rust + + ..... + let _ = to_spawn_tx.unbounded_send(Box::new(future + .select(exit.clone()) + .then(|_| Ok(())))); + telemetry + }); +---------------- +match config.prometheus_endpoint { + None => (), + Some(x) => {let _prometheus = promet::init_prometheus(x);} + } + +------------------- + Ok(NewService { + client, + network, + ..... +``` +substrate/Cargo.toml +```toml + .... +[workspace] +members = [ + "client/prometheus", + .... +``` +### CLI Config +client/cli/src/lib.rs +```rust +fn crate_run_node_config +... +} + + match cli.prometheus_endpoint { + None => {config.prometheus_endpoint = None;}, + Some(x) => { + config.prometheus_endpoint = Some(parse_address(&format!("{}:{}", x, 33333), cli.prometheus_port)?); + } + } +... + +``` + +client/cli/src/params.rs +```rust +pub struct RunCmd{ +/// Specify HTTP RPC server TCP port. +#[structopt(long = "prometheus-port", value_name = "PORT")] + pub prometheus_port: Option, +#[structopt(long = "prometheus-addr", value_name = "Local IP address")] + pub prometheus_endpoint: Option, +} +``` +client/service/src/config.rs +```rust +#[derive(Clone)] +pub struct Configuration { + ... + pub prometheus_endpoint: Option, + ... +} +impl Configuration where + C: Default, + G: RuntimeGenesis, + E: Extension, +{ + /// Create default config for given chain spec. + pub fn default_with_spec(chain_spec: ChainSpec) -> Self { + let mut configuration = Configuration { + ... + prometheus_endpoints: None, + ... + }; + configuration.network.boot_nodes = configuration.chain_spec.boot_nodes().to_vec(); + + configuration.telemetry_endpoints = configuration.chain_spec.telemetry_endpoints().clone(); + + configuration + } +``` + + + +### Metrics Add +ex) consensus_FINALITY_HEIGHT + +client/prometheus/src/metrics.rs + +```rust +pub use crate::*; + +pub fn try_create_int_gauge(name: &str, help: &str) -> Result { + let opts = Opts::new(name, help); + let gauge = IntGauge::with_opts(opts)?; + prometheus::register(Box::new(gauge.clone()))?; + Ok(gauge) +} + +pub fn set_gauge(gauge: &Result, value: u64) { + if let Ok(gauge) = gauge { + gauge.set(value as i64); + } +} + +lazy_static! { + pub static ref FINALITY_HEIGHT: Result = try_create_int_gauge( + "consensus_finality_block_height_number", + "block is finality HEIGHT" + + ); +} +``` +client/service/Cargo.toml +```rust +... +promet = { package = "substrate-prometheus", path="../prometheus"} +... +``` +client/service/src/builder.rs +```rust +..... +use promet::{prometheus_gauge}; +..... + let tel_task = state_rx.for_each(move |(net_status, _)| { + let info = client_.info(); + let best_number = info.chain.best_number.saturated_into::(); + let best_hash = info.chain.best_hash; + let num_peers = net_status.num_connected_peers; + let txpool_status = transaction_pool_.status(); + let finalized_number: u64 = info.chain.finalized_number.saturated_into::(); + let bandwidth_download = net_status.average_download_per_sec; + let bandwidth_upload = net_status.average_upload_per_sec; + + let used_state_cache_size = match info.used_state_cache_size { + Some(size) => size, + None => 0, + }; + + // get cpu usage and memory usage of this process + let (cpu_usage, memory) = if let Some(self_pid) = self_pid { + if sys.refresh_process(self_pid) { + let proc = sys.get_process(self_pid) + .expect("Above refresh_process succeeds, this should be Some(), qed"); + (proc.cpu_usage(), proc.memory()) + } else { (0.0, 0) } + } else { (0.0, 0) }; + + telemetry!( + SUBSTRATE_INFO; + "system.interval"; + "peers" => num_peers, + "height" => best_number, + "best" => ?best_hash, + "txcount" => txpool_status.ready, + "cpu" => cpu_usage, + "memory" => memory, + "finalized_height" => finalized_number, + "finalized_hash" => ?info.chain.finalized_hash, + "bandwidth_download" => bandwidth_download, + "bandwidth_upload" => bandwidth_upload, + "used_state_cache_size" => used_state_cache_size, + ); + + prometheus_gauge!( + MEMPOOL_SIZE => used_state_cache_size as u64, + NODE_MEMORY => memory as u64, + NODE_CPU => cpu_usage as u64, + TX_COUNT => txpool_status.ready as u64, + FINALITY_HEIGHT => finalized_number as u64, + BEST_HEIGHT => best_number as u64, + P2P_PEERS_NUM => num_peers as u64, + P2P_NODE_DOWNLOAD => net_status.average_download_per_sec as u64, + P2P_NODE_UPLOAD => net_status.average_upload_per_sec as u64 + ); +..... +``` +## Metrics + +substrate can report and serve the Prometheus metrics, which in their turn can be consumed by Prometheus collector(s). + +This functionality is disabled by default. + +To enable the Prometheus metrics, set in your cli command (--prometheus-addr,--prometheus-port ). +Metrics will be served under /metrics on 33333 port by default. + +### List of available metrics + + +Consensus metrics, namespace: `substrate` + +| **Name** | **Type** | **Tags** | **Description** | +| -------------------------------------- | --------- | -------- | --------------------------------------------------------------- | +| consensus_finality_block_height_number | IntGauge | | finality Height of the chain | +| consensus_best_block_height_number | IntGauge | | best Height of the chain | +| consensus_target_syn_number | IntGauge | | syning Height target number | +| consensus_block_interval_seconds | Histogram | | Time between this and last block (Block.Header.Time) in seconds | +| consensus_num_txs | Gauge | | Number of transactions | +| consensus_node_memory | IntGauge | | Node's primary memory | +| consensus_node_cpu | IntGauge | | Node's cpu load | +| p2p_peers_number | IntGauge | | Number of peers node's connected to | +| p2p_peer_receive_bytes_per_sec | IntGauge | | number of bytes received from a given peer | +| p2p_peer_send_bytes_per_sec | IntGauge | | number of bytes sent to a given peer | +| mempool_size | IntGauge | | Number of uncommitted transactions | + + +## Start Prometheus +### Install prometheus + +https://prometheus.io/download/ +```bash +wget +tar -zxvf +``` + +### Edit Prometheus config file + +You can visit [prometheus.yml](https://github.com/prometheus/prometheus/blob/master/documentation/examples/prometheus.yml) to download default `prometheus.yml`. + +Then edit `prometheus.yml` and add `jobs` : + +```yaml + - job_name: kusama + static_configs: + - targets: ['localhost:33333'] + labels: + instance: local-validator +``` + +> Note:value of targets is ip:port which used by substrate monitor + +### Start Prometheus + +```bash +cd +./prometheus +``` + +> The above example, you can save `prometheus.yml` at `~/volumes/prometheus` on your host machine + +You can visit `http://localhost:9090` to see prometheus data. + + + +## Start Grafana +### Install Grafana +https://grafana.com/docs/installation/debian/ + +```bash +apt-get install -y software-properties-common +sudo add-apt-repository "deb https://packages.grafana.com/oss/deb stable main" +wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add - +sudo apt-get update +sudo apt-get install grafana +sudo service grafana-server start +./prometheus +``` + +You can visit `http://localhost:3000/` to open grafana and create your own dashboard. + +> Tips: The default username and password are both admin. We strongly recommend immediately changing your username & password after login + +### Seting Grafana + +Default ID:PW is admin. \ No newline at end of file diff --git a/client/prometheus/src/lib.rs b/client/prometheus/src/lib.rs new file mode 100644 index 0000000000000..c3db7e2d15763 --- /dev/null +++ b/client/prometheus/src/lib.rs @@ -0,0 +1,89 @@ +#[macro_use] +extern crate lazy_static; +#[macro_use] +extern crate log; +use hyper::http::StatusCode; +use hyper::rt::Future; +use hyper::service::service_fn_ok; +use hyper::{Body, Request, Response, Server}; +pub use prometheus::{Encoder, HistogramOpts, Opts, TextEncoder}; +pub use prometheus::{Histogram, IntCounter, IntGauge, Result}; +use std::net::SocketAddr; + +pub mod metrics; + +/// Initializes the metrics context, and starts an HTTP server +/// to serve metrics. +pub fn init_prometheus(prometheus_addr: SocketAddr) { + let addr = prometheus_addr; + let server = Server::bind(&addr) + .serve(|| { + // This is the `Service` that will handle the connection. + // `service_fn_ok` is a helper to convert a function that + // returns a Response into a `Service`. + service_fn_ok(move |req: Request| { + if req.uri().path() == "/metrics" { + let metric_families = prometheus::gather(); + let mut buffer = vec![]; + let encoder = TextEncoder::new(); + encoder.encode(&metric_families, &mut buffer).unwrap(); + Response::builder() + .status(StatusCode::OK) + .header("Content-Type", encoder.format_type()) + .body(Body::from(buffer)) + .expect("Sends OK(200) response with one or more data metrics") + } else { + Response::builder() + .status(StatusCode::NOT_FOUND) + .body(Body::from("Not found.")) + .expect("Sends NOT_FOUND(404) message with no data metric") + } + }) + }) + .map_err(|e| error!("server error: {}", e)); + + info!("Exporting metrics at http://{}/metrics", addr); + + let mut rt = tokio::runtime::Builder::new() + .core_threads(1) // one thread is sufficient + .build() + .expect("Builds one thread of tokio runtime exporter for prometheus"); + + std::thread::spawn(move || { + rt.spawn(server); + rt.shutdown_on_idle().wait().unwrap(); + }); +} + +#[macro_export] +macro_rules! prometheus_gauge( + ($($metric:expr => $value:expr),*) => { + use $crate::{metrics::*}; + $( + metrics::set_gauge(&$metric, $value); + )* + } +); + +#[macro_export] +macro_rules! prometheus_histogram( + ($($metric:expr => $value:expr),*) => { + use $crate::{metrics::*}; + $( + metrics::set_histogram(&$metric, $value); + )* + } +); + +/* +TODO: Make abstract type for all metrics(e.g. Gauge, Histogram, Counter) with generic traits so that all metrics can be set up with one function `set` +#[macro_export] +macro_rules! prometheus( + ($($a: expr; $metric:expr => $value:expr),*) => { + use $crate::{metrics::*}; + $( + metrics::set(#$a, &$metric, $value); + )* + } +); +*/ \ No newline at end of file diff --git a/client/prometheus/src/metrics.rs b/client/prometheus/src/metrics.rs new file mode 100644 index 0000000000000..a2621c3354aea --- /dev/null +++ b/client/prometheus/src/metrics.rs @@ -0,0 +1,78 @@ +pub use crate::*; + +/// Gauge type metrics generation function +pub fn try_create_int_gauge(name: &str, help: &str) -> Result { + let opts = Opts::new(name, help); + let gauge = IntGauge::with_opts(opts)?; + prometheus::register(Box::new(gauge.clone()))?; + Ok(gauge) +} +/// histogram type metrics generation function +pub fn try_create_histogram(name: &str, help: &str) -> Result { + let opts = HistogramOpts::new(name, help); + let histogram = Histogram::with_opts(opts)?; + prometheus::register(Box::new(histogram.clone()))?; + Ok(histogram) +} + +///Gauge Metrics a value in injection. +pub fn set_gauge(gauge: &Result, value: u64) { + if let Ok(gauge) = gauge { + gauge.set(value as i64); + } +} +///histogram Metrics a value in injection. +pub fn set_histogram(histogram: &Result, value: f64) { + if let Ok(histogram) = histogram { + histogram.observe(value) + } +} +///All of the metrics in the prometheus are managed by the lazy_static. +lazy_static! { + pub static ref FINALITY_HEIGHT: Result = try_create_int_gauge( + "consensus_finality_block_height_number", + "block is finality HEIGHT" + + ); + pub static ref BEST_HEIGHT: Result = try_create_int_gauge( + "consensus_best_block_height_number", + "block is best HEIGHT" + ); + + pub static ref BLOCK_INTERVAL_SECONDS: Result = try_create_histogram( + "consensus_block_interval_seconds", + "Time between this and last block(Block.Header.Time) in seconds" + ); + pub static ref P2P_PEERS_NUM: Result = try_create_int_gauge( + "p2p_peers_number", + "network gosip peers number" + ); + pub static ref TARGET_NUM: Result = try_create_int_gauge( + "consensus_target_syn_number", + "block syn target number" + ); + pub static ref TX_COUNT: Result = try_create_int_gauge( + "consensus_num_txs", + "Number of transactions" + ); + pub static ref NODE_MEMORY: Result = try_create_int_gauge( + "consensus_node_memory", + "node memory" + ); + pub static ref NODE_CPU: Result = try_create_int_gauge( + "consensus_node_cpu", + "node cpu" + ); + pub static ref MEMPOOL_SIZE: Result = try_create_int_gauge( + "mempool_size", + "Number of uncommitted transactions" + ); + pub static ref P2P_NODE_DOWNLOAD: Result = try_create_int_gauge( + "p2p_peer_receive_byte_per_sec", + "p2p_node_download_per_sec_byte" + ); + pub static ref P2P_NODE_UPLOAD: Result = try_create_int_gauge( + "p2p_peer_send_byte_per_sec", + "p2p_node_upload_per_sec_byte" + ); +} \ No newline at end of file diff --git a/client/service/Cargo.toml b/client/service/Cargo.toml index ce27b0995c5ef..8b1a4e9b5241a 100644 --- a/client/service/Cargo.toml +++ b/client/service/Cargo.toml @@ -54,6 +54,7 @@ parity-multiaddr = { package = "parity-multiaddr", version = "0.5.0" } grafana-data-source = { version = "2.0.0", path = "../../utils/grafana-data-source" } sc-tracing = { version = "2.0.0", path = "../tracing" } tracing = "0.1.10" +promet = { package = "sc-prometheus", path="../prometheus"} [dev-dependencies] substrate-test-runtime-client = { version = "2.0.0", path = "../../test-utils/runtime/client" } diff --git a/client/service/src/builder.rs b/client/service/src/builder.rs index 0c50ae3969e28..2bd11d9620ef1 100644 --- a/client/service/src/builder.rs +++ b/client/service/src/builder.rs @@ -52,7 +52,7 @@ use std::{ }; use sysinfo::{get_current_pid, ProcessExt, System, SystemExt}; use sc_telemetry::{telemetry, SUBSTRATE_INFO}; -use sp_transaction_pool::{TransactionPool, TransactionPoolMaintainer}; +use promet::prometheus_gauge; use sp_blockchain; use grafana_data_source::{self, record_metrics}; @@ -954,6 +954,17 @@ ServiceBuilder< "bandwidth_upload" => bandwidth_upload, "used_state_cache_size" => used_state_cache_size, ); + prometheus_gauge!( + MEMPOOL_SIZE => used_state_cache_size as u64, + NODE_MEMORY => memory as u64, + NODE_CPU => cpu_usage as u64, + TX_COUNT => txpool_status.ready as u64, + FINALITY_HEIGHT => finalized_number as u64, + BEST_HEIGHT => best_number as u64, + P2P_PEERS_NUM => num_peers as u64, + P2P_NODE_DOWNLOAD => net_status.average_download_per_sec as u64, + P2P_NODE_UPLOAD => net_status.average_upload_per_sec as u64 + ); let _ = record_metrics!( "peers" => num_peers, "height" => best_number, @@ -964,8 +975,7 @@ ServiceBuilder< "bandwidth_download" => bandwidth_download, "bandwidth_upload" => bandwidth_upload, "used_state_cache_size" => used_state_cache_size, - ); - + ); Ok(()) }).select(exit.clone().map(Ok).compat()).then(|_| Ok(())); let _ = to_spawn_tx.unbounded_send(Box::new(tel_task)); @@ -1103,7 +1113,12 @@ ServiceBuilder< .then(|_| Ok(())))); telemetry }); - + match config.prometheus_endpoint { + None => (), + Some(x) => { + let _prometheus = promet::init_prometheus(x); + } + } // Grafana data source if let Some(port) = config.grafana_port { let future = select( diff --git a/client/service/src/config.rs b/client/service/src/config.rs index 0b5152e24828d..b7aa6303c3b71 100644 --- a/client/service/src/config.rs +++ b/client/service/src/config.rs @@ -75,6 +75,8 @@ pub struct Configuration { pub rpc_cors: Option>, /// Grafana data source http port. `None` if disabled. pub grafana_port: Option, + + pub prometheus_endpoint: Option, /// Telemetry service URL. `None` if disabled. pub telemetry_endpoints: Option, /// External WASM transport for the telemetry. If `Some`, when connection to a telemetry @@ -153,6 +155,7 @@ impl Configuration where rpc_ws: None, rpc_ws_max_connections: None, rpc_cors: Some(vec![]), + prometheus_endpoint: None, grafana_port: None, telemetry_endpoints: None, telemetry_external_transport: None, diff --git a/client/service/src/lib.rs b/client/service/src/lib.rs index e383703da7f24..26257eebc7773 100644 --- a/client/service/src/lib.rs +++ b/client/service/src/lib.rs @@ -17,8 +17,6 @@ //! Substrate service. Starts a thread that spins up the network, client, and extrinsic pool. //! Manages communication between them. -#![warn(missing_docs)] - pub mod config; #[macro_use] pub mod chain_ops; diff --git a/client/service/test/src/lib.rs b/client/service/test/src/lib.rs index 9601257f07b6f..ea935100e954c 100644 --- a/client/service/test/src/lib.rs +++ b/client/service/test/src/lib.rs @@ -192,6 +192,7 @@ fn node_config ( rpc_ws: None, rpc_ws_max_connections: None, rpc_cors: None, + prometheus_endpoint: None, grafana_port: None, telemetry_endpoints: None, telemetry_external_transport: None, From 472aca1c856b32c456514f2007a7c71c29e322d6 Mon Sep 17 00:00:00 2001 From: nodebreaker-carlsagan Date: Tue, 10 Dec 2019 12:53:56 +0900 Subject: [PATCH 02/42] Milestone1: Final Version of v0.3 --- Cargo.lock | 708 +++++++----------- Cargo.toml | 2 +- client/Cargo.toml | 1 - client/cli/Cargo.toml | 2 +- client/cli/src/lib.rs | 1 + client/service/Cargo.toml | 2 +- client/service/src/builder.rs | 7 +- client/service/src/config.rs | 2 +- client/service/src/lib.rs | 2 + {client => utils}/prometheus/Cargo.toml | 1 + {client => utils}/prometheus/README.md | 245 +++--- .../prometheus/photo_2019-12-13_16-32-53.jpg | Bin 0 -> 27726 bytes {client => utils}/prometheus/src/lib.rs | 1 + {client => utils}/prometheus/src/metrics.rs | 7 +- 14 files changed, 440 insertions(+), 541 deletions(-) rename {client => utils}/prometheus/Cargo.toml (78%) rename {client => utils}/prometheus/README.md (62%) create mode 100644 utils/prometheus/photo_2019-12-13_16-32-53.jpg rename {client => utils}/prometheus/src/lib.rs (98%) rename {client => utils}/prometheus/src/metrics.rs (94%) diff --git a/Cargo.lock b/Cargo.lock index be90a016fb52c..8022469e81549 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -79,7 +79,7 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.26" +version = "1.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -138,12 +138,22 @@ name = "assert_matches" version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "async-macros" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "futures-core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "pin-utils 0.1.0-alpha.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "async-std" -version = "1.4.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "async-task 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "async-macros 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "async-task 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "broadcaster 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-channel 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-deque 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -165,10 +175,10 @@ dependencies = [ [[package]] name = "async-task" -version = "1.1.0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -238,7 +248,7 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -366,7 +376,7 @@ dependencies = [ "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "regex-automata 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -384,7 +394,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "byte-slice-cast" -version = "0.3.5" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -414,7 +424,7 @@ dependencies = [ [[package]] name = "bytes" -version = "0.5.3" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -436,8 +446,8 @@ version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -490,7 +500,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -548,7 +558,7 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen 0.2.56 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -557,7 +567,7 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "web-sys 0.3.33 (registry+https://github.com/rust-lang/crates.io-index)", + "web-sys 0.3.32 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -583,32 +593,6 @@ name = "constant_time_eq" version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "cookie" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", - "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "cookie_store" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cookie 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", - "failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "publicsuffix 1.5.4 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", - "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", - "try_from 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "core-foundation" version = "0.6.4" @@ -642,8 +626,8 @@ dependencies = [ "cranelift-codegen-shared 0.50.0 (registry+https://github.com/rust-lang/crates.io-index)", "cranelift-entity 0.50.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", - "smallvec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "target-lexicon 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "thiserror 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -667,7 +651,7 @@ name = "cranelift-entity" version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -677,7 +661,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cranelift-codegen 0.50.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "smallvec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "target-lexicon 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -700,7 +684,7 @@ dependencies = [ "cranelift-entity 0.50.0 (registry+https://github.com/rust-lang/crates.io-index)", "cranelift-frontend 0.50.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "thiserror 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", "wasmparser 0.39.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -730,12 +714,12 @@ dependencies = [ "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand_os 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "rand_xoshiro 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rayon 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rayon-core 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "rayon 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rayon-core 1.6.1 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", - "tinytemplate 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "tinytemplate 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "walkdir 2.2.9 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -755,11 +739,11 @@ dependencies = [ "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand_os 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "rand_xoshiro 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rayon 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "rayon 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", - "tinytemplate 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "tinytemplate 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "walkdir 2.2.9 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -822,10 +806,9 @@ dependencies = [ [[package]] name = "crossbeam-queue" -version = "0.2.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -871,7 +854,7 @@ dependencies = [ "csv-core 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "ryu 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1012,11 +995,6 @@ name = "doc-comment" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "dtoa" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "ed25519-dalek" version = "1.0.0-pre.3" @@ -1041,14 +1019,6 @@ dependencies = [ "heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "encoding_rs" -version = "0.8.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "enumflags2" version = "0.6.2" @@ -1101,7 +1071,7 @@ name = "erased-serde" version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1123,14 +1093,6 @@ dependencies = [ "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "error-chain" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "evm" version = "0.14.1" @@ -1141,7 +1103,7 @@ dependencies = [ "evm-runtime 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)", "primitive-types 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "rlp 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "sha3 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1186,7 +1148,7 @@ name = "faerie" version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "anyhow 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)", + "anyhow 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", "goblin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "indexmap 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1257,7 +1219,7 @@ dependencies = [ [[package]] name = "fixed-hash" -version = "0.5.2" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1322,7 +1284,7 @@ dependencies = [ "pallet-indices 2.0.0", "pallet-transaction-payment 2.0.0", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", "sp-io 2.0.0", "sp-runtime 2.0.0", @@ -1334,7 +1296,7 @@ name = "frame-metadata" version = "2.0.0" dependencies = [ "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", "sp-std 2.0.0", ] @@ -1353,7 +1315,7 @@ dependencies = [ "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "paste 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "pretty_assertions 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "sp-arithmetic 2.0.0", "sp-core 2.0.0", "sp-inherents 2.0.0", @@ -1361,7 +1323,7 @@ dependencies = [ "sp-runtime 2.0.0", "sp-state-machine 2.0.0", "sp-std 2.0.0", - "tracing 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", + "tracing 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1401,13 +1363,13 @@ dependencies = [ "frame-support 2.0.0", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "pretty_assertions 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", "sp-inherents 2.0.0", "sp-io 2.0.0", "sp-runtime 2.0.0", "sp-state-machine 2.0.0", - "trybuild 1.0.19 (registry+https://github.com/rust-lang/crates.io-index)", + "trybuild 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1419,7 +1381,7 @@ dependencies = [ "impl-trait-for-tuples 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", "sp-io 2.0.0", "sp-runtime 2.0.0", @@ -1667,7 +1629,7 @@ dependencies = [ "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "wasi 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen 0.2.56 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1718,7 +1680,7 @@ dependencies = [ name = "grafana-data-source" version = "2.0.0" dependencies = [ - "async-std 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "async-std 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "derive_more 0.99.2 (registry+https://github.com/rust-lang/crates.io-index)", "futures-timer 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1727,9 +1689,9 @@ dependencies = [ "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1764,7 +1726,7 @@ name = "h2" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bytes 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "futures-core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "futures-sink 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1773,7 +1735,7 @@ dependencies = [ "indexmap 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-util 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1831,7 +1793,7 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.1.5" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1893,7 +1855,7 @@ name = "http" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bytes 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1914,7 +1876,7 @@ name = "http-body" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bytes 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "http 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1983,7 +1945,7 @@ name = "hyper" version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bytes 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "futures-channel 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "futures-core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "futures-util 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1995,7 +1957,7 @@ dependencies = [ "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "pin-project 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", "tower-service 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "want 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2069,7 +2031,7 @@ name = "impl-serde" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2138,10 +2100,10 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.33" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "wasm-bindgen 0.2.56 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2156,7 +2118,7 @@ dependencies = [ "jsonrpc-core 14.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-pubsub 14.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", "tokio 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2170,8 +2132,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2216,7 +2178,7 @@ dependencies = [ "jsonrpc-core 14.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2323,6 +2285,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "lazy_static" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "spin 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] name = "lazycell" @@ -2393,11 +2358,15 @@ dependencies = [ "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +<<<<<<< HEAD <<<<<<< HEAD "libsecp256k1 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", ======= "libsecp256k1 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", >>>>>>> 9044da2b8... Refactor rebase master prometheus_v0.3 +======= + "libsecp256k1 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", +>>>>>>> 6c3137bdd... Milestone1: Final Version of v0.3 "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "multistream-select 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "parity-multiaddr 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2614,7 +2583,7 @@ dependencies = [ "ctr 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", "hmac 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", - "js-sys 0.3.33 (registry+https://github.com/rust-lang/crates.io-index)", + "js-sys 0.3.32 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "libp2p-core 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2628,9 +2597,9 @@ dependencies = [ "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", "twofish 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "untrusted 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen 0.2.56 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", "wasm-bindgen-futures 0.3.27 (registry+https://github.com/rust-lang/crates.io-index)", - "web-sys 0.3.33 (registry+https://github.com/rust-lang/crates.io-index)", + "web-sys 0.3.32 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2679,11 +2648,11 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "js-sys 0.3.33 (registry+https://github.com/rust-lang/crates.io-index)", + "js-sys 0.3.32 (registry+https://github.com/rust-lang/crates.io-index)", "libp2p-core 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)", "parity-send-wrapper 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen 0.2.56 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", "wasm-bindgen-futures 0.3.27 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2731,17 +2700,20 @@ dependencies = [ [[package]] name = "libsecp256k1" <<<<<<< HEAD +<<<<<<< HEAD version = "0.3.4" ======= version = "0.3.3" >>>>>>> 9044da2b8... Refactor rebase master prometheus_v0.3 +======= +version = "0.3.2" +>>>>>>> 6c3137bdd... Milestone1: Final Version of v0.3 source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "arrayref 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", - "crunchy 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "hmac-drbg 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "sha2 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "subtle 2.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "typenum 1.11.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2906,20 +2878,6 @@ dependencies = [ "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "mime" -version = "0.3.14" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "mime_guess" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "mime 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", - "unicase 2.6.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "miniz_oxide" version = "0.3.5" @@ -3061,7 +3019,7 @@ dependencies = [ "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "hex-literal 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "js-sys 0.3.33 (registry+https://github.com/rust-lang/crates.io-index)", + "js-sys 0.3.32 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-core 14.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "kvdb-memorydb 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "libp2p 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3098,7 +3056,7 @@ dependencies = [ "sc-service-test 2.0.0", "sc-telemetry 2.0.0", "sc-transaction-pool 2.0.0", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "sp-authority-discovery 2.0.0", "sp-consensus 0.8.0", "sp-consensus-babe 0.8.0", @@ -3116,7 +3074,7 @@ dependencies = [ "tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "tokio 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", "vergen 3.0.4 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen 0.2.56 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", "wasm-bindgen-futures 0.3.27 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3227,7 +3185,7 @@ dependencies = [ "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "sp-api 2.0.0", "sp-authority-discovery 2.0.0", "sp-block-builder 2.0.0", @@ -3297,7 +3255,7 @@ dependencies = [ "pallet-transaction-payment 2.0.0", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "sp-api 2.0.0", "sp-block-builder 2.0.0", "sp-consensus-aura 0.8.0", @@ -3370,11 +3328,6 @@ name = "nohash-hasher" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "nom" -version = "1.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "nom" version = "4.2.3" @@ -3427,7 +3380,7 @@ name = "num_cpus" version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "hermit-abi 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "hermit-abi 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3516,7 +3469,7 @@ dependencies = [ "frame-support 2.0.0", "frame-system 2.0.0", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", "sp-io 2.0.0", "sp-runtime 2.0.0", @@ -3534,7 +3487,7 @@ dependencies = [ "pallet-timestamp 2.0.0", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "sp-application-crypto 2.0.0", "sp-consensus-aura 0.8.0", "sp-core 2.0.0", @@ -3553,7 +3506,7 @@ dependencies = [ "frame-system 2.0.0", "pallet-session 2.0.0", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "sp-application-crypto 2.0.0", "sp-authority-discovery 2.0.0", "sp-core 2.0.0", @@ -3591,7 +3544,7 @@ dependencies = [ "pallet-timestamp 2.0.0", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "sp-consensus-babe 0.8.0", "sp-core 2.0.0", "sp-inherents 2.0.0", @@ -3613,7 +3566,7 @@ dependencies = [ "pallet-transaction-payment 2.0.0", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", "sp-io 2.0.0", "sp-runtime 2.0.0", @@ -3630,7 +3583,7 @@ dependencies = [ "pallet-balances 2.0.0", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", "sp-io 2.0.0", "sp-runtime 2.0.0", @@ -3651,7 +3604,7 @@ dependencies = [ "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-wasm 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", "pwasm-utils 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", "sp-io 2.0.0", "sp-runtime 2.0.0", @@ -3670,7 +3623,7 @@ dependencies = [ "jsonrpc-derive 14.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "pallet-contracts-rpc-runtime-api 2.0.0", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", "sp-blockchain 2.0.0", "sp-core 2.0.0", @@ -3697,7 +3650,7 @@ dependencies = [ "pallet-balances 2.0.0", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", "sp-io 2.0.0", "sp-runtime 2.0.0", @@ -3714,7 +3667,7 @@ dependencies = [ "pallet-balances 2.0.0", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", "sp-io 2.0.0", "sp-runtime 2.0.0", @@ -3730,7 +3683,7 @@ dependencies = [ "hex-literal 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "pallet-balances 2.0.0", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", "sp-io 2.0.0", "sp-phragmen 2.0.0", @@ -3751,7 +3704,7 @@ dependencies = [ "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "primitive-types 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "rlp 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "sha3 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", "sp-io 2.0.0", @@ -3767,7 +3720,7 @@ dependencies = [ "frame-system 2.0.0", "pallet-balances 2.0.0", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", "sp-io 2.0.0", "sp-runtime 2.0.0", @@ -3782,7 +3735,7 @@ dependencies = [ "frame-system 2.0.0", "impl-trait-for-tuples 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", "sp-finality-tracker 2.0.0", "sp-inherents 2.0.0", @@ -3798,7 +3751,7 @@ dependencies = [ "frame-support 2.0.0", "frame-system 2.0.0", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", "sp-io 2.0.0", "sp-runtime 2.0.0", @@ -3814,7 +3767,7 @@ dependencies = [ "pallet-finality-tracker 2.0.0", "pallet-session 2.0.0", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", "sp-finality-grandpa 2.0.0", "sp-io 2.0.0", @@ -3832,7 +3785,7 @@ dependencies = [ "frame-system 2.0.0", "pallet-balances 2.0.0", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", "sp-io 2.0.0", "sp-runtime 2.0.0", @@ -3848,7 +3801,7 @@ dependencies = [ "pallet-authorship 2.0.0", "pallet-session 2.0.0", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "sp-application-crypto 2.0.0", "sp-core 2.0.0", "sp-io 2.0.0", @@ -3865,7 +3818,7 @@ dependencies = [ "frame-system 2.0.0", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", "sp-io 2.0.0", "sp-keyring 2.0.0", @@ -3880,7 +3833,7 @@ dependencies = [ "frame-support 2.0.0", "frame-system 2.0.0", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", "sp-io 2.0.0", "sp-runtime 2.0.0", @@ -3895,7 +3848,7 @@ dependencies = [ "frame-system 2.0.0", "pallet-balances 2.0.0", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", "sp-io 2.0.0", "sp-runtime 2.0.0", @@ -3910,7 +3863,7 @@ dependencies = [ "frame-system 2.0.0", "pallet-balances 2.0.0", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", "sp-io 2.0.0", "sp-runtime 2.0.0", @@ -3940,7 +3893,7 @@ dependencies = [ "frame-system 2.0.0", "pallet-balances 2.0.0", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", "sp-io 2.0.0", "sp-runtime 2.0.0", @@ -3958,7 +3911,7 @@ dependencies = [ "pallet-timestamp 2.0.0", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "sp-application-crypto 2.0.0", "sp-core 2.0.0", "sp-io 2.0.0", @@ -3981,7 +3934,7 @@ dependencies = [ "pallet-timestamp 2.0.0", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", "sp-io 2.0.0", "sp-keyring 2.0.0", @@ -4010,7 +3963,7 @@ dependencies = [ "frame-support 2.0.0", "frame-system 2.0.0", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", "sp-io 2.0.0", "sp-runtime 2.0.0", @@ -4025,7 +3978,7 @@ dependencies = [ "frame-system 2.0.0", "impl-trait-for-tuples 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", "sp-inherents 2.0.0", "sp-io 2.0.0", @@ -4058,7 +4011,7 @@ dependencies = [ "jsonrpc-derive 14.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "pallet-transaction-payment-rpc-runtime-api 2.0.0", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "sp-blockchain 2.0.0", "sp-core 2.0.0", "sp-rpc 2.0.0", @@ -4071,7 +4024,7 @@ version = "2.0.0" dependencies = [ "frame-support 2.0.0", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", "sp-api 2.0.0", "sp-runtime 2.0.0", @@ -4086,7 +4039,7 @@ dependencies = [ "frame-system 2.0.0", "pallet-balances 2.0.0", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", "sp-io 2.0.0", "sp-runtime 2.0.0", @@ -4101,7 +4054,7 @@ dependencies = [ "frame-system 2.0.0", "pallet-balances 2.0.0", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", "sp-io 2.0.0", "sp-runtime 2.0.0", @@ -4125,7 +4078,7 @@ dependencies = [ "data-encoding 2.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "parity-multihash 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "unsigned-varint 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -4142,7 +4095,7 @@ dependencies = [ "data-encoding 2.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "parity-multihash 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "unsigned-varint 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "url 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -4182,9 +4135,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "arrayvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "bitvec 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)", - "byte-slice-cast 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "byte-slice-cast 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec-derive 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -4412,7 +4365,7 @@ name = "primitive-types" version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "fixed-hash 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "fixed-hash 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "impl-codec 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "impl-rlp 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "impl-serde 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4482,32 +4435,6 @@ dependencies = [ "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "procinfo" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", - "nom 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "prometheus" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", - "procinfo 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "protobuf 2.8.1 (registry+https://github.com/rust-lang/crates.io-index)", - "quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "spin 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "prost" version = "0.5.0" @@ -4561,18 +4488,6 @@ name = "protobuf" version = "2.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "publicsuffix" -version = "1.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "error-chain 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)", - "idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "url 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "pwasm-utils" version = "0.12.0" @@ -4749,7 +4664,7 @@ dependencies = [ "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen 0.2.56 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -4808,21 +4723,21 @@ dependencies = [ [[package]] name = "rayon" -version = "1.3.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "crossbeam-deque 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)", - "rayon-core 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rayon-core 1.6.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rayon-core" -version = "1.7.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "crossbeam-deque 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-queue 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-queue 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4895,39 +4810,6 @@ dependencies = [ "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "reqwest" -version = "0.9.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", - "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", - "cookie 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", - "cookie_store 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "encoding_rs 0.8.22 (registry+https://github.com/rust-lang/crates.io-index)", - "flate2 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "http 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper 0.12.35 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper-tls 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "mime 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)", - "mime_guess 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "native-tls 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_urlencoded 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", - "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-executor 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-threadpool 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-timer 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)", - "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "uuid 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", - "winreg 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "ring" version = "0.16.9" @@ -4938,7 +4820,7 @@ dependencies = [ "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "spin 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "untrusted 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "web-sys 0.3.33 (registry+https://github.com/rust-lang/crates.io-index)", + "web-sys 0.3.32 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -4988,14 +4870,6 @@ name = "rustc-hex" version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "rustc_version" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "semver 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "rustc_version" version = "0.2.3" @@ -5134,7 +5008,7 @@ dependencies = [ "sc-chain-spec-derive 2.0.0", "sc-network 0.8.0", "sc-telemetry 2.0.0", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", "sp-runtime 2.0.0", @@ -5169,7 +5043,6 @@ dependencies = [ "rpassword 4.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "sc-client-api 2.0.0", "sc-network 0.8.0", - "sc-prometheus 2.0.0", "sc-service 2.0.0", "sc-telemetry 2.0.0", "sc-tracing 2.0.0", @@ -5183,7 +5056,7 @@ dependencies = [ "structopt 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -5204,7 +5077,6 @@ dependencies = [ "sc-block-builder 2.0.0", "sc-client-api 2.0.0", "sc-executor 2.0.0", - "sc-prometheus 2.0.0", "sc-telemetry 2.0.0", "sp-api 2.0.0", "sp-blockchain 2.0.0", @@ -5221,7 +5093,7 @@ dependencies = [ "sp-version 2.0.0", "substrate-test-runtime-client 2.0.0", "tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "tracing 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", + "tracing 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -5430,11 +5302,15 @@ dependencies = [ "derive_more 0.99.2 (registry+https://github.com/rust-lang/crates.io-index)", "hex-literal 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +<<<<<<< HEAD <<<<<<< HEAD "libsecp256k1 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", ======= "libsecp256k1 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", >>>>>>> 9044da2b8... Refactor rebase master prometheus_v0.3 +======= + "libsecp256k1 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", +>>>>>>> 6c3137bdd... Milestone1: Final Version of v0.3 "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-wasm 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5594,7 +5470,7 @@ dependencies = [ "sc-client 2.0.0", "sc-client-api 2.0.0", "sc-peerset 2.0.0", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", "slog 2.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "slog_derive 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5702,18 +5578,6 @@ dependencies = [ "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "sc-prometheus" -version = "2.0.0" -dependencies = [ - "hyper 0.12.35 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "prometheus 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "reqwest 0.9.24 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "sc-rpc" version = "2.0.0" @@ -5763,7 +5627,7 @@ dependencies = [ "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", "sp-rpc 2.0.0", @@ -5780,7 +5644,7 @@ dependencies = [ "jsonrpc-pubsub 14.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-ws-server 14.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", "sp-runtime 2.0.0", ] @@ -5820,13 +5684,12 @@ dependencies = [ "sc-keystore 2.0.0", "sc-network 0.8.0", "sc-offchain 2.0.0", - "sc-prometheus 2.0.0", "sc-rpc 2.0.0", "sc-rpc-server 2.0.0", "sc-telemetry 2.0.0", "sc-tracing 2.0.0", "sc-transaction-pool 2.0.0", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", "slog 2.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "sp-api 2.0.0", @@ -5846,7 +5709,7 @@ dependencies = [ "tokio 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-executor 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-timer 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)", - "tracing 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", + "tracing 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -5892,7 +5755,7 @@ dependencies = [ "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "slog 2.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "slog-json 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "slog-scope 4.3.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5910,11 +5773,11 @@ dependencies = [ "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "sc-telemetry 2.0.0", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", "slog 2.5.2 (registry+https://github.com/rust-lang/crates.io-index)", - "tracing 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", - "tracing-core 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "tracing 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tracing-core 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -5928,7 +5791,7 @@ dependencies = [ "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", "sp-runtime 2.0.0", "sp-transaction-pool 2.0.0", @@ -6036,11 +5899,6 @@ dependencies = [ "core-foundation-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "semver" -version = "0.1.20" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "semver" version = "0.6.0" @@ -6055,7 +5913,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -6070,15 +5928,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "serde" -version = "1.0.104" +version = "1.0.103" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "serde_derive" -version = "1.0.104" +version = "1.0.103" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -6093,18 +5951,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "ryu 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "serde_urlencoded" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "dtoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", - "itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", - "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -6180,7 +6027,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", "erased-serde 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", "slog 2.5.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -6215,7 +6062,7 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.1.0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -6293,7 +6140,7 @@ dependencies = [ "sp-state-machine 2.0.0", "sp-version 2.0.0", "substrate-test-runtime-client 2.0.0", - "trybuild 1.0.19 (registry+https://github.com/rust-lang/crates.io-index)", + "trybuild 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -6301,7 +6148,7 @@ name = "sp-application-crypto" version = "2.0.0" dependencies = [ "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", "sp-io 2.0.0", "sp-std 2.0.0", @@ -6327,7 +6174,7 @@ dependencies = [ "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "primitive-types 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "sp-debug-derive 2.0.0", "sp-std 2.0.0", ] @@ -6452,11 +6299,15 @@ dependencies = [ "hex-literal 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "impl-serde 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +<<<<<<< HEAD <<<<<<< HEAD "libsecp256k1 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", ======= "libsecp256k1 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", >>>>>>> 9044da2b8... Refactor rebase master prometheus_v0.3 +======= + "libsecp256k1 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", +>>>>>>> 6c3137bdd... Milestone1: Final Version of v0.3 "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -6467,7 +6318,7 @@ dependencies = [ "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "schnorrkel 0.8.5 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", "sha2 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "sp-debug-derive 2.0.0", @@ -6507,7 +6358,7 @@ name = "sp-finality-grandpa" version = "2.0.0" dependencies = [ "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "sp-api 2.0.0", "sp-application-crypto 2.0.0", "sp-runtime 2.0.0", @@ -6539,11 +6390,15 @@ name = "sp-io" version = "2.0.0" dependencies = [ "hash-db 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)", +<<<<<<< HEAD <<<<<<< HEAD "libsecp256k1 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", ======= "libsecp256k1 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", >>>>>>> 9044da2b8... Refactor rebase master prometheus_v0.3 +======= + "libsecp256k1 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", +>>>>>>> 6c3137bdd... Milestone1: Final Version of v0.3 "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", @@ -6585,7 +6440,7 @@ name = "sp-phragmen" version = "2.0.0" dependencies = [ "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "sp-io 2.0.0", "sp-runtime 2.0.0", "sp-std 2.0.0", @@ -6596,7 +6451,7 @@ dependencies = [ name = "sp-rpc" version = "2.0.0" dependencies = [ - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", ] @@ -6610,7 +6465,7 @@ dependencies = [ "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "paste 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", "sp-application-crypto 2.0.0", "sp-arithmetic 2.0.0", @@ -6637,7 +6492,7 @@ dependencies = [ "sp-std 2.0.0", "sp-wasm-interface 2.0.0", "static_assertions 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "trybuild 1.0.19 (registry+https://github.com/rust-lang/crates.io-index)", + "trybuild 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -6691,7 +6546,7 @@ dependencies = [ name = "sp-serializer" version = "2.0.0" dependencies = [ - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -6741,7 +6596,7 @@ name = "sp-storage" version = "2.0.0" dependencies = [ "impl-serde 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "sp-debug-derive 2.0.0", "sp-std 2.0.0", ] @@ -6751,7 +6606,7 @@ name = "sp-test-primitives" version = "2.0.0" dependencies = [ "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "sp-application-crypto 2.0.0", "sp-core 2.0.0", "sp-runtime 2.0.0", @@ -6777,7 +6632,7 @@ dependencies = [ "futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "sp-api 2.0.0", "sp-runtime 2.0.0", ] @@ -6805,7 +6660,7 @@ version = "2.0.0" dependencies = [ "impl-serde 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "sp-runtime 2.0.0", "sp-std 2.0.0", ] @@ -6854,7 +6709,7 @@ name = "string-interner" version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -6956,7 +6811,7 @@ dependencies = [ "jsonrpc-core 14.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "sc-rpc-api 2.0.0", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "sp-storage 2.0.0", "tokio 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -6975,7 +6830,7 @@ dependencies = [ "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "sc-client 2.0.0", "sc-transaction-pool 2.0.0", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "sp-blockchain 2.0.0", "sp-core 2.0.0", "sp-runtime 2.0.0", @@ -7018,7 +6873,7 @@ dependencies = [ "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "sc-client 2.0.0", "sc-executor 2.0.0", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "sp-api 2.0.0", "sp-application-crypto 2.0.0", "sp-block-builder 2.0.0", @@ -7139,7 +6994,7 @@ dependencies = [ "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "doc-comment 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", - "rayon 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rayon 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -7275,10 +7130,10 @@ dependencies = [ [[package]] name = "tinytemplate" -version = "1.0.3" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -7307,10 +7162,10 @@ dependencies = [ [[package]] name = "tokio" -version = "0.2.6" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bytes 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "pin-project-lite 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -7531,12 +7386,12 @@ name = "tokio-util" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bytes 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "futures-core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "futures-sink 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "pin-project-lite 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -7544,7 +7399,7 @@ name = "toml" version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -7554,17 +7409,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "tracing" -version = "0.1.11" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "tracing-attributes 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "tracing-core 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "spin 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "tracing-attributes 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "tracing-core 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "tracing-attributes" -version = "0.1.6" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -7573,10 +7429,11 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.8" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "spin 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -7633,22 +7490,14 @@ name = "try-lock" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "try_from" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "trybuild" -version = "1.0.19" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "glob 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", "termcolor 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "toml 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -7722,7 +7571,7 @@ name = "unicode-normalization" version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "smallvec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -7779,14 +7628,6 @@ dependencies = [ "percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "uuid" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "vcpkg" version = "0.2.8" @@ -7827,8 +7668,8 @@ name = "wabt" version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", "wabt-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -7879,16 +7720,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "wasm-bindgen" -version = "0.2.56" +version = "0.2.55" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen-macro 0.2.56 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-macro 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.56" +version = "0.2.55" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bumpalo 2.6.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -7897,7 +7738,7 @@ dependencies = [ "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen-shared 0.2.56 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-shared 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -7907,49 +7748,49 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "js-sys 0.3.33 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen 0.2.56 (registry+https://github.com/rust-lang/crates.io-index)", - "web-sys 0.3.33 (registry+https://github.com/rust-lang/crates.io-index)", + "js-sys 0.3.32 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", + "web-sys 0.3.32 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.56" +version = "0.2.55" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen-macro-support 0.2.56 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-macro-support 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.56" +version = "0.2.55" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen-backend 0.2.56 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen-shared 0.2.56 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-backend 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-shared 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.56" +version = "0.2.55" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "wasm-bindgen-webidl" -version = "0.2.56" +version = "0.2.55" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "anyhow 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)", + "anyhow 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", "heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen-backend 0.2.56 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-backend 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", "weedle 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -7969,11 +7810,11 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "js-sys 0.3.33 (registry+https://github.com/rust-lang/crates.io-index)", + "js-sys 0.3.32 (registry+https://github.com/rust-lang/crates.io-index)", "send_wrapper 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-timer 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen 0.2.56 (registry+https://github.com/rust-lang/crates.io-index)", - "web-sys 0.3.33 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", + "web-sys 0.3.32 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -8008,7 +7849,7 @@ name = "wasmtime-debug" version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "anyhow 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)", + "anyhow 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", "cranelift-codegen 0.50.0 (registry+https://github.com/rust-lang/crates.io-index)", "cranelift-entity 0.50.0 (registry+https://github.com/rust-lang/crates.io-index)", "cranelift-wasm 0.50.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -8039,8 +7880,8 @@ dependencies = [ "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "more-asserts 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rayon 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", + "rayon 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "sha2 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "spin 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "thiserror 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", @@ -8055,7 +7896,7 @@ name = "wasmtime-jit" version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "anyhow 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)", + "anyhow 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", "cranelift-codegen 0.50.0 (registry+https://github.com/rust-lang/crates.io-index)", "cranelift-entity 0.50.0 (registry+https://github.com/rust-lang/crates.io-index)", "cranelift-frontend 0.50.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -8093,14 +7934,14 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.33" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "anyhow 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)", - "js-sys 0.3.33 (registry+https://github.com/rust-lang/crates.io-index)", + "anyhow 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", + "js-sys 0.3.32 (registry+https://github.com/rust-lang/crates.io-index)", "sourcefile 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen 0.2.56 (registry+https://github.com/rust-lang/crates.io-index)", - "wasm-bindgen-webidl 0.2.56 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-bindgen-webidl 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -8230,14 +8071,6 @@ dependencies = [ "winapi-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "winreg" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "ws" version = "0.9.1" @@ -8356,7 +8189,7 @@ dependencies = [ "checksum aho-corasick 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)" = "58fb5e95d83b38284460a5fda7d6470aa0b8844d283a0b614b8535e880800d2d" "checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" "checksum ansi_term 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" -"checksum anyhow 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)" = "7825f6833612eb2414095684fcf6c635becf3ce97fe48cf6421321e93bfbd53c" +"checksum anyhow 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)" = "9267dff192e68f3399525901e709a48c1d3982c9c072fa32f2127a0cb0babf14" "checksum app_dirs 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e73a24bad9bd6a94d6395382a6c69fe071708ae4409f763c5475e14ee896313d" "checksum arc-swap 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "d7b8a9123b8027467bce0099fe556c628a53c8d83df0507084c31e9ba2e39aff" "checksum arrayref 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "0d382e583f07208808f6b1249e60848879ba3543f57c32277bf52d69c2f0f0ee" @@ -8365,8 +8198,9 @@ dependencies = [ "checksum asn1_der 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6fce6b6a0ffdafebd82c87e79e3f40e8d2c523e5fea5566ff6b90509bf98d638" "checksum asn1_der_derive 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0d0864d84b8e07b145449be9a8537db86bf9de5ce03b913214694643b4743502" "checksum assert_matches 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7deb0a829ca7bcfaf5da70b073a8d128619259a7be8216a355e23f00763059e5" -"checksum async-std 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0bf6039b315300e057d198b9d3ab92ee029e31c759b7f1afae538145e6f18a3e" -"checksum async-task 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "abdb6048336bef96e8c8fc5573536c5cc5b391fbfd0980349959b7c3f7a40d19" +"checksum async-macros 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "644a5a8de80f2085a1e7e57cd1544a2a7438f6e003c0790999bd43b92a77cdb2" +"checksum async-std 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "513ee3c49800679a319912340f5601afda9e72848d7dea3a48bab489e8c1a46f" +"checksum async-task 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "de6bd58f7b9cc49032559422595c81cbfcf04db2f2133592f70af19e258a1ced" "checksum atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "1803c647a3ec87095e7ae7acfca019e98de5ec9a7d01343f611cf3152ed71a90" "checksum autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" "checksum backtrace 0.3.40 (registry+https://github.com/rust-lang/crates.io-index)" = "924c76597f0d9ca25d762c25a4d369d51267536465dc5064bdf0eb073ed477ea" @@ -8392,12 +8226,12 @@ dependencies = [ "checksum bstr 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8d6c2c5b58ab920a4f5aeaaca34b4488074e8cc7596af94e6f8c6ff247c60245" "checksum build-helper 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "bdce191bf3fa4995ce948c8c83b4640a1745457a149e73c6db75b4ffe36aad5f" "checksum bumpalo 2.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ad807f2fc2bf185eeb98ff3a901bd46dc5ad58163d0fa4577ba0d25674d71708" -"checksum byte-slice-cast 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "b0a5e3906bcbf133e33c1d4d95afc664ad37fbdb9f6568d8043e7ea8c27d93d3" +"checksum byte-slice-cast 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f6209f3b2c1edea170002e016d5ead6903d3bb0a846477f53bbeb614967a52a9" "checksum byte-tools 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" "checksum byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0fc10e8cc6b2580fda3f36eb6dc5316657f812a3df879a44a66fc9f0fdbc4855" "checksum byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a7c3dd8985a7111efc5c80b44e23ecdd8c007de8ade3b96595387e812b957cf5" "checksum bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)" = "206fdffcfa2df7cbe15601ef46c813fce0965eb3286db6b56c583b814b51c81c" -"checksum bytes 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "10004c15deb332055f7a4a208190aed362cf9a7c2f6ab70a305fba50e1105f38" +"checksum bytes 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1c85319f157e4e26c703678e68e26ab71a46c0199286fa670b21cc9fec13d895" "checksum c2-chacha 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "214238caa1bf3a496ec3392968969cab8549f96ff30652c9e56885329315f6bb" "checksum c_linked_list 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4964518bd3b4a8190e832886cdc0da9794f12e8e6c1613a9e90ff331c4c8724b" "checksum cargo_metadata 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "46e3374c604fb39d1a2f35ed5e4a4e30e60d01fab49446e08f1b3e9a90aef202" @@ -8416,8 +8250,6 @@ dependencies = [ "checksum const-random 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7b641a8c9867e341f3295564203b1c250eb8ce6cb6126e007941f78c4d2ed7fe" "checksum const-random-macro 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c750ec12b83377637110d5a57f5ae08e895b06c4b16e2bdbf1a94ef717428c59" "checksum constant_time_eq 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "995a44c877f9212528ccc74b21a232f66ad69001e40ede5bcee2ac9ef2657120" -"checksum cookie 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "888604f00b3db336d2af898ec3c1d5d0ddf5e6d462220f2ededc33a87ac4bbd5" -"checksum cookie_store 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "46750b3f362965f197996c4448e4a0935e791bf7d6631bfce9ee0af3d24c919c" "checksum core-foundation 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "25b9e03f145fd4f2bf705e07b900cd41fc636598fe5dc452fd0db1441c3f496d" "checksum core-foundation-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e7ca8a5221364ef15ce201e8ed2f609fc312682a8f4e0e3d4aa5879764e0fa3b" "checksum cranelift-bforest 0.50.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bd05aac8cefcde54ce26178df8f36cb1f518ac691db650e7d2440c2b6b41c4dc" @@ -8437,7 +8269,7 @@ dependencies = [ "checksum crossbeam-deque 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c3aa945d63861bfe624b55d153a39684da1e8c0bc8fba932f7ee3a3c16cea3ca" "checksum crossbeam-epoch 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5064ebdbf05ce3cb95e45c8b086f72263f4166b29b97f6baff7ef7fe047b55ac" "checksum crossbeam-queue 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7c979cd6cfe72335896575c6b5688da489e420d36a27a0b9eb0c73db574b4a4b" -"checksum crossbeam-queue 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c695eeca1e7173472a32221542ae469b3e9aac3a4fc81f7696bcad82029493db" +"checksum crossbeam-queue 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "dfd6515864a82d2f877b42813d4553292c6659498c9a2aa31bab5a15243c2700" "checksum crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)" = "04973fa96e96579258a5091af6003abde64af786b860f18622b82e026cca60e6" "checksum crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ce446db02cdc3165b94ae73111e570793400d0794e46125cc4056c81cbb039f4" "checksum crunchy 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" @@ -8459,11 +8291,9 @@ dependencies = [ "checksum dirs-sys 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "afa0b23de8fd801745c471deffa6e12d248f962c9fd4b4c33787b055599bde7b" "checksum dns-parser 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c4d33be9473d06f75f58220f71f7a9317aca647dc061dbd3c361b0bef505fbea" "checksum doc-comment 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "923dea538cea0aa3025e8685b20d6ee21ef99c4f77e954a30febbaac5ec73a97" -"checksum dtoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "ea57b42383d091c85abcc2706240b94ab2a8fa1fc81c10ff23c4de06e2a90b5e" "checksum ed25519-dalek 1.0.0-pre.3 (registry+https://github.com/rust-lang/crates.io-index)" = "978710b352437433c97b2bff193f2fb1dfd58a093f863dd95e225a19baa599a2" "checksum either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3" "checksum elastic-array 0.10.3 (registry+https://github.com/rust-lang/crates.io-index)" = "580f3768bd6465780d063f5b8213a2ebd506e139b345e4a81eb301ceae3d61e1" -"checksum encoding_rs 0.8.22 (registry+https://github.com/rust-lang/crates.io-index)" = "cd8d03faa7fe0c1431609dfad7bbe827af30f82e1e2ae6f7ee4fca6bd764bc28" "checksum enumflags2 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "33121c8782ba948ba332dab29311b026a8716dc65a1599e5b88f392d38496af8" "checksum enumflags2_derive 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ecf634c5213044b8d54a46dd282cf5dd1f86bb5cb53e92c409cb4680a7fb9894" "checksum env_logger 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "aafcde04e90a5226a6443b7aabdb016ba2f8307c847d524724bd9b346dd1a2d3" @@ -8472,7 +8302,6 @@ dependencies = [ "checksum erased-serde 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "3beee4bc16478a1b26f2e80ad819a52d24745e292f521a63c16eea5f74b7eb60" "checksum errno 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "c2a071601ed01b988f896ab14b95e67335d1eeb50190932a1320f7fe3cadc84e" "checksum errno-dragonfly 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "14ca354e36190500e1e1fb267c647932382b54053c50b14970856c0b00a35067" -"checksum error-chain 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3ab49e9dcb602294bc42f9a7dfc9bc6e936fca4418ea300dbfb84fe16de0b7d9" "checksum evm 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)" = "32a2c6961fdc9952371fc5f0416f03a9d90378a9dfb6862f6a7a9a3b8986b8dd" "checksum evm-core 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3bcde5af3d542874ddeb53de0919302d57586ea04b3f76f54d865f8a6cdc70ae" "checksum evm-gasometer 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b82bc9f275cb59d2bcc05d85c98736ddfaba003a7ef7b73893fa7c1c1fab29dc" @@ -8486,7 +8315,7 @@ dependencies = [ "checksum fdlimit 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b1ee15a7050e5580b3712877157068ea713b245b080ff302ae2ca973cfcd9baa" "checksum file-per-thread-logger 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "8505b75b31ef7285168dd237c4a7db3c1f3e0927e7d314e670bc98e854272fe9" "checksum finality-grandpa 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4106eb29c7e092f4a6ce6e7632abbbfdf85d94e63035d3790d2d16eeae83d3f4" -"checksum fixed-hash 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "3367952ceb191f4ab95dd5685dc163ac539e36202f9fcfd0cb22f9f9c542fefc" +"checksum fixed-hash 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "72fe7539e2c5692c6989f2f9c0457e42f1e5768f96b85c87d273574670ae459f" "checksum fixedbitset 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "86d4de0081402f5e88cdac65c8dcdcc73118c1a7a465e2a05f0da05843a8ea33" "checksum flate2 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)" = "6bd6d6f4752952feb71363cffc9ebac9411b75b87c6ab6058c40c8900cf43c0f" "checksum fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3" @@ -8534,7 +8363,7 @@ dependencies = [ "checksum hashbrown 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8e6073d0ca812575946eb5f35ff68dbe519907b25c42530389ff946dc84c6ead" "checksum heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1679e6ea370dee694f91f1dc469bf94cf8f52051d147aec3e1f9497c6fc22461" "checksum heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205" -"checksum hermit-abi 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "f629dc602392d3ec14bfc8a09b5e644d7ffd725102b48b81e59f90f2633621d7" +"checksum hermit-abi 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "307c3c9f937f38e3534b1d6447ecf090cafcc9744e4a6360e8b037b2cf5af120" "checksum hex 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "023b39be39e3a2da62a94feb433e91e8bcd37676fbc8bea371daf52b7a769a3e" "checksum hex-literal 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "961de220ec9a91af2e1e5bd80d02109155695e516771762381ef8581317066e0" "checksum hex-literal-impl 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9d4c5c844e2fee0bf673d54c2c177f1713b3d2af2ff6e666b49cb7572e6cf42d" @@ -8565,7 +8394,7 @@ dependencies = [ "checksum itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f56a2d0bc861f9165be4eb3442afd3c236d8a98afd426f65d92324ae1091a484" "checksum itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "501266b7edd0174f8530248f87f99c88fbe60ca4ef3dd486835b8d8d53136f7f" "checksum jobserver 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)" = "f2b1d42ef453b30b7387e113da1c83ab1605d90c5b4e0eb8e96d016ed3b8c160" -"checksum js-sys 0.3.33 (registry+https://github.com/rust-lang/crates.io-index)" = "367647c532db6f1555d7151e619540ec5f713328235b8c062c6b4f63e84adfe3" +"checksum js-sys 0.3.32 (registry+https://github.com/rust-lang/crates.io-index)" = "1c840fdb2167497b0bd0db43d6dfe61e91637fa72f9d061f8bd17ddc44ba6414" "checksum jsonrpc-client-transports 14.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "0a9ae166c4d1f702d297cd76d4b55758ace80272ffc6dbb139fdc1bf810de40b" "checksum jsonrpc-core 14.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fe3b688648f1ef5d5072229e2d672ecb92cbff7d1c79bcf3fd5898f3f3df0970" "checksum jsonrpc-core-client 14.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "080dc110be17701097df238fad3c816d4a478a1899dfbcf8ec8957dd40ec7304" @@ -8608,10 +8437,14 @@ dependencies = [ "checksum libp2p-yamux 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1913eb7dd6eb5515957b6f1770296f6921968db87bc9b985f0e974b6657e1003" "checksum librocksdb-sys 6.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "0a0785e816e1e11e7599388a492c61ef80ddc2afc91e313e61662cce537809be" <<<<<<< HEAD +<<<<<<< HEAD "checksum libsecp256k1 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "df6edf84fd62aad1c93932b39324eaeda3912c1d26bc18dfaee6293848e49a50" ======= "checksum libsecp256k1 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "b0885ff5b8070cdafbf65b3d098a0b7daf4925a18a704d3c503996443b799cc2" >>>>>>> 9044da2b8... Refactor rebase master prometheus_v0.3 +======= +"checksum libsecp256k1 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2bd9a7c16c9487e710536b699c962f022266347c94201174aa0a7eb0546051aa" +>>>>>>> 6c3137bdd... Milestone1: Final Version of v0.3 "checksum libz-sys 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)" = "2eb5e43362e38e2bca2fd5f5134c4d4564a23a5c28e9b95411652021a8675ebe" "checksum linked-hash-map 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ae91b68aebc4ddb91978b11a1b02ddd8602a05ec19002801c5666000e05e0f83" "checksum linked_hash_set 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3c7c91c4c7bbeb4f2f7c4e5be11e6a05bd6830bc37249c47ce1ad86ad453ff9c" @@ -8632,8 +8465,6 @@ dependencies = [ "checksum memory_units 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "71d96e3f3c0b6325d8ccd83c33b28acb183edcb6c67938ba104ec546854b0882" "checksum merlin 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2b0942b357c1b4d0dc43ba724674ec89c3218e6ca2b3e8269e7cb53bcecd2f6e" "checksum mime 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ba626b8a6de5da682e1caa06bdb42a335aee5a84db8e5046a3e8ab17ba0a3ae0" -"checksum mime 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)" = "dd1d63acd1b78403cc0c325605908475dd9b9a3acbf65ed8bcab97e27014afcf" -"checksum mime_guess 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1a0ed03949aef72dbdf3116a383d7b38b4768e6f960528cd6a6044aa9ed68599" "checksum miniz_oxide 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6f3f74f726ae935c3f514300cc6773a0c9492abc5e972d42ba0c0ebb88757625" "checksum mio 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)" = "302dec22bcf6bae6dfb69c647187f4b4d0fb6f535521f7bc022430ce8e12008f" "checksum mio-extras 2.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "52403fe290012ce777c4626790c8951324a2b9e3316b3143779c72b029742f19" @@ -8648,7 +8479,6 @@ dependencies = [ "checksum nix 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6c722bee1037d430d0f8e687bbdbf222f27cc6e4e68d5caf630857bb2b6dbdce" "checksum nodrop 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" "checksum nohash-hasher 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4e657a6ec97f9a3ba46f6f7034ea6db9fcd5b71d25ef1074b7bc03da49be0e8e" -"checksum nom 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "a5b8c256fd9471521bcb84c3cdba98921497f1a331cbc15b8030fc63b82050ce" "checksum nom 4.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2ad2a91a8e869eeb30b9cb3119ae87773a8f4ae617f41b1eb9c154b2905f7bd6" "checksum num-bigint 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "f9c3f34cdd24f334cb265d9bf8bfa8a241920d026916785747a92f0e55541a1a" "checksum num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)" = "b85e541ef8255f6cf42bbfe4ef361305c6c135d10919ecc26126c4e5ae94bc09" @@ -8706,14 +8536,11 @@ dependencies = [ "checksum proc-macro-nested 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "369a6ed065f249a159e06c45752c780bda2fb53c995718f9e484d08daa9eb42e" "checksum proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)" = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" "checksum proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "9c9e470a8dc4aeae2dee2f335e8f533e2d4b347e1434e5671afc49b054592f27" -"checksum procinfo 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f42e8578852a3306838981aedad8c5642ba794929aa12af0c9eb6c072b77af6c" -"checksum prometheus 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5567486d5778e2c6455b1b90ff1c558f29e751fc018130fa182e15828e728af1" "checksum prost 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "96d14b1c185652833d24aaad41c5832b0be5616a590227c1fbff57c616754b23" "checksum prost-build 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "eb788126ea840817128183f8f603dce02cb7aea25c2a0b764359d8e20010702e" "checksum prost-derive 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5e7dc378b94ac374644181a2247cebf59a6ec1c88b49ac77f3a94b86b79d0e11" "checksum prost-types 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1de482a366941c8d56d19b650fac09ca08508f2a696119ee7513ad590c8bac6f" "checksum protobuf 2.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "40361836defdd5871ff7e84096c6f6444af7fc157f8ef1789f54f147687caa20" -"checksum publicsuffix 1.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3bbaa49075179162b49acac1c6aa45fb4dafb5f13cf6794276d77bc7fd95757b" "checksum pwasm-utils 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4f7a12f176deee919f4ba55326ee17491c8b707d0987aed822682c821b660192" "checksum quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9274b940887ce9addde99c4eee6b5c44cc494b182b97e73dc8ffdcb3397fd3f0" "checksum quickcheck 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d5ca504a2fdaa08d3517f442fbbba91ac24d1ec4c51ea68688a038765e3b2662" @@ -8739,8 +8566,8 @@ dependencies = [ "checksum rand_xoshiro 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "03b418169fb9c46533f326efd6eed2576699c44ca92d3052a066214a8d828929" "checksum rand_xoshiro 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0e18c91676f670f6f0312764c759405f13afb98d5d73819840cf72a518487bff" "checksum raw-cpuid 7.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "b4a349ca83373cfa5d6dbb66fd76e58b2cca08da71a5f6400de0a0a6a9bceeaf" -"checksum rayon 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "db6ce3297f9c85e16621bb8cca38a06779ffc31bb8184e1be4bed2be4678a098" -"checksum rayon-core 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "08a89b46efaf957e52b18062fb2f4660f8b8a4dde1807ca002690868ef2c85a9" +"checksum rayon 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "43739f8831493b276363637423d3622d4bd6394ab6f0a9c4a552e208aeb7fddd" +"checksum rayon-core 1.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f8bf17de6f23b05473c437eb958b9c850bfc8af0961fe17b4cc92d5a627b4791" "checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" "checksum redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)" = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" "checksum redox_users 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4ecedbca3bf205f8d8f5c2b44d83cd0690e39ee84b951ed649e9f1841132b66d" @@ -8749,7 +8576,6 @@ dependencies = [ "checksum regex-syntax 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)" = "11a7e20d1cce64ef2fed88b66d347f88bd9babb82845b2b858f3edbf59a4f716" "checksum region 2.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "448e868c6e4cfddfa49b6a72c95906c04e8547465e9536575b95c70a4044f856" "checksum remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4a83fa3702a688b9359eccba92d153ac33fd2e8462f9e0e3fdf155239ea7792e" -"checksum reqwest 0.9.24 (registry+https://github.com/rust-lang/crates.io-index)" = "f88643aea3c1343c804950d7bf983bd2067f5ab59db6d613a08e05572f2714ab" "checksum ring 0.16.9 (registry+https://github.com/rust-lang/crates.io-index)" = "6747f8da1f2b1fabbee1aaa4eb8a11abf9adef0bf58a41cee45db5d59cecdfac" "checksum rlp 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3a44d5ae8afcb238af8b75640907edc6c931efcfab2c854e81ed35fa080f84cd" "checksum rocksdb 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "12069b106981c6103d3eab7dd1c86751482d0779a520b7c14954c8b586c1e643" @@ -8757,7 +8583,6 @@ dependencies = [ "checksum rust-argon2 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4ca4eaef519b494d1f2848fc602d18816fed808a981aedf4f1f00ceb7c9d32cf" "checksum rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" "checksum rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "403bb3a286107a04825a5f82e1270acc1e14028d3d554d7a1e08914549575ab8" -"checksum rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "c5f5376ea5e30ce23c03eb77cbe4962b988deead10910c372b226388b594c084" "checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" "checksum rustls 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b25a18b1bf7387f0145e7f8324e700805aade3842dd3db2e74e4cdeb4677c09e" "checksum rustversion 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c48f91977f4ef3be5358c15d131d3f663f6b4d7a112555bf3bf52ad23b6659e5" @@ -8775,15 +8600,13 @@ dependencies = [ "checksum sct 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e3042af939fca8c3453b7af0f1c66e533a15a86169e39de2657310ade8f98d3c" "checksum security-framework 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8ef2429d7cefe5fd28bd1d2ed41c944547d4ff84776f5935b456da44593a16df" "checksum security-framework-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e31493fc37615debb8c5090a7aeb4a9730bc61e77ab10b9af59f1a202284f895" -"checksum semver 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)" = "d4f410fedcf71af0345d7607d246e7ad15faaadd49d240ee3b24e5dc21a820ac" "checksum semver 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a3186ec9e65071a2095434b1f5bb24838d4e8e130f584c790f6033c79943537" "checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" "checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" "checksum send_wrapper 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a0eddf2e8f50ced781f288c19f18621fa72a3779e3cb58dbf23b07469b0abeb4" -"checksum serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)" = "414115f25f818d7dfccec8ee535d76949ae78584fc4f79a6f45a904bf8ab4449" -"checksum serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)" = "128f9e303a5a29922045a830221b8f78ec74a5f544944f3d5984f8ec3895ef64" +"checksum serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)" = "1217f97ab8e8904b57dd22eb61cde455fa7446a9c1cf43966066da047c1f3702" +"checksum serde_derive 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)" = "a8c6faef9a2e64b0064f48570289b4bf8823b7581f1d6157c1b52152306651d0" "checksum serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)" = "48c575e0cc52bdd09b47f330f646cf59afc586e9c4e3ccd6fc1f625b8ea1dad7" -"checksum serde_urlencoded 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "642dd69105886af2efd227f75a520ec9b44a820d65bc133a9131f7d229fd165a" "checksum sha-1 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "23962131a91661d643c98940b20fcaffe62d776a823247be80a48fcb8b6fce68" "checksum sha1 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d" "checksum sha2 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7b4d8bfd0e469f417657573d8451fb33d16cfe0989359b93baf3a1ffc639543d" @@ -8796,7 +8619,7 @@ dependencies = [ "checksum slog-scope 4.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7c44c89dd8b0ae4537d1ae318353eaf7840b4869c536e31c41e963d1ea523ee6" "checksum slog_derive 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a945ec7f7ce853e89ffa36be1e27dce9a43e82ff9093bf3461c30d5da74ed11b" "checksum smallvec 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "f7b0758c52e15a8b5e3691eae6cc559f08eee9406e548a4477ba4e67770a82b6" -"checksum smallvec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "44e59e0c9fa00817912ae6e4e6e3c4fe04455e75699d06eedc7d85917ed8e8f4" +"checksum smallvec 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4ecf3b85f68e8abaa7555aa5abdb1153079387e60b718283d732f03897fcfc86" "checksum snow 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "afb767eee7d257ba202f0b9b08673bc13b22281632ef45267b19f13100accd2f" "checksum soketto 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "bceb1a3a15232d013d9a3b7cac9e5ce8e2313f348f01d4bc1097e5e53aa07095" "checksum sourcefile 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "4bf77cb82ba8453b42b6ae1d692e4cdc92f9a47beaf89a847c8be83f4e328ad3" @@ -8834,9 +8657,9 @@ dependencies = [ "checksum tiny-bip39 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c1c5676413eaeb1ea35300a0224416f57abc3bd251657e0fafc12c47ff98c060" "checksum tiny-keccak 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d8a021c69bb74a44ccedb824a046447e2c84a01df9e5c20779750acb38e11b2" "checksum tiny-keccak 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2953ca5148619bc99695c1274cb54c5275bbb913c6adad87e72eaf8db9787f69" -"checksum tinytemplate 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "57a3c6667d3e65eb1bc3aed6fd14011c6cbc3a0665218ab7f5daf040b9ec371a" +"checksum tinytemplate 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4574b75faccaacddb9b284faecdf0b544b80b6b294f3d062d325c5726a209c20" "checksum tokio 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)" = "5a09c0b5bb588872ab2f09afa13ee6e9dac11e10a0ec9e8e3ba39a5a5d530af6" -"checksum tokio 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0e1bef565a52394086ecac0a6fa3b8ace4cb3a138ee1d96bd2b93283b56824e3" +"checksum tokio 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "bcced6bb623d4bff3739c176c415f13c418f426395c169c9c3cd9a492c715b16" "checksum tokio-buf 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8fb220f46c53859a4b7ec083e41dec9778ff0b1851c0942b211edb89e0ccdc46" "checksum tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5c501eceaf96f0e1793cf26beb63da3d11c738c4a943fdf3746d81d64684c39f" "checksum tokio-current-thread 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "d16217cad7f1b840c5a97dfb3c43b0c871fef423a6e8d2118c604e843662a443" @@ -8858,17 +8681,16 @@ dependencies = [ "checksum tokio-util 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "571da51182ec208780505a32528fc5512a8fe1443ab960b3f2f3ef093cd16930" "checksum toml 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "01d1404644c8b12b16bfcffa4322403a91a451584daaaa7c28d3152e6cbc98cf" "checksum tower-service 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e987b6bf443f4b5b3b6f38704195592cca41c5bb7aedd3c3693c7081f8289860" -"checksum tracing 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "6de6a8590a29d3f401eab60470c699efa0adf7b4f0352055bf24df2b69849b40" -"checksum tracing-attributes 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "04cfd395def5a60236e187e1ff905cb55668a59f29928dec05e6e1b1fd2ac1f3" -"checksum tracing-core 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "d7fb511ac6ca1d031c5cfc26d8c38da9d88e91d2bd5b38b60cf8dc1b8b5c211f" +"checksum tracing 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "ff4e4f59e752cb3beb5b61c6d5e11191c7946231ba84faec2902c9efdd8691c5" +"checksum tracing-attributes 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "a4263b12c3d3c403274493eb805966093b53214124796552d674ca1dd5d27c2b" +"checksum tracing-core 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "bc913647c520c959b6d21e35ed8fa6984971deca9f0a2fcb8c51207e0c56af1d" "checksum traitobject 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "efd1f82c56340fdf16f2a953d7bda4f8fdffba13d93b00844c25572110b26079" "checksum trie-bench 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)" = "403d8ec7dbc4b46781ef18cd96b371bb9ce6ec394fe83ece75eb3bc755dfa69f" "checksum trie-db 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)" = "784a9813d23f18bccab728ab039c39b8a87d0d6956dcdece39e92f5cffe5076e" "checksum trie-root 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0b779f7c1c8fe9276365d9d5be5c4b5adeacf545117bb3f64c974305789c5c0b" "checksum trie-standardmap 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c3161ba520ab28cd8e6b68e1126f1009f6e335339d1a73b978139011703264c8" "checksum try-lock 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e604eb7b43c06650e854be16a2a03155743d3752dd1c943f6829e26b7a36e382" -"checksum try_from 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "283d3b89e1368717881a9d51dad843cc435380d8109c9e47d38780a324698d8b" -"checksum trybuild 1.0.19 (registry+https://github.com/rust-lang/crates.io-index)" = "987d6fdc45ddd7f3be5aa7386c8c8a844d1655c95b9ed948a9cd9cded8f2b79f" +"checksum trybuild 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)" = "b75e31d624df08744532e935f1d4bfedd319a277d5a162c5b15f6ced59307575" "checksum twofish 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712d261e83e727c8e2dbb75dacac67c36e35db36a958ee504f2164fc052434e1" "checksum twox-hash 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3bfd5b7557925ce778ff9b9ef90e3ade34c524b5ff10e239c69a42d546d2af56" "checksum typeable 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1410f6f91f21d1612654e7cc69193b0334f909dcf2c790c4826254fbb86f8887" @@ -8886,7 +8708,6 @@ dependencies = [ "checksum untrusted 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "60369ef7a31de49bcb3f6ca728d4ba7300d9a1658f94c727d4cab8c8d9f4aece" "checksum url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355a" "checksum url 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "75b414f6c464c879d7f9babf951f23bc3743fb7313c081b2e6ca719067ea9d61" -"checksum uuid 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)" = "90dbc611eb48397705a6b0f6e917da23ae517e4d127123d2cf7674206627d32a" "checksum vcpkg 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3fc439f2794e98976c88a2a2dafce96b930fe8010b0a256b3c2199a773933168" "checksum vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a" "checksum vergen 3.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "6aba5e34f93dc7051dfad05b98a18e9156f27e7b431fe1d2398cb6061c0a1dba" @@ -8899,13 +8720,13 @@ dependencies = [ "checksum want 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b6395efa4784b027708f7451087e647ec73cc74f5d9bc2e418404248d679a230" "checksum want 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" "checksum wasi 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b89c3ce4ce14bdc6fb6beaf9ec7928ca331de5df7e5ea278375642a2f478570d" -"checksum wasm-bindgen 0.2.56 (registry+https://github.com/rust-lang/crates.io-index)" = "99de4b68939a880d530aed51289a7c7baee154e3ea8ac234b542c49da7134aaf" -"checksum wasm-bindgen-backend 0.2.56 (registry+https://github.com/rust-lang/crates.io-index)" = "b58e66a093a7b7571cb76409763c495b8741ac4319ac20acc2b798f6766d92ee" +"checksum wasm-bindgen 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)" = "29ae32af33bacd663a9a28241abecf01f2be64e6a185c6139b04f18b6385c5f2" +"checksum wasm-bindgen-backend 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)" = "1845584bd3593442dc0de6e6d9f84454a59a057722f36f005e44665d6ab19d85" "checksum wasm-bindgen-futures 0.3.27 (registry+https://github.com/rust-lang/crates.io-index)" = "83420b37346c311b9ed822af41ec2e82839bfe99867ec6c54e2da43b7538771c" -"checksum wasm-bindgen-macro 0.2.56 (registry+https://github.com/rust-lang/crates.io-index)" = "a80f89daea7b0a67b11f6e9f911422ed039de9963dce00048a653b63d51194bf" -"checksum wasm-bindgen-macro-support 0.2.56 (registry+https://github.com/rust-lang/crates.io-index)" = "4f9dbc3734ad6cff6b76b75b7df98c06982becd0055f651465a08f769bca5c61" -"checksum wasm-bindgen-shared 0.2.56 (registry+https://github.com/rust-lang/crates.io-index)" = "d907984f8506b3554eab48b8efff723e764ddbf76d4cd4a3fe4196bc00c49a70" -"checksum wasm-bindgen-webidl 0.2.56 (registry+https://github.com/rust-lang/crates.io-index)" = "f85a3825a459cf6a929d03bacb54dca37a614d43032ad1343ef2d4822972947d" +"checksum wasm-bindgen-macro 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)" = "87fcc747e6b73c93d22c947a6334644d22cfec5abd8b66238484dc2b0aeb9fe4" +"checksum wasm-bindgen-macro-support 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)" = "3dc4b3f2c4078c8c4a5f363b92fcf62604c5913cbd16c6ff5aaf0f74ec03f570" +"checksum wasm-bindgen-shared 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)" = "ca0b78d6d3be8589b95d1d49cdc0794728ca734adf36d7c9f07e6459508bb53d" +"checksum wasm-bindgen-webidl 0.2.55 (registry+https://github.com/rust-lang/crates.io-index)" = "3126356474ceb717c8fb5549ae387c9fbf4872818454f4d87708bee997214bb5" "checksum wasm-gc-api 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d0c32691b6c7e6c14e7f8fd55361a9088b507aa49620fcd06c09b3a1082186b9" "checksum wasm-timer 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "aa3e01d234bb71760e685cfafa5e2c96f8ad877c161a721646356651069e26ac" "checksum wasmi 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bf617d864d25af3587aa745529f7aaa541066c876d57e050c0d0c85c61c92aff" @@ -8915,7 +8736,7 @@ dependencies = [ "checksum wasmtime-environ 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a3947662a0b8e05b1418465e64f16de9114f9fec18cc3f56e0ed5aa7737b89d0" "checksum wasmtime-jit 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6ed7922689461a7b5bd0d9c7350cac526c8a520a23b3ffd7f5b446ac51dfc51f" "checksum wasmtime-runtime 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "781d6bb8b346efaa3dc39746386957cd79b8d841e8652ed9b02d77bcf64fb514" -"checksum web-sys 0.3.33 (registry+https://github.com/rust-lang/crates.io-index)" = "2fb60433d0dc12c803b9b017b3902d80c9451bab78d27bc3210bf2a7b96593f1" +"checksum web-sys 0.3.32 (registry+https://github.com/rust-lang/crates.io-index)" = "98405c0a2e722ed3db341b4c5b70eb9fe0021621f7350bab76df93b09b649bbf" "checksum webpki 0.21.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d7e664e770ac0110e2384769bcc59ed19e329d81f555916a6e072714957b81b4" "checksum webpki-roots 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a262ae37dd9d60f60dd473d1158f9fbebf110ba7b6a5051c8160460f6043718b" "checksum webpki-roots 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)" = "91cd5736df7f12a964a5067a12c62fa38e1bd8080aff1f80bc29be7c80d19ab4" @@ -8930,7 +8751,6 @@ dependencies = [ "checksum winapi-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7168bab6e1daee33b4557efd0e95d5ca70a03706d39fa5f3fe7a236f584b03c9" "checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" "checksum wincolor 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "96f5016b18804d24db43cebf3c77269e7569b8954a8464501c216cc5e070eaa9" -"checksum winreg 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b2986deb581c4fe11b621998a5e53361efe6b48a151178d0cd9eeffa4dc6acc9" "checksum ws 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c51a2c47b5798ccc774ffb93ff536aec7c4275d722fd9c740c83cdd1af1f2d94" "checksum ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" "checksum x25519-dalek 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7ee1585dc1484373cbc1cee7aafda26634665cf449436fd6e24bfd1fad230538" diff --git a/Cargo.toml b/Cargo.toml index 722dd3508087b..e5940e5b7cdf1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -45,10 +45,10 @@ members = [ "client/service", "client/service/test", "client/state-db", - "client/prometheus", "client/telemetry", "client/transaction-pool", "client/transaction-pool/graph", + "utils/prometheus", "utils/wasm-builder-runner", "utils/grafana-data-source", "utils/grafana-data-source/test", diff --git a/client/Cargo.toml b/client/Cargo.toml index bb88490e585a8..da4f5e3cc2c9b 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -31,7 +31,6 @@ sp-state-machine = { version = "2.0.0", path = "../primitives/state-machine" } sc-telemetry = { version = "2.0.0", path = "telemetry" } sp-trie = { version = "2.0.0", path = "../primitives/trie" } tracing = "0.1.10" -sc-prometheus = { path = "prometheus" } [dev-dependencies] env_logger = "0.7.0" diff --git a/client/cli/Cargo.toml b/client/cli/Cargo.toml index 6dca93855d0a8..5c7ac86904164 100644 --- a/client/cli/Cargo.toml +++ b/client/cli/Cargo.toml @@ -29,7 +29,7 @@ sp-core = { version = "2.0.0", path = "../../primitives/core" } sc-service = { version = "2.0.0", default-features = false, path = "../service" } sp-state-machine = { version = "2.0.0", path = "../../primitives/state-machine" } sc-telemetry = { version = "2.0.0", path = "../telemetry" } -sc-prometheus = { path = "../prometheus" } +sc-prometheus = { path = "../../utils/prometheus" } sp-keyring = { version = "2.0.0", path = "../../primitives/keyring" } names = "0.11.0" structopt = "=0.3.7" diff --git a/client/cli/src/lib.rs b/client/cli/src/lib.rs index 922c2d77896d9..e2323694f1b51 100644 --- a/client/cli/src/lib.rs +++ b/client/cli/src/lib.rs @@ -942,6 +942,7 @@ where config.tracing_targets = cli.tracing_targets.into(); config.tracing_receiver = cli.tracing_receiver.into(); + // Override prometheus match cli.prometheus_endpoint { None => {config.prometheus_endpoint = None;}, Some(x) => { diff --git a/client/service/Cargo.toml b/client/service/Cargo.toml index 8b1a4e9b5241a..887e8415f39b7 100644 --- a/client/service/Cargo.toml +++ b/client/service/Cargo.toml @@ -54,7 +54,7 @@ parity-multiaddr = { package = "parity-multiaddr", version = "0.5.0" } grafana-data-source = { version = "2.0.0", path = "../../utils/grafana-data-source" } sc-tracing = { version = "2.0.0", path = "../tracing" } tracing = "0.1.10" -promet = { package = "sc-prometheus", path="../prometheus"} +sc-prometheus = { package = "sc-prometheus", path="../../utils/prometheus"} [dev-dependencies] substrate-test-runtime-client = { version = "2.0.0", path = "../../test-utils/runtime/client" } diff --git a/client/service/src/builder.rs b/client/service/src/builder.rs index 2bd11d9620ef1..062da1c655b77 100644 --- a/client/service/src/builder.rs +++ b/client/service/src/builder.rs @@ -52,7 +52,9 @@ use std::{ }; use sysinfo::{get_current_pid, ProcessExt, System, SystemExt}; use sc_telemetry::{telemetry, SUBSTRATE_INFO}; -use promet::prometheus_gauge; +use sp_transaction_pool::{TransactionPool, TransactionPoolMaintainer}; +use sc_prometheus::prometheus_gauge; + use sp_blockchain; use grafana_data_source::{self, record_metrics}; @@ -1113,10 +1115,11 @@ ServiceBuilder< .then(|_| Ok(())))); telemetry }); + // prometheus init match config.prometheus_endpoint { None => (), Some(x) => { - let _prometheus = promet::init_prometheus(x); + let _prometheus = sc_prometheus::init_prometheus(x); } } // Grafana data source diff --git a/client/service/src/config.rs b/client/service/src/config.rs index b7aa6303c3b71..d2bcca7a22b25 100644 --- a/client/service/src/config.rs +++ b/client/service/src/config.rs @@ -75,7 +75,7 @@ pub struct Configuration { pub rpc_cors: Option>, /// Grafana data source http port. `None` if disabled. pub grafana_port: Option, - + /// Promteheus IP addr. `None` if disabled. and defult port 33333 pub prometheus_endpoint: Option, /// Telemetry service URL. `None` if disabled. pub telemetry_endpoints: Option, diff --git a/client/service/src/lib.rs b/client/service/src/lib.rs index 26257eebc7773..e383703da7f24 100644 --- a/client/service/src/lib.rs +++ b/client/service/src/lib.rs @@ -17,6 +17,8 @@ //! Substrate service. Starts a thread that spins up the network, client, and extrinsic pool. //! Manages communication between them. +#![warn(missing_docs)] + pub mod config; #[macro_use] pub mod chain_ops; diff --git a/client/prometheus/Cargo.toml b/utils/prometheus/Cargo.toml similarity index 78% rename from client/prometheus/Cargo.toml rename to utils/prometheus/Cargo.toml index 29d81c9e5fda8..8ac6d7001833f 100644 --- a/client/prometheus/Cargo.toml +++ b/utils/prometheus/Cargo.toml @@ -11,6 +11,7 @@ lazy_static = "1.0" log = "0.4" prometheus = { version = "0.7", features = ["nightly", "process"]} tokio = "0.1" +sp-runtime = { package = "sp-runtime",path = "../../primitives/runtime" } [dev-dependencies] reqwest = "0.9" \ No newline at end of file diff --git a/client/prometheus/README.md b/utils/prometheus/README.md similarity index 62% rename from client/prometheus/README.md rename to utils/prometheus/README.md index ced9730696e27..3efe80d57de94 100644 --- a/client/prometheus/README.md +++ b/utils/prometheus/README.md @@ -1,5 +1,5 @@ # Substrate Prometheus Node Exporter - +![grants](./photo_2019-12-13_16-32-53.jpg) ## Introduction Prometheus is one of the most widely used monitoring tool for managing high availability services supported by [Cloud Native Computing Foundation](https://www.cncf.io/). By providing Prometheus exporter in substrate, node operators can easily adopt widely used display/alert tool such as Grafana without seting-up/operating external Prometheus agent through RPC connections. Easy access to such monitoring tools will benefit parachain develepers/operators and validators to have much higher availability quality of their services. @@ -27,7 +27,7 @@ Start Grafana Here is the entry point of prometheus core module in Parity Substrate. -client/prometheus/src/lib.rs +utils/prometheus/src/lib.rs ```rust #[macro_use] extern crate lazy_static; @@ -39,7 +39,7 @@ use hyper::service::service_fn_ok; use hyper::{Body, Request, Response, Server}; pub use prometheus::{Encoder, HistogramOpts, Opts, TextEncoder}; pub use prometheus::{Histogram, IntCounter, IntGauge, Result}; -pub use sr_primitives::traits::SaturatedConversion; +pub use sp_runtime::traits::SaturatedConversion; use std::net::SocketAddr; pub mod metrics; @@ -47,44 +47,44 @@ pub mod metrics; /// Initializes the metrics context, and starts an HTTP server /// to serve metrics. pub fn init_prometheus(prometheus_addr: SocketAddr) { - let addr = prometheus_addr; - let server = Server::bind(&addr) - .serve(|| { - // This is the `Service` that will handle the connection. - // `service_fn_ok` is a helper to convert a function that - // returns a Response into a `Service`. - service_fn_ok(move |req: Request| { - if req.uri().path() == "/metrics" { - let metric_families = prometheus::gather(); - let mut buffer = vec![]; - let encoder = TextEncoder::new(); - encoder.encode(&metric_families, &mut buffer).unwrap(); - Response::builder() - .status(StatusCode::OK) - .header("Content-Type", encoder.format_type()) - .body(Body::from(buffer)) - .expect("Sends OK(200) response with one or more data metrics") - } else { - Response::builder() - .status(StatusCode::NOT_FOUND) - .body(Body::from("Not found.")) - .expect("Sends NOT_FOUND(404) message with no data metric") - } - }) - }) - .map_err(|e| error!("server error: {}", e)); - - info!("Exporting metrics at http://{}/metrics", addr); - - let mut rt = tokio::runtime::Builder::new() - .core_threads(1) // one thread is sufficient - .build() - .expect("Builds one thread of tokio runtime exporter for prometheus"); - - std::thread::spawn(move || { - rt.spawn(server); - rt.shutdown_on_idle().wait().unwrap(); - }); + let addr = prometheus_addr; + let server = Server::bind(&addr) + .serve(|| { + // This is the `Service` that will handle the connection. + // `service_fn_ok` is a helper to convert a function that + // returns a Response into a `Service`. + service_fn_ok(move |req: Request| { + if req.uri().path() == "/metrics" { + let metric_families = prometheus::gather(); + let mut buffer = vec![]; + let encoder = TextEncoder::new(); + encoder.encode(&metric_families, &mut buffer).unwrap(); + Response::builder() + .status(StatusCode::OK) + .header("Content-Type", encoder.format_type()) + .body(Body::from(buffer)) + .expect("Sends OK(200) response with one or more data metrics") + } else { + Response::builder() + .status(StatusCode::NOT_FOUND) + .body(Body::from("Not found.")) + .expect("Sends NOT_FOUND(404) message with no data metric") + } + }) + }) + .map_err(|e| error!("server error: {}", e)); + + info!("Exporting metrics at http://{}/metrics", addr); + + let mut rt = tokio::runtime::Builder::new() + .core_threads(1) // one thread is sufficient + .build() + .expect("Builds one thread of tokio runtime exporter for prometheus"); + + std::thread::spawn(move || { + rt.spawn(server); + rt.shutdown_on_idle().wait().unwrap(); + }); } #[macro_export] @@ -107,16 +107,6 @@ macro_rules! prometheus_histogram( } ); -#[macro_export] -macro_rules! prometheus_counter( - ($($metric:expr => $value:expr),*) => { - use $crate::{metrics::*}; - $( - metrics::set_counter(&$metric, $value); - )* - } -); - /* TODO: Make abstract type for all metrics(e.g. Gauge, Histogram, Counter) with generic traits so that all metrics can be set up with one function `set` #[macro_export] @@ -135,7 +125,7 @@ Here is the dependancies of the module. client/prometheus/Cargo.toml ```toml [package] -name = "substrate-prometheus" +name = "sc-prometheus" version = "2.0.0" authors = ["Parity Technologies "] description = "prometheus utils" @@ -147,6 +137,7 @@ lazy_static = "1.0" log = "0.4" prometheus = { version = "0.7", features = ["nightly", "process"]} tokio = "0.1" +sp-runtime = { package = "sp-runtime",path = "../../primitives/runtime" } [dev-dependencies] reqwest = "0.9" @@ -155,66 +146,137 @@ reqwest = "0.9" **Abbreviation of the package in service manager of parity substrate** client/service/Cargo.toml ```toml -.... -promet = { package = "substrate-prometheus", path="../../core/prometheus"} -.... +[dependencies] +sc-prometheus = { package = "sc-prometheus", path="../../utils/prometheus"} ``` **Metrics builder as same as substrate-telemetry** -client/service/src/builder.rs +client/service/src/builder.rsL1271 , L1112 ```rust +use sc_prometheus::prometheus_gauge; +... + telemetry!( + SUBSTRATE_INFO; + "system.interval"; + "peers" => num_peers, + "height" => best_number, + "best" => ?best_hash, + "txcount" => txpool_status.ready, + "cpu" => cpu_usage, + "memory" => memory, + "finalized_height" => finalized_number, + "finalized_hash" => ?info.chain.finalized_hash, + "bandwidth_download" => bandwidth_download, + "bandwidth_upload" => bandwidth_upload, + "used_state_cache_size" => used_state_cache_size, + ); + prometheus_gauge!( + MEMPOOL_SIZE => used_state_cache_size as u64, + NODE_MEMORY => memory as u64, + NODE_CPU => cpu_usage as u64, + TX_COUNT => txpool_status.ready as u64, + FINALITY_HEIGHT => finalized_number as u64, + BEST_HEIGHT => best_number as u64, + P2P_PEERS_NUM => num_peers as u64, + P2P_NODE_DOWNLOAD => net_status.average_download_per_sec as u64, + P2P_NODE_UPLOAD => net_status.average_upload_per_sec as u64 + ); + let _ = record_metrics!( + "peers" => num_peers, + "height" => best_number, + "txcount" => txpool_status.ready, + "cpu" => cpu_usage, + "memory" => memory, + "finalized_height" => finalized_number, + "bandwidth_download" => bandwidth_download, + "bandwidth_upload" => bandwidth_upload, + "used_state_cache_size" => used_state_cache_size, + ); + Ok(()) + }).select(exit.clone().map(Ok).compat()).then(|_| Ok(())); + let _ = to_spawn_tx.unbounded_send(Box::new(tel_task)); + +... + // prometheus init + match config.prometheus_endpoint { + None => (), + Some(x) => { + let _prometheus = sc_prometheus::init_prometheus(x); + } + } + // Grafana data source + if let Some(port) = config.grafana_port { + let future = select( + grafana_data_source::run_server(port).boxed(), + exit.clone() + ).map(|either| match either { + Either::Left((result, _)) => result.map_err(|_| ()), + Either::Right(_) => Ok(()) + }).compat(); + + let _ = to_spawn_tx.unbounded_send(Box::new(future)); + } - ..... - let _ = to_spawn_tx.unbounded_send(Box::new(future - .select(exit.clone()) - .then(|_| Ok(())))); - telemetry - }); ----------------- -match config.prometheus_endpoint { - None => (), - Some(x) => {let _prometheus = promet::init_prometheus(x);} + // Instrumentation + if let Some(tracing_targets) = config.tracing_targets.as_ref() { + let subscriber = sc_tracing::ProfilingSubscriber::new( + config.tracing_receiver, tracing_targets + ); + match tracing::subscriber::set_global_default(subscriber) { + Ok(_) => (), + Err(e) => error!(target: "tracing", "Unable to set global default subscriber {}", e), + } } - -------------------- - Ok(NewService { - client, - network, - ..... + + ``` substrate/Cargo.toml ```toml - .... [workspace] members = [ - "client/prometheus", - .... + "utils/prometheus", ``` ### CLI Config client/cli/src/lib.rs ```rust -fn crate_run_node_config +fn crate_run_node_config{ ... -} + // Override telemetry + if cli.no_telemetry { + config.telemetry_endpoints = None; + } else if !cli.telemetry_endpoints.is_empty() { + config.telemetry_endpoints = Some(TelemetryEndpoints::new(cli.telemetry_endpoints)); + } + config.tracing_targets = cli.tracing_targets.into(); + config.tracing_receiver = cli.tracing_receiver.into(); + + // Override prometheus match cli.prometheus_endpoint { None => {config.prometheus_endpoint = None;}, Some(x) => { config.prometheus_endpoint = Some(parse_address(&format!("{}:{}", x, 33333), cli.prometheus_port)?); } } -... + // Imply forced authoring on --dev + config.force_authoring = cli.shared_params.dev || cli.force_authoring; + Ok(config) +... +} ``` client/cli/src/params.rs ```rust pub struct RunCmd{ -/// Specify HTTP RPC server TCP port. -#[structopt(long = "prometheus-port", value_name = "PORT")] +... +/// Prometheus exporter TCP port. + #[structopt(long = "prometheus-port", value_name = "PORT")] pub prometheus_port: Option, -#[structopt(long = "prometheus-addr", value_name = "Local IP address")] + /// Prometheus exporter IP addr. + #[structopt(long = "prometheus-addr", value_name = "Local IP address")] pub prometheus_endpoint: Option, +... } ``` client/service/src/config.rs @@ -222,7 +284,8 @@ client/service/src/config.rs #[derive(Clone)] pub struct Configuration { ... - pub prometheus_endpoint: Option, + /// Promteheus IP addr. `None` if disabled. and defult port 33333 + pub prometheus_endpoint: Option, ... } impl Configuration where @@ -250,11 +313,12 @@ impl Configuration where ### Metrics Add ex) consensus_FINALITY_HEIGHT -client/prometheus/src/metrics.rs +utils/prometheus/src/metrics.rs ```rust pub use crate::*; +/// Gauge type metrics generation function pub fn try_create_int_gauge(name: &str, help: &str) -> Result { let opts = Opts::new(name, help); let gauge = IntGauge::with_opts(opts)?; @@ -262,12 +326,14 @@ pub fn try_create_int_gauge(name: &str, help: &str) -> Result { Ok(gauge) } +///Gauge Metrics a value in injection. pub fn set_gauge(gauge: &Result, value: u64) { if let Ok(gauge) = gauge { gauge.set(value as i64); } } +///All of the metrics in the prometheus are managed by the lazy_static. lazy_static! { pub static ref FINALITY_HEIGHT: Result = try_create_int_gauge( "consensus_finality_block_height_number", @@ -279,13 +345,13 @@ lazy_static! { client/service/Cargo.toml ```rust ... -promet = { package = "substrate-prometheus", path="../prometheus"} +sc-prometheus = { package = "sc-prometheus", path="../../utils/prometheus"} ... ``` client/service/src/builder.rs ```rust ..... -use promet::{prometheus_gauge}; +use sc-prometheus::{prometheus_gauge}; ..... let tel_task = state_rx.for_each(move |(net_status, _)| { let info = client_.info(); @@ -359,7 +425,6 @@ Consensus metrics, namespace: `substrate` | consensus_finality_block_height_number | IntGauge | | finality Height of the chain | | consensus_best_block_height_number | IntGauge | | best Height of the chain | | consensus_target_syn_number | IntGauge | | syning Height target number | -| consensus_block_interval_seconds | Histogram | | Time between this and last block (Block.Header.Time) in seconds | | consensus_num_txs | Gauge | | Number of transactions | | consensus_node_memory | IntGauge | | Node's primary memory | | consensus_node_cpu | IntGauge | | Node's cpu load | @@ -367,6 +432,12 @@ Consensus metrics, namespace: `substrate` | p2p_peer_receive_bytes_per_sec | IntGauge | | number of bytes received from a given peer | | p2p_peer_send_bytes_per_sec | IntGauge | | number of bytes sent to a given peer | | mempool_size | IntGauge | | Number of uncommitted transactions | +| Resource_receive_bytes_per_sec(Future) | IntGauge | | Operating System of bytes received | +| Resource_send_bytes_per_sec(Future) | IntGauge | | Operating System of bytes sent | +| Resource_cpu_use(Future) | IntGauge | | Operating System cpu load | +| Resource_disk_use(Future) | IntGauge | | Operating System disk use | +| validator_sign_prevote(Future) | IntGauge | validator addr | validator sign vote list | +| validator_sign_precommit(Future) | IntGauge | validator addr | validator sign commit list | ## Start Prometheus @@ -427,4 +498,4 @@ You can visit `http://localhost:3000/` to open grafana and create your own dashb ### Seting Grafana -Default ID:PW is admin. \ No newline at end of file +Default ID:PW is admin. diff --git a/utils/prometheus/photo_2019-12-13_16-32-53.jpg b/utils/prometheus/photo_2019-12-13_16-32-53.jpg new file mode 100644 index 0000000000000000000000000000000000000000..cdf44f88fb623d7b5a319235c6d603463698716c GIT binary patch literal 27726 zcmeFZcT`m0wkEoDJ3nV{7^+zOM;&BO;@slT%XD z(lg$@&-|44IsZ#R;n$*y%Bt$`HMMp1ZS5VMUEMvsKZi#~$Hpfnr>2*dS60{7H#WDn z(T7LJC#PqaKj(k5ivVxuzaIZ$*gx4tgSYD%At8tm{5Q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1Tasg|exvf{Pyq(U0PS;ut26BQ> z;L*6vS^dbEuQWOEE4=8@js57=x+>eW z?-@c?e7s^hR}#!3c-U3gWK%;BuYqwdHV=7_3sWUkXHWV0_sCcuv@~s}h!up1(At+kaFO^=KyT&{a>MXi>v?u literal 0 HcmV?d00001 diff --git a/client/prometheus/src/lib.rs b/utils/prometheus/src/lib.rs similarity index 98% rename from client/prometheus/src/lib.rs rename to utils/prometheus/src/lib.rs index c3db7e2d15763..4713f47291de0 100644 --- a/client/prometheus/src/lib.rs +++ b/utils/prometheus/src/lib.rs @@ -8,6 +8,7 @@ use hyper::service::service_fn_ok; use hyper::{Body, Request, Response, Server}; pub use prometheus::{Encoder, HistogramOpts, Opts, TextEncoder}; pub use prometheus::{Histogram, IntCounter, IntGauge, Result}; +pub use sp_runtime::traits::SaturatedConversion; use std::net::SocketAddr; pub mod metrics; diff --git a/client/prometheus/src/metrics.rs b/utils/prometheus/src/metrics.rs similarity index 94% rename from client/prometheus/src/metrics.rs rename to utils/prometheus/src/metrics.rs index a2621c3354aea..dfb9c4ec57720 100644 --- a/client/prometheus/src/metrics.rs +++ b/utils/prometheus/src/metrics.rs @@ -27,7 +27,8 @@ pub fn set_histogram(histogram: &Result, value: f64) { histogram.observe(value) } } -///All of the metrics in the prometheus are managed by the lazy_static. +//All of the metrics in the prometheus are managed by the lazy_static. + lazy_static! { pub static ref FINALITY_HEIGHT: Result = try_create_int_gauge( "consensus_finality_block_height_number", @@ -68,11 +69,11 @@ lazy_static! { "Number of uncommitted transactions" ); pub static ref P2P_NODE_DOWNLOAD: Result = try_create_int_gauge( - "p2p_peer_receive_byte_per_sec", + "p2p_peers_receive_byte_per_sec", "p2p_node_download_per_sec_byte" ); pub static ref P2P_NODE_UPLOAD: Result = try_create_int_gauge( - "p2p_peer_send_byte_per_sec", + "p2p_peers_send_byte_per_sec", "p2p_node_upload_per_sec_byte" ); } \ No newline at end of file From 1974f94dc9ee0bf41089d956b7314448e5d1dfac Mon Sep 17 00:00:00 2001 From: nodebreaker-carlsagan Date: Thu, 2 Jan 2020 21:23:51 +0900 Subject: [PATCH 03/42] no-std or warm compatibility issues, grapana-data -source code reference and correction,applicable --- Cargo.lock | 66 +++++++ client/cli/src/lib.rs | 11 +- client/cli/src/params.rs | 6 +- client/service/src/builder.rs | 14 +- client/service/src/config.rs | 6 +- client/service/test/src/lib.rs | 2 +- utils/prometheus/Cargo.toml | 14 +- utils/prometheus/README.md | 281 ++++++++++++++++++++--------- utils/prometheus/src/lib.rs | 169 ++++++++++++----- utils/prometheus/src/metrics.rs | 19 +- utils/prometheus/src/networking.rs | 66 +++++++ 11 files changed, 497 insertions(+), 157 deletions(-) create mode 100644 utils/prometheus/src/networking.rs diff --git a/Cargo.lock b/Cargo.lock index 8022469e81549..282df55da6540 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3328,6 +3328,11 @@ name = "nohash-hasher" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "nom" +version = "1.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "nom" version = "4.2.3" @@ -4435,6 +4440,32 @@ dependencies = [ "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "procinfo" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", + "nom 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "prometheus" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", + "procinfo 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "protobuf 2.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "spin 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "prost" version = "0.5.0" @@ -4870,6 +4901,14 @@ name = "rustc-hex" version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "rustc_version" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "semver 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "rustc_version" version = "0.2.3" @@ -5043,6 +5082,7 @@ dependencies = [ "rpassword 4.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "sc-client-api 2.0.0", "sc-network 0.8.0", + "sc-prometheus 2.0.0", "sc-service 2.0.0", "sc-telemetry 2.0.0", "sc-tracing 2.0.0", @@ -5578,6 +5618,21 @@ dependencies = [ "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "sc-prometheus" +version = "2.0.0" +dependencies = [ + "async-std 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "derive_more 0.99.2 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-util 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "prometheus 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-runtime 2.0.0", + "tokio 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "sc-rpc" version = "2.0.0" @@ -5684,6 +5739,7 @@ dependencies = [ "sc-keystore 2.0.0", "sc-network 0.8.0", "sc-offchain 2.0.0", + "sc-prometheus 2.0.0", "sc-rpc 2.0.0", "sc-rpc-server 2.0.0", "sc-telemetry 2.0.0", @@ -5899,6 +5955,11 @@ dependencies = [ "core-foundation-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "semver" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "semver" version = "0.6.0" @@ -8479,6 +8540,7 @@ dependencies = [ "checksum nix 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6c722bee1037d430d0f8e687bbdbf222f27cc6e4e68d5caf630857bb2b6dbdce" "checksum nodrop 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" "checksum nohash-hasher 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4e657a6ec97f9a3ba46f6f7034ea6db9fcd5b71d25ef1074b7bc03da49be0e8e" +"checksum nom 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "a5b8c256fd9471521bcb84c3cdba98921497f1a331cbc15b8030fc63b82050ce" "checksum nom 4.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2ad2a91a8e869eeb30b9cb3119ae87773a8f4ae617f41b1eb9c154b2905f7bd6" "checksum num-bigint 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "f9c3f34cdd24f334cb265d9bf8bfa8a241920d026916785747a92f0e55541a1a" "checksum num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)" = "b85e541ef8255f6cf42bbfe4ef361305c6c135d10919ecc26126c4e5ae94bc09" @@ -8536,6 +8598,8 @@ dependencies = [ "checksum proc-macro-nested 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "369a6ed065f249a159e06c45752c780bda2fb53c995718f9e484d08daa9eb42e" "checksum proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)" = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" "checksum proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "9c9e470a8dc4aeae2dee2f335e8f533e2d4b347e1434e5671afc49b054592f27" +"checksum procinfo 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f42e8578852a3306838981aedad8c5642ba794929aa12af0c9eb6c072b77af6c" +"checksum prometheus 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5567486d5778e2c6455b1b90ff1c558f29e751fc018130fa182e15828e728af1" "checksum prost 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "96d14b1c185652833d24aaad41c5832b0be5616a590227c1fbff57c616754b23" "checksum prost-build 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "eb788126ea840817128183f8f603dce02cb7aea25c2a0b764359d8e20010702e" "checksum prost-derive 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5e7dc378b94ac374644181a2247cebf59a6ec1c88b49ac77f3a94b86b79d0e11" @@ -8583,6 +8647,7 @@ dependencies = [ "checksum rust-argon2 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4ca4eaef519b494d1f2848fc602d18816fed808a981aedf4f1f00ceb7c9d32cf" "checksum rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" "checksum rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "403bb3a286107a04825a5f82e1270acc1e14028d3d554d7a1e08914549575ab8" +"checksum rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "c5f5376ea5e30ce23c03eb77cbe4962b988deead10910c372b226388b594c084" "checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" "checksum rustls 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b25a18b1bf7387f0145e7f8324e700805aade3842dd3db2e74e4cdeb4677c09e" "checksum rustversion 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c48f91977f4ef3be5358c15d131d3f663f6b4d7a112555bf3bf52ad23b6659e5" @@ -8600,6 +8665,7 @@ dependencies = [ "checksum sct 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e3042af939fca8c3453b7af0f1c66e533a15a86169e39de2657310ade8f98d3c" "checksum security-framework 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8ef2429d7cefe5fd28bd1d2ed41c944547d4ff84776f5935b456da44593a16df" "checksum security-framework-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e31493fc37615debb8c5090a7aeb4a9730bc61e77ab10b9af59f1a202284f895" +"checksum semver 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)" = "d4f410fedcf71af0345d7607d246e7ad15faaadd49d240ee3b24e5dc21a820ac" "checksum semver 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a3186ec9e65071a2095434b1f5bb24838d4e8e130f584c790f6033c79943537" "checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" "checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" diff --git a/client/cli/src/lib.rs b/client/cli/src/lib.rs index e2323694f1b51..36bf19eedd0ec 100644 --- a/client/cli/src/lib.rs +++ b/client/cli/src/lib.rs @@ -910,6 +910,7 @@ where let rpc_interface: &str = interface_str(cli.rpc_external, cli.unsafe_rpc_external, cli.validator)?; let ws_interface: &str = interface_str(cli.ws_external, cli.unsafe_ws_external, cli.validator)?; let grafana_interface: &str = if cli.grafana_external { "0.0.0.0" } else { "127.0.0.1" }; + let prometheus_interface: &str = if cli.prometheus_external { "0.0.0.0" } else { "127.0.0.1" }; config.rpc_http = Some(parse_address(&format!("{}:{}", rpc_interface, 9933), cli.rpc_port)?); config.rpc_ws = Some(parse_address(&format!("{}:{}", ws_interface, 9944), cli.ws_port)?); @@ -943,12 +944,10 @@ where config.tracing_receiver = cli.tracing_receiver.into(); // Override prometheus - match cli.prometheus_endpoint { - None => {config.prometheus_endpoint = None;}, - Some(x) => { - config.prometheus_endpoint = Some(parse_address(&format!("{}:{}", x, 33333), cli.prometheus_port)?); - } - } + if cli.prometheus_external { + config.prometheus_port = Some( + parse_address(&format!("{}:{}", prometheus_interface, 33333), cli.prometheus_port)? + )} // Imply forced authoring on --dev config.force_authoring = cli.shared_params.dev || cli.force_authoring; diff --git a/client/cli/src/params.rs b/client/cli/src/params.rs index 79de3384e3168..3fd521b1334b9 100644 --- a/client/cli/src/params.rs +++ b/client/cli/src/params.rs @@ -443,9 +443,9 @@ pub struct RunCmd { /// Prometheus exporter TCP port. #[structopt(long = "prometheus-port", value_name = "PORT")] pub prometheus_port: Option, - /// Prometheus exporter IP addr. - #[structopt(long = "prometheus-addr", value_name = "Local IP address")] - pub prometheus_endpoint: Option, + /// Prometheus exporter on/off external". + #[structopt(long = "prometheus-external")] + pub prometheus_external: bool, /// Listen to all Websocket interfaces. /// diff --git a/client/service/src/builder.rs b/client/service/src/builder.rs index 062da1c655b77..17a9429c4d0d9 100644 --- a/client/service/src/builder.rs +++ b/client/service/src/builder.rs @@ -1116,11 +1116,15 @@ ServiceBuilder< telemetry }); // prometheus init - match config.prometheus_endpoint { - None => (), - Some(x) => { - let _prometheus = sc_prometheus::init_prometheus(x); - } + if let Some(port) = config.prometheus_port { + let future = select( + sc_prometheus::init_prometheus(port).boxed() + ,exit.clone() + ).map(|either| match either { + Either::Left((result, _)) => result.map_err(|_| ()), + Either::Right(_) => Ok(()) + }).compat(); + let _ = to_spawn_tx.unbounded_send(Box::new(future)); } // Grafana data source if let Some(port) = config.grafana_port { diff --git a/client/service/src/config.rs b/client/service/src/config.rs index d2bcca7a22b25..835f0fc39d215 100644 --- a/client/service/src/config.rs +++ b/client/service/src/config.rs @@ -75,8 +75,8 @@ pub struct Configuration { pub rpc_cors: Option>, /// Grafana data source http port. `None` if disabled. pub grafana_port: Option, - /// Promteheus IP addr. `None` if disabled. and defult port 33333 - pub prometheus_endpoint: Option, + /// Promteheus Port. `None` if disabled. and defult port 33333 + pub prometheus_port: Option, /// Telemetry service URL. `None` if disabled. pub telemetry_endpoints: Option, /// External WASM transport for the telemetry. If `Some`, when connection to a telemetry @@ -155,7 +155,7 @@ impl Configuration where rpc_ws: None, rpc_ws_max_connections: None, rpc_cors: Some(vec![]), - prometheus_endpoint: None, + prometheus_port: None, grafana_port: None, telemetry_endpoints: None, telemetry_external_transport: None, diff --git a/client/service/test/src/lib.rs b/client/service/test/src/lib.rs index ea935100e954c..ea3e523d4ef0a 100644 --- a/client/service/test/src/lib.rs +++ b/client/service/test/src/lib.rs @@ -192,7 +192,7 @@ fn node_config ( rpc_ws: None, rpc_ws_max_connections: None, rpc_cors: None, - prometheus_endpoint: None, + prometheus_port: None, grafana_port: None, telemetry_endpoints: None, telemetry_external_transport: None, diff --git a/utils/prometheus/Cargo.toml b/utils/prometheus/Cargo.toml index 8ac6d7001833f..ea131e3952049 100644 --- a/utils/prometheus/Cargo.toml +++ b/utils/prometheus/Cargo.toml @@ -6,12 +6,14 @@ description = "prometheus utils" edition = "2018" [dependencies] -hyper = "0.12" -lazy_static = "1.0" -log = "0.4" +hyper = { version = "0.13.1", default-features = false, features = ["stream"] } +lazy_static = "1.4" +log = "0.4.8" prometheus = { version = "0.7", features = ["nightly", "process"]} -tokio = "0.1" +tokio = "0.2" +futures-util = { version = "0.3.1", default-features = false, features = ["io"] } sp-runtime = { package = "sp-runtime",path = "../../primitives/runtime" } +derive_more = "0.99" -[dev-dependencies] -reqwest = "0.9" \ No newline at end of file +[target.'cfg(not(target_os = "unknown"))'.dependencies] +async-std = { version = "1.0.1", features = ["unstable"] } \ No newline at end of file diff --git a/utils/prometheus/README.md b/utils/prometheus/README.md index 3efe80d57de94..9fec16a81ca15 100644 --- a/utils/prometheus/README.md +++ b/utils/prometheus/README.md @@ -27,66 +27,128 @@ Start Grafana Here is the entry point of prometheus core module in Parity Substrate. +In existing sources, refer to the grapana source due to the issue of the wasm. + utils/prometheus/src/lib.rs ```rust #[macro_use] extern crate lazy_static; -#[macro_use] -extern crate log; +use futures_util::{FutureExt,future::{Future}}; use hyper::http::StatusCode; -use hyper::rt::Future; -use hyper::service::service_fn_ok; -use hyper::{Body, Request, Response, Server}; +use hyper::Server; +use hyper::{Body, Request, Response, service::{service_fn, make_service_fn}}; pub use prometheus::{Encoder, HistogramOpts, Opts, TextEncoder}; -pub use prometheus::{Histogram, IntCounter, IntGauge, Result}; +pub use prometheus::{Histogram, IntCounter, IntGauge}; pub use sp_runtime::traits::SaturatedConversion; use std::net::SocketAddr; - +#[cfg(not(target_os = "unknown"))] +mod networking; pub mod metrics; +#[derive(Debug, derive_more::Display, derive_more::From)] +pub enum Error { + /// Hyper internal error. + Hyper(hyper::Error), + /// Http request error. + Http(hyper::http::Error), + /// i/o error. + Io(std::io::Error) +} +impl std::error::Error for Error { + fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { + match self { + Error::Hyper(error) => Some(error), + Error::Http(error) => Some(error), + Error::Io(error) => Some(error) + } + } +} + +async fn request_metrics(req: Request) -> Result, Error> { + if req.uri().path() == "/metrics" { + let metric_families = prometheus::gather(); + let mut buffer = vec![]; + let encoder = TextEncoder::new(); + encoder.encode(&metric_families, &mut buffer).unwrap(); + Response::builder() + .status(StatusCode::OK) + .header("Content-Type", encoder.format_type()) + .body(Body::from(buffer)) + .map_err(Error::Http) + //.expect("Sends OK(200) response with one or more data metrics") + } else { + Response::builder() + .status(StatusCode::NOT_FOUND) + .body(Body::from("Not found.")) + .map_err(Error::Http) + //.expect("Sends NOT_FOUND(404) message with no data metric") + } + +} + +#[derive(Clone)] +pub struct Executor; + +#[cfg(not(target_os = "unknown"))] +impl hyper::rt::Executor for Executor + where + T: Future + Send + 'static, + T::Output: Send + 'static, +{ + fn execute(&self, future: T) { + async_std::task::spawn(future); + } +} /// Initializes the metrics context, and starts an HTTP server /// to serve metrics. -pub fn init_prometheus(prometheus_addr: SocketAddr) { - let addr = prometheus_addr; - let server = Server::bind(&addr) - .serve(|| { - // This is the `Service` that will handle the connection. - // `service_fn_ok` is a helper to convert a function that - // returns a Response into a `Service`. - service_fn_ok(move |req: Request| { - if req.uri().path() == "/metrics" { - let metric_families = prometheus::gather(); - let mut buffer = vec![]; - let encoder = TextEncoder::new(); - encoder.encode(&metric_families, &mut buffer).unwrap(); - Response::builder() - .status(StatusCode::OK) - .header("Content-Type", encoder.format_type()) - .body(Body::from(buffer)) - .expect("Sends OK(200) response with one or more data metrics") - } else { - Response::builder() - .status(StatusCode::NOT_FOUND) - .body(Body::from("Not found.")) - .expect("Sends NOT_FOUND(404) message with no data metric") - } - }) - }) - .map_err(|e| error!("server error: {}", e)); - - info!("Exporting metrics at http://{}/metrics", addr); - - let mut rt = tokio::runtime::Builder::new() - .core_threads(1) // one thread is sufficient - .build() - .expect("Builds one thread of tokio runtime exporter for prometheus"); - - std::thread::spawn(move || { - rt.spawn(server); - rt.shutdown_on_idle().wait().unwrap(); - }); +#[cfg(not(target_os = "unknown"))] +pub async fn init_prometheus(mut prometheus_addr: SocketAddr) -> Result<(), Error>{ + use async_std::{net, io}; + use crate::networking::Incoming; + + let listener = loop { + let listener = net::TcpListener::bind(&prometheus_addr).await; + match listener { + Ok(listener) => { + log::info!("Prometheus server started at {}", prometheus_addr); + break listener + }, + Err(err) => match err.kind() { + io::ErrorKind::AddrInUse | io::ErrorKind::PermissionDenied if prometheus_addr.port() != 0 => { + log::warn!( + "Prometheus server to already {} port.", prometheus_addr.port() + ); + prometheus_addr.set_port(0); + continue; + }, + _ => return Err(err.into()) + } + } + }; + let service = make_service_fn(|_| { + async { + Ok::<_, Error>(service_fn(request_metrics)) + } + }); + + + let _server = Server::builder(Incoming(listener.incoming())) + .executor(Executor) + .serve(service) + .boxed(); + + + let result = _server.await.map_err(Into::into); + + result +} + +#[cfg(target_os = "unknown")] +pub async fn init_prometheus(_: SocketAddr) -> Result<(), Error> { + Ok(()) } + #[macro_export] macro_rules! prometheus_gauge( ($($metric:expr => $value:expr),*) => { @@ -120,9 +182,65 @@ macro_rules! prometheus( ); */ ``` +utuls/prometheus/src/networking.rs ( grafana-data-source Note) +```rust +use async_std::pin::Pin; +use std::task::{Poll, Context}; +use futures_util::{stream::Stream, io::{AsyncRead, AsyncWrite}}; + +pub struct Incoming<'a>(pub async_std::net::Incoming<'a>); + +impl hyper::server::accept::Accept for Incoming<'_> { + type Conn = TcpStream; + type Error = async_std::io::Error; + + fn poll_accept(self: Pin<&mut Self>, cx: &mut Context) -> Poll>> { + Pin::new(&mut Pin::into_inner(self).0) + .poll_next(cx) + .map(|opt| opt.map(|res| res.map(TcpStream))) + } +} + +pub struct TcpStream(pub async_std::net::TcpStream); + +impl tokio::io::AsyncRead for TcpStream { + fn poll_read( + self: Pin<&mut Self>, + cx: &mut Context, + buf: &mut [u8] + ) -> Poll> { + Pin::new(&mut Pin::into_inner(self).0) + .poll_read(cx, buf) + } +} + +impl tokio::io::AsyncWrite for TcpStream { + fn poll_write( + self: Pin<&mut Self>, + cx: &mut Context, + buf: &[u8] + ) -> Poll> { + Pin::new(&mut Pin::into_inner(self).0) + .poll_write(cx, buf) + } + + fn poll_flush(self: Pin<&mut Self>, cx: &mut Context) -> Poll> { + Pin::new(&mut Pin::into_inner(self).0) + .poll_flush(cx) + } + + fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context) -> Poll> { + Pin::new(&mut Pin::into_inner(self).0) + .poll_close(cx) + } +} + +``` + + Here is the dependancies of the module. -client/prometheus/Cargo.toml +utils/prometheus/Cargo.toml ```toml [package] name = "sc-prometheus" @@ -132,15 +250,17 @@ description = "prometheus utils" edition = "2018" [dependencies] -hyper = "0.12" -lazy_static = "1.0" -log = "0.4" +hyper = { version = "0.13.1", default-features = false, features = ["stream"] } +lazy_static = "1.4" +log = "0.4.8" prometheus = { version = "0.7", features = ["nightly", "process"]} -tokio = "0.1" +tokio = "0.2" +futures-util = { version = "0.3.1", default-features = false, features = ["io"] } sp-runtime = { package = "sp-runtime",path = "../../primitives/runtime" } +derive_more = "0.99" -[dev-dependencies] -reqwest = "0.9" +[target.'cfg(not(target_os = "unknown"))'.dependencies] +async-std = { version = "1.0.1", features = ["unstable"] } ``` **Abbreviation of the package in service manager of parity substrate** @@ -198,11 +318,15 @@ use sc_prometheus::prometheus_gauge; ... // prometheus init - match config.prometheus_endpoint { - None => (), - Some(x) => { - let _prometheus = sc_prometheus::init_prometheus(x); - } + if let Some(port) = config.prometheus_port { + let future = select( + sc_prometheus::init_prometheus(port).boxed() + ,exit.clone() + ).map(|either| match either { + Either::Left((result, _)) => result.map_err(|_| ()), + Either::Right(_) => Ok(()) + }).compat(); + let _ = to_spawn_tx.unbounded_send(Box::new(future)); } // Grafana data source if let Some(port) = config.grafana_port { @@ -241,28 +365,13 @@ client/cli/src/lib.rs ```rust fn crate_run_node_config{ ... - // Override telemetry - if cli.no_telemetry { - config.telemetry_endpoints = None; - } else if !cli.telemetry_endpoints.is_empty() { - config.telemetry_endpoints = Some(TelemetryEndpoints::new(cli.telemetry_endpoints)); - } - - config.tracing_targets = cli.tracing_targets.into(); - config.tracing_receiver = cli.tracing_receiver.into(); - - // Override prometheus - match cli.prometheus_endpoint { - None => {config.prometheus_endpoint = None;}, - Some(x) => { - config.prometheus_endpoint = Some(parse_address(&format!("{}:{}", x, 33333), cli.prometheus_port)?); - } - } - // Imply forced authoring on --dev - config.force_authoring = cli.shared_params.dev || cli.force_authoring; - - Ok(config) + let prometheus_interface: &str = if cli.prometheus_external { "0.0.0.0" } ... + // Override prometheus + if cli.prometheus_external { + config.prometheus_port = Some( + parse_address(&format!("{}:{}", prometheus_interface, 33333), cli.prometheus_port)? + )} } ``` @@ -270,12 +379,12 @@ client/cli/src/params.rs ```rust pub struct RunCmd{ ... -/// Prometheus exporter TCP port. + /// Prometheus exporter TCP port. #[structopt(long = "prometheus-port", value_name = "PORT")] pub prometheus_port: Option, - /// Prometheus exporter IP addr. - #[structopt(long = "prometheus-addr", value_name = "Local IP address")] - pub prometheus_endpoint: Option, + /// Prometheus exporter on/off external". + #[structopt(long = "prometheus-external")] + pub prometheus_external: bool, ... } ``` @@ -284,8 +393,8 @@ client/service/src/config.rs #[derive(Clone)] pub struct Configuration { ... - /// Promteheus IP addr. `None` if disabled. and defult port 33333 - pub prometheus_endpoint: Option, + /// Promteheus Port. `None` if disabled. and defult port 33333 + pub prometheus_port: Option, ... } impl Configuration where @@ -297,7 +406,7 @@ impl Configuration where pub fn default_with_spec(chain_spec: ChainSpec) -> Self { let mut configuration = Configuration { ... - prometheus_endpoints: None, + prometheus_prot: None, ... }; configuration.network.boot_nodes = configuration.chain_spec.boot_nodes().to_vec(); diff --git a/utils/prometheus/src/lib.rs b/utils/prometheus/src/lib.rs index 4713f47291de0..70e0ebfd830cc 100644 --- a/utils/prometheus/src/lib.rs +++ b/utils/prometheus/src/lib.rs @@ -1,61 +1,138 @@ +// Copyright 2019 Parity Technologies (UK) Ltd. +// This file is part of Substrate. + +// Substrate is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Substrate is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Substrate. If not, see . + + #[macro_use] extern crate lazy_static; -#[macro_use] -extern crate log; +use futures_util::{FutureExt,future::{Future}}; use hyper::http::StatusCode; -use hyper::rt::Future; -use hyper::service::service_fn_ok; -use hyper::{Body, Request, Response, Server}; +use hyper::Server; +use hyper::{Body, Request, Response, service::{service_fn, make_service_fn}}; pub use prometheus::{Encoder, HistogramOpts, Opts, TextEncoder}; -pub use prometheus::{Histogram, IntCounter, IntGauge, Result}; +pub use prometheus::{Histogram, IntCounter, IntGauge}; pub use sp_runtime::traits::SaturatedConversion; use std::net::SocketAddr; - +#[cfg(not(target_os = "unknown"))] +mod networking; pub mod metrics; +#[derive(Debug, derive_more::Display, derive_more::From)] +pub enum Error { + /// Hyper internal error. + Hyper(hyper::Error), + /// Http request error. + Http(hyper::http::Error), + /// i/o error. + Io(std::io::Error) +} +impl std::error::Error for Error { + fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { + match self { + Error::Hyper(error) => Some(error), + Error::Http(error) => Some(error), + Error::Io(error) => Some(error) + } + } +} + +async fn request_metrics(req: Request) -> Result, Error> { + if req.uri().path() == "/metrics" { + let metric_families = prometheus::gather(); + let mut buffer = vec![]; + let encoder = TextEncoder::new(); + encoder.encode(&metric_families, &mut buffer).unwrap(); + Response::builder() + .status(StatusCode::OK) + .header("Content-Type", encoder.format_type()) + .body(Body::from(buffer)) + .map_err(Error::Http) + //.expect("Sends OK(200) response with one or more data metrics") + } else { + Response::builder() + .status(StatusCode::NOT_FOUND) + .body(Body::from("Not found.")) + .map_err(Error::Http) + //.expect("Sends NOT_FOUND(404) message with no data metric") + } + +} + +#[derive(Clone)] +pub struct Executor; + +#[cfg(not(target_os = "unknown"))] +impl hyper::rt::Executor for Executor + where + T: Future + Send + 'static, + T::Output: Send + 'static, +{ + fn execute(&self, future: T) { + async_std::task::spawn(future); + } +} /// Initializes the metrics context, and starts an HTTP server /// to serve metrics. -pub fn init_prometheus(prometheus_addr: SocketAddr) { - let addr = prometheus_addr; - let server = Server::bind(&addr) - .serve(|| { - // This is the `Service` that will handle the connection. - // `service_fn_ok` is a helper to convert a function that - // returns a Response into a `Service`. - service_fn_ok(move |req: Request| { - if req.uri().path() == "/metrics" { - let metric_families = prometheus::gather(); - let mut buffer = vec![]; - let encoder = TextEncoder::new(); - encoder.encode(&metric_families, &mut buffer).unwrap(); - Response::builder() - .status(StatusCode::OK) - .header("Content-Type", encoder.format_type()) - .body(Body::from(buffer)) - .expect("Sends OK(200) response with one or more data metrics") - } else { - Response::builder() - .status(StatusCode::NOT_FOUND) - .body(Body::from("Not found.")) - .expect("Sends NOT_FOUND(404) message with no data metric") - } - }) - }) - .map_err(|e| error!("server error: {}", e)); - - info!("Exporting metrics at http://{}/metrics", addr); - - let mut rt = tokio::runtime::Builder::new() - .core_threads(1) // one thread is sufficient - .build() - .expect("Builds one thread of tokio runtime exporter for prometheus"); - - std::thread::spawn(move || { - rt.spawn(server); - rt.shutdown_on_idle().wait().unwrap(); - }); +#[cfg(not(target_os = "unknown"))] +pub async fn init_prometheus(mut prometheus_addr: SocketAddr) -> Result<(), Error>{ + use async_std::{net, io}; + use crate::networking::Incoming; + + let listener = loop { + let listener = net::TcpListener::bind(&prometheus_addr).await; + match listener { + Ok(listener) => { + log::info!("Prometheus server started at {}", prometheus_addr); + break listener + }, + Err(err) => match err.kind() { + io::ErrorKind::AddrInUse | io::ErrorKind::PermissionDenied if prometheus_addr.port() != 0 => { + log::warn!( + "Prometheus server to already {} port.", prometheus_addr.port() + ); + prometheus_addr.set_port(0); + continue; + }, + _ => return Err(err.into()) + } + } + }; + let service = make_service_fn(|_| { + async { + Ok::<_, Error>(service_fn(request_metrics)) + } + }); + + + let _server = Server::builder(Incoming(listener.incoming())) + .executor(Executor) + .serve(service) + .boxed(); + + + let result = _server.await.map_err(Into::into); + + result } +#[cfg(target_os = "unknown")] +pub async fn init_prometheus(_: SocketAddr) -> Result<(), Error> { + Ok(()) +} + + #[macro_export] macro_rules! prometheus_gauge( ($($metric:expr => $value:expr),*) => { diff --git a/utils/prometheus/src/metrics.rs b/utils/prometheus/src/metrics.rs index dfb9c4ec57720..a653535c11092 100644 --- a/utils/prometheus/src/metrics.rs +++ b/utils/prometheus/src/metrics.rs @@ -1,5 +1,22 @@ -pub use crate::*; +// Copyright 2019 Parity Technologies (UK) Ltd. +// This file is part of Substrate. + +// Substrate is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Substrate is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// You should have received a copy of the GNU General Public License +// along with Substrate. If not, see . + + +pub use crate::*; +pub use prometheus::Result; /// Gauge type metrics generation function pub fn try_create_int_gauge(name: &str, help: &str) -> Result { let opts = Opts::new(name, help); diff --git a/utils/prometheus/src/networking.rs b/utils/prometheus/src/networking.rs new file mode 100644 index 0000000000000..f5bbd21d57a86 --- /dev/null +++ b/utils/prometheus/src/networking.rs @@ -0,0 +1,66 @@ +// Copyright 2019 Parity Technologies (UK) Ltd. +// This file is part of Substrate. + +// Substrate is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Substrate is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Substrate. If not, see . + +use async_std::pin::Pin; +use std::task::{Poll, Context}; +use futures_util::{stream::Stream, io::{AsyncRead, AsyncWrite}}; + +pub struct Incoming<'a>(pub async_std::net::Incoming<'a>); + +impl hyper::server::accept::Accept for Incoming<'_> { + type Conn = TcpStream; + type Error = async_std::io::Error; + + fn poll_accept(self: Pin<&mut Self>, cx: &mut Context) -> Poll>> { + Pin::new(&mut Pin::into_inner(self).0) + .poll_next(cx) + .map(|opt| opt.map(|res| res.map(TcpStream))) + } +} + +pub struct TcpStream(pub async_std::net::TcpStream); + +impl tokio::io::AsyncRead for TcpStream { + fn poll_read( + self: Pin<&mut Self>, + cx: &mut Context, + buf: &mut [u8] + ) -> Poll> { + Pin::new(&mut Pin::into_inner(self).0) + .poll_read(cx, buf) + } +} + +impl tokio::io::AsyncWrite for TcpStream { + fn poll_write( + self: Pin<&mut Self>, + cx: &mut Context, + buf: &[u8] + ) -> Poll> { + Pin::new(&mut Pin::into_inner(self).0) + .poll_write(cx, buf) + } + + fn poll_flush(self: Pin<&mut Self>, cx: &mut Context) -> Poll> { + Pin::new(&mut Pin::into_inner(self).0) + .poll_flush(cx) + } + + fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context) -> Poll> { + Pin::new(&mut Pin::into_inner(self).0) + .poll_close(cx) + } +} From 62a873de37e9fd91141a65bedc48be7be759e8b6 Mon Sep 17 00:00:00 2001 From: nodebreaker-carlsagan Date: Thu, 2 Jan 2020 22:38:23 +0900 Subject: [PATCH 04/42] Cargo.lock paritytech/master rebase --- Cargo.lock | 53 +++-------------------------------------------------- 1 file changed, 3 insertions(+), 50 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 282df55da6540..7387dd107a59f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2358,15 +2358,7 @@ dependencies = [ "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", -<<<<<<< HEAD -<<<<<<< HEAD "libsecp256k1 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", -======= - "libsecp256k1 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", ->>>>>>> 9044da2b8... Refactor rebase master prometheus_v0.3 -======= - "libsecp256k1 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", ->>>>>>> 6c3137bdd... Milestone1: Final Version of v0.3 "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "multistream-select 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "parity-multiaddr 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2699,21 +2691,14 @@ dependencies = [ [[package]] name = "libsecp256k1" -<<<<<<< HEAD -<<<<<<< HEAD version = "0.3.4" -======= -version = "0.3.3" ->>>>>>> 9044da2b8... Refactor rebase master prometheus_v0.3 -======= -version = "0.3.2" ->>>>>>> 6c3137bdd... Milestone1: Final Version of v0.3 source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "arrayref 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "crunchy 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "hmac-drbg 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "sha2 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "subtle 2.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "typenum 1.11.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5342,15 +5327,7 @@ dependencies = [ "derive_more 0.99.2 (registry+https://github.com/rust-lang/crates.io-index)", "hex-literal 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", -<<<<<<< HEAD -<<<<<<< HEAD "libsecp256k1 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", -======= - "libsecp256k1 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", ->>>>>>> 9044da2b8... Refactor rebase master prometheus_v0.3 -======= - "libsecp256k1 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", ->>>>>>> 6c3137bdd... Milestone1: Final Version of v0.3 "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-wasm 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -6360,15 +6337,7 @@ dependencies = [ "hex-literal 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "impl-serde 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", -<<<<<<< HEAD -<<<<<<< HEAD "libsecp256k1 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", -======= - "libsecp256k1 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", ->>>>>>> 9044da2b8... Refactor rebase master prometheus_v0.3 -======= - "libsecp256k1 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", ->>>>>>> 6c3137bdd... Milestone1: Final Version of v0.3 "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -6451,15 +6420,7 @@ name = "sp-io" version = "2.0.0" dependencies = [ "hash-db 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)", -<<<<<<< HEAD -<<<<<<< HEAD "libsecp256k1 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", -======= - "libsecp256k1 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", ->>>>>>> 9044da2b8... Refactor rebase master prometheus_v0.3 -======= - "libsecp256k1 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", ->>>>>>> 6c3137bdd... Milestone1: Final Version of v0.3 "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0", @@ -7579,7 +7540,7 @@ name = "twox-hash" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "rand 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -8497,15 +8458,7 @@ dependencies = [ "checksum libp2p-websocket 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0d74d4fc229ad7e8d1a973178786bdcd5dadbdd7b9822c4477c8687df6f82f66" "checksum libp2p-yamux 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1913eb7dd6eb5515957b6f1770296f6921968db87bc9b985f0e974b6657e1003" "checksum librocksdb-sys 6.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "0a0785e816e1e11e7599388a492c61ef80ddc2afc91e313e61662cce537809be" -<<<<<<< HEAD -<<<<<<< HEAD "checksum libsecp256k1 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "df6edf84fd62aad1c93932b39324eaeda3912c1d26bc18dfaee6293848e49a50" -======= -"checksum libsecp256k1 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "b0885ff5b8070cdafbf65b3d098a0b7daf4925a18a704d3c503996443b799cc2" ->>>>>>> 9044da2b8... Refactor rebase master prometheus_v0.3 -======= -"checksum libsecp256k1 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2bd9a7c16c9487e710536b699c962f022266347c94201174aa0a7eb0546051aa" ->>>>>>> 6c3137bdd... Milestone1: Final Version of v0.3 "checksum libz-sys 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)" = "2eb5e43362e38e2bca2fd5f5134c4d4564a23a5c28e9b95411652021a8675ebe" "checksum linked-hash-map 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ae91b68aebc4ddb91978b11a1b02ddd8602a05ec19002801c5666000e05e0f83" "checksum linked_hash_set 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3c7c91c4c7bbeb4f2f7c4e5be11e6a05bd6830bc37249c47ce1ad86ad453ff9c" From 97e37e499adb9661a74618295b67d5406d5361a2 Mon Sep 17 00:00:00 2001 From: nodebreaker-carlsagan Date: Fri, 3 Jan 2020 19:03:19 +0900 Subject: [PATCH 05/42] prometheus networking.rs del, grafana-data-source networking.rs pub edit and note --- Cargo.lock | 1 + client/service/src/builder.rs | 2 +- utils/grafana-data-source/src/lib.rs | 2 +- utils/prometheus/Cargo.toml | 1 + utils/prometheus/README.md | 67 +++------------------------- utils/prometheus/src/lib.rs | 8 ++-- utils/prometheus/src/metrics.rs | 6 +-- utils/prometheus/src/networking.rs | 66 --------------------------- 8 files changed, 17 insertions(+), 136 deletions(-) delete mode 100644 utils/prometheus/src/networking.rs diff --git a/Cargo.lock b/Cargo.lock index 7387dd107a59f..194716611f7f2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5602,6 +5602,7 @@ dependencies = [ "async-std 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "derive_more 0.99.2 (registry+https://github.com/rust-lang/crates.io-index)", "futures-util 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "grafana-data-source 2.0.0", "hyper 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/client/service/src/builder.rs b/client/service/src/builder.rs index 17a9429c4d0d9..424f47d57a614 100644 --- a/client/service/src/builder.rs +++ b/client/service/src/builder.rs @@ -957,7 +957,7 @@ ServiceBuilder< "used_state_cache_size" => used_state_cache_size, ); prometheus_gauge!( - MEMPOOL_SIZE => used_state_cache_size as u64, + STATE_CACHE_SIZE => used_state_cache_size as u64, NODE_MEMORY => memory as u64, NODE_CPU => cpu_usage as u64, TX_COUNT => txpool_status.ready as u64, diff --git a/utils/grafana-data-source/src/lib.rs b/utils/grafana-data-source/src/lib.rs index 86c523cc53bdd..ef92c3f17e35c 100644 --- a/utils/grafana-data-source/src/lib.rs +++ b/utils/grafana-data-source/src/lib.rs @@ -31,7 +31,7 @@ use parking_lot::RwLock; mod types; mod server; #[cfg(not(target_os = "unknown"))] -mod networking; +pub mod networking; mod database; use database::Database; diff --git a/utils/prometheus/Cargo.toml b/utils/prometheus/Cargo.toml index ea131e3952049..4102e33e9821f 100644 --- a/utils/prometheus/Cargo.toml +++ b/utils/prometheus/Cargo.toml @@ -14,6 +14,7 @@ tokio = "0.2" futures-util = { version = "0.3.1", default-features = false, features = ["io"] } sp-runtime = { package = "sp-runtime",path = "../../primitives/runtime" } derive_more = "0.99" +grafana-data-source = { version = "2.0.0", path = "../grafana-data-source" } [target.'cfg(not(target_os = "unknown"))'.dependencies] async-std = { version = "1.0.1", features = ["unstable"] } \ No newline at end of file diff --git a/utils/prometheus/README.md b/utils/prometheus/README.md index 9fec16a81ca15..06830426848cc 100644 --- a/utils/prometheus/README.md +++ b/utils/prometheus/README.md @@ -41,8 +41,7 @@ pub use prometheus::{Encoder, HistogramOpts, Opts, TextEncoder}; pub use prometheus::{Histogram, IntCounter, IntGauge}; pub use sp_runtime::traits::SaturatedConversion; use std::net::SocketAddr; -#[cfg(not(target_os = "unknown"))] -mod networking; + pub mod metrics; #[derive(Debug, derive_more::Display, derive_more::From)] @@ -104,7 +103,7 @@ impl hyper::rt::Executor for Executor #[cfg(not(target_os = "unknown"))] pub async fn init_prometheus(mut prometheus_addr: SocketAddr) -> Result<(), Error>{ use async_std::{net, io}; - use crate::networking::Incoming; + use grafana_data_source::networking::Incoming; let listener = loop { let listener = net::TcpListener::bind(&prometheus_addr).await; @@ -182,60 +181,6 @@ macro_rules! prometheus( ); */ ``` -utuls/prometheus/src/networking.rs ( grafana-data-source Note) -```rust -use async_std::pin::Pin; -use std::task::{Poll, Context}; -use futures_util::{stream::Stream, io::{AsyncRead, AsyncWrite}}; - -pub struct Incoming<'a>(pub async_std::net::Incoming<'a>); - -impl hyper::server::accept::Accept for Incoming<'_> { - type Conn = TcpStream; - type Error = async_std::io::Error; - - fn poll_accept(self: Pin<&mut Self>, cx: &mut Context) -> Poll>> { - Pin::new(&mut Pin::into_inner(self).0) - .poll_next(cx) - .map(|opt| opt.map(|res| res.map(TcpStream))) - } -} - -pub struct TcpStream(pub async_std::net::TcpStream); - -impl tokio::io::AsyncRead for TcpStream { - fn poll_read( - self: Pin<&mut Self>, - cx: &mut Context, - buf: &mut [u8] - ) -> Poll> { - Pin::new(&mut Pin::into_inner(self).0) - .poll_read(cx, buf) - } -} - -impl tokio::io::AsyncWrite for TcpStream { - fn poll_write( - self: Pin<&mut Self>, - cx: &mut Context, - buf: &[u8] - ) -> Poll> { - Pin::new(&mut Pin::into_inner(self).0) - .poll_write(cx, buf) - } - - fn poll_flush(self: Pin<&mut Self>, cx: &mut Context) -> Poll> { - Pin::new(&mut Pin::into_inner(self).0) - .poll_flush(cx) - } - - fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context) -> Poll> { - Pin::new(&mut Pin::into_inner(self).0) - .poll_close(cx) - } -} - -``` @@ -291,7 +236,7 @@ use sc_prometheus::prometheus_gauge; "used_state_cache_size" => used_state_cache_size, ); prometheus_gauge!( - MEMPOOL_SIZE => used_state_cache_size as u64, + STATE_CACHE_SIZE => used_state_cache_size as u64, NODE_MEMORY => memory as u64, NODE_CPU => cpu_usage as u64, TX_COUNT => txpool_status.ready as u64, @@ -503,7 +448,7 @@ use sc-prometheus::{prometheus_gauge}; ); prometheus_gauge!( - MEMPOOL_SIZE => used_state_cache_size as u64, + STATE_CACHE_SIZE => used_state_cache_size as u64, NODE_MEMORY => memory as u64, NODE_CPU => cpu_usage as u64, TX_COUNT => txpool_status.ready as u64, @@ -537,14 +482,14 @@ Consensus metrics, namespace: `substrate` | consensus_num_txs | Gauge | | Number of transactions | | consensus_node_memory | IntGauge | | Node's primary memory | | consensus_node_cpu | IntGauge | | Node's cpu load | +| consensus_state_cache_size | IntGauge | | used state cache size | | p2p_peers_number | IntGauge | | Number of peers node's connected to | | p2p_peer_receive_bytes_per_sec | IntGauge | | number of bytes received from a given peer | | p2p_peer_send_bytes_per_sec | IntGauge | | number of bytes sent to a given peer | -| mempool_size | IntGauge | | Number of uncommitted transactions | | Resource_receive_bytes_per_sec(Future) | IntGauge | | Operating System of bytes received | | Resource_send_bytes_per_sec(Future) | IntGauge | | Operating System of bytes sent | | Resource_cpu_use(Future) | IntGauge | | Operating System cpu load | -| Resource_disk_use(Future) | IntGauge | | Operating System disk use | +| Resource_disk_use(Future) | IntGauge | | Operating System disk use | | validator_sign_prevote(Future) | IntGauge | validator addr | validator sign vote list | | validator_sign_precommit(Future) | IntGauge | validator addr | validator sign commit list | diff --git a/utils/prometheus/src/lib.rs b/utils/prometheus/src/lib.rs index 70e0ebfd830cc..0765c40aedebd 100644 --- a/utils/prometheus/src/lib.rs +++ b/utils/prometheus/src/lib.rs @@ -25,8 +25,9 @@ pub use prometheus::{Encoder, HistogramOpts, Opts, TextEncoder}; pub use prometheus::{Histogram, IntCounter, IntGauge}; pub use sp_runtime::traits::SaturatedConversion; use std::net::SocketAddr; -#[cfg(not(target_os = "unknown"))] -mod networking; +//#[cfg(not(target_os = "unknown"))] +//mod networking; + pub mod metrics; #[derive(Debug, derive_more::Display, derive_more::From)] @@ -88,8 +89,7 @@ impl hyper::rt::Executor for Executor #[cfg(not(target_os = "unknown"))] pub async fn init_prometheus(mut prometheus_addr: SocketAddr) -> Result<(), Error>{ use async_std::{net, io}; - use crate::networking::Incoming; - + use grafana_data_source::networking::Incoming; let listener = loop { let listener = net::TcpListener::bind(&prometheus_addr).await; match listener { diff --git a/utils/prometheus/src/metrics.rs b/utils/prometheus/src/metrics.rs index a653535c11092..ee7787f4b24dc 100644 --- a/utils/prometheus/src/metrics.rs +++ b/utils/prometheus/src/metrics.rs @@ -81,9 +81,9 @@ lazy_static! { "consensus_node_cpu", "node cpu" ); - pub static ref MEMPOOL_SIZE: Result = try_create_int_gauge( - "mempool_size", - "Number of uncommitted transactions" + pub static ref STATE_CACHE_SIZE: Result = try_create_int_gauge( + "consensus_state_cache_size", + "used state cache size" ); pub static ref P2P_NODE_DOWNLOAD: Result = try_create_int_gauge( "p2p_peers_receive_byte_per_sec", diff --git a/utils/prometheus/src/networking.rs b/utils/prometheus/src/networking.rs deleted file mode 100644 index f5bbd21d57a86..0000000000000 --- a/utils/prometheus/src/networking.rs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2019 Parity Technologies (UK) Ltd. -// This file is part of Substrate. - -// Substrate is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Substrate is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Substrate. If not, see . - -use async_std::pin::Pin; -use std::task::{Poll, Context}; -use futures_util::{stream::Stream, io::{AsyncRead, AsyncWrite}}; - -pub struct Incoming<'a>(pub async_std::net::Incoming<'a>); - -impl hyper::server::accept::Accept for Incoming<'_> { - type Conn = TcpStream; - type Error = async_std::io::Error; - - fn poll_accept(self: Pin<&mut Self>, cx: &mut Context) -> Poll>> { - Pin::new(&mut Pin::into_inner(self).0) - .poll_next(cx) - .map(|opt| opt.map(|res| res.map(TcpStream))) - } -} - -pub struct TcpStream(pub async_std::net::TcpStream); - -impl tokio::io::AsyncRead for TcpStream { - fn poll_read( - self: Pin<&mut Self>, - cx: &mut Context, - buf: &mut [u8] - ) -> Poll> { - Pin::new(&mut Pin::into_inner(self).0) - .poll_read(cx, buf) - } -} - -impl tokio::io::AsyncWrite for TcpStream { - fn poll_write( - self: Pin<&mut Self>, - cx: &mut Context, - buf: &[u8] - ) -> Poll> { - Pin::new(&mut Pin::into_inner(self).0) - .poll_write(cx, buf) - } - - fn poll_flush(self: Pin<&mut Self>, cx: &mut Context) -> Poll> { - Pin::new(&mut Pin::into_inner(self).0) - .poll_flush(cx) - } - - fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context) -> Poll> { - Pin::new(&mut Pin::into_inner(self).0) - .poll_close(cx) - } -} From f3e444ec1c5bd699fff1bb7bcbca126a69b409f9 Mon Sep 17 00:00:00 2001 From: nodebreaker-carlsagan Date: Fri, 10 Jan 2020 14:57:00 +0900 Subject: [PATCH 06/42] chore: reflect various feedback --- client/service/src/config.rs | 2 +- utils/prometheus/Cargo.toml | 2 +- utils/prometheus/README.md | 28 +++++++--------------------- utils/prometheus/src/lib.rs | 15 --------------- utils/prometheus/src/metrics.rs | 20 ++++++++++++-------- 5 files changed, 21 insertions(+), 46 deletions(-) diff --git a/client/service/src/config.rs b/client/service/src/config.rs index 835f0fc39d215..2f0a2ba83a071 100644 --- a/client/service/src/config.rs +++ b/client/service/src/config.rs @@ -75,7 +75,7 @@ pub struct Configuration { pub rpc_cors: Option>, /// Grafana data source http port. `None` if disabled. pub grafana_port: Option, - /// Promteheus Port. `None` if disabled. and defult port 33333 + /// Prometheus Port.`None` if disabled and port 33333 by default. pub prometheus_port: Option, /// Telemetry service URL. `None` if disabled. pub telemetry_endpoints: Option, diff --git a/utils/prometheus/Cargo.toml b/utils/prometheus/Cargo.toml index 4102e33e9821f..46b5c42ca3ef4 100644 --- a/utils/prometheus/Cargo.toml +++ b/utils/prometheus/Cargo.toml @@ -17,4 +17,4 @@ derive_more = "0.99" grafana-data-source = { version = "2.0.0", path = "../grafana-data-source" } [target.'cfg(not(target_os = "unknown"))'.dependencies] -async-std = { version = "1.0.1", features = ["unstable"] } \ No newline at end of file +async-std = { version = "1.0.1", features = ["unstable"] } diff --git a/utils/prometheus/README.md b/utils/prometheus/README.md index 06830426848cc..e5952f1e192c4 100644 --- a/utils/prometheus/README.md +++ b/utils/prometheus/README.md @@ -2,12 +2,12 @@ ![grants](./photo_2019-12-13_16-32-53.jpg) ## Introduction -Prometheus is one of the most widely used monitoring tool for managing high availability services supported by [Cloud Native Computing Foundation](https://www.cncf.io/). By providing Prometheus exporter in substrate, node operators can easily adopt widely used display/alert tool such as Grafana without seting-up/operating external Prometheus agent through RPC connections. Easy access to such monitoring tools will benefit parachain develepers/operators and validators to have much higher availability quality of their services. +Prometheus is one of the most widely used monitoring tool for managing high availability services supported by [Cloud Native Computing Foundation](https://www.cncf.io/). By providing Prometheus metrics in Substrate, node operators can easily adopt widely used display/alert tools such as Grafana and Alertmanager without setting-up/operating external Prometheus push gateways (which is an antipattern in the first place) through RPC connections. Easy access to such monitoring tools will benefit parachain developers/operators and validators to have much higher availability of their services. -## List of Contents +## Table of Contents Hack Prometheus in Substrate - - Prometheus starter + - Prometheus primer - CLI Config - Metrics Add @@ -23,11 +23,11 @@ Start Grafana - Install Grafana ## Substrate Dev hack -### Prometheus starter +### Prometheus primer Here is the entry point of prometheus core module in Parity Substrate. -In existing sources, refer to the grapana source due to the issue of the wasm. +In existing sources, refer to the Grafana source due to the issue of the wasm. utils/prometheus/src/lib.rs ```rust @@ -74,13 +74,11 @@ async fn request_metrics(req: Request) -> Result, Error> { .header("Content-Type", encoder.format_type()) .body(Body::from(buffer)) .map_err(Error::Http) - //.expect("Sends OK(200) response with one or more data metrics") } else { Response::builder() .status(StatusCode::NOT_FOUND) .body(Body::from("Not found.")) .map_err(Error::Http) - //.expect("Sends NOT_FOUND(404) message with no data metric") } } @@ -168,18 +166,7 @@ macro_rules! prometheus_histogram( } ); -/* -TODO: Make abstract type for all metrics(e.g. Gauge, Histogram, Counter) with generic traits so that all metrics can be set up with one function `set` -#[macro_export] -macro_rules! prometheus( - ($($a: expr; $metric:expr => $value:expr),*) => { - use $crate::{metrics::*}; - $( - metrics::set(#$a, &$metric, $value); - )* - } -); -*/ + ``` @@ -338,7 +325,7 @@ client/service/src/config.rs #[derive(Clone)] pub struct Configuration { ... - /// Promteheus Port. `None` if disabled. and defult port 33333 + /// Prometheus Port.`None` if disabled and port 33333 by default. pub prometheus_port: Option, ... } @@ -392,7 +379,6 @@ lazy_static! { pub static ref FINALITY_HEIGHT: Result = try_create_int_gauge( "consensus_finality_block_height_number", "block is finality HEIGHT" - ); } ``` diff --git a/utils/prometheus/src/lib.rs b/utils/prometheus/src/lib.rs index 0765c40aedebd..a6d9397575db6 100644 --- a/utils/prometheus/src/lib.rs +++ b/utils/prometheus/src/lib.rs @@ -60,13 +60,11 @@ async fn request_metrics(req: Request) -> Result, Error> { .header("Content-Type", encoder.format_type()) .body(Body::from(buffer)) .map_err(Error::Http) - //.expect("Sends OK(200) response with one or more data metrics") } else { Response::builder() .status(StatusCode::NOT_FOUND) .body(Body::from("Not found.")) .map_err(Error::Http) - //.expect("Sends NOT_FOUND(404) message with no data metric") } } @@ -152,16 +150,3 @@ macro_rules! prometheus_histogram( )* } ); - -/* -TODO: Make abstract type for all metrics(e.g. Gauge, Histogram, Counter) with generic traits so that all metrics can be set up with one function `set` -#[macro_export] -macro_rules! prometheus( - ($($a: expr; $metric:expr => $value:expr),*) => { - use $crate::{metrics::*}; - $( - metrics::set(#$a, &$metric, $value); - )* - } -); -*/ \ No newline at end of file diff --git a/utils/prometheus/src/metrics.rs b/utils/prometheus/src/metrics.rs index ee7787f4b24dc..61a7fcc6eb3fc 100644 --- a/utils/prometheus/src/metrics.rs +++ b/utils/prometheus/src/metrics.rs @@ -32,19 +32,19 @@ pub fn try_create_histogram(name: &str, help: &str) -> Result { Ok(histogram) } -///Gauge Metrics a value in injection. +/// Gauge Metrics a value in injection. pub fn set_gauge(gauge: &Result, value: u64) { if let Ok(gauge) = gauge { gauge.set(value as i64); } } -///histogram Metrics a value in injection. +/// histogram Metrics a value in injection. pub fn set_histogram(histogram: &Result, value: f64) { if let Ok(histogram) = histogram { histogram.observe(value) } } -//All of the metrics in the prometheus are managed by the lazy_static. +/// All of the metrics in the prometheus are managed by the lazy_static. lazy_static! { pub static ref FINALITY_HEIGHT: Result = try_create_int_gauge( @@ -52,45 +52,49 @@ lazy_static! { "block is finality HEIGHT" ); + pub static ref BEST_HEIGHT: Result = try_create_int_gauge( "consensus_best_block_height_number", "block is best HEIGHT" ); - pub static ref BLOCK_INTERVAL_SECONDS: Result = try_create_histogram( - "consensus_block_interval_seconds", - "Time between this and last block(Block.Header.Time) in seconds" - ); pub static ref P2P_PEERS_NUM: Result = try_create_int_gauge( "p2p_peers_number", "network gosip peers number" ); + pub static ref TARGET_NUM: Result = try_create_int_gauge( "consensus_target_syn_number", "block syn target number" ); + pub static ref TX_COUNT: Result = try_create_int_gauge( "consensus_num_txs", "Number of transactions" ); + pub static ref NODE_MEMORY: Result = try_create_int_gauge( "consensus_node_memory", "node memory" ); + pub static ref NODE_CPU: Result = try_create_int_gauge( "consensus_node_cpu", "node cpu" ); + pub static ref STATE_CACHE_SIZE: Result = try_create_int_gauge( "consensus_state_cache_size", "used state cache size" ); + pub static ref P2P_NODE_DOWNLOAD: Result = try_create_int_gauge( "p2p_peers_receive_byte_per_sec", "p2p_node_download_per_sec_byte" ); + pub static ref P2P_NODE_UPLOAD: Result = try_create_int_gauge( "p2p_peers_send_byte_per_sec", "p2p_node_upload_per_sec_byte" ); -} \ No newline at end of file +} From 8145df768ae5c0270f752d19078ff0b2fa80a5c4 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Mon, 6 Jan 2020 16:08:11 +0100 Subject: [PATCH 07/42] Spaces to tabs. --- primitives/consensus/babe/src/inherents.rs | 70 +++++++++++----------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/primitives/consensus/babe/src/inherents.rs b/primitives/consensus/babe/src/inherents.rs index 5a4e042352dcb..4fe71dbb8a7c4 100644 --- a/primitives/consensus/babe/src/inherents.rs +++ b/primitives/consensus/babe/src/inherents.rs @@ -32,59 +32,59 @@ pub const INHERENT_IDENTIFIER: InherentIdentifier = *b"babeslot"; pub type InherentType = u64; /// Auxiliary trait to extract BABE inherent data. pub trait BabeInherentData { - /// Get BABE inherent data. - fn babe_inherent_data(&self) -> Result; - /// Replace BABE inherent data. - fn babe_replace_inherent_data(&mut self, new: InherentType); + /// Get BABE inherent data. + fn babe_inherent_data(&self) -> Result; + /// Replace BABE inherent data. + fn babe_replace_inherent_data(&mut self, new: InherentType); } impl BabeInherentData for InherentData { - fn babe_inherent_data(&self) -> Result { - self.get_data(&INHERENT_IDENTIFIER) - .and_then(|r| r.ok_or_else(|| "BABE inherent data not found".into())) - } + fn babe_inherent_data(&self) -> Result { + self.get_data(&INHERENT_IDENTIFIER) + .and_then(|r| r.ok_or_else(|| "BABE inherent data not found".into())) + } - fn babe_replace_inherent_data(&mut self, new: InherentType) { - self.replace_data(INHERENT_IDENTIFIER, &new); - } + fn babe_replace_inherent_data(&mut self, new: InherentType) { + self.replace_data(INHERENT_IDENTIFIER, &new); + } } /// Provides the slot duration inherent data for BABE. #[cfg(feature = "std")] pub struct InherentDataProvider { - slot_duration: u64, + slot_duration: u64, } #[cfg(feature = "std")] impl InherentDataProvider { - /// Constructs `Self` - pub fn new(slot_duration: u64) -> Self { - Self { slot_duration } - } + /// Constructs `Self` + pub fn new(slot_duration: u64) -> Self { + Self { slot_duration } + } } #[cfg(feature = "std")] impl ProvideInherentData for InherentDataProvider { - fn on_register(&self, providers: &InherentDataProviders) -> Result<(), Error> { - if !providers.has_provider(&sp_timestamp::INHERENT_IDENTIFIER) { - // Add the timestamp inherent data provider, as we require it. - providers.register_provider(sp_timestamp::InherentDataProvider) - } else { - Ok(()) - } - } + fn on_register(&self, providers: &InherentDataProviders) -> Result<(), Error> { + if !providers.has_provider(&sp_timestamp::INHERENT_IDENTIFIER) { + // Add the timestamp inherent data provider, as we require it. + providers.register_provider(sp_timestamp::InherentDataProvider) + } else { + Ok(()) + } + } - fn inherent_identifier(&self) -> &'static InherentIdentifier { - &INHERENT_IDENTIFIER - } + fn inherent_identifier(&self) -> &'static InherentIdentifier { + &INHERENT_IDENTIFIER + } - fn provide_inherent_data(&self, inherent_data: &mut InherentData) -> Result<(), Error> { - let timestamp = inherent_data.timestamp_inherent_data()?; - let slot_number = timestamp / self.slot_duration; - inherent_data.put_data(INHERENT_IDENTIFIER, &slot_number) - } + fn provide_inherent_data(&self, inherent_data: &mut InherentData) -> Result<(), Error> { + let timestamp = inherent_data.timestamp_inherent_data()?; + let slot_number = timestamp / self.slot_duration; + inherent_data.put_data(INHERENT_IDENTIFIER, &slot_number) + } - fn error_to_string(&self, error: &[u8]) -> Option { - Error::decode(&mut &error[..]).map(|e| e.into_string()).ok() - } + fn error_to_string(&self, error: &[u8]) -> Option { + Error::decode(&mut &error[..]).map(|e| e.into_string()).ok() + } } From fca71bef05c4550cc0973de7a4868f5d5540cd76 Mon Sep 17 00:00:00 2001 From: Ashley Date: Fri, 10 Jan 2020 12:26:33 +0100 Subject: [PATCH 08/42] Replace grafana and tidy --- Cargo.lock | 66 +++--------- Cargo.toml | 2 - client/cli/Cargo.toml | 2 +- client/cli/src/informant/display.rs | 16 ++- client/cli/src/lib.rs | 12 +-- client/cli/src/params.rs | 22 ++-- client/service/Cargo.toml | 3 +- client/service/src/builder.rs | 95 ++++++++++------- client/service/src/config.rs | 5 +- client/service/test/src/lib.rs | 1 - client/tracing/Cargo.toml | 1 - client/tracing/src/lib.rs | 16 ++- utils/grafana-data-source/Cargo.toml | 23 ---- utils/grafana-data-source/test/Cargo.toml | 13 --- utils/prometheus/Cargo.toml | 10 +- .../prometheus/photo_2019-12-13_16-32-53.jpg | Bin 27726 -> 0 bytes utils/prometheus/src/lib.rs | 86 ++++++--------- utils/prometheus/src/metrics.rs | 100 ------------------ .../src/networking.rs | 0 19 files changed, 145 insertions(+), 328 deletions(-) delete mode 100644 utils/grafana-data-source/Cargo.toml delete mode 100644 utils/grafana-data-source/test/Cargo.toml delete mode 100644 utils/prometheus/photo_2019-12-13_16-32-53.jpg delete mode 100644 utils/prometheus/src/metrics.rs rename utils/{grafana-data-source => prometheus}/src/networking.rs (100%) diff --git a/Cargo.lock b/Cargo.lock index 194716611f7f2..4367a7fc8ae60 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -500,7 +500,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1676,34 +1675,6 @@ dependencies = [ "scroll 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "grafana-data-source" -version = "2.0.0" -dependencies = [ - "async-std 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", - "derive_more 0.99.2 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-timer 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-util 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "grafana-data-source-test" -version = "2.0.0" -dependencies = [ - "futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-timer 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "grafana-data-source 2.0.0", - "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "h2" version = "0.1.26" @@ -4451,6 +4422,21 @@ dependencies = [ "spin 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "prometheus-endpoint" +version = "2.0.0" +dependencies = [ + "async-std 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "derive_more 0.99.2 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-util 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "prometheus 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-runtime 2.0.0", + "tokio 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "prost" version = "0.5.0" @@ -5063,11 +5049,11 @@ dependencies = [ "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "names 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "prometheus-endpoint 2.0.0", "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "rpassword 4.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "sc-client-api 2.0.0", "sc-network 0.8.0", - "sc-prometheus 2.0.0", "sc-service 2.0.0", "sc-telemetry 2.0.0", "sc-tracing 2.0.0", @@ -5595,22 +5581,6 @@ dependencies = [ "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "sc-prometheus" -version = "2.0.0" -dependencies = [ - "async-std 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "derive_more 0.99.2 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-util 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "grafana-data-source 2.0.0", - "hyper 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "prometheus 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-runtime 2.0.0", - "tokio 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "sc-rpc" version = "2.0.0" @@ -5702,12 +5672,12 @@ dependencies = [ "exit-future 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "grafana-data-source 2.0.0", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "parity-multiaddr 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "prometheus-endpoint 2.0.0", "sc-chain-spec 2.0.0", "sc-client 2.0.0", "sc-client-api 2.0.0", @@ -5717,7 +5687,6 @@ dependencies = [ "sc-keystore 2.0.0", "sc-network 0.8.0", "sc-offchain 2.0.0", - "sc-prometheus 2.0.0", "sc-rpc 2.0.0", "sc-rpc-server 2.0.0", "sc-telemetry 2.0.0", @@ -5803,7 +5772,6 @@ name = "sc-tracing" version = "2.0.0" dependencies = [ "erased-serde 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "grafana-data-source 2.0.0", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "sc-telemetry 2.0.0", diff --git a/Cargo.toml b/Cargo.toml index e5940e5b7cdf1..219b1588f9618 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -50,8 +50,6 @@ members = [ "client/transaction-pool/graph", "utils/prometheus", "utils/wasm-builder-runner", - "utils/grafana-data-source", - "utils/grafana-data-source/test", "frame/assets", "frame/aura", "frame/authority-discovery", diff --git a/client/cli/Cargo.toml b/client/cli/Cargo.toml index 5c7ac86904164..05fc019d0a9d9 100644 --- a/client/cli/Cargo.toml +++ b/client/cli/Cargo.toml @@ -29,7 +29,7 @@ sp-core = { version = "2.0.0", path = "../../primitives/core" } sc-service = { version = "2.0.0", default-features = false, path = "../service" } sp-state-machine = { version = "2.0.0", path = "../../primitives/state-machine" } sc-telemetry = { version = "2.0.0", path = "../telemetry" } -sc-prometheus = { path = "../../utils/prometheus" } +prometheus-endpoint = { path = "../../utils/prometheus" } sp-keyring = { version = "2.0.0", path = "../../primitives/keyring" } names = "0.11.0" structopt = "=0.3.7" diff --git a/client/cli/src/informant/display.rs b/client/cli/src/informant/display.rs index f0b6e61176de7..b39cb2ddd1766 100644 --- a/client/cli/src/informant/display.rs +++ b/client/cli/src/informant/display.rs @@ -18,10 +18,20 @@ use ansi_term::Colour; use sc_client_api::ClientInfo; use log::info; use sc_network::SyncState; -use sp_runtime::traits::{Block as BlockT, CheckedDiv, NumberFor, Zero, Saturating}; +use sp_runtime::traits::{ + Block as BlockT, CheckedDiv, NumberFor, Zero, Saturating, UniqueSaturatedInto +}; use sc_service::NetworkStatus; use std::{convert::{TryFrom, TryInto}, fmt, time}; -use sc_prometheus::prometheus_gauge; +use prometheus_endpoint::{create_gauge, Gauge}; + +prometheus_endpoint::lazy_static! { + pub static ref SYNC_TARGET: Gauge = create_gauge( + "sync_target_number", + "block sync target number" + ); +} + /// State of the informant display system. /// /// This is the system that handles the line that gets regularly printed and that looks something @@ -64,7 +74,7 @@ impl InformantDisplay { (SyncState::Idle, _) => ("Idle".into(), "".into()), (SyncState::Downloading, None) => (format!("Syncing{}", speed), "".into()), (SyncState::Downloading, Some(n)) => { - prometheus_gauge!(TARGET_NUM => n.saturated_into().try_into().unwrap()); + SYNC_TARGET.set(n.unique_saturated_into() as i64); (format!("Syncing{}", speed), format!(", target=#{}", n)) } }; diff --git a/client/cli/src/lib.rs b/client/cli/src/lib.rs index 36bf19eedd0ec..c92b764b247ca 100644 --- a/client/cli/src/lib.rs +++ b/client/cli/src/lib.rs @@ -909,13 +909,12 @@ where let rpc_interface: &str = interface_str(cli.rpc_external, cli.unsafe_rpc_external, cli.validator)?; let ws_interface: &str = interface_str(cli.ws_external, cli.unsafe_ws_external, cli.validator)?; - let grafana_interface: &str = if cli.grafana_external { "0.0.0.0" } else { "127.0.0.1" }; let prometheus_interface: &str = if cli.prometheus_external { "0.0.0.0" } else { "127.0.0.1" }; config.rpc_http = Some(parse_address(&format!("{}:{}", rpc_interface, 9933), cli.rpc_port)?); config.rpc_ws = Some(parse_address(&format!("{}:{}", ws_interface, 9944), cli.ws_port)?); - config.grafana_port = Some( - parse_address(&format!("{}:{}", grafana_interface, 9955), cli.grafana_port)? + config.prometheus_port = Some( + parse_address(&format!("{}:{}", prometheus_interface, 9955), cli.prometheus_port)? ); config.rpc_ws_max_connections = cli.ws_max_connections; @@ -942,12 +941,7 @@ where config.tracing_targets = cli.tracing_targets.into(); config.tracing_receiver = cli.tracing_receiver.into(); - - // Override prometheus - if cli.prometheus_external { - config.prometheus_port = Some( - parse_address(&format!("{}:{}", prometheus_interface, 33333), cli.prometheus_port)? - )} + // Imply forced authoring on --dev config.force_authoring = cli.shared_params.dev || cli.force_authoring; diff --git a/client/cli/src/params.rs b/client/cli/src/params.rs index 3fd521b1334b9..377e2c1dc0def 100644 --- a/client/cli/src/params.rs +++ b/client/cli/src/params.rs @@ -298,7 +298,7 @@ arg_enum! { pub enum TracingReceiver { Log, Telemetry, - Grafana, + Prometheus, } } @@ -307,7 +307,7 @@ impl Into for TracingReceiver { match self { TracingReceiver::Log => sc_tracing::TracingReceiver::Log, TracingReceiver::Telemetry => sc_tracing::TracingReceiver::Telemetry, - TracingReceiver::Grafana => sc_tracing::TracingReceiver::Grafana, + TracingReceiver::Prometheus => sc_tracing::TracingReceiver::Prometheus, } } } @@ -440,12 +440,6 @@ pub struct RunCmd { /// Use `--unsafe-ws-external` to suppress the warning if you understand the risks. #[structopt(long = "ws-external")] pub ws_external: bool, - /// Prometheus exporter TCP port. - #[structopt(long = "prometheus-port", value_name = "PORT")] - pub prometheus_port: Option, - /// Prometheus exporter on/off external". - #[structopt(long = "prometheus-external")] - pub prometheus_external: bool, /// Listen to all Websocket interfaces. /// @@ -453,11 +447,11 @@ pub struct RunCmd { #[structopt(long = "unsafe-ws-external")] pub unsafe_ws_external: bool, - /// Listen to all Grafana data source interfaces. + /// Listen to all Prometheus endpoint interfaces. /// /// Default is local. - #[structopt(long = "grafana-external")] - pub grafana_external: bool, + #[structopt(long = "prometheus-external")] + pub prometheus_external: bool, /// Specify HTTP RPC server TCP port. #[structopt(long = "rpc-port", value_name = "PORT")] @@ -481,9 +475,9 @@ pub struct RunCmd { #[structopt(long = "rpc-cors", value_name = "ORIGINS", parse(try_from_str = parse_cors))] pub rpc_cors: Option, - /// Specify Grafana data source server TCP Port. - #[structopt(long = "grafana-port", value_name = "PORT")] - pub grafana_port: Option, + /// Specify Prometheus endpoint TCP Port. + #[structopt(long = "prometheus-port", value_name = "PORT")] + pub prometheus_port: Option, /// The human-readable name for this node. /// diff --git a/client/service/Cargo.toml b/client/service/Cargo.toml index 887e8415f39b7..42f0a73dfbfa2 100644 --- a/client/service/Cargo.toml +++ b/client/service/Cargo.toml @@ -51,10 +51,9 @@ sc-rpc = { version = "2.0.0", path = "../rpc" } sc-telemetry = { version = "2.0.0", path = "../telemetry" } sc-offchain = { version = "2.0.0", path = "../offchain" } parity-multiaddr = { package = "parity-multiaddr", version = "0.5.0" } -grafana-data-source = { version = "2.0.0", path = "../../utils/grafana-data-source" } +prometheus-endpoint = { path = "../../utils/prometheus" } sc-tracing = { version = "2.0.0", path = "../tracing" } tracing = "0.1.10" -sc-prometheus = { package = "sc-prometheus", path="../../utils/prometheus"} [dev-dependencies] substrate-test-runtime-client = { version = "2.0.0", path = "../../test-utils/runtime/client" } diff --git a/client/service/src/builder.rs b/client/service/src/builder.rs index 424f47d57a614..3a447cd06f877 100644 --- a/client/service/src/builder.rs +++ b/client/service/src/builder.rs @@ -53,11 +53,51 @@ use std::{ use sysinfo::{get_current_pid, ProcessExt, System, SystemExt}; use sc_telemetry::{telemetry, SUBSTRATE_INFO}; use sp_transaction_pool::{TransactionPool, TransactionPoolMaintainer}; -use sc_prometheus::prometheus_gauge; - use sp_blockchain; -use grafana_data_source::{self, record_metrics}; - +use prometheus_endpoint::{create_gauge, Gauge}; + +prometheus_endpoint::lazy_static! { + pub static ref FINALITY_HEIGHT: Gauge = create_gauge( + "consensus_finality_block_height_number", + "block is finality HEIGHT" + ); + pub static ref BEST_HEIGHT: Gauge = create_gauge( + "consensus_best_block_height_number", + "block is best HEIGHT" + ); + pub static ref BLOCK_INTERVAL_SECONDS: Gauge = create_gauge( + "consensus_block_interval_seconds", + "Time between this and last block(Block.Header.Time) in seconds" + ); + pub static ref P2P_PEERS_NUM: Gauge = create_gauge( + "p2p_peers_number", + "network gosip peers number" + ); + pub static ref TX_COUNT: Gauge = create_gauge( + "consensus_num_txs", + "Number of transactions" + ); + pub static ref NODE_MEMORY: Gauge = create_gauge( + "consensus_node_memory", + "node memory" + ); + pub static ref NODE_CPU: Gauge = create_gauge( + "consensus_node_cpu", + "node cpu" + ); + pub static ref STATE_CACHE_SIZE: Gauge = create_gauge( + "consensus_state_cache_size", + "used state cache size" + ); + pub static ref P2P_NODE_DOWNLOAD: Gauge = create_gauge( + "p2p_peers_receive_byte_per_sec", + "p2p_node_download_per_sec_byte" + ); + pub static ref P2P_NODE_UPLOAD: Gauge = create_gauge( + "p2p_peers_send_byte_per_sec", + "p2p_node_upload_per_sec_byte" + ); +} /// Aggregator for the components required to build a service. /// /// # Usage @@ -956,28 +996,14 @@ ServiceBuilder< "bandwidth_upload" => bandwidth_upload, "used_state_cache_size" => used_state_cache_size, ); - prometheus_gauge!( - STATE_CACHE_SIZE => used_state_cache_size as u64, - NODE_MEMORY => memory as u64, - NODE_CPU => cpu_usage as u64, - TX_COUNT => txpool_status.ready as u64, - FINALITY_HEIGHT => finalized_number as u64, - BEST_HEIGHT => best_number as u64, - P2P_PEERS_NUM => num_peers as u64, - P2P_NODE_DOWNLOAD => net_status.average_download_per_sec as u64, - P2P_NODE_UPLOAD => net_status.average_upload_per_sec as u64 - ); - let _ = record_metrics!( - "peers" => num_peers, - "height" => best_number, - "txcount" => txpool_status.ready, - "cpu" => cpu_usage, - "memory" => memory, - "finalized_height" => finalized_number, - "bandwidth_download" => bandwidth_download, - "bandwidth_upload" => bandwidth_upload, - "used_state_cache_size" => used_state_cache_size, - ); + NODE_MEMORY.set(memory as i64); + NODE_CPU.set(cpu_usage as i64); + TX_COUNT.set(txpool_status.ready as i64); + FINALITY_HEIGHT.set(finalized_number as i64); + BEST_HEIGHT.set(best_number as i64); + P2P_PEERS_NUM.set(num_peers as i64); + P2P_NODE_DOWNLOAD.set(net_status.average_download_per_sec as i64); + P2P_NODE_UPLOAD.set(net_status.average_upload_per_sec as i64); Ok(()) }).select(exit.clone().map(Ok).compat()).then(|_| Ok(())); let _ = to_spawn_tx.unbounded_send(Box::new(tel_task)); @@ -1115,21 +1141,10 @@ ServiceBuilder< .then(|_| Ok(())))); telemetry }); - // prometheus init + // Prometheus endpoint if let Some(port) = config.prometheus_port { let future = select( - sc_prometheus::init_prometheus(port).boxed() - ,exit.clone() - ).map(|either| match either { - Either::Left((result, _)) => result.map_err(|_| ()), - Either::Right(_) => Ok(()) - }).compat(); - let _ = to_spawn_tx.unbounded_send(Box::new(future)); - } - // Grafana data source - if let Some(port) = config.grafana_port { - let future = select( - grafana_data_source::run_server(port).boxed(), + prometheus_endpoint::init_prometheus(port).boxed(), exit.clone() ).map(|either| match either { Either::Left((result, _)) => result.map_err(|_| ()), @@ -1137,7 +1152,7 @@ ServiceBuilder< }).compat(); let _ = to_spawn_tx.unbounded_send(Box::new(future)); - } + } // Instrumentation if let Some(tracing_targets) = config.tracing_targets.as_ref() { diff --git a/client/service/src/config.rs b/client/service/src/config.rs index 2f0a2ba83a071..9f240a19affba 100644 --- a/client/service/src/config.rs +++ b/client/service/src/config.rs @@ -73,9 +73,7 @@ pub struct Configuration { pub rpc_ws_max_connections: Option, /// CORS settings for HTTP & WS servers. `None` if all origins are allowed. pub rpc_cors: Option>, - /// Grafana data source http port. `None` if disabled. - pub grafana_port: Option, - /// Prometheus Port.`None` if disabled and port 33333 by default. + /// Prometheus endpoint Port. `None` if disabled. pub prometheus_port: Option, /// Telemetry service URL. `None` if disabled. pub telemetry_endpoints: Option, @@ -156,7 +154,6 @@ impl Configuration where rpc_ws_max_connections: None, rpc_cors: Some(vec![]), prometheus_port: None, - grafana_port: None, telemetry_endpoints: None, telemetry_external_transport: None, default_heap_pages: None, diff --git a/client/service/test/src/lib.rs b/client/service/test/src/lib.rs index ea3e523d4ef0a..cf1baa06db6c8 100644 --- a/client/service/test/src/lib.rs +++ b/client/service/test/src/lib.rs @@ -193,7 +193,6 @@ fn node_config ( rpc_ws_max_connections: None, rpc_cors: None, prometheus_port: None, - grafana_port: None, telemetry_endpoints: None, telemetry_external_transport: None, default_heap_pages: None, diff --git a/client/tracing/Cargo.toml b/client/tracing/Cargo.toml index 2ceee93f6a62a..ed9b52fc26e20 100644 --- a/client/tracing/Cargo.toml +++ b/client/tracing/Cargo.toml @@ -15,7 +15,6 @@ slog = { version = "2.5.2", features = ["nested-values"] } tracing-core = "0.1.7" sc-telemetry = { version = "2.0.0", path = "../telemetry" } -grafana-data-source = { version = "2.0.0", path = "../../utils/grafana-data-source" } [dev-dependencies] tracing = "0.1.10" diff --git a/client/tracing/src/lib.rs b/client/tracing/src/lib.rs index 288d5e70192de..32dc27be158e0 100644 --- a/client/tracing/src/lib.rs +++ b/client/tracing/src/lib.rs @@ -34,7 +34,7 @@ //! let span = tracing::span!(tracing::Level::INFO, "my_span_name", my_number = 10, a_key = "a value"); //! let _guard = span.enter(); //! ``` -//! Currently we provide `Log` (default), `Telemetry` and `Grafana` variants for `Receiver` +//! Currently we provide `Log` (default), `Telemetry` and `Prometheus` variants for `Receiver` use std::collections::HashMap; use std::fmt; @@ -53,7 +53,6 @@ use tracing_core::{ subscriber::Subscriber }; -use grafana_data_source::{self, record_metrics}; use sc_telemetry::{telemetry, SUBSTRATE_INFO}; /// Used to configure how to receive the metrics @@ -63,8 +62,8 @@ pub enum TracingReceiver { Log, /// Output to telemetry Telemetry, - /// Output to Grafana - Grafana, + /// Output to Prometheus endpoint + Prometheus, } impl Default for TracingReceiver { @@ -255,7 +254,7 @@ impl ProfilingSubscriber { match self.receiver { TracingReceiver::Log => print_log(span_datum), TracingReceiver::Telemetry => send_telemetry(span_datum), - TracingReceiver::Grafana => send_grafana(span_datum), + TracingReceiver::Prometheus => send_prometheus(span_datum), } } } @@ -291,9 +290,6 @@ fn send_telemetry(span_datum: SpanDatum) { ); } -fn send_grafana(span_datum: SpanDatum) { - let name = format!("{}::{}", span_datum.target, span_datum.name); - if let Err(e) = record_metrics!(&name => span_datum.overall_time.as_nanos(),) { - log::warn!("Unable to send metrics to grafana: {:?}", e); - } +fn send_prometheus(span_datum: SpanDatum) { + unimplemented!() } diff --git a/utils/grafana-data-source/Cargo.toml b/utils/grafana-data-source/Cargo.toml deleted file mode 100644 index 76bf7d5988d9a..0000000000000 --- a/utils/grafana-data-source/Cargo.toml +++ /dev/null @@ -1,23 +0,0 @@ -[package] -description = "Grafana data source server" -name = "grafana-data-source" -version = "2.0.0" -license = "GPL-3.0" -authors = ["Parity Technologies "] -edition = "2018" - -[dependencies] -log = "0.4.8" -hyper = { version = "0.13.1", default-features = false, features = ["stream"] } -tokio = "0.2" -futures-util = { version = "0.3.1", default-features = false, features = ["io"] } -serde_json = "1" -serde = { version = "1", features = ["derive"] } -chrono = { version = "0.4", features = ["serde"] } -lazy_static = "1.4" -parking_lot = "0.9" -futures-timer = "2.0" -derive_more = "0.99" - -[target.'cfg(not(target_os = "unknown"))'.dependencies] -async-std = { version = "1.0.1", features = ["unstable"] } diff --git a/utils/grafana-data-source/test/Cargo.toml b/utils/grafana-data-source/test/Cargo.toml deleted file mode 100644 index 079b49dc8608a..0000000000000 --- a/utils/grafana-data-source/test/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -description = "Grafana data source server test" -name = "grafana-data-source-test" -version = "2.0.0" -license = "GPL-3.0" -authors = ["Parity Technologies "] -edition = "2018" - -[dependencies] -grafana-data-source = { version = "2.0.0", path = ".." } -futures = "0.3" -futures-timer = "2.0" -rand = "0.7" diff --git a/utils/prometheus/Cargo.toml b/utils/prometheus/Cargo.toml index 46b5c42ca3ef4..3f3b4bf408df0 100644 --- a/utils/prometheus/Cargo.toml +++ b/utils/prometheus/Cargo.toml @@ -1,20 +1,20 @@ [package] -name = "sc-prometheus" +description = "Prometheus endpoint server" +name = "prometheus-endpoint" version = "2.0.0" +license = "GPL-3.0" authors = ["Parity Technologies "] -description = "prometheus utils" edition = "2018" [dependencies] -hyper = { version = "0.13.1", default-features = false, features = ["stream"] } -lazy_static = "1.4" log = "0.4.8" +hyper = { version = "0.13.1", default-features = false, features = ["stream"] } prometheus = { version = "0.7", features = ["nightly", "process"]} tokio = "0.2" futures-util = { version = "0.3.1", default-features = false, features = ["io"] } +lazy_static = "1.4" sp-runtime = { package = "sp-runtime",path = "../../primitives/runtime" } derive_more = "0.99" -grafana-data-source = { version = "2.0.0", path = "../grafana-data-source" } [target.'cfg(not(target_os = "unknown"))'.dependencies] async-std = { version = "1.0.1", features = ["unstable"] } diff --git a/utils/prometheus/photo_2019-12-13_16-32-53.jpg b/utils/prometheus/photo_2019-12-13_16-32-53.jpg deleted file mode 100644 index cdf44f88fb623d7b5a319235c6d603463698716c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 27726 zcmeFZcT`m0wkEoDJ3nV{7^+zOM;&BO;@slT%XD z(lg$@&-|44IsZ#R;n$*y%Bt$`HMMp1ZS5VMUEMvsKZi#~$Hpfnr>2*dS60{7H#WDn z(T7LJC#PqaKj(k5ivVxuzaIZ$*gx4tgSYD%At8tm{5QJ@u6g4Jh=!2p=6zyXrKjMR zu5`CVf=TEfBz-LZLCPii48>sSHblnAEw;pi{+nrkx9mS=Sjhh;%l?O9|7O=TKmj7a z-#icv00qv@`91}a{WbntgTFBF7Y6>qz+V{n3j=>);4cjPg@L~?@V^fOcdL)%D8o7m z6+NQfYu6G^gu-l2qdlj2yR+$c()IQ4cPpltf()(0YbPjhIc@YZY7eh#32s`4KgPi&q)`=tn2 zr%VSyRGwF~RE?HmFZkb;-Rd<%-+P%fYW>u+(AY?f-_xD`w)YfuQpka`QqGqk!66lT z;OYN;gMb26+S&N6`9V+qb$Kd=BSh2{V3V!YBZuQ?Hrb50MT*l<8%#)Rd363L8o-!e z0Z+#Lg$pAO1j~*us->T`epJ|2vuJB*q44)WYlT&?ohIm4u`|>z>&SnA>o{y(sy+HP zF339ZtTJSuc!#}*88VRXqxQG|(NCvy#5?F@J@Q&E(n3V#m}NEab&w?XKDwYS@YWQ4 zjhbeIlU#Ah-HoYpNH@dg)1Ks9k5?Wq6MwpqoFe0}ny8k}K>7uq{dY&k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zaMW#sX;KM)$(?IyGtxlN;4Y;gb-PLj6~i*BEMwkwD;3*xgXE~O3)<969JpBfeg}$d z`Z3os{Nc%-u|^pBICcDNodZPFGQ#=fb{bP1=3z{XxQnWIgIx8NIozxaJfUf{Wxpo) zE*Z?=E9`c6QOAuZvD-vHAhbo{lYIeArCL5%3%G@Ru+jM?n4dO1{X)>E`rAwAGdUiE0|jsIffrYU|H?-yt$9 z69568juojC@E$e9*JiwCNBR8vFfNmF))gLYp&$7?I+8@h34ale4%r+IF@b(TPsg>ZXJ;5@soz3YFR!o@h#9C_PWJsU}HlQ=an7<*T32N z7@)}Xt0cMyxe2!}lnz1g5SI#E*wxKj*3EegcTjcn$NV?bx>^!?t>Adb%1~>pKbWSe z8^Ra>4JWFK*5fROv6sYqRRmFE^$l{j)5@IJKx8zSyGL%E0~H(1;ZlF=z!%px-9w0$ z8yx{$C@&yzbg_Fn~o1f^PpdHVP2-b2=UXi1Tasg|exvf{Pyq(U0PS;ut26BQ> z;L*6vS^dbEuQWOEE4=8@js57=x+>eW z?-@c?e7s^hR}#!3c-U3gWK%;BuYqwdHV=7_3sWUkXHWV0_sCcuv@~s}h!up1(At+kaFO^=KyT&{a>MXi>v?u diff --git a/utils/prometheus/src/lib.rs b/utils/prometheus/src/lib.rs index a6d9397575db6..6883fae48fae1 100644 --- a/utils/prometheus/src/lib.rs +++ b/utils/prometheus/src/lib.rs @@ -22,13 +22,21 @@ use hyper::http::StatusCode; use hyper::Server; use hyper::{Body, Request, Response, service::{service_fn, make_service_fn}}; pub use prometheus::{Encoder, HistogramOpts, Opts, TextEncoder}; -pub use prometheus::{Histogram, IntCounter, IntGauge}; +pub use prometheus::{Histogram, IntCounter}; +pub use prometheus::IntGauge as Gauge; pub use sp_runtime::traits::SaturatedConversion; use std::net::SocketAddr; -//#[cfg(not(target_os = "unknown"))] -//mod networking; +#[cfg(not(target_os = "unknown"))] +mod networking; + +pub use lazy_static::lazy_static; -pub mod metrics; +pub fn create_gauge(name: &str, description: &str) -> Gauge { + let opts = Opts::new(name, description); + let gauge = Gauge::with_opts(opts).expect("Creating Gauge Failed"); + prometheus::register(Box::new(gauge.clone())).expect("Registering gauge failed"); + gauge +} #[derive(Debug, derive_more::Display, derive_more::From)] pub enum Error { @@ -50,23 +58,22 @@ impl std::error::Error for Error { } async fn request_metrics(req: Request) -> Result, Error> { - if req.uri().path() == "/metrics" { - let metric_families = prometheus::gather(); - let mut buffer = vec![]; - let encoder = TextEncoder::new(); - encoder.encode(&metric_families, &mut buffer).unwrap(); - Response::builder() - .status(StatusCode::OK) - .header("Content-Type", encoder.format_type()) - .body(Body::from(buffer)) - .map_err(Error::Http) - } else { - Response::builder() - .status(StatusCode::NOT_FOUND) - .body(Body::from("Not found.")) - .map_err(Error::Http) - } - + if req.uri().path() == "/metrics" { + let metric_families = prometheus::gather(); + let mut buffer = vec![]; + let encoder = TextEncoder::new(); + encoder.encode(&metric_families, &mut buffer).unwrap(); + Response::builder() + .status(StatusCode::OK) + .header("Content-Type", encoder.format_type()) + .body(Body::from(buffer)) + .map_err(Error::Http) + } else { + Response::builder() + .status(StatusCode::NOT_FOUND) + .body(Body::from("Not found.")) + .map_err(Error::Http) + } } #[derive(Clone)] @@ -86,8 +93,8 @@ impl hyper::rt::Executor for Executor /// to serve metrics. #[cfg(not(target_os = "unknown"))] pub async fn init_prometheus(mut prometheus_addr: SocketAddr) -> Result<(), Error>{ - use async_std::{net, io}; - use grafana_data_source::networking::Incoming; + use async_std::{net, io}; + use networking::Incoming; let listener = loop { let listener = net::TcpListener::bind(&prometheus_addr).await; match listener { @@ -103,23 +110,21 @@ pub async fn init_prometheus(mut prometheus_addr: SocketAddr) -> Result<(), Err prometheus_addr.set_port(0); continue; }, - _ => return Err(err.into()) - } + _ => return Err(err.into()) + } } }; - let service = make_service_fn(|_| { + let service = make_service_fn(|_| { async { Ok::<_, Error>(service_fn(request_metrics)) } }); - let _server = Server::builder(Incoming(listener.incoming())) .executor(Executor) .serve(service) - .boxed(); - - + .boxed(); + let result = _server.await.map_err(Into::into); result @@ -129,24 +134,3 @@ pub async fn init_prometheus(mut prometheus_addr: SocketAddr) -> Result<(), Err pub async fn init_prometheus(_: SocketAddr) -> Result<(), Error> { Ok(()) } - - -#[macro_export] -macro_rules! prometheus_gauge( - ($($metric:expr => $value:expr),*) => { - use $crate::{metrics::*}; - $( - metrics::set_gauge(&$metric, $value); - )* - } -); - -#[macro_export] -macro_rules! prometheus_histogram( - ($($metric:expr => $value:expr),*) => { - use $crate::{metrics::*}; - $( - metrics::set_histogram(&$metric, $value); - )* - } -); diff --git a/utils/prometheus/src/metrics.rs b/utils/prometheus/src/metrics.rs deleted file mode 100644 index 61a7fcc6eb3fc..0000000000000 --- a/utils/prometheus/src/metrics.rs +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright 2019 Parity Technologies (UK) Ltd. -// This file is part of Substrate. - -// Substrate is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Substrate is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Substrate. If not, see . - - -pub use crate::*; -pub use prometheus::Result; -/// Gauge type metrics generation function -pub fn try_create_int_gauge(name: &str, help: &str) -> Result { - let opts = Opts::new(name, help); - let gauge = IntGauge::with_opts(opts)?; - prometheus::register(Box::new(gauge.clone()))?; - Ok(gauge) -} -/// histogram type metrics generation function -pub fn try_create_histogram(name: &str, help: &str) -> Result { - let opts = HistogramOpts::new(name, help); - let histogram = Histogram::with_opts(opts)?; - prometheus::register(Box::new(histogram.clone()))?; - Ok(histogram) -} - -/// Gauge Metrics a value in injection. -pub fn set_gauge(gauge: &Result, value: u64) { - if let Ok(gauge) = gauge { - gauge.set(value as i64); - } -} -/// histogram Metrics a value in injection. -pub fn set_histogram(histogram: &Result, value: f64) { - if let Ok(histogram) = histogram { - histogram.observe(value) - } -} -/// All of the metrics in the prometheus are managed by the lazy_static. - -lazy_static! { - pub static ref FINALITY_HEIGHT: Result = try_create_int_gauge( - "consensus_finality_block_height_number", - "block is finality HEIGHT" - - ); - - pub static ref BEST_HEIGHT: Result = try_create_int_gauge( - "consensus_best_block_height_number", - "block is best HEIGHT" - ); - - pub static ref P2P_PEERS_NUM: Result = try_create_int_gauge( - "p2p_peers_number", - "network gosip peers number" - ); - - pub static ref TARGET_NUM: Result = try_create_int_gauge( - "consensus_target_syn_number", - "block syn target number" - ); - - pub static ref TX_COUNT: Result = try_create_int_gauge( - "consensus_num_txs", - "Number of transactions" - ); - - pub static ref NODE_MEMORY: Result = try_create_int_gauge( - "consensus_node_memory", - "node memory" - ); - - pub static ref NODE_CPU: Result = try_create_int_gauge( - "consensus_node_cpu", - "node cpu" - ); - - pub static ref STATE_CACHE_SIZE: Result = try_create_int_gauge( - "consensus_state_cache_size", - "used state cache size" - ); - - pub static ref P2P_NODE_DOWNLOAD: Result = try_create_int_gauge( - "p2p_peers_receive_byte_per_sec", - "p2p_node_download_per_sec_byte" - ); - - pub static ref P2P_NODE_UPLOAD: Result = try_create_int_gauge( - "p2p_peers_send_byte_per_sec", - "p2p_node_upload_per_sec_byte" - ); -} diff --git a/utils/grafana-data-source/src/networking.rs b/utils/prometheus/src/networking.rs similarity index 100% rename from utils/grafana-data-source/src/networking.rs rename to utils/prometheus/src/networking.rs From 855ceed68ed9c5a523fd6a7b08b4f61f48a882aa Mon Sep 17 00:00:00 2001 From: Ashley Date: Fri, 10 Jan 2020 12:11:58 +0100 Subject: [PATCH 09/42] Add generics --- Cargo.lock | 1 - client/cli/src/informant/display.rs | 6 ++-- client/service/src/builder.rs | 42 +++++++++++---------------- utils/prometheus/Cargo.toml | 1 - utils/prometheus/src/lib.rs | 44 ++++++++++++----------------- 5 files changed, 38 insertions(+), 56 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4367a7fc8ae60..010acdb334062 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4433,7 +4433,6 @@ dependencies = [ "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "prometheus 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-runtime 2.0.0", "tokio 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", ] diff --git a/client/cli/src/informant/display.rs b/client/cli/src/informant/display.rs index b39cb2ddd1766..3f0c1b8d60604 100644 --- a/client/cli/src/informant/display.rs +++ b/client/cli/src/informant/display.rs @@ -23,10 +23,10 @@ use sp_runtime::traits::{ }; use sc_service::NetworkStatus; use std::{convert::{TryFrom, TryInto}, fmt, time}; -use prometheus_endpoint::{create_gauge, Gauge}; +use prometheus_endpoint::{create_gauge, Gauge, U64}; prometheus_endpoint::lazy_static! { - pub static ref SYNC_TARGET: Gauge = create_gauge( + pub static ref SYNC_TARGET: Gauge = create_gauge( "sync_target_number", "block sync target number" ); @@ -74,7 +74,7 @@ impl InformantDisplay { (SyncState::Idle, _) => ("Idle".into(), "".into()), (SyncState::Downloading, None) => (format!("Syncing{}", speed), "".into()), (SyncState::Downloading, Some(n)) => { - SYNC_TARGET.set(n.unique_saturated_into() as i64); + SYNC_TARGET.set(n.unique_saturated_into() as u64); (format!("Syncing{}", speed), format!(", target=#{}", n)) } }; diff --git a/client/service/src/builder.rs b/client/service/src/builder.rs index 3a447cd06f877..9f17ad4a1ce28 100644 --- a/client/service/src/builder.rs +++ b/client/service/src/builder.rs @@ -54,46 +54,38 @@ use sysinfo::{get_current_pid, ProcessExt, System, SystemExt}; use sc_telemetry::{telemetry, SUBSTRATE_INFO}; use sp_transaction_pool::{TransactionPool, TransactionPoolMaintainer}; use sp_blockchain; -use prometheus_endpoint::{create_gauge, Gauge}; +use prometheus_endpoint::{create_gauge, Gauge, U64, F64}; prometheus_endpoint::lazy_static! { - pub static ref FINALITY_HEIGHT: Gauge = create_gauge( + pub static ref FINALITY_HEIGHT: Gauge = create_gauge( "consensus_finality_block_height_number", "block is finality HEIGHT" ); - pub static ref BEST_HEIGHT: Gauge = create_gauge( + pub static ref BEST_HEIGHT: Gauge = create_gauge( "consensus_best_block_height_number", "block is best HEIGHT" ); - pub static ref BLOCK_INTERVAL_SECONDS: Gauge = create_gauge( - "consensus_block_interval_seconds", - "Time between this and last block(Block.Header.Time) in seconds" - ); - pub static ref P2P_PEERS_NUM: Gauge = create_gauge( + pub static ref P2P_PEERS_NUM: Gauge = create_gauge( "p2p_peers_number", "network gosip peers number" ); - pub static ref TX_COUNT: Gauge = create_gauge( + pub static ref TX_COUNT: Gauge = create_gauge( "consensus_num_txs", "Number of transactions" ); - pub static ref NODE_MEMORY: Gauge = create_gauge( + pub static ref NODE_MEMORY: Gauge = create_gauge( "consensus_node_memory", "node memory" ); - pub static ref NODE_CPU: Gauge = create_gauge( + pub static ref NODE_CPU: Gauge = create_gauge( "consensus_node_cpu", "node cpu" ); - pub static ref STATE_CACHE_SIZE: Gauge = create_gauge( - "consensus_state_cache_size", - "used state cache size" - ); - pub static ref P2P_NODE_DOWNLOAD: Gauge = create_gauge( + pub static ref P2P_NODE_DOWNLOAD: Gauge = create_gauge( "p2p_peers_receive_byte_per_sec", "p2p_node_download_per_sec_byte" ); - pub static ref P2P_NODE_UPLOAD: Gauge = create_gauge( + pub static ref P2P_NODE_UPLOAD: Gauge = create_gauge( "p2p_peers_send_byte_per_sec", "p2p_node_upload_per_sec_byte" ); @@ -996,14 +988,14 @@ ServiceBuilder< "bandwidth_upload" => bandwidth_upload, "used_state_cache_size" => used_state_cache_size, ); - NODE_MEMORY.set(memory as i64); - NODE_CPU.set(cpu_usage as i64); - TX_COUNT.set(txpool_status.ready as i64); - FINALITY_HEIGHT.set(finalized_number as i64); - BEST_HEIGHT.set(best_number as i64); - P2P_PEERS_NUM.set(num_peers as i64); - P2P_NODE_DOWNLOAD.set(net_status.average_download_per_sec as i64); - P2P_NODE_UPLOAD.set(net_status.average_upload_per_sec as i64); + NODE_MEMORY.set(memory); + NODE_CPU.set(f64::from(cpu_usage)); + TX_COUNT.set(txpool_status.ready as u64); + FINALITY_HEIGHT.set(finalized_number); + BEST_HEIGHT.set(best_number); + P2P_PEERS_NUM.set(num_peers as u64); + P2P_NODE_DOWNLOAD.set(net_status.average_download_per_sec); + P2P_NODE_UPLOAD.set(net_status.average_upload_per_sec); Ok(()) }).select(exit.clone().map(Ok).compat()).then(|_| Ok(())); let _ = to_spawn_tx.unbounded_send(Box::new(tel_task)); diff --git a/utils/prometheus/Cargo.toml b/utils/prometheus/Cargo.toml index 3f3b4bf408df0..a4bf0aa52273e 100644 --- a/utils/prometheus/Cargo.toml +++ b/utils/prometheus/Cargo.toml @@ -13,7 +13,6 @@ prometheus = { version = "0.7", features = ["nightly", "process"]} tokio = "0.2" futures-util = { version = "0.3.1", default-features = false, features = ["io"] } lazy_static = "1.4" -sp-runtime = { package = "sp-runtime",path = "../../primitives/runtime" } derive_more = "0.99" [target.'cfg(not(target_os = "unknown"))'.dependencies] diff --git a/utils/prometheus/src/lib.rs b/utils/prometheus/src/lib.rs index 6883fae48fae1..802a2b53b7fa5 100644 --- a/utils/prometheus/src/lib.rs +++ b/utils/prometheus/src/lib.rs @@ -14,24 +14,22 @@ // You should have received a copy of the GNU General Public License // along with Substrate. If not, see . - -#[macro_use] extern crate lazy_static; -use futures_util::{FutureExt,future::{Future}}; + +use futures_util::{FutureExt, future::Future}; use hyper::http::StatusCode; -use hyper::Server; -use hyper::{Body, Request, Response, service::{service_fn, make_service_fn}}; -pub use prometheus::{Encoder, HistogramOpts, Opts, TextEncoder}; -pub use prometheus::{Histogram, IntCounter}; -pub use prometheus::IntGauge as Gauge; -pub use sp_runtime::traits::SaturatedConversion; +use hyper::{Server, Body, Request, Response, service::{service_fn, make_service_fn}}; +use prometheus::{Encoder, Opts, TextEncoder, core::Atomic}; use std::net::SocketAddr; #[cfg(not(target_os = "unknown"))] mod networking; +pub use prometheus::core::{ + GenericGauge as Gauge, AtomicF64 as F64, AtomicI64 as I64, AtomicU64 as U64 +}; pub use lazy_static::lazy_static; -pub fn create_gauge(name: &str, description: &str) -> Gauge { +pub fn create_gauge(name: &str, description: &str) -> Gauge { let opts = Opts::new(name, description); let gauge = Gauge::with_opts(opts).expect("Creating Gauge Failed"); prometheus::register(Box::new(gauge.clone())).expect("Registering gauge failed"); @@ -58,22 +56,16 @@ impl std::error::Error for Error { } async fn request_metrics(req: Request) -> Result, Error> { - if req.uri().path() == "/metrics" { - let metric_families = prometheus::gather(); - let mut buffer = vec![]; - let encoder = TextEncoder::new(); - encoder.encode(&metric_families, &mut buffer).unwrap(); - Response::builder() - .status(StatusCode::OK) - .header("Content-Type", encoder.format_type()) - .body(Body::from(buffer)) - .map_err(Error::Http) - } else { - Response::builder() - .status(StatusCode::NOT_FOUND) - .body(Body::from("Not found.")) - .map_err(Error::Http) - } + let metric_families = prometheus::gather(); + let mut buffer = vec![]; + let encoder = TextEncoder::new(); + encoder.encode(&metric_families, &mut buffer).unwrap(); + + Response::builder() + .status(StatusCode::OK) + .header("Content-Type", encoder.format_type()) + .body(Body::from(buffer)) + .map_err(Error::Http) } #[derive(Clone)] From 70c6bccf6d704a60d99c3504f9d406ea3604b148 Mon Sep 17 00:00:00 2001 From: Ashley Date: Fri, 10 Jan 2020 12:35:54 +0100 Subject: [PATCH 10/42] Add photo back --- primitives/consensus/babe/src/inherents.rs | 70 +-- utils/prometheus/README.md | 424 ------------------ .../prometheus/photo_2019-12-13_16-32-53.jpg | Bin 0 -> 27726 bytes 3 files changed, 35 insertions(+), 459 deletions(-) create mode 100644 utils/prometheus/photo_2019-12-13_16-32-53.jpg diff --git a/primitives/consensus/babe/src/inherents.rs b/primitives/consensus/babe/src/inherents.rs index 4fe71dbb8a7c4..5a4e042352dcb 100644 --- a/primitives/consensus/babe/src/inherents.rs +++ b/primitives/consensus/babe/src/inherents.rs @@ -32,59 +32,59 @@ pub const INHERENT_IDENTIFIER: InherentIdentifier = *b"babeslot"; pub type InherentType = u64; /// Auxiliary trait to extract BABE inherent data. pub trait BabeInherentData { - /// Get BABE inherent data. - fn babe_inherent_data(&self) -> Result; - /// Replace BABE inherent data. - fn babe_replace_inherent_data(&mut self, new: InherentType); + /// Get BABE inherent data. + fn babe_inherent_data(&self) -> Result; + /// Replace BABE inherent data. + fn babe_replace_inherent_data(&mut self, new: InherentType); } impl BabeInherentData for InherentData { - fn babe_inherent_data(&self) -> Result { - self.get_data(&INHERENT_IDENTIFIER) - .and_then(|r| r.ok_or_else(|| "BABE inherent data not found".into())) - } + fn babe_inherent_data(&self) -> Result { + self.get_data(&INHERENT_IDENTIFIER) + .and_then(|r| r.ok_or_else(|| "BABE inherent data not found".into())) + } - fn babe_replace_inherent_data(&mut self, new: InherentType) { - self.replace_data(INHERENT_IDENTIFIER, &new); - } + fn babe_replace_inherent_data(&mut self, new: InherentType) { + self.replace_data(INHERENT_IDENTIFIER, &new); + } } /// Provides the slot duration inherent data for BABE. #[cfg(feature = "std")] pub struct InherentDataProvider { - slot_duration: u64, + slot_duration: u64, } #[cfg(feature = "std")] impl InherentDataProvider { - /// Constructs `Self` - pub fn new(slot_duration: u64) -> Self { - Self { slot_duration } - } + /// Constructs `Self` + pub fn new(slot_duration: u64) -> Self { + Self { slot_duration } + } } #[cfg(feature = "std")] impl ProvideInherentData for InherentDataProvider { - fn on_register(&self, providers: &InherentDataProviders) -> Result<(), Error> { - if !providers.has_provider(&sp_timestamp::INHERENT_IDENTIFIER) { - // Add the timestamp inherent data provider, as we require it. - providers.register_provider(sp_timestamp::InherentDataProvider) - } else { - Ok(()) - } - } + fn on_register(&self, providers: &InherentDataProviders) -> Result<(), Error> { + if !providers.has_provider(&sp_timestamp::INHERENT_IDENTIFIER) { + // Add the timestamp inherent data provider, as we require it. + providers.register_provider(sp_timestamp::InherentDataProvider) + } else { + Ok(()) + } + } - fn inherent_identifier(&self) -> &'static InherentIdentifier { - &INHERENT_IDENTIFIER - } + fn inherent_identifier(&self) -> &'static InherentIdentifier { + &INHERENT_IDENTIFIER + } - fn provide_inherent_data(&self, inherent_data: &mut InherentData) -> Result<(), Error> { - let timestamp = inherent_data.timestamp_inherent_data()?; - let slot_number = timestamp / self.slot_duration; - inherent_data.put_data(INHERENT_IDENTIFIER, &slot_number) - } + fn provide_inherent_data(&self, inherent_data: &mut InherentData) -> Result<(), Error> { + let timestamp = inherent_data.timestamp_inherent_data()?; + let slot_number = timestamp / self.slot_duration; + inherent_data.put_data(INHERENT_IDENTIFIER, &slot_number) + } - fn error_to_string(&self, error: &[u8]) -> Option { - Error::decode(&mut &error[..]).map(|e| e.into_string()).ok() - } + fn error_to_string(&self, error: &[u8]) -> Option { + Error::decode(&mut &error[..]).map(|e| e.into_string()).ok() + } } diff --git a/utils/prometheus/README.md b/utils/prometheus/README.md index e5952f1e192c4..f38cb1c8c7a15 100644 --- a/utils/prometheus/README.md +++ b/utils/prometheus/README.md @@ -22,430 +22,6 @@ Start Prometheus Start Grafana - Install Grafana -## Substrate Dev hack -### Prometheus primer - -Here is the entry point of prometheus core module in Parity Substrate. - -In existing sources, refer to the Grafana source due to the issue of the wasm. - -utils/prometheus/src/lib.rs -```rust -#[macro_use] -extern crate lazy_static; -use futures_util::{FutureExt,future::{Future}}; -use hyper::http::StatusCode; -use hyper::Server; -use hyper::{Body, Request, Response, service::{service_fn, make_service_fn}}; -pub use prometheus::{Encoder, HistogramOpts, Opts, TextEncoder}; -pub use prometheus::{Histogram, IntCounter, IntGauge}; -pub use sp_runtime::traits::SaturatedConversion; -use std::net::SocketAddr; - -pub mod metrics; - -#[derive(Debug, derive_more::Display, derive_more::From)] -pub enum Error { - /// Hyper internal error. - Hyper(hyper::Error), - /// Http request error. - Http(hyper::http::Error), - /// i/o error. - Io(std::io::Error) -} -impl std::error::Error for Error { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match self { - Error::Hyper(error) => Some(error), - Error::Http(error) => Some(error), - Error::Io(error) => Some(error) - } - } -} - -async fn request_metrics(req: Request) -> Result, Error> { - if req.uri().path() == "/metrics" { - let metric_families = prometheus::gather(); - let mut buffer = vec![]; - let encoder = TextEncoder::new(); - encoder.encode(&metric_families, &mut buffer).unwrap(); - Response::builder() - .status(StatusCode::OK) - .header("Content-Type", encoder.format_type()) - .body(Body::from(buffer)) - .map_err(Error::Http) - } else { - Response::builder() - .status(StatusCode::NOT_FOUND) - .body(Body::from("Not found.")) - .map_err(Error::Http) - } - -} - -#[derive(Clone)] -pub struct Executor; - -#[cfg(not(target_os = "unknown"))] -impl hyper::rt::Executor for Executor - where - T: Future + Send + 'static, - T::Output: Send + 'static, -{ - fn execute(&self, future: T) { - async_std::task::spawn(future); - } -} -/// Initializes the metrics context, and starts an HTTP server -/// to serve metrics. -#[cfg(not(target_os = "unknown"))] -pub async fn init_prometheus(mut prometheus_addr: SocketAddr) -> Result<(), Error>{ - use async_std::{net, io}; - use grafana_data_source::networking::Incoming; - - let listener = loop { - let listener = net::TcpListener::bind(&prometheus_addr).await; - match listener { - Ok(listener) => { - log::info!("Prometheus server started at {}", prometheus_addr); - break listener - }, - Err(err) => match err.kind() { - io::ErrorKind::AddrInUse | io::ErrorKind::PermissionDenied if prometheus_addr.port() != 0 => { - log::warn!( - "Prometheus server to already {} port.", prometheus_addr.port() - ); - prometheus_addr.set_port(0); - continue; - }, - _ => return Err(err.into()) - } - } - }; - let service = make_service_fn(|_| { - async { - Ok::<_, Error>(service_fn(request_metrics)) - } - }); - - - let _server = Server::builder(Incoming(listener.incoming())) - .executor(Executor) - .serve(service) - .boxed(); - - - let result = _server.await.map_err(Into::into); - - result -} - -#[cfg(target_os = "unknown")] -pub async fn init_prometheus(_: SocketAddr) -> Result<(), Error> { - Ok(()) -} - - -#[macro_export] -macro_rules! prometheus_gauge( - ($($metric:expr => $value:expr),*) => { - use $crate::{metrics::*}; - $( - metrics::set_gauge(&$metric, $value); - )* - } -); - -#[macro_export] -macro_rules! prometheus_histogram( - ($($metric:expr => $value:expr),*) => { - use $crate::{metrics::*}; - $( - metrics::set_histogram(&$metric, $value); - )* - } -); - - -``` - - - -Here is the dependancies of the module. -utils/prometheus/Cargo.toml -```toml -[package] -name = "sc-prometheus" -version = "2.0.0" -authors = ["Parity Technologies "] -description = "prometheus utils" -edition = "2018" - -[dependencies] -hyper = { version = "0.13.1", default-features = false, features = ["stream"] } -lazy_static = "1.4" -log = "0.4.8" -prometheus = { version = "0.7", features = ["nightly", "process"]} -tokio = "0.2" -futures-util = { version = "0.3.1", default-features = false, features = ["io"] } -sp-runtime = { package = "sp-runtime",path = "../../primitives/runtime" } -derive_more = "0.99" - -[target.'cfg(not(target_os = "unknown"))'.dependencies] -async-std = { version = "1.0.1", features = ["unstable"] } -``` - -**Abbreviation of the package in service manager of parity substrate** -client/service/Cargo.toml -```toml -[dependencies] -sc-prometheus = { package = "sc-prometheus", path="../../utils/prometheus"} -``` - -**Metrics builder as same as substrate-telemetry** -client/service/src/builder.rsL1271 , L1112 -```rust -use sc_prometheus::prometheus_gauge; -... - telemetry!( - SUBSTRATE_INFO; - "system.interval"; - "peers" => num_peers, - "height" => best_number, - "best" => ?best_hash, - "txcount" => txpool_status.ready, - "cpu" => cpu_usage, - "memory" => memory, - "finalized_height" => finalized_number, - "finalized_hash" => ?info.chain.finalized_hash, - "bandwidth_download" => bandwidth_download, - "bandwidth_upload" => bandwidth_upload, - "used_state_cache_size" => used_state_cache_size, - ); - prometheus_gauge!( - STATE_CACHE_SIZE => used_state_cache_size as u64, - NODE_MEMORY => memory as u64, - NODE_CPU => cpu_usage as u64, - TX_COUNT => txpool_status.ready as u64, - FINALITY_HEIGHT => finalized_number as u64, - BEST_HEIGHT => best_number as u64, - P2P_PEERS_NUM => num_peers as u64, - P2P_NODE_DOWNLOAD => net_status.average_download_per_sec as u64, - P2P_NODE_UPLOAD => net_status.average_upload_per_sec as u64 - ); - let _ = record_metrics!( - "peers" => num_peers, - "height" => best_number, - "txcount" => txpool_status.ready, - "cpu" => cpu_usage, - "memory" => memory, - "finalized_height" => finalized_number, - "bandwidth_download" => bandwidth_download, - "bandwidth_upload" => bandwidth_upload, - "used_state_cache_size" => used_state_cache_size, - ); - Ok(()) - }).select(exit.clone().map(Ok).compat()).then(|_| Ok(())); - let _ = to_spawn_tx.unbounded_send(Box::new(tel_task)); - -... - // prometheus init - if let Some(port) = config.prometheus_port { - let future = select( - sc_prometheus::init_prometheus(port).boxed() - ,exit.clone() - ).map(|either| match either { - Either::Left((result, _)) => result.map_err(|_| ()), - Either::Right(_) => Ok(()) - }).compat(); - let _ = to_spawn_tx.unbounded_send(Box::new(future)); - } - // Grafana data source - if let Some(port) = config.grafana_port { - let future = select( - grafana_data_source::run_server(port).boxed(), - exit.clone() - ).map(|either| match either { - Either::Left((result, _)) => result.map_err(|_| ()), - Either::Right(_) => Ok(()) - }).compat(); - - let _ = to_spawn_tx.unbounded_send(Box::new(future)); - } - - // Instrumentation - if let Some(tracing_targets) = config.tracing_targets.as_ref() { - let subscriber = sc_tracing::ProfilingSubscriber::new( - config.tracing_receiver, tracing_targets - ); - match tracing::subscriber::set_global_default(subscriber) { - Ok(_) => (), - Err(e) => error!(target: "tracing", "Unable to set global default subscriber {}", e), - } - } - - -``` -substrate/Cargo.toml -```toml -[workspace] -members = [ - "utils/prometheus", -``` -### CLI Config -client/cli/src/lib.rs -```rust -fn crate_run_node_config{ -... - let prometheus_interface: &str = if cli.prometheus_external { "0.0.0.0" } -... - // Override prometheus - if cli.prometheus_external { - config.prometheus_port = Some( - parse_address(&format!("{}:{}", prometheus_interface, 33333), cli.prometheus_port)? - )} -} -``` - -client/cli/src/params.rs -```rust -pub struct RunCmd{ -... - /// Prometheus exporter TCP port. - #[structopt(long = "prometheus-port", value_name = "PORT")] - pub prometheus_port: Option, - /// Prometheus exporter on/off external". - #[structopt(long = "prometheus-external")] - pub prometheus_external: bool, -... -} -``` -client/service/src/config.rs -```rust -#[derive(Clone)] -pub struct Configuration { - ... - /// Prometheus Port.`None` if disabled and port 33333 by default. - pub prometheus_port: Option, - ... -} -impl Configuration where - C: Default, - G: RuntimeGenesis, - E: Extension, -{ - /// Create default config for given chain spec. - pub fn default_with_spec(chain_spec: ChainSpec) -> Self { - let mut configuration = Configuration { - ... - prometheus_prot: None, - ... - }; - configuration.network.boot_nodes = configuration.chain_spec.boot_nodes().to_vec(); - - configuration.telemetry_endpoints = configuration.chain_spec.telemetry_endpoints().clone(); - - configuration - } -``` - - - -### Metrics Add -ex) consensus_FINALITY_HEIGHT - -utils/prometheus/src/metrics.rs - -```rust -pub use crate::*; - -/// Gauge type metrics generation function -pub fn try_create_int_gauge(name: &str, help: &str) -> Result { - let opts = Opts::new(name, help); - let gauge = IntGauge::with_opts(opts)?; - prometheus::register(Box::new(gauge.clone()))?; - Ok(gauge) -} - -///Gauge Metrics a value in injection. -pub fn set_gauge(gauge: &Result, value: u64) { - if let Ok(gauge) = gauge { - gauge.set(value as i64); - } -} - -///All of the metrics in the prometheus are managed by the lazy_static. -lazy_static! { - pub static ref FINALITY_HEIGHT: Result = try_create_int_gauge( - "consensus_finality_block_height_number", - "block is finality HEIGHT" - ); -} -``` -client/service/Cargo.toml -```rust -... -sc-prometheus = { package = "sc-prometheus", path="../../utils/prometheus"} -... -``` -client/service/src/builder.rs -```rust -..... -use sc-prometheus::{prometheus_gauge}; -..... - let tel_task = state_rx.for_each(move |(net_status, _)| { - let info = client_.info(); - let best_number = info.chain.best_number.saturated_into::(); - let best_hash = info.chain.best_hash; - let num_peers = net_status.num_connected_peers; - let txpool_status = transaction_pool_.status(); - let finalized_number: u64 = info.chain.finalized_number.saturated_into::(); - let bandwidth_download = net_status.average_download_per_sec; - let bandwidth_upload = net_status.average_upload_per_sec; - - let used_state_cache_size = match info.used_state_cache_size { - Some(size) => size, - None => 0, - }; - - // get cpu usage and memory usage of this process - let (cpu_usage, memory) = if let Some(self_pid) = self_pid { - if sys.refresh_process(self_pid) { - let proc = sys.get_process(self_pid) - .expect("Above refresh_process succeeds, this should be Some(), qed"); - (proc.cpu_usage(), proc.memory()) - } else { (0.0, 0) } - } else { (0.0, 0) }; - - telemetry!( - SUBSTRATE_INFO; - "system.interval"; - "peers" => num_peers, - "height" => best_number, - "best" => ?best_hash, - "txcount" => txpool_status.ready, - "cpu" => cpu_usage, - "memory" => memory, - "finalized_height" => finalized_number, - "finalized_hash" => ?info.chain.finalized_hash, - "bandwidth_download" => bandwidth_download, - "bandwidth_upload" => bandwidth_upload, - "used_state_cache_size" => used_state_cache_size, - ); - - prometheus_gauge!( - STATE_CACHE_SIZE => used_state_cache_size as u64, - NODE_MEMORY => memory as u64, - NODE_CPU => cpu_usage as u64, - TX_COUNT => txpool_status.ready as u64, - FINALITY_HEIGHT => finalized_number as u64, - BEST_HEIGHT => best_number as u64, - P2P_PEERS_NUM => num_peers as u64, - P2P_NODE_DOWNLOAD => net_status.average_download_per_sec as u64, - P2P_NODE_UPLOAD => net_status.average_upload_per_sec as u64 - ); -..... -``` ## Metrics substrate can report and serve the Prometheus metrics, which in their turn can be consumed by Prometheus collector(s). diff --git a/utils/prometheus/photo_2019-12-13_16-32-53.jpg b/utils/prometheus/photo_2019-12-13_16-32-53.jpg new file mode 100644 index 0000000000000000000000000000000000000000..cdf44f88fb623d7b5a319235c6d603463698716c GIT binary patch literal 27726 zcmeFZcT`m0wkEoDJ3nV{7^+zOM;&BO;@slT%XD z(lg$@&-|44IsZ#R;n$*y%Bt$`HMMp1ZS5VMUEMvsKZi#~$Hpfnr>2*dS60{7H#WDn z(T7LJC#PqaKj(k5ivVxuzaIZ$*gx4tgSYD%At8tm{5QJ@u6g4Jh=!2p=6zyXrKjMR zu5`CVf=TEfBz-LZLCPii48>sSHblnAEw;pi{+nrkx9mS=Sjhh;%l?O9|7O=TKmj7a z-#icv00qv@`91}a{WbntgTFBF7Y6>qz+V{n3j=>);4cjPg@L~?@V^fOcdL)%D8o7m z6+NQfYu6G^gu-l2qdlj2yR+$c()IQ4cPpltf()(0YbPjhIc@YZY7eh#32s`4KgPi&q)`=tn2 zr%VSyRGw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[PATCH 11/42] Re-fix spaces in primitives/consensus/babe/src/inherents.rs --- primitives/consensus/babe/src/inherents.rs | 70 +++++++++++----------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/primitives/consensus/babe/src/inherents.rs b/primitives/consensus/babe/src/inherents.rs index 5a4e042352dcb..4fe71dbb8a7c4 100644 --- a/primitives/consensus/babe/src/inherents.rs +++ b/primitives/consensus/babe/src/inherents.rs @@ -32,59 +32,59 @@ pub const INHERENT_IDENTIFIER: InherentIdentifier = *b"babeslot"; pub type InherentType = u64; /// Auxiliary trait to extract BABE inherent data. pub trait BabeInherentData { - /// Get BABE inherent data. - fn babe_inherent_data(&self) -> Result; - /// Replace BABE inherent data. - fn babe_replace_inherent_data(&mut self, new: InherentType); + /// Get BABE inherent data. + fn babe_inherent_data(&self) -> Result; + /// Replace BABE inherent data. + fn babe_replace_inherent_data(&mut self, new: InherentType); } impl BabeInherentData for InherentData { - fn babe_inherent_data(&self) -> Result { - self.get_data(&INHERENT_IDENTIFIER) - .and_then(|r| r.ok_or_else(|| "BABE inherent data not found".into())) - } + fn babe_inherent_data(&self) -> Result { + self.get_data(&INHERENT_IDENTIFIER) + .and_then(|r| r.ok_or_else(|| "BABE inherent data not found".into())) + } - fn babe_replace_inherent_data(&mut self, new: InherentType) { - self.replace_data(INHERENT_IDENTIFIER, &new); - } + fn babe_replace_inherent_data(&mut self, new: InherentType) { + self.replace_data(INHERENT_IDENTIFIER, &new); + } } /// Provides the slot duration inherent data for BABE. #[cfg(feature = "std")] pub struct InherentDataProvider { - slot_duration: u64, + slot_duration: u64, } #[cfg(feature = "std")] impl InherentDataProvider { - /// Constructs `Self` - pub fn new(slot_duration: u64) -> Self { - Self { slot_duration } - } + /// Constructs `Self` + pub fn new(slot_duration: u64) -> Self { + Self { slot_duration } + } } #[cfg(feature = "std")] impl ProvideInherentData for InherentDataProvider { - fn on_register(&self, providers: &InherentDataProviders) -> Result<(), Error> { - if !providers.has_provider(&sp_timestamp::INHERENT_IDENTIFIER) { - // Add the timestamp inherent data provider, as we require it. - providers.register_provider(sp_timestamp::InherentDataProvider) - } else { - Ok(()) - } - } + fn on_register(&self, providers: &InherentDataProviders) -> Result<(), Error> { + if !providers.has_provider(&sp_timestamp::INHERENT_IDENTIFIER) { + // Add the timestamp inherent data provider, as we require it. + providers.register_provider(sp_timestamp::InherentDataProvider) + } else { + Ok(()) + } + } - fn inherent_identifier(&self) -> &'static InherentIdentifier { - &INHERENT_IDENTIFIER - } + fn inherent_identifier(&self) -> &'static InherentIdentifier { + &INHERENT_IDENTIFIER + } - fn provide_inherent_data(&self, inherent_data: &mut InherentData) -> Result<(), Error> { - let timestamp = inherent_data.timestamp_inherent_data()?; - let slot_number = timestamp / self.slot_duration; - inherent_data.put_data(INHERENT_IDENTIFIER, &slot_number) - } + fn provide_inherent_data(&self, inherent_data: &mut InherentData) -> Result<(), Error> { + let timestamp = inherent_data.timestamp_inherent_data()?; + let slot_number = timestamp / self.slot_duration; + inherent_data.put_data(INHERENT_IDENTIFIER, &slot_number) + } - fn error_to_string(&self, error: &[u8]) -> Option { - Error::decode(&mut &error[..]).map(|e| e.into_string()).ok() - } + fn error_to_string(&self, error: &[u8]) -> Option { + Error::decode(&mut &error[..]).map(|e| e.into_string()).ok() + } } From 7d9d341ebbb4ec6458b8731565666f1e8dd10f87 Mon Sep 17 00:00:00 2001 From: nodebreaker-carlsagan Date: Thu, 28 Nov 2019 18:19:01 +0900 Subject: [PATCH 12/42] Refactor rebase master prometheus_v0.3 --- Cargo.lock | 2 +- Cargo.toml | 1 + client/Cargo.toml | 1 + client/cli/Cargo.toml | 1 + client/cli/src/informant/display.rs | 7 +- client/cli/src/lib.rs | 8 +- client/cli/src/params.rs | 6 + client/prometheus/Cargo.toml | 16 ++ client/prometheus/README.md | 430 ++++++++++++++++++++++++++++ client/prometheus/src/lib.rs | 89 ++++++ client/prometheus/src/metrics.rs | 78 +++++ client/service/Cargo.toml | 1 + client/service/src/builder.rs | 20 +- client/service/src/config.rs | 3 + client/service/src/lib.rs | 2 - client/service/test/src/lib.rs | 1 + 16 files changed, 658 insertions(+), 8 deletions(-) create mode 100644 client/prometheus/Cargo.toml create mode 100644 client/prometheus/README.md create mode 100644 client/prometheus/src/lib.rs create mode 100644 client/prometheus/src/metrics.rs diff --git a/Cargo.lock b/Cargo.lock index 82f43ac5d54f5..7c16aef33eb33 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8813,4 +8813,4 @@ dependencies = [ "checksum zeroize_derive 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "de251eec69fc7c1bc3923403d18ececb929380e016afe103da75f396704f8ca2" "checksum zstd 0.5.1+zstd.1.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "5c5d978b793ae64375b80baf652919b148f6a496ac8802922d9999f5a553194f" "checksum zstd-safe 2.0.3+zstd.1.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "bee25eac9753cfedd48133fa1736cbd23b774e253d89badbeac7d12b23848d3f" -"checksum zstd-sys 1.4.15+zstd.1.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "89719b034dc22d240d5b407fb0a3fe6d29952c181cff9a9f95c0bd40b4f8f7d8" +"checksum zstd-sys 1.4.15+zstd.1.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "89719b034dc22d240d5b407fb0a3fe6d29952c181cff9a9f95c0bd40b4f8f7d8" \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml index f6e521b9c5dbb..9a468a160abdc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -45,6 +45,7 @@ members = [ "client/service", "client/service/test", "client/state-db", + "client/prometheus", "client/telemetry", "client/transaction-pool", "client/transaction-pool/graph", diff --git a/client/Cargo.toml b/client/Cargo.toml index eaddd9f3dcfe6..736444ad14f89 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -31,6 +31,7 @@ sp-state-machine = { version = "2.0.0", path = "../primitives/state-machine" } sc-telemetry = { version = "2.0.0", path = "telemetry" } sp-trie = { version = "2.0.0", path = "../primitives/trie" } tracing = "0.1.10" +sc-prometheus = { path = "prometheus" } [dev-dependencies] env_logger = "0.7.0" diff --git a/client/cli/Cargo.toml b/client/cli/Cargo.toml index 460cc2a05a32e..6dca93855d0a8 100644 --- a/client/cli/Cargo.toml +++ b/client/cli/Cargo.toml @@ -29,6 +29,7 @@ sp-core = { version = "2.0.0", path = "../../primitives/core" } sc-service = { version = "2.0.0", default-features = false, path = "../service" } sp-state-machine = { version = "2.0.0", path = "../../primitives/state-machine" } sc-telemetry = { version = "2.0.0", path = "../telemetry" } +sc-prometheus = { path = "../prometheus" } sp-keyring = { version = "2.0.0", path = "../../primitives/keyring" } names = "0.11.0" structopt = "=0.3.7" diff --git a/client/cli/src/informant/display.rs b/client/cli/src/informant/display.rs index 199635e7c7883..e34f5e53dfdad 100644 --- a/client/cli/src/informant/display.rs +++ b/client/cli/src/informant/display.rs @@ -21,7 +21,7 @@ use sc_network::SyncState; use sp_runtime::traits::{Block as BlockT, CheckedDiv, NumberFor, Zero, Saturating}; use sc_service::NetworkStatus; use std::{convert::{TryFrom, TryInto}, fmt, time}; - +use sc_prometheus::prometheus_gauge; /// State of the informant display system. /// /// This is the system that handles the line that gets regularly printed and that looks something @@ -63,7 +63,10 @@ impl InformantDisplay { let (status, target) = match (net_status.sync_state, net_status.best_seen_block) { (SyncState::Idle, _) => ("Idle".into(), "".into()), (SyncState::Downloading, None) => (format!("Syncing{}", speed), "".into()), - (SyncState::Downloading, Some(n)) => (format!("Syncing{}", speed), format!(", target=#{}", n)), + (SyncState::Downloading, Some(n)) => { + prometheus_gauge!(TARGET_NUM => n.saturated_into().try_into().unwrap()); + (format!("Syncing{}", speed), format!(", target=#{}", n)) + } }; info!( diff --git a/client/cli/src/lib.rs b/client/cli/src/lib.rs index 620a90c514d00..62ad776dd7fae 100644 --- a/client/cli/src/lib.rs +++ b/client/cli/src/lib.rs @@ -952,7 +952,13 @@ where config.tracing_targets = cli.tracing_targets.into(); config.tracing_receiver = cli.tracing_receiver.into(); - + + match cli.prometheus_endpoint { + None => {config.prometheus_endpoint = None;}, + Some(x) => { + config.prometheus_endpoint = Some(parse_address(&format!("{}:{}", x, 33333), cli.prometheus_port)?); + } + } // Imply forced authoring on --dev config.force_authoring = cli.shared_params.dev || cli.force_authoring; diff --git a/client/cli/src/params.rs b/client/cli/src/params.rs index 07fbe9b73885c..44c7cffffb4d1 100644 --- a/client/cli/src/params.rs +++ b/client/cli/src/params.rs @@ -440,6 +440,12 @@ pub struct RunCmd { /// Use `--unsafe-ws-external` to suppress the warning if you understand the risks. #[structopt(long = "ws-external")] pub ws_external: bool, + /// Prometheus exporter TCP port. + #[structopt(long = "prometheus-port", value_name = "PORT")] + pub prometheus_port: Option, + /// Prometheus exporter IP addr. + #[structopt(long = "prometheus-addr", value_name = "Local IP address")] + pub prometheus_endpoint: Option, /// Listen to all Websocket interfaces. /// diff --git a/client/prometheus/Cargo.toml b/client/prometheus/Cargo.toml new file mode 100644 index 0000000000000..29d81c9e5fda8 --- /dev/null +++ b/client/prometheus/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "sc-prometheus" +version = "2.0.0" +authors = ["Parity Technologies "] +description = "prometheus utils" +edition = "2018" + +[dependencies] +hyper = "0.12" +lazy_static = "1.0" +log = "0.4" +prometheus = { version = "0.7", features = ["nightly", "process"]} +tokio = "0.1" + +[dev-dependencies] +reqwest = "0.9" \ No newline at end of file diff --git a/client/prometheus/README.md b/client/prometheus/README.md new file mode 100644 index 0000000000000..ced9730696e27 --- /dev/null +++ b/client/prometheus/README.md @@ -0,0 +1,430 @@ +# Substrate Prometheus Node Exporter + +## Introduction + +Prometheus is one of the most widely used monitoring tool for managing high availability services supported by [Cloud Native Computing Foundation](https://www.cncf.io/). By providing Prometheus exporter in substrate, node operators can easily adopt widely used display/alert tool such as Grafana without seting-up/operating external Prometheus agent through RPC connections. Easy access to such monitoring tools will benefit parachain develepers/operators and validators to have much higher availability quality of their services. + +## List of Contents + +Hack Prometheus in Substrate + - Prometheus starter + - CLI Config + - Metrics Add + +Metrics + - List of available metrics + +Start Prometheus + - Install prometheus + - Edit Prometheus config file + - Start Prometheus + +Start Grafana + - Install Grafana + +## Substrate Dev hack +### Prometheus starter + +Here is the entry point of prometheus core module in Parity Substrate. + +client/prometheus/src/lib.rs +```rust +#[macro_use] +extern crate lazy_static; +#[macro_use] +extern crate log; +use hyper::http::StatusCode; +use hyper::rt::Future; +use hyper::service::service_fn_ok; +use hyper::{Body, Request, Response, Server}; +pub use prometheus::{Encoder, HistogramOpts, Opts, TextEncoder}; +pub use prometheus::{Histogram, IntCounter, IntGauge, Result}; +pub use sr_primitives::traits::SaturatedConversion; +use std::net::SocketAddr; + +pub mod metrics; + +/// Initializes the metrics context, and starts an HTTP server +/// to serve metrics. +pub fn init_prometheus(prometheus_addr: SocketAddr) { + let addr = prometheus_addr; + let server = Server::bind(&addr) + .serve(|| { + // This is the `Service` that will handle the connection. + // `service_fn_ok` is a helper to convert a function that + // returns a Response into a `Service`. + service_fn_ok(move |req: Request| { + if req.uri().path() == "/metrics" { + let metric_families = prometheus::gather(); + let mut buffer = vec![]; + let encoder = TextEncoder::new(); + encoder.encode(&metric_families, &mut buffer).unwrap(); + Response::builder() + .status(StatusCode::OK) + .header("Content-Type", encoder.format_type()) + .body(Body::from(buffer)) + .expect("Sends OK(200) response with one or more data metrics") + } else { + Response::builder() + .status(StatusCode::NOT_FOUND) + .body(Body::from("Not found.")) + .expect("Sends NOT_FOUND(404) message with no data metric") + } + }) + }) + .map_err(|e| error!("server error: {}", e)); + + info!("Exporting metrics at http://{}/metrics", addr); + + let mut rt = tokio::runtime::Builder::new() + .core_threads(1) // one thread is sufficient + .build() + .expect("Builds one thread of tokio runtime exporter for prometheus"); + + std::thread::spawn(move || { + rt.spawn(server); + rt.shutdown_on_idle().wait().unwrap(); + }); +} + +#[macro_export] +macro_rules! prometheus_gauge( + ($($metric:expr => $value:expr),*) => { + use $crate::{metrics::*}; + $( + metrics::set_gauge(&$metric, $value); + )* + } +); + +#[macro_export] +macro_rules! prometheus_histogram( + ($($metric:expr => $value:expr),*) => { + use $crate::{metrics::*}; + $( + metrics::set_histogram(&$metric, $value); + )* + } +); + +#[macro_export] +macro_rules! prometheus_counter( + ($($metric:expr => $value:expr),*) => { + use $crate::{metrics::*}; + $( + metrics::set_counter(&$metric, $value); + )* + } +); + +/* +TODO: Make abstract type for all metrics(e.g. Gauge, Histogram, Counter) with generic traits so that all metrics can be set up with one function `set` +#[macro_export] +macro_rules! prometheus( + ($($a: expr; $metric:expr => $value:expr),*) => { + use $crate::{metrics::*}; + $( + metrics::set(#$a, &$metric, $value); + )* + } +); +*/ +``` + +Here is the dependancies of the module. +client/prometheus/Cargo.toml +```toml +[package] +name = "substrate-prometheus" +version = "2.0.0" +authors = ["Parity Technologies "] +description = "prometheus utils" +edition = "2018" + +[dependencies] +hyper = "0.12" +lazy_static = "1.0" +log = "0.4" +prometheus = { version = "0.7", features = ["nightly", "process"]} +tokio = "0.1" + +[dev-dependencies] +reqwest = "0.9" +``` + +**Abbreviation of the package in service manager of parity substrate** +client/service/Cargo.toml +```toml +.... +promet = { package = "substrate-prometheus", path="../../core/prometheus"} +.... +``` + +**Metrics builder as same as substrate-telemetry** +client/service/src/builder.rs +```rust + + ..... + let _ = to_spawn_tx.unbounded_send(Box::new(future + .select(exit.clone()) + .then(|_| Ok(())))); + telemetry + }); +---------------- +match config.prometheus_endpoint { + None => (), + Some(x) => {let _prometheus = promet::init_prometheus(x);} + } + +------------------- + Ok(NewService { + client, + network, + ..... +``` +substrate/Cargo.toml +```toml + .... +[workspace] +members = [ + "client/prometheus", + .... +``` +### CLI Config +client/cli/src/lib.rs +```rust +fn crate_run_node_config +... +} + + match cli.prometheus_endpoint { + None => {config.prometheus_endpoint = None;}, + Some(x) => { + config.prometheus_endpoint = Some(parse_address(&format!("{}:{}", x, 33333), cli.prometheus_port)?); + } + } +... + +``` + +client/cli/src/params.rs +```rust +pub struct RunCmd{ +/// Specify HTTP RPC server TCP port. +#[structopt(long = "prometheus-port", value_name = "PORT")] + pub prometheus_port: Option, +#[structopt(long = "prometheus-addr", value_name = "Local IP address")] + pub prometheus_endpoint: Option, +} +``` +client/service/src/config.rs +```rust +#[derive(Clone)] +pub struct Configuration { + ... + pub prometheus_endpoint: Option, + ... +} +impl Configuration where + C: Default, + G: RuntimeGenesis, + E: Extension, +{ + /// Create default config for given chain spec. + pub fn default_with_spec(chain_spec: ChainSpec) -> Self { + let mut configuration = Configuration { + ... + prometheus_endpoints: None, + ... + }; + configuration.network.boot_nodes = configuration.chain_spec.boot_nodes().to_vec(); + + configuration.telemetry_endpoints = configuration.chain_spec.telemetry_endpoints().clone(); + + configuration + } +``` + + + +### Metrics Add +ex) consensus_FINALITY_HEIGHT + +client/prometheus/src/metrics.rs + +```rust +pub use crate::*; + +pub fn try_create_int_gauge(name: &str, help: &str) -> Result { + let opts = Opts::new(name, help); + let gauge = IntGauge::with_opts(opts)?; + prometheus::register(Box::new(gauge.clone()))?; + Ok(gauge) +} + +pub fn set_gauge(gauge: &Result, value: u64) { + if let Ok(gauge) = gauge { + gauge.set(value as i64); + } +} + +lazy_static! { + pub static ref FINALITY_HEIGHT: Result = try_create_int_gauge( + "consensus_finality_block_height_number", + "block is finality HEIGHT" + + ); +} +``` +client/service/Cargo.toml +```rust +... +promet = { package = "substrate-prometheus", path="../prometheus"} +... +``` +client/service/src/builder.rs +```rust +..... +use promet::{prometheus_gauge}; +..... + let tel_task = state_rx.for_each(move |(net_status, _)| { + let info = client_.info(); + let best_number = info.chain.best_number.saturated_into::(); + let best_hash = info.chain.best_hash; + let num_peers = net_status.num_connected_peers; + let txpool_status = transaction_pool_.status(); + let finalized_number: u64 = info.chain.finalized_number.saturated_into::(); + let bandwidth_download = net_status.average_download_per_sec; + let bandwidth_upload = net_status.average_upload_per_sec; + + let used_state_cache_size = match info.used_state_cache_size { + Some(size) => size, + None => 0, + }; + + // get cpu usage and memory usage of this process + let (cpu_usage, memory) = if let Some(self_pid) = self_pid { + if sys.refresh_process(self_pid) { + let proc = sys.get_process(self_pid) + .expect("Above refresh_process succeeds, this should be Some(), qed"); + (proc.cpu_usage(), proc.memory()) + } else { (0.0, 0) } + } else { (0.0, 0) }; + + telemetry!( + SUBSTRATE_INFO; + "system.interval"; + "peers" => num_peers, + "height" => best_number, + "best" => ?best_hash, + "txcount" => txpool_status.ready, + "cpu" => cpu_usage, + "memory" => memory, + "finalized_height" => finalized_number, + "finalized_hash" => ?info.chain.finalized_hash, + "bandwidth_download" => bandwidth_download, + "bandwidth_upload" => bandwidth_upload, + "used_state_cache_size" => used_state_cache_size, + ); + + prometheus_gauge!( + MEMPOOL_SIZE => used_state_cache_size as u64, + NODE_MEMORY => memory as u64, + NODE_CPU => cpu_usage as u64, + TX_COUNT => txpool_status.ready as u64, + FINALITY_HEIGHT => finalized_number as u64, + BEST_HEIGHT => best_number as u64, + P2P_PEERS_NUM => num_peers as u64, + P2P_NODE_DOWNLOAD => net_status.average_download_per_sec as u64, + P2P_NODE_UPLOAD => net_status.average_upload_per_sec as u64 + ); +..... +``` +## Metrics + +substrate can report and serve the Prometheus metrics, which in their turn can be consumed by Prometheus collector(s). + +This functionality is disabled by default. + +To enable the Prometheus metrics, set in your cli command (--prometheus-addr,--prometheus-port ). +Metrics will be served under /metrics on 33333 port by default. + +### List of available metrics + + +Consensus metrics, namespace: `substrate` + +| **Name** | **Type** | **Tags** | **Description** | +| -------------------------------------- | --------- | -------- | --------------------------------------------------------------- | +| consensus_finality_block_height_number | IntGauge | | finality Height of the chain | +| consensus_best_block_height_number | IntGauge | | best Height of the chain | +| consensus_target_syn_number | IntGauge | | syning Height target number | +| consensus_block_interval_seconds | Histogram | | Time between this and last block (Block.Header.Time) in seconds | +| consensus_num_txs | Gauge | | Number of transactions | +| consensus_node_memory | IntGauge | | Node's primary memory | +| consensus_node_cpu | IntGauge | | Node's cpu load | +| p2p_peers_number | IntGauge | | Number of peers node's connected to | +| p2p_peer_receive_bytes_per_sec | IntGauge | | number of bytes received from a given peer | +| p2p_peer_send_bytes_per_sec | IntGauge | | number of bytes sent to a given peer | +| mempool_size | IntGauge | | Number of uncommitted transactions | + + +## Start Prometheus +### Install prometheus + +https://prometheus.io/download/ +```bash +wget +tar -zxvf +``` + +### Edit Prometheus config file + +You can visit [prometheus.yml](https://github.com/prometheus/prometheus/blob/master/documentation/examples/prometheus.yml) to download default `prometheus.yml`. + +Then edit `prometheus.yml` and add `jobs` : + +```yaml + - job_name: kusama + static_configs: + - targets: ['localhost:33333'] + labels: + instance: local-validator +``` + +> Note:value of targets is ip:port which used by substrate monitor + +### Start Prometheus + +```bash +cd +./prometheus +``` + +> The above example, you can save `prometheus.yml` at `~/volumes/prometheus` on your host machine + +You can visit `http://localhost:9090` to see prometheus data. + + + +## Start Grafana +### Install Grafana +https://grafana.com/docs/installation/debian/ + +```bash +apt-get install -y software-properties-common +sudo add-apt-repository "deb https://packages.grafana.com/oss/deb stable main" +wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add - +sudo apt-get update +sudo apt-get install grafana +sudo service grafana-server start +./prometheus +``` + +You can visit `http://localhost:3000/` to open grafana and create your own dashboard. + +> Tips: The default username and password are both admin. We strongly recommend immediately changing your username & password after login + +### Seting Grafana + +Default ID:PW is admin. \ No newline at end of file diff --git a/client/prometheus/src/lib.rs b/client/prometheus/src/lib.rs new file mode 100644 index 0000000000000..c3db7e2d15763 --- /dev/null +++ b/client/prometheus/src/lib.rs @@ -0,0 +1,89 @@ +#[macro_use] +extern crate lazy_static; +#[macro_use] +extern crate log; +use hyper::http::StatusCode; +use hyper::rt::Future; +use hyper::service::service_fn_ok; +use hyper::{Body, Request, Response, Server}; +pub use prometheus::{Encoder, HistogramOpts, Opts, TextEncoder}; +pub use prometheus::{Histogram, IntCounter, IntGauge, Result}; +use std::net::SocketAddr; + +pub mod metrics; + +/// Initializes the metrics context, and starts an HTTP server +/// to serve metrics. +pub fn init_prometheus(prometheus_addr: SocketAddr) { + let addr = prometheus_addr; + let server = Server::bind(&addr) + .serve(|| { + // This is the `Service` that will handle the connection. + // `service_fn_ok` is a helper to convert a function that + // returns a Response into a `Service`. + service_fn_ok(move |req: Request| { + if req.uri().path() == "/metrics" { + let metric_families = prometheus::gather(); + let mut buffer = vec![]; + let encoder = TextEncoder::new(); + encoder.encode(&metric_families, &mut buffer).unwrap(); + Response::builder() + .status(StatusCode::OK) + .header("Content-Type", encoder.format_type()) + .body(Body::from(buffer)) + .expect("Sends OK(200) response with one or more data metrics") + } else { + Response::builder() + .status(StatusCode::NOT_FOUND) + .body(Body::from("Not found.")) + .expect("Sends NOT_FOUND(404) message with no data metric") + } + }) + }) + .map_err(|e| error!("server error: {}", e)); + + info!("Exporting metrics at http://{}/metrics", addr); + + let mut rt = tokio::runtime::Builder::new() + .core_threads(1) // one thread is sufficient + .build() + .expect("Builds one thread of tokio runtime exporter for prometheus"); + + std::thread::spawn(move || { + rt.spawn(server); + rt.shutdown_on_idle().wait().unwrap(); + }); +} + +#[macro_export] +macro_rules! prometheus_gauge( + ($($metric:expr => $value:expr),*) => { + use $crate::{metrics::*}; + $( + metrics::set_gauge(&$metric, $value); + )* + } +); + +#[macro_export] +macro_rules! prometheus_histogram( + ($($metric:expr => $value:expr),*) => { + use $crate::{metrics::*}; + $( + metrics::set_histogram(&$metric, $value); + )* + } +); + +/* +TODO: Make abstract type for all metrics(e.g. Gauge, Histogram, Counter) with generic traits so that all metrics can be set up with one function `set` +#[macro_export] +macro_rules! prometheus( + ($($a: expr; $metric:expr => $value:expr),*) => { + use $crate::{metrics::*}; + $( + metrics::set(#$a, &$metric, $value); + )* + } +); +*/ \ No newline at end of file diff --git a/client/prometheus/src/metrics.rs b/client/prometheus/src/metrics.rs new file mode 100644 index 0000000000000..a2621c3354aea --- /dev/null +++ b/client/prometheus/src/metrics.rs @@ -0,0 +1,78 @@ +pub use crate::*; + +/// Gauge type metrics generation function +pub fn try_create_int_gauge(name: &str, help: &str) -> Result { + let opts = Opts::new(name, help); + let gauge = IntGauge::with_opts(opts)?; + prometheus::register(Box::new(gauge.clone()))?; + Ok(gauge) +} +/// histogram type metrics generation function +pub fn try_create_histogram(name: &str, help: &str) -> Result { + let opts = HistogramOpts::new(name, help); + let histogram = Histogram::with_opts(opts)?; + prometheus::register(Box::new(histogram.clone()))?; + Ok(histogram) +} + +///Gauge Metrics a value in injection. +pub fn set_gauge(gauge: &Result, value: u64) { + if let Ok(gauge) = gauge { + gauge.set(value as i64); + } +} +///histogram Metrics a value in injection. +pub fn set_histogram(histogram: &Result, value: f64) { + if let Ok(histogram) = histogram { + histogram.observe(value) + } +} +///All of the metrics in the prometheus are managed by the lazy_static. +lazy_static! { + pub static ref FINALITY_HEIGHT: Result = try_create_int_gauge( + "consensus_finality_block_height_number", + "block is finality HEIGHT" + + ); + pub static ref BEST_HEIGHT: Result = try_create_int_gauge( + "consensus_best_block_height_number", + "block is best HEIGHT" + ); + + pub static ref BLOCK_INTERVAL_SECONDS: Result = try_create_histogram( + "consensus_block_interval_seconds", + "Time between this and last block(Block.Header.Time) in seconds" + ); + pub static ref P2P_PEERS_NUM: Result = try_create_int_gauge( + "p2p_peers_number", + "network gosip peers number" + ); + pub static ref TARGET_NUM: Result = try_create_int_gauge( + "consensus_target_syn_number", + "block syn target number" + ); + pub static ref TX_COUNT: Result = try_create_int_gauge( + "consensus_num_txs", + "Number of transactions" + ); + pub static ref NODE_MEMORY: Result = try_create_int_gauge( + "consensus_node_memory", + "node memory" + ); + pub static ref NODE_CPU: Result = try_create_int_gauge( + "consensus_node_cpu", + "node cpu" + ); + pub static ref MEMPOOL_SIZE: Result = try_create_int_gauge( + "mempool_size", + "Number of uncommitted transactions" + ); + pub static ref P2P_NODE_DOWNLOAD: Result = try_create_int_gauge( + "p2p_peer_receive_byte_per_sec", + "p2p_node_download_per_sec_byte" + ); + pub static ref P2P_NODE_UPLOAD: Result = try_create_int_gauge( + "p2p_peer_send_byte_per_sec", + "p2p_node_upload_per_sec_byte" + ); +} \ No newline at end of file diff --git a/client/service/Cargo.toml b/client/service/Cargo.toml index ce27b0995c5ef..8b1a4e9b5241a 100644 --- a/client/service/Cargo.toml +++ b/client/service/Cargo.toml @@ -54,6 +54,7 @@ parity-multiaddr = { package = "parity-multiaddr", version = "0.5.0" } grafana-data-source = { version = "2.0.0", path = "../../utils/grafana-data-source" } sc-tracing = { version = "2.0.0", path = "../tracing" } tracing = "0.1.10" +promet = { package = "sc-prometheus", path="../prometheus"} [dev-dependencies] substrate-test-runtime-client = { version = "2.0.0", path = "../../test-utils/runtime/client" } diff --git a/client/service/src/builder.rs b/client/service/src/builder.rs index 0160da9bbed8d..57b78bd4c0d02 100644 --- a/client/service/src/builder.rs +++ b/client/service/src/builder.rs @@ -51,7 +51,7 @@ use std::{ }; use sysinfo::{get_current_pid, ProcessExt, System, SystemExt}; use sc_telemetry::{telemetry, SUBSTRATE_INFO}; -use sp_transaction_pool::{TransactionPool, TransactionPoolMaintainer}; +use promet::prometheus_gauge; use sp_blockchain; use grafana_data_source::{self, record_metrics}; @@ -975,6 +975,17 @@ ServiceBuilder< "disk_read_per_sec" => info.usage.as_ref().map(|usage| usage.io.bytes_read).unwrap_or(0), "disk_write_per_sec" => info.usage.as_ref().map(|usage| usage.io.bytes_written).unwrap_or(0), ); + prometheus_gauge!( + MEMPOOL_SIZE => used_state_cache_size as u64, + NODE_MEMORY => memory as u64, + NODE_CPU => cpu_usage as u64, + TX_COUNT => txpool_status.ready as u64, + FINALITY_HEIGHT => finalized_number as u64, + BEST_HEIGHT => best_number as u64, + P2P_PEERS_NUM => num_peers as u64, + P2P_NODE_DOWNLOAD => net_status.average_download_per_sec as u64, + P2P_NODE_UPLOAD => net_status.average_upload_per_sec as u64 + ); let _ = record_metrics!( "peers" => num_peers, "height" => best_number, @@ -1126,7 +1137,12 @@ ServiceBuilder< .then(|_| Ok(())))); telemetry }); - + match config.prometheus_endpoint { + None => (), + Some(x) => { + let _prometheus = promet::init_prometheus(x); + } + } // Grafana data source if let Some(port) = config.grafana_port { let future = select( diff --git a/client/service/src/config.rs b/client/service/src/config.rs index 75c626821479d..51ce76368dd6f 100644 --- a/client/service/src/config.rs +++ b/client/service/src/config.rs @@ -75,6 +75,8 @@ pub struct Configuration { pub rpc_cors: Option>, /// Grafana data source http port. `None` if disabled. pub grafana_port: Option, + + pub prometheus_endpoint: Option, /// Telemetry service URL. `None` if disabled. pub telemetry_endpoints: Option, /// External WASM transport for the telemetry. If `Some`, when connection to a telemetry @@ -177,6 +179,7 @@ impl Configuration where rpc_ws: None, rpc_ws_max_connections: None, rpc_cors: Some(vec![]), + prometheus_endpoint: None, grafana_port: None, telemetry_endpoints: None, telemetry_external_transport: None, diff --git a/client/service/src/lib.rs b/client/service/src/lib.rs index 7a3c6fc9eaab3..aeeef1ecaedb3 100644 --- a/client/service/src/lib.rs +++ b/client/service/src/lib.rs @@ -17,8 +17,6 @@ //! Substrate service. Starts a thread that spins up the network, client, and extrinsic pool. //! Manages communication between them. -#![warn(missing_docs)] - pub mod config; #[macro_use] pub mod chain_ops; diff --git a/client/service/test/src/lib.rs b/client/service/test/src/lib.rs index 06a1edd189a29..5092ec1cf8295 100644 --- a/client/service/test/src/lib.rs +++ b/client/service/test/src/lib.rs @@ -194,6 +194,7 @@ fn node_config ( rpc_ws: None, rpc_ws_max_connections: None, rpc_cors: None, + prometheus_endpoint: None, grafana_port: None, telemetry_endpoints: None, telemetry_external_transport: None, From 52316ae27096df9846f687cb8e4ce87088090621 Mon Sep 17 00:00:00 2001 From: nodebreaker-carlsagan Date: Tue, 10 Dec 2019 12:53:56 +0900 Subject: [PATCH 13/42] Milestone1: Final Version of v0.3 --- Cargo.toml | 2 +- client/Cargo.toml | 1 - client/cli/Cargo.toml | 2 +- client/cli/src/lib.rs | 1 + client/service/Cargo.toml | 2 +- client/service/src/builder.rs | 7 +- client/service/src/config.rs | 2 +- client/service/src/lib.rs | 2 + {client => utils}/prometheus/Cargo.toml | 1 + {client => utils}/prometheus/README.md | 245 +++++++++++------- .../prometheus/photo_2019-12-13_16-32-53.jpg | Bin 0 -> 27726 bytes {client => utils}/prometheus/src/lib.rs | 1 + {client => utils}/prometheus/src/metrics.rs | 7 +- 13 files changed, 176 insertions(+), 97 deletions(-) rename {client => utils}/prometheus/Cargo.toml (78%) rename {client => utils}/prometheus/README.md (62%) create mode 100644 utils/prometheus/photo_2019-12-13_16-32-53.jpg rename {client => utils}/prometheus/src/lib.rs (98%) rename {client => utils}/prometheus/src/metrics.rs (94%) diff --git a/Cargo.toml b/Cargo.toml index 9a468a160abdc..d25dff212f9b9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -45,10 +45,10 @@ members = [ "client/service", "client/service/test", "client/state-db", - "client/prometheus", "client/telemetry", "client/transaction-pool", "client/transaction-pool/graph", + "utils/prometheus", "utils/wasm-builder-runner", "utils/grafana-data-source", "utils/grafana-data-source/test", diff --git a/client/Cargo.toml b/client/Cargo.toml index 736444ad14f89..eaddd9f3dcfe6 100644 --- a/client/Cargo.toml +++ b/client/Cargo.toml @@ -31,7 +31,6 @@ sp-state-machine = { version = "2.0.0", path = "../primitives/state-machine" } sc-telemetry = { version = "2.0.0", path = "telemetry" } sp-trie = { version = "2.0.0", path = "../primitives/trie" } tracing = "0.1.10" -sc-prometheus = { path = "prometheus" } [dev-dependencies] env_logger = "0.7.0" diff --git a/client/cli/Cargo.toml b/client/cli/Cargo.toml index 6dca93855d0a8..5c7ac86904164 100644 --- a/client/cli/Cargo.toml +++ b/client/cli/Cargo.toml @@ -29,7 +29,7 @@ sp-core = { version = "2.0.0", path = "../../primitives/core" } sc-service = { version = "2.0.0", default-features = false, path = "../service" } sp-state-machine = { version = "2.0.0", path = "../../primitives/state-machine" } sc-telemetry = { version = "2.0.0", path = "../telemetry" } -sc-prometheus = { path = "../prometheus" } +sc-prometheus = { path = "../../utils/prometheus" } sp-keyring = { version = "2.0.0", path = "../../primitives/keyring" } names = "0.11.0" structopt = "=0.3.7" diff --git a/client/cli/src/lib.rs b/client/cli/src/lib.rs index 62ad776dd7fae..5fd7286583077 100644 --- a/client/cli/src/lib.rs +++ b/client/cli/src/lib.rs @@ -953,6 +953,7 @@ where config.tracing_targets = cli.tracing_targets.into(); config.tracing_receiver = cli.tracing_receiver.into(); + // Override prometheus match cli.prometheus_endpoint { None => {config.prometheus_endpoint = None;}, Some(x) => { diff --git a/client/service/Cargo.toml b/client/service/Cargo.toml index 8b1a4e9b5241a..887e8415f39b7 100644 --- a/client/service/Cargo.toml +++ b/client/service/Cargo.toml @@ -54,7 +54,7 @@ parity-multiaddr = { package = "parity-multiaddr", version = "0.5.0" } grafana-data-source = { version = "2.0.0", path = "../../utils/grafana-data-source" } sc-tracing = { version = "2.0.0", path = "../tracing" } tracing = "0.1.10" -promet = { package = "sc-prometheus", path="../prometheus"} +sc-prometheus = { package = "sc-prometheus", path="../../utils/prometheus"} [dev-dependencies] substrate-test-runtime-client = { version = "2.0.0", path = "../../test-utils/runtime/client" } diff --git a/client/service/src/builder.rs b/client/service/src/builder.rs index 57b78bd4c0d02..0dbf30afcfa03 100644 --- a/client/service/src/builder.rs +++ b/client/service/src/builder.rs @@ -51,7 +51,9 @@ use std::{ }; use sysinfo::{get_current_pid, ProcessExt, System, SystemExt}; use sc_telemetry::{telemetry, SUBSTRATE_INFO}; -use promet::prometheus_gauge; +use sp_transaction_pool::{TransactionPool, TransactionPoolMaintainer}; +use sc_prometheus::prometheus_gauge; + use sp_blockchain; use grafana_data_source::{self, record_metrics}; @@ -1137,10 +1139,11 @@ ServiceBuilder< .then(|_| Ok(())))); telemetry }); + // prometheus init match config.prometheus_endpoint { None => (), Some(x) => { - let _prometheus = promet::init_prometheus(x); + let _prometheus = sc_prometheus::init_prometheus(x); } } // Grafana data source diff --git a/client/service/src/config.rs b/client/service/src/config.rs index 51ce76368dd6f..251ec90d0221f 100644 --- a/client/service/src/config.rs +++ b/client/service/src/config.rs @@ -75,7 +75,7 @@ pub struct Configuration { pub rpc_cors: Option>, /// Grafana data source http port. `None` if disabled. pub grafana_port: Option, - + /// Promteheus IP addr. `None` if disabled. and defult port 33333 pub prometheus_endpoint: Option, /// Telemetry service URL. `None` if disabled. pub telemetry_endpoints: Option, diff --git a/client/service/src/lib.rs b/client/service/src/lib.rs index aeeef1ecaedb3..7a3c6fc9eaab3 100644 --- a/client/service/src/lib.rs +++ b/client/service/src/lib.rs @@ -17,6 +17,8 @@ //! Substrate service. Starts a thread that spins up the network, client, and extrinsic pool. //! Manages communication between them. +#![warn(missing_docs)] + pub mod config; #[macro_use] pub mod chain_ops; diff --git a/client/prometheus/Cargo.toml b/utils/prometheus/Cargo.toml similarity index 78% rename from client/prometheus/Cargo.toml rename to utils/prometheus/Cargo.toml index 29d81c9e5fda8..8ac6d7001833f 100644 --- a/client/prometheus/Cargo.toml +++ b/utils/prometheus/Cargo.toml @@ -11,6 +11,7 @@ lazy_static = "1.0" log = "0.4" prometheus = { version = "0.7", features = ["nightly", "process"]} tokio = "0.1" +sp-runtime = { package = "sp-runtime",path = "../../primitives/runtime" } [dev-dependencies] reqwest = "0.9" \ No newline at end of file diff --git a/client/prometheus/README.md b/utils/prometheus/README.md similarity index 62% rename from client/prometheus/README.md rename to utils/prometheus/README.md index ced9730696e27..3efe80d57de94 100644 --- a/client/prometheus/README.md +++ b/utils/prometheus/README.md @@ -1,5 +1,5 @@ # Substrate Prometheus Node Exporter - +![grants](./photo_2019-12-13_16-32-53.jpg) ## Introduction Prometheus is one of the most widely used monitoring tool for managing high availability services supported by [Cloud Native Computing Foundation](https://www.cncf.io/). By providing Prometheus exporter in substrate, node operators can easily adopt widely used display/alert tool such as Grafana without seting-up/operating external Prometheus agent through RPC connections. Easy access to such monitoring tools will benefit parachain develepers/operators and validators to have much higher availability quality of their services. @@ -27,7 +27,7 @@ Start Grafana Here is the entry point of prometheus core module in Parity Substrate. -client/prometheus/src/lib.rs +utils/prometheus/src/lib.rs ```rust #[macro_use] extern crate lazy_static; @@ -39,7 +39,7 @@ use hyper::service::service_fn_ok; use hyper::{Body, Request, Response, Server}; pub use prometheus::{Encoder, HistogramOpts, Opts, TextEncoder}; pub use prometheus::{Histogram, IntCounter, IntGauge, Result}; -pub use sr_primitives::traits::SaturatedConversion; +pub use sp_runtime::traits::SaturatedConversion; use std::net::SocketAddr; pub mod metrics; @@ -47,44 +47,44 @@ pub mod metrics; /// Initializes the metrics context, and starts an HTTP server /// to serve metrics. pub fn init_prometheus(prometheus_addr: SocketAddr) { - let addr = prometheus_addr; - let server = Server::bind(&addr) - .serve(|| { - // This is the `Service` that will handle the connection. - // `service_fn_ok` is a helper to convert a function that - // returns a Response into a `Service`. - service_fn_ok(move |req: Request| { - if req.uri().path() == "/metrics" { - let metric_families = prometheus::gather(); - let mut buffer = vec![]; - let encoder = TextEncoder::new(); - encoder.encode(&metric_families, &mut buffer).unwrap(); - Response::builder() - .status(StatusCode::OK) - .header("Content-Type", encoder.format_type()) - .body(Body::from(buffer)) - .expect("Sends OK(200) response with one or more data metrics") - } else { - Response::builder() - .status(StatusCode::NOT_FOUND) - .body(Body::from("Not found.")) - .expect("Sends NOT_FOUND(404) message with no data metric") - } - }) - }) - .map_err(|e| error!("server error: {}", e)); - - info!("Exporting metrics at http://{}/metrics", addr); - - let mut rt = tokio::runtime::Builder::new() - .core_threads(1) // one thread is sufficient - .build() - .expect("Builds one thread of tokio runtime exporter for prometheus"); - - std::thread::spawn(move || { - rt.spawn(server); - rt.shutdown_on_idle().wait().unwrap(); - }); + let addr = prometheus_addr; + let server = Server::bind(&addr) + .serve(|| { + // This is the `Service` that will handle the connection. + // `service_fn_ok` is a helper to convert a function that + // returns a Response into a `Service`. + service_fn_ok(move |req: Request| { + if req.uri().path() == "/metrics" { + let metric_families = prometheus::gather(); + let mut buffer = vec![]; + let encoder = TextEncoder::new(); + encoder.encode(&metric_families, &mut buffer).unwrap(); + Response::builder() + .status(StatusCode::OK) + .header("Content-Type", encoder.format_type()) + .body(Body::from(buffer)) + .expect("Sends OK(200) response with one or more data metrics") + } else { + Response::builder() + .status(StatusCode::NOT_FOUND) + .body(Body::from("Not found.")) + .expect("Sends NOT_FOUND(404) message with no data metric") + } + }) + }) + .map_err(|e| error!("server error: {}", e)); + + info!("Exporting metrics at http://{}/metrics", addr); + + let mut rt = tokio::runtime::Builder::new() + .core_threads(1) // one thread is sufficient + .build() + .expect("Builds one thread of tokio runtime exporter for prometheus"); + + std::thread::spawn(move || { + rt.spawn(server); + rt.shutdown_on_idle().wait().unwrap(); + }); } #[macro_export] @@ -107,16 +107,6 @@ macro_rules! prometheus_histogram( } ); -#[macro_export] -macro_rules! prometheus_counter( - ($($metric:expr => $value:expr),*) => { - use $crate::{metrics::*}; - $( - metrics::set_counter(&$metric, $value); - )* - } -); - /* TODO: Make abstract type for all metrics(e.g. Gauge, Histogram, Counter) with generic traits so that all metrics can be set up with one function `set` #[macro_export] @@ -135,7 +125,7 @@ Here is the dependancies of the module. client/prometheus/Cargo.toml ```toml [package] -name = "substrate-prometheus" +name = "sc-prometheus" version = "2.0.0" authors = ["Parity Technologies "] description = "prometheus utils" @@ -147,6 +137,7 @@ lazy_static = "1.0" log = "0.4" prometheus = { version = "0.7", features = ["nightly", "process"]} tokio = "0.1" +sp-runtime = { package = "sp-runtime",path = "../../primitives/runtime" } [dev-dependencies] reqwest = "0.9" @@ -155,66 +146,137 @@ reqwest = "0.9" **Abbreviation of the package in service manager of parity substrate** client/service/Cargo.toml ```toml -.... -promet = { package = "substrate-prometheus", path="../../core/prometheus"} -.... +[dependencies] +sc-prometheus = { package = "sc-prometheus", path="../../utils/prometheus"} ``` **Metrics builder as same as substrate-telemetry** -client/service/src/builder.rs +client/service/src/builder.rsL1271 , L1112 ```rust +use sc_prometheus::prometheus_gauge; +... + telemetry!( + SUBSTRATE_INFO; + "system.interval"; + "peers" => num_peers, + "height" => best_number, + "best" => ?best_hash, + "txcount" => txpool_status.ready, + "cpu" => cpu_usage, + "memory" => memory, + "finalized_height" => finalized_number, + "finalized_hash" => ?info.chain.finalized_hash, + "bandwidth_download" => bandwidth_download, + "bandwidth_upload" => bandwidth_upload, + "used_state_cache_size" => used_state_cache_size, + ); + prometheus_gauge!( + MEMPOOL_SIZE => used_state_cache_size as u64, + NODE_MEMORY => memory as u64, + NODE_CPU => cpu_usage as u64, + TX_COUNT => txpool_status.ready as u64, + FINALITY_HEIGHT => finalized_number as u64, + BEST_HEIGHT => best_number as u64, + P2P_PEERS_NUM => num_peers as u64, + P2P_NODE_DOWNLOAD => net_status.average_download_per_sec as u64, + P2P_NODE_UPLOAD => net_status.average_upload_per_sec as u64 + ); + let _ = record_metrics!( + "peers" => num_peers, + "height" => best_number, + "txcount" => txpool_status.ready, + "cpu" => cpu_usage, + "memory" => memory, + "finalized_height" => finalized_number, + "bandwidth_download" => bandwidth_download, + "bandwidth_upload" => bandwidth_upload, + "used_state_cache_size" => used_state_cache_size, + ); + Ok(()) + }).select(exit.clone().map(Ok).compat()).then(|_| Ok(())); + let _ = to_spawn_tx.unbounded_send(Box::new(tel_task)); + +... + // prometheus init + match config.prometheus_endpoint { + None => (), + Some(x) => { + let _prometheus = sc_prometheus::init_prometheus(x); + } + } + // Grafana data source + if let Some(port) = config.grafana_port { + let future = select( + grafana_data_source::run_server(port).boxed(), + exit.clone() + ).map(|either| match either { + Either::Left((result, _)) => result.map_err(|_| ()), + Either::Right(_) => Ok(()) + }).compat(); + + let _ = to_spawn_tx.unbounded_send(Box::new(future)); + } - ..... - let _ = to_spawn_tx.unbounded_send(Box::new(future - .select(exit.clone()) - .then(|_| Ok(())))); - telemetry - }); ----------------- -match config.prometheus_endpoint { - None => (), - Some(x) => {let _prometheus = promet::init_prometheus(x);} + // Instrumentation + if let Some(tracing_targets) = config.tracing_targets.as_ref() { + let subscriber = sc_tracing::ProfilingSubscriber::new( + config.tracing_receiver, tracing_targets + ); + match tracing::subscriber::set_global_default(subscriber) { + Ok(_) => (), + Err(e) => error!(target: "tracing", "Unable to set global default subscriber {}", e), + } } - -------------------- - Ok(NewService { - client, - network, - ..... + + ``` substrate/Cargo.toml ```toml - .... [workspace] members = [ - "client/prometheus", - .... + "utils/prometheus", ``` ### CLI Config client/cli/src/lib.rs ```rust -fn crate_run_node_config +fn crate_run_node_config{ ... -} + // Override telemetry + if cli.no_telemetry { + config.telemetry_endpoints = None; + } else if !cli.telemetry_endpoints.is_empty() { + config.telemetry_endpoints = Some(TelemetryEndpoints::new(cli.telemetry_endpoints)); + } + config.tracing_targets = cli.tracing_targets.into(); + config.tracing_receiver = cli.tracing_receiver.into(); + + // Override prometheus match cli.prometheus_endpoint { None => {config.prometheus_endpoint = None;}, Some(x) => { config.prometheus_endpoint = Some(parse_address(&format!("{}:{}", x, 33333), cli.prometheus_port)?); } } -... + // Imply forced authoring on --dev + config.force_authoring = cli.shared_params.dev || cli.force_authoring; + Ok(config) +... +} ``` client/cli/src/params.rs ```rust pub struct RunCmd{ -/// Specify HTTP RPC server TCP port. -#[structopt(long = "prometheus-port", value_name = "PORT")] +... +/// Prometheus exporter TCP port. + #[structopt(long = "prometheus-port", value_name = "PORT")] pub prometheus_port: Option, -#[structopt(long = "prometheus-addr", value_name = "Local IP address")] + /// Prometheus exporter IP addr. + #[structopt(long = "prometheus-addr", value_name = "Local IP address")] pub prometheus_endpoint: Option, +... } ``` client/service/src/config.rs @@ -222,7 +284,8 @@ client/service/src/config.rs #[derive(Clone)] pub struct Configuration { ... - pub prometheus_endpoint: Option, + /// Promteheus IP addr. `None` if disabled. and defult port 33333 + pub prometheus_endpoint: Option, ... } impl Configuration where @@ -250,11 +313,12 @@ impl Configuration where ### Metrics Add ex) consensus_FINALITY_HEIGHT -client/prometheus/src/metrics.rs +utils/prometheus/src/metrics.rs ```rust pub use crate::*; +/// Gauge type metrics generation function pub fn try_create_int_gauge(name: &str, help: &str) -> Result { let opts = Opts::new(name, help); let gauge = IntGauge::with_opts(opts)?; @@ -262,12 +326,14 @@ pub fn try_create_int_gauge(name: &str, help: &str) -> Result { Ok(gauge) } +///Gauge Metrics a value in injection. pub fn set_gauge(gauge: &Result, value: u64) { if let Ok(gauge) = gauge { gauge.set(value as i64); } } +///All of the metrics in the prometheus are managed by the lazy_static. lazy_static! { pub static ref FINALITY_HEIGHT: Result = try_create_int_gauge( "consensus_finality_block_height_number", @@ -279,13 +345,13 @@ lazy_static! { client/service/Cargo.toml ```rust ... -promet = { package = "substrate-prometheus", path="../prometheus"} +sc-prometheus = { package = "sc-prometheus", path="../../utils/prometheus"} ... ``` client/service/src/builder.rs ```rust ..... -use promet::{prometheus_gauge}; +use sc-prometheus::{prometheus_gauge}; ..... let tel_task = state_rx.for_each(move |(net_status, _)| { let info = client_.info(); @@ -359,7 +425,6 @@ Consensus metrics, namespace: `substrate` | consensus_finality_block_height_number | IntGauge | | finality Height of the chain | | consensus_best_block_height_number | IntGauge | | best Height of the chain | | consensus_target_syn_number | IntGauge | | syning Height target number | -| consensus_block_interval_seconds | Histogram | | Time between this and last block (Block.Header.Time) in seconds | | consensus_num_txs | Gauge | | Number of transactions | | consensus_node_memory | IntGauge | | Node's primary memory | | consensus_node_cpu | IntGauge | | Node's cpu load | @@ -367,6 +432,12 @@ Consensus metrics, namespace: `substrate` | p2p_peer_receive_bytes_per_sec | IntGauge | | number of bytes received from a given peer | | p2p_peer_send_bytes_per_sec | IntGauge | | number of bytes sent to a given peer | | mempool_size | IntGauge | | Number of uncommitted transactions | +| Resource_receive_bytes_per_sec(Future) | IntGauge | | Operating System of bytes received | +| Resource_send_bytes_per_sec(Future) | IntGauge | | Operating System of bytes sent | +| Resource_cpu_use(Future) | IntGauge | | Operating System cpu load | +| Resource_disk_use(Future) | IntGauge | | Operating System disk use | +| validator_sign_prevote(Future) | IntGauge | validator addr | validator sign vote list | +| validator_sign_precommit(Future) | IntGauge | validator addr | validator sign commit list | ## Start Prometheus @@ -427,4 +498,4 @@ You can visit `http://localhost:3000/` to open grafana and create your own dashb ### Seting Grafana -Default ID:PW is admin. \ No newline at end of file +Default ID:PW is admin. diff --git a/utils/prometheus/photo_2019-12-13_16-32-53.jpg b/utils/prometheus/photo_2019-12-13_16-32-53.jpg new file mode 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ZXJ;5@soz3YFR!o@h#9C_PWJsU}HlQ=an7<*T32N z7@)}Xt0cMyxe2!}lnz1g5SI#E*wxKj*3EegcTjcn$NV?bx>^!?t>Adb%1~>pKbWSe z8^Ra>4JWFK*5fROv6sYqRRmFE^$l{j)5@IJKx8zSyGL%E0~H(1;ZlF=z!%px-9w0$ z8yx{$C@&yzbg_Fn~o1f^PpdHVP2-b2=UXi1Tasg|exvf{Pyq(U0PS;ut26BQ> z;L*6vS^dbEuQWOEE4=8@js57=x+>eW z?-@c?e7s^hR}#!3c-U3gWK%;BuYqwdHV=7_3sWUkXHWV0_sCcuv@~s}h!up1(At+kaFO^=KyT&{a>MXi>v?u literal 0 HcmV?d00001 diff --git a/client/prometheus/src/lib.rs b/utils/prometheus/src/lib.rs similarity index 98% rename from client/prometheus/src/lib.rs rename to utils/prometheus/src/lib.rs index c3db7e2d15763..4713f47291de0 100644 --- a/client/prometheus/src/lib.rs +++ b/utils/prometheus/src/lib.rs @@ -8,6 +8,7 @@ use hyper::service::service_fn_ok; use hyper::{Body, Request, Response, Server}; pub use prometheus::{Encoder, HistogramOpts, Opts, TextEncoder}; pub use prometheus::{Histogram, IntCounter, IntGauge, Result}; +pub use sp_runtime::traits::SaturatedConversion; use std::net::SocketAddr; pub mod metrics; diff --git a/client/prometheus/src/metrics.rs b/utils/prometheus/src/metrics.rs similarity index 94% rename from client/prometheus/src/metrics.rs rename to utils/prometheus/src/metrics.rs index a2621c3354aea..dfb9c4ec57720 100644 --- a/client/prometheus/src/metrics.rs +++ b/utils/prometheus/src/metrics.rs @@ -27,7 +27,8 @@ pub fn set_histogram(histogram: &Result, value: f64) { histogram.observe(value) } } -///All of the metrics in the prometheus are managed by the lazy_static. +//All of the metrics in the prometheus are managed by the lazy_static. + lazy_static! { pub static ref FINALITY_HEIGHT: Result = try_create_int_gauge( "consensus_finality_block_height_number", @@ -68,11 +69,11 @@ lazy_static! { "Number of uncommitted transactions" ); pub static ref P2P_NODE_DOWNLOAD: Result = try_create_int_gauge( - "p2p_peer_receive_byte_per_sec", + "p2p_peers_receive_byte_per_sec", "p2p_node_download_per_sec_byte" ); pub static ref P2P_NODE_UPLOAD: Result = try_create_int_gauge( - "p2p_peer_send_byte_per_sec", + "p2p_peers_send_byte_per_sec", "p2p_node_upload_per_sec_byte" ); } \ No newline at end of file From 82cd8cf54890fe46f9eb3ed441075dc4126c8ad8 Mon Sep 17 00:00:00 2001 From: nodebreaker-carlsagan Date: Thu, 2 Jan 2020 21:23:51 +0900 Subject: [PATCH 14/42] no-std or warm compatibility issues, grapana-data -source code reference and correction,applicable --- Cargo.lock | 66 +++++++ client/cli/src/lib.rs | 11 +- client/cli/src/params.rs | 6 +- client/service/src/builder.rs | 14 +- client/service/src/config.rs | 6 +- client/service/test/src/lib.rs | 2 +- utils/prometheus/Cargo.toml | 14 +- utils/prometheus/README.md | 281 ++++++++++++++++++++--------- utils/prometheus/src/lib.rs | 169 ++++++++++++----- utils/prometheus/src/metrics.rs | 19 +- utils/prometheus/src/networking.rs | 66 +++++++ 11 files changed, 497 insertions(+), 157 deletions(-) create mode 100644 utils/prometheus/src/networking.rs diff --git a/Cargo.lock b/Cargo.lock index 7c16aef33eb33..1c68365731295 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3336,6 +3336,11 @@ name = "nohash-hasher" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "nom" +version = "1.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "nom" version = "4.2.3" @@ -4497,6 +4502,32 @@ dependencies = [ "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "procinfo" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", + "nom 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "prometheus" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", + "procinfo 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "protobuf 2.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "spin 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "prost" version = "0.5.0" @@ -4942,6 +4973,14 @@ name = "rustc-hex" version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "rustc_version" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "semver 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "rustc_version" version = "0.2.3" @@ -5118,6 +5157,7 @@ dependencies = [ "rpassword 4.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "sc-client-api 2.0.0", "sc-network 0.8.0", + "sc-prometheus 2.0.0", "sc-service 2.0.0", "sc-telemetry 2.0.0", "sc-tracing 2.0.0", @@ -5647,6 +5687,21 @@ dependencies = [ "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "sc-prometheus" +version = "2.0.0" +dependencies = [ + "async-std 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "derive_more 0.99.2 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-util 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "prometheus 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-runtime 2.0.0", + "tokio 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "sc-rpc" version = "2.0.0" @@ -5753,6 +5808,7 @@ dependencies = [ "sc-keystore 2.0.0", "sc-network 0.8.0", "sc-offchain 2.0.0", + "sc-prometheus 2.0.0", "sc-rpc 2.0.0", "sc-rpc-server 2.0.0", "sc-telemetry 2.0.0", @@ -5967,6 +6023,11 @@ dependencies = [ "core-foundation-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "semver" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "semver" version = "0.6.0" @@ -8527,6 +8588,7 @@ dependencies = [ "checksum nix 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6c722bee1037d430d0f8e687bbdbf222f27cc6e4e68d5caf630857bb2b6dbdce" "checksum nodrop 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" "checksum nohash-hasher 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4e657a6ec97f9a3ba46f6f7034ea6db9fcd5b71d25ef1074b7bc03da49be0e8e" +"checksum nom 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "a5b8c256fd9471521bcb84c3cdba98921497f1a331cbc15b8030fc63b82050ce" "checksum nom 4.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2ad2a91a8e869eeb30b9cb3119ae87773a8f4ae617f41b1eb9c154b2905f7bd6" "checksum num-bigint 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "f9c3f34cdd24f334cb265d9bf8bfa8a241920d026916785747a92f0e55541a1a" "checksum num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)" = "b85e541ef8255f6cf42bbfe4ef361305c6c135d10919ecc26126c4e5ae94bc09" @@ -8586,6 +8648,8 @@ dependencies = [ "checksum proc-macro-nested 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "369a6ed065f249a159e06c45752c780bda2fb53c995718f9e484d08daa9eb42e" "checksum proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)" = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" "checksum proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "9c9e470a8dc4aeae2dee2f335e8f533e2d4b347e1434e5671afc49b054592f27" +"checksum procinfo 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f42e8578852a3306838981aedad8c5642ba794929aa12af0c9eb6c072b77af6c" +"checksum prometheus 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5567486d5778e2c6455b1b90ff1c558f29e751fc018130fa182e15828e728af1" "checksum prost 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "96d14b1c185652833d24aaad41c5832b0be5616a590227c1fbff57c616754b23" "checksum prost-build 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "eb788126ea840817128183f8f603dce02cb7aea25c2a0b764359d8e20010702e" "checksum prost-derive 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5e7dc378b94ac374644181a2247cebf59a6ec1c88b49ac77f3a94b86b79d0e11" @@ -8634,6 +8698,7 @@ dependencies = [ "checksum rust-argon2 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4ca4eaef519b494d1f2848fc602d18816fed808a981aedf4f1f00ceb7c9d32cf" "checksum rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" "checksum rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "403bb3a286107a04825a5f82e1270acc1e14028d3d554d7a1e08914549575ab8" +"checksum rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "c5f5376ea5e30ce23c03eb77cbe4962b988deead10910c372b226388b594c084" "checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" "checksum rustls 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b25a18b1bf7387f0145e7f8324e700805aade3842dd3db2e74e4cdeb4677c09e" "checksum rustversion 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c48f91977f4ef3be5358c15d131d3f663f6b4d7a112555bf3bf52ad23b6659e5" @@ -8651,6 +8716,7 @@ dependencies = [ "checksum sct 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e3042af939fca8c3453b7af0f1c66e533a15a86169e39de2657310ade8f98d3c" "checksum security-framework 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8ef2429d7cefe5fd28bd1d2ed41c944547d4ff84776f5935b456da44593a16df" "checksum security-framework-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e31493fc37615debb8c5090a7aeb4a9730bc61e77ab10b9af59f1a202284f895" +"checksum semver 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)" = "d4f410fedcf71af0345d7607d246e7ad15faaadd49d240ee3b24e5dc21a820ac" "checksum semver 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a3186ec9e65071a2095434b1f5bb24838d4e8e130f584c790f6033c79943537" "checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" "checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" diff --git a/client/cli/src/lib.rs b/client/cli/src/lib.rs index 5fd7286583077..ff2c5a19ad73b 100644 --- a/client/cli/src/lib.rs +++ b/client/cli/src/lib.rs @@ -921,6 +921,7 @@ where let rpc_interface: &str = interface_str(cli.rpc_external, cli.unsafe_rpc_external, cli.validator)?; let ws_interface: &str = interface_str(cli.ws_external, cli.unsafe_ws_external, cli.validator)?; let grafana_interface: &str = if cli.grafana_external { "0.0.0.0" } else { "127.0.0.1" }; + let prometheus_interface: &str = if cli.prometheus_external { "0.0.0.0" } else { "127.0.0.1" }; config.rpc_http = Some(parse_address(&format!("{}:{}", rpc_interface, 9933), cli.rpc_port)?); config.rpc_ws = Some(parse_address(&format!("{}:{}", ws_interface, 9944), cli.ws_port)?); @@ -954,12 +955,10 @@ where config.tracing_receiver = cli.tracing_receiver.into(); // Override prometheus - match cli.prometheus_endpoint { - None => {config.prometheus_endpoint = None;}, - Some(x) => { - config.prometheus_endpoint = Some(parse_address(&format!("{}:{}", x, 33333), cli.prometheus_port)?); - } - } + if cli.prometheus_external { + config.prometheus_port = Some( + parse_address(&format!("{}:{}", prometheus_interface, 33333), cli.prometheus_port)? + )} // Imply forced authoring on --dev config.force_authoring = cli.shared_params.dev || cli.force_authoring; diff --git a/client/cli/src/params.rs b/client/cli/src/params.rs index 44c7cffffb4d1..bcce3496abf19 100644 --- a/client/cli/src/params.rs +++ b/client/cli/src/params.rs @@ -443,9 +443,9 @@ pub struct RunCmd { /// Prometheus exporter TCP port. #[structopt(long = "prometheus-port", value_name = "PORT")] pub prometheus_port: Option, - /// Prometheus exporter IP addr. - #[structopt(long = "prometheus-addr", value_name = "Local IP address")] - pub prometheus_endpoint: Option, + /// Prometheus exporter on/off external". + #[structopt(long = "prometheus-external")] + pub prometheus_external: bool, /// Listen to all Websocket interfaces. /// diff --git a/client/service/src/builder.rs b/client/service/src/builder.rs index 0dbf30afcfa03..6e216d499cc0d 100644 --- a/client/service/src/builder.rs +++ b/client/service/src/builder.rs @@ -1140,11 +1140,15 @@ ServiceBuilder< telemetry }); // prometheus init - match config.prometheus_endpoint { - None => (), - Some(x) => { - let _prometheus = sc_prometheus::init_prometheus(x); - } + if let Some(port) = config.prometheus_port { + let future = select( + sc_prometheus::init_prometheus(port).boxed() + ,exit.clone() + ).map(|either| match either { + Either::Left((result, _)) => result.map_err(|_| ()), + Either::Right(_) => Ok(()) + }).compat(); + let _ = to_spawn_tx.unbounded_send(Box::new(future)); } // Grafana data source if let Some(port) = config.grafana_port { diff --git a/client/service/src/config.rs b/client/service/src/config.rs index 251ec90d0221f..eb97283661c7e 100644 --- a/client/service/src/config.rs +++ b/client/service/src/config.rs @@ -75,8 +75,8 @@ pub struct Configuration { pub rpc_cors: Option>, /// Grafana data source http port. `None` if disabled. pub grafana_port: Option, - /// Promteheus IP addr. `None` if disabled. and defult port 33333 - pub prometheus_endpoint: Option, + /// Promteheus Port. `None` if disabled. and defult port 33333 + pub prometheus_port: Option, /// Telemetry service URL. `None` if disabled. pub telemetry_endpoints: Option, /// External WASM transport for the telemetry. If `Some`, when connection to a telemetry @@ -179,7 +179,7 @@ impl Configuration where rpc_ws: None, rpc_ws_max_connections: None, rpc_cors: Some(vec![]), - prometheus_endpoint: None, + prometheus_port: None, grafana_port: None, telemetry_endpoints: None, telemetry_external_transport: None, diff --git a/client/service/test/src/lib.rs b/client/service/test/src/lib.rs index 5092ec1cf8295..56f75324eb7dc 100644 --- a/client/service/test/src/lib.rs +++ b/client/service/test/src/lib.rs @@ -194,7 +194,7 @@ fn node_config ( rpc_ws: None, rpc_ws_max_connections: None, rpc_cors: None, - prometheus_endpoint: None, + prometheus_port: None, grafana_port: None, telemetry_endpoints: None, telemetry_external_transport: None, diff --git a/utils/prometheus/Cargo.toml b/utils/prometheus/Cargo.toml index 8ac6d7001833f..ea131e3952049 100644 --- a/utils/prometheus/Cargo.toml +++ b/utils/prometheus/Cargo.toml @@ -6,12 +6,14 @@ description = "prometheus utils" edition = "2018" [dependencies] -hyper = "0.12" -lazy_static = "1.0" -log = "0.4" +hyper = { version = "0.13.1", default-features = false, features = ["stream"] } +lazy_static = "1.4" +log = "0.4.8" prometheus = { version = "0.7", features = ["nightly", "process"]} -tokio = "0.1" +tokio = "0.2" +futures-util = { version = "0.3.1", default-features = false, features = ["io"] } sp-runtime = { package = "sp-runtime",path = "../../primitives/runtime" } +derive_more = "0.99" -[dev-dependencies] -reqwest = "0.9" \ No newline at end of file +[target.'cfg(not(target_os = "unknown"))'.dependencies] +async-std = { version = "1.0.1", features = ["unstable"] } \ No newline at end of file diff --git a/utils/prometheus/README.md b/utils/prometheus/README.md index 3efe80d57de94..9fec16a81ca15 100644 --- a/utils/prometheus/README.md +++ b/utils/prometheus/README.md @@ -27,66 +27,128 @@ Start Grafana Here is the entry point of prometheus core module in Parity Substrate. +In existing sources, refer to the grapana source due to the issue of the wasm. + utils/prometheus/src/lib.rs ```rust #[macro_use] extern crate lazy_static; -#[macro_use] -extern crate log; +use futures_util::{FutureExt,future::{Future}}; use hyper::http::StatusCode; -use hyper::rt::Future; -use hyper::service::service_fn_ok; -use hyper::{Body, Request, Response, Server}; +use hyper::Server; +use hyper::{Body, Request, Response, service::{service_fn, make_service_fn}}; pub use prometheus::{Encoder, HistogramOpts, Opts, TextEncoder}; -pub use prometheus::{Histogram, IntCounter, IntGauge, Result}; +pub use prometheus::{Histogram, IntCounter, IntGauge}; pub use sp_runtime::traits::SaturatedConversion; use std::net::SocketAddr; - +#[cfg(not(target_os = "unknown"))] +mod networking; pub mod metrics; +#[derive(Debug, derive_more::Display, derive_more::From)] +pub enum Error { + /// Hyper internal error. + Hyper(hyper::Error), + /// Http request error. + Http(hyper::http::Error), + /// i/o error. + Io(std::io::Error) +} +impl std::error::Error for Error { + fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { + match self { + Error::Hyper(error) => Some(error), + Error::Http(error) => Some(error), + Error::Io(error) => Some(error) + } + } +} + +async fn request_metrics(req: Request) -> Result, Error> { + if req.uri().path() == "/metrics" { + let metric_families = prometheus::gather(); + let mut buffer = vec![]; + let encoder = TextEncoder::new(); + encoder.encode(&metric_families, &mut buffer).unwrap(); + Response::builder() + .status(StatusCode::OK) + .header("Content-Type", encoder.format_type()) + .body(Body::from(buffer)) + .map_err(Error::Http) + //.expect("Sends OK(200) response with one or more data metrics") + } else { + Response::builder() + .status(StatusCode::NOT_FOUND) + .body(Body::from("Not found.")) + .map_err(Error::Http) + //.expect("Sends NOT_FOUND(404) message with no data metric") + } + +} + +#[derive(Clone)] +pub struct Executor; + +#[cfg(not(target_os = "unknown"))] +impl hyper::rt::Executor for Executor + where + T: Future + Send + 'static, + T::Output: Send + 'static, +{ + fn execute(&self, future: T) { + async_std::task::spawn(future); + } +} /// Initializes the metrics context, and starts an HTTP server /// to serve metrics. -pub fn init_prometheus(prometheus_addr: SocketAddr) { - let addr = prometheus_addr; - let server = Server::bind(&addr) - .serve(|| { - // This is the `Service` that will handle the connection. - // `service_fn_ok` is a helper to convert a function that - // returns a Response into a `Service`. - service_fn_ok(move |req: Request| { - if req.uri().path() == "/metrics" { - let metric_families = prometheus::gather(); - let mut buffer = vec![]; - let encoder = TextEncoder::new(); - encoder.encode(&metric_families, &mut buffer).unwrap(); - Response::builder() - .status(StatusCode::OK) - .header("Content-Type", encoder.format_type()) - .body(Body::from(buffer)) - .expect("Sends OK(200) response with one or more data metrics") - } else { - Response::builder() - .status(StatusCode::NOT_FOUND) - .body(Body::from("Not found.")) - .expect("Sends NOT_FOUND(404) message with no data metric") - } - }) - }) - .map_err(|e| error!("server error: {}", e)); - - info!("Exporting metrics at http://{}/metrics", addr); - - let mut rt = tokio::runtime::Builder::new() - .core_threads(1) // one thread is sufficient - .build() - .expect("Builds one thread of tokio runtime exporter for prometheus"); - - std::thread::spawn(move || { - rt.spawn(server); - rt.shutdown_on_idle().wait().unwrap(); - }); +#[cfg(not(target_os = "unknown"))] +pub async fn init_prometheus(mut prometheus_addr: SocketAddr) -> Result<(), Error>{ + use async_std::{net, io}; + use crate::networking::Incoming; + + let listener = loop { + let listener = net::TcpListener::bind(&prometheus_addr).await; + match listener { + Ok(listener) => { + log::info!("Prometheus server started at {}", prometheus_addr); + break listener + }, + Err(err) => match err.kind() { + io::ErrorKind::AddrInUse | io::ErrorKind::PermissionDenied if prometheus_addr.port() != 0 => { + log::warn!( + "Prometheus server to already {} port.", prometheus_addr.port() + ); + prometheus_addr.set_port(0); + continue; + }, + _ => return Err(err.into()) + } + } + }; + let service = make_service_fn(|_| { + async { + Ok::<_, Error>(service_fn(request_metrics)) + } + }); + + + let _server = Server::builder(Incoming(listener.incoming())) + .executor(Executor) + .serve(service) + .boxed(); + + + let result = _server.await.map_err(Into::into); + + result +} + +#[cfg(target_os = "unknown")] +pub async fn init_prometheus(_: SocketAddr) -> Result<(), Error> { + Ok(()) } + #[macro_export] macro_rules! prometheus_gauge( ($($metric:expr => $value:expr),*) => { @@ -120,9 +182,65 @@ macro_rules! prometheus( ); */ ``` +utuls/prometheus/src/networking.rs ( grafana-data-source Note) +```rust +use async_std::pin::Pin; +use std::task::{Poll, Context}; +use futures_util::{stream::Stream, io::{AsyncRead, AsyncWrite}}; + +pub struct Incoming<'a>(pub async_std::net::Incoming<'a>); + +impl hyper::server::accept::Accept for Incoming<'_> { + type Conn = TcpStream; + type Error = async_std::io::Error; + + fn poll_accept(self: Pin<&mut Self>, cx: &mut Context) -> Poll>> { + Pin::new(&mut Pin::into_inner(self).0) + .poll_next(cx) + .map(|opt| opt.map(|res| res.map(TcpStream))) + } +} + +pub struct TcpStream(pub async_std::net::TcpStream); + +impl tokio::io::AsyncRead for TcpStream { + fn poll_read( + self: Pin<&mut Self>, + cx: &mut Context, + buf: &mut [u8] + ) -> Poll> { + Pin::new(&mut Pin::into_inner(self).0) + .poll_read(cx, buf) + } +} + +impl tokio::io::AsyncWrite for TcpStream { + fn poll_write( + self: Pin<&mut Self>, + cx: &mut Context, + buf: &[u8] + ) -> Poll> { + Pin::new(&mut Pin::into_inner(self).0) + .poll_write(cx, buf) + } + + fn poll_flush(self: Pin<&mut Self>, cx: &mut Context) -> Poll> { + Pin::new(&mut Pin::into_inner(self).0) + .poll_flush(cx) + } + + fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context) -> Poll> { + Pin::new(&mut Pin::into_inner(self).0) + .poll_close(cx) + } +} + +``` + + Here is the dependancies of the module. -client/prometheus/Cargo.toml +utils/prometheus/Cargo.toml ```toml [package] name = "sc-prometheus" @@ -132,15 +250,17 @@ description = "prometheus utils" edition = "2018" [dependencies] -hyper = "0.12" -lazy_static = "1.0" -log = "0.4" +hyper = { version = "0.13.1", default-features = false, features = ["stream"] } +lazy_static = "1.4" +log = "0.4.8" prometheus = { version = "0.7", features = ["nightly", "process"]} -tokio = "0.1" +tokio = "0.2" +futures-util = { version = "0.3.1", default-features = false, features = ["io"] } sp-runtime = { package = "sp-runtime",path = "../../primitives/runtime" } +derive_more = "0.99" -[dev-dependencies] -reqwest = "0.9" +[target.'cfg(not(target_os = "unknown"))'.dependencies] +async-std = { version = "1.0.1", features = ["unstable"] } ``` **Abbreviation of the package in service manager of parity substrate** @@ -198,11 +318,15 @@ use sc_prometheus::prometheus_gauge; ... // prometheus init - match config.prometheus_endpoint { - None => (), - Some(x) => { - let _prometheus = sc_prometheus::init_prometheus(x); - } + if let Some(port) = config.prometheus_port { + let future = select( + sc_prometheus::init_prometheus(port).boxed() + ,exit.clone() + ).map(|either| match either { + Either::Left((result, _)) => result.map_err(|_| ()), + Either::Right(_) => Ok(()) + }).compat(); + let _ = to_spawn_tx.unbounded_send(Box::new(future)); } // Grafana data source if let Some(port) = config.grafana_port { @@ -241,28 +365,13 @@ client/cli/src/lib.rs ```rust fn crate_run_node_config{ ... - // Override telemetry - if cli.no_telemetry { - config.telemetry_endpoints = None; - } else if !cli.telemetry_endpoints.is_empty() { - config.telemetry_endpoints = Some(TelemetryEndpoints::new(cli.telemetry_endpoints)); - } - - config.tracing_targets = cli.tracing_targets.into(); - config.tracing_receiver = cli.tracing_receiver.into(); - - // Override prometheus - match cli.prometheus_endpoint { - None => {config.prometheus_endpoint = None;}, - Some(x) => { - config.prometheus_endpoint = Some(parse_address(&format!("{}:{}", x, 33333), cli.prometheus_port)?); - } - } - // Imply forced authoring on --dev - config.force_authoring = cli.shared_params.dev || cli.force_authoring; - - Ok(config) + let prometheus_interface: &str = if cli.prometheus_external { "0.0.0.0" } ... + // Override prometheus + if cli.prometheus_external { + config.prometheus_port = Some( + parse_address(&format!("{}:{}", prometheus_interface, 33333), cli.prometheus_port)? + )} } ``` @@ -270,12 +379,12 @@ client/cli/src/params.rs ```rust pub struct RunCmd{ ... -/// Prometheus exporter TCP port. + /// Prometheus exporter TCP port. #[structopt(long = "prometheus-port", value_name = "PORT")] pub prometheus_port: Option, - /// Prometheus exporter IP addr. - #[structopt(long = "prometheus-addr", value_name = "Local IP address")] - pub prometheus_endpoint: Option, + /// Prometheus exporter on/off external". + #[structopt(long = "prometheus-external")] + pub prometheus_external: bool, ... } ``` @@ -284,8 +393,8 @@ client/service/src/config.rs #[derive(Clone)] pub struct Configuration { ... - /// Promteheus IP addr. `None` if disabled. and defult port 33333 - pub prometheus_endpoint: Option, + /// Promteheus Port. `None` if disabled. and defult port 33333 + pub prometheus_port: Option, ... } impl Configuration where @@ -297,7 +406,7 @@ impl Configuration where pub fn default_with_spec(chain_spec: ChainSpec) -> Self { let mut configuration = Configuration { ... - prometheus_endpoints: None, + prometheus_prot: None, ... }; configuration.network.boot_nodes = configuration.chain_spec.boot_nodes().to_vec(); diff --git a/utils/prometheus/src/lib.rs b/utils/prometheus/src/lib.rs index 4713f47291de0..70e0ebfd830cc 100644 --- a/utils/prometheus/src/lib.rs +++ b/utils/prometheus/src/lib.rs @@ -1,61 +1,138 @@ +// Copyright 2019 Parity Technologies (UK) Ltd. +// This file is part of Substrate. + +// Substrate is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Substrate is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Substrate. If not, see . + + #[macro_use] extern crate lazy_static; -#[macro_use] -extern crate log; +use futures_util::{FutureExt,future::{Future}}; use hyper::http::StatusCode; -use hyper::rt::Future; -use hyper::service::service_fn_ok; -use hyper::{Body, Request, Response, Server}; +use hyper::Server; +use hyper::{Body, Request, Response, service::{service_fn, make_service_fn}}; pub use prometheus::{Encoder, HistogramOpts, Opts, TextEncoder}; -pub use prometheus::{Histogram, IntCounter, IntGauge, Result}; +pub use prometheus::{Histogram, IntCounter, IntGauge}; pub use sp_runtime::traits::SaturatedConversion; use std::net::SocketAddr; - +#[cfg(not(target_os = "unknown"))] +mod networking; pub mod metrics; +#[derive(Debug, derive_more::Display, derive_more::From)] +pub enum Error { + /// Hyper internal error. + Hyper(hyper::Error), + /// Http request error. + Http(hyper::http::Error), + /// i/o error. + Io(std::io::Error) +} +impl std::error::Error for Error { + fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { + match self { + Error::Hyper(error) => Some(error), + Error::Http(error) => Some(error), + Error::Io(error) => Some(error) + } + } +} + +async fn request_metrics(req: Request) -> Result, Error> { + if req.uri().path() == "/metrics" { + let metric_families = prometheus::gather(); + let mut buffer = vec![]; + let encoder = TextEncoder::new(); + encoder.encode(&metric_families, &mut buffer).unwrap(); + Response::builder() + .status(StatusCode::OK) + .header("Content-Type", encoder.format_type()) + .body(Body::from(buffer)) + .map_err(Error::Http) + //.expect("Sends OK(200) response with one or more data metrics") + } else { + Response::builder() + .status(StatusCode::NOT_FOUND) + .body(Body::from("Not found.")) + .map_err(Error::Http) + //.expect("Sends NOT_FOUND(404) message with no data metric") + } + +} + +#[derive(Clone)] +pub struct Executor; + +#[cfg(not(target_os = "unknown"))] +impl hyper::rt::Executor for Executor + where + T: Future + Send + 'static, + T::Output: Send + 'static, +{ + fn execute(&self, future: T) { + async_std::task::spawn(future); + } +} /// Initializes the metrics context, and starts an HTTP server /// to serve metrics. -pub fn init_prometheus(prometheus_addr: SocketAddr) { - let addr = prometheus_addr; - let server = Server::bind(&addr) - .serve(|| { - // This is the `Service` that will handle the connection. - // `service_fn_ok` is a helper to convert a function that - // returns a Response into a `Service`. - service_fn_ok(move |req: Request| { - if req.uri().path() == "/metrics" { - let metric_families = prometheus::gather(); - let mut buffer = vec![]; - let encoder = TextEncoder::new(); - encoder.encode(&metric_families, &mut buffer).unwrap(); - Response::builder() - .status(StatusCode::OK) - .header("Content-Type", encoder.format_type()) - .body(Body::from(buffer)) - .expect("Sends OK(200) response with one or more data metrics") - } else { - Response::builder() - .status(StatusCode::NOT_FOUND) - .body(Body::from("Not found.")) - .expect("Sends NOT_FOUND(404) message with no data metric") - } - }) - }) - .map_err(|e| error!("server error: {}", e)); - - info!("Exporting metrics at http://{}/metrics", addr); - - let mut rt = tokio::runtime::Builder::new() - .core_threads(1) // one thread is sufficient - .build() - .expect("Builds one thread of tokio runtime exporter for prometheus"); - - std::thread::spawn(move || { - rt.spawn(server); - rt.shutdown_on_idle().wait().unwrap(); - }); +#[cfg(not(target_os = "unknown"))] +pub async fn init_prometheus(mut prometheus_addr: SocketAddr) -> Result<(), Error>{ + use async_std::{net, io}; + use crate::networking::Incoming; + + let listener = loop { + let listener = net::TcpListener::bind(&prometheus_addr).await; + match listener { + Ok(listener) => { + log::info!("Prometheus server started at {}", prometheus_addr); + break listener + }, + Err(err) => match err.kind() { + io::ErrorKind::AddrInUse | io::ErrorKind::PermissionDenied if prometheus_addr.port() != 0 => { + log::warn!( + "Prometheus server to already {} port.", prometheus_addr.port() + ); + prometheus_addr.set_port(0); + continue; + }, + _ => return Err(err.into()) + } + } + }; + let service = make_service_fn(|_| { + async { + Ok::<_, Error>(service_fn(request_metrics)) + } + }); + + + let _server = Server::builder(Incoming(listener.incoming())) + .executor(Executor) + .serve(service) + .boxed(); + + + let result = _server.await.map_err(Into::into); + + result } +#[cfg(target_os = "unknown")] +pub async fn init_prometheus(_: SocketAddr) -> Result<(), Error> { + Ok(()) +} + + #[macro_export] macro_rules! prometheus_gauge( ($($metric:expr => $value:expr),*) => { diff --git a/utils/prometheus/src/metrics.rs b/utils/prometheus/src/metrics.rs index dfb9c4ec57720..a653535c11092 100644 --- a/utils/prometheus/src/metrics.rs +++ b/utils/prometheus/src/metrics.rs @@ -1,5 +1,22 @@ -pub use crate::*; +// Copyright 2019 Parity Technologies (UK) Ltd. +// This file is part of Substrate. + +// Substrate is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Substrate is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// You should have received a copy of the GNU General Public License +// along with Substrate. If not, see . + + +pub use crate::*; +pub use prometheus::Result; /// Gauge type metrics generation function pub fn try_create_int_gauge(name: &str, help: &str) -> Result { let opts = Opts::new(name, help); diff --git a/utils/prometheus/src/networking.rs b/utils/prometheus/src/networking.rs new file mode 100644 index 0000000000000..f5bbd21d57a86 --- /dev/null +++ b/utils/prometheus/src/networking.rs @@ -0,0 +1,66 @@ +// Copyright 2019 Parity Technologies (UK) Ltd. +// This file is part of Substrate. + +// Substrate is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Substrate is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Substrate. If not, see . + +use async_std::pin::Pin; +use std::task::{Poll, Context}; +use futures_util::{stream::Stream, io::{AsyncRead, AsyncWrite}}; + +pub struct Incoming<'a>(pub async_std::net::Incoming<'a>); + +impl hyper::server::accept::Accept for Incoming<'_> { + type Conn = TcpStream; + type Error = async_std::io::Error; + + fn poll_accept(self: Pin<&mut Self>, cx: &mut Context) -> Poll>> { + Pin::new(&mut Pin::into_inner(self).0) + .poll_next(cx) + .map(|opt| opt.map(|res| res.map(TcpStream))) + } +} + +pub struct TcpStream(pub async_std::net::TcpStream); + +impl tokio::io::AsyncRead for TcpStream { + fn poll_read( + self: Pin<&mut Self>, + cx: &mut Context, + buf: &mut [u8] + ) -> Poll> { + Pin::new(&mut Pin::into_inner(self).0) + .poll_read(cx, buf) + } +} + +impl tokio::io::AsyncWrite for TcpStream { + fn poll_write( + self: Pin<&mut Self>, + cx: &mut Context, + buf: &[u8] + ) -> Poll> { + Pin::new(&mut Pin::into_inner(self).0) + .poll_write(cx, buf) + } + + fn poll_flush(self: Pin<&mut Self>, cx: &mut Context) -> Poll> { + Pin::new(&mut Pin::into_inner(self).0) + .poll_flush(cx) + } + + fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context) -> Poll> { + Pin::new(&mut Pin::into_inner(self).0) + .poll_close(cx) + } +} From b0528293cdb0114da83f103b51d2b54d53848475 Mon Sep 17 00:00:00 2001 From: nodebreaker-carlsagan Date: Fri, 3 Jan 2020 19:03:19 +0900 Subject: [PATCH 15/42] prometheus networking.rs del, grafana-data-source networking.rs pub edit and note --- Cargo.lock | 1 + client/service/src/builder.rs | 2 +- utils/grafana-data-source/src/lib.rs | 2 +- utils/prometheus/Cargo.toml | 1 + utils/prometheus/README.md | 67 +++------------------------- utils/prometheus/src/lib.rs | 8 ++-- utils/prometheus/src/metrics.rs | 6 +-- utils/prometheus/src/networking.rs | 66 --------------------------- 8 files changed, 17 insertions(+), 136 deletions(-) delete mode 100644 utils/prometheus/src/networking.rs diff --git a/Cargo.lock b/Cargo.lock index 1c68365731295..bd1aafbf7481d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5694,6 +5694,7 @@ dependencies = [ "async-std 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "derive_more 0.99.2 (registry+https://github.com/rust-lang/crates.io-index)", "futures-util 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "grafana-data-source 2.0.0", "hyper 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/client/service/src/builder.rs b/client/service/src/builder.rs index 6e216d499cc0d..2a99396f4f0b6 100644 --- a/client/service/src/builder.rs +++ b/client/service/src/builder.rs @@ -978,7 +978,7 @@ ServiceBuilder< "disk_write_per_sec" => info.usage.as_ref().map(|usage| usage.io.bytes_written).unwrap_or(0), ); prometheus_gauge!( - MEMPOOL_SIZE => used_state_cache_size as u64, + STATE_CACHE_SIZE => used_state_cache_size as u64, NODE_MEMORY => memory as u64, NODE_CPU => cpu_usage as u64, TX_COUNT => txpool_status.ready as u64, diff --git a/utils/grafana-data-source/src/lib.rs b/utils/grafana-data-source/src/lib.rs index fbba064706e0a..eacb0c59df38d 100644 --- a/utils/grafana-data-source/src/lib.rs +++ b/utils/grafana-data-source/src/lib.rs @@ -31,7 +31,7 @@ use parking_lot::RwLock; mod types; mod server; #[cfg(not(target_os = "unknown"))] -mod networking; +pub mod networking; mod database; use database::Database; diff --git a/utils/prometheus/Cargo.toml b/utils/prometheus/Cargo.toml index ea131e3952049..4102e33e9821f 100644 --- a/utils/prometheus/Cargo.toml +++ b/utils/prometheus/Cargo.toml @@ -14,6 +14,7 @@ tokio = "0.2" futures-util = { version = "0.3.1", default-features = false, features = ["io"] } sp-runtime = { package = "sp-runtime",path = "../../primitives/runtime" } derive_more = "0.99" +grafana-data-source = { version = "2.0.0", path = "../grafana-data-source" } [target.'cfg(not(target_os = "unknown"))'.dependencies] async-std = { version = "1.0.1", features = ["unstable"] } \ No newline at end of file diff --git a/utils/prometheus/README.md b/utils/prometheus/README.md index 9fec16a81ca15..06830426848cc 100644 --- a/utils/prometheus/README.md +++ b/utils/prometheus/README.md @@ -41,8 +41,7 @@ pub use prometheus::{Encoder, HistogramOpts, Opts, TextEncoder}; pub use prometheus::{Histogram, IntCounter, IntGauge}; pub use sp_runtime::traits::SaturatedConversion; use std::net::SocketAddr; -#[cfg(not(target_os = "unknown"))] -mod networking; + pub mod metrics; #[derive(Debug, derive_more::Display, derive_more::From)] @@ -104,7 +103,7 @@ impl hyper::rt::Executor for Executor #[cfg(not(target_os = "unknown"))] pub async fn init_prometheus(mut prometheus_addr: SocketAddr) -> Result<(), Error>{ use async_std::{net, io}; - use crate::networking::Incoming; + use grafana_data_source::networking::Incoming; let listener = loop { let listener = net::TcpListener::bind(&prometheus_addr).await; @@ -182,60 +181,6 @@ macro_rules! prometheus( ); */ ``` -utuls/prometheus/src/networking.rs ( grafana-data-source Note) -```rust -use async_std::pin::Pin; -use std::task::{Poll, Context}; -use futures_util::{stream::Stream, io::{AsyncRead, AsyncWrite}}; - -pub struct Incoming<'a>(pub async_std::net::Incoming<'a>); - -impl hyper::server::accept::Accept for Incoming<'_> { - type Conn = TcpStream; - type Error = async_std::io::Error; - - fn poll_accept(self: Pin<&mut Self>, cx: &mut Context) -> Poll>> { - Pin::new(&mut Pin::into_inner(self).0) - .poll_next(cx) - .map(|opt| opt.map(|res| res.map(TcpStream))) - } -} - -pub struct TcpStream(pub async_std::net::TcpStream); - -impl tokio::io::AsyncRead for TcpStream { - fn poll_read( - self: Pin<&mut Self>, - cx: &mut Context, - buf: &mut [u8] - ) -> Poll> { - Pin::new(&mut Pin::into_inner(self).0) - .poll_read(cx, buf) - } -} - -impl tokio::io::AsyncWrite for TcpStream { - fn poll_write( - self: Pin<&mut Self>, - cx: &mut Context, - buf: &[u8] - ) -> Poll> { - Pin::new(&mut Pin::into_inner(self).0) - .poll_write(cx, buf) - } - - fn poll_flush(self: Pin<&mut Self>, cx: &mut Context) -> Poll> { - Pin::new(&mut Pin::into_inner(self).0) - .poll_flush(cx) - } - - fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context) -> Poll> { - Pin::new(&mut Pin::into_inner(self).0) - .poll_close(cx) - } -} - -``` @@ -291,7 +236,7 @@ use sc_prometheus::prometheus_gauge; "used_state_cache_size" => used_state_cache_size, ); prometheus_gauge!( - MEMPOOL_SIZE => used_state_cache_size as u64, + STATE_CACHE_SIZE => used_state_cache_size as u64, NODE_MEMORY => memory as u64, NODE_CPU => cpu_usage as u64, TX_COUNT => txpool_status.ready as u64, @@ -503,7 +448,7 @@ use sc-prometheus::{prometheus_gauge}; ); prometheus_gauge!( - MEMPOOL_SIZE => used_state_cache_size as u64, + STATE_CACHE_SIZE => used_state_cache_size as u64, NODE_MEMORY => memory as u64, NODE_CPU => cpu_usage as u64, TX_COUNT => txpool_status.ready as u64, @@ -537,14 +482,14 @@ Consensus metrics, namespace: `substrate` | consensus_num_txs | Gauge | | Number of transactions | | consensus_node_memory | IntGauge | | Node's primary memory | | consensus_node_cpu | IntGauge | | Node's cpu load | +| consensus_state_cache_size | IntGauge | | used state cache size | | p2p_peers_number | IntGauge | | Number of peers node's connected to | | p2p_peer_receive_bytes_per_sec | IntGauge | | number of bytes received from a given peer | | p2p_peer_send_bytes_per_sec | IntGauge | | number of bytes sent to a given peer | -| mempool_size | IntGauge | | Number of uncommitted transactions | | Resource_receive_bytes_per_sec(Future) | IntGauge | | Operating System of bytes received | | Resource_send_bytes_per_sec(Future) | IntGauge | | Operating System of bytes sent | | Resource_cpu_use(Future) | IntGauge | | Operating System cpu load | -| Resource_disk_use(Future) | IntGauge | | Operating System disk use | +| Resource_disk_use(Future) | IntGauge | | Operating System disk use | | validator_sign_prevote(Future) | IntGauge | validator addr | validator sign vote list | | validator_sign_precommit(Future) | IntGauge | validator addr | validator sign commit list | diff --git a/utils/prometheus/src/lib.rs b/utils/prometheus/src/lib.rs index 70e0ebfd830cc..0765c40aedebd 100644 --- a/utils/prometheus/src/lib.rs +++ b/utils/prometheus/src/lib.rs @@ -25,8 +25,9 @@ pub use prometheus::{Encoder, HistogramOpts, Opts, TextEncoder}; pub use prometheus::{Histogram, IntCounter, IntGauge}; pub use sp_runtime::traits::SaturatedConversion; use std::net::SocketAddr; -#[cfg(not(target_os = "unknown"))] -mod networking; +//#[cfg(not(target_os = "unknown"))] +//mod networking; + pub mod metrics; #[derive(Debug, derive_more::Display, derive_more::From)] @@ -88,8 +89,7 @@ impl hyper::rt::Executor for Executor #[cfg(not(target_os = "unknown"))] pub async fn init_prometheus(mut prometheus_addr: SocketAddr) -> Result<(), Error>{ use async_std::{net, io}; - use crate::networking::Incoming; - + use grafana_data_source::networking::Incoming; let listener = loop { let listener = net::TcpListener::bind(&prometheus_addr).await; match listener { diff --git a/utils/prometheus/src/metrics.rs b/utils/prometheus/src/metrics.rs index a653535c11092..ee7787f4b24dc 100644 --- a/utils/prometheus/src/metrics.rs +++ b/utils/prometheus/src/metrics.rs @@ -81,9 +81,9 @@ lazy_static! { "consensus_node_cpu", "node cpu" ); - pub static ref MEMPOOL_SIZE: Result = try_create_int_gauge( - "mempool_size", - "Number of uncommitted transactions" + pub static ref STATE_CACHE_SIZE: Result = try_create_int_gauge( + "consensus_state_cache_size", + "used state cache size" ); pub static ref P2P_NODE_DOWNLOAD: Result = try_create_int_gauge( "p2p_peers_receive_byte_per_sec", diff --git a/utils/prometheus/src/networking.rs b/utils/prometheus/src/networking.rs deleted file mode 100644 index f5bbd21d57a86..0000000000000 --- a/utils/prometheus/src/networking.rs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2019 Parity Technologies (UK) Ltd. -// This file is part of Substrate. - -// Substrate is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Substrate is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Substrate. If not, see . - -use async_std::pin::Pin; -use std::task::{Poll, Context}; -use futures_util::{stream::Stream, io::{AsyncRead, AsyncWrite}}; - -pub struct Incoming<'a>(pub async_std::net::Incoming<'a>); - -impl hyper::server::accept::Accept for Incoming<'_> { - type Conn = TcpStream; - type Error = async_std::io::Error; - - fn poll_accept(self: Pin<&mut Self>, cx: &mut Context) -> Poll>> { - Pin::new(&mut Pin::into_inner(self).0) - .poll_next(cx) - .map(|opt| opt.map(|res| res.map(TcpStream))) - } -} - -pub struct TcpStream(pub async_std::net::TcpStream); - -impl tokio::io::AsyncRead for TcpStream { - fn poll_read( - self: Pin<&mut Self>, - cx: &mut Context, - buf: &mut [u8] - ) -> Poll> { - Pin::new(&mut Pin::into_inner(self).0) - .poll_read(cx, buf) - } -} - -impl tokio::io::AsyncWrite for TcpStream { - fn poll_write( - self: Pin<&mut Self>, - cx: &mut Context, - buf: &[u8] - ) -> Poll> { - Pin::new(&mut Pin::into_inner(self).0) - .poll_write(cx, buf) - } - - fn poll_flush(self: Pin<&mut Self>, cx: &mut Context) -> Poll> { - Pin::new(&mut Pin::into_inner(self).0) - .poll_flush(cx) - } - - fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context) -> Poll> { - Pin::new(&mut Pin::into_inner(self).0) - .poll_close(cx) - } -} From 4e831e90f6145f0d79f2e747007d486298cddba5 Mon Sep 17 00:00:00 2001 From: nodebreaker-carlsagan Date: Fri, 10 Jan 2020 14:57:00 +0900 Subject: [PATCH 16/42] chore: reflect various feedback --- client/service/src/config.rs | 2 +- utils/prometheus/Cargo.toml | 2 +- utils/prometheus/README.md | 28 +++++++--------------------- utils/prometheus/src/lib.rs | 15 --------------- utils/prometheus/src/metrics.rs | 20 ++++++++++++-------- 5 files changed, 21 insertions(+), 46 deletions(-) diff --git a/client/service/src/config.rs b/client/service/src/config.rs index eb97283661c7e..cb691820d9f30 100644 --- a/client/service/src/config.rs +++ b/client/service/src/config.rs @@ -75,7 +75,7 @@ pub struct Configuration { pub rpc_cors: Option>, /// Grafana data source http port. `None` if disabled. pub grafana_port: Option, - /// Promteheus Port. `None` if disabled. and defult port 33333 + /// Prometheus Port.`None` if disabled and port 33333 by default. pub prometheus_port: Option, /// Telemetry service URL. `None` if disabled. pub telemetry_endpoints: Option, diff --git a/utils/prometheus/Cargo.toml b/utils/prometheus/Cargo.toml index 4102e33e9821f..46b5c42ca3ef4 100644 --- a/utils/prometheus/Cargo.toml +++ b/utils/prometheus/Cargo.toml @@ -17,4 +17,4 @@ derive_more = "0.99" grafana-data-source = { version = "2.0.0", path = "../grafana-data-source" } [target.'cfg(not(target_os = "unknown"))'.dependencies] -async-std = { version = "1.0.1", features = ["unstable"] } \ No newline at end of file +async-std = { version = "1.0.1", features = ["unstable"] } diff --git a/utils/prometheus/README.md b/utils/prometheus/README.md index 06830426848cc..e5952f1e192c4 100644 --- a/utils/prometheus/README.md +++ b/utils/prometheus/README.md @@ -2,12 +2,12 @@ ![grants](./photo_2019-12-13_16-32-53.jpg) ## Introduction -Prometheus is one of the most widely used monitoring tool for managing high availability services supported by [Cloud Native Computing Foundation](https://www.cncf.io/). By providing Prometheus exporter in substrate, node operators can easily adopt widely used display/alert tool such as Grafana without seting-up/operating external Prometheus agent through RPC connections. Easy access to such monitoring tools will benefit parachain develepers/operators and validators to have much higher availability quality of their services. +Prometheus is one of the most widely used monitoring tool for managing high availability services supported by [Cloud Native Computing Foundation](https://www.cncf.io/). By providing Prometheus metrics in Substrate, node operators can easily adopt widely used display/alert tools such as Grafana and Alertmanager without setting-up/operating external Prometheus push gateways (which is an antipattern in the first place) through RPC connections. Easy access to such monitoring tools will benefit parachain developers/operators and validators to have much higher availability of their services. -## List of Contents +## Table of Contents Hack Prometheus in Substrate - - Prometheus starter + - Prometheus primer - CLI Config - Metrics Add @@ -23,11 +23,11 @@ Start Grafana - Install Grafana ## Substrate Dev hack -### Prometheus starter +### Prometheus primer Here is the entry point of prometheus core module in Parity Substrate. -In existing sources, refer to the grapana source due to the issue of the wasm. +In existing sources, refer to the Grafana source due to the issue of the wasm. utils/prometheus/src/lib.rs ```rust @@ -74,13 +74,11 @@ async fn request_metrics(req: Request) -> Result, Error> { .header("Content-Type", encoder.format_type()) .body(Body::from(buffer)) .map_err(Error::Http) - //.expect("Sends OK(200) response with one or more data metrics") } else { Response::builder() .status(StatusCode::NOT_FOUND) .body(Body::from("Not found.")) .map_err(Error::Http) - //.expect("Sends NOT_FOUND(404) message with no data metric") } } @@ -168,18 +166,7 @@ macro_rules! prometheus_histogram( } ); -/* -TODO: Make abstract type for all metrics(e.g. Gauge, Histogram, Counter) with generic traits so that all metrics can be set up with one function `set` -#[macro_export] -macro_rules! prometheus( - ($($a: expr; $metric:expr => $value:expr),*) => { - use $crate::{metrics::*}; - $( - metrics::set(#$a, &$metric, $value); - )* - } -); -*/ + ``` @@ -338,7 +325,7 @@ client/service/src/config.rs #[derive(Clone)] pub struct Configuration { ... - /// Promteheus Port. `None` if disabled. and defult port 33333 + /// Prometheus Port.`None` if disabled and port 33333 by default. pub prometheus_port: Option, ... } @@ -392,7 +379,6 @@ lazy_static! { pub static ref FINALITY_HEIGHT: Result = try_create_int_gauge( "consensus_finality_block_height_number", "block is finality HEIGHT" - ); } ``` diff --git a/utils/prometheus/src/lib.rs b/utils/prometheus/src/lib.rs index 0765c40aedebd..a6d9397575db6 100644 --- a/utils/prometheus/src/lib.rs +++ b/utils/prometheus/src/lib.rs @@ -60,13 +60,11 @@ async fn request_metrics(req: Request) -> Result, Error> { .header("Content-Type", encoder.format_type()) .body(Body::from(buffer)) .map_err(Error::Http) - //.expect("Sends OK(200) response with one or more data metrics") } else { Response::builder() .status(StatusCode::NOT_FOUND) .body(Body::from("Not found.")) .map_err(Error::Http) - //.expect("Sends NOT_FOUND(404) message with no data metric") } } @@ -152,16 +150,3 @@ macro_rules! prometheus_histogram( )* } ); - -/* -TODO: Make abstract type for all metrics(e.g. Gauge, Histogram, Counter) with generic traits so that all metrics can be set up with one function `set` -#[macro_export] -macro_rules! prometheus( - ($($a: expr; $metric:expr => $value:expr),*) => { - use $crate::{metrics::*}; - $( - metrics::set(#$a, &$metric, $value); - )* - } -); -*/ \ No newline at end of file diff --git a/utils/prometheus/src/metrics.rs b/utils/prometheus/src/metrics.rs index ee7787f4b24dc..61a7fcc6eb3fc 100644 --- a/utils/prometheus/src/metrics.rs +++ b/utils/prometheus/src/metrics.rs @@ -32,19 +32,19 @@ pub fn try_create_histogram(name: &str, help: &str) -> Result { Ok(histogram) } -///Gauge Metrics a value in injection. +/// Gauge Metrics a value in injection. pub fn set_gauge(gauge: &Result, value: u64) { if let Ok(gauge) = gauge { gauge.set(value as i64); } } -///histogram Metrics a value in injection. +/// histogram Metrics a value in injection. pub fn set_histogram(histogram: &Result, value: f64) { if let Ok(histogram) = histogram { histogram.observe(value) } } -//All of the metrics in the prometheus are managed by the lazy_static. +/// All of the metrics in the prometheus are managed by the lazy_static. lazy_static! { pub static ref FINALITY_HEIGHT: Result = try_create_int_gauge( @@ -52,45 +52,49 @@ lazy_static! { "block is finality HEIGHT" ); + pub static ref BEST_HEIGHT: Result = try_create_int_gauge( "consensus_best_block_height_number", "block is best HEIGHT" ); - pub static ref BLOCK_INTERVAL_SECONDS: Result = try_create_histogram( - "consensus_block_interval_seconds", - "Time between this and last block(Block.Header.Time) in seconds" - ); pub static ref P2P_PEERS_NUM: Result = try_create_int_gauge( "p2p_peers_number", "network gosip peers number" ); + pub static ref TARGET_NUM: Result = try_create_int_gauge( "consensus_target_syn_number", "block syn target number" ); + pub static ref TX_COUNT: Result = try_create_int_gauge( "consensus_num_txs", "Number of transactions" ); + pub static ref NODE_MEMORY: Result = try_create_int_gauge( "consensus_node_memory", "node memory" ); + pub static ref NODE_CPU: Result = try_create_int_gauge( "consensus_node_cpu", "node cpu" ); + pub static ref STATE_CACHE_SIZE: Result = try_create_int_gauge( "consensus_state_cache_size", "used state cache size" ); + pub static ref P2P_NODE_DOWNLOAD: Result = try_create_int_gauge( "p2p_peers_receive_byte_per_sec", "p2p_node_download_per_sec_byte" ); + pub static ref P2P_NODE_UPLOAD: Result = try_create_int_gauge( "p2p_peers_send_byte_per_sec", "p2p_node_upload_per_sec_byte" ); -} \ No newline at end of file +} From 0b15bc40db985cac509f2eb0178763b0f86b8369 Mon Sep 17 00:00:00 2001 From: Ashley Date: Fri, 10 Jan 2020 12:26:33 +0100 Subject: [PATCH 17/42] Replace grafana and tidy --- Cargo.lock | 68 ++++-------- Cargo.toml | 2 - client/cli/Cargo.toml | 2 +- client/cli/src/informant/display.rs | 16 ++- client/cli/src/lib.rs | 12 +-- client/cli/src/params.rs | 22 ++-- client/service/Cargo.toml | 3 +- client/service/src/builder.rs | 95 +++++++++-------- client/service/src/config.rs | 5 +- client/service/test/src/lib.rs | 1 - client/tracing/Cargo.toml | 1 - client/tracing/src/lib.rs | 16 ++- utils/grafana-data-source/Cargo.toml | 23 ---- utils/grafana-data-source/test/Cargo.toml | 13 --- utils/prometheus/Cargo.toml | 10 +- .../prometheus/photo_2019-12-13_16-32-53.jpg | Bin 27726 -> 0 bytes utils/prometheus/src/lib.rs | 86 ++++++--------- utils/prometheus/src/metrics.rs | 100 ------------------ .../src/networking.rs | 0 19 files changed, 144 insertions(+), 331 deletions(-) delete mode 100644 utils/grafana-data-source/Cargo.toml delete mode 100644 utils/grafana-data-source/test/Cargo.toml delete mode 100644 utils/prometheus/photo_2019-12-13_16-32-53.jpg delete mode 100644 utils/prometheus/src/metrics.rs rename utils/{grafana-data-source => prometheus}/src/networking.rs (100%) diff --git a/Cargo.lock b/Cargo.lock index bd1aafbf7481d..34e17b7f2b481 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -533,7 +533,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1711,34 +1710,6 @@ dependencies = [ "scroll 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "grafana-data-source" -version = "2.0.0" -dependencies = [ - "async-std 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", - "derive_more 0.99.2 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-timer 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-util 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "grafana-data-source-test" -version = "2.0.0" -dependencies = [ - "futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-timer 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "grafana-data-source 2.0.0", - "rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "h2" version = "0.1.26" @@ -4528,6 +4499,21 @@ dependencies = [ "spin 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "prometheus-endpoint" +version = "2.0.0" +dependencies = [ + "async-std 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "derive_more 0.99.2 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-util 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "prometheus 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-runtime 2.0.0", + "tokio 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "prost" version = "0.5.0" @@ -5153,11 +5139,11 @@ dependencies = [ "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "names 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "prometheus-endpoint 2.0.0", "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "rpassword 4.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "sc-client-api 2.0.0", "sc-network 0.8.0", - "sc-prometheus 2.0.0", "sc-service 2.0.0", "sc-telemetry 2.0.0", "sc-tracing 2.0.0", @@ -5687,22 +5673,6 @@ dependencies = [ "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "sc-prometheus" -version = "2.0.0" -dependencies = [ - "async-std 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "derive_more 0.99.2 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-util 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "grafana-data-source 2.0.0", - "hyper 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "prometheus 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-runtime 2.0.0", - "tokio 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "sc-rpc" version = "2.0.0" @@ -5794,12 +5764,12 @@ dependencies = [ "exit-future 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "grafana-data-source 2.0.0", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "parity-multiaddr 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "prometheus-endpoint 2.0.0", "sc-chain-spec 2.0.0", "sc-client 2.0.0", "sc-client-api 2.0.0", @@ -5809,7 +5779,6 @@ dependencies = [ "sc-keystore 2.0.0", "sc-network 0.8.0", "sc-offchain 2.0.0", - "sc-prometheus 2.0.0", "sc-rpc 2.0.0", "sc-rpc-server 2.0.0", "sc-telemetry 2.0.0", @@ -5894,7 +5863,6 @@ name = "sc-tracing" version = "2.0.0" dependencies = [ "erased-serde 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "grafana-data-source 2.0.0", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "sc-telemetry 2.0.0", @@ -8880,4 +8848,4 @@ dependencies = [ "checksum zeroize_derive 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "de251eec69fc7c1bc3923403d18ececb929380e016afe103da75f396704f8ca2" "checksum zstd 0.5.1+zstd.1.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "5c5d978b793ae64375b80baf652919b148f6a496ac8802922d9999f5a553194f" "checksum zstd-safe 2.0.3+zstd.1.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "bee25eac9753cfedd48133fa1736cbd23b774e253d89badbeac7d12b23848d3f" -"checksum zstd-sys 1.4.15+zstd.1.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "89719b034dc22d240d5b407fb0a3fe6d29952c181cff9a9f95c0bd40b4f8f7d8" \ No newline at end of file +"checksum zstd-sys 1.4.15+zstd.1.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "89719b034dc22d240d5b407fb0a3fe6d29952c181cff9a9f95c0bd40b4f8f7d8" diff --git a/Cargo.toml b/Cargo.toml index d25dff212f9b9..9f4e9c3760c7d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -50,8 +50,6 @@ members = [ "client/transaction-pool/graph", "utils/prometheus", "utils/wasm-builder-runner", - "utils/grafana-data-source", - "utils/grafana-data-source/test", "frame/assets", "frame/aura", "frame/authority-discovery", diff --git a/client/cli/Cargo.toml b/client/cli/Cargo.toml index 5c7ac86904164..05fc019d0a9d9 100644 --- a/client/cli/Cargo.toml +++ b/client/cli/Cargo.toml @@ -29,7 +29,7 @@ sp-core = { version = "2.0.0", path = "../../primitives/core" } sc-service = { version = "2.0.0", default-features = false, path = "../service" } sp-state-machine = { version = "2.0.0", path = "../../primitives/state-machine" } sc-telemetry = { version = "2.0.0", path = "../telemetry" } -sc-prometheus = { path = "../../utils/prometheus" } +prometheus-endpoint = { path = "../../utils/prometheus" } sp-keyring = { version = "2.0.0", path = "../../primitives/keyring" } names = "0.11.0" structopt = "=0.3.7" diff --git a/client/cli/src/informant/display.rs b/client/cli/src/informant/display.rs index e34f5e53dfdad..93f60d5309531 100644 --- a/client/cli/src/informant/display.rs +++ b/client/cli/src/informant/display.rs @@ -18,10 +18,20 @@ use ansi_term::Colour; use sc_client_api::ClientInfo; use log::info; use sc_network::SyncState; -use sp_runtime::traits::{Block as BlockT, CheckedDiv, NumberFor, Zero, Saturating}; +use sp_runtime::traits::{ + Block as BlockT, CheckedDiv, NumberFor, Zero, Saturating, UniqueSaturatedInto +}; use sc_service::NetworkStatus; use std::{convert::{TryFrom, TryInto}, fmt, time}; -use sc_prometheus::prometheus_gauge; +use prometheus_endpoint::{create_gauge, Gauge}; + +prometheus_endpoint::lazy_static! { + pub static ref SYNC_TARGET: Gauge = create_gauge( + "sync_target_number", + "block sync target number" + ); +} + /// State of the informant display system. /// /// This is the system that handles the line that gets regularly printed and that looks something @@ -64,7 +74,7 @@ impl InformantDisplay { (SyncState::Idle, _) => ("Idle".into(), "".into()), (SyncState::Downloading, None) => (format!("Syncing{}", speed), "".into()), (SyncState::Downloading, Some(n)) => { - prometheus_gauge!(TARGET_NUM => n.saturated_into().try_into().unwrap()); + SYNC_TARGET.set(n.unique_saturated_into() as i64); (format!("Syncing{}", speed), format!(", target=#{}", n)) } }; diff --git a/client/cli/src/lib.rs b/client/cli/src/lib.rs index ff2c5a19ad73b..96bf17999cf3e 100644 --- a/client/cli/src/lib.rs +++ b/client/cli/src/lib.rs @@ -920,13 +920,12 @@ where let rpc_interface: &str = interface_str(cli.rpc_external, cli.unsafe_rpc_external, cli.validator)?; let ws_interface: &str = interface_str(cli.ws_external, cli.unsafe_ws_external, cli.validator)?; - let grafana_interface: &str = if cli.grafana_external { "0.0.0.0" } else { "127.0.0.1" }; let prometheus_interface: &str = if cli.prometheus_external { "0.0.0.0" } else { "127.0.0.1" }; config.rpc_http = Some(parse_address(&format!("{}:{}", rpc_interface, 9933), cli.rpc_port)?); config.rpc_ws = Some(parse_address(&format!("{}:{}", ws_interface, 9944), cli.ws_port)?); - config.grafana_port = Some( - parse_address(&format!("{}:{}", grafana_interface, 9955), cli.grafana_port)? + config.prometheus_port = Some( + parse_address(&format!("{}:{}", prometheus_interface, 9955), cli.prometheus_port)? ); config.rpc_ws_max_connections = cli.ws_max_connections; @@ -953,12 +952,7 @@ where config.tracing_targets = cli.tracing_targets.into(); config.tracing_receiver = cli.tracing_receiver.into(); - - // Override prometheus - if cli.prometheus_external { - config.prometheus_port = Some( - parse_address(&format!("{}:{}", prometheus_interface, 33333), cli.prometheus_port)? - )} + // Imply forced authoring on --dev config.force_authoring = cli.shared_params.dev || cli.force_authoring; diff --git a/client/cli/src/params.rs b/client/cli/src/params.rs index bcce3496abf19..b9aa6f172cd8c 100644 --- a/client/cli/src/params.rs +++ b/client/cli/src/params.rs @@ -298,7 +298,7 @@ arg_enum! { pub enum TracingReceiver { Log, Telemetry, - Grafana, + Prometheus, } } @@ -307,7 +307,7 @@ impl Into for TracingReceiver { match self { TracingReceiver::Log => sc_tracing::TracingReceiver::Log, TracingReceiver::Telemetry => sc_tracing::TracingReceiver::Telemetry, - TracingReceiver::Grafana => sc_tracing::TracingReceiver::Grafana, + TracingReceiver::Prometheus => sc_tracing::TracingReceiver::Prometheus, } } } @@ -440,12 +440,6 @@ pub struct RunCmd { /// Use `--unsafe-ws-external` to suppress the warning if you understand the risks. #[structopt(long = "ws-external")] pub ws_external: bool, - /// Prometheus exporter TCP port. - #[structopt(long = "prometheus-port", value_name = "PORT")] - pub prometheus_port: Option, - /// Prometheus exporter on/off external". - #[structopt(long = "prometheus-external")] - pub prometheus_external: bool, /// Listen to all Websocket interfaces. /// @@ -453,11 +447,11 @@ pub struct RunCmd { #[structopt(long = "unsafe-ws-external")] pub unsafe_ws_external: bool, - /// Listen to all Grafana data source interfaces. + /// Listen to all Prometheus endpoint interfaces. /// /// Default is local. - #[structopt(long = "grafana-external")] - pub grafana_external: bool, + #[structopt(long = "prometheus-external")] + pub prometheus_external: bool, /// Specify HTTP RPC server TCP port. #[structopt(long = "rpc-port", value_name = "PORT")] @@ -481,9 +475,9 @@ pub struct RunCmd { #[structopt(long = "rpc-cors", value_name = "ORIGINS", parse(try_from_str = parse_cors))] pub rpc_cors: Option, - /// Specify Grafana data source server TCP Port. - #[structopt(long = "grafana-port", value_name = "PORT")] - pub grafana_port: Option, + /// Specify Prometheus endpoint TCP Port. + #[structopt(long = "prometheus-port", value_name = "PORT")] + pub prometheus_port: Option, /// The human-readable name for this node. /// diff --git a/client/service/Cargo.toml b/client/service/Cargo.toml index 887e8415f39b7..42f0a73dfbfa2 100644 --- a/client/service/Cargo.toml +++ b/client/service/Cargo.toml @@ -51,10 +51,9 @@ sc-rpc = { version = "2.0.0", path = "../rpc" } sc-telemetry = { version = "2.0.0", path = "../telemetry" } sc-offchain = { version = "2.0.0", path = "../offchain" } parity-multiaddr = { package = "parity-multiaddr", version = "0.5.0" } -grafana-data-source = { version = "2.0.0", path = "../../utils/grafana-data-source" } +prometheus-endpoint = { path = "../../utils/prometheus" } sc-tracing = { version = "2.0.0", path = "../tracing" } tracing = "0.1.10" -sc-prometheus = { package = "sc-prometheus", path="../../utils/prometheus"} [dev-dependencies] substrate-test-runtime-client = { version = "2.0.0", path = "../../test-utils/runtime/client" } diff --git a/client/service/src/builder.rs b/client/service/src/builder.rs index 2a99396f4f0b6..b5d73e6df9f22 100644 --- a/client/service/src/builder.rs +++ b/client/service/src/builder.rs @@ -52,11 +52,51 @@ use std::{ use sysinfo::{get_current_pid, ProcessExt, System, SystemExt}; use sc_telemetry::{telemetry, SUBSTRATE_INFO}; use sp_transaction_pool::{TransactionPool, TransactionPoolMaintainer}; -use sc_prometheus::prometheus_gauge; - use sp_blockchain; -use grafana_data_source::{self, record_metrics}; +use prometheus_endpoint::{create_gauge, Gauge}; +prometheus_endpoint::lazy_static! { + pub static ref FINALITY_HEIGHT: Gauge = create_gauge( + "consensus_finality_block_height_number", + "block is finality HEIGHT" + ); + pub static ref BEST_HEIGHT: Gauge = create_gauge( + "consensus_best_block_height_number", + "block is best HEIGHT" + ); + pub static ref BLOCK_INTERVAL_SECONDS: Gauge = create_gauge( + "consensus_block_interval_seconds", + "Time between this and last block(Block.Header.Time) in seconds" + ); + pub static ref P2P_PEERS_NUM: Gauge = create_gauge( + "p2p_peers_number", + "network gosip peers number" + ); + pub static ref TX_COUNT: Gauge = create_gauge( + "consensus_num_txs", + "Number of transactions" + ); + pub static ref NODE_MEMORY: Gauge = create_gauge( + "consensus_node_memory", + "node memory" + ); + pub static ref NODE_CPU: Gauge = create_gauge( + "consensus_node_cpu", + "node cpu" + ); + pub static ref STATE_CACHE_SIZE: Gauge = create_gauge( + "consensus_state_cache_size", + "used state cache size" + ); + pub static ref P2P_NODE_DOWNLOAD: Gauge = create_gauge( + "p2p_peers_receive_byte_per_sec", + "p2p_node_download_per_sec_byte" + ); + pub static ref P2P_NODE_UPLOAD: Gauge = create_gauge( + "p2p_peers_send_byte_per_sec", + "p2p_node_upload_per_sec_byte" + ); +} /// Aggregator for the components required to build a service. /// /// # Usage @@ -977,32 +1017,14 @@ ServiceBuilder< "disk_read_per_sec" => info.usage.as_ref().map(|usage| usage.io.bytes_read).unwrap_or(0), "disk_write_per_sec" => info.usage.as_ref().map(|usage| usage.io.bytes_written).unwrap_or(0), ); - prometheus_gauge!( - STATE_CACHE_SIZE => used_state_cache_size as u64, - NODE_MEMORY => memory as u64, - NODE_CPU => cpu_usage as u64, - TX_COUNT => txpool_status.ready as u64, - FINALITY_HEIGHT => finalized_number as u64, - BEST_HEIGHT => best_number as u64, - P2P_PEERS_NUM => num_peers as u64, - P2P_NODE_DOWNLOAD => net_status.average_download_per_sec as u64, - P2P_NODE_UPLOAD => net_status.average_upload_per_sec as u64 - ); - let _ = record_metrics!( - "peers" => num_peers, - "height" => best_number, - "txcount" => txpool_status.ready, - "cpu" => cpu_usage, - "memory" => memory, - "finalized_height" => finalized_number, - "bandwidth_download" => bandwidth_download, - "bandwidth_upload" => bandwidth_upload, - "used_state_cache_size" => info.usage.as_ref().map(|usage| usage.memory.state_cache).unwrap_or(0), - "used_db_cache_size" => info.usage.as_ref().map(|usage| usage.memory.database_cache).unwrap_or(0), - "disk_read_per_sec" => info.usage.as_ref().map(|usage| usage.io.bytes_read).unwrap_or(0), - "disk_write_per_sec" => info.usage.as_ref().map(|usage| usage.io.bytes_written).unwrap_or(0), - ); - + NODE_MEMORY.set(memory as i64); + NODE_CPU.set(cpu_usage as i64); + TX_COUNT.set(txpool_status.ready as i64); + FINALITY_HEIGHT.set(finalized_number as i64); + BEST_HEIGHT.set(best_number as i64); + P2P_PEERS_NUM.set(num_peers as i64); + P2P_NODE_DOWNLOAD.set(net_status.average_download_per_sec as i64); + P2P_NODE_UPLOAD.set(net_status.average_upload_per_sec as i64); Ok(()) }).select(exit.clone().map(Ok).compat()).then(|_| Ok(())); let _ = to_spawn_tx.unbounded_send(Box::new(tel_task)); @@ -1139,21 +1161,10 @@ ServiceBuilder< .then(|_| Ok(())))); telemetry }); - // prometheus init + // Prometheus endpoint if let Some(port) = config.prometheus_port { let future = select( - sc_prometheus::init_prometheus(port).boxed() - ,exit.clone() - ).map(|either| match either { - Either::Left((result, _)) => result.map_err(|_| ()), - Either::Right(_) => Ok(()) - }).compat(); - let _ = to_spawn_tx.unbounded_send(Box::new(future)); - } - // Grafana data source - if let Some(port) = config.grafana_port { - let future = select( - grafana_data_source::run_server(port).boxed(), + prometheus_endpoint::init_prometheus(port).boxed(), exit.clone() ).map(|either| match either { Either::Left((result, _)) => result.map_err(|_| ()), diff --git a/client/service/src/config.rs b/client/service/src/config.rs index cb691820d9f30..9aa7f795ddeca 100644 --- a/client/service/src/config.rs +++ b/client/service/src/config.rs @@ -73,9 +73,7 @@ pub struct Configuration { pub rpc_ws_max_connections: Option, /// CORS settings for HTTP & WS servers. `None` if all origins are allowed. pub rpc_cors: Option>, - /// Grafana data source http port. `None` if disabled. - pub grafana_port: Option, - /// Prometheus Port.`None` if disabled and port 33333 by default. + /// Prometheus endpoint Port. `None` if disabled. pub prometheus_port: Option, /// Telemetry service URL. `None` if disabled. pub telemetry_endpoints: Option, @@ -180,7 +178,6 @@ impl Configuration where rpc_ws_max_connections: None, rpc_cors: Some(vec![]), prometheus_port: None, - grafana_port: None, telemetry_endpoints: None, telemetry_external_transport: None, default_heap_pages: None, diff --git a/client/service/test/src/lib.rs b/client/service/test/src/lib.rs index 56f75324eb7dc..c8dead0845c65 100644 --- a/client/service/test/src/lib.rs +++ b/client/service/test/src/lib.rs @@ -195,7 +195,6 @@ fn node_config ( rpc_ws_max_connections: None, rpc_cors: None, prometheus_port: None, - grafana_port: None, telemetry_endpoints: None, telemetry_external_transport: None, default_heap_pages: None, diff --git a/client/tracing/Cargo.toml b/client/tracing/Cargo.toml index 2ceee93f6a62a..ed9b52fc26e20 100644 --- a/client/tracing/Cargo.toml +++ b/client/tracing/Cargo.toml @@ -15,7 +15,6 @@ slog = { version = "2.5.2", features = ["nested-values"] } tracing-core = "0.1.7" sc-telemetry = { version = "2.0.0", path = "../telemetry" } -grafana-data-source = { version = "2.0.0", path = "../../utils/grafana-data-source" } [dev-dependencies] tracing = "0.1.10" diff --git a/client/tracing/src/lib.rs b/client/tracing/src/lib.rs index cd301041d39af..451f22fe14f6c 100644 --- a/client/tracing/src/lib.rs +++ b/client/tracing/src/lib.rs @@ -34,7 +34,7 @@ //! let span = tracing::span!(tracing::Level::INFO, "my_span_name", my_number = 10, a_key = "a value"); //! let _guard = span.enter(); //! ``` -//! Currently we provide `Log` (default), `Telemetry` and `Grafana` variants for `Receiver` +//! Currently we provide `Log` (default), `Telemetry` and `Prometheus` variants for `Receiver` use std::collections::HashMap; use std::fmt; @@ -53,7 +53,6 @@ use tracing_core::{ subscriber::Subscriber }; -use grafana_data_source::{self, record_metrics}; use sc_telemetry::{telemetry, SUBSTRATE_INFO}; /// Used to configure how to receive the metrics @@ -63,8 +62,8 @@ pub enum TracingReceiver { Log, /// Output to telemetry Telemetry, - /// Output to Grafana - Grafana, + /// Output to Prometheus endpoint + Prometheus, } impl Default for TracingReceiver { @@ -255,7 +254,7 @@ impl ProfilingSubscriber { match self.receiver { TracingReceiver::Log => print_log(span_datum), TracingReceiver::Telemetry => send_telemetry(span_datum), - TracingReceiver::Grafana => send_grafana(span_datum), + TracingReceiver::Prometheus => send_prometheus(span_datum), } } } @@ -291,9 +290,6 @@ fn send_telemetry(span_datum: SpanDatum) { ); } -fn send_grafana(span_datum: SpanDatum) { - let name = format!("{}::{}", span_datum.target, span_datum.name); - if let Err(e) = record_metrics!(&name => span_datum.overall_time.as_nanos(),) { - log::warn!("Unable to send metrics to grafana: {:?}", e); - } +fn send_prometheus(span_datum: SpanDatum) { + unimplemented!() } diff --git a/utils/grafana-data-source/Cargo.toml b/utils/grafana-data-source/Cargo.toml deleted file mode 100644 index 76bf7d5988d9a..0000000000000 --- a/utils/grafana-data-source/Cargo.toml +++ /dev/null @@ -1,23 +0,0 @@ -[package] -description = "Grafana data source server" -name = "grafana-data-source" -version = "2.0.0" -license = "GPL-3.0" -authors = ["Parity Technologies "] -edition = "2018" - -[dependencies] -log = "0.4.8" -hyper = { version = "0.13.1", default-features = false, features = ["stream"] } -tokio = "0.2" -futures-util = { version = "0.3.1", default-features = false, features = ["io"] } -serde_json = "1" -serde = { version = "1", features = ["derive"] } -chrono = { version = "0.4", features = ["serde"] } -lazy_static = "1.4" -parking_lot = "0.9" -futures-timer = "2.0" -derive_more = "0.99" - -[target.'cfg(not(target_os = "unknown"))'.dependencies] -async-std = { version = "1.0.1", features = ["unstable"] } diff --git a/utils/grafana-data-source/test/Cargo.toml b/utils/grafana-data-source/test/Cargo.toml deleted file mode 100644 index 079b49dc8608a..0000000000000 --- a/utils/grafana-data-source/test/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -description = "Grafana data source server test" -name = "grafana-data-source-test" -version = "2.0.0" -license = "GPL-3.0" -authors = ["Parity Technologies "] -edition = "2018" - -[dependencies] -grafana-data-source = { version = "2.0.0", path = ".." } -futures = "0.3" -futures-timer = "2.0" -rand = "0.7" diff --git a/utils/prometheus/Cargo.toml b/utils/prometheus/Cargo.toml index 46b5c42ca3ef4..3f3b4bf408df0 100644 --- a/utils/prometheus/Cargo.toml +++ b/utils/prometheus/Cargo.toml @@ -1,20 +1,20 @@ [package] -name = "sc-prometheus" +description = "Prometheus endpoint server" +name = "prometheus-endpoint" version = "2.0.0" +license = "GPL-3.0" authors = ["Parity Technologies "] -description = "prometheus utils" edition = "2018" [dependencies] -hyper = { version = "0.13.1", default-features = false, features = ["stream"] } -lazy_static = "1.4" log = "0.4.8" +hyper = { version = "0.13.1", default-features = false, features = ["stream"] } prometheus = { version = "0.7", features = ["nightly", "process"]} tokio = "0.2" futures-util = { version = "0.3.1", default-features = false, features = ["io"] } +lazy_static = "1.4" sp-runtime = { package = "sp-runtime",path = "../../primitives/runtime" } derive_more = "0.99" -grafana-data-source = { version = "2.0.0", path = "../grafana-data-source" } [target.'cfg(not(target_os = "unknown"))'.dependencies] async-std = { version = "1.0.1", features = ["unstable"] } diff --git a/utils/prometheus/photo_2019-12-13_16-32-53.jpg b/utils/prometheus/photo_2019-12-13_16-32-53.jpg deleted file mode 100644 index cdf44f88fb623d7b5a319235c6d603463698716c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 27726 zcmeFZcT`m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wxKj*3EegcTjcn$NV?bx>^!?t>Adb%1~>pKbWSe z8^Ra>4JWFK*5fROv6sYqRRmFE^$l{j)5@IJKx8zSyGL%E0~H(1;ZlF=z!%px-9w0$ z8yx{$C@&yzbg_Fn~o1f^PpdHVP2-b2=UXi1Tasg|exvf{Pyq(U0PS;ut26BQ> z;L*6vS^dbEuQWOEE4=8@js57=x+>eW z?-@c?e7s^hR}#!3c-U3gWK%;BuYqwdHV=7_3sWUkXHWV0_sCcuv@~s}h!up1(At+kaFO^=KyT&{a>MXi>v?u diff --git a/utils/prometheus/src/lib.rs b/utils/prometheus/src/lib.rs index a6d9397575db6..6883fae48fae1 100644 --- a/utils/prometheus/src/lib.rs +++ b/utils/prometheus/src/lib.rs @@ -22,13 +22,21 @@ use hyper::http::StatusCode; use hyper::Server; use hyper::{Body, Request, Response, service::{service_fn, make_service_fn}}; pub use prometheus::{Encoder, HistogramOpts, Opts, TextEncoder}; -pub use prometheus::{Histogram, IntCounter, IntGauge}; +pub use prometheus::{Histogram, IntCounter}; +pub use prometheus::IntGauge as Gauge; pub use sp_runtime::traits::SaturatedConversion; use std::net::SocketAddr; -//#[cfg(not(target_os = "unknown"))] -//mod networking; +#[cfg(not(target_os = "unknown"))] +mod networking; + +pub use lazy_static::lazy_static; -pub mod metrics; +pub fn create_gauge(name: &str, description: &str) -> Gauge { + let opts = Opts::new(name, description); + let gauge = Gauge::with_opts(opts).expect("Creating Gauge Failed"); + prometheus::register(Box::new(gauge.clone())).expect("Registering gauge failed"); + gauge +} #[derive(Debug, derive_more::Display, derive_more::From)] pub enum Error { @@ -50,23 +58,22 @@ impl std::error::Error for Error { } async fn request_metrics(req: Request) -> Result, Error> { - if req.uri().path() == "/metrics" { - let metric_families = prometheus::gather(); - let mut buffer = vec![]; - let encoder = TextEncoder::new(); - encoder.encode(&metric_families, &mut buffer).unwrap(); - Response::builder() - .status(StatusCode::OK) - .header("Content-Type", encoder.format_type()) - .body(Body::from(buffer)) - .map_err(Error::Http) - } else { - Response::builder() - .status(StatusCode::NOT_FOUND) - .body(Body::from("Not found.")) - .map_err(Error::Http) - } - + if req.uri().path() == "/metrics" { + let metric_families = prometheus::gather(); + let mut buffer = vec![]; + let encoder = TextEncoder::new(); + encoder.encode(&metric_families, &mut buffer).unwrap(); + Response::builder() + .status(StatusCode::OK) + .header("Content-Type", encoder.format_type()) + .body(Body::from(buffer)) + .map_err(Error::Http) + } else { + Response::builder() + .status(StatusCode::NOT_FOUND) + .body(Body::from("Not found.")) + .map_err(Error::Http) + } } #[derive(Clone)] @@ -86,8 +93,8 @@ impl hyper::rt::Executor for Executor /// to serve metrics. #[cfg(not(target_os = "unknown"))] pub async fn init_prometheus(mut prometheus_addr: SocketAddr) -> Result<(), Error>{ - use async_std::{net, io}; - use grafana_data_source::networking::Incoming; + use async_std::{net, io}; + use networking::Incoming; let listener = loop { let listener = net::TcpListener::bind(&prometheus_addr).await; match listener { @@ -103,23 +110,21 @@ pub async fn init_prometheus(mut prometheus_addr: SocketAddr) -> Result<(), Err prometheus_addr.set_port(0); continue; }, - _ => return Err(err.into()) - } + _ => return Err(err.into()) + } } }; - let service = make_service_fn(|_| { + let service = make_service_fn(|_| { async { Ok::<_, Error>(service_fn(request_metrics)) } }); - let _server = Server::builder(Incoming(listener.incoming())) .executor(Executor) .serve(service) - .boxed(); - - + .boxed(); + let result = _server.await.map_err(Into::into); result @@ -129,24 +134,3 @@ pub async fn init_prometheus(mut prometheus_addr: SocketAddr) -> Result<(), Err pub async fn init_prometheus(_: SocketAddr) -> Result<(), Error> { Ok(()) } - - -#[macro_export] -macro_rules! prometheus_gauge( - ($($metric:expr => $value:expr),*) => { - use $crate::{metrics::*}; - $( - metrics::set_gauge(&$metric, $value); - )* - } -); - -#[macro_export] -macro_rules! prometheus_histogram( - ($($metric:expr => $value:expr),*) => { - use $crate::{metrics::*}; - $( - metrics::set_histogram(&$metric, $value); - )* - } -); diff --git a/utils/prometheus/src/metrics.rs b/utils/prometheus/src/metrics.rs deleted file mode 100644 index 61a7fcc6eb3fc..0000000000000 --- a/utils/prometheus/src/metrics.rs +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright 2019 Parity Technologies (UK) Ltd. -// This file is part of Substrate. - -// Substrate is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Substrate is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Substrate. If not, see . - - -pub use crate::*; -pub use prometheus::Result; -/// Gauge type metrics generation function -pub fn try_create_int_gauge(name: &str, help: &str) -> Result { - let opts = Opts::new(name, help); - let gauge = IntGauge::with_opts(opts)?; - prometheus::register(Box::new(gauge.clone()))?; - Ok(gauge) -} -/// histogram type metrics generation function -pub fn try_create_histogram(name: &str, help: &str) -> Result { - let opts = HistogramOpts::new(name, help); - let histogram = Histogram::with_opts(opts)?; - prometheus::register(Box::new(histogram.clone()))?; - Ok(histogram) -} - -/// Gauge Metrics a value in injection. -pub fn set_gauge(gauge: &Result, value: u64) { - if let Ok(gauge) = gauge { - gauge.set(value as i64); - } -} -/// histogram Metrics a value in injection. -pub fn set_histogram(histogram: &Result, value: f64) { - if let Ok(histogram) = histogram { - histogram.observe(value) - } -} -/// All of the metrics in the prometheus are managed by the lazy_static. - -lazy_static! { - pub static ref FINALITY_HEIGHT: Result = try_create_int_gauge( - "consensus_finality_block_height_number", - "block is finality HEIGHT" - - ); - - pub static ref BEST_HEIGHT: Result = try_create_int_gauge( - "consensus_best_block_height_number", - "block is best HEIGHT" - ); - - pub static ref P2P_PEERS_NUM: Result = try_create_int_gauge( - "p2p_peers_number", - "network gosip peers number" - ); - - pub static ref TARGET_NUM: Result = try_create_int_gauge( - "consensus_target_syn_number", - "block syn target number" - ); - - pub static ref TX_COUNT: Result = try_create_int_gauge( - "consensus_num_txs", - "Number of transactions" - ); - - pub static ref NODE_MEMORY: Result = try_create_int_gauge( - "consensus_node_memory", - "node memory" - ); - - pub static ref NODE_CPU: Result = try_create_int_gauge( - "consensus_node_cpu", - "node cpu" - ); - - pub static ref STATE_CACHE_SIZE: Result = try_create_int_gauge( - "consensus_state_cache_size", - "used state cache size" - ); - - pub static ref P2P_NODE_DOWNLOAD: Result = try_create_int_gauge( - "p2p_peers_receive_byte_per_sec", - "p2p_node_download_per_sec_byte" - ); - - pub static ref P2P_NODE_UPLOAD: Result = try_create_int_gauge( - "p2p_peers_send_byte_per_sec", - "p2p_node_upload_per_sec_byte" - ); -} diff --git a/utils/grafana-data-source/src/networking.rs b/utils/prometheus/src/networking.rs similarity index 100% rename from utils/grafana-data-source/src/networking.rs rename to utils/prometheus/src/networking.rs From 8025361826b476f0fae9a5e1561b850c6e1de14f Mon Sep 17 00:00:00 2001 From: Ashley Date: Fri, 10 Jan 2020 12:11:58 +0100 Subject: [PATCH 18/42] Add generics --- Cargo.lock | 1 - client/cli/src/informant/display.rs | 6 ++-- client/service/src/builder.rs | 42 +++++++++++---------------- utils/prometheus/Cargo.toml | 1 - utils/prometheus/src/lib.rs | 44 ++++++++++++----------------- 5 files changed, 38 insertions(+), 56 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 34e17b7f2b481..60a7a4e1ad20f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4510,7 +4510,6 @@ dependencies = [ "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "prometheus 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-runtime 2.0.0", "tokio 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", ] diff --git a/client/cli/src/informant/display.rs b/client/cli/src/informant/display.rs index 93f60d5309531..c69cce143a386 100644 --- a/client/cli/src/informant/display.rs +++ b/client/cli/src/informant/display.rs @@ -23,10 +23,10 @@ use sp_runtime::traits::{ }; use sc_service::NetworkStatus; use std::{convert::{TryFrom, TryInto}, fmt, time}; -use prometheus_endpoint::{create_gauge, Gauge}; +use prometheus_endpoint::{create_gauge, Gauge, U64}; prometheus_endpoint::lazy_static! { - pub static ref SYNC_TARGET: Gauge = create_gauge( + pub static ref SYNC_TARGET: Gauge = create_gauge( "sync_target_number", "block sync target number" ); @@ -74,7 +74,7 @@ impl InformantDisplay { (SyncState::Idle, _) => ("Idle".into(), "".into()), (SyncState::Downloading, None) => (format!("Syncing{}", speed), "".into()), (SyncState::Downloading, Some(n)) => { - SYNC_TARGET.set(n.unique_saturated_into() as i64); + SYNC_TARGET.set(n.unique_saturated_into() as u64); (format!("Syncing{}", speed), format!(", target=#{}", n)) } }; diff --git a/client/service/src/builder.rs b/client/service/src/builder.rs index b5d73e6df9f22..2e4b1ee6af48c 100644 --- a/client/service/src/builder.rs +++ b/client/service/src/builder.rs @@ -53,46 +53,38 @@ use sysinfo::{get_current_pid, ProcessExt, System, SystemExt}; use sc_telemetry::{telemetry, SUBSTRATE_INFO}; use sp_transaction_pool::{TransactionPool, TransactionPoolMaintainer}; use sp_blockchain; -use prometheus_endpoint::{create_gauge, Gauge}; +use prometheus_endpoint::{create_gauge, Gauge, U64, F64}; prometheus_endpoint::lazy_static! { - pub static ref FINALITY_HEIGHT: Gauge = create_gauge( + pub static ref FINALITY_HEIGHT: Gauge = create_gauge( "consensus_finality_block_height_number", "block is finality HEIGHT" ); - pub static ref BEST_HEIGHT: Gauge = create_gauge( + pub static ref BEST_HEIGHT: Gauge = create_gauge( "consensus_best_block_height_number", "block is best HEIGHT" ); - pub static ref BLOCK_INTERVAL_SECONDS: Gauge = create_gauge( - "consensus_block_interval_seconds", - "Time between this and last block(Block.Header.Time) in seconds" - ); - pub static ref P2P_PEERS_NUM: Gauge = create_gauge( + pub static ref P2P_PEERS_NUM: Gauge = create_gauge( "p2p_peers_number", "network gosip peers number" ); - pub static ref TX_COUNT: Gauge = create_gauge( + pub static ref TX_COUNT: Gauge = create_gauge( "consensus_num_txs", "Number of transactions" ); - pub static ref NODE_MEMORY: Gauge = create_gauge( + pub static ref NODE_MEMORY: Gauge = create_gauge( "consensus_node_memory", "node memory" ); - pub static ref NODE_CPU: Gauge = create_gauge( + pub static ref NODE_CPU: Gauge = create_gauge( "consensus_node_cpu", "node cpu" ); - pub static ref STATE_CACHE_SIZE: Gauge = create_gauge( - "consensus_state_cache_size", - "used state cache size" - ); - pub static ref P2P_NODE_DOWNLOAD: Gauge = create_gauge( + pub static ref P2P_NODE_DOWNLOAD: Gauge = create_gauge( "p2p_peers_receive_byte_per_sec", "p2p_node_download_per_sec_byte" ); - pub static ref P2P_NODE_UPLOAD: Gauge = create_gauge( + pub static ref P2P_NODE_UPLOAD: Gauge = create_gauge( "p2p_peers_send_byte_per_sec", "p2p_node_upload_per_sec_byte" ); @@ -1017,14 +1009,14 @@ ServiceBuilder< "disk_read_per_sec" => info.usage.as_ref().map(|usage| usage.io.bytes_read).unwrap_or(0), "disk_write_per_sec" => info.usage.as_ref().map(|usage| usage.io.bytes_written).unwrap_or(0), ); - NODE_MEMORY.set(memory as i64); - NODE_CPU.set(cpu_usage as i64); - TX_COUNT.set(txpool_status.ready as i64); - FINALITY_HEIGHT.set(finalized_number as i64); - BEST_HEIGHT.set(best_number as i64); - P2P_PEERS_NUM.set(num_peers as i64); - P2P_NODE_DOWNLOAD.set(net_status.average_download_per_sec as i64); - P2P_NODE_UPLOAD.set(net_status.average_upload_per_sec as i64); + NODE_MEMORY.set(memory); + NODE_CPU.set(f64::from(cpu_usage)); + TX_COUNT.set(txpool_status.ready as u64); + FINALITY_HEIGHT.set(finalized_number); + BEST_HEIGHT.set(best_number); + P2P_PEERS_NUM.set(num_peers as u64); + P2P_NODE_DOWNLOAD.set(net_status.average_download_per_sec); + P2P_NODE_UPLOAD.set(net_status.average_upload_per_sec); Ok(()) }).select(exit.clone().map(Ok).compat()).then(|_| Ok(())); let _ = to_spawn_tx.unbounded_send(Box::new(tel_task)); diff --git a/utils/prometheus/Cargo.toml b/utils/prometheus/Cargo.toml index 3f3b4bf408df0..a4bf0aa52273e 100644 --- a/utils/prometheus/Cargo.toml +++ b/utils/prometheus/Cargo.toml @@ -13,7 +13,6 @@ prometheus = { version = "0.7", features = ["nightly", "process"]} tokio = "0.2" futures-util = { version = "0.3.1", default-features = false, features = ["io"] } lazy_static = "1.4" -sp-runtime = { package = "sp-runtime",path = "../../primitives/runtime" } derive_more = "0.99" [target.'cfg(not(target_os = "unknown"))'.dependencies] diff --git a/utils/prometheus/src/lib.rs b/utils/prometheus/src/lib.rs index 6883fae48fae1..802a2b53b7fa5 100644 --- a/utils/prometheus/src/lib.rs +++ b/utils/prometheus/src/lib.rs @@ -14,24 +14,22 @@ // You should have received a copy of the GNU General Public License // along with Substrate. If not, see . - -#[macro_use] extern crate lazy_static; -use futures_util::{FutureExt,future::{Future}}; + +use futures_util::{FutureExt, future::Future}; use hyper::http::StatusCode; -use hyper::Server; -use hyper::{Body, Request, Response, service::{service_fn, make_service_fn}}; -pub use prometheus::{Encoder, HistogramOpts, Opts, TextEncoder}; -pub use prometheus::{Histogram, IntCounter}; -pub use prometheus::IntGauge as Gauge; -pub use sp_runtime::traits::SaturatedConversion; +use hyper::{Server, Body, Request, Response, service::{service_fn, make_service_fn}}; +use prometheus::{Encoder, Opts, TextEncoder, core::Atomic}; use std::net::SocketAddr; #[cfg(not(target_os = "unknown"))] mod networking; +pub use prometheus::core::{ + GenericGauge as Gauge, AtomicF64 as F64, AtomicI64 as I64, AtomicU64 as U64 +}; pub use lazy_static::lazy_static; -pub fn create_gauge(name: &str, description: &str) -> Gauge { +pub fn create_gauge(name: &str, description: &str) -> Gauge { let opts = Opts::new(name, description); let gauge = Gauge::with_opts(opts).expect("Creating Gauge Failed"); prometheus::register(Box::new(gauge.clone())).expect("Registering gauge failed"); @@ -58,22 +56,16 @@ impl std::error::Error for Error { } async fn request_metrics(req: Request) -> Result, Error> { - if req.uri().path() == "/metrics" { - let metric_families = prometheus::gather(); - let mut buffer = vec![]; - let encoder = TextEncoder::new(); - encoder.encode(&metric_families, &mut buffer).unwrap(); - Response::builder() - .status(StatusCode::OK) - .header("Content-Type", encoder.format_type()) - .body(Body::from(buffer)) - .map_err(Error::Http) - } else { - Response::builder() - .status(StatusCode::NOT_FOUND) - .body(Body::from("Not found.")) - .map_err(Error::Http) - } + let metric_families = prometheus::gather(); + let mut buffer = vec![]; + let encoder = TextEncoder::new(); + encoder.encode(&metric_families, &mut buffer).unwrap(); + + Response::builder() + .status(StatusCode::OK) + .header("Content-Type", encoder.format_type()) + .body(Body::from(buffer)) + .map_err(Error::Http) } #[derive(Clone)] From fd081c91e697aa5fb966344cffebd6df61342542 Mon Sep 17 00:00:00 2001 From: Ashley Date: Fri, 10 Jan 2020 12:35:54 +0100 Subject: [PATCH 19/42] Add photo back --- primitives/consensus/babe/src/inherents.rs | 70 +-- utils/prometheus/README.md | 424 ------------------ .../prometheus/photo_2019-12-13_16-32-53.jpg | Bin 0 -> 27726 bytes 3 files changed, 35 insertions(+), 459 deletions(-) create mode 100644 utils/prometheus/photo_2019-12-13_16-32-53.jpg diff --git a/primitives/consensus/babe/src/inherents.rs b/primitives/consensus/babe/src/inherents.rs index 7c0744ac6e13a..4a460ec6f772d 100644 --- a/primitives/consensus/babe/src/inherents.rs +++ b/primitives/consensus/babe/src/inherents.rs @@ -32,59 +32,59 @@ pub const INHERENT_IDENTIFIER: InherentIdentifier = *b"babeslot"; pub type InherentType = u64; /// Auxiliary trait to extract BABE inherent data. pub trait BabeInherentData { - /// Get BABE inherent data. - fn babe_inherent_data(&self) -> Result; - /// Replace BABE inherent data. - fn babe_replace_inherent_data(&mut self, new: InherentType); + /// Get BABE inherent data. + fn babe_inherent_data(&self) -> Result; + /// Replace BABE inherent data. + fn babe_replace_inherent_data(&mut self, new: InherentType); } impl BabeInherentData for InherentData { - fn babe_inherent_data(&self) -> Result { - self.get_data(&INHERENT_IDENTIFIER) - .and_then(|r| r.ok_or_else(|| "BABE inherent data not found".into())) - } + fn babe_inherent_data(&self) -> Result { + self.get_data(&INHERENT_IDENTIFIER) + .and_then(|r| r.ok_or_else(|| "BABE inherent data not found".into())) + } - fn babe_replace_inherent_data(&mut self, new: InherentType) { - self.replace_data(INHERENT_IDENTIFIER, &new); - } + fn babe_replace_inherent_data(&mut self, new: InherentType) { + self.replace_data(INHERENT_IDENTIFIER, &new); + } } /// Provides the slot duration inherent data for BABE. #[cfg(feature = "std")] pub struct InherentDataProvider { - slot_duration: u64, + slot_duration: u64, } #[cfg(feature = "std")] impl InherentDataProvider { - /// Constructs `Self` - pub fn new(slot_duration: u64) -> Self { - Self { slot_duration } - } + /// Constructs `Self` + pub fn new(slot_duration: u64) -> Self { + Self { slot_duration } + } } #[cfg(feature = "std")] impl ProvideInherentData for InherentDataProvider { - fn on_register(&self, providers: &InherentDataProviders) -> Result<(), Error> { - if !providers.has_provider(&sp_timestamp::INHERENT_IDENTIFIER) { - // Add the timestamp inherent data provider, as we require it. - providers.register_provider(sp_timestamp::InherentDataProvider) - } else { - Ok(()) - } - } + fn on_register(&self, providers: &InherentDataProviders) -> Result<(), Error> { + if !providers.has_provider(&sp_timestamp::INHERENT_IDENTIFIER) { + // Add the timestamp inherent data provider, as we require it. + providers.register_provider(sp_timestamp::InherentDataProvider) + } else { + Ok(()) + } + } - fn inherent_identifier(&self) -> &'static InherentIdentifier { - &INHERENT_IDENTIFIER - } + fn inherent_identifier(&self) -> &'static InherentIdentifier { + &INHERENT_IDENTIFIER + } - fn provide_inherent_data(&self, inherent_data: &mut InherentData) -> Result<(), Error> { - let timestamp = inherent_data.timestamp_inherent_data()?; - let slot_number = timestamp / self.slot_duration; - inherent_data.put_data(INHERENT_IDENTIFIER, &slot_number) - } + fn provide_inherent_data(&self, inherent_data: &mut InherentData) -> Result<(), Error> { + let timestamp = inherent_data.timestamp_inherent_data()?; + let slot_number = timestamp / self.slot_duration; + inherent_data.put_data(INHERENT_IDENTIFIER, &slot_number) + } - fn error_to_string(&self, error: &[u8]) -> Option { - Error::decode(&mut &error[..]).map(|e| e.into_string()).ok() - } + fn error_to_string(&self, error: &[u8]) -> Option { + Error::decode(&mut &error[..]).map(|e| e.into_string()).ok() + } } diff --git a/utils/prometheus/README.md b/utils/prometheus/README.md index e5952f1e192c4..f38cb1c8c7a15 100644 --- a/utils/prometheus/README.md +++ b/utils/prometheus/README.md @@ -22,430 +22,6 @@ Start Prometheus Start Grafana - Install Grafana -## Substrate Dev hack -### Prometheus primer - -Here is the entry point of prometheus core module in Parity Substrate. - -In existing sources, refer to the Grafana source due to the issue of the wasm. - -utils/prometheus/src/lib.rs -```rust -#[macro_use] -extern crate lazy_static; -use futures_util::{FutureExt,future::{Future}}; -use hyper::http::StatusCode; -use hyper::Server; -use hyper::{Body, Request, Response, service::{service_fn, make_service_fn}}; -pub use prometheus::{Encoder, HistogramOpts, Opts, TextEncoder}; -pub use prometheus::{Histogram, IntCounter, IntGauge}; -pub use sp_runtime::traits::SaturatedConversion; -use std::net::SocketAddr; - -pub mod metrics; - -#[derive(Debug, derive_more::Display, derive_more::From)] -pub enum Error { - /// Hyper internal error. - Hyper(hyper::Error), - /// Http request error. - Http(hyper::http::Error), - /// i/o error. - Io(std::io::Error) -} -impl std::error::Error for Error { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match self { - Error::Hyper(error) => Some(error), - Error::Http(error) => Some(error), - Error::Io(error) => Some(error) - } - } -} - -async fn request_metrics(req: Request) -> Result, Error> { - if req.uri().path() == "/metrics" { - let metric_families = prometheus::gather(); - let mut buffer = vec![]; - let encoder = TextEncoder::new(); - encoder.encode(&metric_families, &mut buffer).unwrap(); - Response::builder() - .status(StatusCode::OK) - .header("Content-Type", encoder.format_type()) - .body(Body::from(buffer)) - .map_err(Error::Http) - } else { - Response::builder() - .status(StatusCode::NOT_FOUND) - .body(Body::from("Not found.")) - .map_err(Error::Http) - } - -} - -#[derive(Clone)] -pub struct Executor; - -#[cfg(not(target_os = "unknown"))] -impl hyper::rt::Executor for Executor - where - T: Future + Send + 'static, - T::Output: Send + 'static, -{ - fn execute(&self, future: T) { - async_std::task::spawn(future); - } -} -/// Initializes the metrics context, and starts an HTTP server -/// to serve metrics. -#[cfg(not(target_os = "unknown"))] -pub async fn init_prometheus(mut prometheus_addr: SocketAddr) -> Result<(), Error>{ - use async_std::{net, io}; - use grafana_data_source::networking::Incoming; - - let listener = loop { - let listener = net::TcpListener::bind(&prometheus_addr).await; - match listener { - Ok(listener) => { - log::info!("Prometheus server started at {}", prometheus_addr); - break listener - }, - Err(err) => match err.kind() { - io::ErrorKind::AddrInUse | io::ErrorKind::PermissionDenied if prometheus_addr.port() != 0 => { - log::warn!( - "Prometheus server to already {} port.", prometheus_addr.port() - ); - prometheus_addr.set_port(0); - continue; - }, - _ => return Err(err.into()) - } - } - }; - let service = make_service_fn(|_| { - async { - Ok::<_, Error>(service_fn(request_metrics)) - } - }); - - - let _server = Server::builder(Incoming(listener.incoming())) - .executor(Executor) - .serve(service) - .boxed(); - - - let result = _server.await.map_err(Into::into); - - result -} - -#[cfg(target_os = "unknown")] -pub async fn init_prometheus(_: SocketAddr) -> Result<(), Error> { - Ok(()) -} - - -#[macro_export] -macro_rules! prometheus_gauge( - ($($metric:expr => $value:expr),*) => { - use $crate::{metrics::*}; - $( - metrics::set_gauge(&$metric, $value); - )* - } -); - -#[macro_export] -macro_rules! prometheus_histogram( - ($($metric:expr => $value:expr),*) => { - use $crate::{metrics::*}; - $( - metrics::set_histogram(&$metric, $value); - )* - } -); - - -``` - - - -Here is the dependancies of the module. -utils/prometheus/Cargo.toml -```toml -[package] -name = "sc-prometheus" -version = "2.0.0" -authors = ["Parity Technologies "] -description = "prometheus utils" -edition = "2018" - -[dependencies] -hyper = { version = "0.13.1", default-features = false, features = ["stream"] } -lazy_static = "1.4" -log = "0.4.8" -prometheus = { version = "0.7", features = ["nightly", "process"]} -tokio = "0.2" -futures-util = { version = "0.3.1", default-features = false, features = ["io"] } -sp-runtime = { package = "sp-runtime",path = "../../primitives/runtime" } -derive_more = "0.99" - -[target.'cfg(not(target_os = "unknown"))'.dependencies] -async-std = { version = "1.0.1", features = ["unstable"] } -``` - -**Abbreviation of the package in service manager of parity substrate** -client/service/Cargo.toml -```toml -[dependencies] -sc-prometheus = { package = "sc-prometheus", path="../../utils/prometheus"} -``` - -**Metrics builder as same as substrate-telemetry** -client/service/src/builder.rsL1271 , L1112 -```rust -use sc_prometheus::prometheus_gauge; -... - telemetry!( - SUBSTRATE_INFO; - "system.interval"; - "peers" => num_peers, - "height" => best_number, - "best" => ?best_hash, - "txcount" => txpool_status.ready, - "cpu" => cpu_usage, - "memory" => memory, - "finalized_height" => finalized_number, - "finalized_hash" => ?info.chain.finalized_hash, - "bandwidth_download" => bandwidth_download, - "bandwidth_upload" => bandwidth_upload, - "used_state_cache_size" => used_state_cache_size, - ); - prometheus_gauge!( - STATE_CACHE_SIZE => used_state_cache_size as u64, - NODE_MEMORY => memory as u64, - NODE_CPU => cpu_usage as u64, - TX_COUNT => txpool_status.ready as u64, - FINALITY_HEIGHT => finalized_number as u64, - BEST_HEIGHT => best_number as u64, - P2P_PEERS_NUM => num_peers as u64, - P2P_NODE_DOWNLOAD => net_status.average_download_per_sec as u64, - P2P_NODE_UPLOAD => net_status.average_upload_per_sec as u64 - ); - let _ = record_metrics!( - "peers" => num_peers, - "height" => best_number, - "txcount" => txpool_status.ready, - "cpu" => cpu_usage, - "memory" => memory, - "finalized_height" => finalized_number, - "bandwidth_download" => bandwidth_download, - "bandwidth_upload" => bandwidth_upload, - "used_state_cache_size" => used_state_cache_size, - ); - Ok(()) - }).select(exit.clone().map(Ok).compat()).then(|_| Ok(())); - let _ = to_spawn_tx.unbounded_send(Box::new(tel_task)); - -... - // prometheus init - if let Some(port) = config.prometheus_port { - let future = select( - sc_prometheus::init_prometheus(port).boxed() - ,exit.clone() - ).map(|either| match either { - Either::Left((result, _)) => result.map_err(|_| ()), - Either::Right(_) => Ok(()) - }).compat(); - let _ = to_spawn_tx.unbounded_send(Box::new(future)); - } - // Grafana data source - if let Some(port) = config.grafana_port { - let future = select( - grafana_data_source::run_server(port).boxed(), - exit.clone() - ).map(|either| match either { - Either::Left((result, _)) => result.map_err(|_| ()), - Either::Right(_) => Ok(()) - }).compat(); - - let _ = to_spawn_tx.unbounded_send(Box::new(future)); - } - - // Instrumentation - if let Some(tracing_targets) = config.tracing_targets.as_ref() { - let subscriber = sc_tracing::ProfilingSubscriber::new( - config.tracing_receiver, tracing_targets - ); - match tracing::subscriber::set_global_default(subscriber) { - Ok(_) => (), - Err(e) => error!(target: "tracing", "Unable to set global default subscriber {}", e), - } - } - - -``` -substrate/Cargo.toml -```toml -[workspace] -members = [ - "utils/prometheus", -``` -### CLI Config -client/cli/src/lib.rs -```rust -fn crate_run_node_config{ -... - let prometheus_interface: &str = if cli.prometheus_external { "0.0.0.0" } -... - // Override prometheus - if cli.prometheus_external { - config.prometheus_port = Some( - parse_address(&format!("{}:{}", prometheus_interface, 33333), cli.prometheus_port)? - )} -} -``` - -client/cli/src/params.rs -```rust -pub struct RunCmd{ -... - /// Prometheus exporter TCP port. - #[structopt(long = "prometheus-port", value_name = "PORT")] - pub prometheus_port: Option, - /// Prometheus exporter on/off external". - #[structopt(long = "prometheus-external")] - pub prometheus_external: bool, -... -} -``` -client/service/src/config.rs -```rust -#[derive(Clone)] -pub struct Configuration { - ... - /// Prometheus Port.`None` if disabled and port 33333 by default. - pub prometheus_port: Option, - ... -} -impl Configuration where - C: Default, - G: RuntimeGenesis, - E: Extension, -{ - /// Create default config for given chain spec. - pub fn default_with_spec(chain_spec: ChainSpec) -> Self { - let mut configuration = Configuration { - ... - prometheus_prot: None, - ... - }; - configuration.network.boot_nodes = configuration.chain_spec.boot_nodes().to_vec(); - - configuration.telemetry_endpoints = configuration.chain_spec.telemetry_endpoints().clone(); - - configuration - } -``` - - - -### Metrics Add -ex) consensus_FINALITY_HEIGHT - -utils/prometheus/src/metrics.rs - -```rust -pub use crate::*; - -/// Gauge type metrics generation function -pub fn try_create_int_gauge(name: &str, help: &str) -> Result { - let opts = Opts::new(name, help); - let gauge = IntGauge::with_opts(opts)?; - prometheus::register(Box::new(gauge.clone()))?; - Ok(gauge) -} - -///Gauge Metrics a value in injection. -pub fn set_gauge(gauge: &Result, value: u64) { - if let Ok(gauge) = gauge { - gauge.set(value as i64); - } -} - -///All of the metrics in the prometheus are managed by the lazy_static. -lazy_static! { - pub static ref FINALITY_HEIGHT: Result = try_create_int_gauge( - "consensus_finality_block_height_number", - "block is finality HEIGHT" - ); -} -``` -client/service/Cargo.toml -```rust -... -sc-prometheus = { package = "sc-prometheus", path="../../utils/prometheus"} -... -``` -client/service/src/builder.rs -```rust -..... -use sc-prometheus::{prometheus_gauge}; -..... - let tel_task = state_rx.for_each(move |(net_status, _)| { - let info = client_.info(); - let best_number = info.chain.best_number.saturated_into::(); - let best_hash = info.chain.best_hash; - let num_peers = net_status.num_connected_peers; - let txpool_status = transaction_pool_.status(); - let finalized_number: u64 = info.chain.finalized_number.saturated_into::(); - let bandwidth_download = net_status.average_download_per_sec; - let bandwidth_upload = net_status.average_upload_per_sec; - - let used_state_cache_size = match info.used_state_cache_size { - Some(size) => size, - None => 0, - }; - - // get cpu usage and memory usage of this process - let (cpu_usage, memory) = if let Some(self_pid) = self_pid { - if sys.refresh_process(self_pid) { - let proc = sys.get_process(self_pid) - .expect("Above refresh_process succeeds, this should be Some(), qed"); - (proc.cpu_usage(), proc.memory()) - } else { (0.0, 0) } - } else { (0.0, 0) }; - - telemetry!( - SUBSTRATE_INFO; - "system.interval"; - "peers" => num_peers, - "height" => best_number, - "best" => ?best_hash, - "txcount" => txpool_status.ready, - "cpu" => cpu_usage, - "memory" => memory, - "finalized_height" => finalized_number, - "finalized_hash" => ?info.chain.finalized_hash, - "bandwidth_download" => bandwidth_download, - "bandwidth_upload" => bandwidth_upload, - "used_state_cache_size" => used_state_cache_size, - ); - - prometheus_gauge!( - STATE_CACHE_SIZE => used_state_cache_size as u64, - NODE_MEMORY => memory as u64, - NODE_CPU => cpu_usage as u64, - TX_COUNT => txpool_status.ready as u64, - FINALITY_HEIGHT => finalized_number as u64, - BEST_HEIGHT => best_number as u64, - P2P_PEERS_NUM => num_peers as u64, - P2P_NODE_DOWNLOAD => net_status.average_download_per_sec as u64, - P2P_NODE_UPLOAD => net_status.average_upload_per_sec as u64 - ); -..... -``` ## Metrics substrate can report and serve the Prometheus metrics, which in their turn can be consumed by Prometheus collector(s). diff --git a/utils/prometheus/photo_2019-12-13_16-32-53.jpg b/utils/prometheus/photo_2019-12-13_16-32-53.jpg new file mode 100644 index 0000000000000000000000000000000000000000..cdf44f88fb623d7b5a319235c6d603463698716c GIT binary patch literal 27726 zcmeFZcT`m0wkEoDJ3nV{7^+zOM;&BO;@slT%XD z(lg$@&-|44IsZ#R;n$*y%Bt$`HMMp1ZS5VMUEMvsKZi#~$Hpfnr>2*dS60{7H#WDn z(T7LJC#PqaKj(k5ivVxuzaIZ$*gx4tgSYD%At8tm{5QJ@u6g4Jh=!2p=6zyXrKjMR zu5`CVf=TEfBz-LZLCPii48>sSHblnAEw;pi{+nrkx9mS=Sjhh;%l?O9|7O=TKmj7a z-#icv00qv@`91}a{WbntgTFBF7Y6>qz+V{n3j=>);4cjPg@L~?@V^fOcdL)%D8o7m z6+NQfYu6G^gu-l2qdlj2yR+$c()IQ4cPpltf()(0YbPjhIc@YZY7eh#32s`4KgPi&q)`=tn2 zr%VSyRGwF~RE?HmFZkb;-Rd<%-+P%fYW>u+(AY?f-_xD`w)YfuQpka`QqGqk!66lT z;OYN;gMb26+S&N6`9V+qb$Kd=BSh2{V3V!YBZuQ?Hrb50MT*l<8%#)Rd363L8o-!e z0Z+#Lg$pAO1j~*us->T`epJ|2vuJB*q44)WYlT&?ohIm4u`|>z>&SnA>o{y(sy+HP zF339ZtTJSuc!#}*88VRXqxQG|(NCvy#5?F@J@Q&E(n3V#m}NEab&w?XKDwYS@YWQ4 zjhbeIlU#Ah-HoYpNH@dg)1Ks9k5?Wq6Mwpqo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lQp1{kTP=~9yAPVq={9y zaMW#sX;KM)$(?IyGtxlN;4Y;gb-PLj6~i*BEMwkwD;3*xgXE~O3)<969JpBfeg}$d z`Z3os{Nc%-u|^pBICcDNodZPFGQ#=fb{bP1=3z{XxQnWIgIx8NIozxaJfUf{Wxpo) zE*Z?=E9`c6QOAuZvD-vHAhbo{lYIeArCL5%3%G@Ru+jM?n4dO1{X)>E`rAwAGdUiE0|jsIffrYU|H?-yt$9 z69568juojC@E$e9*JiwCNBR8vFfNmF))gLYp&$7?I+8@h34ale4%r+IF@b(TPsg>ZXJ;5@soz3YFR!o@h#9C_PWJsU}HlQ=an7<*T32N z7@)}Xt0cMyxe2!}lnz1g5SI#E*wxKj*3EegcTjcn$NV?bx>^!?t>Adb%1~>pKbWSe z8^Ra>4JWFK*5fROv6sYqRRmFE^$l{j)5@IJKx8zSyGL%E0~H(1;ZlF=z!%px-9w0$ z8yx{$C@&yzbg_Fn~o1f^PpdHVP2-b2=UXi1Tasg|exvf{Pyq(U0PS;ut26BQ> z;L*6vS^dbEuQWOEE4=8@js57=x+>eW z?-@c?e7s^hR}#!3c-U3gWK%;BuYqwdHV=7_3sWUkXHWV0_sCcuv@~s}h!up1(At+kaFO^=KyT&{a>MXi>v?u literal 0 HcmV?d00001 From f00bb9bcd0a6faff96caccf2019d36659ce4b881 Mon Sep 17 00:00:00 2001 From: Ashley Date: Fri, 10 Jan 2020 12:43:47 +0100 Subject: [PATCH 20/42] Re-fix spaces in primitives/consensus/babe/src/inherents.rs --- primitives/consensus/babe/src/inherents.rs | 70 +++++++++++----------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/primitives/consensus/babe/src/inherents.rs b/primitives/consensus/babe/src/inherents.rs index 4a460ec6f772d..7c0744ac6e13a 100644 --- a/primitives/consensus/babe/src/inherents.rs +++ b/primitives/consensus/babe/src/inherents.rs @@ -32,59 +32,59 @@ pub const INHERENT_IDENTIFIER: InherentIdentifier = *b"babeslot"; pub type InherentType = u64; /// Auxiliary trait to extract BABE inherent data. pub trait BabeInherentData { - /// Get BABE inherent data. - fn babe_inherent_data(&self) -> Result; - /// Replace BABE inherent data. - fn babe_replace_inherent_data(&mut self, new: InherentType); + /// Get BABE inherent data. + fn babe_inherent_data(&self) -> Result; + /// Replace BABE inherent data. + fn babe_replace_inherent_data(&mut self, new: InherentType); } impl BabeInherentData for InherentData { - fn babe_inherent_data(&self) -> Result { - self.get_data(&INHERENT_IDENTIFIER) - .and_then(|r| r.ok_or_else(|| "BABE inherent data not found".into())) - } + fn babe_inherent_data(&self) -> Result { + self.get_data(&INHERENT_IDENTIFIER) + .and_then(|r| r.ok_or_else(|| "BABE inherent data not found".into())) + } - fn babe_replace_inherent_data(&mut self, new: InherentType) { - self.replace_data(INHERENT_IDENTIFIER, &new); - } + fn babe_replace_inherent_data(&mut self, new: InherentType) { + self.replace_data(INHERENT_IDENTIFIER, &new); + } } /// Provides the slot duration inherent data for BABE. #[cfg(feature = "std")] pub struct InherentDataProvider { - slot_duration: u64, + slot_duration: u64, } #[cfg(feature = "std")] impl InherentDataProvider { - /// Constructs `Self` - pub fn new(slot_duration: u64) -> Self { - Self { slot_duration } - } + /// Constructs `Self` + pub fn new(slot_duration: u64) -> Self { + Self { slot_duration } + } } #[cfg(feature = "std")] impl ProvideInherentData for InherentDataProvider { - fn on_register(&self, providers: &InherentDataProviders) -> Result<(), Error> { - if !providers.has_provider(&sp_timestamp::INHERENT_IDENTIFIER) { - // Add the timestamp inherent data provider, as we require it. - providers.register_provider(sp_timestamp::InherentDataProvider) - } else { - Ok(()) - } - } + fn on_register(&self, providers: &InherentDataProviders) -> Result<(), Error> { + if !providers.has_provider(&sp_timestamp::INHERENT_IDENTIFIER) { + // Add the timestamp inherent data provider, as we require it. + providers.register_provider(sp_timestamp::InherentDataProvider) + } else { + Ok(()) + } + } - fn inherent_identifier(&self) -> &'static InherentIdentifier { - &INHERENT_IDENTIFIER - } + fn inherent_identifier(&self) -> &'static InherentIdentifier { + &INHERENT_IDENTIFIER + } - fn provide_inherent_data(&self, inherent_data: &mut InherentData) -> Result<(), Error> { - let timestamp = inherent_data.timestamp_inherent_data()?; - let slot_number = timestamp / self.slot_duration; - inherent_data.put_data(INHERENT_IDENTIFIER, &slot_number) - } + fn provide_inherent_data(&self, inherent_data: &mut InherentData) -> Result<(), Error> { + let timestamp = inherent_data.timestamp_inherent_data()?; + let slot_number = timestamp / self.slot_duration; + inherent_data.put_data(INHERENT_IDENTIFIER, &slot_number) + } - fn error_to_string(&self, error: &[u8]) -> Option { - Error::decode(&mut &error[..]).map(|e| e.into_string()).ok() - } + fn error_to_string(&self, error: &[u8]) -> Option { + Error::decode(&mut &error[..]).map(|e| e.into_string()).ok() + } } From 398da97f401c7044ac76c14e7d669bde49452ae5 Mon Sep 17 00:00:00 2001 From: nodebreaker-carlsagan Date: Tue, 14 Jan 2020 16:33:18 +0900 Subject: [PATCH 21/42] chore: revert this file back to paritytech/master inherents.rs. --- primitives/consensus/babe/src/inherents.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/primitives/consensus/babe/src/inherents.rs b/primitives/consensus/babe/src/inherents.rs index 7c0744ac6e13a..22b55e6c40fee 100644 --- a/primitives/consensus/babe/src/inherents.rs +++ b/primitives/consensus/babe/src/inherents.rs @@ -87,4 +87,4 @@ impl ProvideInherentData for InherentDataProvider { fn error_to_string(&self, error: &[u8]) -> Option { Error::decode(&mut &error[..]).map(|e| e.into_string()).ok() } -} +} \ No newline at end of file From 84c458f9c2c70d335aafb3398abbe8133b837100 Mon Sep 17 00:00:00 2001 From: Ashley Date: Tue, 14 Jan 2020 14:32:57 +0100 Subject: [PATCH 22/42] Add newline at EOF --- primitives/consensus/babe/src/inherents.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/primitives/consensus/babe/src/inherents.rs b/primitives/consensus/babe/src/inherents.rs index 22b55e6c40fee..7c0744ac6e13a 100644 --- a/primitives/consensus/babe/src/inherents.rs +++ b/primitives/consensus/babe/src/inherents.rs @@ -87,4 +87,4 @@ impl ProvideInherentData for InherentDataProvider { fn error_to_string(&self, error: &[u8]) -> Option { Error::decode(&mut &error[..]).map(|e| e.into_string()).ok() } -} \ No newline at end of file +} From ffb4746ddc76139d67d6659e968fc0b0e1a2d7a8 Mon Sep 17 00:00:00 2001 From: Ashley Date: Fri, 17 Jan 2020 16:40:05 +0100 Subject: [PATCH 23/42] Tidy --- client/cli/src/informant/display.rs | 4 +- client/cli/src/lib.rs | 2 +- client/service/src/builder.rs | 42 +++++++++--------- client/tracing/src/lib.rs | 2 +- utils/prometheus/README.md | 40 +++-------------- .../prometheus/photo_2019-12-13_16-32-53.jpg | Bin 27726 -> 0 bytes utils/prometheus/src/lib.rs | 39 ++++++---------- 7 files changed, 43 insertions(+), 86 deletions(-) delete mode 100644 utils/prometheus/photo_2019-12-13_16-32-53.jpg diff --git a/client/cli/src/informant/display.rs b/client/cli/src/informant/display.rs index c69cce143a386..894d03f4b98fe 100644 --- a/client/cli/src/informant/display.rs +++ b/client/cli/src/informant/display.rs @@ -27,8 +27,8 @@ use prometheus_endpoint::{create_gauge, Gauge, U64}; prometheus_endpoint::lazy_static! { pub static ref SYNC_TARGET: Gauge = create_gauge( - "sync_target_number", - "block sync target number" + "substrate_sync_target_number", + "Block sync target number" ); } diff --git a/client/cli/src/lib.rs b/client/cli/src/lib.rs index 044eb4868ca6a..79afaa03b4269 100644 --- a/client/cli/src/lib.rs +++ b/client/cli/src/lib.rs @@ -1049,7 +1049,7 @@ where config.rpc_http = Some(parse_address(&format!("{}:{}", rpc_interface, 9933), cli.rpc_port)?); config.rpc_ws = Some(parse_address(&format!("{}:{}", ws_interface, 9944), cli.ws_port)?); config.prometheus_port = Some( - parse_address(&format!("{}:{}", prometheus_interface, 9955), cli.prometheus_port)? + parse_address(&format!("{}:{}", prometheus_interface, 9615), cli.prometheus_port)? ); config.rpc_ws_max_connections = cli.ws_max_connections; diff --git a/client/service/src/builder.rs b/client/service/src/builder.rs index 640e1a10c9705..f758c2fe71c75 100644 --- a/client/service/src/builder.rs +++ b/client/service/src/builder.rs @@ -55,36 +55,36 @@ use prometheus_endpoint::{create_gauge, Gauge, U64, F64}; prometheus_endpoint::lazy_static! { pub static ref FINALITY_HEIGHT: Gauge = create_gauge( - "consensus_finality_block_height_number", - "block is finality HEIGHT" + "substrate_finality_block_height_number", + "Height of the highest finalized block" ); pub static ref BEST_HEIGHT: Gauge = create_gauge( - "consensus_best_block_height_number", - "block is best HEIGHT" + "substrate_best_block_height_number", + "Height of the highest block" ); - pub static ref P2P_PEERS_NUM: Gauge = create_gauge( - "p2p_peers_number", - "network gosip peers number" + pub static ref PEERS_NUM: Gauge = create_gauge( + "substrate_peers_count", + "Number of network gossip peers" ); pub static ref TX_COUNT: Gauge = create_gauge( - "consensus_num_txs", + "substrate_transaction_count", "Number of transactions" ); pub static ref NODE_MEMORY: Gauge = create_gauge( - "consensus_node_memory", - "node memory" + "substrate_memory_usage", + "Node memory usage" ); pub static ref NODE_CPU: Gauge = create_gauge( - "consensus_node_cpu", - "node cpu" + "substrate_cpu_usage", + "Node CPU usage" ); - pub static ref P2P_NODE_DOWNLOAD: Gauge = create_gauge( - "p2p_peers_receive_byte_per_sec", - "p2p_node_download_per_sec_byte" + pub static ref NODE_DOWNLOAD: Gauge = create_gauge( + "substrate_receive_byte_per_sec", + "Received bytes per second" ); - pub static ref P2P_NODE_UPLOAD: Gauge = create_gauge( - "p2p_peers_send_byte_per_sec", - "p2p_node_upload_per_sec_byte" + pub static ref NODE_UPLOAD: Gauge = create_gauge( + "substrate_sent_byte_per_sec", + "Sent bytes per second" ); } /// Aggregator for the components required to build a service. @@ -1006,9 +1006,9 @@ ServiceBuilder< TX_COUNT.set(txpool_status.ready as u64); FINALITY_HEIGHT.set(finalized_number); BEST_HEIGHT.set(best_number); - P2P_PEERS_NUM.set(num_peers as u64); - P2P_NODE_DOWNLOAD.set(net_status.average_download_per_sec); - P2P_NODE_UPLOAD.set(net_status.average_upload_per_sec); + PEERS_NUM.set(num_peers as u64); + NODE_DOWNLOAD.set(net_status.average_download_per_sec); + NODE_UPLOAD.set(net_status.average_upload_per_sec); ready(()) }); diff --git a/client/tracing/src/lib.rs b/client/tracing/src/lib.rs index 451f22fe14f6c..b6c1b1120f4ed 100644 --- a/client/tracing/src/lib.rs +++ b/client/tracing/src/lib.rs @@ -290,6 +290,6 @@ fn send_telemetry(span_datum: SpanDatum) { ); } -fn send_prometheus(span_datum: SpanDatum) { +fn send_prometheus(_span_datum: SpanDatum) { unimplemented!() } diff --git a/utils/prometheus/README.md b/utils/prometheus/README.md index f38cb1c8c7a15..25979eaabc011 100644 --- a/utils/prometheus/README.md +++ b/utils/prometheus/README.md @@ -1,8 +1,8 @@ -# Substrate Prometheus Node Exporter -![grants](./photo_2019-12-13_16-32-53.jpg) +# Substrate Prometheus Exporter + ## Introduction -Prometheus is one of the most widely used monitoring tool for managing high availability services supported by [Cloud Native Computing Foundation](https://www.cncf.io/). By providing Prometheus metrics in Substrate, node operators can easily adopt widely used display/alert tools such as Grafana and Alertmanager without setting-up/operating external Prometheus push gateways (which is an antipattern in the first place) through RPC connections. Easy access to such monitoring tools will benefit parachain developers/operators and validators to have much higher availability of their services. +Prometheus is one of the most widely used monitoring tool for managing highly available services supported by [Cloud Native Computing Foundation](https://www.cncf.io/). By providing Prometheus metrics in Substrate, node operators can easily adopt widely used display/alert tools such as Grafana and Alertmanager without setting-up/operating external Prometheus push gateways (which is an antipattern in the first place) through RPC connections. Easy access to such monitoring tools will benefit parachain developers/operators and validators to have much higher availability of their services. ## Table of Contents @@ -24,37 +24,7 @@ Start Grafana ## Metrics -substrate can report and serve the Prometheus metrics, which in their turn can be consumed by Prometheus collector(s). - -This functionality is disabled by default. - -To enable the Prometheus metrics, set in your cli command (--prometheus-addr,--prometheus-port ). -Metrics will be served under /metrics on 33333 port by default. - -### List of available metrics - - -Consensus metrics, namespace: `substrate` - -| **Name** | **Type** | **Tags** | **Description** | -| -------------------------------------- | --------- | -------- | --------------------------------------------------------------- | -| consensus_finality_block_height_number | IntGauge | | finality Height of the chain | -| consensus_best_block_height_number | IntGauge | | best Height of the chain | -| consensus_target_syn_number | IntGauge | | syning Height target number | -| consensus_num_txs | Gauge | | Number of transactions | -| consensus_node_memory | IntGauge | | Node's primary memory | -| consensus_node_cpu | IntGauge | | Node's cpu load | -| consensus_state_cache_size | IntGauge | | used state cache size | -| p2p_peers_number | IntGauge | | Number of peers node's connected to | -| p2p_peer_receive_bytes_per_sec | IntGauge | | number of bytes received from a given peer | -| p2p_peer_send_bytes_per_sec | IntGauge | | number of bytes sent to a given peer | -| Resource_receive_bytes_per_sec(Future) | IntGauge | | Operating System of bytes received | -| Resource_send_bytes_per_sec(Future) | IntGauge | | Operating System of bytes sent | -| Resource_cpu_use(Future) | IntGauge | | Operating System cpu load | -| Resource_disk_use(Future) | IntGauge | | Operating System disk use | -| validator_sign_prevote(Future) | IntGauge | validator addr | validator sign vote list | -| validator_sign_precommit(Future) | IntGauge | validator addr | validator sign commit list | - +Substrate can report and serve the Prometheus metrics, which in turn can be consumed by Prometheus collector(s). Metrics will be served under /metrics on 9615 port by default. ## Start Prometheus ### Install prometheus @@ -84,7 +54,7 @@ Then edit `prometheus.yml` and add `jobs` : ### Start Prometheus ```bash -cd +cd ./prometheus ``` diff --git a/utils/prometheus/photo_2019-12-13_16-32-53.jpg b/utils/prometheus/photo_2019-12-13_16-32-53.jpg deleted file mode 100644 index cdf44f88fb623d7b5a319235c6d603463698716c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 27726 zcmeFZcT`m0wkEoDJ3nV{7^+zOM;&BO;@slT%XD z(lg$@&-|44IsZ#R;n$*y%Bt$`HMMp1ZS5VMUEMvsKZi#~$Hpfnr>2*dS60{7H#WDn z(T7LJC#PqaKj(k5ivVxuzaIZ$*gx4tgSYD%At8tm{5QJ@u6g4Jh=!2p=6zyXrKjMR zu5`CVf=TEfBz-LZLCPii48>sSHblnAEw;pi{+nrkx9mS=Sj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!3c-U3gWK%;BuYqwdHV=7_3sWUkXHWV0_sCcuv@~s}h!up1(At+kaFO^=KyT&{a>MXi>v?u diff --git a/utils/prometheus/src/lib.rs b/utils/prometheus/src/lib.rs index 802a2b53b7fa5..1c7a95f364dcb 100644 --- a/utils/prometheus/src/lib.rs +++ b/utils/prometheus/src/lib.rs @@ -43,19 +43,22 @@ pub enum Error { /// Http request error. Http(hyper::http::Error), /// i/o error. - Io(std::io::Error) + Io(std::io::Error), + #[display(fmt = "Prometheus export port {} already in use.", _0)] + PortInUse(SocketAddr) } impl std::error::Error for Error { fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { match self { Error::Hyper(error) => Some(error), Error::Http(error) => Some(error), - Error::Io(error) => Some(error) + Error::Io(error) => Some(error), + Error::PortInUse(_) => None } } } -async fn request_metrics(req: Request) -> Result, Error> { +async fn request_metrics(_req: Request) -> Result, Error> { let metric_families = prometheus::gather(); let mut buffer = vec![]; let encoder = TextEncoder::new(); @@ -84,40 +87,24 @@ impl hyper::rt::Executor for Executor /// Initializes the metrics context, and starts an HTTP server /// to serve metrics. #[cfg(not(target_os = "unknown"))] -pub async fn init_prometheus(mut prometheus_addr: SocketAddr) -> Result<(), Error>{ - use async_std::{net, io}; +pub async fn init_prometheus(prometheus_addr: SocketAddr) -> Result<(), Error>{ use networking::Incoming; - let listener = loop { - let listener = net::TcpListener::bind(&prometheus_addr).await; - match listener { - Ok(listener) => { - log::info!("Prometheus server started at {}", prometheus_addr); - break listener - }, - Err(err) => match err.kind() { - io::ErrorKind::AddrInUse | io::ErrorKind::PermissionDenied if prometheus_addr.port() != 0 => { - log::warn!( - "Prometheus server to already {} port.", prometheus_addr.port() - ); - prometheus_addr.set_port(0); - continue; - }, - _ => return Err(err.into()) - } - } - }; + let listener = async_std::net::TcpListener::bind(&prometheus_addr) + .await + .map_err(|_| Error::PortInUse(prometheus_addr))?; + let service = make_service_fn(|_| { async { Ok::<_, Error>(service_fn(request_metrics)) } }); - let _server = Server::builder(Incoming(listener.incoming())) + let server = Server::builder(Incoming(listener.incoming())) .executor(Executor) .serve(service) .boxed(); - let result = _server.await.map_err(Into::into); + let result = server.await.map_err(Into::into); result } From 8a6e3c5aaa03f4d0d56216128701fb942dd98bc0 Mon Sep 17 00:00:00 2001 From: Ashley Date: Fri, 17 Jan 2020 18:42:00 +0100 Subject: [PATCH 24/42] Use local registry --- client/cli/src/informant/display.rs | 17 +------ client/service/src/builder.rs | 77 ++++++++++++++++++++++++----- client/service/src/error.rs | 6 +++ utils/prometheus/src/lib.rs | 22 ++++++--- 4 files changed, 88 insertions(+), 34 deletions(-) diff --git a/client/cli/src/informant/display.rs b/client/cli/src/informant/display.rs index 894d03f4b98fe..199635e7c7883 100644 --- a/client/cli/src/informant/display.rs +++ b/client/cli/src/informant/display.rs @@ -18,19 +18,9 @@ use ansi_term::Colour; use sc_client_api::ClientInfo; use log::info; use sc_network::SyncState; -use sp_runtime::traits::{ - Block as BlockT, CheckedDiv, NumberFor, Zero, Saturating, UniqueSaturatedInto -}; +use sp_runtime::traits::{Block as BlockT, CheckedDiv, NumberFor, Zero, Saturating}; use sc_service::NetworkStatus; use std::{convert::{TryFrom, TryInto}, fmt, time}; -use prometheus_endpoint::{create_gauge, Gauge, U64}; - -prometheus_endpoint::lazy_static! { - pub static ref SYNC_TARGET: Gauge = create_gauge( - "substrate_sync_target_number", - "Block sync target number" - ); -} /// State of the informant display system. /// @@ -73,10 +63,7 @@ impl InformantDisplay { let (status, target) = match (net_status.sync_state, net_status.best_seen_block) { (SyncState::Idle, _) => ("Idle".into(), "".into()), (SyncState::Downloading, None) => (format!("Syncing{}", speed), "".into()), - (SyncState::Downloading, Some(n)) => { - SYNC_TARGET.set(n.unique_saturated_into() as u64); - (format!("Syncing{}", speed), format!(", target=#{}", n)) - } + (SyncState::Downloading, Some(n)) => (format!("Syncing{}", speed), format!(", target=#{}", n)), }; info!( diff --git a/client/service/src/builder.rs b/client/service/src/builder.rs index f758c2fe71c75..920b5463a0b78 100644 --- a/client/service/src/builder.rs +++ b/client/service/src/builder.rs @@ -39,7 +39,7 @@ use sc_network::{config::BoxFinalityProofRequestBuilder, specialization::Network use parking_lot::{Mutex, RwLock}; use sp_runtime::generic::BlockId; use sp_runtime::traits::{ - Block as BlockT, NumberFor, SaturatedConversion, HasherFor, + Block as BlockT, NumberFor, SaturatedConversion, HasherFor, UniqueSaturatedInto, }; use sp_api::ProvideRuntimeApi; use sc_executor::{NativeExecutor, NativeExecutionDispatch}; @@ -51,41 +51,45 @@ use sysinfo::{get_current_pid, ProcessExt, System, SystemExt}; use sc_telemetry::{telemetry, SUBSTRATE_INFO}; use sp_transaction_pool::{TransactionPool, TransactionPoolMaintainer}; use sp_blockchain; -use prometheus_endpoint::{create_gauge, Gauge, U64, F64}; +use prometheus_endpoint::{create_gauge, Gauge, U64, F64, Registry}; prometheus_endpoint::lazy_static! { pub static ref FINALITY_HEIGHT: Gauge = create_gauge( - "substrate_finality_block_height_number", + "finality_block_height_number", "Height of the highest finalized block" ); pub static ref BEST_HEIGHT: Gauge = create_gauge( - "substrate_best_block_height_number", + "best_block_height_number", "Height of the highest block" ); pub static ref PEERS_NUM: Gauge = create_gauge( - "substrate_peers_count", + "peers_count", "Number of network gossip peers" ); pub static ref TX_COUNT: Gauge = create_gauge( - "substrate_transaction_count", + "transaction_count", "Number of transactions" ); pub static ref NODE_MEMORY: Gauge = create_gauge( - "substrate_memory_usage", + "memory_usage", "Node memory usage" ); pub static ref NODE_CPU: Gauge = create_gauge( - "substrate_cpu_usage", + "cpu_usage", "Node CPU usage" ); pub static ref NODE_DOWNLOAD: Gauge = create_gauge( - "substrate_receive_byte_per_sec", + "receive_byte_per_sec", "Received bytes per second" ); pub static ref NODE_UPLOAD: Gauge = create_gauge( - "substrate_sent_byte_per_sec", + "sent_byte_per_sec", "Sent bytes per second" ); + pub static ref SYNC_TARGET: Gauge = create_gauge( + "sync_target_number", + "Block sync target number" + ); } /// Aggregator for the components required to build a service. /// @@ -122,6 +126,7 @@ pub struct ServiceBuilder>>, marker: PhantomData<(TBl, TRtApi)>, + prometheus_registry: Option } /// Full client type. @@ -298,6 +303,7 @@ where TGen: RuntimeGenesis, TCSExt: Extension { rpc_extensions: Default::default(), remote_backend: None, marker: PhantomData, + prometheus_registry: None, }) } @@ -384,6 +390,7 @@ where TGen: RuntimeGenesis, TCSExt: Extension { rpc_extensions: Default::default(), remote_backend: Some(remote_blockchain), marker: PhantomData, + prometheus_registry: None, }) } } @@ -432,6 +439,7 @@ impl Self { + Self { + config: self.config, + client: self.client, + backend: self.backend, + keystore: self.keystore, + fetcher: self.fetcher, + select_chain: self.select_chain, + import_queue: self.import_queue, + finality_proof_request_builder: self.finality_proof_request_builder, + finality_proof_provider: self.finality_proof_provider, + network_protocol: self.network_protocol, + transaction_pool: self.transaction_pool, + rpc_extensions: self.rpc_extensions, + remote_backend: self.remote_backend, + marker: self.marker, + prometheus_registry: Some(registry), + } + } } /// Implemented on `ServiceBuilder`. Allows running block commands, such as import/export/validate @@ -815,6 +850,7 @@ ServiceBuilder< transaction_pool, rpc_extensions, remote_backend, + prometheus_registry, } = self; sp_session::generate_initial_session_keys( @@ -973,6 +1009,8 @@ ServiceBuilder< let finalized_number: u64 = info.chain.finalized_number.saturated_into::(); let bandwidth_download = net_status.average_download_per_sec; let bandwidth_upload = net_status.average_upload_per_sec; + let best_seen_block = net_status.best_seen_block + .map(|num: NumberFor| num.unique_saturated_into() as u64); // get cpu usage and memory usage of this process let (cpu_usage, memory) = if let Some(self_pid) = self_pid { @@ -1009,6 +1047,9 @@ ServiceBuilder< PEERS_NUM.set(num_peers as u64); NODE_DOWNLOAD.set(net_status.average_download_per_sec); NODE_UPLOAD.set(net_status.average_upload_per_sec); + if let Some(best_seen_block) = best_seen_block { + SYNC_TARGET.set(best_seen_block); + } ready(()) }); @@ -1143,8 +1184,22 @@ ServiceBuilder< }); // Prometheus endpoint if let Some(port) = config.prometheus_port { + let registry = match prometheus_registry { + Some(registry) => registry, + None => Registry::new_custom(Some("substrate".into()), None)? + }; + + registry.register(Box::new(NODE_MEMORY.clone()))?; + registry.register(Box::new(NODE_CPU.clone()))?; + registry.register(Box::new(TX_COUNT.clone()))?; + registry.register(Box::new(FINALITY_HEIGHT.clone()))?; + registry.register(Box::new(BEST_HEIGHT.clone()))?; + registry.register(Box::new(PEERS_NUM.clone()))?; + registry.register(Box::new(NODE_DOWNLOAD.clone()))?; + registry.register(Box::new(NODE_UPLOAD.clone()))?; + let future = select( - prometheus_endpoint::init_prometheus(port).boxed(), + prometheus_endpoint::init_prometheus(port, registry).boxed(), exit.clone() ).map(drop); diff --git a/client/service/src/error.rs b/client/service/src/error.rs index 6516b1c62c6d6..c09b2008e3fc0 100644 --- a/client/service/src/error.rs +++ b/client/service/src/error.rs @@ -50,6 +50,12 @@ impl<'a> From<&'a str> for Error { } } +impl From for Error { + fn from(e: prometheus_endpoint::PrometheusError) -> Self { + Error::Other(format!("Prometheus error: {}", e)) + } +} + impl std::error::Error for Error { fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { match self { diff --git a/utils/prometheus/src/lib.rs b/utils/prometheus/src/lib.rs index 1c7a95f364dcb..6ede3863a9c4d 100644 --- a/utils/prometheus/src/lib.rs +++ b/utils/prometheus/src/lib.rs @@ -18,7 +18,7 @@ extern crate lazy_static; use futures_util::{FutureExt, future::Future}; use hyper::http::StatusCode; -use hyper::{Server, Body, Request, Response, service::{service_fn, make_service_fn}}; +use hyper::{Server, Body, Response, service::{service_fn, make_service_fn}}; use prometheus::{Encoder, Opts, TextEncoder, core::Atomic}; use std::net::SocketAddr; #[cfg(not(target_os = "unknown"))] @@ -27,12 +27,12 @@ mod networking; pub use prometheus::core::{ GenericGauge as Gauge, AtomicF64 as F64, AtomicI64 as I64, AtomicU64 as U64 }; +pub use prometheus::{Registry, Error as PrometheusError}; pub use lazy_static::lazy_static; pub fn create_gauge(name: &str, description: &str) -> Gauge { let opts = Opts::new(name, description); let gauge = Gauge::with_opts(opts).expect("Creating Gauge Failed"); - prometheus::register(Box::new(gauge.clone())).expect("Registering gauge failed"); gauge } @@ -58,8 +58,8 @@ impl std::error::Error for Error { } } -async fn request_metrics(_req: Request) -> Result, Error> { - let metric_families = prometheus::gather(); +async fn request_metrics(registry: Registry) -> Result, Error> { + let metric_families = registry.gather(); let mut buffer = vec![]; let encoder = TextEncoder::new(); encoder.encode(&metric_families, &mut buffer).unwrap(); @@ -87,15 +87,21 @@ impl hyper::rt::Executor for Executor /// Initializes the metrics context, and starts an HTTP server /// to serve metrics. #[cfg(not(target_os = "unknown"))] -pub async fn init_prometheus(prometheus_addr: SocketAddr) -> Result<(), Error>{ +pub async fn init_prometheus(prometheus_addr: SocketAddr, registry: Registry) -> Result<(), Error>{ use networking::Incoming; let listener = async_std::net::TcpListener::bind(&prometheus_addr) .await .map_err(|_| Error::PortInUse(prometheus_addr))?; - let service = make_service_fn(|_| { - async { - Ok::<_, Error>(service_fn(request_metrics)) + log::info!("Prometheus server started at {}", prometheus_addr); + + let service = make_service_fn(move |_| { + let registry = registry.clone(); + + async move { + Ok::<_, hyper::Error>(service_fn(move |_| { + request_metrics(registry.clone()) + })) } }); From 53c95de30206c843f5a6eaea28c6fc2c0d0f3132 Mon Sep 17 00:00:00 2001 From: Hyungsuk Kang Date: Fri, 17 Jan 2020 11:33:47 -0800 Subject: [PATCH 25/42] fix typo Co-Authored-By: Max Inden --- utils/prometheus/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/prometheus/README.md b/utils/prometheus/README.md index f38cb1c8c7a15..3add837de9e7e 100644 --- a/utils/prometheus/README.md +++ b/utils/prometheus/README.md @@ -2,7 +2,7 @@ ![grants](./photo_2019-12-13_16-32-53.jpg) ## Introduction -Prometheus is one of the most widely used monitoring tool for managing high availability services supported by [Cloud Native Computing Foundation](https://www.cncf.io/). By providing Prometheus metrics in Substrate, node operators can easily adopt widely used display/alert tools such as Grafana and Alertmanager without setting-up/operating external Prometheus push gateways (which is an antipattern in the first place) through RPC connections. Easy access to such monitoring tools will benefit parachain developers/operators and validators to have much higher availability of their services. +Prometheus is one of the most widely used monitoring tool for managing highly available services supported by [Cloud Native Computing Foundation](https://www.cncf.io/). By providing Prometheus metrics in Substrate, node operators can easily adopt widely used display/alert tools such as Grafana and Alertmanager without setting-up/operating external Prometheus push gateways (which is an antipattern in the first place) through RPC connections. Easy access to such monitoring tools will benefit parachain developers/operators and validators to have much higher availability of their services. ## Table of Contents From 23cb72e98be4e1e4acb3aa5ca61f12da3c9ff4f5 Mon Sep 17 00:00:00 2001 From: nodebreaker-carlsagan Date: Mon, 20 Jan 2020 15:03:16 +0900 Subject: [PATCH 26/42] chore: Apply review feedback --- utils/prometheus/README.md | 79 ++----------------------------------- utils/prometheus/src/lib.rs | 6 +-- 2 files changed, 7 insertions(+), 78 deletions(-) diff --git a/utils/prometheus/README.md b/utils/prometheus/README.md index 3add837de9e7e..67199143fcdd6 100644 --- a/utils/prometheus/README.md +++ b/utils/prometheus/README.md @@ -1,4 +1,4 @@ -# Substrate Prometheus Node Exporter +# Substrate Prometheus Exporter ![grants](./photo_2019-12-13_16-32-53.jpg) ## Introduction @@ -6,21 +6,11 @@ Prometheus is one of the most widely used monitoring tool for managing highly av ## Table of Contents -Hack Prometheus in Substrate - - Prometheus primer - - CLI Config - - Metrics Add - Metrics - - List of available metrics Start Prometheus - - Install prometheus - Edit Prometheus config file - - Start Prometheus -Start Grafana - - Install Grafana ## Metrics @@ -28,43 +18,11 @@ substrate can report and serve the Prometheus metrics, which in their turn can b This functionality is disabled by default. -To enable the Prometheus metrics, set in your cli command (--prometheus-addr,--prometheus-port ). -Metrics will be served under /metrics on 33333 port by default. - -### List of available metrics - - -Consensus metrics, namespace: `substrate` - -| **Name** | **Type** | **Tags** | **Description** | -| -------------------------------------- | --------- | -------- | --------------------------------------------------------------- | -| consensus_finality_block_height_number | IntGauge | | finality Height of the chain | -| consensus_best_block_height_number | IntGauge | | best Height of the chain | -| consensus_target_syn_number | IntGauge | | syning Height target number | -| consensus_num_txs | Gauge | | Number of transactions | -| consensus_node_memory | IntGauge | | Node's primary memory | -| consensus_node_cpu | IntGauge | | Node's cpu load | -| consensus_state_cache_size | IntGauge | | used state cache size | -| p2p_peers_number | IntGauge | | Number of peers node's connected to | -| p2p_peer_receive_bytes_per_sec | IntGauge | | number of bytes received from a given peer | -| p2p_peer_send_bytes_per_sec | IntGauge | | number of bytes sent to a given peer | -| Resource_receive_bytes_per_sec(Future) | IntGauge | | Operating System of bytes received | -| Resource_send_bytes_per_sec(Future) | IntGauge | | Operating System of bytes sent | -| Resource_cpu_use(Future) | IntGauge | | Operating System cpu load | -| Resource_disk_use(Future) | IntGauge | | Operating System disk use | -| validator_sign_prevote(Future) | IntGauge | validator addr | validator sign vote list | -| validator_sign_precommit(Future) | IntGauge | validator addr | validator sign commit list | +To enable the Prometheus metrics, set in your cli command (--prometheus_external, --prometheus-port ). +Metrics will be served under /metrics on 9955 port by default. ## Start Prometheus -### Install prometheus - -https://prometheus.io/download/ -```bash -wget -tar -zxvf -``` - ### Edit Prometheus config file You can visit [prometheus.yml](https://github.com/prometheus/prometheus/blob/master/documentation/examples/prometheus.yml) to download default `prometheus.yml`. @@ -74,7 +32,7 @@ Then edit `prometheus.yml` and add `jobs` : ```yaml - job_name: kusama static_configs: - - targets: ['localhost:33333'] + - targets: ['localhost:9955'] labels: instance: local-validator ``` @@ -83,35 +41,6 @@ Then edit `prometheus.yml` and add `jobs` : ### Start Prometheus -```bash -cd -./prometheus -``` - > The above example, you can save `prometheus.yml` at `~/volumes/prometheus` on your host machine You can visit `http://localhost:9090` to see prometheus data. - - - -## Start Grafana -### Install Grafana -https://grafana.com/docs/installation/debian/ - -```bash -apt-get install -y software-properties-common -sudo add-apt-repository "deb https://packages.grafana.com/oss/deb stable main" -wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add - -sudo apt-get update -sudo apt-get install grafana -sudo service grafana-server start -./prometheus -``` - -You can visit `http://localhost:3000/` to open grafana and create your own dashboard. - -> Tips: The default username and password are both admin. We strongly recommend immediately changing your username & password after login - -### Seting Grafana - -Default ID:PW is admin. diff --git a/utils/prometheus/src/lib.rs b/utils/prometheus/src/lib.rs index 802a2b53b7fa5..7cb18b220028c 100644 --- a/utils/prometheus/src/lib.rs +++ b/utils/prometheus/src/lib.rs @@ -97,7 +97,7 @@ pub async fn init_prometheus(mut prometheus_addr: SocketAddr) -> Result<(), Err Err(err) => match err.kind() { io::ErrorKind::AddrInUse | io::ErrorKind::PermissionDenied if prometheus_addr.port() != 0 => { log::warn!( - "Prometheus server to already {} port.", prometheus_addr.port() + "Prometheus metric port {} already in use.", prometheus_addr.port() ); prometheus_addr.set_port(0); continue; @@ -112,12 +112,12 @@ pub async fn init_prometheus(mut prometheus_addr: SocketAddr) -> Result<(), Err } }); - let _server = Server::builder(Incoming(listener.incoming())) + let server = Server::builder(Incoming(listener.incoming())) .executor(Executor) .serve(service) .boxed(); - let result = _server.await.map_err(Into::into); + let result = server.await.map_err(Into::into); result } From 3cfe43cc14a3f7d4b7c4dacef951539aa56b9292 Mon Sep 17 00:00:00 2001 From: Ashley Date: Mon, 20 Jan 2020 10:26:45 +0100 Subject: [PATCH 27/42] endpoint -> exporter --- Cargo.lock | 6 +++--- client/cli/Cargo.toml | 2 +- client/service/Cargo.toml | 2 +- client/service/src/builder.rs | 8 ++++---- client/service/src/config.rs | 2 +- client/service/src/error.rs | 4 ++-- utils/prometheus/Cargo.toml | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 989ab8bc2ed9b..b8df759cf4087 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4493,7 +4493,7 @@ dependencies = [ ] [[package]] -name = "prometheus-endpoint" +name = "prometheus-exporter" version = "0.8.0" dependencies = [ "async-std 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5131,7 +5131,7 @@ dependencies = [ "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "names 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "prometheus-endpoint 0.8.0", + "prometheus-exporter 0.8.0", "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "rpassword 4.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "sc-client-api 2.0.0", @@ -5762,7 +5762,7 @@ dependencies = [ "parity-multiaddr 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "prometheus-endpoint 0.8.0", + "prometheus-exporter 0.8.0", "sc-chain-spec 2.0.0", "sc-client 0.8.0", "sc-client-api 2.0.0", diff --git a/client/cli/Cargo.toml b/client/cli/Cargo.toml index 30bd079e01e15..1c1d967c7d8d5 100644 --- a/client/cli/Cargo.toml +++ b/client/cli/Cargo.toml @@ -29,7 +29,7 @@ sp-core = { version = "2.0.0", path = "../../primitives/core" } sc-service = { version = "0.8", default-features = false, path = "../service" } sp-state-machine = { version = "0.8", path = "../../primitives/state-machine" } sc-telemetry = { version = "2.0.0", path = "../telemetry" } -prometheus-endpoint = { path = "../../utils/prometheus" } +prometheus-exporter = { path = "../../utils/prometheus" } sp-keyring = { version = "2.0.0", path = "../../primitives/keyring" } names = "0.11.0" structopt = "=0.3.7" diff --git a/client/service/Cargo.toml b/client/service/Cargo.toml index acf3f399d16b9..9946377693110 100644 --- a/client/service/Cargo.toml +++ b/client/service/Cargo.toml @@ -51,7 +51,7 @@ sc-rpc = { version = "2.0.0", path = "../rpc" } sc-telemetry = { version = "2.0.0", path = "../telemetry" } sc-offchain = { version = "2.0.0", path = "../offchain" } parity-multiaddr = { package = "parity-multiaddr", version = "0.5.0" } -prometheus-endpoint = { path = "../../utils/prometheus" } +prometheus-exporter = { path = "../../utils/prometheus" } sc-tracing = { version = "2.0.0", path = "../tracing" } tracing = "0.1.10" diff --git a/client/service/src/builder.rs b/client/service/src/builder.rs index 920b5463a0b78..85d4091eed02b 100644 --- a/client/service/src/builder.rs +++ b/client/service/src/builder.rs @@ -51,9 +51,9 @@ use sysinfo::{get_current_pid, ProcessExt, System, SystemExt}; use sc_telemetry::{telemetry, SUBSTRATE_INFO}; use sp_transaction_pool::{TransactionPool, TransactionPoolMaintainer}; use sp_blockchain; -use prometheus_endpoint::{create_gauge, Gauge, U64, F64, Registry}; +use prometheus_exporter::{create_gauge, Gauge, U64, F64, Registry}; -prometheus_endpoint::lazy_static! { +prometheus_exporter::lazy_static! { pub static ref FINALITY_HEIGHT: Gauge = create_gauge( "finality_block_height_number", "Height of the highest finalized block" @@ -1182,7 +1182,7 @@ ServiceBuilder< ).map(drop))); telemetry }); - // Prometheus endpoint + // Prometheus exporter if let Some(port) = config.prometheus_port { let registry = match prometheus_registry { Some(registry) => registry, @@ -1199,7 +1199,7 @@ ServiceBuilder< registry.register(Box::new(NODE_UPLOAD.clone()))?; let future = select( - prometheus_endpoint::init_prometheus(port, registry).boxed(), + prometheus_exporter::init_prometheus(port, registry).boxed(), exit.clone() ).map(drop); diff --git a/client/service/src/config.rs b/client/service/src/config.rs index 9aa7f795ddeca..994ef2e3723b9 100644 --- a/client/service/src/config.rs +++ b/client/service/src/config.rs @@ -73,7 +73,7 @@ pub struct Configuration { pub rpc_ws_max_connections: Option, /// CORS settings for HTTP & WS servers. `None` if all origins are allowed. pub rpc_cors: Option>, - /// Prometheus endpoint Port. `None` if disabled. + /// Prometheus exporter Port. `None` if disabled. pub prometheus_port: Option, /// Telemetry service URL. `None` if disabled. pub telemetry_endpoints: Option, diff --git a/client/service/src/error.rs b/client/service/src/error.rs index c09b2008e3fc0..4cbd172e4b2b3 100644 --- a/client/service/src/error.rs +++ b/client/service/src/error.rs @@ -50,8 +50,8 @@ impl<'a> From<&'a str> for Error { } } -impl From for Error { - fn from(e: prometheus_endpoint::PrometheusError) -> Self { +impl From for Error { + fn from(e: prometheus_exporter::PrometheusError) -> Self { Error::Other(format!("Prometheus error: {}", e)) } } diff --git a/utils/prometheus/Cargo.toml b/utils/prometheus/Cargo.toml index 1aec3eed6b34b..d335505d58cfe 100644 --- a/utils/prometheus/Cargo.toml +++ b/utils/prometheus/Cargo.toml @@ -1,6 +1,6 @@ [package] -description = "Prometheus endpoint server" -name = "prometheus-endpoint" +description = "Prometheus exporter server" +name = "prometheus-exporter" version = "0.8.0" license = "GPL-3.0" authors = ["Parity Technologies "] From 0af2369e6d1fcb2469e6c24ea0afbbd2043d2635 Mon Sep 17 00:00:00 2001 From: Ashley Date: Mon, 20 Jan 2020 10:33:17 +0100 Subject: [PATCH 28/42] fix readme --- utils/prometheus/README.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/utils/prometheus/README.md b/utils/prometheus/README.md index 106c0824e0c05..c6746d573d602 100644 --- a/utils/prometheus/README.md +++ b/utils/prometheus/README.md @@ -1,9 +1,5 @@ # Substrate Prometheus Exporter -<<<<<<< HEAD -======= -![grants](./photo_2019-12-13_16-32-53.jpg) ->>>>>>> nodebreaker/prometheus_v0.3 ## Introduction Prometheus is one of the most widely used monitoring tool for managing highly available services supported by [Cloud Native Computing Foundation](https://www.cncf.io/). By providing Prometheus metrics in Substrate, node operators can easily adopt widely used display/alert tools such as Grafana and Alertmanager without setting-up/operating external Prometheus push gateways (which is an antipattern in the first place) through RPC connections. Easy access to such monitoring tools will benefit parachain developers/operators and validators to have much higher availability of their services. @@ -35,7 +31,7 @@ Then edit `prometheus.yml` and add `jobs` : ```yaml - job_name: kusama static_configs: - - targets: ['localhost:9955'] + - targets: ['localhost:9615'] labels: instance: local-validator ``` From d2bba611438f5c5c379968eb42fcc1cf5d94ecbf Mon Sep 17 00:00:00 2001 From: Ashley Date: Tue, 21 Jan 2020 14:53:28 +0100 Subject: [PATCH 29/42] Remove lazy_static, use ServiceMetrics struct instead --- Cargo.lock | 1 - client/service/src/builder.rs | 168 ++++++++++++++++++++-------------- utils/prometheus/Cargo.toml | 1 - utils/prometheus/src/lib.rs | 18 ++-- 4 files changed, 105 insertions(+), 83 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b8df759cf4087..86d274da59b81 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4500,7 +4500,6 @@ dependencies = [ "derive_more 0.99.2 (registry+https://github.com/rust-lang/crates.io-index)", "futures-util 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "prometheus 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "tokio 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/client/service/src/builder.rs b/client/service/src/builder.rs index 85d4091eed02b..ec336de37de32 100644 --- a/client/service/src/builder.rs +++ b/client/service/src/builder.rs @@ -51,46 +51,72 @@ use sysinfo::{get_current_pid, ProcessExt, System, SystemExt}; use sc_telemetry::{telemetry, SUBSTRATE_INFO}; use sp_transaction_pool::{TransactionPool, TransactionPoolMaintainer}; use sp_blockchain; -use prometheus_exporter::{create_gauge, Gauge, U64, F64, Registry}; +use prometheus_exporter::{create_gauge, Gauge, U64, F64, Registry, PrometheusError}; + +struct ServiceMetrics { + finality_height: Gauge, + best_height: Gauge, + peers_num: Gauge, + tx_count: Gauge, + node_memory: Gauge, + node_cpu: Gauge, + node_download: Gauge, + node_upload: Gauge, + sync_target: Gauge, +} -prometheus_exporter::lazy_static! { - pub static ref FINALITY_HEIGHT: Gauge = create_gauge( - "finality_block_height_number", - "Height of the highest finalized block" - ); - pub static ref BEST_HEIGHT: Gauge = create_gauge( - "best_block_height_number", - "Height of the highest block" - ); - pub static ref PEERS_NUM: Gauge = create_gauge( - "peers_count", - "Number of network gossip peers" - ); - pub static ref TX_COUNT: Gauge = create_gauge( - "transaction_count", - "Number of transactions" - ); - pub static ref NODE_MEMORY: Gauge = create_gauge( - "memory_usage", - "Node memory usage" - ); - pub static ref NODE_CPU: Gauge = create_gauge( - "cpu_usage", - "Node CPU usage" - ); - pub static ref NODE_DOWNLOAD: Gauge = create_gauge( - "receive_byte_per_sec", - "Received bytes per second" - ); - pub static ref NODE_UPLOAD: Gauge = create_gauge( - "sent_byte_per_sec", - "Sent bytes per second" - ); - pub static ref SYNC_TARGET: Gauge = create_gauge( - "sync_target_number", - "Block sync target number" - ); +impl ServiceMetrics { + fn register(registry: &Registry) -> Result { + Ok(Self { + finality_height: create_gauge( + "finality_block_height_number", + "Height of the highest finalized block", + registry + )?, + best_height: create_gauge( + "best_block_height_number", + "Height of the highest block", + registry + )?, + peers_num: create_gauge( + "peers_count", + "Number of network gossip peers", + registry + )?, + tx_count: create_gauge( + "transaction_count", + "Number of transactions", + registry + )?, + node_memory: create_gauge( + "memory_usage", + "Node memory usage", + registry + )?, + node_cpu: create_gauge( + "cpu_usage", + "Node CPU usage", + registry + )?, + node_download: create_gauge( + "receive_byte_per_sec", + "Received bytes per second", + registry + )?, + node_upload: create_gauge( + "sent_byte_per_sec", + "Sent bytes per second", + registry + )?, + sync_target: create_gauge( + "sync_target_number", + "Block sync target number", + registry + )?, + }) + } } + /// Aggregator for the components required to build a service. /// /// # Usage @@ -993,6 +1019,27 @@ ServiceBuilder< let _ = to_spawn_tx.unbounded_send(Box::pin(select(events, exit.clone()).map(drop))); } + // Prometheus exporter and metrics + let metrics = if let Some(port) = config.prometheus_port { + let registry = match prometheus_registry { + Some(registry) => registry, + None => Registry::new_custom(Some("substrate".into()), None)? + }; + + let metrics = ServiceMetrics::register(®istry)?; + + let future = select( + prometheus_exporter::init_prometheus(port, registry).boxed(), + exit.clone() + ).map(drop); + + let _ = to_spawn_tx.unbounded_send(Box::pin(future)); + + Some(metrics) + } else { + None + }; + // Periodically notify the telemetry. let transaction_pool_ = transaction_pool.clone(); let client_ = client.clone(); @@ -1039,16 +1086,18 @@ ServiceBuilder< "disk_read_per_sec" => info.usage.as_ref().map(|usage| usage.io.bytes_read).unwrap_or(0), "disk_write_per_sec" => info.usage.as_ref().map(|usage| usage.io.bytes_written).unwrap_or(0), ); - NODE_MEMORY.set(memory); - NODE_CPU.set(f64::from(cpu_usage)); - TX_COUNT.set(txpool_status.ready as u64); - FINALITY_HEIGHT.set(finalized_number); - BEST_HEIGHT.set(best_number); - PEERS_NUM.set(num_peers as u64); - NODE_DOWNLOAD.set(net_status.average_download_per_sec); - NODE_UPLOAD.set(net_status.average_upload_per_sec); - if let Some(best_seen_block) = best_seen_block { - SYNC_TARGET.set(best_seen_block); + if let Some(metrics) = metrics.as_ref() { + metrics.node_memory.set(memory); + metrics.node_cpu.set(f64::from(cpu_usage)); + metrics.tx_count.set(txpool_status.ready as u64); + metrics.finality_height.set(finalized_number); + metrics.best_height.set(best_number); + metrics.peers_num.set(num_peers as u64); + metrics.node_download.set(net_status.average_download_per_sec); + metrics.node_upload.set(net_status.average_upload_per_sec); + if let Some(best_seen_block) = best_seen_block { + metrics.sync_target.set(best_seen_block); + } } ready(()) @@ -1182,29 +1231,6 @@ ServiceBuilder< ).map(drop))); telemetry }); - // Prometheus exporter - if let Some(port) = config.prometheus_port { - let registry = match prometheus_registry { - Some(registry) => registry, - None => Registry::new_custom(Some("substrate".into()), None)? - }; - - registry.register(Box::new(NODE_MEMORY.clone()))?; - registry.register(Box::new(NODE_CPU.clone()))?; - registry.register(Box::new(TX_COUNT.clone()))?; - registry.register(Box::new(FINALITY_HEIGHT.clone()))?; - registry.register(Box::new(BEST_HEIGHT.clone()))?; - registry.register(Box::new(PEERS_NUM.clone()))?; - registry.register(Box::new(NODE_DOWNLOAD.clone()))?; - registry.register(Box::new(NODE_UPLOAD.clone()))?; - - let future = select( - prometheus_exporter::init_prometheus(port, registry).boxed(), - exit.clone() - ).map(drop); - - let _ = to_spawn_tx.unbounded_send(Box::pin(future)); - } // Instrumentation if let Some(tracing_targets) = config.tracing_targets.as_ref() { diff --git a/utils/prometheus/Cargo.toml b/utils/prometheus/Cargo.toml index d335505d58cfe..8e50b4024e3bc 100644 --- a/utils/prometheus/Cargo.toml +++ b/utils/prometheus/Cargo.toml @@ -12,7 +12,6 @@ hyper = { version = "0.13.1", default-features = false, features = ["stream"] } prometheus = { version = "0.7", features = ["nightly", "process"]} tokio = "0.2" futures-util = { version = "0.3.1", default-features = false, features = ["io"] } -lazy_static = "1.4" derive_more = "0.99" [target.'cfg(not(target_os = "unknown"))'.dependencies] diff --git a/utils/prometheus/src/lib.rs b/utils/prometheus/src/lib.rs index fc53d89ba0301..25f058acc377d 100644 --- a/utils/prometheus/src/lib.rs +++ b/utils/prometheus/src/lib.rs @@ -14,8 +14,6 @@ // You should have received a copy of the GNU General Public License // along with Substrate. If not, see . -extern crate lazy_static; - use futures_util::{FutureExt, future::Future}; use hyper::http::StatusCode; use hyper::{Server, Body, Response, service::{service_fn, make_service_fn}}; @@ -24,16 +22,15 @@ use std::net::SocketAddr; #[cfg(not(target_os = "unknown"))] mod networking; -pub use prometheus::core::{ - GenericGauge as Gauge, AtomicF64 as F64, AtomicI64 as I64, AtomicU64 as U64 +pub use prometheus::{ + Registry, Error as PrometheusError, + core::{GenericGauge as Gauge, AtomicF64 as F64, AtomicI64 as I64, AtomicU64 as U64} }; -pub use prometheus::{Registry, Error as PrometheusError}; -pub use lazy_static::lazy_static; -pub fn create_gauge(name: &str, description: &str) -> Gauge { - let opts = Opts::new(name, description); - let gauge = Gauge::with_opts(opts).expect("Creating Gauge Failed"); - gauge +pub fn create_gauge(name: &str, description: &str, registry: &Registry) -> Result, PrometheusError> { + let gauge = Gauge::with_opts(Opts::new(name, description))?; + registry.register(Box::new(gauge.clone()))?; + Ok(gauge) } #[derive(Debug, derive_more::Display, derive_more::From)] @@ -47,6 +44,7 @@ pub enum Error { #[display(fmt = "Prometheus exporter port {} already in use.", _0)] PortInUse(SocketAddr) } + impl std::error::Error for Error { fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { match self { From 9bde830938a6075fb1c738234f99c1a16ea79606 Mon Sep 17 00:00:00 2001 From: Ashley Date: Thu, 23 Jan 2020 18:49:59 +0100 Subject: [PATCH 30/42] Switch to using GaugeVecs --- Cargo.lock | 35 ------------ client/service/src/builder.rs | 103 +++++++++++++--------------------- utils/prometheus/Cargo.toml | 2 +- utils/prometheus/src/lib.rs | 17 +++--- 4 files changed, 50 insertions(+), 107 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 86d274da59b81..25d2f90533b54 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3307,11 +3307,6 @@ name = "nohash-hasher" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "nom" -version = "1.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "nom" version = "4.2.3" @@ -4466,17 +4461,6 @@ dependencies = [ "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "procinfo" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", - "nom 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "prometheus" version = "0.7.0" @@ -4485,8 +4469,6 @@ dependencies = [ "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", - "procinfo 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "protobuf 2.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "spin 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4950,14 +4932,6 @@ name = "rustc-hex" version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "rustc_version" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "semver 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "rustc_version" version = "0.2.3" @@ -5983,11 +5957,6 @@ dependencies = [ "core-foundation-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "semver" -version = "0.1.20" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "semver" version = "0.6.0" @@ -8558,7 +8527,6 @@ dependencies = [ "checksum nix 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6c722bee1037d430d0f8e687bbdbf222f27cc6e4e68d5caf630857bb2b6dbdce" "checksum nodrop 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" "checksum nohash-hasher 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4e657a6ec97f9a3ba46f6f7034ea6db9fcd5b71d25ef1074b7bc03da49be0e8e" -"checksum nom 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "a5b8c256fd9471521bcb84c3cdba98921497f1a331cbc15b8030fc63b82050ce" "checksum nom 4.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2ad2a91a8e869eeb30b9cb3119ae87773a8f4ae617f41b1eb9c154b2905f7bd6" "checksum num-bigint 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "f9c3f34cdd24f334cb265d9bf8bfa8a241920d026916785747a92f0e55541a1a" "checksum num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)" = "b85e541ef8255f6cf42bbfe4ef361305c6c135d10919ecc26126c4e5ae94bc09" @@ -8618,7 +8586,6 @@ dependencies = [ "checksum proc-macro-nested 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "369a6ed065f249a159e06c45752c780bda2fb53c995718f9e484d08daa9eb42e" "checksum proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)" = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" "checksum proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "9c9e470a8dc4aeae2dee2f335e8f533e2d4b347e1434e5671afc49b054592f27" -"checksum procinfo 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f42e8578852a3306838981aedad8c5642ba794929aa12af0c9eb6c072b77af6c" "checksum prometheus 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5567486d5778e2c6455b1b90ff1c558f29e751fc018130fa182e15828e728af1" "checksum prost 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "96d14b1c185652833d24aaad41c5832b0be5616a590227c1fbff57c616754b23" "checksum prost-build 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "eb788126ea840817128183f8f603dce02cb7aea25c2a0b764359d8e20010702e" @@ -8668,7 +8635,6 @@ dependencies = [ "checksum rust-argon2 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4ca4eaef519b494d1f2848fc602d18816fed808a981aedf4f1f00ceb7c9d32cf" "checksum rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" "checksum rustc-hex 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" -"checksum rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "c5f5376ea5e30ce23c03eb77cbe4962b988deead10910c372b226388b594c084" "checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" "checksum rustls 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b25a18b1bf7387f0145e7f8324e700805aade3842dd3db2e74e4cdeb4677c09e" "checksum rustversion 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c48f91977f4ef3be5358c15d131d3f663f6b4d7a112555bf3bf52ad23b6659e5" @@ -8686,7 +8652,6 @@ dependencies = [ "checksum sct 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e3042af939fca8c3453b7af0f1c66e533a15a86169e39de2657310ade8f98d3c" "checksum security-framework 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8ef2429d7cefe5fd28bd1d2ed41c944547d4ff84776f5935b456da44593a16df" "checksum security-framework-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e31493fc37615debb8c5090a7aeb4a9730bc61e77ab10b9af59f1a202284f895" -"checksum semver 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)" = "d4f410fedcf71af0345d7607d246e7ad15faaadd49d240ee3b24e5dc21a820ac" "checksum semver 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a3186ec9e65071a2095434b1f5bb24838d4e8e130f584c790f6033c79943537" "checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" "checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" diff --git a/client/service/src/builder.rs b/client/service/src/builder.rs index ec336de37de32..11d11151f948a 100644 --- a/client/service/src/builder.rs +++ b/client/service/src/builder.rs @@ -51,68 +51,40 @@ use sysinfo::{get_current_pid, ProcessExt, System, SystemExt}; use sc_telemetry::{telemetry, SUBSTRATE_INFO}; use sp_transaction_pool::{TransactionPool, TransactionPoolMaintainer}; use sp_blockchain; -use prometheus_exporter::{create_gauge, Gauge, U64, F64, Registry, PrometheusError}; +use prometheus_exporter::{register, Gauge, Counter, U64, F64, Registry, PrometheusError, Opts, GaugeVec}; struct ServiceMetrics { - finality_height: Gauge, - best_height: Gauge, - peers_num: Gauge, - tx_count: Gauge, - node_memory: Gauge, - node_cpu: Gauge, - node_download: Gauge, - node_upload: Gauge, - sync_target: Gauge, + block_height: GaugeVec, + peers_count: Gauge, + transactions_total: Counter, + memory_usage_bytes: Gauge, + cpu_usage_percentage: Gauge, + network_per_sec_bytes: GaugeVec, } impl ServiceMetrics { fn register(registry: &Registry) -> Result { Ok(Self { - finality_height: create_gauge( - "finality_block_height_number", - "Height of the highest finalized block", - registry - )?, - best_height: create_gauge( - "best_block_height_number", - "Height of the highest block", - registry - )?, - peers_num: create_gauge( - "peers_count", - "Number of network gossip peers", - registry - )?, - tx_count: create_gauge( - "transaction_count", - "Number of transactions", - registry - )?, - node_memory: create_gauge( - "memory_usage", - "Node memory usage", - registry - )?, - node_cpu: create_gauge( - "cpu_usage", - "Node CPU usage", - registry - )?, - node_download: create_gauge( - "receive_byte_per_sec", - "Received bytes per second", - registry - )?, - node_upload: create_gauge( - "sent_byte_per_sec", - "Sent bytes per second", - registry - )?, - sync_target: create_gauge( - "sync_target_number", - "Block sync target number", - registry - )?, + block_height: register(GaugeVec::new( + Opts::new("block_height", "Height of the chain"), + &["number"] + )?, registry)?, + peers_count: register(Gauge::new( + "peers_count", "Number of network gossip peers", + )?, registry)?, + transactions_total: register(Counter::new( + "transactions_total", "Total number of transactions", + )?, registry)?, + memory_usage_bytes: register(Gauge::new( + "memory_usage_bytes", "Node memory usage", + )?, registry)?, + cpu_usage_percentage: register(Gauge::new( + "cpu_usage_percentage", "Node CPU usage", + )?, registry)?, + network_per_sec_bytes: register(GaugeVec::new( + Opts::new("network_per_sec_bytes", "Networking bytes per second"), + &["direction"] + )?, registry)?, }) } } @@ -1087,16 +1059,19 @@ ServiceBuilder< "disk_write_per_sec" => info.usage.as_ref().map(|usage| usage.io.bytes_written).unwrap_or(0), ); if let Some(metrics) = metrics.as_ref() { - metrics.node_memory.set(memory); - metrics.node_cpu.set(f64::from(cpu_usage)); - metrics.tx_count.set(txpool_status.ready as u64); - metrics.finality_height.set(finalized_number); - metrics.best_height.set(best_number); - metrics.peers_num.set(num_peers as u64); - metrics.node_download.set(net_status.average_download_per_sec); - metrics.node_upload.set(net_status.average_upload_per_sec); + metrics.memory_usage_bytes.set(memory); + metrics.cpu_usage_percentage.set(f64::from(cpu_usage)); + metrics.transactions_total.inc_by(txpool_status.ready as u64); + metrics.peers_count.set(num_peers as u64); + + metrics.network_per_sec_bytes.with_label_values(&["download"]).set(net_status.average_download_per_sec); + metrics.network_per_sec_bytes.with_label_values(&["upload"]).set(net_status.average_upload_per_sec); + + metrics.block_height.with_label_values(&["finalized"]).set(finalized_number); + metrics.block_height.with_label_values(&["best"]).set(best_number); + if let Some(best_seen_block) = best_seen_block { - metrics.sync_target.set(best_seen_block); + metrics.block_height.with_label_values(&["sync_target"]).set(best_seen_block); } } diff --git a/utils/prometheus/Cargo.toml b/utils/prometheus/Cargo.toml index 8e50b4024e3bc..6b591a8b2cbd6 100644 --- a/utils/prometheus/Cargo.toml +++ b/utils/prometheus/Cargo.toml @@ -9,7 +9,7 @@ edition = "2018" [dependencies] log = "0.4.8" hyper = { version = "0.13.1", default-features = false, features = ["stream"] } -prometheus = { version = "0.7", features = ["nightly", "process"]} +prometheus = "0.7" tokio = "0.2" futures-util = { version = "0.3.1", default-features = false, features = ["io"] } derive_more = "0.99" diff --git a/utils/prometheus/src/lib.rs b/utils/prometheus/src/lib.rs index 25f058acc377d..c3fcd6ad40a16 100644 --- a/utils/prometheus/src/lib.rs +++ b/utils/prometheus/src/lib.rs @@ -17,20 +17,23 @@ use futures_util::{FutureExt, future::Future}; use hyper::http::StatusCode; use hyper::{Server, Body, Response, service::{service_fn, make_service_fn}}; -use prometheus::{Encoder, Opts, TextEncoder, core::Atomic}; +use prometheus::{Encoder, TextEncoder, core::Collector}; use std::net::SocketAddr; #[cfg(not(target_os = "unknown"))] mod networking; pub use prometheus::{ - Registry, Error as PrometheusError, - core::{GenericGauge as Gauge, AtomicF64 as F64, AtomicI64 as I64, AtomicU64 as U64} + Registry, Error as PrometheusError, Opts, + core::{ + GenericGauge as Gauge, GenericCounter as Counter, + GenericGaugeVec as GaugeVec, GenericCounterVec as CounterVec, + AtomicF64 as F64, AtomicI64 as I64, AtomicU64 as U64, + } }; -pub fn create_gauge(name: &str, description: &str, registry: &Registry) -> Result, PrometheusError> { - let gauge = Gauge::with_opts(Opts::new(name, description))?; - registry.register(Box::new(gauge.clone()))?; - Ok(gauge) +pub fn register(metric: T, registry: &Registry) -> Result { + registry.register(Box::new(metric.clone()))?; + Ok(metric) } #[derive(Debug, derive_more::Display, derive_more::From)] From f64a4823f0e6c53d33382c28a56b99294a5ae65d Mon Sep 17 00:00:00 2001 From: nodebreaker-carlsagan Date: Fri, 24 Jan 2020 16:45:27 +0900 Subject: [PATCH 31/42] chore: without nightly , edit README --- utils/prometheus/Cargo.toml | 2 +- utils/prometheus/README.md | 45 +++++++------------------------------ 2 files changed, 9 insertions(+), 38 deletions(-) diff --git a/utils/prometheus/Cargo.toml b/utils/prometheus/Cargo.toml index 8e50b4024e3bc..81980d1aa379f 100644 --- a/utils/prometheus/Cargo.toml +++ b/utils/prometheus/Cargo.toml @@ -9,7 +9,7 @@ edition = "2018" [dependencies] log = "0.4.8" hyper = { version = "0.13.1", default-features = false, features = ["stream"] } -prometheus = { version = "0.7", features = ["nightly", "process"]} +prometheus = { version = "0.7", features = ["process"]} tokio = "0.2" futures-util = { version = "0.3.1", default-features = false, features = ["io"] } derive_more = "0.99" diff --git a/utils/prometheus/README.md b/utils/prometheus/README.md index c6746d573d602..9dd0882105c69 100644 --- a/utils/prometheus/README.md +++ b/utils/prometheus/README.md @@ -2,44 +2,15 @@ ## Introduction -Prometheus is one of the most widely used monitoring tool for managing highly available services supported by [Cloud Native Computing Foundation](https://www.cncf.io/). By providing Prometheus metrics in Substrate, node operators can easily adopt widely used display/alert tools such as Grafana and Alertmanager without setting-up/operating external Prometheus push gateways (which is an antipattern in the first place) through RPC connections. Easy access to such monitoring tools will benefit parachain developers/operators and validators to have much higher availability of their services. +[Prometheus](https://prometheus.io/) is one of the most widely used monitoring tools for managing highly available services supported by [Cloud Native Computing Foundation](https://www.cncf.io/). By providing Prometheus metrics in Substrate, node operators can easily adopt widely used display/alert tools such +as [Grafana](https://grafana.com/) and [Alertmanager](https://prometheus.io/docs/alerting/alertmanager/). Easy access to such monitoring tools will benefit parachain developers/operators and validators to have much higher availability of their services. -## Table of Contents +Metrics will be served under `/metrics` on TCP port 9615 by default. -Metrics +## Quick Start + +1. From the root of the repository start Substrate `cargo run --release`. -Start Prometheus - - Edit Prometheus config file +2. In another terminal run `curl localhost:9615/metrics` to retrieve the metrics. - -## Metrics - -Substrate can report and serve the Prometheus metrics, which in their turn can be consumed by Prometheus collector(s). - -This functionality is disabled by default. - -Metrics will be served under /metrics on 9615 port by default. - - -## Start Prometheus -### Edit Prometheus config file - -You can visit [prometheus.yml](https://github.com/prometheus/prometheus/blob/master/documentation/examples/prometheus.yml) to download default `prometheus.yml`. - -Then edit `prometheus.yml` and add `jobs` : - -```yaml - - job_name: kusama - static_configs: - - targets: ['localhost:9615'] - labels: - instance: local-validator -``` - -> Note:value of targets is ip:port which used by substrate monitor - -### Start Prometheus - -> The above example, you can save `prometheus.yml` at `~/volumes/prometheus` on your host machine - -You can visit `http://localhost:9090` to see prometheus data. +To learn how to configure Prometheus see the Prometheus [Getting Started](https://prometheus.io/docs/prometheus/latest/getting_started/) guide. \ No newline at end of file From 50f29284c5c16977d7597ece1e1924f9aa28da11 Mon Sep 17 00:00:00 2001 From: Ashley Date: Mon, 27 Jan 2020 11:12:30 +0100 Subject: [PATCH 32/42] block_height -> block_height_number --- client/service/src/builder.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/client/service/src/builder.rs b/client/service/src/builder.rs index 11d11151f948a..e00f747291d3c 100644 --- a/client/service/src/builder.rs +++ b/client/service/src/builder.rs @@ -54,7 +54,7 @@ use sp_blockchain; use prometheus_exporter::{register, Gauge, Counter, U64, F64, Registry, PrometheusError, Opts, GaugeVec}; struct ServiceMetrics { - block_height: GaugeVec, + block_height_number: GaugeVec, peers_count: Gauge, transactions_total: Counter, memory_usage_bytes: Gauge, @@ -65,9 +65,9 @@ struct ServiceMetrics { impl ServiceMetrics { fn register(registry: &Registry) -> Result { Ok(Self { - block_height: register(GaugeVec::new( - Opts::new("block_height", "Height of the chain"), - &["number"] + block_height_number: register(GaugeVec::new( + Opts::new("block_height_number", "Height of the chain"), + &["status"] )?, registry)?, peers_count: register(Gauge::new( "peers_count", "Number of network gossip peers", @@ -1067,11 +1067,11 @@ ServiceBuilder< metrics.network_per_sec_bytes.with_label_values(&["download"]).set(net_status.average_download_per_sec); metrics.network_per_sec_bytes.with_label_values(&["upload"]).set(net_status.average_upload_per_sec); - metrics.block_height.with_label_values(&["finalized"]).set(finalized_number); - metrics.block_height.with_label_values(&["best"]).set(best_number); + metrics.block_height_number.with_label_values(&["finalized"]).set(finalized_number); + metrics.block_height_number.with_label_values(&["best"]).set(best_number); if let Some(best_seen_block) = best_seen_block { - metrics.block_height.with_label_values(&["sync_target"]).set(best_seen_block); + metrics.block_height_number.with_label_values(&["sync_target"]).set(best_seen_block); } } From 6a25ea8147e5b1352d2e7a3272a97e2f9c4d0505 Mon Sep 17 00:00:00 2001 From: Ashley Date: Wed, 29 Jan 2020 12:20:53 +0100 Subject: [PATCH 33/42] Switch to a ready_transactions_number gauge --- client/service/src/builder.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/client/service/src/builder.rs b/client/service/src/builder.rs index 68a4c242c29fd..51112367a6f62 100644 --- a/client/service/src/builder.rs +++ b/client/service/src/builder.rs @@ -51,12 +51,12 @@ use sysinfo::{get_current_pid, ProcessExt, System, SystemExt}; use sc_telemetry::{telemetry, SUBSTRATE_INFO}; use sp_transaction_pool::{TransactionPool, TransactionPoolMaintainer}; use sp_blockchain; -use prometheus_exporter::{register, Gauge, Counter, U64, F64, Registry, PrometheusError, Opts, GaugeVec}; +use prometheus_exporter::{register, Gauge, U64, F64, Registry, PrometheusError, Opts, GaugeVec}; struct ServiceMetrics { block_height_number: GaugeVec, peers_count: Gauge, - transactions_total: Counter, + ready_transactions_number: Gauge, memory_usage_bytes: Gauge, cpu_usage_percentage: Gauge, network_per_sec_bytes: GaugeVec, @@ -72,8 +72,8 @@ impl ServiceMetrics { peers_count: register(Gauge::new( "peers_count", "Number of network gossip peers", )?, registry)?, - transactions_total: register(Counter::new( - "transactions_total", "Total number of transactions", + ready_transactions_number: register(Gauge::new( + "ready_transactions_number", "Number of transactions in the ready queue", )?, registry)?, memory_usage_bytes: register(Gauge::new( "memory_usage_bytes", "Node memory usage", @@ -1061,7 +1061,7 @@ ServiceBuilder< if let Some(metrics) = metrics.as_ref() { metrics.memory_usage_bytes.set(memory); metrics.cpu_usage_percentage.set(f64::from(cpu_usage)); - metrics.transactions_total.inc_by(txpool_status.ready as u64); + metrics.ready_transactions_number.set(txpool_status.ready as u64); metrics.peers_count.set(num_peers as u64); metrics.network_per_sec_bytes.with_label_values(&["download"]).set(net_status.average_download_per_sec); From bb388f590ace3f02277d0be9c2448da32db0503e Mon Sep 17 00:00:00 2001 From: Hyungsuk Kang Date: Thu, 30 Jan 2020 23:00:47 -0800 Subject: [PATCH 34/42] Update utils/prometheus/src/lib.rs Co-Authored-By: Max Inden --- utils/prometheus/src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/utils/prometheus/src/lib.rs b/utils/prometheus/src/lib.rs index c3fcd6ad40a16..f1027ce7ef87d 100644 --- a/utils/prometheus/src/lib.rs +++ b/utils/prometheus/src/lib.rs @@ -85,6 +85,7 @@ impl hyper::rt::Executor for Executor async_std::task::spawn(future); } } + /// Initializes the metrics context, and starts an HTTP server /// to serve metrics. #[cfg(not(target_os = "unknown"))] From 77ba2523b58cb64d20526255d22ced77d315940e Mon Sep 17 00:00:00 2001 From: nodebreaker-carlsagan Date: Fri, 31 Jan 2020 16:59:24 +0900 Subject: [PATCH 35/42] no-prometheus flag add --- client/cli/src/lib.rs | 13 ++++++++----- client/cli/src/params.rs | 6 ++++++ 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/client/cli/src/lib.rs b/client/cli/src/lib.rs index 785f1919247e0..93a79c820523b 100644 --- a/client/cli/src/lib.rs +++ b/client/cli/src/lib.rs @@ -1065,13 +1065,9 @@ where let rpc_interface: &str = interface_str(cli.rpc_external, cli.unsafe_rpc_external, cli.validator)?; let ws_interface: &str = interface_str(cli.ws_external, cli.unsafe_ws_external, cli.validator)?; - let prometheus_interface: &str = if cli.prometheus_external { "0.0.0.0" } else { "127.0.0.1" }; config.rpc_http = Some(parse_address(&format!("{}:{}", rpc_interface, 9933), cli.rpc_port)?); config.rpc_ws = Some(parse_address(&format!("{}:{}", ws_interface, 9944), cli.ws_port)?); - config.prometheus_port = Some( - parse_address(&format!("{}:{}", prometheus_interface, 9615), cli.prometheus_port)? - ); config.rpc_ws_max_connections = cli.ws_max_connections; config.rpc_cors = cli.rpc_cors.unwrap_or_else(|| if is_dev { @@ -1094,7 +1090,14 @@ where } else if !cli.telemetry_endpoints.is_empty() { config.telemetry_endpoints = Some(TelemetryEndpoints::new(cli.telemetry_endpoints)); } - + // Override prometheus + if cli.no_prometheus { + config.prometheus_port = None; + } else { + let prometheus_interface: &str = if cli.prometheus_external { "0.0.0.0" } else { "127.0.0.1" }; + config.prometheus_port = Some( + parse_address(&format!("{}:{}", prometheus_interface, 9615), cli.prometheus_port)?); + } config.tracing_targets = cli.tracing_targets.into(); config.tracing_receiver = cli.tracing_receiver.into(); diff --git a/client/cli/src/params.rs b/client/cli/src/params.rs index 4d5164ea7e874..fe7c34fbb1a45 100644 --- a/client/cli/src/params.rs +++ b/client/cli/src/params.rs @@ -480,6 +480,12 @@ pub struct RunCmd { #[structopt(long = "prometheus-port", value_name = "PORT")] pub prometheus_port: Option, + /// Disable connecting to the Substrate prometheus. + /// + /// prometheus is on by default on global chains. + #[structopt(long = "no-prometheus")] + pub no_prometheus: bool, + /// The human-readable name for this node. /// /// The node name will be reported to the telemetry server, if enabled. From 5e327c22f46c1b8a1eb251087e4d9d6ce762124f Mon Sep 17 00:00:00 2001 From: nodebreaker-carlsagan Date: Fri, 31 Jan 2020 18:19:14 +0900 Subject: [PATCH 36/42] /metrics url Input check --- utils/prometheus/src/lib.rs | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/utils/prometheus/src/lib.rs b/utils/prometheus/src/lib.rs index f1027ce7ef87d..a59f17a14a738 100644 --- a/utils/prometheus/src/lib.rs +++ b/utils/prometheus/src/lib.rs @@ -16,7 +16,7 @@ use futures_util::{FutureExt, future::Future}; use hyper::http::StatusCode; -use hyper::{Server, Body, Response, service::{service_fn, make_service_fn}}; +use hyper::{Server, Body, Request, Response, service::{service_fn, make_service_fn}}; use prometheus::{Encoder, TextEncoder, core::Collector}; use std::net::SocketAddr; #[cfg(not(target_os = "unknown"))] @@ -59,17 +59,25 @@ impl std::error::Error for Error { } } -async fn request_metrics(registry: Registry) -> Result, Error> { - let metric_families = registry.gather(); - let mut buffer = vec![]; - let encoder = TextEncoder::new(); - encoder.encode(&metric_families, &mut buffer).unwrap(); - - Response::builder() - .status(StatusCode::OK) - .header("Content-Type", encoder.format_type()) - .body(Body::from(buffer)) +async fn request_metrics(req: Request, registry: Registry) -> Result, Error> { + if req.uri().path() == "/metrics" { + let metric_families = registry.gather(); + let mut buffer = vec![]; + let encoder = TextEncoder::new(); + encoder.encode(&metric_families, &mut buffer).unwrap(); + + Response::builder() + .status(StatusCode::OK) + .header("Content-Type", encoder.format_type()) + .body(Body::from(buffer)) + .map_err(Error::Http) + } else { + Response::builder() + .status(StatusCode::NOT_FOUND) + .body(Body::from("Not found.")) .map_err(Error::Http) + } + } #[derive(Clone)] @@ -101,8 +109,8 @@ pub async fn init_prometheus(prometheus_addr: SocketAddr, registry: Registry) -> let registry = registry.clone(); async move { - Ok::<_, hyper::Error>(service_fn(move |_| { - request_metrics(registry.clone()) + Ok::<_, hyper::Error>(service_fn(move |req: Request| { + request_metrics(req, registry.clone()) })) } }); From ccb3179bfca127433db6767ce0f09752139929a2 Mon Sep 17 00:00:00 2001 From: nodebreaker-carlsagan Date: Wed, 5 Feb 2020 15:16:50 +0900 Subject: [PATCH 37/42] remove prometheus in Tracing --- client/cli/src/params.rs | 4 ++-- client/tracing/src/lib.rs | 8 +------- utils/prometheus/src/lib.rs | 6 ++---- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/client/cli/src/params.rs b/client/cli/src/params.rs index fe7c34fbb1a45..128c66b30b8a9 100644 --- a/client/cli/src/params.rs +++ b/client/cli/src/params.rs @@ -480,9 +480,9 @@ pub struct RunCmd { #[structopt(long = "prometheus-port", value_name = "PORT")] pub prometheus_port: Option, - /// Disable connecting to the Substrate prometheus. + /// Do not expose a Prometheus metric endpoint. /// - /// prometheus is on by default on global chains. + /// Prometheus metric endpoint is enabled by default. #[structopt(long = "no-prometheus")] pub no_prometheus: bool, diff --git a/client/tracing/src/lib.rs b/client/tracing/src/lib.rs index b6c1b1120f4ed..c00bca9275eec 100644 --- a/client/tracing/src/lib.rs +++ b/client/tracing/src/lib.rs @@ -34,7 +34,7 @@ //! let span = tracing::span!(tracing::Level::INFO, "my_span_name", my_number = 10, a_key = "a value"); //! let _guard = span.enter(); //! ``` -//! Currently we provide `Log` (default), `Telemetry` and `Prometheus` variants for `Receiver` +//! Currently we provide `Log` (default), `Telemetry` variants for `Receiver` use std::collections::HashMap; use std::fmt; @@ -62,8 +62,6 @@ pub enum TracingReceiver { Log, /// Output to telemetry Telemetry, - /// Output to Prometheus endpoint - Prometheus, } impl Default for TracingReceiver { @@ -254,7 +252,6 @@ impl ProfilingSubscriber { match self.receiver { TracingReceiver::Log => print_log(span_datum), TracingReceiver::Telemetry => send_telemetry(span_datum), - TracingReceiver::Prometheus => send_prometheus(span_datum), } } } @@ -290,6 +287,3 @@ fn send_telemetry(span_datum: SpanDatum) { ); } -fn send_prometheus(_span_datum: SpanDatum) { - unimplemented!() -} diff --git a/utils/prometheus/src/lib.rs b/utils/prometheus/src/lib.rs index a59f17a14a738..31cb627578667 100644 --- a/utils/prometheus/src/lib.rs +++ b/utils/prometheus/src/lib.rs @@ -66,14 +66,12 @@ async fn request_metrics(req: Request, registry: Registry) -> Result Date: Fri, 14 Feb 2020 13:39:45 +0900 Subject: [PATCH 38/42] remove prometheus in Tracing --- client/cli/src/params.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/client/cli/src/params.rs b/client/cli/src/params.rs index 128c66b30b8a9..1a4b284432b19 100644 --- a/client/cli/src/params.rs +++ b/client/cli/src/params.rs @@ -299,7 +299,6 @@ arg_enum! { pub enum TracingReceiver { Log, Telemetry, - Prometheus, } } @@ -308,7 +307,6 @@ impl Into for TracingReceiver { match self { TracingReceiver::Log => sc_tracing::TracingReceiver::Log, TracingReceiver::Telemetry => sc_tracing::TracingReceiver::Telemetry, - TracingReceiver::Prometheus => sc_tracing::TracingReceiver::Prometheus, } } } From e76f20085811e86f649df6ff36979f5f542314d6 Mon Sep 17 00:00:00 2001 From: nodebreaker-carlsagan Date: Fri, 14 Feb 2020 16:46:55 +0900 Subject: [PATCH 39/42] chore: master code rebase edit --- Cargo.lock | 839 ++++++---------------------------- client/cli/src/lib.rs | 22 +- client/service/src/builder.rs | 5 +- 3 files changed, 137 insertions(+), 729 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8249ccd698403..d32998415722b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -598,9 +598,12 @@ version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "31850b4a4d6bae316f7a09e691c944c28299298837edc0a03f755618c23cbc01" dependencies = [ - "num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", - "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", + "js-sys", + "num-integer", + "num-traits", + "serde", + "time", + "wasm-bindgen", ] [[package]] @@ -1915,6 +1918,34 @@ dependencies = [ "scroll", ] +[[package]] +name = "grafana-data-source" +version = "0.8.0" +dependencies = [ + "async-std", + "chrono", + "derive_more", + "futures-timer 3.0.1", + "futures-util", + "hyper 0.13.2", + "lazy_static", + "log 0.4.8", + "parking_lot 0.10.0", + "serde", + "serde_json", + "tokio 0.2.11", +] + +[[package]] +name = "grafana-data-source-test" +version = "2.0.0" +dependencies = [ + "futures 0.3.4", + "futures-timer 3.0.1", + "grafana-data-source", + "rand 0.7.3", +] + [[package]] name = "h2" version = "0.1.26" @@ -4920,41 +4951,7 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "prometheus" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "protobuf 2.8.1 (registry+https://github.com/rust-lang/crates.io-index)", - "quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "spin 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "prometheus-exporter" -version = "0.8.0" -dependencies = [ - "async-std 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "derive_more 0.99.2 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-util 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "prometheus 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "prost" -version = "0.5.0" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3acb317c6ff86a4e579dfa00fc5e6cca91ecbb4e7eb2df0468805b674eb88548" dependencies = [ @@ -5598,36 +5595,38 @@ dependencies = [ name = "sc-cli" version = "0.8.0" dependencies = [ - "ansi_term 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)", - "app_dirs 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", - "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", - "derive_more 0.99.2 (registry+https://github.com/rust-lang/crates.io-index)", - "env_logger 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", - "fdlimit 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "names 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "prometheus-exporter 0.8.0", - "regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "rpassword 4.0.3 (registry+https://github.com/rust-lang/crates.io-index)", - "sc-client-api 2.0.0", - "sc-network 0.8.0", - "sc-service 0.8.0", - "sc-telemetry 2.0.0", - "sc-tracing 2.0.0", - "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-blockchain 2.0.0", - "sp-core 2.0.0", - "sp-keyring 2.0.0", - "sp-panic-handler 2.0.0", - "sp-runtime 2.0.0", - "sp-state-machine 0.8.0", - "structopt 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", - "tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "ansi_term 0.12.1", + "app_dirs", + "atty", + "chrono", + "clap", + "derive_more", + "env_logger 0.7.1", + "fdlimit", + "futures 0.3.4", + "lazy_static", + "log 0.4.8", + "names", + "parity-util-mem", + "regex", + "rpassword", + "sc-client-api", + "sc-informant", + "sc-network", + "sc-service", + "sc-telemetry", + "sc-tracing", + "serde_json", + "sp-blockchain", + "sp-core", + "sp-keyring", + "sp-panic-handler", + "sp-runtime", + "sp-state-machine", + "structopt", + "tempfile", + "time", + "tokio 0.2.11", ] [[package]] @@ -6299,51 +6298,54 @@ dependencies = [ name = "sc-service" version = "0.8.0" dependencies = [ - "derive_more 0.99.2 (registry+https://github.com/rust-lang/crates.io-index)", - "exit-future 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-timer 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-multiaddr 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "prometheus-exporter 0.8.0", - "sc-chain-spec 2.0.0", - "sc-client 0.8.0", - "sc-client-api 2.0.0", - "sc-client-db 0.8.0", - "sc-executor 0.8.0", - "sc-finality-grandpa 0.8.0", - "sc-keystore 2.0.0", - "sc-network 0.8.0", - "sc-offchain 2.0.0", - "sc-rpc 2.0.0", - "sc-rpc-server 2.0.0", - "sc-telemetry 2.0.0", - "sc-tracing 2.0.0", - "sc-transaction-pool 2.0.0", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", - "slog 2.5.2 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-api 2.0.0", - "sp-application-crypto 2.0.0", - "sp-blockchain 2.0.0", - "sp-consensus 0.8.0", - "sp-consensus-babe 0.8.0", - "sp-core 2.0.0", - "sp-finality-grandpa 2.0.0", - "sp-io 2.0.0", - "sp-runtime 2.0.0", - "sp-session 2.0.0", - "sp-transaction-pool 2.0.0", - "substrate-test-runtime-client 2.0.0", - "sysinfo 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)", - "target_info 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-executor 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", - "tracing 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "derive_more", + "exit-future", + "futures 0.1.29", + "futures 0.3.4", + "futures-diagnose", + "futures-timer 3.0.1", + "grafana-data-source", + "lazy_static", + "log 0.4.8", + "parity-multiaddr", + "parity-scale-codec", + "parity-util-mem", + "parking_lot 0.10.0", + "sc-chain-spec", + "sc-client", + "sc-client-api", + "sc-client-db", + "sc-executor", + "sc-finality-grandpa", + "sc-keystore", + "sc-network", + "sc-offchain", + "sc-rpc", + "sc-rpc-server", + "sc-telemetry", + "sc-tracing", + "sc-transaction-pool", + "serde", + "serde_json", + "slog", + "sp-api", + "sp-application-crypto", + "sp-blockchain", + "sp-consensus", + "sp-consensus-babe", + "sp-core", + "sp-finality-grandpa", + "sp-io", + "sp-runtime", + "sp-session", + "sp-transaction-pool", + "substrate-test-runtime-client", + "sysinfo", + "target_info", + "tokio 0.2.11", + "tokio-executor 0.1.10", + "tracing", + "wasm-timer", ] [[package]] @@ -6402,15 +6404,16 @@ dependencies = [ name = "sc-tracing" version = "2.0.0" dependencies = [ - "erased-serde 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sc-telemetry 2.0.0", - "serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)", - "slog 2.5.2 (registry+https://github.com/rust-lang/crates.io-index)", - "tracing 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "tracing-core 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "erased-serde", + "grafana-data-source", + "log 0.4.8", + "parking_lot 0.10.0", + "sc-telemetry", + "serde", + "serde_json", + "slog", + "tracing", + "tracing-core", ] [[package]] @@ -9085,591 +9088,7 @@ version = "1.4.15+zstd.1.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "89719b034dc22d240d5b407fb0a3fe6d29952c181cff9a9f95c0bd40b4f8f7d8" dependencies = [ - "cc 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)", - "glob 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[metadata] -"checksum Inflector 0.11.4 (registry+https://github.com/rust-lang/crates.io-index)" = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" -"checksum adler32 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "5d2e7343e7fc9de883d1b0341e0b13970f764c14101234857d2ddafa1cb1cac2" -"checksum aes-ctr 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d2e5b0458ea3beae0d1d8c0f3946564f8e10f90646cf78c06b4351052058d1ee" -"checksum aes-soft 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cfd7e7ae3f9a1fb5c03b389fc6bb9a51400d0c13053f0dca698c832bfd893a0d" -"checksum aesni 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2f70a6b5f971e473091ab7cfb5ffac6cde81666c4556751d8d5620ead8abf100" -"checksum ahash 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)" = "6f33b5018f120946c1dcf279194f238a9f146725593ead1c08fa47ff22b0b5d3" -"checksum aho-corasick 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)" = "58fb5e95d83b38284460a5fda7d6470aa0b8844d283a0b614b8535e880800d2d" -"checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" -"checksum ansi_term 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" -"checksum anyhow 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)" = "9267dff192e68f3399525901e709a48c1d3982c9c072fa32f2127a0cb0babf14" -"checksum app_dirs 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e73a24bad9bd6a94d6395382a6c69fe071708ae4409f763c5475e14ee896313d" -"checksum arc-swap 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "d7b8a9123b8027467bce0099fe556c628a53c8d83df0507084c31e9ba2e39aff" -"checksum arrayref 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "0d382e583f07208808f6b1249e60848879ba3543f57c32277bf52d69c2f0f0ee" -"checksum arrayvec 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)" = "cd9fd44efafa8690358b7408d253adf110036b88f55672a933f01d616ad9b1b9" -"checksum arrayvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cff77d8686867eceff3105329d4698d96c2391c176d5d03adc90c7389162b5b8" -"checksum asn1_der 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6fce6b6a0ffdafebd82c87e79e3f40e8d2c523e5fea5566ff6b90509bf98d638" -"checksum asn1_der_derive 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0d0864d84b8e07b145449be9a8537db86bf9de5ce03b913214694643b4743502" -"checksum assert_matches 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7deb0a829ca7bcfaf5da70b073a8d128619259a7be8216a355e23f00763059e5" -"checksum async-macros 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "644a5a8de80f2085a1e7e57cd1544a2a7438f6e003c0790999bd43b92a77cdb2" -"checksum async-std 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "513ee3c49800679a319912340f5601afda9e72848d7dea3a48bab489e8c1a46f" -"checksum async-task 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "de6bd58f7b9cc49032559422595c81cbfcf04db2f2133592f70af19e258a1ced" -"checksum async-tls 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6ce6977f57fa68da77ffe5542950d47e9c23d65f5bc7cb0a9f8700996913eec7" -"checksum atty 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "1803c647a3ec87095e7ae7acfca019e98de5ec9a7d01343f611cf3152ed71a90" -"checksum autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" -"checksum backtrace 0.3.40 (registry+https://github.com/rust-lang/crates.io-index)" = "924c76597f0d9ca25d762c25a4d369d51267536465dc5064bdf0eb073ed477ea" -"checksum backtrace-sys 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)" = "5d6575f128516de27e3ce99689419835fce9643a9b215a14d2b5b685be018491" -"checksum base58 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5024ee8015f02155eee35c711107ddd9a9bf3cb689cf2a9089c97e79b6e1ae83" -"checksum base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0b25d992356d2eb0ed82172f5248873db5560c4721f564b13cb5193bda5e668e" -"checksum base64 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b41b7ea54a0c9d92199de89e20e58d49f02f8e699814ef3fdf266f6f748d15c7" -"checksum base64 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)" = "489d6c0ed21b11d038c31b6ceccca973e65d73ba3bd8ecb9a2babf5546164643" -"checksum bincode 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5753e2a71534719bf3f4e57006c3a4f0d2c672a4b676eec84161f763eca87dbf" -"checksum bindgen 0.49.4 (registry+https://github.com/rust-lang/crates.io-index)" = "4c07087f3d5731bf3fb375a81841b99597e25dc11bd3bc72d16d43adf6624a6e" -"checksum bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" -"checksum bitmask 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5da9b3d9f6f585199287a473f4f8dfab6566cf827d15c00c219f53c645687ead" -"checksum bitvec 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a993f74b4c99c1908d156b8d2e0fb6277736b0ecbd833982fd1241d39b2766a6" -"checksum blake2 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "94cb07b0da6a73955f8fb85d24c466778e70cda767a568229b104f0264089330" -"checksum blake2-rfc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)" = "5d6d530bdd2d52966a6d03b7a964add7ae1a288d25214066fd4b600f0f796400" -"checksum blake2b_simd 0.5.9 (registry+https://github.com/rust-lang/crates.io-index)" = "b83b7baab1e671718d78204225800d6b170e648188ac7dc992e9d6bddf87d0c0" -"checksum block-buffer 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" -"checksum block-cipher-trait 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1c924d49bd09e7c06003acda26cd9742e796e34282ec6c1189404dee0c1f4774" -"checksum block-padding 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" -"checksum broadcaster 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "07a1446420a56f1030271649ba0da46d23239b3a68c73591cea5247f15a788a0" -"checksum bs58 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "c95ee6bba9d950218b6cc910cf62bc9e0a171d0f4537e3627b0f54d08549b188" -"checksum bs58 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b170cd256a3f9fa6b9edae3e44a7dfdfc77e8124dbc3e2612d75f9c3e2396dae" -"checksum bstr 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8d6c2c5b58ab920a4f5aeaaca34b4488074e8cc7596af94e6f8c6ff247c60245" -"checksum build-helper 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "bdce191bf3fa4995ce948c8c83b4640a1745457a149e73c6db75b4ffe36aad5f" -"checksum bumpalo 3.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8fe2567a8d8a3aedb4e39aa39e186d5673acfd56393c6ac83b2bc5bd82f4369c" -"checksum byte-slice-cast 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f6209f3b2c1edea170002e016d5ead6903d3bb0a846477f53bbeb614967a52a9" -"checksum byte-tools 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" -"checksum byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0fc10e8cc6b2580fda3f36eb6dc5316657f812a3df879a44a66fc9f0fdbc4855" -"checksum byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a7c3dd8985a7111efc5c80b44e23ecdd8c007de8ade3b96595387e812b957cf5" -"checksum bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)" = "206fdffcfa2df7cbe15601ef46c813fce0965eb3286db6b56c583b814b51c81c" -"checksum bytes 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "10004c15deb332055f7a4a208190aed362cf9a7c2f6ab70a305fba50e1105f38" -"checksum c2-chacha 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "214238caa1bf3a496ec3392968969cab8549f96ff30652c9e56885329315f6bb" -"checksum c_linked_list 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4964518bd3b4a8190e832886cdc0da9794f12e8e6c1613a9e90ff331c4c8724b" -"checksum cargo_metadata 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "46e3374c604fb39d1a2f35ed5e4a4e30e60d01fab49446e08f1b3e9a90aef202" -"checksum cast 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4b9434b9a5aa1450faa3f9cb14ea0e8c53bb5d2b3c1bfd1ab4fc03e9f33fbfb0" -"checksum cc 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)" = "f52a465a666ca3d838ebbf08b241383421412fe7ebb463527bba275526d89f76" -"checksum cexpr 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "fce5b5fb86b0c57c20c834c1b412fd09c77c8a59b9473f86272709e78874cd1d" -"checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" -"checksum chrono 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)" = "31850b4a4d6bae316f7a09e691c944c28299298837edc0a03f755618c23cbc01" -"checksum clang-sys 0.28.1 (registry+https://github.com/rust-lang/crates.io-index)" = "81de550971c976f176130da4b2978d3b524eaa0fd9ac31f3ceb5ae1231fb4853" -"checksum clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5067f5bb2d80ef5d68b4c87db81601f0b75bca627bc2ef76b141d7b846a3c6d9" -"checksum clear_on_drop 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "97276801e127ffb46b66ce23f35cc96bd454fa311294bced4bbace7baa8b1d17" -"checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" -"checksum cmake 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "81fb25b677f8bf1eb325017cb6bb8452f87969db0fedb4f757b297bee78a7c62" -"checksum console_error_panic_hook 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "b8d976903543e0c48546a91908f21588a680a8c8f984df9a5d69feccb2b2a211" -"checksum console_log 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1e7871d2947441b0fdd8e2bd1ce2a2f75304f896582c0d572162d48290683c48" -"checksum const-random 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7b641a8c9867e341f3295564203b1c250eb8ce6cb6126e007941f78c4d2ed7fe" -"checksum const-random-macro 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c750ec12b83377637110d5a57f5ae08e895b06c4b16e2bdbf1a94ef717428c59" -"checksum constant_time_eq 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "995a44c877f9212528ccc74b21a232f66ad69001e40ede5bcee2ac9ef2657120" -"checksum core-foundation 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "25b9e03f145fd4f2bf705e07b900cd41fc636598fe5dc452fd0db1441c3f496d" -"checksum core-foundation-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e7ca8a5221364ef15ce201e8ed2f609fc312682a8f4e0e3d4aa5879764e0fa3b" -"checksum cranelift-bforest 0.50.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bd05aac8cefcde54ce26178df8f36cb1f518ac691db650e7d2440c2b6b41c4dc" -"checksum cranelift-codegen 0.50.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c63d9b6ff8a94f98deabab21880d7fd54996e0e16be687b6f80a3b6bdd9c188d" -"checksum cranelift-codegen-meta 0.50.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7cb3df51c2c07d719d02869bfac6cabd8d82ee308d5b29ca62e6528723cc33a4" -"checksum cranelift-codegen-shared 0.50.0 (registry+https://github.com/rust-lang/crates.io-index)" = "758f9426b2e22bf83fc1a6b231a9d53cd4830751883c7f0e196ebb3c210467b3" -"checksum cranelift-entity 0.50.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ff064733df8b98f453060264a8790393d1e807aca6942706b42f79a4f7aae9ed" -"checksum cranelift-frontend 0.50.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1eaafb5fa623dcbe19a28084a8226d7a1b17184a949c1a1f29a46b479867998d" -"checksum cranelift-native 0.50.0 (registry+https://github.com/rust-lang/crates.io-index)" = "90033dbd7293f6fad4cf9dcd769cd621d60df22b1c5a11799e86359b7447a51d" -"checksum cranelift-wasm 0.50.0 (registry+https://github.com/rust-lang/crates.io-index)" = "54cb82a1071f88822763a583ec1a8688ffe5e2cda02c111d4483dd4376ed14d8" -"checksum crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1" -"checksum criterion 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "0363053954f3e679645fc443321ca128b7b950a6fe288cf5f9335cc22ee58394" -"checksum criterion 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "938703e165481c8d612ea3479ac8342e5615185db37765162e762ec3523e2fc6" -"checksum criterion-plot 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "76f9212ddf2f4a9eb2d401635190600656a1f88a932ef53d06e7fa4c7e02fb8e" -"checksum criterion-plot 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "eccdc6ce8bbe352ca89025bee672aa6d24f4eb8c53e3a8b5d1bc58011da072a2" -"checksum crossbeam-channel 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "acec9a3b0b3559f15aee4f90746c4e5e293b701c0f7d3925d24e01645267b68c" -"checksum crossbeam-deque 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c3aa945d63861bfe624b55d153a39684da1e8c0bc8fba932f7ee3a3c16cea3ca" -"checksum crossbeam-epoch 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5064ebdbf05ce3cb95e45c8b086f72263f4166b29b97f6baff7ef7fe047b55ac" -"checksum crossbeam-queue 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7c979cd6cfe72335896575c6b5688da489e420d36a27a0b9eb0c73db574b4a4b" -"checksum crossbeam-queue 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "dfd6515864a82d2f877b42813d4553292c6659498c9a2aa31bab5a15243c2700" -"checksum crossbeam-utils 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)" = "04973fa96e96579258a5091af6003abde64af786b860f18622b82e026cca60e6" -"checksum crossbeam-utils 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ce446db02cdc3165b94ae73111e570793400d0794e46125cc4056c81cbb039f4" -"checksum crunchy 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" -"checksum crypto-mac 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4434400df11d95d556bac068ddfedd482915eb18fe8bea89bc80b6e4b1c179e5" -"checksum csv 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "37519ccdfd73a75821cac9319d4fce15a81b9fcf75f951df5b9988aa3a0af87d" -"checksum csv-core 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "9b5cadb6b25c77aeff80ba701712494213f4a8418fcda2ee11b6560c3ad0bf4c" -"checksum ct-logs 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4d3686f5fa27dbc1d76c751300376e167c5a43387f44bb451fd1c24776e49113" -"checksum ctor 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "cd8ce37ad4184ab2ce004c33bf6379185d3b1c95801cab51026bd271bf68eedc" -"checksum ctr 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "022cd691704491df67d25d006fe8eca083098253c4d43516c2206479c58c6736" -"checksum ctrlc 3.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c7dfd2d8b4c82121dfdff120f818e09fc4380b0b7e17a742081a89b94853e87f" -"checksum cuckoofilter 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "8dd43f7cfaffe0a386636a10baea2ee05cc50df3b77bea4a456c9572a939bf1f" -"checksum curve25519-dalek 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8b7dcd30ba50cdf88b55b033456138b7c0ac4afdc436d82e1b79f370f24cc66d" -"checksum curve25519-dalek 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "26778518a7f6cffa1d25a44b602b62b979bd88adb9e99ffec546998cf3404839" -"checksum data-encoding 2.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f4f47ca1860a761136924ddd2422ba77b2ea54fe8cc75b9040804a0d9d32ad97" -"checksum derive_more 0.99.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2159be042979966de68315bce7034bb000c775f22e3e834e1c52ff78f041cae8" -"checksum difference 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198" -"checksum digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" -"checksum directories 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "551a778172a450d7fc12e629ca3b0428d00f6afa9a43da1b630d54604e97371c" -"checksum dirs-sys 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "afa0b23de8fd801745c471deffa6e12d248f962c9fd4b4c33787b055599bde7b" -"checksum dns-parser 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c4d33be9473d06f75f58220f71f7a9317aca647dc061dbd3c361b0bef505fbea" -"checksum doc-comment 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "923dea538cea0aa3025e8685b20d6ee21ef99c4f77e954a30febbaac5ec73a97" -"checksum ed25519-dalek 1.0.0-pre.3 (registry+https://github.com/rust-lang/crates.io-index)" = "978710b352437433c97b2bff193f2fb1dfd58a093f863dd95e225a19baa599a2" -"checksum either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3" -"checksum enumflags2 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "33121c8782ba948ba332dab29311b026a8716dc65a1599e5b88f392d38496af8" -"checksum enumflags2_derive 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ecf634c5213044b8d54a46dd282cf5dd1f86bb5cb53e92c409cb4680a7fb9894" -"checksum env_logger 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "aafcde04e90a5226a6443b7aabdb016ba2f8307c847d524724bd9b346dd1a2d3" -"checksum env_logger 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "44533bbbb3bb3c1fa17d9f2e4e38bbbaf8396ba82193c4cb1b6445d711445d36" -"checksum environmental 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "516aa8d7a71cb00a1c4146f0798549b93d083d4f189b3ced8f3de6b8f11ee6c4" -"checksum erased-serde 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "3beee4bc16478a1b26f2e80ad819a52d24745e292f521a63c16eea5f74b7eb60" -"checksum errno 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "c2a071601ed01b988f896ab14b95e67335d1eeb50190932a1320f7fe3cadc84e" -"checksum errno-dragonfly 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "14ca354e36190500e1e1fb267c647932382b54053c50b14970856c0b00a35067" -"checksum evm 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)" = "32a2c6961fdc9952371fc5f0416f03a9d90378a9dfb6862f6a7a9a3b8986b8dd" -"checksum evm-core 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3bcde5af3d542874ddeb53de0919302d57586ea04b3f76f54d865f8a6cdc70ae" -"checksum evm-gasometer 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b82bc9f275cb59d2bcc05d85c98736ddfaba003a7ef7b73893fa7c1c1fab29dc" -"checksum evm-runtime 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0dbbc89d29618c3722c17ba78ddf432d40ace8ee27e3f8b28b52a85921112e4b" -"checksum exit-future 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e43f2f1833d64e33f15592464d6fdd70f349dda7b1a53088eb83cd94014008c5" -"checksum faerie 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f902f2af041f6c7177a2a04f805687cdc71e69c7cbef059a2755d8923f4cd7a8" -"checksum failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "f8273f13c977665c5db7eb2b99ae520952fe5ac831ae4cd09d80c4c7042b5ed9" -"checksum failure_derive 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0bc225b78e0391e4b8683440bf2e63c2deeeb2ce5189eab46e2b68c6d3725d08" -"checksum fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" -"checksum fallible-iterator 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" -"checksum fdlimit 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b1ee15a7050e5580b3712877157068ea713b245b080ff302ae2ca973cfcd9baa" -"checksum file-per-thread-logger 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "8505b75b31ef7285168dd237c4a7db3c1f3e0927e7d314e670bc98e854272fe9" -"checksum finality-grandpa 0.10.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2d9ad6bb0e42865b2d79fc9c8a08f22c39127310ed3334f2a1119ca25ed69dfb" -"checksum fixed-hash 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "72fe7539e2c5692c6989f2f9c0457e42f1e5768f96b85c87d273574670ae459f" -"checksum fixedbitset 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "86d4de0081402f5e88cdac65c8dcdcc73118c1a7a465e2a05f0da05843a8ea33" -"checksum flate2 1.0.13 (registry+https://github.com/rust-lang/crates.io-index)" = "6bd6d6f4752952feb71363cffc9ebac9411b75b87c6ab6058c40c8900cf43c0f" -"checksum fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3" -"checksum foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -"checksum foreign-types-shared 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" -"checksum fs-swap 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "921d332c89b3b61a826de38c61ee5b6e02c56806cade1b0e5d81bd71f57a71bb" -"checksum fs2 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213" -"checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" -"checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" -"checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" -"checksum futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)" = "1b980f2816d6ee8673b6517b52cb0e808a180efc92e5c19d02cdda79066703ef" -"checksum futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b6f16056ecbb57525ff698bb955162d0cd03bee84e6241c27ff75c08d8ca5987" -"checksum futures-channel 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fcae98ca17d102fd8a3603727b9259fcf7fa4239b603d2142926189bc8999b86" -"checksum futures-channel-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)" = "d5e5f4df964fa9c1c2f8bddeb5c3611631cacd93baf810fc8bb2fb4b495c263a" -"checksum futures-core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "79564c427afefab1dfb3298535b21eda083ef7935b4f0ecbfcb121f0aec10866" -"checksum futures-core-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)" = "b35b6263fb1ef523c3056565fa67b1d16f0a8604ff12b11b08c25f28a734c60a" -"checksum futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "ab90cde24b3319636588d0c35fe03b1333857621051837ed769faefb4c2162e4" -"checksum futures-executor 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1e274736563f686a837a0568b478bdabfeaec2dca794b5649b04e2fe1627c231" -"checksum futures-io 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e676577d229e70952ab25f3945795ba5b16d63ca794ca9d2c860e5595d20b5ff" -"checksum futures-macro 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "52e7c56c15537adb4f76d0b7a76ad131cb4d2f4f32d3b0bcabcbe1c7c5e87764" -"checksum futures-sink 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "171be33efae63c2d59e6dbba34186fe0d6394fb378069a76dfd80fdcffd43c16" -"checksum futures-sink-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)" = "86f148ef6b69f75bb610d4f9a2336d4fc88c4b5b67129d1a340dd0fd362efeec" -"checksum futures-task 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0bae52d6b29cf440e298856fec3965ee6fa71b06aa7495178615953fd669e5f9" -"checksum futures-timer 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "878f1d2fc31355fa02ed2372e741b0c17e58373341e6a122569b4623a14a7d33" -"checksum futures-timer 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a1de7508b218029b0f01662ed8f61b1c964b3ae99d6f25462d0f55a595109df6" -"checksum futures-util 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c0d66274fb76985d3c62c886d1da7ac4c0903a8c9f754e8fe0f35a6a6cc39e76" -"checksum futures-util-preview 0.3.0-alpha.19 (registry+https://github.com/rust-lang/crates.io-index)" = "5ce968633c17e5f97936bd2797b6e38fb56cf16a7422319f7ec2e30d3c470e8d" -"checksum futures_codec 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "a0a73299e4718f5452e45980fc1d6957a070abe308d3700b63b8673f47e1c2b3" -"checksum fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" -"checksum gcc 0.3.55 (registry+https://github.com/rust-lang/crates.io-index)" = "8f5f3913fa0bfe7ee1fd8248b6b9f42a5af4b9d65ec2dd2c3c26132b950ecfc2" -"checksum generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec" -"checksum get_if_addrs 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "abddb55a898d32925f3148bd281174a68eeb68bbfd9a5938a57b18f506ee4ef7" -"checksum get_if_addrs-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0d04f9fb746cf36b191c00f3ede8bde9c8e64f9f4b05ae2694a9ccf5e3f5ab48" -"checksum getrandom 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "e7db7ca94ed4cd01190ceee0d8a8052f08a247aa1b469a7f68c6a3b71afcf407" -"checksum gimli 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)" = "162d18ae5f2e3b90a993d202f1ba17a5633c2484426f8bcae201f86194bacd00" -"checksum glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb" -"checksum glob 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" -"checksum globset 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "925aa2cac82d8834e2b2a4415b6f6879757fb5c0928fc445ae76461a12eed8f2" -"checksum goblin 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "88a79ef1f0dad46fd78075b6f80f92d97710eddf87b3e18a15a66761e8942672" -"checksum h2 0.1.26 (registry+https://github.com/rust-lang/crates.io-index)" = "a5b34c246847f938a410a03c5458c7fee2274436675e76d8b903c08efc29c462" -"checksum h2 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b9433d71e471c1736fd5a61b671fc0b148d7a2992f666c958d03cd8feb3b88d1" -"checksum hash-db 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d23bd4e7b5eda0d0f3a307e8b381fdc8ba9000f26fbe912250c0a4cc3956364a" -"checksum hash256-std-hasher 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)" = "92c171d55b98633f4ed3860808f004099b36c1cc29c42cfc53aa8591b21efcf2" -"checksum hashbrown 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3bae29b6653b3412c2e71e9d486db9f9df5d701941d86683005efb9f2d28e3da" -"checksum hashbrown 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e1de41fb8dba9714efd92241565cdff73f78508c95697dd56787d3cba27e2353" -"checksum hashbrown 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8e6073d0ca812575946eb5f35ff68dbe519907b25c42530389ff946dc84c6ead" -"checksum heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205" -"checksum hermit-abi 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "307c3c9f937f38e3534b1d6447ecf090cafcc9744e4a6360e8b037b2cf5af120" -"checksum hex 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "023b39be39e3a2da62a94feb433e91e8bcd37676fbc8bea371daf52b7a769a3e" -"checksum hex-literal 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "961de220ec9a91af2e1e5bd80d02109155695e516771762381ef8581317066e0" -"checksum hex-literal-impl 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9d4c5c844e2fee0bf673d54c2c177f1713b3d2af2ff6e666b49cb7572e6cf42d" -"checksum hmac 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5dcb5e64cda4c23119ab41ba960d1e170a774c8e4b9d9e6a9bc18aabf5e59695" -"checksum hmac-drbg 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c6e570451493f10f6581b48cdd530413b63ea9e780f544bfd3bdcaa0d89d1a7b" -"checksum http 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)" = "d6ccf5ede3a895d8856620237b2f02972c1bbc78d2965ad7fe8838d4a0ed41f0" -"checksum http 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b708cc7f06493459026f53b9a61a7a121a5d1ec6238dee58ea4941132b30156b" -"checksum http-body 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6741c859c1b2463a423a1dbce98d418e6c3c3fc720fb0d45528657320920292d" -"checksum http-body 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "13d5ff830006f7646652e057693569bfe0d51760c0085a071769d142a205111b" -"checksum httparse 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" -"checksum humantime 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f" -"checksum hyper 0.10.16 (registry+https://github.com/rust-lang/crates.io-index)" = "0a0652d9a2609a968c14be1a9ea00bf4b1d64e2e1f53a1b51b6fff3a6e829273" -"checksum hyper 0.12.35 (registry+https://github.com/rust-lang/crates.io-index)" = "9dbe6ed1438e1f8ad955a4701e9a944938e9519f6888d12d8558b645e247d5f6" -"checksum hyper 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8bf49cfb32edee45d890537d9057d1b02ed55f53b7b6a30bae83a38c9231749e" -"checksum hyper-rustls 0.17.1 (registry+https://github.com/rust-lang/crates.io-index)" = "719d85c7df4a7f309a77d145340a063ea929dcb2e025bae46a80345cffec2952" -"checksum hyper-tls 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "3a800d6aa50af4b5850b2b0f659625ce9504df908e9733b635720483be26174f" -"checksum idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" -"checksum idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" -"checksum impl-codec 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1be51a921b067b0eaca2fad532d9400041561aa922221cc65f95a85641c6bf53" -"checksum impl-rlp 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8f7a72f11830b52333f36e3b09a288333888bf54380fd0ac0790a3c31ab0f3c5" -"checksum impl-serde 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "58e3cae7e99c7ff5a995da2cf78dd0a5383740eda71d98cf7b1910c301ac69b8" -"checksum impl-trait-for-tuples 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7ef5550a42e3740a0e71f909d4c861056a284060af885ae7aa6242820f920d9d" -"checksum indexmap 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712d7b3ea5827fcb9d4fda14bf4da5f136f0db2ae9c8f4bd4e2d1c6fde4e6db2" -"checksum integer-sqrt 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ea155abb3ba6f382a75f1418988c05fe82959ed9ce727de427f9cfd425b0c903" -"checksum interleaved-ordered 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "141340095b15ed7491bd3d4ced9d20cebfb826174b6bb03386381f62b01e3d77" -"checksum iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" -"checksum ipnet 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f2f4b06b21db0228860c8dfd17d2106c49c7c6bd07477a4036985347d84def04" -"checksum itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f56a2d0bc861f9165be4eb3442afd3c236d8a98afd426f65d92324ae1091a484" -"checksum itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "501266b7edd0174f8530248f87f99c88fbe60ca4ef3dd486835b8d8d53136f7f" -"checksum jobserver 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)" = "f2b1d42ef453b30b7387e113da1c83ab1605d90c5b4e0eb8e96d016ed3b8c160" -"checksum js-sys 0.3.34 (registry+https://github.com/rust-lang/crates.io-index)" = "c40e7a4fafb6cf0be06d25662fc99aacb25f526eb6e1bc0c24100bde5d6a834e" -"checksum jsonrpc-client-transports 14.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "0a9ae166c4d1f702d297cd76d4b55758ace80272ffc6dbb139fdc1bf810de40b" -"checksum jsonrpc-core 14.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fe3b688648f1ef5d5072229e2d672ecb92cbff7d1c79bcf3fd5898f3f3df0970" -"checksum jsonrpc-core-client 14.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "080dc110be17701097df238fad3c816d4a478a1899dfbcf8ec8957dd40ec7304" -"checksum jsonrpc-derive 14.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "8609af8f63b626e8e211f52441fcdb6ec54f1a446606b10d5c89ae9bf8a20058" -"checksum jsonrpc-http-server 14.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "2d83d348120edee487c560b7cdd2565055d61cda053aa0d0ef0f8b6a18429048" -"checksum jsonrpc-pubsub 14.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "3453625f0f0f5cd6d6776d389d73b7d70fcc98620b7cbb1cbbb1f6a36e95f39a" -"checksum jsonrpc-server-utils 14.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "95b7635e618a0edbbe0d2a2bbbc69874277c49383fcf6c3c0414491cfb517d22" -"checksum jsonrpc-ws-server 14.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "b34faa167c3ac9705aeecb986c0da6056529f348425dbe0441db60a2c4cc41d1" -"checksum keccak 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "67c21572b4949434e4fc1e1978b99c5f77064153c59d998bf13ecd96fb5ecba7" -"checksum keccak-hasher 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)" = "3468207deea1359a0e921591ae9b4c928733d94eb9d6a2eeda994cfd59f42cf8" -"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" -"checksum kv-log-macro 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8c54d9f465d530a752e6ebdc217e081a7a614b48cb200f6f0aee21ba6bc9aabb" -"checksum kvdb 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8396be0e5561ccd1bf7ff0b2007487cdd7a87a056873fe6ea906b35d4dbf7ed8" -"checksum kvdb-memorydb 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4d25ef14155e418515c4839e9144c839de3506e68946f255a32b7f166095493d" -"checksum kvdb-rocksdb 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "af488cc16c3801705c8d681c3a32c8faa8fafc7fb5309dee0f573f3c6a19d395" -"checksum kvdb-web 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "37a0e36637fb86454de401e7cb88f40eb0ad1b9bcee837d46785e7c451f1ebf4" -"checksum language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a91d884b6667cd606bb5a69aa0c99ba811a115fc68915e7056ec08a46e93199a" -"checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" -"checksum lazycell 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b294d6fa9ee409a054354afc4352b0b9ef7ca222c69b8812cbea9e7d2bf3783f" -"checksum libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)" = "d515b1f41455adea1313a4a2ac8a8a477634fbae63cc6100e3aebb207ce61558" -"checksum libloading 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f2b111a074963af1d37a139918ac6d49ad1d0d5e47f72fd55388619691a7d753" -"checksum libp2p 0.14.0-alpha.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0c85f850649e7533db125207d86bc2180faf7a962ea07686011031b71cbb3540" -"checksum libp2p-core 0.14.0-alpha.1 (registry+https://github.com/rust-lang/crates.io-index)" = "187ac3f588a74d48f163a8899fddafef4dc9796cad7b73ae754d9e928cebbbe7" -"checksum libp2p-core-derive 0.14.0-alpha.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b674da01855701636371b3d5f0e6b38bf5a74d283de705c1f66fab9980da8943" -"checksum libp2p-deflate 0.6.0-alpha.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2f83cefe9f01a4a7012c1285e20fca4f193c46526a350679465150035afc5a97" -"checksum libp2p-dns 0.14.0-alpha.1 (registry+https://github.com/rust-lang/crates.io-index)" = "67d5a6d0905479ee4c6bcfaeab597d506f3447e5eb09b84aff1ed5e6d834b221" -"checksum libp2p-floodsub 0.14.0-alpha.1 (registry+https://github.com/rust-lang/crates.io-index)" = "462f310a152433a94d4e9766aa8366e4770084f67b9a17289a9667a7b0780714" -"checksum libp2p-identify 0.14.0-alpha.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8269e7b673cf0fbce1cbfedf61708e860aeb4b2ad3ca2df54586f1e810b9fbc9" -"checksum libp2p-kad 0.14.0-alpha.1 (registry+https://github.com/rust-lang/crates.io-index)" = "90fdc0027f76b50b0822f489f5b8a83664b71c6087e67e8e9e53e6c255b069b3" -"checksum libp2p-mdns 0.14.0-alpha.1 (registry+https://github.com/rust-lang/crates.io-index)" = "be0b7cdeb0ad2c009099eaed258ef18b308c1e3f56d8f57668a868305f1c4caa" -"checksum libp2p-mplex 0.14.0-alpha.1 (registry+https://github.com/rust-lang/crates.io-index)" = "54c2ca42c7511fddc566af2259b81749d36011fefab1e99d9bf77bdc6210a5bd" -"checksum libp2p-noise 0.12.0-alpha.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f8ff485bebd3181fc7f0c8ca7d11dde6231c132bbfb5d26c0e3a568e1a58b450" -"checksum libp2p-ping 0.14.0-alpha.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9061919a24a74760610c860e67cdb44ae4fd3cffe34c3b3a916f21ec68d9d50a" -"checksum libp2p-plaintext 0.14.0-alpha.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e9bf4b832590e0bf7efc09ff91c2d4cda0737f29b44356ef0cc3aecc08ed54a" -"checksum libp2p-secio 0.14.0-alpha.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2aa7599c5413cbc3de7138d64b932a26e86f8897ef3722f18840ed12ad54ea43" -"checksum libp2p-swarm 0.4.0-alpha.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2ea29f98b08c7a5113a787bce1a44d33fca6cf9f680f99812b50555e50baf408" -"checksum libp2p-tcp 0.14.0-alpha.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a4e0d1f322101d81c26782e76c523043f96fe53fa41962fd2c2193a709985186" -"checksum libp2p-uds 0.14.0-alpha.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d5620aca9d9f85158b934be33a25a6310f1ca6a038392498eb7f35d35063aee9" -"checksum libp2p-wasm-ext 0.7.0-alpha.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2dfe80dd0d2cb6412b57fffeb3db2dc36f7ea23566ed94011e0e07ff948f9624" -"checksum libp2p-websocket 0.14.0-alpha.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ac2a4974254a91f5291ef8493e6377380473334ba166ea0487e898364931dd61" -"checksum libp2p-yamux 0.14.0-alpha.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ef3277eaffc7c3a0ad0c115dcbe3cbeb0e3a953a18b959d05081835fc2cf2ff9" -"checksum librocksdb-sys 6.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "0a0785e816e1e11e7599388a492c61ef80ddc2afc91e313e61662cce537809be" -"checksum libsecp256k1 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "df6edf84fd62aad1c93932b39324eaeda3912c1d26bc18dfaee6293848e49a50" -"checksum libz-sys 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)" = "2eb5e43362e38e2bca2fd5f5134c4d4564a23a5c28e9b95411652021a8675ebe" -"checksum linked-hash-map 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ae91b68aebc4ddb91978b11a1b02ddd8602a05ec19002801c5666000e05e0f83" -"checksum linked_hash_set 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3c7c91c4c7bbeb4f2f7c4e5be11e6a05bd6830bc37249c47ce1ad86ad453ff9c" -"checksum lock_api 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "62ebf1391f6acad60e5c8b43706dde4582df75c06698ab44511d15016bc2442c" -"checksum lock_api 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e57b3997725d2b60dbec1297f6c2e2957cc383db1cebd6be812163f969c7d586" -"checksum log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" -"checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" -"checksum lru 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)" = "5d8f669d42c72d18514dfca8115689c5f6370a17d980cb5bd777a67f404594c8" -"checksum lru 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0609345ddee5badacf857d4f547e0e5a2e987db77085c24cd887f73573a04237" -"checksum mach 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "86dd2487cdfea56def77b88438a2c915fb45113c5319bfe7e14306ca4cd0b0e1" -"checksum malloc_size_of_derive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e37c5d4cd9473c5f4c9c111f033f15d4df9bd378fdf615944e360a4f55a05f0b" -"checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" -"checksum maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" -"checksum memchr 2.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "88579771288728879b57485cc7d6b07d648c9f0141eb955f8ab7f9d45394468e" -"checksum memoffset 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "75189eb85871ea5c2e2c15abbdd541185f63b408415e5051f5cac122d8c774b9" -"checksum memory-db 0.18.1 (registry+https://github.com/rust-lang/crates.io-index)" = "881736a0f68a6fae1b596bb066c5bd16d7b3ed645a4dd8ffaefd02f585abaf71" -"checksum memory_units 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "71d96e3f3c0b6325d8ccd83c33b28acb183edcb6c67938ba104ec546854b0882" -"checksum merlin 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2b0942b357c1b4d0dc43ba724674ec89c3218e6ca2b3e8269e7cb53bcecd2f6e" -"checksum mime 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ba626b8a6de5da682e1caa06bdb42a335aee5a84db8e5046a3e8ab17ba0a3ae0" -"checksum miniz_oxide 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6f3f74f726ae935c3f514300cc6773a0c9492abc5e972d42ba0c0ebb88757625" -"checksum mio 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)" = "302dec22bcf6bae6dfb69c647187f4b4d0fb6f535521f7bc022430ce8e12008f" -"checksum mio-extras 2.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "52403fe290012ce777c4626790c8951324a2b9e3316b3143779c72b029742f19" -"checksum mio-uds 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)" = "966257a94e196b11bb43aca423754d87429960a768de9414f3691d6957abf125" -"checksum miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" -"checksum more-asserts 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0debeb9fcf88823ea64d64e4a815ab1643f33127d995978e099942ce38f25238" -"checksum multimap 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2eb04b9f127583ed176e163fb9ec6f3e793b87e21deedd5734a69386a18a0151" -"checksum multistream-select 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f938ffe420493e77c8b6cbcc3f282283f68fc889c5dcbc8e51668d5f3a01ad94" -"checksum names 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ef320dab323286b50fb5cdda23f61c796a72a89998ab565ca32525c5c556f2da" -"checksum native-tls 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4b2df1a4c22fd44a62147fd8f13dd0f95c9d8ca7b2610299b2a2f9cf8964274e" -"checksum net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)" = "42550d9fb7b6684a6d404d9fa7250c2eb2646df731d1c06afc06dcee9e1bcf88" -"checksum nix 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6c722bee1037d430d0f8e687bbdbf222f27cc6e4e68d5caf630857bb2b6dbdce" -"checksum nodrop 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" -"checksum nohash-hasher 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4e657a6ec97f9a3ba46f6f7034ea6db9fcd5b71d25ef1074b7bc03da49be0e8e" -"checksum nom 4.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2ad2a91a8e869eeb30b9cb3119ae87773a8f4ae617f41b1eb9c154b2905f7bd6" -"checksum num-bigint 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "f9c3f34cdd24f334cb265d9bf8bfa8a241920d026916785747a92f0e55541a1a" -"checksum num-integer 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)" = "b85e541ef8255f6cf42bbfe4ef361305c6c135d10919ecc26126c4e5ae94bc09" -"checksum num-rational 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f2885278d5fe2adc2f75ced642d52d879bffaceb5a2e0b1d4309ffdfb239b454" -"checksum num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "d4c81ffc11c212fa327657cb19dd85eb7419e163b5b076bede2bdb5c974c07e4" -"checksum num_cpus 1.11.1 (registry+https://github.com/rust-lang/crates.io-index)" = "76dac5ed2a876980778b8b85f75a71b6cbf0db0b1232ee12f826bccb00d09d72" -"checksum ole32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5d2c49021782e5233cd243168edfa8037574afed4eba4bbaf538b3d8d1789d8c" -"checksum once_cell 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "532c29a261168a45ce28948f9537ddd7a5dd272cc513b3017b1e82a88f962c37" -"checksum once_cell 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "d584f08c2d717d5c23a6414fc2822b71c651560713e54fa7eace675f758a355e" -"checksum once_cell 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "891f486f630e5c5a4916c7e16c4b24a53e78c860b646e9f8e005e4f16847bfed" -"checksum opaque-debug 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" -"checksum openssl 0.10.26 (registry+https://github.com/rust-lang/crates.io-index)" = "3a3cc5799d98e1088141b8e01ff760112bbd9f19d850c124500566ca6901a585" -"checksum openssl-probe 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" -"checksum openssl-sys 0.9.53 (registry+https://github.com/rust-lang/crates.io-index)" = "465d16ae7fc0e313318f7de5cecf57b2fbe7511fd213978b457e1c96ff46736f" -"checksum output_vt100 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "53cdc5b785b7a58c5aad8216b3dfa114df64b0b06ae6e1501cef91df2fbdf8f9" -"checksum owning_ref 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "49a4b8ea2179e6a2e27411d3bca09ca6dd630821cf6894c6c7c8467a8ee7ef13" -"checksum parity-bytes 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0c276d76c5333b8c2579e02d49a06733a55b8282d2d9b13e8d53b6406bd7e30a" -"checksum parity-multiaddr 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "045b3c7af871285146300da35b1932bb6e4639b66c7c98e85d06a32cbc4e8fa7" -"checksum parity-multiaddr 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6de20a133b50f5120c6b8284ee88c5017fb167149208b3ee2e95f8719a434dc4" -"checksum parity-multihash 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "df3a17dc27848fd99e4f87eb0f8c9baba6ede0a6d555400c850ca45254ef4ce3" -"checksum parity-multihash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "70a4d7b05e51bff5ae2c29c7b8c3d889985bbd8f4e15b3542fcc1f6f9666d292" -"checksum parity-scale-codec 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f747c06d9f3b2ad387ac881b9667298c81b1243aa9833f086e05996937c35507" -"checksum parity-scale-codec-derive 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "34e513ff3e406f3ede6796dcdc83d0b32ffb86668cea1ccf7363118abeb00476" -"checksum parity-send-wrapper 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aa9777aa91b8ad9dd5aaa04a9b6bcb02c7f1deb952fca5a66034d5e63afc5c6f" -"checksum parity-util-mem 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8174d85e62c4d615fddd1ef67966bdc5757528891d0742f15b131ad04667b3f9" -"checksum parity-util-mem 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "900dd84654b048e5bad420bb341658fc2c4d7fea628c22bcf4621733e54859b4" -"checksum parity-util-mem-derive 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f557c32c6d268a07c921471619c0295f5efad3a0e76d4f97a05c091a51d110b2" -"checksum parity-wasm 0.32.0 (registry+https://github.com/rust-lang/crates.io-index)" = "16ad52817c4d343339b3bc2e26861bd21478eda0b7509acf83505727000512ac" -"checksum parity-wasm 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc878dac00da22f8f61e7af3157988424567ab01d9920b962ef7dcbd7cd865" -"checksum parking_lot 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "92e98c49ab0b7ce5b222f2cc9193fc4efe11c6d0bd4f648e374684a6857b1cfc" -"checksum parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ab41b4aed082705d1056416ae4468b6ea99d52599ecf3169b00088d43113e337" -"checksum parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f842b1982eb6c2fe34036a4fbfb06dd185a3f5c8edfaacdf7d1ea10b07de6252" -"checksum parking_lot_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "94c8c7923936b28d546dfd14d4472eaf34c99b14e1c973a32b3e6d4eb04298c9" -"checksum parking_lot_core 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b876b1b9e7ac6e1a74a6da34d25c42e17e8862aa409cbbbdcfc8d86c6f3bc62b" -"checksum parking_lot_core 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7582838484df45743c8434fbff785e8edf260c28748353d44bc0da32e0ceabf1" -"checksum paste 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "423a519e1c6e828f1e73b720f9d9ed2fa643dce8a7737fb43235ce0b41eeaa49" -"checksum paste-impl 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "4214c9e912ef61bf42b81ba9a47e8aad1b2ffaf739ab162bf96d1e011f54e6c5" -"checksum pbkdf2 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "006c038a43a45995a9670da19e67600114740e8511d4333bf97a56e66a7542d9" -"checksum pdqselect 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4ec91767ecc0a0bbe558ce8c9da33c068066c57ecc8bb8477ef8c1ad3ef77c27" -"checksum peeking_take_while 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" -"checksum percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" -"checksum percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" -"checksum petgraph 0.4.13 (registry+https://github.com/rust-lang/crates.io-index)" = "9c3659d1ee90221741f65dd128d9998311b0e40c5d3c23a62445938214abce4f" -"checksum pin-project 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "94b90146c7216e4cb534069fb91366de4ea0ea353105ee45ed297e2d1619e469" -"checksum pin-project-internal 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "44ca92f893f0656d3cba8158dd0f2b99b94de256a4a54e870bd6922fcc6c8355" -"checksum pin-project-lite 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f0af6cbca0e6e3ce8692ee19fb8d734b641899e07b68eb73e9bbbd32f1703991" -"checksum pin-utils 0.1.0-alpha.4 (registry+https://github.com/rust-lang/crates.io-index)" = "5894c618ce612a3fa23881b152b608bafb8c56cfc22f434a3ba3120b40f7b587" -"checksum pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)" = "05da548ad6865900e60eaba7f589cc0783590a92e940c26953ff81ddbab2d677" -"checksum plain 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" -"checksum ppv-lite86 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "74490b50b9fbe561ac330df47c08f3f33073d2d00c150f719147d7c54522fa1b" -"checksum pretty_assertions 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3f81e1644e1b54f5a68959a29aa86cde704219254669da328ecfdf6a1f09d427" -"checksum primitive-types 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a0253db64c26d8b4e7896dd2063b516d2a1b9e0a5da26b5b78335f236d1e9522" -"checksum proc-macro-crate 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "e10d4b51f154c8a7fb96fd6dad097cb74b863943ec010ac94b9fd1be8861fe1e" -"checksum proc-macro-error 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "53c98547ceaea14eeb26fcadf51dc70d01a2479a7839170eae133721105e4428" -"checksum proc-macro-error-attr 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c2bf5d493cf5d3e296beccfd61794e445e830dfc8070a9c248ad3ee071392c6c" -"checksum proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)" = "ecd45702f76d6d3c75a80564378ae228a85f0b59d2f3ed43c91b4a69eb2ebfc5" -"checksum proc-macro-nested 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "369a6ed065f249a159e06c45752c780bda2fb53c995718f9e484d08daa9eb42e" -"checksum proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)" = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" -"checksum proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "9c9e470a8dc4aeae2dee2f335e8f533e2d4b347e1434e5671afc49b054592f27" -"checksum prometheus 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5567486d5778e2c6455b1b90ff1c558f29e751fc018130fa182e15828e728af1" -"checksum prost 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "96d14b1c185652833d24aaad41c5832b0be5616a590227c1fbff57c616754b23" -"checksum prost 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ce49aefe0a6144a45de32927c77bd2859a5f7677b55f220ae5b744e87389c212" -"checksum prost-build 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "eb788126ea840817128183f8f603dce02cb7aea25c2a0b764359d8e20010702e" -"checksum prost-derive 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5e7dc378b94ac374644181a2247cebf59a6ec1c88b49ac77f3a94b86b79d0e11" -"checksum prost-derive 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "537aa19b95acde10a12fec4301466386f757403de4cd4e5b4fa78fb5ecb18f72" -"checksum prost-types 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1de482a366941c8d56d19b650fac09ca08508f2a696119ee7513ad590c8bac6f" -"checksum protobuf 2.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "40361836defdd5871ff7e84096c6f6444af7fc157f8ef1789f54f147687caa20" -"checksum pwasm-utils 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4f7a12f176deee919f4ba55326ee17491c8b707d0987aed822682c821b660192" -"checksum quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9274b940887ce9addde99c4eee6b5c44cc494b182b97e73dc8ffdcb3397fd3f0" -"checksum quickcheck 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d5ca504a2fdaa08d3517f442fbbba91ac24d1ec4c51ea68688a038765e3b2662" -"checksum quicksink 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a8461ef7445f61fd72d8dcd0629ce724b9131b3c2eb36e83a5d3d4161c127530" -"checksum quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" -"checksum quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "053a8c8bcc71fcce321828dc897a98ab9760bef03a4fc36693c231e5b3216cfe" -"checksum rand 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)" = "64ac302d8f83c0c1974bf758f6b041c6c8ada916fbb44a609158ca8b064cc76c" -"checksum rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293" -"checksum rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca" -"checksum rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "3ae1b169243eaf61759b8475a998f0a385e42042370f3a7dbaf35246eacc8412" -"checksum rand_chacha 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef" -"checksum rand_chacha 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "03a2a90da8c7523f554344f921aa97283eadf6ac484a6d2a7d0212fa7f8d6853" -"checksum rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" -"checksum rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" -"checksum rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" -"checksum rand_hc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4" -"checksum rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" -"checksum rand_isaac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08" -"checksum rand_jitter 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b" -"checksum rand_os 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071" -"checksum rand_os 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a788ae3edb696cfcba1c19bfd388cc4b8c21f8a408432b199c072825084da58a" -"checksum rand_pcg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44" -"checksum rand_xorshift 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c" -"checksum rand_xoshiro 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "03b418169fb9c46533f326efd6eed2576699c44ca92d3052a066214a8d828929" -"checksum rand_xoshiro 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0e18c91676f670f6f0312764c759405f13afb98d5d73819840cf72a518487bff" -"checksum raw-cpuid 7.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "b4a349ca83373cfa5d6dbb66fd76e58b2cca08da71a5f6400de0a0a6a9bceeaf" -"checksum rayon 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "43739f8831493b276363637423d3622d4bd6394ab6f0a9c4a552e208aeb7fddd" -"checksum rayon-core 1.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f8bf17de6f23b05473c437eb958b9c850bfc8af0961fe17b4cc92d5a627b4791" -"checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" -"checksum redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)" = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" -"checksum redox_users 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4ecedbca3bf205f8d8f5c2b44d83cd0690e39ee84b951ed649e9f1841132b66d" -"checksum regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dc220bd33bdce8f093101afe22a037b8eb0e5af33592e6a9caafff0d4cb81cbd" -"checksum regex-automata 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "92b73c2a1770c255c240eaa4ee600df1704a38dc3feaa6e949e7fcd4f8dc09f9" -"checksum regex-syntax 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)" = "11a7e20d1cce64ef2fed88b66d347f88bd9babb82845b2b858f3edbf59a4f716" -"checksum region 2.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "448e868c6e4cfddfa49b6a72c95906c04e8547465e9536575b95c70a4044f856" -"checksum remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4a83fa3702a688b9359eccba92d153ac33fd2e8462f9e0e3fdf155239ea7792e" -"checksum ring 0.16.9 (registry+https://github.com/rust-lang/crates.io-index)" = "6747f8da1f2b1fabbee1aaa4eb8a11abf9adef0bf58a41cee45db5d59cecdfac" -"checksum rlp 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3a44d5ae8afcb238af8b75640907edc6c931efcfab2c854e81ed35fa080f84cd" -"checksum rocksdb 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "12069b106981c6103d3eab7dd1c86751482d0779a520b7c14954c8b586c1e643" -"checksum rpassword 4.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "d59f0e97173c514b9036cd450c195a6483ba81055c6fa0f1bff3ab563f47d44a" -"checksum rust-argon2 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4ca4eaef519b494d1f2848fc602d18816fed808a981aedf4f1f00ceb7c9d32cf" -"checksum rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" -"checksum rustc-hex 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" -"checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" -"checksum rustls 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b25a18b1bf7387f0145e7f8324e700805aade3842dd3db2e74e4cdeb4677c09e" -"checksum rustversion 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c48f91977f4ef3be5358c15d131d3f663f6b4d7a112555bf3bf52ad23b6659e5" -"checksum rw-stream-sink 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "761d4727649dc004ee5555a0779afd53963efafd2218c969a2c5e323cdf73a09" -"checksum ryu 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bfa8506c1de11c9c4e4c38863ccbe02a305c8188e85a05a784c9e11e1c3910c8" -"checksum safe-mix 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7f7bf422d23a88c16d5090d455f182bc99c60af4df6a345c63428acf5129e347" -"checksum safemem 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072" -"checksum same-file 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "585e8ddcedc187886a30fa705c47985c3fa88d06624095856b36ca0b82ff4421" -"checksum schannel 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "87f550b06b6cba9c8b8be3ee73f391990116bf527450d2556e9b9ce263b9a021" -"checksum schnorrkel 0.8.5 (registry+https://github.com/rust-lang/crates.io-index)" = "eacd8381b3c37840c9c9f40472af529e49975bdcbc24f83c31059fd6539023d3" -"checksum scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "94258f53601af11e6a49f722422f6e3425c52b06245a5cf9bc09908b174f5e27" -"checksum scopeguard 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b42e15e59b18a828bbf5c58ea01debb36b9b096346de35d941dcb89009f24a0d" -"checksum scroll 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "abb2332cb595d33f7edd5700f4cbf94892e680c7f0ae56adab58a35190b66cb1" -"checksum scroll_derive 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f8584eea9b9ff42825b46faf46a8c24d2cff13ec152fa2a50df788b87c07ee28" -"checksum sct 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e3042af939fca8c3453b7af0f1c66e533a15a86169e39de2657310ade8f98d3c" -"checksum security-framework 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8ef2429d7cefe5fd28bd1d2ed41c944547d4ff84776f5935b456da44593a16df" -"checksum security-framework-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e31493fc37615debb8c5090a7aeb4a9730bc61e77ab10b9af59f1a202284f895" -"checksum semver 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a3186ec9e65071a2095434b1f5bb24838d4e8e130f584c790f6033c79943537" -"checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" -"checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" -"checksum send_wrapper 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a0eddf2e8f50ced781f288c19f18621fa72a3779e3cb58dbf23b07469b0abeb4" -"checksum send_wrapper 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "686ef91cf020ad8d4aca9a7047641fd6add626b7b89e14546c2b6a76781cf822" -"checksum serde 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)" = "1217f97ab8e8904b57dd22eb61cde455fa7446a9c1cf43966066da047c1f3702" -"checksum serde_derive 1.0.103 (registry+https://github.com/rust-lang/crates.io-index)" = "a8c6faef9a2e64b0064f48570289b4bf8823b7581f1d6157c1b52152306651d0" -"checksum serde_json 1.0.44 (registry+https://github.com/rust-lang/crates.io-index)" = "48c575e0cc52bdd09b47f330f646cf59afc586e9c4e3ccd6fc1f625b8ea1dad7" -"checksum sha-1 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "23962131a91661d643c98940b20fcaffe62d776a823247be80a48fcb8b6fce68" -"checksum sha1 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d" -"checksum sha2 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7b4d8bfd0e469f417657573d8451fb33d16cfe0989359b93baf3a1ffc639543d" -"checksum sha3 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dd26bc0e7a2e3a7c959bc494caf58b72ee0c71d67704e9520f736ca7e4853ecf" -"checksum shell32-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9ee04b46101f57121c9da2b151988283b6beb79b34f5bb29a58ee48cb695122c" -"checksum shlex 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7fdf1b9db47230893d76faad238fd6097fd6d6a9245cd7a4d90dbd639536bbd2" -"checksum slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" -"checksum slog 2.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1cc9c640a4adbfbcc11ffb95efe5aa7af7309e002adab54b185507dbf2377b99" -"checksum slog-json 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ddc0d2aff1f8f325ef660d9a0eb6e6dcd20b30b3f581a5897f58bf42d061c37a" -"checksum slog-scope 4.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7c44c89dd8b0ae4537d1ae318353eaf7840b4869c536e31c41e963d1ea523ee6" -"checksum slog_derive 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a945ec7f7ce853e89ffa36be1e27dce9a43e82ff9093bf3461c30d5da74ed11b" -"checksum smallvec 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "f7b0758c52e15a8b5e3691eae6cc559f08eee9406e548a4477ba4e67770a82b6" -"checksum smallvec 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4ecf3b85f68e8abaa7555aa5abdb1153079387e60b718283d732f03897fcfc86" -"checksum snow 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "afb767eee7d257ba202f0b9b08673bc13b22281632ef45267b19f13100accd2f" -"checksum soketto 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3caa0ad6b765419f21e4cfa490ec7514a9fae4af986adef168a69477ba528671" -"checksum sourcefile 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "4bf77cb82ba8453b42b6ae1d692e4cdc92f9a47beaf89a847c8be83f4e328ad3" -"checksum spin 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" -"checksum stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8" -"checksum static_assertions 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" -"checksum stream-cipher 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "8131256a5896cabcf5eb04f4d6dacbe1aefda854b0d9896e09cb58829ec5638c" -"checksum string 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d24114bfcceb867ca7f71a0d3fe45d45619ec47a6fbfa98cb14e14250bfa5d6d" -"checksum string-interner 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fd710eadff449a1531351b0e43eb81ea404336fa2f56c777427ab0e32a4cf183" -"checksum strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" -"checksum structopt 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "884ae79d6aad1e738f4a70dff314203fd498490a63ebc4d03ea83323c40b7b72" -"checksum structopt-derive 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0a97f829a34a0a9d5b353a881025a23b8c9fd09d46be6045df6b22920dbd7a93" -"checksum strum 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6138f8f88a16d90134763314e3fc76fa3ed6a7db4725d6acf9a3ef95a3188d22" -"checksum strum_macros 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0054a7df764039a6cd8592b9de84be4bec368ff081d203a7d5371cbfa8e65c81" -"checksum substrate-bip39 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3be511be555a3633e71739a79e4ddff6a6aaa6579fa6114182a51d72c3eb93c5" -"checksum subtle 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2d67a5a62ba6e01cb2192ff309324cb4875d0c451d55fe2319433abe7a05a8ee" -"checksum subtle 2.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7c65d530b10ccaeac294f349038a597e435b18fb456aadd0840a623f83b9e941" -"checksum syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)" = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5" -"checksum syn 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)" = "dff0acdb207ae2fe6d5976617f887eb1e35a2ba52c13c7234c790960cdad9238" -"checksum syn-mid 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9fd3937748a7eccff61ba5b90af1a20dbf610858923a9192ea0ecb0cb77db1d0" -"checksum synstructure 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "67656ea1dc1b41b1451851562ea232ec2e5a80242139f7e679ceccfb5d61f545" -"checksum sysinfo 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)" = "6f4b2468c629cffba39c0a4425849ab3cdb03d9dfacba69684609aea04d08ff9" -"checksum take_mut 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f764005d11ee5f36500a149ace24e00e3da98b0158b3e2d53a7495660d3f4d60" -"checksum target-lexicon 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6f4c118a7a38378f305a9e111fcb2f7f838c0be324bfb31a77ea04f7f6e684b4" -"checksum target_info 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c63f48baada5c52e65a29eef93ab4f8982681b67f9e8d29c7b05abcfec2b9ffe" -"checksum tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "15f2b5fb00ccdf689e0149d1b1b3c03fead81c2b37735d812fa8bddbbf41b6d8" -"checksum tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" -"checksum termcolor 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "96d6098003bde162e4277c70665bd87c326f5a0c3f3fbfb285787fa482d54e6e" -"checksum test-case 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a605baa797821796a751f4a959e1206079b24a4b7e1ed302b7d785d81a9276c9" -"checksum textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" -"checksum thiserror 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)" = "6f357d1814b33bc2dc221243f8424104bfe72dbe911d5b71b3816a2dff1c977e" -"checksum thiserror-impl 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)" = "eb2e25d25307eb8436894f727aba8f65d07adf02e5b35a13cebed48bd282bfef" -"checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b" -"checksum threadpool 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e2f0c90a5f3459330ac8bc0d2f879c693bb7a2f59689c1083fc4ef83834da865" -"checksum time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "db8dcfca086c1143c9270ac42a2bbd8a7ee477b78ac8e45b19abfb0cbede4b6f" -"checksum tiny-bip39 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c1c5676413eaeb1ea35300a0224416f57abc3bd251657e0fafc12c47ff98c060" -"checksum tiny-keccak 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d8a021c69bb74a44ccedb824a046447e2c84a01df9e5c20779750acb38e11b2" -"checksum tiny-keccak 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2953ca5148619bc99695c1274cb54c5275bbb913c6adad87e72eaf8db9787f69" -"checksum tinytemplate 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4574b75faccaacddb9b284faecdf0b544b80b6b294f3d062d325c5726a209c20" -"checksum tokio 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)" = "5a09c0b5bb588872ab2f09afa13ee6e9dac11e10a0ec9e8e3ba39a5a5d530af6" -"checksum tokio 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "bcced6bb623d4bff3739c176c415f13c418f426395c169c9c3cd9a492c715b16" -"checksum tokio-buf 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8fb220f46c53859a4b7ec083e41dec9778ff0b1851c0942b211edb89e0ccdc46" -"checksum tokio-codec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5c501eceaf96f0e1793cf26beb63da3d11c738c4a943fdf3746d81d64684c39f" -"checksum tokio-current-thread 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "d16217cad7f1b840c5a97dfb3c43b0c871fef423a6e8d2118c604e843662a443" -"checksum tokio-executor 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "ca6df436c42b0c3330a82d855d2ef017cd793090ad550a6bc2184f4b933532ab" -"checksum tokio-executor 0.2.0-alpha.6 (registry+https://github.com/rust-lang/crates.io-index)" = "9ee9ceecf69145923834ea73f32ba40c790fd877b74a7817dd0b089f1eb9c7c8" -"checksum tokio-fs 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "3fe6dc22b08d6993916647d108a1a7d15b9cd29c4f4496c62b92c45b5041b7af" -"checksum tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "5090db468dad16e1a7a54c8c67280c5e4b544f3d3e018f0b913b400261f85926" -"checksum tokio-reactor 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "6732fe6b53c8d11178dcb77ac6d9682af27fc6d4cb87789449152e5377377146" -"checksum tokio-rustls 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1df2fa53ac211c136832f530ccb081af9af891af22d685a9493e232c7a359bc2" -"checksum tokio-sync 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "d06554cce1ae4a50f42fba8023918afa931413aded705b560e29600ccf7c6d76" -"checksum tokio-sync 0.2.0-alpha.6 (registry+https://github.com/rust-lang/crates.io-index)" = "4f1aaeb685540f7407ea0e27f1c9757d258c7c6bf4e3eb19da6fc59b747239d2" -"checksum tokio-tcp 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "1d14b10654be682ac43efee27401d792507e30fd8d26389e1da3b185de2e4119" -"checksum tokio-threadpool 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)" = "f0c32ffea4827978e9aa392d2f743d973c1dfa3730a2ed3f22ce1e6984da848c" -"checksum tokio-timer 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)" = "1739638e364e558128461fc1ad84d997702c8e31c2e6b18fb99842268199e827" -"checksum tokio-tls 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "354b8cd83825b3c20217a9dc174d6a0c67441a2fae5c41bcb1ea6679f6ae0f7c" -"checksum tokio-udp 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "f02298505547f73e60f568359ef0d016d5acd6e830ab9bc7c4a5b3403440121b" -"checksum tokio-uds 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "037ffc3ba0e12a0ab4aca92e5234e0dedeb48fddf6ccd260f1f150a36a9f2445" -"checksum tokio-util 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "571da51182ec208780505a32528fc5512a8fe1443ab960b3f2f3ef093cd16930" -"checksum toml 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "01d1404644c8b12b16bfcffa4322403a91a451584daaaa7c28d3152e6cbc98cf" -"checksum tower-service 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e987b6bf443f4b5b3b6f38704195592cca41c5bb7aedd3c3693c7081f8289860" -"checksum tracing 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "ff4e4f59e752cb3beb5b61c6d5e11191c7946231ba84faec2902c9efdd8691c5" -"checksum tracing-attributes 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "a4263b12c3d3c403274493eb805966093b53214124796552d674ca1dd5d27c2b" -"checksum tracing-core 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "bc913647c520c959b6d21e35ed8fa6984971deca9f0a2fcb8c51207e0c56af1d" -"checksum traitobject 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "efd1f82c56340fdf16f2a953d7bda4f8fdffba13d93b00844c25572110b26079" -"checksum trie-bench 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)" = "26fd042d57ee9c987c562811162a78db78b5340ab674ac76056c85dca49b26bc" -"checksum trie-db 0.19.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a0d747ae5b6f078df7e46477fcc7df66df9eb4f27a031cf4a7c890a8dd03d8e6" -"checksum trie-root 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0b779f7c1c8fe9276365d9d5be5c4b5adeacf545117bb3f64c974305789c5c0b" -"checksum trie-standardmap 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c3161ba520ab28cd8e6b68e1126f1009f6e335339d1a73b978139011703264c8" -"checksum try-lock 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e604eb7b43c06650e854be16a2a03155743d3752dd1c943f6829e26b7a36e382" -"checksum trybuild 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)" = "b75e31d624df08744532e935f1d4bfedd319a277d5a162c5b15f6ced59307575" -"checksum twofish 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712d261e83e727c8e2dbb75dacac67c36e35db36a958ee504f2164fc052434e1" -"checksum twox-hash 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3bfd5b7557925ce778ff9b9ef90e3ade34c524b5ff10e239c69a42d546d2af56" -"checksum typeable 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1410f6f91f21d1612654e7cc69193b0334f909dcf2c790c4826254fbb86f8887" -"checksum typenum 1.11.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6d2783fe2d6b8c1101136184eb41be8b1ad379e4657050b8aaff0c79ee7575f9" -"checksum uint 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e75a4cdd7b87b28840dba13c483b9a88ee6bbf16ba5c951ee1ecfcf723078e0d" -"checksum unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7f4765f83163b74f957c797ad9253caf97f103fb064d3999aea9568d09fc8a33" -"checksum unicase 2.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" -"checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" -"checksum unicode-normalization 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "b561e267b2326bb4cebfc0ef9e68355c7abe6c6f522aeac2f5bf95d56c59bdcf" -"checksum unicode-segmentation 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e83e153d1053cbb5a118eeff7fd5be06ed99153f00dbcd8ae310c5fb2b22edc0" -"checksum unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "caaa9d531767d1ff2150b9332433f32a24622147e5ebb1f26409d5da67afd479" -"checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" -"checksum unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" -"checksum unsigned-varint 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a7f0023a96687fe169081e8adce3f65e3874426b7886e9234d490af2dc077959" -"checksum unsigned-varint 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c689459fbaeb50e56c6749275f084decfd02194ac5852e6617d95d0d3cf02eaf" -"checksum untrusted 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "60369ef7a31de49bcb3f6ca728d4ba7300d9a1658f94c727d4cab8c8d9f4aece" -"checksum url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355a" -"checksum url 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "75b414f6c464c879d7f9babf951f23bc3743fb7313c081b2e6ca719067ea9d61" -"checksum vcpkg 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3fc439f2794e98976c88a2a2dafce96b930fe8010b0a256b3c2199a773933168" -"checksum vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a" -"checksum vergen 3.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "6aba5e34f93dc7051dfad05b98a18e9156f27e7b431fe1d2398cb6061c0a1dba" -"checksum version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd" -"checksum version_check 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "078775d0255232fb988e6fccf26ddc9d1ac274299aaedcedce21c6f72cc533ce" -"checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" -"checksum wabt 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)" = "3c5c5c1286c6e578416982609f47594265f9d489f9b836157d403ad605a46693" -"checksum wabt-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "af5d153dc96aad7dc13ab90835b892c69867948112d95299e522d370c4e13a08" -"checksum walkdir 2.2.9 (registry+https://github.com/rust-lang/crates.io-index)" = "9658c94fa8b940eab2250bd5a457f9c48b748420d71293b165c8cdbe2f55f71e" -"checksum want 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b6395efa4784b027708f7451087e647ec73cc74f5d9bc2e418404248d679a230" -"checksum want 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" -"checksum wasi 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b89c3ce4ce14bdc6fb6beaf9ec7928ca331de5df7e5ea278375642a2f478570d" -"checksum wasm-bindgen 0.2.57 (registry+https://github.com/rust-lang/crates.io-index)" = "701bc20794a7f9e8dcd85984a848f951ef6c5083322b6dd17fe880c99390f7cd" -"checksum wasm-bindgen-backend 0.2.57 (registry+https://github.com/rust-lang/crates.io-index)" = "426315280d373e1a828e1c322507d51aa82e03c2fb1d654720b9e2f2368d291d" -"checksum wasm-bindgen-futures 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "1de54efe80cb87a8fa1f715d60ab47a5eac6b1447dd68665300773f498c229b1" -"checksum wasm-bindgen-macro 0.2.57 (registry+https://github.com/rust-lang/crates.io-index)" = "d9a8a46373db32c892de910ccca302ecdaf8262abab746324a8a4dac352fc11f" -"checksum wasm-bindgen-macro-support 0.2.57 (registry+https://github.com/rust-lang/crates.io-index)" = "45d1c6c2259c0f4ef3d61ea0976ea075b6f8185497c4a5457793740c2cda6430" -"checksum wasm-bindgen-shared 0.2.57 (registry+https://github.com/rust-lang/crates.io-index)" = "dd8e108ae395aae8017b091c4766101f08c635a5074e6631e0085e8a839e5810" -"checksum wasm-bindgen-webidl 0.2.57 (registry+https://github.com/rust-lang/crates.io-index)" = "7a38859ace1c29c8ed75cd74940d4c96b980837179355de542a2eab3b435bb5c" -"checksum wasm-gc-api 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d0c32691b6c7e6c14e7f8fd55361a9088b507aa49620fcd06c09b3a1082186b9" -"checksum wasm-timer 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "324c5e65a08699c9c4334ba136597ab22b85dccd4b65dd1e36ccf8f723a95b54" -"checksum wasmi 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bf617d864d25af3587aa745529f7aaa541066c876d57e050c0d0c85c61c92aff" -"checksum wasmi-validation 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ea78c597064ba73596099281e2f4cfc019075122a65cdda3205af94f0b264d93" -"checksum wasmparser 0.39.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c702914acda5feeeffbc29e4d953e5b9ce79d8b98da4dbf18a77086e116c5470" -"checksum wasmtime-debug 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5008729ad53f75020f28fa0d682269335d6f0eac0b3ffafe31f185b2f33aca74" -"checksum wasmtime-environ 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a3947662a0b8e05b1418465e64f16de9114f9fec18cc3f56e0ed5aa7737b89d0" -"checksum wasmtime-jit 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6ed7922689461a7b5bd0d9c7350cac526c8a520a23b3ffd7f5b446ac51dfc51f" -"checksum wasmtime-runtime 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "781d6bb8b346efaa3dc39746386957cd79b8d841e8652ed9b02d77bcf64fb514" -"checksum web-sys 0.3.34 (registry+https://github.com/rust-lang/crates.io-index)" = "ba09295448c0b93bc87d2769614d371a924749e5e6c87e4c1df8b2416b49b775" -"checksum webpki 0.21.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d7e664e770ac0110e2384769bcc59ed19e329d81f555916a6e072714957b81b4" -"checksum webpki-roots 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a262ae37dd9d60f60dd473d1158f9fbebf110ba7b6a5051c8160460f6043718b" -"checksum webpki-roots 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)" = "91cd5736df7f12a964a5067a12c62fa38e1bd8080aff1f80bc29be7c80d19ab4" -"checksum websocket 0.24.0 (registry+https://github.com/rust-lang/crates.io-index)" = "413b37840b9e27b340ce91b319ede10731de8c72f5bc4cb0206ec1ca4ce581d0" -"checksum websocket-base 0.24.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5e3810f0d00c4dccb54c30a4eee815e703232819dec7b007db115791c42aa374" -"checksum weedle 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3bb43f70885151e629e2a19ce9e50bd730fd436cfd4b666894c9ce4de9141164" -"checksum which 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b57acb10231b9493c8472b20cb57317d0679a49e0bdbee44b3b803a6473af164" -"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" -"checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" -"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" -"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" -"checksum winapi-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7168bab6e1daee33b4557efd0e95d5ca70a03706d39fa5f3fe7a236f584b03c9" -"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -"checksum wincolor 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "96f5016b18804d24db43cebf3c77269e7569b8954a8464501c216cc5e070eaa9" -"checksum ws 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c51a2c47b5798ccc774ffb93ff536aec7c4275d722fd9c740c83cdd1af1f2d94" -"checksum ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" -"checksum x25519-dalek 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7ee1585dc1484373cbc1cee7aafda26634665cf449436fd6e24bfd1fad230538" -"checksum xdg 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d089681aa106a86fade1b0128fb5daf07d5867a509ab036d99988dec80429a57" -"checksum yamux 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "809f4388471d280173404e3d4f889e2d36004960a37d822ce5637fbef33a0ce4" -"checksum zeroize 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)" = "45af6a010d13e4cf5b54c94ba5a2b2eba5596b9e46bf5875612d332a1f2b3f86" -"checksum zeroize 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3cbac2ed2ba24cc90f5e06485ac8c7c1e5449fe8911aef4d8877218af021a5b8" -"checksum zeroize_derive 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "de251eec69fc7c1bc3923403d18ececb929380e016afe103da75f396704f8ca2" -"checksum zstd 0.5.1+zstd.1.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "5c5d978b793ae64375b80baf652919b148f6a496ac8802922d9999f5a553194f" -"checksum zstd-safe 2.0.3+zstd.1.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "bee25eac9753cfedd48133fa1736cbd23b774e253d89badbeac7d12b23848d3f" -"checksum zstd-sys 1.4.15+zstd.1.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "89719b034dc22d240d5b407fb0a3fe6d29952c181cff9a9f95c0bd40b4f8f7d8" + "cc", + "glob 0.3.0", + "libc", +] \ No newline at end of file diff --git a/client/cli/src/lib.rs b/client/cli/src/lib.rs index 37a9a456c949a..1e649152ef942 100644 --- a/client/cli/src/lib.rs +++ b/client/cli/src/lib.rs @@ -614,13 +614,6 @@ where } }); -<<<<<<< HEAD - let rpc_interface: &str = interface_str(cli.rpc_external, cli.unsafe_rpc_external, cli.validator)?; - let ws_interface: &str = interface_str(cli.ws_external, cli.unsafe_ws_external, cli.validator)?; - - config.rpc_http = Some(parse_address(&format!("{}:{}", rpc_interface, 9933), cli.rpc_port)?); - config.rpc_ws = Some(parse_address(&format!("{}:{}", ws_interface, 9944), cli.ws_port)?); -======= if config.rpc_http.is_none() || cli.rpc_port.is_some() { let rpc_interface: &str = interface_str(cli.rpc_external, cli.unsafe_rpc_external, cli.validator)?; config.rpc_http = Some(parse_address(&format!("{}:{}", rpc_interface, 9933), cli.rpc_port)?); @@ -630,14 +623,6 @@ where config.rpc_ws = Some(parse_address(&format!("{}:{}", ws_interface, 9944), cli.ws_port)?); } - if config.grafana_port.is_none() || cli.grafana_port.is_some() { - let grafana_interface: &str = if cli.grafana_external { "0.0.0.0" } else { "127.0.0.1" }; - config.grafana_port = Some( - parse_address(&format!("{}:{}", grafana_interface, 9955), cli.grafana_port)? - ); - } ->>>>>>> master - config.rpc_ws_max_connections = cli.ws_max_connections; config.rpc_cors = cli.rpc_cors.unwrap_or_else(|| if is_dev { log::warn!("Running in --dev mode, RPC CORS has been disabled."); @@ -667,8 +652,9 @@ where config.prometheus_port = Some( parse_address(&format!("{}:{}", prometheus_interface, 9615), cli.prometheus_port)?); } - config.tracing_targets = cli.tracing_targets.into(); - config.tracing_receiver = cli.tracing_receiver.into(); + + config.tracing_targets = cli.import_params.tracing_targets.into(); + config.tracing_receiver = cli.import_params.tracing_receiver.into(); // Imply forced authoring on --dev config.force_authoring = cli.shared_params.dev || cli.force_authoring; @@ -892,4 +878,4 @@ mod tests { assert!(config.network.config_path.is_some()); assert!(!config.network.listen_addresses.is_empty()); } -} +} \ No newline at end of file diff --git a/client/service/src/builder.rs b/client/service/src/builder.rs index 6aae854497d03..126dca9afe02c 100644 --- a/client/service/src/builder.rs +++ b/client/service/src/builder.rs @@ -1031,7 +1031,10 @@ ServiceBuilder< exit.clone() ).map(drop); - let _ = to_spawn_tx.unbounded_send(Box::pin(future)); + let _ = to_spawn_tx.unbounded_send(( + Box::pin(future), + From::from("prometheus-on-block") + )); Some(metrics) } else { From 55428b7df919e65e34fabe518c6a37d247ec1f3c Mon Sep 17 00:00:00 2001 From: nodebreaker-carlsagan Date: Fri, 14 Feb 2020 17:10:45 +0900 Subject: [PATCH 40/42] gitlab-check-web-wasm edit code --- utils/prometheus/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/prometheus/src/lib.rs b/utils/prometheus/src/lib.rs index 31cb627578667..5d3b139eac44c 100644 --- a/utils/prometheus/src/lib.rs +++ b/utils/prometheus/src/lib.rs @@ -124,6 +124,6 @@ pub async fn init_prometheus(prometheus_addr: SocketAddr, registry: Registry) -> } #[cfg(target_os = "unknown")] -pub async fn init_prometheus(_: SocketAddr) -> Result<(), Error> { +pub async fn init_prometheus(_: SocketAddr, _registry: Registry) -> Result<(), Error> { Ok(()) } From d1003e6482ba33d6695382629cea681f8cb01f9d Mon Sep 17 00:00:00 2001 From: nodebreaker-carlsagan Date: Tue, 18 Feb 2020 00:59:44 +0900 Subject: [PATCH 41/42] From:from and cargo.lock update --- Cargo.lock | 161 ++++++++++++++++++++++------------ client/service/src/builder.rs | 2 +- 2 files changed, 106 insertions(+), 57 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d32998415722b..9d9bfbc50cfa8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -446,6 +446,12 @@ dependencies = [ "wasm-bindgen-futures", ] +[[package]] +name = "bs58" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c95ee6bba9d950218b6cc910cf62bc9e0a171d0f4537e3627b0f54d08549b188" + [[package]] name = "bs58" version = "0.3.0" @@ -601,7 +607,6 @@ dependencies = [ "js-sys", "num-integer", "num-traits", - "serde", "time", "wasm-bindgen", ] @@ -1918,34 +1923,6 @@ dependencies = [ "scroll", ] -[[package]] -name = "grafana-data-source" -version = "0.8.0" -dependencies = [ - "async-std", - "chrono", - "derive_more", - "futures-timer 3.0.1", - "futures-util", - "hyper 0.13.2", - "lazy_static", - "log 0.4.8", - "parking_lot 0.10.0", - "serde", - "serde_json", - "tokio 0.2.11", -] - -[[package]] -name = "grafana-data-source-test" -version = "2.0.0" -dependencies = [ - "futures 0.3.4", - "futures-timer 3.0.1", - "grafana-data-source", - "rand 0.7.3", -] - [[package]] name = "h2" version = "0.1.26" @@ -2661,8 +2638,8 @@ dependencies = [ "libp2p-wasm-ext", "libp2p-websocket", "libp2p-yamux", - "parity-multiaddr", - "parity-multihash", + "parity-multiaddr 0.7.2", + "parity-multihash 0.2.3", "parking_lot 0.10.0", "pin-project", "smallvec 1.2.0", @@ -2676,7 +2653,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dbafb2706b8082233f66dc13e196f9cf9b4c229f2cd7c96b2b16617ad6ee330b" dependencies = [ "asn1_der", - "bs58", + "bs58 0.3.0", "ed25519-dalek", "fnv", "futures 0.3.4", @@ -2685,8 +2662,8 @@ dependencies = [ "libsecp256k1", "log 0.4.8", "multistream-select", - "parity-multiaddr", - "parity-multihash", + "parity-multiaddr 0.7.2", + "parity-multihash 0.2.3", "parking_lot 0.10.0", "pin-project", "prost", @@ -2697,7 +2674,7 @@ dependencies = [ "sha2", "smallvec 1.2.0", "thiserror", - "unsigned-varint", + "unsigned-varint 0.3.0", "untrusted", "void", "zeroize 1.1.0", @@ -2741,7 +2718,7 @@ version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4bdf6fba9272ad47dde94bade89540fdb16e24ae9ff7fb714c1c80a035165f28" dependencies = [ - "bs58", + "bs58 0.3.0", "cuckoofilter", "fnv", "futures 0.3.4", @@ -2760,7 +2737,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e6ecd058bf769d27ebec530544b081e08b0a1088e3186da8cc58d59915784d0" dependencies = [ "base64 0.11.0", - "bs58", + "bs58 0.3.0", "byteorder 1.3.4", "bytes 0.5.4", "fnv", @@ -2775,7 +2752,7 @@ dependencies = [ "rand 0.7.3", "sha2", "smallvec 1.2.0", - "unsigned-varint", + "unsigned-varint 0.3.0", "wasm-timer", ] @@ -2810,14 +2787,14 @@ dependencies = [ "libp2p-core", "libp2p-swarm", "log 0.4.8", - "parity-multihash", + "parity-multihash 0.2.3", "prost", "prost-build", "rand 0.7.3", "sha2", "smallvec 1.2.0", "uint", - "unsigned-varint", + "unsigned-varint 0.3.0", "void", "wasm-timer", ] @@ -2857,7 +2834,7 @@ dependencies = [ "libp2p-core", "log 0.4.8", "parking_lot 0.10.0", - "unsigned-varint", + "unsigned-varint 0.3.0", ] [[package]] @@ -2909,7 +2886,7 @@ dependencies = [ "prost", "prost-build", "rw-stream-sink", - "unsigned-varint", + "unsigned-varint 0.3.0", "void", ] @@ -3306,7 +3283,7 @@ dependencies = [ "log 0.4.8", "smallvec 1.2.0", "tokio-io", - "unsigned-varint", + "unsigned-varint 0.3.0", ] [[package]] @@ -4533,27 +4510,60 @@ checksum = "0c276d76c5333b8c2579e02d49a06733a55b8282d2d9b13e8d53b6406bd7e30a" [[package]] name = "parity-multiaddr" -version = "0.7.1" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "045b3c7af871285146300da35b1932bb6e4639b66c7c98e85d06a32cbc4e8fa7" +dependencies = [ + "arrayref", + "bs58 0.2.5", + "byteorder 1.3.4", + "bytes 0.4.12", + "data-encoding", + "parity-multihash 0.1.3", + "percent-encoding 1.0.1", + "serde", + "unsigned-varint 0.2.3", + "url 1.7.2", +] + +[[package]] +name = "parity-multiaddr" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80878c27f90dd162d3143333d672e80b194d6b080f05c83440e3dfda42e409f2" +checksum = "26df883298bc3f4e92528b4c5cc9f806b791955b136da3e5e939ed9de0fd958b" dependencies = [ "arrayref", - "bs58", + "bs58 0.3.0", "byteorder 1.3.4", "data-encoding", - "parity-multihash", + "parity-multihash 0.2.3", "percent-encoding 2.1.0", "serde", "static_assertions", - "unsigned-varint", + "unsigned-varint 0.3.0", "url 2.1.1", ] [[package]] name = "parity-multihash" -version = "0.2.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b11f42bbd3a021c5061b77154bd3334d5a57e1a03eb162de0b962681cc25800d" +checksum = "df3a17dc27848fd99e4f87eb0f8c9baba6ede0a6d555400c850ca45254ef4ce3" +dependencies = [ + "blake2", + "bytes 0.4.12", + "rand 0.6.5", + "sha-1", + "sha2", + "sha3", + "unsigned-varint 0.2.3", +] + +[[package]] +name = "parity-multihash" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a1cd2ba02391b81367bec529fb209019d718684fdc8ad6a712c2b536e46f775" dependencies = [ "blake2", "bytes 0.5.4", @@ -4561,7 +4571,7 @@ dependencies = [ "sha-1", "sha2", "sha3", - "unsigned-varint", + "unsigned-varint 0.3.0", ] [[package]] @@ -4958,6 +4968,33 @@ dependencies = [ "unicode-xid 0.2.0", ] +[[package]] +name = "prometheus" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5567486d5778e2c6455b1b90ff1c558f29e751fc018130fa182e15828e728af1" +dependencies = [ + "cfg-if", + "fnv", + "lazy_static", + "protobuf", + "quick-error", + "spin", +] + +[[package]] +name = "prometheus-exporter" +version = "0.8.0" +dependencies = [ + "async-std", + "derive_more", + "futures-util", + "hyper 0.13.2", + "log 0.4.8", + "prometheus", + "tokio 0.2.11", +] + [[package]] name = "prost" version = "0.6.1" @@ -5009,6 +5046,12 @@ dependencies = [ "prost", ] +[[package]] +name = "protobuf" +version = "2.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6686ddd96a8dbe2687b5f2a687b2cfb520854010ec480f2d74c32e7c9873d3c5" + [[package]] name = "pwasm-utils" version = "0.12.0" @@ -5608,6 +5651,7 @@ dependencies = [ "log 0.4.8", "names", "parity-util-mem", + "prometheus-exporter", "regex", "rpassword", "sc-client-api", @@ -6115,7 +6159,7 @@ dependencies = [ "substrate-test-runtime-client", "tempfile", "thiserror", - "unsigned-varint", + "unsigned-varint 0.3.0", "void", "wasm-timer", "yamux", @@ -6304,13 +6348,13 @@ dependencies = [ "futures 0.3.4", "futures-diagnose", "futures-timer 3.0.1", - "grafana-data-source", "lazy_static", "log 0.4.8", - "parity-multiaddr", + "parity-multiaddr 0.5.0", "parity-scale-codec", "parity-util-mem", "parking_lot 0.10.0", + "prometheus-exporter", "sc-chain-spec", "sc-client", "sc-client-api", @@ -6405,7 +6449,6 @@ name = "sc-tracing" version = "2.0.0" dependencies = [ "erased-serde", - "grafana-data-source", "log 0.4.8", "parking_lot 0.10.0", "sc-telemetry", @@ -8409,6 +8452,12 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" +[[package]] +name = "unsigned-varint" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7f0023a96687fe169081e8adce3f65e3874426b7886e9234d490af2dc077959" + [[package]] name = "unsigned-varint" version = "0.3.0" @@ -9091,4 +9140,4 @@ dependencies = [ "cc", "glob 0.3.0", "libc", -] \ No newline at end of file +] diff --git a/client/service/src/builder.rs b/client/service/src/builder.rs index 126dca9afe02c..4275be29a998c 100644 --- a/client/service/src/builder.rs +++ b/client/service/src/builder.rs @@ -1033,7 +1033,7 @@ ServiceBuilder< let _ = to_spawn_tx.unbounded_send(( Box::pin(future), - From::from("prometheus-on-block") + From::from("prometheus-endpoint") )); Some(metrics) From b4b4432ae76ad8a80a5d0e1879e2e5b0eadebf44 Mon Sep 17 00:00:00 2001 From: nodebreaker-carlsagan Date: Tue, 18 Feb 2020 01:22:33 +0900 Subject: [PATCH 42/42] with_prometheus_registry add background_tasks --- Cargo.lock | 35 ++++++++++++++++++++++++++++++++++- client/service/src/builder.rs | 1 + 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index ef86718fcc3a8..0f2ec0bf22bda 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2684,7 +2684,7 @@ dependencies = [ "sha2", "smallvec 1.2.0", "thiserror", - "unsigned-varint", + "unsigned-varint 0.3.0", "void", "zeroize 1.1.0", ] @@ -4529,6 +4529,24 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c276d76c5333b8c2579e02d49a06733a55b8282d2d9b13e8d53b6406bd7e30a" +[[package]] +name = "parity-multiaddr" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "045b3c7af871285146300da35b1932bb6e4639b66c7c98e85d06a32cbc4e8fa7" +dependencies = [ + "arrayref", + "bs58 0.2.5", + "byteorder 1.3.4", + "bytes 0.4.12", + "data-encoding", + "parity-multihash 0.1.3", + "percent-encoding 1.0.1", + "serde", + "unsigned-varint 0.2.3", + "url 1.7.2", +] + [[package]] name = "parity-multiaddr" version = "0.7.2" @@ -4547,6 +4565,21 @@ dependencies = [ "url 2.1.1", ] +[[package]] +name = "parity-multihash" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3a17dc27848fd99e4f87eb0f8c9baba6ede0a6d555400c850ca45254ef4ce3" +dependencies = [ + "blake2", + "bytes 0.4.12", + "rand 0.6.5", + "sha-1", + "sha2", + "sha3", + "unsigned-varint 0.2.3", +] + [[package]] name = "parity-multihash" version = "0.2.3" diff --git a/client/service/src/builder.rs b/client/service/src/builder.rs index 0df94186070fc..9f139795fb04c 100644 --- a/client/service/src/builder.rs +++ b/client/service/src/builder.rs @@ -746,6 +746,7 @@ impl