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

difftreelog

merge master

Igor Kozyrev2022-03-30parents: #c21a15c #17c0e89.patch.diff
in: master

10 files changed

modifiedREADME.mddiffbeforeafterboth
before · README.md
1![Docker build](https://github.com/usetech-llc/nft_parachain/workflows/Docker%20build/badge.svg)23# Unique Parachain45## Project Description67The Unique Pallet is the core of NFT functionality. Like ERC-721 standard in Ethereum ecosystem, this pallet provides the8basement for creating collections of unique non-divisible things, also called Non Fungible Tokens (NFTs), minting NFT of9a given Collection, and managing their ownership.1011The pallet also enables storing NFT properties. Though (according to ERC-721) NFT properties belong to logic of a12concrete application that operates a Collection, so purposefully the NFT Tracking Module does not have any knowledge13about properties except their byte size leaving application logic out to be controlled by Smart Contracts.1415The Unique Chain also provides:1617-   Smart Contracts Pallet and example smart contract that interacts with Unique Runtime18-   ERC-1155 Functionality (currently PoC as Re-Fungible tokens, i.e. items that are still unique, but that can be split19    between multiple users)20-   Variety of economic options for dapp producers to choose from to create freemium games and other ways to attract21    users. As a step one, we implemented an economic model when a collection sponsor can be set to pay for collection22    Transfer transactions.2324Wider Unique Ecosystem (most of it was developed during Hackusama):2526-   [SubstraPunks Game hosted on IPFS](https://github.com/usetech-llc/substrapunks)27-   [Unique Wallet and UI](https://uniqueapps.usetech.com/#/nft)28-   [NFT Asset for Unity Framework](https://github.com/usetech-llc/nft_unity)2930Please see our [walk-through instructions](doc/hackusama_walk_through.md) to try everything out!3132## Application Development3334If you are building an application that operates NFT tokens, use [this document](doc/application_development.md).353637## Building3839Building Unique chain requires special versions of Rust and toolchain. We don't use the most recent versions of everything40so that we can keep the builds stable.41421. Install Rust:4344```bash45sudo apt-get install git curl libssl-dev llvm pkg-config libclang-dev clang46curl https://sh.rustup.rs -sSf | sh47```48492. Remove all installed toolchains with `rustup toolchain list` and `rustup toolchain uninstall <toolchain>`.50513. Install install nightly 2021-11-11 and make it default:5253```bash54rustup toolchain install nightly-2021-11-1155rustup default nightly-2021-11-1156```57584. Add wasm target for nightly toolchain:5960```bash61rustup target add wasm32-unknown-unknown --toolchain nightly-2021-11-1162```63645. Build:65```bash66cargo build --features=unique-runtime,quartz-runtime --release67```6869## Building as Parachain locally7071Note: checkout this project and all related projects (see below) in the sibling folders (both under the same folder)7273### Polkadot launch utility7475```76git clone https://github.com/paritytech/polkadot-launch77```7879### Build relay8081```82git clone https://github.com/paritytech/polkadot.git83cd polkadot84git checkout release-v0.9.1885cargo build --release86```8788### Build Unique parachain8990Run in the root of this project:91```92cargo build --release93```9495### Build Acala parachain (optional, full config only)9697```98git clone https://github.com/AcalaNetwork/Acala99cd Acala100git checkout 54db3acd409a0b787f116f20e163a3b24101ce38101make build-release102```103104## Running as Parachain locally105106```107./launch-testnet.sh108```109110Optional, full setup with Acala and Statemint111```112./launch-testnet-full.sh113```114115## Run Integration Tests1161171. Install all needed dependecies118```119cd tests120yarn install121```1221232. Run tests124```125yarn test126```127128129## Code Formatting130131### Apply formatting and clippy fixes132```bash133cargo clippy134cargo fmt135```136137### Format tests138```bash139pushd tests && yarn fix ; popd140```141142### Check code style in tests143```bash144cd tests && yarn eslint --ext .ts,.js src/145```146147148## Karura token transfer149150To get started, you need to open inbound and outbound hrmp channels.151152### Next, we need to register our asset at Karura.153```154assetRegistry -> registerForeignAsset(location, metadata)155location:156	V0(X2(Parent, Parachain(PARA_ID)))157metadata:158	name         OPL159	symbol       OPL160	decimals     18161minimalBalance	 1162```163164### Next, we can send tokens from Opal to Karura:165```166polkadotXcm -> reserveTransferAssets167dest:168	V0(X2(Parent, Parachain(<KARURA_PARA_ID>)))169beneficiary:170	X1(AccountId(Any, <ACCOUNT>))171assets:172	V1(Concrete(0,Here), Fungible(<AMOUNT>))173feeAssetItem:174	0175weightLimit:176	<LIMIT>177```178179The result will be displayed in ChainState180tokens -> accounts181182### To send tokens from Karura to Opal:183```184xtokens -> transfer185186currencyId:187	ForeingAsset188		<TOKEN_ID>189190amount:191		<AMOUNT>192dest:193	V1194	(195		Parents:1,196		X2(Parachain(<KARURA_PARA_ID>), AccountId(Any, <ACCOUNT>)197	)198destWeight:199	<WEIGHT>200```
after · README.md
1![Docker build](https://github.com/usetech-llc/nft_parachain/workflows/Docker%20build/badge.svg)23# Unique Parachain45## Project Description67The Unique Pallet is the core of NFT functionality. Like ERC-721 standard in Ethereum ecosystem, this pallet provides the8basement for creating collections of unique non-divisible things, also called Non Fungible Tokens (NFTs), minting NFT of9a given Collection, and managing their ownership.1011The pallet also enables storing NFT properties. Though (according to ERC-721) NFT properties belong to logic of a12concrete application that operates a Collection, so purposefully the NFT Tracking Module does not have any knowledge13about properties except their byte size leaving application logic out to be controlled by Smart Contracts.1415The Unique Chain also provides:1617-   Smart Contracts Pallet and example smart contract that interacts with Unique Runtime18-   ERC-1155 Functionality (currently PoC as Re-Fungible tokens, i.e. items that are still unique, but that can be split19    between multiple users)20-   Variety of economic options for dapp producers to choose from to create freemium games and other ways to attract21    users. As a step one, we implemented an economic model when a collection sponsor can be set to pay for collection22    Transfer transactions.2324Wider Unique Ecosystem (most of it was developed during Hackusama):2526-   [SubstraPunks Game hosted on IPFS](https://github.com/usetech-llc/substrapunks)27-   [Unique Wallet and UI](https://uniqueapps.usetech.com/#/nft)28-   [NFT Asset for Unity Framework](https://github.com/usetech-llc/nft_unity)2930Please see our [walk-through instructions](doc/hackusama_walk_through.md) to try everything out!3132## Application Development3334If you are building an application that operates NFT tokens, use [this document](doc/application_development.md).353637## Building3839Building Unique chain requires special versions of Rust and toolchain. We don't use the most recent versions of everything40so that we can keep the builds stable.41421. Install Rust:4344```bash45sudo apt-get install git curl libssl-dev llvm pkg-config libclang-dev clang46curl https://sh.rustup.rs -sSf | sh47```48492. Remove all installed toolchains with `rustup toolchain list` and `rustup toolchain uninstall <toolchain>`.50513. Install install nightly 2021-11-11 and make it default:5253```bash54rustup toolchain install nightly-2021-11-1155rustup default nightly-2021-11-1156```57584. Add wasm target for nightly toolchain:5960```bash61rustup target add wasm32-unknown-unknown --toolchain nightly-2021-11-1162```63645. Build:65```bash66cargo build --features=unique-runtime,quartz-runtime --release67```6869## Building as Parachain locally7071Note: checkout this project and all related projects (see below) in the sibling folders (both under the same folder)7273### Polkadot launch utility7475```76git clone https://github.com/paritytech/polkadot-launch77```7879### Build relay8081```82git clone https://github.com/paritytech/polkadot.git83cd polkadot84git checkout release-v0.9.1885cargo build --release86```8788### Build Unique parachain8990Run in the root of this project:91```92cargo build --release93```9495### Build Acala parachain (optional, full config only)9697```98git clone https://github.com/AcalaNetwork/Acala99cd Acala100git checkout 54db3acd409a0b787f116f20e163a3b24101ce38101make build-release102```103104## Running as Parachain locally105106```107./launch-testnet.sh108```109110Optional, full setup with Acala and Statemint111```112./launch-testnet-full.sh113```114115## Run Integration Tests1161171. Install all needed dependecies118```119cd tests120yarn install121```1221232. Run tests124```125yarn test126```127128129## Code Formatting130131### Apply formatting and clippy fixes132```bash133cargo clippy134cargo fmt135```136137### Format tests138```bash139pushd tests && yarn fix ; popd140```141142### Check code style in tests143```bash144cd tests && yarn eslint --ext .ts,.js src/145```146147148## Karura token transfer149150To get started, you need to open inbound and outbound hrmp channels.151152### Next, we need to register our asset at Karura.153```154assetRegistry -> registerForeignAsset(location, metadata)155location:156	V0(X2(Parent, Parachain(PARA_ID)))157metadata:158	name         QTZ159	symbol       QTZ160	decimals     18161minimalBalance	 1162```163164### Next, we can send tokens from Quartz to Karura:165```166polkadotXcm -> reserveTransferAssets167dest:168	V0(X2(Parent, Parachain(<KARURA_PARA_ID>)))169beneficiary:170	X1(AccountId(Any, <ACCOUNT>))171assets:172	V1(Concrete(0,Here), Fungible(<AMOUNT>))173feeAssetItem:174	0175weightLimit:176	<LIMIT>177```178179The result will be displayed in ChainState180tokens -> accounts181182### To send tokens from Karura to Quartz:183```184xtokens -> transfer185186currencyId:187	ForeingAsset188		<TOKEN_ID>189190amount:191		<AMOUNT>192dest:193	V1194	(195		Parents:1,196		X2(Parachain(<KARURA_PARA_ID>), AccountId(Any, <ACCOUNT>)197	)198destWeight:199	<WEIGHT>200```
modifiedclient/rpc/src/lib.rsdiffbeforeafterboth
--- a/client/rpc/src/lib.rs
+++ b/client/rpc/src/lib.rs
@@ -14,6 +14,7 @@
 // You should have received a copy of the GNU General Public License
 // along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
 
+// Original License
 use std::sync::Arc;
 
 use codec::Decode;
modifiednode/cli/src/service.rsdiffbeforeafterboth
--- a/node/cli/src/service.rs
+++ b/node/cli/src/service.rs
@@ -14,8 +14,6 @@
 // You should have received a copy of the GNU General Public License
 // along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
 
-//! Service and ServiceFactory implementation. Specialized wrapper over substrate service.
-
 // std
 use std::sync::Arc;
 use std::sync::Mutex;
modifiedpallets/scheduler/src/lib.rsdiffbeforeafterboth
--- a/pallets/scheduler/src/lib.rs
+++ b/pallets/scheduler/src/lib.rs
@@ -14,7 +14,7 @@
 // You should have received a copy of the GNU General Public License
 // along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
 
-// Original license
+// Original license:
 // This file is part of Substrate.
 
 // Copyright (C) 2017-2021 Parity Technologies (UK) Ltd.
modifiedruntime/opal/src/lib.rsdiffbeforeafterboth
--- a/runtime/opal/src/lib.rs
+++ b/runtime/opal/src/lib.rs
@@ -216,11 +216,15 @@
 		.avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO)
 		.build_or_panic();
 	pub const Version: RuntimeVersion = VERSION;
-	pub const SS58Prefix: u8 = 42;
+	/*
+	255 - Quartz
+	42 - Opal
+	*/
+	pub const SS58Prefix: u8 = 255;
 }
 
 parameter_types! {
-	pub const ChainId: u64 = 8882;
+	pub const ChainId: u64 = 8881;
 }
 
 pub struct FixedFee;
