diff --git a/Cargo.lock b/Cargo.lock index be4e4cf0d5..57d1672814 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5385,11 +5385,14 @@ dependencies = [ "jsonrpc-core", "node-primitives", "pallet-transaction-payment-rpc", + "sc-client-api", "sc-rpc", "sc-rpc-api", "sc-transaction-pool-api", "sp-api", + "sp-block-builder", "sp-blockchain", + "substrate-frame-rpc-system", "zenlink-protocol-rpc", "zenlink-protocol-runtime-api", ] diff --git a/node/rpc/Cargo.toml b/node/rpc/Cargo.toml index 7941d7471e..1d4af964b3 100644 --- a/node/rpc/Cargo.toml +++ b/node/rpc/Cargo.toml @@ -10,12 +10,15 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] jsonrpc-core = "15.1.0" node-primitives = { path = "../primitives" } +sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10" } sc-rpc-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10" } sc-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10" } sc-transaction-pool-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10" } sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10" } +sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10" } sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10" } pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10" } +substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.10" } bifrost-flexible-fee-rpc = { path = "../../pallets/flexible-fee/rpc" } bifrost-flexible-fee-rpc-runtime-api = { path = "../../pallets/flexible-fee/rpc/runtime-api" } bifrost-salp-rpc-api = { path = "../../pallets/salp/rpc" } diff --git a/node/rpc/src/lib.rs b/node/rpc/src/lib.rs index c78280d7ed..b93639b676 100644 --- a/node/rpc/src/lib.rs +++ b/node/rpc/src/lib.rs @@ -39,12 +39,15 @@ use bifrost_liquidity_mining_rpc_api::{LiquidityMiningRpcApi, LiquidityMiningRpc use bifrost_liquidity_mining_rpc_runtime_api::LiquidityMiningRuntimeApi; use bifrost_salp_rpc_api::{SalpRpcApi, SalpRpcWrapper}; use bifrost_salp_rpc_runtime_api::SalpRuntimeApi; -use node_primitives::{AccountId, Balance, Block, ParaId, PoolId}; +use node_primitives::{AccountId, Balance, Block, Nonce, ParaId, PoolId}; use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApi}; -pub use sc_rpc_api::DenyUnsafe; +use sc_client_api::AuxStore; +use sc_rpc_api::DenyUnsafe; use sc_transaction_pool_api::TransactionPool; use sp_api::ProvideRuntimeApi; +use sp_block_builder::BlockBuilder; use sp_blockchain::{Error as BlockChainError, HeaderBackend, HeaderMetadata}; +use substrate_frame_rpc_system::{FullSystem, SystemApi}; use zenlink_protocol_rpc::{ZenlinkProtocol, ZenlinkProtocolApi}; use zenlink_protocol_runtime_api::ZenlinkProtocolApi as ZenlinkProtocolRuntimeApi; @@ -67,20 +70,26 @@ pub type RpcExtension = jsonrpc_core::IoHandler; #[allow(non_snake_case)] pub fn create_full(deps: FullDeps) -> RpcExtension where - C: ProvideRuntimeApi, - C: HeaderBackend + HeaderMetadata, - C: Send + Sync + 'static, + C: ProvideRuntimeApi + + HeaderBackend + + AuxStore + + HeaderMetadata + + Send + + Sync + + 'static, C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi, + C::Api: substrate_frame_rpc_system::AccountNonceApi, C::Api: FeeRuntimeApi, C::Api: SalpRuntimeApi, C::Api: LiquidityMiningRuntimeApi, C::Api: ZenlinkProtocolRuntimeApi, - P: TransactionPool + 'static, + C::Api: BlockBuilder, + P: TransactionPool + Sync + Send + 'static, { - let FullDeps { client, .. } = deps; - - let mut io = RpcExtension::default(); + let mut io = jsonrpc_core::IoHandler::default(); + let FullDeps { client, pool, deny_unsafe } = deps; + io.extend_with(SystemApi::to_delegate(FullSystem::new(client.clone(), pool, deny_unsafe))); io.extend_with(TransactionPaymentApi::to_delegate(TransactionPayment::new(client.clone()))); io.extend_with(FeeRpcApi::to_delegate(FlexibleFeeStruct::new(client.clone()))); diff --git a/node/service/src/collator.rs b/node/service/src/collator.rs index cd11c10df2..82cc2c8c01 100644 --- a/node/service/src/collator.rs +++ b/node/service/src/collator.rs @@ -35,7 +35,9 @@ use cumulus_client_service::{ }; use cumulus_primitives_core::ParaId; use node_primitives::PoolId; -pub use node_primitives::{AccountId, Block, BlockNumber, Hash, Header, ParaId as BifrostParaId}; +pub use node_primitives::{ + AccountId, Block, BlockNumber, Hash, Header, Nonce, ParaId as BifrostParaId, +}; use sc_client_api::ExecutorProvider; use sc_consensus::LongestChain; use sc_executor::NativeExecutionDispatch; @@ -190,6 +192,7 @@ where RuntimeApi::RuntimeApi: RuntimeApiCollection>, RuntimeApi::RuntimeApi: sp_consensus_aura::AuraApi, + RuntimeApi::RuntimeApi: substrate_frame_rpc_system::AccountNonceApi, RuntimeApi::RuntimeApi: FeeRuntimeApi, RuntimeApi::RuntimeApi: SalpRuntimeApi, RuntimeApi::RuntimeApi: LiquidityMiningRuntimeApi,