pub fn new_full(config: Configuration) -> Result<impl AbstractService, ServiceError> {
	let role = config.role.clone();
	// let force_authoring = config.force_authoring;
	// let name = config.network.node_name.clone();
	// let disable_grandpa = config.disable_grandpa;

	let (builder, mut import_setup, inherent_data_providers) = new_full_start!(config);

	let block_import =import_setup.take()
			.expect("Link Half and Block Import are present for Full Services or setup failed before. qed");

	let service = builder
	.with_finality_proof_provider(|client, backend| {
		// GenesisAuthoritySetProvider is implemented for StorageAndProofProvider
		let provider = client as Arc<dyn StorageAndProofProvider<_, _>>;
		Ok(Arc::new(()) as _)
	})?
	.build_full()?;

	let proposer = sc_basic_authorship::ProposerFactory::new(
		service.client(),
		service.transaction_pool(),
		service.prometheus_registry().as_ref(),
	);
	let rounds = 500;

	let client = service.client();
	let select_chain = service.select_chain()
		.ok_or(ServiceError::SelectChainRequired)?;

	let can_author_with =
		sp_consensus::CanAuthorWithNativeVersion::new(client.executor().clone());


	sc_consensus_pow::start_mine(
		Box::new(block_import),
		client.clone(),
		crate::pow::Sha3Algorithm::new(client.clone()),
		proposer,
		None,
		rounds,
		service.network(),
		std::time::Duration::new(2,0),
		Some(select_chain),
		inherent_data_providers,
		can_author_with
	);

	Ok(service)
}
/// Builds a new service for a full client.
Builds a new service for a full client.
Builds a new service for a full client .
pub fn new_full(config: Configuration) -> Result<impl AbstractService, ServiceError> {
	let role = config.role.clone();
	// let force_authoring = config.force_authoring;
	// let name = config.network.node_name.clone();
	// let disable_grandpa = config.disable_grandpa;
	let (builder, mut import_setup, inherent_data_providers) = new_full_start!(config);
	let block_import =import_setup.take()
			.expect("Link Half and Block Import are present for Full Services or setup failed before. qed");
	let service = builder
	.with_finality_proof_provider(|client, backend| {
		// GenesisAuthoritySetProvider is implemented for StorageAndProofProvider
		let provider = client as Arc<dyn StorageAndProofProvider<_, _>>;
		Ok(Arc::new(()) as _)
	})?
	.build_full()?;
	let proposer = sc_basic_authorship::ProposerFactory::new(
		service.client(),
		service.transaction_pool(),
		service.prometheus_registry().as_ref(),
	);
	let rounds = 500;
	let client = service.client();
	let select_chain = service.select_chain()
		.ok_or(ServiceError::SelectChainRequired)?;
	let can_author_with =
		sp_consensus::CanAuthorWithNativeVersion::new(client.executor().clone());
	sc_consensus_pow::start_mine(
		Box::new(block_import),
		client.clone(),
		crate::pow::Sha3Algorithm::new(client.clone()),
		proposer,
		None,
		rounds,
		service.network(),
		std::time::Duration::new(2,0),
		Some(select_chain),
		inherent_data_providers,
		can_author_with
	);
	Ok(service)
}
pub fn new_full ( config : Configuration ) -> Result < impl AbstractService , ServiceError > { let role = config . role . clone ( ) ; // let force_authoring = config.force_authoring; // let name = config.network.node_name.clone(); // let disable_grandpa = config.disable_grandpa; let ( builder , mut import_setup , inherent_data_providers ) = new_full_start ! ( config ) ; let block_import = import_setup . take ( ) . expect ( " " ) ; let service = builder . with_finality_proof_provider ( | client , backend | { // GenesisAuthoritySetProvider is implemented for StorageAndProofProvider let provider = client as Arc < dyn StorageAndProofProvider < _ , _ > > ; Ok ( Arc :: new ( ( ) ) as _ ) } ) ? . build_full ( ) ? ; let proposer = sc_basic_authorship :: ProposerFactory :: new ( service . client ( ) , service . transaction_pool ( ) , service . prometheus_registry ( ) . as_ref ( ) , ) ; let rounds = 500 ; let client = service . client ( ) ; let select_chain = service . select_chain ( ) . ok_or ( ServiceError :: SelectChainRequired ) ? ; let can_author_with = sp_consensus :: CanAuthorWithNativeVersion :: new ( client . executor ( ) . clone ( ) ) ; sc_consensus_pow :: start_mine ( Box :: new ( block_import ) , client . clone ( ) , crate :: pow :: Sha3Algorithm :: new ( client . clone ( ) ) , proposer , None , rounds , service . network ( ) , std :: time :: Duration :: new ( 2 , 0 ) , Some ( select_chain ) , inherent_data_providers , can_author_with ) ; Ok ( service ) }
Builds a new service for a full client.
Builds a new service for a full client .
config
Configuration
config
Configuration