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

Commit

Permalink
install meta-defichain rpc
Browse files Browse the repository at this point in the history
  • Loading branch information
canonbrother committed Nov 1, 2022
1 parent 9ab07c6 commit 2ae956d
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 2 deletions.
3 changes: 3 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions meta/meta-node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ fp-dynamic-fee = { git = "https://github.com/paritytech/frontier.git", branc
fp-evm = { git = "https://github.com/paritytech/frontier.git", branch = "polkadot-v0.9.27" }
fp-rpc = { git = "https://github.com/paritytech/frontier.git", branch = "polkadot-v0.9.27" }
fp-storage = { git = "https://github.com/paritytech/frontier.git", branch = "polkadot-v0.9.27" }
# local packages
meta-runtime = { package = "meta-runtime", path = "../meta-runtime" }
# Local
meta-runtime = { package = "meta-runtime", path = "../meta-runtime" }
meta-defichain-rpc = { package = "meta-defichain-rpc", path = "../meta-defichain/rpc"}

[build-dependencies]
substrate-build-script-utils = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.27" }
Expand Down
3 changes: 3 additions & 0 deletions meta/meta-node/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ where
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: meta_defichain_rpc::DefichainRuntimeApi<Block>,
C::Api: fp_rpc::ConvertTransactionRuntimeApi<Block>,
C::Api: fp_rpc::EthereumRuntimeRPCApi<Block>,
P: TransactionPool<Block = Block> + 'static,
Expand All @@ -121,6 +122,7 @@ where
Eth, EthApiServer, EthDevSigner, EthFilter, EthFilterApiServer, EthPubSub,
EthPubSubApiServer, EthSigner, Net, NetApiServer, Web3, Web3ApiServer,
};
use meta_defichain_rpc::{Defichain, DefichainApiServer};
use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApiServer};
use substrate_frame_rpc_system::{System, SystemApiServer};

Expand All @@ -145,6 +147,7 @@ where

module.merge(System::new(client.clone(), pool.clone(), deny_unsafe).into_rpc())?;
module.merge(TransactionPayment::new(client.clone()).into_rpc())?;
module.merge(Defichain::new(client.clone()).into_rpc())?;

let mut signers = Vec::new();
if enable_dev_signer {
Expand Down
6 changes: 6 additions & 0 deletions meta/meta-runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ pallet-dynamic-fee = { default-features = false, git = "https://github.co
pallet-ethereum = { default-features = false, git = "https://github.com/paritytech/frontier.git", branch = "polkadot-v0.9.27" }
pallet-evm = { default-features = false, git = "https://github.com/paritytech/frontier.git", branch = "polkadot-v0.9.27" }
pallet-evm-chain-id = { default-features = false, git = "https://github.com/paritytech/frontier.git", branch = "polkadot-v0.9.27" }
# Local
meta-defichain = { default-features = false, path = "../meta-defichain", package = "meta-defichain"}
meta-defichain-rpc-runtime-api = { default-features = false, path = "../meta-defichain/rpc/runtime-api", package = "meta-defichain-rpc-runtime-api"}

[build-dependencies]
substrate-wasm-builder = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.27" }
Expand Down Expand Up @@ -84,4 +87,7 @@ std = [
"pallet-sudo/std",
"pallet-timestamp/std",
"pallet-transaction-payment/std",
# Local
"meta-defichain/std",
"meta-defichain-rpc-runtime-api/std",
]
12 changes: 12 additions & 0 deletions meta/meta-runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,11 @@ impl pallet_transaction_payment::Config for Runtime {
type FeeMultiplierUpdate = ();
}

impl meta_defichain::Config for Runtime {
type Event = Event;
type Balance = Balance;
}

construct_runtime!(
pub enum Runtime where
Block = Block,
Expand All @@ -328,6 +333,7 @@ construct_runtime!(
EVMChainId: pallet_evm_chain_id,
DynamicFee: pallet_dynamic_fee,
BaseFee: pallet_base_fee,
Defichain: meta_defichain,
}
);

Expand Down Expand Up @@ -688,4 +694,10 @@ impl_runtime_apis! {
)
}
}

impl meta_defichain_rpc_runtime_api::DefichainApi<Block> for Runtime {
fn get_7() -> u64 {
Defichain::get_7()
}
}
}

0 comments on commit 2ae956d

Please sign in to comment.