Ensure we send the correct polkadot node version to telemetry (#1307)

This is basically a hack, but with the current way we initialize the node this is the easiest
solution to ensure we send the correct version etc.
This commit is contained in:
Bastian Köcher
2022-05-30 19:50:00 +02:00
committed by GitHub
parent 154ea86efb
commit 6f416eece2
5 changed files with 13 additions and 5 deletions
@@ -32,6 +32,7 @@ use polkadot_client::{ClientHandle, ExecuteWithClient, FullBackend};
use polkadot_service::{
AuxStore, BabeApi, CollatorPair, Configuration, Handle, NewFull, Role, TaskManager,
};
use sc_cli::SubstrateCli;
use sc_client_api::{
blockchain::BlockStatus, Backend, BlockchainEvents, HeaderBackend, ImportNotifications,
StorageProof, UsageProvider,
@@ -359,12 +360,17 @@ fn build_polkadot_full_node(
/// Builds a relay chain interface by constructing a full relay chain node
pub fn build_inprocess_relay_chain(
polkadot_config: Configuration,
mut polkadot_config: Configuration,
parachain_config: &Configuration,
telemetry_worker_handle: Option<TelemetryWorkerHandle>,
task_manager: &mut TaskManager,
hwbench: Option<sc_sysinfo::HwBench>,
) -> RelayChainResult<(Arc<(dyn RelayChainInterface + 'static)>, Option<CollatorPair>)> {
// This is essentially a hack, but we want to ensure that we send the correct node version
// to the telemetry.
polkadot_config.impl_version = polkadot_cli::Cli::impl_version();
polkadot_config.impl_name = polkadot_cli::Cli::impl_name();
let (full_node, collator_key) = build_polkadot_full_node(
polkadot_config,
parachain_config,