Skip to content
This repository was archived by the owner on Aug 24, 2023. It is now read-only.

Commit 3cc7ca6

Browse files
committed
install meta-defichain rpc
1 parent f19e20f commit 3cc7ca6

File tree

5 files changed

+27
-2
lines changed

5 files changed

+27
-2
lines changed

Cargo.lock

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

meta/meta-node/Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,9 @@ fp-dynamic-fee = { git = "https://github.com/paritytech/frontier.git", branc
5353
fp-evm = { git = "https://github.com/paritytech/frontier.git", branch = "polkadot-v0.9.27" }
5454
fp-rpc = { git = "https://github.com/paritytech/frontier.git", branch = "polkadot-v0.9.27" }
5555
fp-storage = { git = "https://github.com/paritytech/frontier.git", branch = "polkadot-v0.9.27" }
56-
# local packages
57-
meta-runtime = { package = "meta-runtime", path = "../meta-runtime" }
56+
# Local
57+
meta-runtime = { package = "meta-runtime", path = "../meta-runtime" }
58+
meta-defichain-rpc = { package = "meta-defichain-rpc", path = "../meta-defichain/rpc"}
5859

5960
[build-dependencies]
6061
substrate-build-script-utils = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.27" }

meta/meta-node/src/rpc.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ where
112112
C::Api: substrate_frame_rpc_system::AccountNonceApi<Block, AccountId, Index>,
113113
C::Api: BlockBuilder<Block>,
114114
C::Api: pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi<Block, Balance>,
115+
C::Api: meta_defichain_rpc::DefichainRuntimeApi<Block>,
115116
C::Api: fp_rpc::ConvertTransactionRuntimeApi<Block>,
116117
C::Api: fp_rpc::EthereumRuntimeRPCApi<Block>,
117118
P: TransactionPool<Block = Block> + 'static,
@@ -121,6 +122,7 @@ where
121122
Eth, EthApiServer, EthDevSigner, EthFilter, EthFilterApiServer, EthPubSub,
122123
EthPubSubApiServer, EthSigner, Net, NetApiServer, Web3, Web3ApiServer,
123124
};
125+
use meta_defichain_rpc::{Defichain, DefichainApiServer};
124126
use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApiServer};
125127
use substrate_frame_rpc_system::{System, SystemApiServer};
126128

@@ -145,6 +147,7 @@ where
145147

146148
module.merge(System::new(client.clone(), pool.clone(), deny_unsafe).into_rpc())?;
147149
module.merge(TransactionPayment::new(client.clone()).into_rpc())?;
150+
module.merge(Defichain::new(client.clone()).into_rpc())?;
148151

149152
let mut signers = Vec::new();
150153
if enable_dev_signer {

meta/meta-runtime/Cargo.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ pallet-dynamic-fee = { default-features = false, git = "https://github.co
4141
pallet-ethereum = { default-features = false, git = "https://github.com/paritytech/frontier.git", branch = "polkadot-v0.9.27" }
4242
pallet-evm = { default-features = false, git = "https://github.com/paritytech/frontier.git", branch = "polkadot-v0.9.27" }
4343
pallet-evm-chain-id = { default-features = false, git = "https://github.com/paritytech/frontier.git", branch = "polkadot-v0.9.27" }
44+
# Local
45+
meta-defichain = { default-features = false, path = "../meta-defichain", package = "meta-defichain"}
46+
meta-defichain-rpc-runtime-api = { default-features = false, path = "../meta-defichain/rpc/runtime-api", package = "meta-defichain-rpc-runtime-api"}
4447

4548
[build-dependencies]
4649
substrate-wasm-builder = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.27" }
@@ -84,4 +87,7 @@ std = [
8487
"pallet-sudo/std",
8588
"pallet-timestamp/std",
8689
"pallet-transaction-payment/std",
90+
# Local
91+
"meta-defichain/std",
92+
"meta-defichain-rpc-runtime-api/std",
8793
]

meta/meta-runtime/src/lib.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,11 @@ impl pallet_transaction_payment::Config for Runtime {
312312
type FeeMultiplierUpdate = ();
313313
}
314314

315+
impl meta_defichain::Config for Runtime {
316+
type Event = Event;
317+
type Balance = Balance;
318+
}
319+
315320
construct_runtime!(
316321
pub enum Runtime where
317322
Block = Block,
@@ -328,6 +333,7 @@ construct_runtime!(
328333
EVMChainId: pallet_evm_chain_id,
329334
DynamicFee: pallet_dynamic_fee,
330335
BaseFee: pallet_base_fee,
336+
Defichain: meta_defichain,
331337
}
332338
);
333339

@@ -688,4 +694,10 @@ impl_runtime_apis! {
688694
)
689695
}
690696
}
697+
698+
impl meta_defichain_rpc_runtime_api::DefichainApi<Block> for Runtime {
699+
fn get_7() -> u64 {
700+
Defichain::get_7()
701+
}
702+
}
691703
}

0 commit comments

Comments
 (0)