1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
use std::sync::Arc;
use crate::{
client::DrmlClient,
service::{self, *},
};
use drml_primitives::OpaqueBlock as Block;
use pangolin_runtime::RuntimeApi;
pub struct Executor;
impl sc_executor::NativeExecutionDispatch for Executor {
type ExtendHostFunctions =
(frame_benchmarking::benchmarking::HostFunctions, dp_evm_trace_ext::dvm_ext::HostFunctions);
fn dispatch(method: &str, data: &[u8]) -> Option<Vec<u8>> {
pangolin_runtime::api::dispatch(method, data)
}
fn native_version() -> sc_executor::NativeVersion {
pangolin_runtime::native_version()
}
}
#[cfg(feature = "full-node")]
pub fn new_full(
config: sc_service::Configuration,
authority_discovery_disabled: bool,
eth_rpc_config: drml_rpc::EthRpcConfig,
) -> ServiceResult<(
sc_service::TaskManager,
Arc<impl DrmlClient<Block, FullBackend, RuntimeApi>>,
sc_service::RpcHandlers,
)> {
let (components, client, rpc_handlers) = service::new_full::<RuntimeApi, Executor>(
config,
authority_discovery_disabled,
eth_rpc_config,
)?;
Ok((components, client, rpc_handlers))
}