diff --git a/.baedeker/xcm-unique.jsonnet b/.baedeker/xcm-unique.jsonnet index 087512b718..0bd65424c3 100644 --- a/.baedeker/xcm-unique.jsonnet +++ b/.baedeker/xcm-unique.jsonnet @@ -15,6 +15,7 @@ local relay = { ['unique', 'moonbeam'], ['unique', 'statemint'], ['unique', 'astar'], + ['unique', 'polkadex'], ] ])), }}, @@ -23,7 +24,7 @@ local relay = { bin: $.bin, wantedKeys: 'relay', }, - for name in ['alice', 'bob', 'charlie', 'dave', 'eve', 'ferdie'] + for name in ['alice', 'bob', 'charlie', 'dave', 'eve', 'ferdie', 'gregory'] }, }; @@ -93,7 +94,7 @@ local statemint = { nodes: { [name]: { bin: $.bin, - wantedKeys: 'para', + wantedKeys: 'para-ed', }, for name in ['alice', 'bob'] }, @@ -116,9 +117,26 @@ local astar = { }, }; +local polkadex = { + name: 'polkadex', + bin: 'bin/polkadex', + paraId: 1006, + spec: {Genesis:{ + chain: 'mainnet', + modify:: m.genericPara($), + }}, + nodes: { + [name]: { + bin: $.bin, + wantedKeys: 'para', + }, + for name in ['alice', 'bob'] + }, +}; + relay + { parachains: { [para.name]: para, - for para in [unique, acala, moonbeam, statemint, astar] + for para in [unique, acala, moonbeam, statemint, astar, polkadex] }, } diff --git a/.docker/Dockerfile-astar.j2 b/.docker/Dockerfile-astar.j2 index 0cd7abd240..eec18e6f9d 100644 --- a/.docker/Dockerfile-astar.j2 +++ b/.docker/Dockerfile-astar.j2 @@ -35,11 +35,11 @@ RUN --mount=type=cache,target=/cargo-home/registry \ --mount=type=cache,target=/unique_parachain/Astar/target \ cd Astar && \ CARGO_INCREMENTAL=0 cargo build --release --locked && \ - mv ./target/release/astar-collator /unique_parachain/Astar/ + mv ./target/release/astar-collator /unique_parachain/Astar/astar # ===== BIN ====== FROM ubuntu:22.04 as builder-astar -COPY --from=builder-astar-bin /unique_parachain/Astar/astar-collator /bin/astar-collator +COPY --from=builder-astar-bin /unique_parachain/Astar/astar /bin/astar ENTRYPOINT ["/bin/astar-collator"] diff --git a/.docker/Dockerfile-polkadex.j2 b/.docker/Dockerfile-polkadex.j2 new file mode 100644 index 0000000000..23c20f6295 --- /dev/null +++ b/.docker/Dockerfile-polkadex.j2 @@ -0,0 +1,46 @@ +# ===== Rust builder ===== +FROM ubuntu:22.04 as rust-builder +LABEL maintainer="Unique.Network" + +ENV CARGO_HOME="/cargo-home" +ENV PATH="/cargo-home/bin:$PATH" +ENV TZ=UTC +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 protobuf-compiler && \ + apt-get clean && \ + rm -r /var/lib/apt/lists/* + +RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none + +RUN rustup toolchain install {{ RUST_TOOLCHAIN }} && \ + rustup target add wasm32-unknown-unknown --toolchain {{ RUST_TOOLCHAIN }} && \ + rustup default {{ RUST_TOOLCHAIN }} && \ + rustup target list --installed && \ + rustup show + +RUN mkdir /unique_parachain +WORKDIR /unique_parachain + +# ===== BUILD ACALA ===== +FROM rust-builder as builder-polkadex-bin + +WORKDIR /unique_parachain + +RUN git clone --depth 1 -b {{ POLKADEX_BUILD_BRANCH }} https://github.com/Polkadex-Substrate/parachain.git + +RUN --mount=type=cache,target=/cargo-home/registry \ + --mount=type=cache,target=/cargo-home/git \ + --mount=type=cache,target=/unique_parachain/parachain/target \ + cd parachain && \ + CARGO_INCREMENTAL=0 cargo build --release --locked && \ + mkdir /unique_parachain/Polkadex && \ + mv ./target/release/parachain-polkadex-node /unique_parachain/Polkadex/polkadex + +# ===== BIN ====== + +FROM ubuntu:22.04 as builder-polkadex + +COPY --from=builder-polkadex-bin /unique_parachain/Polkadex/polkadex /bin/polkadex +ENTRYPOINT ["/bin/polkadex"] diff --git a/.docker/additional/Dockerfile-chainql b/.docker/additional/Dockerfile-chainql new file mode 100644 index 0000000000..39033519e8 --- /dev/null +++ b/.docker/additional/Dockerfile-chainql @@ -0,0 +1,40 @@ +# ===== Rust builder ===== +FROM ubuntu:22.04 as rust-builder +LABEL maintainer="Unique.Network" + +ENV CARGO_HOME="/cargo-home" +ENV PATH="/cargo-home/bin:$PATH" +ENV TZ=UTC +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 protobuf-compiler && \ + apt-get clean && \ + rm -r /var/lib/apt/lists/* + +RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none + +RUN rustup toolchain uninstall $(rustup toolchain list) && \ + rustup toolchain install nightly-2022-11-15 && \ + rustup default nightly-2022-11-15 && \ + rustup target list --installed && \ + rustup show +RUN rustup target add wasm32-unknown-unknown --toolchain nightly-2022-11-15 + +RUN mkdir /unique_parachain +WORKDIR /unique_parachain + +# ===== BUILD CHAINQL ===== +FROM rust-builder as builder-chainql-bin + +RUN mkdir chainql +WORKDIR /chainql + +RUN git clone -b {{ CHAINQL }} --depth 1 https://github.com/UniqueNetwork/chainql.git . && \ + cargo build --release + +# ===== RUN ====== + +FROM ubuntu:22.04 as builder-chainql + +COPY --from=builder-chainql-bin /chainql/target/release/chainql /chainql/target/release/chainql diff --git a/.env b/.env index b28977aa56..c53626bf93 100644 --- a/.env +++ b/.env @@ -11,6 +11,8 @@ MOONBEAM_BUILD_BRANCH=runtime-2403 ASTAR_BUILD_BRANCH=v5.11.0 UNIQUE_MAINNET_BRANCH=release-v942057 UNIQUE_REPLICA_FROM=wss://ws.unique.network:443 +POLKADEX_BUILD_BRANCH=v1.1.0 + KUSAMA_MAINNET_BRANCH=release-v1.0.0 STATEMINE_BUILD_BRANCH=release-parachains-v9430 diff --git a/.github/workflows/ci-develop.yml b/.github/workflows/ci-develop.yml index 9244d88ffd..c24cac2b70 100644 --- a/.github/workflows/ci-develop.yml +++ b/.github/workflows/ci-develop.yml @@ -5,7 +5,7 @@ name: develop # Triger: PR at 'develop' branch with following types of events. on: pull_request: - branches: [ 'develop' ] + branches: [ 'develop', 'ci/baedeker' ] types: [ opened, reopened, synchronize, ready_for_review, converted_to_draft ] #Concurency group for control execution queue over github runners. diff --git a/.github/workflows/xcm.yml b/.github/workflows/xcm.yml index e8ba5e286b..ef0b211939 100644 --- a/.github/workflows/xcm.yml +++ b/.github/workflows/xcm.yml @@ -40,9 +40,7 @@ jobs: id: create_matrix with: matrix: | - network {opal}, relay_branch {${{ env.UNIQUEWEST_MAINNET_BRANCH }}}, acala_version {${{ env.ACALA_BUILD_BRANCH }}}, moonbeam_version {${{ env.MOONBEAM_BUILD_BRANCH }}}, cumulus_version {${{ env.WESTMINT_BUILD_BRANCH }}}, astar_version {${{ env.ASTAR_BUILD_BRANCH }}}, runtest {testXcmOpal}, runtime_features {opal-runtime} - network {quartz}, relay_branch {${{ env.KUSAMA_MAINNET_BRANCH }}}, acala_version {${{ env.KARURA_BUILD_BRANCH }}}, moonbeam_version {${{ env.MOONRIVER_BUILD_BRANCH }}}, cumulus_version {${{ env.STATEMINE_BUILD_BRANCH }}}, astar_version {${{ env.SHIDEN_BUILD_BRANCH }}}, runtest {testXcmQuartz}, runtime_features {quartz-runtime} - network {unique}, relay_branch {${{ env.POLKADOT_MAINNET_BRANCH }}}, acala_version {${{ env.ACALA_BUILD_BRANCH }}}, moonbeam_version {${{ env.MOONBEAM_BUILD_BRANCH }}}, cumulus_version {${{ env.STATEMINT_BUILD_BRANCH }}}, astar_version {${{ env.ASTAR_BUILD_BRANCH }}}, runtest {testXcmUnique}, runtime_features {unique-runtime} + network {unique}, relay_branch {${{ env.POLKADOT_MAINNET_BRANCH }}}, acala_version {${{ env.ACALA_BUILD_BRANCH }}}, moonbeam_version {${{ env.MOONBEAM_BUILD_BRANCH }}}, cumulus_version {${{ env.STATEMINT_BUILD_BRANCH }}}, astar_version {${{ env.ASTAR_BUILD_BRANCH }}}, polkadex_version {${{ env.POLKADEX_BUILD_BRANCH }}}, runtest {testXcmUnique}, runtime_features {unique-runtime} xcm-build: @@ -251,6 +249,40 @@ jobs: fi shell: bash + # Check POLKADEX version and build it if it doesn't exist in repository + - name: Generate ENV related extend Dockerfile file for POLKADEX + uses: cuchi/jinja2-action@v1.2.0 + with: + template: .docker/Dockerfile-polkadex.j2 + output_file: .docker/Dockerfile-polkadex.${{ matrix.polkadex_version }}.yml + variables: | + RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} + POLKADEX_BUILD_BRANCH=${{ matrix.polkadex_version }} + + - name: Check if the dockerhub repository contains the needed POLKADEX version + run: | + # aquire token + TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'${{ secrets.CORE_DOCKERHUB_USERNAME }}'", "password": "'${{ secrets.CORE_DOCKERHUB_TOKEN }}'"}' https://hub.docker.com/v2/users/login/ | jq -r .token) + export TOKEN=$TOKEN + + # Get TAGS from DOCKERHUB repository + POLKADEX_TAGS=$(curl -s -H "Authorization: JWT ${TOKEN}" https://hub.docker.com/v2/repositories/uniquenetwork/builder-polkadex/tags/?page_size=100 | jq -r '."results"[]["name"]') + # Show TAGS + echo "POLKADEX TAGS:" + echo $POLKADEX_TAGS + # Check correct version POLKADEX and build it if it doesn't exist in POLKADEX TAGS + if [[ ${POLKADEX_TAGS[*]} =~ (^|[[:space:]])"${{ matrix.polkadex_version }}"($|[[:space:]]) ]]; then + echo "Repository has needed POLKADEX version"; + docker pull uniquenetwork/builder-polkadex:${{ matrix.polkadex_version }} + else + echo "Repository has not needed POLKADEX version, so build it"; + cd .docker/ && docker build --file ./Dockerfile-polkadex.${{ matrix.polkadex_version }}.yml --tag uniquenetwork/builder-polkadex:${{ matrix.polkadex_version }} . + echo "Push needed POLKADEX version to the repository"; + docker push uniquenetwork/builder-polkadex:${{ matrix.polkadex_version }} + fi + shell: bash + + - name: Run find-and-replace to remove slashes from branch name uses: mad9000/actions-find-and-replace-string@4 id: branchname @@ -294,6 +326,7 @@ jobs: snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/moonbeam':{dockerImage:'uniquenetwork/builder-moonbeam:${{ matrix.moonbeam_version }}'}}) snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/cumulus':{dockerImage:'uniquenetwork/builder-cumulus:${{ matrix.cumulus_version }}'}}) snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/astar':{dockerImage:'uniquenetwork/builder-astar:${{ matrix.astar_version }}'}}) + snippet:(import 'baedeker-library/ops/rewrites.libsonnet').rewriteNodePaths({'bin/polkadex':{dockerImage:'uniquenetwork/builder-polkadex:${{ matrix.polkadex_version }}'}}) - name: Upload network config uses: actions/upload-artifact@v3 diff --git a/tests/src/eth/util/playgrounds/unique.dev.ts b/tests/src/eth/util/playgrounds/unique.dev.ts index a60cf075d9..7d98f696e0 100644 --- a/tests/src/eth/util/playgrounds/unique.dev.ts +++ b/tests/src/eth/util/playgrounds/unique.dev.ts @@ -206,6 +206,7 @@ class CreateCollectionTransaction { this.mergeDeprecated = mergeDeprecated; } + // eslint-disable-next-line require-await private async createTransaction() { const collectionHelper = this.helper.ethNativeContract.collectionHelpers(this.signer); let collectionMode; diff --git a/tests/src/util/playgrounds/unique.dev.ts b/tests/src/util/playgrounds/unique.dev.ts index 13df31a176..adaa0dc0b1 100644 --- a/tests/src/util/playgrounds/unique.dev.ts +++ b/tests/src/util/playgrounds/unique.dev.ts @@ -9,7 +9,7 @@ import * as defs from '../../interfaces/definitions'; import {IKeyringPair} from '@polkadot/types/types'; import {EventRecord} from '@polkadot/types/interfaces'; import {ICrossAccountId, IPovInfo, ITransactionResult, TSigner} from './types'; -import {FrameSystemEventRecord, XcmV2TraitsError, PalletSchedulerEvent} from '@polkadot/types/lookup'; +import {FrameSystemEventRecord, XcmV2TraitsError} from '@polkadot/types/lookup'; import {VoidFn} from '@polkadot/api/types'; import {Pallets} from '..'; import {spawnSync} from 'child_process';