mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 14:01:02 +00:00
Telemetry (Slog + WS) (#217)
* Merge remote-tracking branch 'origin/master' into gav-xts-dont-panic * Update wasm. * consensus, session and staking all panic-safe. * Democracy doesn't panic in apply. * Fix tests. * Extra helper macro, council depanicked. * Fix one test. * Fix up all council tests. No panics! * Council voting depanicked. * Dispatch returns result. * session & staking tests updated * Fix democracy tests. * Fix council tests. * Fix up polkadot parachains in runtime * Fix borked merge * More Slicable support Support general `Option` and array types. * Basic storage types. * Existential deposit for contract creation * Basic implemnetation along with removals * Fix tests. * externalities builder fix. * Tests. * Fix up the runtime. * Fix tests. * Add generic `Address` type. * Initial function integration of Address into Extrinsic. * Fix build * All tests compile. * Fix (some) tests. * Fix signing. * Push error. * transfer can accept Address * Make Address generic over AccountIndex * Fix test * Make Council use Address for dispatch. * Fix build * Bend over backwards to support braindead derive. * Repot some files. * Fix tests. * Fix grumbles * Remove Default bound * Fix build for new nightly. * Make `apply_extrinsic` never panic, return useful Result. * More merge hell * Doesn't build, but might do soon * Serde woes * get substrate-runtime-staking compiling * Polkadot builds again! * Fix all build. * Fix tests & binaries. * Reserve some extra initial byte values of address for future format changes * Make semantic of `ReservedBalance` clear. * Fix panic handler. * Integrate other balance transformations into the new model Fix up staking tests. * Fix runtime tests. * Fix panic build. * Tests for demonstrating interaction between balance types. * Repot some runtime code * Fix checkedblock in non-std builds * Get rid of `DoLookup` phantom. * Attempt to make transaction_pool work with lookups. * Remove vscode settings * New attempt at making transaction pool work. * It builds again! * --all builds * Fix tests. * New build. * Test account nonce reset. * polkadot transaction pool tests/framework. * Initial draft (working). * Address grumbles. * Revert bad `map_or` * Rebuild binaries, workaround. * Avoid checking in vscode * reconnecting, shared, slog * CLI options for name and telemetry url * ensure telemetry url imples enabled * Avoid casting to usize early. * Provide on-connect event for session message * Better port * heartbeat and some renaming * transaction pool stuff * minor renaming. * report telemetry * cleanups. * Fix for previous cleanup * Initial draft (working). * Avoid checking in vscode * reconnecting, shared, slog * CLI options for name and telemetry url * ensure telemetry url imples enabled * Provide on-connect event for session message * Better port * heartbeat and some renaming * transaction pool stuff * minor renaming. * report telemetry * cleanups. * Fix for previous cleanup * Address grumble * Final grumble and repot telemetry to substrate * Fix comment * Please build, travis...
This commit is contained in:
@@ -19,8 +19,8 @@
|
||||
|
||||
extern crate futures;
|
||||
extern crate ed25519;
|
||||
extern crate clap;
|
||||
extern crate exit_future;
|
||||
extern crate parking_lot;
|
||||
extern crate tokio_timer;
|
||||
extern crate polkadot_primitives;
|
||||
extern crate polkadot_runtime;
|
||||
@@ -40,9 +40,13 @@ extern crate tokio_core;
|
||||
extern crate substrate_client as client;
|
||||
extern crate substrate_client_db as client_db;
|
||||
|
||||
#[macro_use]
|
||||
extern crate substrate_telemetry;
|
||||
#[macro_use]
|
||||
extern crate error_chain;
|
||||
#[macro_use]
|
||||
extern crate slog; // needed until we can reexport `slog_info` from `substrate_telemetry`
|
||||
#[macro_use]
|
||||
extern crate log;
|
||||
#[macro_use]
|
||||
extern crate hex_literal;
|
||||
@@ -71,7 +75,7 @@ use network::ManageNetwork;
|
||||
use exit_future::Signal;
|
||||
|
||||
pub use self::error::{ErrorKind, Error};
|
||||
pub use config::{Configuration, Role, ChainSpec};
|
||||
pub use config::{Configuration, Role, OptionChainSpec, ChainSpec};
|
||||
|
||||
type CodeExecutor = NativeExecutor<LocalDispatch>;
|
||||
|
||||
@@ -410,7 +414,8 @@ impl<B, E> Service<B, E>
|
||||
let (client, on_demand) = client_creator(db_settings, executor, genesis_builder)?;
|
||||
let api = api_creator(client.clone());
|
||||
let best_header = client.best_block_header()?;
|
||||
info!("Starting Polkadot. Best block is #{}", best_header.number);
|
||||
info!("Best block is #{}", best_header.number);
|
||||
telemetry!("node.start"; "height" => best_header.number, "best" => ?best_header.hash());
|
||||
let transaction_pool = Arc::new(TransactionPool::new(config.transaction_pool));
|
||||
let transaction_pool_adapter = Arc::new(TransactionPoolAdapter {
|
||||
pool: transaction_pool.clone(),
|
||||
@@ -430,6 +435,7 @@ impl<B, E> Service<B, E>
|
||||
let barrier = ::std::sync::Arc::new(Barrier::new(2));
|
||||
on_demand.map(|on_demand| on_demand.set_service_link(Arc::downgrade(&network)));
|
||||
|
||||
|
||||
let thread = {
|
||||
let client = client.clone();
|
||||
let network = network.clone();
|
||||
@@ -445,11 +451,11 @@ impl<B, E> Service<B, E>
|
||||
// block notifications
|
||||
let network1 = network.clone();
|
||||
let txpool1 = txpool.clone();
|
||||
|
||||
let events = client.import_notification_stream()
|
||||
.for_each(move |notification| {
|
||||
network1.on_block_imported(notification.hash, ¬ification.header);
|
||||
prune_imported(&*api, &*txpool1, notification.hash);
|
||||
|
||||
Ok(())
|
||||
});
|
||||
core.handle().spawn(events);
|
||||
|
||||
Reference in New Issue
Block a user