modifiedtests/flipper-src/lib.rsdiffbeforeafterboth
--- a/tests/flipper-src/lib.rs
+++ b/tests/flipper-src/lib.rs
@@ -14,7 +14,7 @@
 // You should have received a copy of the GNU General Public License
 // along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
 
-// Original license
+// Original License
 // Copyright 2018-2020 Parity Technologies (UK) Ltd.
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
modifiedtests/ink-types-node-runtime/src/calls.rsdiffbeforeafterboth
--- a/tests/ink-types-node-runtime/src/calls.rs
+++ b/tests/ink-types-node-runtime/src/calls.rs
@@ -14,7 +14,7 @@
 // You should have received a copy of the GNU General Public License
 // along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
 
-// Original license
+// Original License
 // Copyright 2019 Parity Technologies (UK) Ltd.
 // This file is part of ink!.
 //
modifiedtests/ink-types-node-runtime/src/lib.rsdiffbeforeafterboth
--- a/tests/ink-types-node-runtime/src/lib.rs
+++ b/tests/ink-types-node-runtime/src/lib.rs
@@ -14,7 +14,7 @@
 // You should have received a copy of the GNU General Public License
 // along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
 
-// Original license
+// Original License
 // Copyright 2018-2019 Parity Technologies (UK) Ltd.
 // This file is part of ink!.
 //
