pub fn create_full<C, P, BE>(
	deps: FullDeps<C, P>,
	subscription_task_executor: SubscriptionTaskExecutor,
) -> jsonrpc_core::IoHandler<sc_rpc::Metadata>
where
	BE: Backend<Block> + 'static,
	BE::State: StateBackend<BlakeTwo256>,
	C: ProvideRuntimeApi<Block> + StorageProvider<Block, BE> + AuxStore,
	C: BlockchainEvents<Block>,
	C: HeaderBackend<Block> + HeaderMetadata<Block, Error = BlockChainError>,
	C: Send + Sync + 'static,
	C::Api: substrate_frame_rpc_system::AccountNonceApi<Block, AccountId, Index>,
	C::Api: BlockBuilder<Block>,
	C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi<Block, Balance>,
	C::Api: fp_rpc::EthereumRuntimeRPCApi<Block>,
	P: TransactionPool<Block = Block> + 'static,
{
	use fc_rpc::{
		EthApi, EthApiServer, EthDevSigner, EthFilterApi, EthFilterApiServer, EthPubSubApi,
		EthPubSubApiServer, EthSigner, HexEncodedIdProvider, NetApi, NetApiServer, Web3Api,
		Web3ApiServer,
	};
	use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApi};
	use substrate_frame_rpc_system::{FullSystem, SystemApi};

	let mut io = jsonrpc_core::IoHandler::default();
	let FullDeps {
		client,
		pool,
		deny_unsafe,
		is_authority,
		network,
		pending_transactions,
		filter_pool,
		command_sink,
		backend,
		max_past_logs,
		enable_dev_signer,
	} = deps;

	io.extend_with(SystemApi::to_delegate(FullSystem::new(
		client.clone(),
		pool.clone(),
		deny_unsafe,
	)));
	io.extend_with(TransactionPaymentApi::to_delegate(TransactionPayment::new(
		client.clone(),
	)));

	let mut signers = Vec::new();
	if enable_dev_signer {
		signers.push(Box::new(EthDevSigner::new()) as Box<dyn EthSigner>);
	}
	let mut overrides_map = BTreeMap::new();
	overrides_map.insert(
		EthereumStorageSchema::V1,
		Box::new(SchemaV1Override::new(client.clone()))
			as Box<dyn StorageOverride<_> + Send + Sync>,
	);

	let overrides = Arc::new(OverrideHandle {
		schemas: overrides_map,
		fallback: Box::new(RuntimeApiStorageOverride::new(client.clone())),
	});

	io.extend_with(EthApiServer::to_delegate(EthApi::new(
		client.clone(),
		pool.clone(),
		frontier_template_runtime::TransactionConverter,
		network.clone(),
		pending_transactions.clone(),
		signers,
		overrides.clone(),
		backend.clone(),
		is_authority,
		max_past_logs,
	)));

	if let Some(filter_pool) = filter_pool {
		io.extend_with(EthFilterApiServer::to_delegate(EthFilterApi::new(
			client.clone(),
			backend,
			filter_pool.clone(),
			500 as usize, // max stored filters
			overrides.clone(),
			max_past_logs,
		)));
	}

	io.extend_with(NetApiServer::to_delegate(NetApi::new(
		client.clone(),
		network.clone(),
		// Whether to format the `peer_count` response as Hex (default) or not.
		true,
	)));

	io.extend_with(Web3ApiServer::to_delegate(Web3Api::new(client.clone())));

	io.extend_with(EthPubSubApiServer::to_delegate(EthPubSubApi::new(
		pool.clone(),
		client.clone(),
		network.clone(),
		SubscriptionManager::<HexEncodedIdProvider>::with_id_provider(
			HexEncodedIdProvider::default(),
			Arc::new(subscription_task_executor),
		),
		overrides,
	)));

	match command_sink {
		Some(command_sink) => {
			io.extend_with(
				// We provide the rpc handler with the sending end of the channel to allow the rpc
				// send EngineCommands to the background block authorship task.
				ManualSealApi::to_delegate(ManualSeal::new(command_sink)),
			);
		}
		_ => {}
	}

	io
}
/// Instantiate all Full RPC extensions.
Instantiate all Full RPC extensions.
Instantiate all Full RPC extensions .
pub fn create_full<C, P, BE>(
	deps: FullDeps<C, P>,
	subscription_task_executor: SubscriptionTaskExecutor,
) -> jsonrpc_core::IoHandler<sc_rpc::Metadata>
where
	BE: Backend<Block> + 'static,
	BE::State: StateBackend<BlakeTwo256>,
	C: ProvideRuntimeApi<Block> + StorageProvider<Block, BE> + AuxStore,
	C: BlockchainEvents<Block>,
	C: HeaderBackend<Block> + HeaderMetadata<Block, Error = BlockChainError>,
	C: Send + Sync + 'static,
	C::Api: substrate_frame_rpc_system::AccountNonceApi<Block, AccountId, Index>,
	C::Api: BlockBuilder<Block>,
	C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi<Block, Balance>,
	C::Api: fp_rpc::EthereumRuntimeRPCApi<Block>,
	P: TransactionPool<Block = Block> + 'static,
{
	use fc_rpc::{
		EthApi, EthApiServer, EthDevSigner, EthFilterApi, EthFilterApiServer, EthPubSubApi,
		EthPubSubApiServer, EthSigner, HexEncodedIdProvider, NetApi, NetApiServer, Web3Api,
		Web3ApiServer,
	};
	use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApi};
	use substrate_frame_rpc_system::{FullSystem, SystemApi};
	let mut io = jsonrpc_core::IoHandler::default();
	let FullDeps {
		client,
		pool,
		deny_unsafe,
		is_authority,
		network,
		pending_transactions,
		filter_pool,
		command_sink,
		backend,
		max_past_logs,
		enable_dev_signer,
	} = deps;
	io.extend_with(SystemApi::to_delegate(FullSystem::new(
		client.clone(),
		pool.clone(),
		deny_unsafe,
	)));
	io.extend_with(TransactionPaymentApi::to_delegate(TransactionPayment::new(
		client.clone(),
	)));
	let mut signers = Vec::new();
	if enable_dev_signer {
		signers.push(Box::new(EthDevSigner::new()) as Box<dyn EthSigner>);
	}
	let mut overrides_map = BTreeMap::new();
	overrides_map.insert(
		EthereumStorageSchema::V1,
		Box::new(SchemaV1Override::new(client.clone()))
			as Box<dyn StorageOverride<_> + Send + Sync>,
	);
	let overrides = Arc::new(OverrideHandle {
		schemas: overrides_map,
		fallback: Box::new(RuntimeApiStorageOverride::new(client.clone())),
	});
	io.extend_with(EthApiServer::to_delegate(EthApi::new(
		client.clone(),
		pool.clone(),
		frontier_template_runtime::TransactionConverter,
		network.clone(),
		pending_transactions.clone(),
		signers,
		overrides.clone(),
		backend.clone(),
		is_authority,
		max_past_logs,
	)));
	if let Some(filter_pool) = filter_pool {
		io.extend_with(EthFilterApiServer::to_delegate(EthFilterApi::new(
			client.clone(),
			backend,
			filter_pool.clone(),
			500 as usize, // max stored filters
			overrides.clone(),
			max_past_logs,
		)));
	}
	io.extend_with(NetApiServer::to_delegate(NetApi::new(
		client.clone(),
		network.clone(),
		// Whether to format the `peer_count` response as Hex (default) or not.
		true,
	)));
	io.extend_with(Web3ApiServer::to_delegate(Web3Api::new(client.clone())));
	io.extend_with(EthPubSubApiServer::to_delegate(EthPubSubApi::new(
		pool.clone(),
		client.clone(),
		network.clone(),
		SubscriptionManager::<HexEncodedIdProvider>::with_id_provider(
			HexEncodedIdProvider::default(),
			Arc::new(subscription_task_executor),
		),
		overrides,
	)));
	match command_sink {
		Some(command_sink) => {
			io.extend_with(
				// We provide the rpc handler with the sending end of the channel to allow the rpc
				// send EngineCommands to the background block authorship task.
				ManualSealApi::to_delegate(ManualSeal::new(command_sink)),
			);
		}
		_ => {}
	}
	io
}
pub fn create_full < C , P , BE > ( deps : FullDeps < C , P > , subscription_task_executor : SubscriptionTaskExecutor , ) -> jsonrpc_core :: IoHandler < sc_rpc :: Metadata > where BE : Backend < Block > + ' static , BE :: State : StateBackend < BlakeTwo256 > , C : ProvideRuntimeApi < Block > + StorageProvider < Block , BE > + AuxStore , C : BlockchainEvents < Block > , C : HeaderBackend < Block > + HeaderMetadata < Block , Error = BlockChainError > , C : Send + Sync + ' static , C :: Api : substrate_frame_rpc_system :: AccountNonceApi < Block , AccountId , Index > , C :: Api : BlockBuilder < Block > , C :: Api : pallet_transaction_payment_rpc :: TransactionPaymentRuntimeApi < Block , Balance > , C :: Api : fp_rpc :: EthereumRuntimeRPCApi < Block > , P : TransactionPool < Block = Block > + ' static , { use fc_rpc :: { EthApi , EthApiServer , EthDevSigner , EthFilterApi , EthFilterApiServer , EthPubSubApi , EthPubSubApiServer , EthSigner , HexEncodedIdProvider , NetApi , NetApiServer , Web3Api , Web3ApiServer , } ; use pallet_transaction_payment_rpc :: { TransactionPayment , TransactionPaymentApi } ; use substrate_frame_rpc_system :: { FullSystem , SystemApi } ; let mut io = jsonrpc_core :: IoHandler :: default ( ) ; let FullDeps { client , pool , deny_unsafe , is_authority , network , pending_transactions , filter_pool , command_sink , backend , max_past_logs , enable_dev_signer , } = deps ; io . extend_with ( SystemApi :: to_delegate ( FullSystem :: new ( client . clone ( ) , pool . clone ( ) , deny_unsafe , ) ) ) ; io . extend_with ( TransactionPaymentApi :: to_delegate ( TransactionPayment :: new ( client . clone ( ) , ) ) ) ; let mut signers = Vec :: new ( ) ; if enable_dev_signer { signers . push ( Box :: new ( EthDevSigner :: new ( ) ) as Box < dyn EthSigner > ) ; } let mut overrides_map = BTreeMap :: new ( ) ; overrides_map . insert ( EthereumStorageSchema :: V1 , Box :: new ( SchemaV1Override :: new ( client . clone ( ) ) ) as Box < dyn StorageOverride < _ > + Send + Sync > , ) ; let overrides = Arc :: new ( OverrideHandle { schemas : overrides_map , fallback : Box :: new ( RuntimeApiStorageOverride :: new ( client . clone ( ) ) ) , } ) ; io . extend_with ( EthApiServer :: to_delegate ( EthApi :: new ( client . clone ( ) , pool . clone ( ) , frontier_template_runtime :: TransactionConverter , network . clone ( ) , pending_transactions . clone ( ) , signers , overrides . clone ( ) , backend . clone ( ) , is_authority , max_past_logs , ) ) ) ; if let Some ( filter_pool ) = filter_pool { io . extend_with ( EthFilterApiServer :: to_delegate ( EthFilterApi :: new ( client . clone ( ) , backend , filter_pool . clone ( ) , 500 as usize , // max stored filters overrides . clone ( ) , max_past_logs , ) ) ) ; } io . extend_with ( NetApiServer :: to_delegate ( NetApi :: new ( client . clone ( ) , network . clone ( ) , // Whether to format the `peer_count` response as Hex (default) or not. true , ) ) ) ; io . extend_with ( Web3ApiServer :: to_delegate ( Web3Api :: new ( client . clone ( ) ) ) ) ; io . extend_with ( EthPubSubApiServer :: to_delegate ( EthPubSubApi :: new ( pool . clone ( ) , client . clone ( ) , network . clone ( ) , SubscriptionManager :: < HexEncodedIdProvider > :: with_id_provider ( HexEncodedIdProvider :: default ( ) , Arc :: new ( subscription_task_executor ) , ) , overrides , ) ) ) ; match command_sink { Some ( command_sink ) => { io . extend_with ( // We provide the rpc handler with the sending end of the channel to allow the rpc // send EngineCommands to the background block authorship task. ManualSealApi :: to_delegate ( ManualSeal :: new ( command_sink ) ) , ) ; } _ => { } } io }
Instantiate all Full RPC extensions.
Instantiate all Full RPC extensions .
deps
FullDeps<C, P>
subscription_task_executor
SubscriptionTaskExecutor