git.delta.rocks / unique-network / refs/commits / cc7c742e7c94

difftreelog

Merge pull request #322 from UniqueNetwork/release/opal-v918000

kozyrevdev2022-03-29parents: #80d5011 #c21a15c.patch.diff
in: master
Release v918000

12 files changed

modified.envdiffbeforeafterboth
--- a/.env
+++ b/.env
@@ -1,6 +1,6 @@
 RUST_TOOLCHAIN=nightly-2021-11-11
 RUST_C=1.58.0-nightly
-POLKA_VERSION=release-v0.9.17
+POLKA_VERSION=release-v0.9.18
 UNIQUE_BRANCH=develop
 USER=***
 PASS=***
modifiedCargo.lockdiffbeforeafterboth
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -5565,7 +5565,7 @@
 
 [[package]]
 name = "opal-runtime"
-version = "0.1.0"
+version = "0.9.18"
 dependencies = [
  "cumulus-pallet-aura-ext",
  "cumulus-pallet-dmp-queue",
@@ -8693,7 +8693,7 @@
 
 [[package]]
 name = "quartz-runtime"
-version = "0.1.0"
+version = "0.9.18"
 dependencies = [
  "cumulus-pallet-aura-ext",
  "cumulus-pallet-dmp-queue",
@@ -12402,7 +12402,7 @@
 
 [[package]]
 name = "unique-node"
-version = "0.9.17"
+version = "0.9.18"
 dependencies = [
  "clap",
  "cumulus-client-cli",
@@ -12534,7 +12534,7 @@
 
 [[package]]
 name = "unique-runtime"
-version = "0.9.17"
+version = "0.9.18"
 dependencies = [
  "cumulus-pallet-aura-ext",
  "cumulus-pallet-dmp-queue",
@@ -12610,7 +12610,7 @@
 
 [[package]]
 name = "unique-runtime-common"
-version = "0.1.0"
+version = "0.9.18"
 dependencies = [
  "fp-rpc",
  "frame-support",
modifiedREADME.mddiffbeforeafterboth
--- a/README.md
+++ b/README.md
@@ -63,12 +63,7 @@
 
 5. Build:
 ```bash
-cargo build
-```
-
-optionally, build in release:
-```bash
-cargo build --release
+cargo build --features=unique-runtime,quartz-runtime --release
 ```
 
 ## Building as Parachain locally
modifiednode/cli/Cargo.tomldiffbeforeafterboth
--- a/node/cli/Cargo.toml
+++ b/node/cli/Cargo.toml
@@ -283,7 +283,7 @@
 license = 'GPLv3'
 name = 'unique-node'
 repository = 'https://github.com/UniqueNetwork/unique-chain'
-version = '0.9.17'
+version = '0.9.18'
 
 [[bin]]
 name = 'unique-collator'
@@ -312,7 +312,7 @@
 unique-rpc = { default-features = false, path = "../rpc" }
 
 [features]
-default = ["unique-runtime", "quartz-runtime"]
+default = []
 runtime-benchmarks = [
     'unique-runtime/runtime-benchmarks',
     'polkadot-service/runtime-benchmarks',
modifiednode/cli/src/chain_spec.rsdiffbeforeafterboth
before · node/cli/src/chain_spec.rs
1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617use cumulus_primitives_core::ParaId;18use sc_chain_spec::{ChainSpecExtension, ChainSpecGroup};19use sc_service::ChainType;20use sp_core::{sr25519, Pair, Public};21use sp_runtime::traits::{IdentifyAccount, Verify};22use std::collections::BTreeMap;2324use serde::{Deserialize, Serialize};25use serde_json::map::Map;2627use unique_runtime_common::types::*;2829/// The `ChainSpec` parameterized for the unique runtime.30#[cfg(feature = "unique-runtime")]31pub type UniqueChainSpec = sc_service::GenericChainSpec<unique_runtime::GenesisConfig, Extensions>;3233/// The `ChainSpec` parameterized for the quartz runtime.34#[cfg(feature = "quartz-runtime")]35pub type QuartzChainSpec = sc_service::GenericChainSpec<quartz_runtime::GenesisConfig, Extensions>;3637/// The `ChainSpec` parameterized for the opal runtime.38pub type OpalChainSpec = sc_service::GenericChainSpec<opal_runtime::GenesisConfig, Extensions>;3940pub enum RuntimeId {41	#[cfg(feature = "unique-runtime")]42	Unique,4344	#[cfg(feature = "quartz-runtime")]45	Quartz,4647	Opal,48	Unknown(String),49}5051pub trait RuntimeIdentification {52	fn runtime_id(&self) -> RuntimeId;53}5455impl RuntimeIdentification for Box<dyn sc_service::ChainSpec> {56	fn runtime_id(&self) -> RuntimeId {57		#[cfg(feature = "unique-runtime")]58		if self.id().starts_with("unique") {59			return RuntimeId::Unique;60		}6162		#[cfg(feature = "quartz-runtime")]63		if self.id().starts_with("quartz") {64			return RuntimeId::Quartz;65		}6667		if self.id().starts_with("opal") || self.id() == "dev" || self.id() == "local_testnet" {68			return RuntimeId::Opal;69		}7071		RuntimeId::Unknown(self.id().into())72	}73}7475pub enum ServiceId {76	Prod,77	Dev,78}7980pub trait ServiceIdentification {81	fn service_id(&self) -> ServiceId;82}8384impl ServiceIdentification for Box<dyn sc_service::ChainSpec> {85	fn service_id(&self) -> ServiceId {86		if self.id().ends_with("dev") {87			ServiceId::Dev88		} else {89			ServiceId::Prod90		}91	}92}9394/// Helper function to generate a crypto pair from seed95pub fn get_from_seed<TPublic: Public>(seed: &str) -> <TPublic::Pair as Pair>::Public {96	TPublic::Pair::from_string(&format!("//{}", seed), None)97		.expect("static values are valid; qed")98		.public()99}100101/// The extensions for the [`ChainSpec`].102#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ChainSpecGroup, ChainSpecExtension)]103#[serde(deny_unknown_fields)]104pub struct Extensions {105	/// The relay chain of the Parachain.106	pub relay_chain: String,107	/// The id of the Parachain.108	pub para_id: u32,109}110111impl Extensions {112	/// Try to get the extension from the given `ChainSpec`.113	pub fn try_get(chain_spec: &dyn sc_service::ChainSpec) -> Option<&Self> {114		sc_chain_spec::get_extension(chain_spec.extensions())115	}116}117118type AccountPublic = <Signature as Verify>::Signer;119120/// Helper function to generate an account ID from seed121pub fn get_account_id_from_seed<TPublic: Public>(seed: &str) -> AccountId122where123	AccountPublic: From<<TPublic::Pair as Pair>::Public>,124{125	AccountPublic::from(get_from_seed::<TPublic>(seed)).into_account()126}127128pub fn development_config() -> OpalChainSpec {129	let mut properties = Map::new();130	properties.insert("tokenSymbol".into(), "OPL".into());131	properties.insert("tokenDecimals".into(), 15.into());132	properties.insert("ss58Format".into(), 42.into());133134	OpalChainSpec::from_genesis(135		// Name136		"Development",137		// ID138		"dev",139		ChainType::Local,140		move || {141			testnet_genesis(142				// Sudo account143				get_account_id_from_seed::<sr25519::Public>("Alice"),144				vec![145					get_from_seed::<AuraId>("Alice"),146					get_from_seed::<AuraId>("Bob"),147				],148				// Pre-funded accounts149				vec![150					get_account_id_from_seed::<sr25519::Public>("Alice"),151					get_account_id_from_seed::<sr25519::Public>("Bob"),152				],153				1000.into(),154			)155		},156		// Bootnodes157		vec![],158		// Telemetry159		None,160		// Protocol ID161		None,162		None,163		// Properties164		Some(properties),165		// Extensions166		Extensions {167			relay_chain: "rococo-dev".into(),168			para_id: 1000,169		},170	)171}172173pub fn local_testnet_rococo_config() -> OpalChainSpec {174	OpalChainSpec::from_genesis(175		// Name176		"Local Testnet",177		// ID178		"local_testnet",179		ChainType::Local,180		move || {181			testnet_genesis(182				// Sudo account183				get_account_id_from_seed::<sr25519::Public>("Alice"),184				vec![185					get_from_seed::<AuraId>("Alice"),186					get_from_seed::<AuraId>("Bob"),187				],188				// Pre-funded accounts189				vec![190					get_account_id_from_seed::<sr25519::Public>("Alice"),191					get_account_id_from_seed::<sr25519::Public>("Bob"),192					get_account_id_from_seed::<sr25519::Public>("Charlie"),193					get_account_id_from_seed::<sr25519::Public>("Dave"),194					get_account_id_from_seed::<sr25519::Public>("Eve"),195					get_account_id_from_seed::<sr25519::Public>("Ferdie"),196					get_account_id_from_seed::<sr25519::Public>("Alice//stash"),197					get_account_id_from_seed::<sr25519::Public>("Bob//stash"),198					get_account_id_from_seed::<sr25519::Public>("Charlie//stash"),199					get_account_id_from_seed::<sr25519::Public>("Dave//stash"),200					get_account_id_from_seed::<sr25519::Public>("Eve//stash"),201					get_account_id_from_seed::<sr25519::Public>("Ferdie//stash"),202				],203				1000.into(),204			)205		},206		// Bootnodes207		vec![],208		// Telemetry209		None,210		// Protocol ID211		None,212		None,213		// Properties214		None,215		// Extensions216		Extensions {217			relay_chain: "rococo-local".into(),218			para_id: 1000,219		},220	)221}222223fn testnet_genesis(224	root_key: AccountId,225	initial_authorities: Vec<AuraId>,226	endowed_accounts: Vec<AccountId>,227	id: ParaId,228) -> opal_runtime::GenesisConfig {229	use opal_runtime::*;230231	GenesisConfig {232		system: SystemConfig {233			code: WASM_BINARY234				.expect("WASM binary was not build, please build it!")235				.to_vec(),236		},237		balances: BalancesConfig {238			balances: endowed_accounts239				.iter()240				.cloned()241				// 1e13 UNQ242				.map(|k| (k, 1 << 100))243				.collect(),244		},245		treasury: Default::default(),246		sudo: SudoConfig {247			key: Some(root_key),248		},249		vesting: VestingConfig { vesting: vec![] },250		parachain_info: ParachainInfoConfig { parachain_id: id },251		parachain_system: Default::default(),252		aura: AuraConfig {253			authorities: initial_authorities,254		},255		aura_ext: Default::default(),256		evm: EVMConfig {257			accounts: BTreeMap::new(),258		},259		ethereum: EthereumConfig {},260	}261}
after · node/cli/src/chain_spec.rs
1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617use cumulus_primitives_core::ParaId;18use sc_chain_spec::{ChainSpecExtension, ChainSpecGroup};19use sc_service::ChainType;20use sp_core::{sr25519, Pair, Public};21use sp_runtime::traits::{IdentifyAccount, Verify};22use std::collections::BTreeMap;2324use serde::{Deserialize, Serialize};25use serde_json::map::Map;2627use unique_runtime_common::types::*;2829/// The `ChainSpec` parameterized for the unique runtime.30#[cfg(feature = "unique-runtime")]31pub type UniqueChainSpec = sc_service::GenericChainSpec<unique_runtime::GenesisConfig, Extensions>;3233/// The `ChainSpec` parameterized for the quartz runtime.34#[cfg(feature = "quartz-runtime")]35pub type QuartzChainSpec = sc_service::GenericChainSpec<quartz_runtime::GenesisConfig, Extensions>;3637/// The `ChainSpec` parameterized for the opal runtime.38pub type OpalChainSpec = sc_service::GenericChainSpec<opal_runtime::GenesisConfig, Extensions>;3940pub enum RuntimeId {41	#[cfg(feature = "unique-runtime")]42	Unique,4344	#[cfg(feature = "quartz-runtime")]45	Quartz,4647	Opal,48	Unknown(String),49}5051pub trait RuntimeIdentification {52	fn runtime_id(&self) -> RuntimeId;53}5455impl RuntimeIdentification for Box<dyn sc_service::ChainSpec> {56	fn runtime_id(&self) -> RuntimeId {57		#[cfg(feature = "unique-runtime")]58		if self.id().starts_with("unique") {59			return RuntimeId::Unique;60		}6162		#[cfg(feature = "quartz-runtime")]63		if self.id().starts_with("quartz") {64			return RuntimeId::Quartz;65		}6667		if self.id().starts_with("opal") || self.id() == "dev" || self.id() == "local_testnet" {68			return RuntimeId::Opal;69		}7071		RuntimeId::Unknown(self.id().into())72	}73}7475pub enum ServiceId {76	Prod,77	Dev,78}7980pub trait ServiceIdentification {81	fn service_id(&self) -> ServiceId;82}8384impl ServiceIdentification for Box<dyn sc_service::ChainSpec> {85	fn service_id(&self) -> ServiceId {86		if self.id().ends_with("dev") {87			ServiceId::Dev88		} else {89			ServiceId::Prod90		}91	}92}9394/// Helper function to generate a crypto pair from seed95pub fn get_from_seed<TPublic: Public>(seed: &str) -> <TPublic::Pair as Pair>::Public {96	TPublic::Pair::from_string(&format!("//{}", seed), None)97		.expect("static values are valid; qed")98		.public()99}100101/// The extensions for the [`ChainSpec`].102#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ChainSpecGroup, ChainSpecExtension)]103#[serde(deny_unknown_fields)]104pub struct Extensions {105	/// The relay chain of the Parachain.106	pub relay_chain: String,107	/// The id of the Parachain.108	pub para_id: u32,109}110111impl Extensions {112	/// Try to get the extension from the given `ChainSpec`.113	pub fn try_get(chain_spec: &dyn sc_service::ChainSpec) -> Option<&Self> {114		sc_chain_spec::get_extension(chain_spec.extensions())115	}116}117118type AccountPublic = <Signature as Verify>::Signer;119120/// Helper function to generate an account ID from seed121pub fn get_account_id_from_seed<TPublic: Public>(seed: &str) -> AccountId122where123	AccountPublic: From<<TPublic::Pair as Pair>::Public>,124{125	AccountPublic::from(get_from_seed::<TPublic>(seed)).into_account()126}127128pub fn development_config() -> OpalChainSpec {129	let mut properties = Map::new();130	properties.insert("tokenSymbol".into(), "OPL".into());131	properties.insert("tokenDecimals".into(), 18.into());132	properties.insert("ss58Format".into(), 42.into());133134	OpalChainSpec::from_genesis(135		// Name136		"OPAL by UNIQUE",137		// ID138		"opal_dev",139		ChainType::Local,140		move || {141			testnet_genesis(142				// Sudo account143				get_account_id_from_seed::<sr25519::Public>("Alice"),144				vec![145					get_from_seed::<AuraId>("Alice"),146					get_from_seed::<AuraId>("Bob"),147				],148				// Pre-funded accounts149				vec![150					get_account_id_from_seed::<sr25519::Public>("Alice"),151					get_account_id_from_seed::<sr25519::Public>("Bob"),152				],153				1000.into(),154			)155		},156		// Bootnodes157		vec![],158		// Telemetry159		None,160		// Protocol ID161		None,162		None,163		// Properties164		Some(properties),165		// Extensions166		Extensions {167			relay_chain: "rococo-dev".into(),168			para_id: 1000,169		},170	)171}172173pub fn local_testnet_rococo_config() -> OpalChainSpec {174	let mut properties = Map::new();175	properties.insert("tokenSymbol".into(), "OPL".into());176	properties.insert("tokenDecimals".into(), 18.into());177	properties.insert("ss58Format".into(), 42.into());178179	OpalChainSpec::from_genesis(180		// Name181		"OPAL by UNIQUE",182		// ID183		"opal_local",184		ChainType::Local,185		move || {186			testnet_genesis(187				// Sudo account188				get_account_id_from_seed::<sr25519::Public>("Alice"),189				vec![190					get_from_seed::<AuraId>("Alice"),191					get_from_seed::<AuraId>("Bob"),192				],193				// Pre-funded accounts194				vec![195					get_account_id_from_seed::<sr25519::Public>("Alice"),196					get_account_id_from_seed::<sr25519::Public>("Bob"),197					get_account_id_from_seed::<sr25519::Public>("Charlie"),198					get_account_id_from_seed::<sr25519::Public>("Dave"),199					get_account_id_from_seed::<sr25519::Public>("Eve"),200					get_account_id_from_seed::<sr25519::Public>("Ferdie"),201					get_account_id_from_seed::<sr25519::Public>("Alice//stash"),202					get_account_id_from_seed::<sr25519::Public>("Bob//stash"),203					get_account_id_from_seed::<sr25519::Public>("Charlie//stash"),204					get_account_id_from_seed::<sr25519::Public>("Dave//stash"),205					get_account_id_from_seed::<sr25519::Public>("Eve//stash"),206					get_account_id_from_seed::<sr25519::Public>("Ferdie//stash"),207				],208				1000.into(),209			)210		},211		// Bootnodes212		vec![],213		// Telemetry214		None,215		// Protocol ID216		None,217		None,218		// Properties219		Some(properties),220		// Extensions221		Extensions {222			relay_chain: "rococo-local".into(),223			para_id: 1000,224		},225	)226}227228fn testnet_genesis(229	root_key: AccountId,230	initial_authorities: Vec<AuraId>,231	endowed_accounts: Vec<AccountId>,232	id: ParaId,233) -> opal_runtime::GenesisConfig {234	use opal_runtime::*;235236	GenesisConfig {237		system: SystemConfig {238			code: WASM_BINARY239				.expect("WASM binary was not build, please build it!")240				.to_vec(),241		},242		balances: BalancesConfig {243			balances: endowed_accounts244				.iter()245				.cloned()246				// 1e13 UNQ247				.map(|k| (k, 1 << 100))248				.collect(),249		},250		treasury: Default::default(),251		sudo: SudoConfig {252			key: Some(root_key),253		},254		vesting: VestingConfig { vesting: vec![] },255		parachain_info: ParachainInfoConfig { parachain_id: id },256		parachain_system: Default::default(),257		aura: AuraConfig {258			authorities: initial_authorities,259		},260		aura_ext: Default::default(),261		evm: EVMConfig {262			accounts: BTreeMap::new(),263		},264		ethereum: EthereumConfig {},265	}266}
modifiedruntime/common/Cargo.tomldiffbeforeafterboth
--- a/runtime/common/Cargo.toml
+++ b/runtime/common/Cargo.toml
@@ -6,7 +6,7 @@
 license = 'All Rights Reserved'
 name = 'unique-runtime-common'
 repository = 'https://github.com/UniqueNetwork/unique-chain'
-version = '0.1.0'
+version = '0.9.18'
 
 [features]
 default = ['std']
modifiedruntime/opal/Cargo.tomldiffbeforeafterboth
--- a/runtime/opal/Cargo.toml
+++ b/runtime/opal/Cargo.toml
@@ -10,7 +10,7 @@
 license = 'GPLv3'
 name = 'opal-runtime'
 repository = 'https://github.com/UniqueNetwork/unique-chain'
-version = '0.1.0'
+version = '0.9.18'
 
 [package.metadata.docs.rs]
 targets = ['x86_64-unknown-linux-gnu']
modifiedruntime/opal/src/lib.rsdiffbeforeafterboth
--- a/runtime/opal/src/lib.rs
+++ b/runtime/opal/src/lib.rs
@@ -114,7 +114,7 @@
 
 use unique_runtime_common::{impl_common_runtime_apis, types::*, constants::*};
 
-pub const RUNTIME_NAME: &str = "Opal";
+pub const RUNTIME_NAME: &str = "opal";
 
 type CrossAccountId = pallet_common::account::BasicCrossAccountId<Runtime>;
 
@@ -151,7 +151,7 @@
 	spec_name: create_runtime_str!(RUNTIME_NAME),
 	impl_name: create_runtime_str!(RUNTIME_NAME),
 	authoring_version: 1,
-	spec_version: 917004,
+	spec_version: 918000,
 	impl_version: 0,
 	apis: RUNTIME_API_VERSIONS,
 	transaction_version: 1,
modifiedruntime/quartz/Cargo.tomldiffbeforeafterboth
--- a/runtime/quartz/Cargo.toml
+++ b/runtime/quartz/Cargo.toml
@@ -10,7 +10,7 @@
 license = 'GPLv3'
 name = 'quartz-runtime'
 repository = 'https://github.com/UniqueNetwork/unique-chain'
-version = '0.1.0'
+version = '0.9.18'
 
 [package.metadata.docs.rs]
 targets = ['x86_64-unknown-linux-gnu']
modifiedruntime/quartz/src/lib.rsdiffbeforeafterboth
--- a/runtime/quartz/src/lib.rs
+++ b/runtime/quartz/src/lib.rs
@@ -114,7 +114,7 @@
 
 use unique_runtime_common::{impl_common_runtime_apis, types::*, constants::*};
 
-pub const RUNTIME_NAME: &str = "Quartz";
+pub const RUNTIME_NAME: &str = "quartz";
 
 type CrossAccountId = pallet_common::account::BasicCrossAccountId<Runtime>;
 
@@ -151,7 +151,7 @@
 	spec_name: create_runtime_str!(RUNTIME_NAME),
 	impl_name: create_runtime_str!(RUNTIME_NAME),
 	authoring_version: 1,
-	spec_version: 917004,
+	spec_version: 918000,
 	impl_version: 0,
 	apis: RUNTIME_API_VERSIONS,
 	transaction_version: 1,
modifiedruntime/unique/Cargo.tomldiffbeforeafterboth
--- a/runtime/unique/Cargo.toml
+++ b/runtime/unique/Cargo.toml
@@ -10,7 +10,7 @@
 license = 'GPLv3'
 name = 'unique-runtime'
 repository = 'https://github.com/UniqueNetwork/unique-chain'
-version = '0.9.17'
+version = '0.9.18'
 
 [package.metadata.docs.rs]
 targets = ['x86_64-unknown-linux-gnu']
modifiedruntime/unique/src/lib.rsdiffbeforeafterboth
--- a/runtime/unique/src/lib.rs
+++ b/runtime/unique/src/lib.rs
@@ -113,7 +113,7 @@
 
 use unique_runtime_common::{impl_common_runtime_apis, types::*, constants::*};
 
-pub const RUNTIME_NAME: &str = "Unique";
+pub const RUNTIME_NAME: &str = "unique";
 
 type CrossAccountId = pallet_common::account::BasicCrossAccountId<Runtime>;
 
@@ -150,7 +150,7 @@
 	spec_name: create_runtime_str!(RUNTIME_NAME),
 	impl_name: create_runtime_str!(RUNTIME_NAME),
 	authoring_version: 1,
-	spec_version: 917004,
+	spec_version: 918000,
 	impl_version: 0,
 	apis: RUNTIME_API_VERSIONS,
 	transaction_version: 1,