difftreelog
Adjust node to new runtimes
in: master
6 files changed
node/cli/Cargo.tomldiffbeforeafterboth239# Local dependencies239# Local dependencies240240241[dependencies.unique-runtime]241[dependencies.unique-runtime]242path = '../../runtime'242path = '../../runtime/unique'243optional = true244245[dependencies.quartz-runtime]246path = '../../runtime/quartz'247optional = true248249[dependencies.opal-runtime]250path = '../../runtime/opal'251optional = true243252244[dependencies.up-data-structs]253[dependencies.up-data-structs]245path = "../../primitives/data-structs"254path = "../../primitives/data-structs"283fp-rpc = { git = "https://github.com/uniquenetwork/frontier.git", branch = "unique-polkadot-v0.9.17" }292fp-rpc = { git = "https://github.com/uniquenetwork/frontier.git", branch = "unique-polkadot-v0.9.17" }284pallet-ethereum = { git = "https://github.com/uniquenetwork/frontier.git", branch = "unique-polkadot-v0.9.17" }293pallet-ethereum = { git = "https://github.com/uniquenetwork/frontier.git", branch = "unique-polkadot-v0.9.17" }285294286unique-rpc = { path = "../rpc" }295unique-rpc = { default-features = false, path = "../rpc" }287296288[features]297[features]289default = []298default = ["unique-runtime"]290runtime-benchmarks = [299runtime-benchmarks = [291 'unique-runtime/runtime-benchmarks',300 'unique-runtime/runtime-benchmarks',292 'polkadot-service/runtime-benchmarks',301 'polkadot-service/runtime-benchmarks',node/cli/src/chain_spec.rsdiffbeforeafterboth15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.161617use cumulus_primitives_core::ParaId;17use cumulus_primitives_core::ParaId;18use unique_runtime::*;19use sc_chain_spec::{ChainSpecExtension, ChainSpecGroup};18use sc_chain_spec::{ChainSpecExtension, ChainSpecGroup};20use sc_service::ChainType;19use sc_service::ChainType;21use sp_core::{sr25519, Pair, Public};20use sp_core::{sr25519, Pair, Public};25use serde::{Deserialize, Serialize};24use serde::{Deserialize, Serialize};26use serde_json::map::Map;25use serde_json::map::Map;2627#[cfg(feature = "unique-runtime")]28use unique_runtime as runtime;2930#[cfg(feature = "quartz-runtime")]31use quartz_runtime as runtime;3233#[cfg(feature = "opal-runtime")]34use opal_runtime as runtime;3536use runtime::{*, opaque::*};273728/// Specialized `ChainSpec`. This is a specialization of the general Substrate ChainSpec type.38/// Specialized `ChainSpec`. This is a specialization of the general Substrate ChainSpec type.29pub type ChainSpec = sc_service::GenericChainSpec<unique_runtime::GenesisConfig, Extensions>;39pub type ChainSpec = sc_service::GenericChainSpec<runtime::GenesisConfig, Extensions>;304031/// Helper function to generate a crypto pair from seed41/// Helper function to generate a crypto pair from seed32pub fn get_from_seed<TPublic: Public>(seed: &str) -> <TPublic::Pair as Pair>::Public {42pub fn get_from_seed<TPublic: Public>(seed: &str) -> <TPublic::Pair as Pair>::Public {217 id: ParaId,227 id: ParaId,218) -> GenesisConfig {228) -> GenesisConfig {219 GenesisConfig {229 GenesisConfig {220 system: unique_runtime::SystemConfig {230 system: runtime::SystemConfig {221 code: unique_runtime::WASM_BINARY231 code: runtime::WASM_BINARY222 .expect("WASM binary was not build, please build it!")232 .expect("WASM binary was not build, please build it!")223 .to_vec(),233 .to_vec(),224 },234 },235 key: Some(root_key),245 key: Some(root_key),236 },246 },237 vesting: VestingConfig { vesting: vec![] },247 vesting: VestingConfig { vesting: vec![] },238 parachain_info: unique_runtime::ParachainInfoConfig { parachain_id: id },248 parachain_info: runtime::ParachainInfoConfig { parachain_id: id },239 parachain_system: Default::default(),249 parachain_system: Default::default(),240 aura: unique_runtime::AuraConfig {250 aura: runtime::AuraConfig {241 authorities: initial_authorities,251 authorities: initial_authorities,242 },252 },243 aura_ext: Default::default(),253 aura_ext: Default::default(),node/cli/src/command.rsdiffbeforeafterboth41use cumulus_primitives_core::ParaId;41use cumulus_primitives_core::ParaId;42use cumulus_client_service::genesis::generate_genesis_block;42use cumulus_client_service::genesis::generate_genesis_block;43use log::info;43use log::info;44use unique_runtime::Block;45use polkadot_parachain::primitives::AccountIdConversion;44use polkadot_parachain::primitives::AccountIdConversion;46use sc_cli::{45use sc_cli::{47 ChainSpec, CliConfiguration, DefaultConfigurationValues, ImportParams, KeystoreParams,46 ChainSpec, CliConfiguration, DefaultConfigurationValues, ImportParams, KeystoreParams,54use sp_runtime::traits::Block as BlockT;53use sp_runtime::traits::Block as BlockT;55use std::{io::Write, net::SocketAddr};54use std::{io::Write, net::SocketAddr};5556#[cfg(feature = "unique-runtime")]57use unique_runtime as runtime;5859#[cfg(feature = "quartz-runtime")]60use quartz_runtime as runtime;6162#[cfg(feature = "opal-runtime")]63use opal_runtime as runtime;6465use runtime::Block;566657fn load_spec(id: &str) -> std::result::Result<Box<dyn sc_service::ChainSpec>, String> {67fn load_spec(id: &str) -> std::result::Result<Box<dyn sc_service::ChainSpec>, String> {58 Ok(match id {68 Ok(match id {104 }114 }105115106 fn native_runtime_version(_: &Box<dyn ChainSpec>) -> &'static RuntimeVersion {116 fn native_runtime_version(_: &Box<dyn ChainSpec>) -> &'static RuntimeVersion {107 &unique_runtime::VERSION117 &runtime::VERSION108 }118 }109}119}110120node/cli/src/service.rsdiffbeforeafterboth262627use unique_rpc::overrides_handle;27use unique_rpc::overrides_handle;28// Local Runtime Types28// Local Runtime Types29#[cfg(feature = "unique-runtime")]30use unique_runtime as runtime;3132#[cfg(feature = "quartz-runtime")]33use quartz_runtime as runtime;3435#[cfg(feature = "opal-runtime")]36use opal_runtime as runtime;3729use unique_runtime::RuntimeApi;38use runtime::RuntimeApi;303931// Cumulus Imports40// Cumulus Imports32use cumulus_client_consensus_aura::{AuraConsensus, BuildAuraConsensusParams, SlotProportion};41use cumulus_client_consensus_aura::{AuraConsensus, BuildAuraConsensusParams, SlotProportion};69 type ExtendHostFunctions = frame_benchmarking::benchmarking::HostFunctions;78 type ExtendHostFunctions = frame_benchmarking::benchmarking::HostFunctions;707971 fn dispatch(method: &str, data: &[u8]) -> Option<Vec<u8>> {80 fn dispatch(method: &str, data: &[u8]) -> Option<Vec<u8>> {72 unique_runtime::api::dispatch(method, data)81 runtime::api::dispatch(method, data)73 }82 }748375 fn native_version() -> sc_executor::NativeVersion {84 fn native_version() -> sc_executor::NativeVersion {76 unique_runtime::native_version()85 runtime::native_version()77 }86 }78}87}7988node/rpc/Cargo.tomldiffbeforeafterboth51pallet-unique = { path = "../../pallets/unique" }51pallet-unique = { path = "../../pallets/unique" }52uc-rpc = { path = "../../client/rpc" }52uc-rpc = { path = "../../client/rpc" }53up-rpc = { path = "../../primitives/rpc" }53up-rpc = { path = "../../primitives/rpc" }54unique-runtime = { path = "../../runtime" }54unique-runtime = { path = "../../runtime/unique", optional = true }55quartz-runtime = { path = "../../runtime/quartz", optional = true }56opal-runtime = { path = "../../runtime/opal", optional = true }555756[features]58[features]59default = ["unique-runtime"]57std = []60std = []5861node/rpc/src/lib.rsdiffbeforeafterboth15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.161617use sp_runtime::traits::BlakeTwo256;17use sp_runtime::traits::BlakeTwo256;18use unique_runtime::{Hash, AccountId, CrossAccountId, Index, opaque::Block, BlockNumber, Balance};19use fc_rpc::{18use fc_rpc::{20 EthBlockDataCache, OverrideHandle, RuntimeApiStorageOverride, SchemaV1Override,19 EthBlockDataCache, OverrideHandle, RuntimeApiStorageOverride, SchemaV1Override,21 StorageOverride, SchemaV2Override, SchemaV3Override,20 StorageOverride, SchemaV2Override, SchemaV3Override,41use sc_service::TransactionPool;40use sc_service::TransactionPool;42use std::{collections::BTreeMap, marker::PhantomData, sync::Arc};41use std::{collections::BTreeMap, marker::PhantomData, sync::Arc};4243#[cfg(feature = "unique-runtime")]44use unique_runtime as runtime;4546#[cfg(feature = "quartz-runtime")]47use quartz_runtime as runtime;4849#[cfg(feature = "opal-runtime")]50use opal_runtime as runtime;5152use runtime::opaque::{Hash, AccountId, CrossAccountId, Index, Block, BlockNumber, Balance};435344/// Public io handler for exporting into other modules54/// Public io handler for exporting into other modules45pub type IoHandler = jsonrpc_core::IoHandler<sc_rpc::Metadata>;55pub type IoHandler = jsonrpc_core::IoHandler<sc_rpc::Metadata>;231 client.clone(),241 client.clone(),232 pool.clone(),242 pool.clone(),233 graph,243 graph,234 unique_runtime::TransactionConverter,244 runtime::TransactionConverter,235 network.clone(),245 network.clone(),236 signers,246 signers,237 overrides.clone(),247 overrides.clone(),