pub fn new_full_parts<TBl, TRtApi, TExecDisp>(
	config: &Configuration,
) -> Result<TFullParts<TBl, TRtApi, TExecDisp>,	Error> where
	TBl: BlockT,
	TExecDisp: NativeExecutionDispatch + 'static,
{
	let keystore_container = KeystoreContainer::new(&config.keystore)?;

	let task_manager = {
		let registry = config.prometheus_config.as_ref().map(|cfg| &cfg.registry);
		TaskManager::new(config.task_executor.clone(), registry)?
	};

	let executor = NativeExecutor::<TExecDisp>::new(
		config.wasm_method,
		config.default_heap_pages,
		config.max_runtime_instances,
	);

	let chain_spec = &config.chain_spec;
	let fork_blocks = get_extension::<ForkBlocks<TBl>>(chain_spec.extensions())
		.cloned()
		.unwrap_or_default();

	let bad_blocks = get_extension::<BadBlocks<TBl>>(chain_spec.extensions())
		.cloned()
		.unwrap_or_default();

	let (client, backend) = {
		let db_config = sc_client_db::DatabaseSettings {
			state_cache_size: config.state_cache_size,
			state_cache_child_ratio:
			config.state_cache_child_ratio.map(|v| (v, 100)),
			pruning: config.pruning.clone(),
			source: config.database.clone(),
		};

		let extensions = sc_client_api::execution_extensions::ExecutionExtensions::new(
			config.execution_strategies.clone(),
			Some(keystore_container.sync_keystore()),
		);

		new_client(
			db_config,
			executor,
			chain_spec.as_storage_builder(),
			fork_blocks,
			bad_blocks,
			extensions,
			Box::new(task_manager.spawn_handle()),
			config.prometheus_config.as_ref().map(|config| config.registry.clone()),
			ClientConfig {
				offchain_worker_enabled : config.offchain_worker.enabled,
				offchain_indexing_api: config.offchain_worker.indexing_enabled,
				wasm_runtime_overrides: config.wasm_runtime_overrides.clone(),
			},
		)?
	};

	Ok((
		client,
		backend,
		keystore_container,
		task_manager,
	))
}
/// Create the initial parts of a full node.
Create the initial parts of a full node.
Create the initial parts of a full node .
pub fn new_full_parts<TBl, TRtApi, TExecDisp>(
	config: &Configuration,
) -> Result<TFullParts<TBl, TRtApi, TExecDisp>,	Error> where
	TBl: BlockT,
	TExecDisp: NativeExecutionDispatch + 'static,
{
	let keystore_container = KeystoreContainer::new(&config.keystore)?;
	let task_manager = {
		let registry = config.prometheus_config.as_ref().map(|cfg| &cfg.registry);
		TaskManager::new(config.task_executor.clone(), registry)?
	};
	let executor = NativeExecutor::<TExecDisp>::new(
		config.wasm_method,
		config.default_heap_pages,
		config.max_runtime_instances,
	);
	let chain_spec = &config.chain_spec;
	let fork_blocks = get_extension::<ForkBlocks<TBl>>(chain_spec.extensions())
		.cloned()
		.unwrap_or_default();
	let bad_blocks = get_extension::<BadBlocks<TBl>>(chain_spec.extensions())
		.cloned()
		.unwrap_or_default();
	let (client, backend) = {
		let db_config = sc_client_db::DatabaseSettings {
			state_cache_size: config.state_cache_size,
			state_cache_child_ratio:
			config.state_cache_child_ratio.map(|v| (v, 100)),
			pruning: config.pruning.clone(),
			source: config.database.clone(),
		};
		let extensions = sc_client_api::execution_extensions::ExecutionExtensions::new(
			config.execution_strategies.clone(),
			Some(keystore_container.sync_keystore()),
		);
		new_client(
			db_config,
			executor,
			chain_spec.as_storage_builder(),
			fork_blocks,
			bad_blocks,
			extensions,
			Box::new(task_manager.spawn_handle()),
			config.prometheus_config.as_ref().map(|config| config.registry.clone()),
			ClientConfig {
				offchain_worker_enabled : config.offchain_worker.enabled,
				offchain_indexing_api: config.offchain_worker.indexing_enabled,
				wasm_runtime_overrides: config.wasm_runtime_overrides.clone(),
			},
		)?
	};
	Ok((
		client,
		backend,
		keystore_container,
		task_manager,
	))
}
pub fn new_full_parts < TBl , TRtApi , TExecDisp > ( config : & Configuration , ) -> Result < TFullParts < TBl , TRtApi , TExecDisp > , Error > where TBl : BlockT , TExecDisp : NativeExecutionDispatch + ' static , { let keystore_container = KeystoreContainer :: new ( & config . keystore ) ? ; let task_manager = { let registry = config . prometheus_config . as_ref ( ) . map ( | cfg | & cfg . registry ) ; TaskManager :: new ( config . task_executor . clone ( ) , registry ) ? } ; let executor = NativeExecutor :: < TExecDisp > :: new ( config . wasm_method , config . default_heap_pages , config . max_runtime_instances , ) ; let chain_spec = & config . chain_spec ; let fork_blocks = get_extension :: < ForkBlocks < TBl > > ( chain_spec . extensions ( ) ) . cloned ( ) . unwrap_or_default ( ) ; let bad_blocks = get_extension :: < BadBlocks < TBl > > ( chain_spec . extensions ( ) ) . cloned ( ) . unwrap_or_default ( ) ; let ( client , backend ) = { let db_config = sc_client_db :: DatabaseSettings { state_cache_size : config . state_cache_size , state_cache_child_ratio : config . state_cache_child_ratio . map ( | v | ( v , 100 ) ) , pruning : config . pruning . clone ( ) , source : config . database . clone ( ) , } ; let extensions = sc_client_api :: execution_extensions :: ExecutionExtensions :: new ( config . execution_strategies . clone ( ) , Some ( keystore_container . sync_keystore ( ) ) , ) ; new_client ( db_config , executor , chain_spec . as_storage_builder ( ) , fork_blocks , bad_blocks , extensions , Box :: new ( task_manager . spawn_handle ( ) ) , config . prometheus_config . as_ref ( ) . map ( | config | config . registry . clone ( ) ) , ClientConfig { offchain_worker_enabled : config . offchain_worker . enabled , offchain_indexing_api : config . offchain_worker . indexing_enabled , wasm_runtime_overrides : config . wasm_runtime_overrides . clone ( ) , } , ) ? } ; Ok ( ( client , backend , keystore_container , task_manager , ) ) }
Create the initial parts of a full node.
Create the initial parts of a full node .
config
&Configuration
config
&Configuration