difftreelog
ci install protoc
in: master
Substrate now requires it
17 files changed
.docker/Dockerfile-acala.j2diffbeforeafterboth--- a/.docker/Dockerfile-acala.j2
+++ b/.docker/Dockerfile-acala.j2
@@ -8,7 +8,7 @@
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt-get update && \
- apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev && \
+ apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev protobuf-compiler && \
apt-get clean && \
rm -r /var/lib/apt/lists/*
.docker/Dockerfile-chain-devdiffbeforeafterboth--- a/.docker/Dockerfile-chain-dev
+++ b/.docker/Dockerfile-chain-dev
@@ -11,7 +11,7 @@
RUN echo "$FEATURE\n" && echo "$RUST_TOOLCHAIN\n"
-RUN apt-get update && apt-get install -y git curl libssl-dev llvm pkg-config libclang-dev clang git make cmake
+RUN apt-get update && apt-get install -y git curl libssl-dev llvm pkg-config libclang-dev clang git make cmake protobuf-compiler
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none
@@ -20,7 +20,7 @@
rustup default $RUST_TOOLCHAIN && \
rustup target add wasm32-unknown-unknown --toolchain $RUST_TOOLCHAIN
-RUN mkdir /dev_chain
+RUN mkdir /dev_chain
COPY . /dev_chain
WORKDIR /dev_chain
.docker/Dockerfile-chain-dev-unitdiffbeforeafterboth--- a/.docker/Dockerfile-chain-dev-unit
+++ b/.docker/Dockerfile-chain-dev-unit
@@ -3,7 +3,7 @@
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Etc/UTC
-RUN apt-get update && apt-get install -y git curl libssl-dev llvm pkg-config libclang-dev clang git make cmake
+RUN apt-get update && apt-get install -y git curl libssl-dev llvm pkg-config libclang-dev clang git make cmake protobuf-compiler
ENV CARGO_HOME="/cargo-home"
ENV PATH="/cargo-home/bin:$PATH"
@@ -18,7 +18,7 @@
rustup default $RUST_TOOLCHAIN && \
rustup target add wasm32-unknown-unknown --toolchain $RUST_TOOLCHAIN
-RUN mkdir /dev_chain
+RUN mkdir /dev_chain
COPY . /dev_chain
WORKDIR /dev_chain
.docker/Dockerfile-cumulus.j2diffbeforeafterboth--- a/.docker/Dockerfile-cumulus.j2
+++ b/.docker/Dockerfile-cumulus.j2
@@ -8,7 +8,7 @@
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt-get update && \
- apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev && \
+ apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev protobuf-compiler && \
apt-get clean && \
rm -r /var/lib/apt/lists/*
.docker/Dockerfile-moonbeam.j2diffbeforeafterboth--- a/.docker/Dockerfile-moonbeam.j2
+++ b/.docker/Dockerfile-moonbeam.j2
@@ -8,7 +8,7 @@
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt-get update && \
- apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev && \
+ apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev protobuf-compiler && \
apt-get clean && \
rm -r /var/lib/apt/lists/*
@@ -38,4 +38,4 @@
FROM ubuntu:20.04 as builder-moonbeam
-COPY --from=builder-moonbeam-bin /unique_parachain/moonbeam/target/release/moonbeam /unique_parachain/moonbeam/target/release/moonbeam
\ No newline at end of file
+COPY --from=builder-moonbeam-bin /unique_parachain/moonbeam/target/release/moonbeam /unique_parachain/moonbeam/target/release/moonbeam
.docker/Dockerfile-parachaindiffbeforeafterboth--- a/.docker/Dockerfile-parachain
+++ b/.docker/Dockerfile-parachain
@@ -11,7 +11,7 @@
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt-get update && \
- apt-get install -y curl cmake pkg-config libssl-dev git clang && \
+ apt-get install -y curl cmake pkg-config libssl-dev git clang protobuf-compiler && \
apt-get clean && \
rm -r /var/lib/apt/lists/*
.docker/Dockerfile-parachain-node-onlydiffbeforeafterboth--- a/.docker/Dockerfile-parachain-node-only
+++ b/.docker/Dockerfile-parachain-node-only
@@ -11,7 +11,7 @@
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt-get update && \
- apt-get install -y curl cmake pkg-config libssl-dev git clang && \
+ apt-get install -y curl cmake pkg-config libssl-dev git clang protobuf-compiler && \
apt-get clean && \
rm -r /var/lib/apt/lists/*
.docker/Dockerfile-parachain-upgradediffbeforeafterboth--- a/.docker/Dockerfile-parachain-upgrade
+++ b/.docker/Dockerfile-parachain-upgrade
@@ -11,7 +11,7 @@
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt-get update && \
- apt-get install -y curl cmake pkg-config libssl-dev git clang && \
+ apt-get install -y curl cmake pkg-config libssl-dev git clang protobuf-compiler && \
apt-get clean && \
rm -r /var/lib/apt/lists/*
.docker/Dockerfile-parachain-upgrade-datadiffbeforeafterboth--- a/.docker/Dockerfile-parachain-upgrade-data
+++ b/.docker/Dockerfile-parachain-upgrade-data
@@ -11,7 +11,7 @@
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt-get update && \
- apt-get install -y curl cmake pkg-config libssl-dev git clang && \
+ apt-get install -y curl cmake pkg-config libssl-dev git clang protobuf-compiler && \
apt-get clean && \
rm -r /var/lib/apt/lists/*
.docker/Dockerfile-testnet.j2diffbeforeafterboth--- a/.docker/Dockerfile-testnet.j2
+++ b/.docker/Dockerfile-testnet.j2
@@ -8,7 +8,7 @@
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt-get update && \
- apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev && \
+ apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev protobuf-compiler && \
apt-get clean && \
rm -r /var/lib/apt/lists/*
@@ -71,5 +71,3 @@
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \
cd /polkadot-launch && \
yarn start launch-config.json
-
-
\ No newline at end of file
.docker/Dockerfile-try-runtimediffbeforeafterboth--- a/.docker/Dockerfile-try-runtime
+++ b/.docker/Dockerfile-try-runtime
@@ -12,7 +12,7 @@
RUN apt-get update && \
- apt-get install -y curl cmake pkg-config libssl-dev git clang && \
+ apt-get install -y curl cmake pkg-config libssl-dev git clang protobuf-compiler && \
apt-get clean && \
rm -r /var/lib/apt/lists/*
@@ -45,5 +45,5 @@
RUN echo "Requested features: $FEATURE\n" && \
echo "Fork from: $REPLICA_FROM\n" && \
cargo build --features=$FEATURE --release
-
+
CMD cargo run --features=try-runtime,$FEATURE --release -- try-runtime --no-spec-name-check on-runtime-upgrade live --uri $REPLICA_FROM
.docker/Dockerfile-xcm.j2diffbeforeafterboth--- a/.docker/Dockerfile-xcm.j2
+++ b/.docker/Dockerfile-xcm.j2
@@ -8,7 +8,7 @@
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt-get update && \
- apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev && \
+ apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev protobuf-compiler && \
apt-get clean && \
rm -r /var/lib/apt/lists/*
@@ -82,4 +82,3 @@
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \
cd /polkadot-launch && \
yarn start launch-config-xcm-{{ NETWORK }}.json
-
.docker/additional/xcm-rococo/Dockerfile-xcm-opal-rococodiffbeforeafterboth--- a/.docker/additional/xcm-rococo/Dockerfile-xcm-opal-rococo
+++ b/.docker/additional/xcm-rococo/Dockerfile-xcm-opal-rococo
@@ -13,7 +13,7 @@
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt-get update && \
- apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev && \
+ apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev protobuf-compiler && \
apt-get clean && \
rm -r /var/lib/apt/lists/*
@@ -85,5 +85,3 @@
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \
cd /polkadot-launch && \
yarn start ${LAUNCH_CONFIG_FILE}
-
-
.docker/additional/xcm-rococo/Dockerfile-xcm-quartz-rococodiffbeforeafterboth--- a/.docker/additional/xcm-rococo/Dockerfile-xcm-quartz-rococo
+++ b/.docker/additional/xcm-rococo/Dockerfile-xcm-quartz-rococo
@@ -13,7 +13,7 @@
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt-get update && \
- apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev && \
+ apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev protobuf-compiler && \
apt-get clean && \
rm -r /var/lib/apt/lists/*
@@ -89,5 +89,3 @@
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \
cd /polkadot-launch && \
yarn start ${LAUNCH_CONFIG_FILE}
-
-
.docker/additional/xcm-rococo/Dockerfile-xcm-unique-rococodiffbeforeafterboth--- a/.docker/additional/xcm-rococo/Dockerfile-xcm-unique-rococo
+++ b/.docker/additional/xcm-rococo/Dockerfile-xcm-unique-rococo
@@ -13,7 +13,7 @@
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt-get update && \
- apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev && \
+ apt-get install -y curl cmake pkg-config libssl-dev git clang llvm libudev-dev protobuf-compiler && \
apt-get clean && \
rm -r /var/lib/apt/lists/*
@@ -89,5 +89,3 @@
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && \
cd /polkadot-launch && \
yarn start ${LAUNCH_CONFIG_FILE}
-
-
.github/workflows/codestyle_v2.ymldiffbeforeafterboth--- a/.github/workflows/codestyle_v2.yml
+++ b/.github/workflows/codestyle_v2.yml
@@ -15,7 +15,7 @@
toolchain: nightly
default: true
target: wasm32-unknown-unknown
- components: rustfmt, clippy
+ components: rustfmt, clippy
- name: Run cargo fmt
run: cargo fmt -- --check # In that mode it returns only exit code.
- name: Cargo fmt state
@@ -26,12 +26,12 @@
clippy:
if: ${{ false }}
runs-on: self-hosted-ci
-
+
steps:
-
+
- uses: actions/checkout@v3
- name: Install substrate dependencies
- run: sudo apt-get install libssl-dev pkg-config libclang-dev clang
+ run: sudo apt-get install libssl-dev pkg-config libclang-dev clang protobuf-compiler
- name: Install latest nightly
uses: actions-rs/toolchain@v1
with:
README.mddiffbeforeafterboth123# 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/UniqueNetwork/substrapunks)27- [Unique Wallet and UI](https://wallet.unique.network)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 clang make cmake46curl https://sh.rustup.rs -sSf | sh47```48492. Remove all installed toolchains with `rustup toolchain list` and `rustup toolchain uninstall <toolchain>`.50513. Install toolchain nightly-2022-07-24 and make it default:5253```bash54rustup toolchain install nightly-2022-07-2455rustup default nightly-2022-07-2456```57584. Add wasm target for nightly toolchain:5960```bash61rustup target add wasm32-unknown-unknown --toolchain nightly-2022-07-2462```63645. Build:6566Opal67```bash68cargo build --release69```70Quartz71```bash72cargo build --features=quartz-runtime --release73```74Unique75```bash76cargo build --features=unique-runtime --release77```7879## Building as Parachain locally8081Note: checkout this project and all related projects (see below) in the sibling folders (both under the same folder)8283### Polkadot launch utility8485```86git clone https://github.com/UniqueNetwork/polkadot-launch.git87git checkout feature/runtime-upgrade-testing88```8990### Build relay9192```93git clone https://github.com/paritytech/polkadot.git94cd polkadot95git checkout release-v0.9.3096cargo build --release97```9899### Build Unique parachain100101Run in the root of this project:102```103cargo build --release104```105106### Build Acala parachain (optional, full config only)107108```109git clone https://github.com/AcalaNetwork/Acala110cd Acala111git checkout 54db3acd409a0b787f116f20e163a3b24101ce38112make build-release113```114115## Running as Parachain locally116117```118./launch-testnet.sh119```120121Optional, full setup with Acala and Statemint122```123./launch-testnet-full.sh124```125126## Run Integration Tests1271281. Install all needed dependecies129```130cd tests131yarn install132```1331342. Run tests135```136yarn test137```138139140## Code Formatting141142### Apply formatting and clippy fixes143```bash144cargo clippy145cargo fmt146```147148### Format tests149```bash150pushd tests && yarn fix ; popd151```152153### Check code style in tests154```bash155cd tests && yarn eslint --ext .ts,.js src/156```157158159## Karura token transfer160161To get started, you need to open inbound and outbound hrmp channels.162163### Next, we need to register our asset at Karura.164```165assetRegistry -> registerForeignAsset(location, metadata)166location:167 V0(X2(Parent, Parachain(PARA_ID)))168metadata:169 name QTZ170 symbol QTZ171 decimals 18172minimalBalance 1173```174175### Next, we can send tokens from Quartz to Karura:176```177polkadotXcm -> reserveTransferAssets178dest:179 V0(X2(Parent, Parachain(<KARURA_PARA_ID>)))180beneficiary:181 X1(AccountId(Any, <ACCOUNT>))182assets:183 V1(Concrete(0,Here), Fungible(<AMOUNT>))184feeAssetItem:185 0186weightLimit:187 <LIMIT>188```189190The result will be displayed in ChainState191tokens -> accounts192193### To send tokens from Karura to Quartz:194```195xtokens -> transfer196197currencyId:198 ForeignAsset199 <TOKEN_ID>200201amount:202 <AMOUNT>203dest:204 V1205 (206 Parents:1,207 X2(Parachain(<KARURA_PARA_ID>), AccountId(Any, <ACCOUNT>)208 )209destWeight:210 <WEIGHT>211```