Skip to content
lib.rs 33.7 KiB
Newer Older
		new_light::<westend_runtime::RuntimeApi, WestendExecutor>(config)
	} else {
		new_light::<polkadot_runtime::RuntimeApi, PolkadotExecutor>(config)
	}
}

#[cfg(feature = "full-node")]
	config: Configuration,
	grandpa_pause: Option<(u32, u32)>,
	jaeger_agent: Option<std::net::SocketAddr>,
) -> Result<NewFull<Client>, Error> {
	let isolation_strategy = {
		#[cfg(not(any(target_os = "android", target_os = "unknown")))]
		{
			let cache_base_path = config.database.path();
			IsolationStrategy::external_process_with_caching(cache_base_path)
		}

		#[cfg(any(target_os = "android", target_os = "unknown"))]
		{
			IsolationStrategy::InProcess
		}
	};

	if config.chain_spec.is_rococo() {
		new_full::<rococo_runtime::RuntimeApi, RococoExecutor>(
			config,
			jaeger_agent,
		).map(|full| full.with_client(Client::Rococo))
	} else if config.chain_spec.is_kusama() {
		new_full::<kusama_runtime::RuntimeApi, KusamaExecutor>(
			config,
			jaeger_agent,
		).map(|full| full.with_client(Client::Kusama))
	} else if config.chain_spec.is_westend() {
		new_full::<westend_runtime::RuntimeApi, WestendExecutor>(
			config,
			jaeger_agent,
		).map(|full| full.with_client(Client::Westend))
	} else {
		new_full::<polkadot_runtime::RuntimeApi, PolkadotExecutor>(
			config,
			jaeger_agent,
		).map(|full| full.with_client(Client::Polkadot))