modifiedtests/loadtester-src/lib.rsdiffbeforeafterboth
--- a/tests/loadtester-src/lib.rs
+++ b/tests/loadtester-src/lib.rs
@@ -14,6 +14,7 @@
 // You should have received a copy of the GNU General Public License
 // along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
 
+// Original License
 #![cfg_attr(not(feature = "std"), no_std)]
 
 use ink_lang as ink;
modifiedtests/src/xcmTransfer.test.tsdiffbeforeafterboth
--- a/tests/src/xcmTransfer.test.ts
+++ b/tests/src/xcmTransfer.test.ts
@@ -34,7 +34,7 @@
 const KARURA_CHAIN = 2000;
 const KARURA_PORT = '9946';
 
-describe('Integration test: Exchanging OPL with Karura', () => {
+describe('Integration test: Exchanging QTZ with Karura', () => {
   let alice: IKeyringPair;
   
   before(async () => {
@@ -60,8 +60,8 @@
 
       const metadata =
       {
-        name: 'OPL',
-        symbol: 'OPL',
+        name: 'QTZ',
+        symbol: 'QTZ',
         decimals: 18,
         minimalBalance: 1,
       };
@@ -74,7 +74,7 @@
     }, karuraApiOptions);
   });
 
-  it('Should connect and send OPL to Karura', async () => {
+  it('Should connect and send QTZ to Karura', async () => {
     let balanceOnKaruraBefore: bigint;
     
     await usingApi(async (api) => {
@@ -141,7 +141,7 @@
     }, {provider: new WsProvider('ws://127.0.0.1:' + KARURA_PORT)});
   });
 
-  it('Should connect to Karura and send OPL back', async () => {
+  it('Should connect to Karura and send QTZ back', async () => {
     let balanceBefore: bigint;
     
     await usingApi(async (api) => {