From a0b39cbddd8c019f120b8b6033f3732e2798dee3 Mon Sep 17 00:00:00 2001 From: Alan Sapede Date: Fri, 21 Jul 2023 13:34:05 +0200 Subject: [PATCH] Update references from purestake to moonbeam-foundation (#2405) * Update readme to inform about the organization move * Use new github org * Update doc with new org * Updates purestake references * Adds debug to build * fix docker secrets * fix links * fix docker tagging * better link * Removes debug * typos * migrate images * adds tracing migration images * remove migration * remove polkadot preparation script * migrate previous moonbeam sha image * cleanup migration --- .github/workflows/build.yml | 94 +++++--------------- .github/workflows/coverage.yml | 9 +- .github/workflows/prepare-binary.yml | 17 +++- .github/workflows/publish-docker-runtime.yml | 16 ++++ .github/workflows/publish-docker.yml | 48 +++++++++- .github/workflows/publish-runtime.yml | 12 +-- .github/workflows/upgrade-typescript-api.yml | 2 +- CONTRIBUTIONS.md | 34 +++---- README.md | 27 +++--- RELEASE.md | 14 +-- client/rpc/debug/README.md | 14 +-- docker/moonbeam-fork-tests.Dockerfile | 31 ------- docker/polkadot-para-tests.Dockerfile | 26 ------ docker/polkadot-relay.Dockerfile | 50 ----------- moonbeam-types-bundle/package.json | 2 +- pallets/author-mapping/migrations.md | 6 +- pallets/parachain-staking/README.md | 2 +- pallets/parachain-staking/migrations.md | 26 +++--- scripts/build-alphanet-relay-image.sh | 19 ---- scripts/build-last-tracing-runtime.sh | 2 +- scripts/bump-node-version.sh | 2 +- scripts/create-substrate-fork.sh | 2 +- scripts/embed-specs.sh | 2 +- scripts/generate-relay-specs.sh | 21 ----- scripts/get-alphanet-relay-image.sh | 16 ---- scripts/run-rococo-local.sh | 73 --------------- scripts/toml-sort.sh | 2 +- tests/README.md | 27 +----- tests/run-para-tests.sh | 22 ----- tests/util/binaries.ts | 6 +- tools/get-binary.ts | 8 +- tools/github/print-runtime-release-issue.ts | 4 +- tools/github/print-version-bump-info.ts | 2 +- typescript-api/package.json | 4 +- 34 files changed, 190 insertions(+), 452 deletions(-) delete mode 100644 docker/moonbeam-fork-tests.Dockerfile delete mode 100644 docker/polkadot-para-tests.Dockerfile delete mode 100644 docker/polkadot-relay.Dockerfile delete mode 100755 scripts/build-alphanet-relay-image.sh delete mode 100755 scripts/generate-relay-specs.sh delete mode 100755 scripts/get-alphanet-relay-image.sh delete mode 100755 scripts/run-rococo-local.sh delete mode 100755 tests/run-para-tests.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 193083db6d..3857eca741 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -52,6 +52,8 @@ jobs: echo "git_branch=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_OUTPUT echo "git_ref=$GITHUB_REF" >> $GITHUB_OUTPUT fi + echo "repo.full_name: ${{ github.event.pull_request.head.repo.full_name }}" + echo "github.repository: ${{ github.repository }}" - uses: actions/checkout@v3 with: @@ -59,7 +61,7 @@ jobs: - name: Get Latest RT Release id: get-latest-rt run: | - LATEST_RUNTIME_RELEASE=$(curl -s https://api.github.com/repos/purestake/moonbeam/releases | jq -r '.[] | select(.name | test("runtime";"i")) | .tag_name' | head -n 1 | tr -d '[:blank:]') && [[ ! -z "${LATEST_RUNTIME_RELEASE}" ]] + LATEST_RUNTIME_RELEASE=$(curl -s https://api.github.com/repos/moonbeam-foundation/moonbeam/releases | jq -r '.[] | select(.name | test("runtime";"i")) | .tag_name' | head -n 1 | tr -d '[:blank:]') && [[ ! -z "${LATEST_RUNTIME_RELEASE}" ]] echo $LATEST_RUNTIME_RELEASE echo "latest_rt=$LATEST_RUNTIME_RELEASE" >> $GITHUB_OUTPUT - name: Get Sha @@ -72,7 +74,7 @@ jobs: head -1 | sed 's/.*#//' | cut -c1-8)" >> $GITHUB_OUTPUT echo "polkadot_ver=$(grep 'frame-system' Cargo.toml | sed -nE 's/.*moonbeam-polkadot-v([0-9]+\.[0-9]+\.[0-9]+).*/\1/p' | head -1)" >> $GITHUB_OUTPUT - ENDPOINT="https://api.github.com/repos/PureStake/moonbeam/git/refs/tags/${{ steps.get-latest-rt.outputs.latest_rt }}" + ENDPOINT="https://api.github.com/repos/moonbeam-foundation/moonbeam/git/refs/tags/${{ steps.get-latest-rt.outputs.latest_rt }}" RESPONSE=$(curl -s -H "Accept: application/vnd.github.v3+json" $ENDPOINT) TYPE=$(echo $RESPONSE | jq -r '.object.type') @@ -94,7 +96,7 @@ jobs: id: check-docker-image run: | TAG=sha-${{ steps.get-sha.outputs.sha8 }} - echo "image_exists=$(docker image inspect purestake/moonbeam:$TAG > /dev/null && echo "true" || echo "false")" >> $GITHUB_OUTPUT + echo "image_exists=$(docker image inspect moonbeamfoundation/moonbeam:$TAG > /dev/null && echo "true" || echo "false")" >> $GITHUB_OUTPUT - name: Display variables run: | echo git_ref: ${{ steps.check-git-ref.outputs.git_ref }} @@ -229,67 +231,6 @@ jobs: - name: Format code with rustfmt run: cargo fmt -- --check - ####### Preparing polkadot binary for parachain tests ####### - ####### For non-official repo, the script will fail if a new version of - ####### polkadot needs to be pushed. - ####### This job must not be skipped (otherwise the ts-tests are not run) - - prepare-polkadot: - runs-on: bare-metal - needs: ["set-tags"] - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - ref: ${{ needs.set-tags.outputs.git_ref }} - - name: Login to DockerHub - # We should make sure that external PRs can't login to docker, - # but the check to detect if a PR is "external" not work when - # this workflow is trigerred by a push. - if: | - github.event_name == 'push' || - github.event.pull_request.head.repo.full_name == github.repository - uses: docker/login-action@v2.2.0 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - registry: index.docker.io - - name: Check & build polkadot docker image - run: | - POLKADOT_REPO=${{ needs.set-tags.outputs.polkadot_repo }} - POLKADOT_COMMIT=${{ needs.set-tags.outputs.polkadot_commit }} - DOCKER_TAG="purestake/moonbase-relay-testnet:sha-$POLKADOT_COMMIT" - - POLKADOT_EXISTS=$(docker image inspect $DOCKER_TAG > /dev/null && \ - echo "true" || echo "false") - if [[ "$POLKADOT_EXISTS" == "false" ]]; then - # $POLKADOT_COMMIT and $POLKADOT_REPO is used to build the relay image - ./scripts/build-alphanet-relay-image.sh - docker push $DOCKER_TAG - fi - - name: Check & prepare para-test docker image - run: | - POLKADOT_REPO=${{ needs.set-tags.outputs.polkadot_repo }} - POLKADOT_COMMIT=${{ needs.set-tags.outputs.polkadot_commit }} - DOCKER_TAG="docker.io/purestake/polkadot-para-tests:sha-$POLKADOT_COMMIT" - - POLKADOT_EXISTS=$(docker image inspect $DOCKER_TAG > /dev/null && \ - echo "true" || echo "false") - if [[ "$POLKADOT_EXISTS" == "false" ]]; then - mkdir -p build - MOONBEAM_DOCKER_TAG="docker.io/purestake/moonbase-relay-testnet:sha-$POLKADOT_COMMIT" - # Clear the dummy container if it wasn't properly cleaned up - docker rm -f dummy 2> /dev/null | true - docker create --pull always -ti --name dummy $MOONBEAM_DOCKER_TAG bash - docker cp dummy:/usr/local/bin/polkadot build/polkadot - docker rm -f dummy - docker build . --pull --no-cache -f docker/polkadot-para-tests.Dockerfile \ - --network=host \ - --build-arg HOST_UID="$UID" \ - -t $DOCKER_TAG - docker push $DOCKER_TAG - fi - ####### Building and Testing binaries ####### cargo-clippy: @@ -398,7 +339,7 @@ jobs: typescript-tests: runs-on: labels: bare-metal - needs: ["set-tags", "build", "prepare-polkadot"] + needs: ["set-tags", "build"] env: BINARY_PATH: "../build/moonbeam" steps: @@ -473,7 +414,9 @@ jobs: docker-moonbeam: runs-on: ubuntu-latest needs: ["set-tags", "build"] - if: needs.set-tags.outputs.image_exists == false && github.event.pull_request.head.repo.full_name == github.repository + if: | + needs.set-tags.outputs.image_exists == 'false' + && github.event.pull_request.head.repo.full_name == github.repository steps: - name: Checkout uses: actions/checkout@v3 @@ -486,7 +429,7 @@ jobs: - name: Prepare id: prep run: | - DOCKER_IMAGE=purestake/moonbeam + DOCKER_IMAGE=moonbeamfoundation/moonbeam TAGS="${DOCKER_IMAGE}:sha-${{ needs.set-tags.outputs.sha8 }}" echo "tags=${TAGS}" >> $GITHUB_OUTPUT echo "created=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT @@ -501,8 +444,8 @@ jobs: - name: Login to DockerHub uses: docker/login-action@v2.2.0 with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} + username: ${{ secrets.MBF_DOCKERHUB_USERNAME }} + password: ${{ secrets.MBF_DOCKERHUB_PASSWORD }} - name: Build and push moonbeam id: docker_build uses: docker/build-push-action@v4 @@ -520,6 +463,17 @@ jobs: org.opencontainers.image.created=${{ steps.prep.outputs.created }} org.opencontainers.image.revision=${{ github.sha }} org.opencontainers.image.licenses=${{ github.event.repository.license.spdx_id }} + - name: Login to DockerHub + uses: docker/login-action@v2.2.0 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Tag it with purestake for 6 month + run: | + PURESTAKE_TAG=`echo "${{ steps.prep.outputs.tags }}" | sed 's/moonbeamfoundation/purestake/'` + docker pull ${{ steps.prep.outputs.tags }} + docker tag ${{ steps.prep.outputs.tags }} $PURESTAKE_TAG + docker push $PURESTAKE_TAG chopsticks-upgrade-test: runs-on: @@ -605,7 +559,7 @@ jobs: - name: Retrieve moonbeam binary from docker (for plainSpec generation) run: | MOONBEAM_COMMIT=${{ needs.set-tags.outputs.latest_rt_sha8 }} - DOCKER_TAG="purestake/moonbeam:sha-$MOONBEAM_COMMIT" + DOCKER_TAG="moonbeamfoundation/moonbeam:sha-$MOONBEAM_COMMIT" docker rm -f moonbeam_container 2> /dev/null | true docker create --name moonbeam_container $DOCKER_TAG bash diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 5b165173ee..b8d1e62850 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -23,7 +23,6 @@ jobs: outputs: git_branch: ${{ steps.check-git-ref.outputs.git_branch }} git_ref: ${{ steps.check-git-ref.outputs.git_ref }} - image_exists: ${{ steps.check-docker-image.outputs.image_exists }} sha: ${{ steps.get-sha.outputs.sha }} sha8: ${{ steps.get-sha.outputs.sha8 }} polkadot_repo: ${{ steps.get-sha.outputs.polkadot_repo }} @@ -57,7 +56,7 @@ jobs: - name: Get Latest RT Release id: get-latest-rt run: | - LATEST_RUNTIME_RELEASE=$(curl -s https://api.github.com/repos/purestake/moonbeam/releases | jq -r '.[] | select(.name | test("runtime";"i")) | .tag_name' | head -n 1 | tr -d '[:blank:]') + LATEST_RUNTIME_RELEASE=$(curl -s https://api.github.com/repos/moonbeam-foundation/moonbeam/releases | jq -r '.[] | select(.name | test("runtime";"i")) | .tag_name' | head -n 1 | tr -d '[:blank:]') echo $LATEST_RUNTIME_RELEASE echo "latest_rt=$LATEST_RUNTIME_RELEASE" >> $GITHUB_OUTPUT - name: Get Sha @@ -69,19 +68,17 @@ jobs: echo "polkadot_commit=$(egrep -o '/polkadot.*#([^\"]*)' Cargo.lock | \ head -1 | sed 's/.*#//' | cut -c1-8)" >> $GITHUB_OUTPUT - echo "$(curl -s "https://api.github.com/repos/purestake/moonbeam/git/refs/tags/${{ steps.get-latest-rt.outputs.latest_rt }}" | jq -r '.object.sha' | cut -c 1-8)" - echo "latest_rt_sha8=$(curl -s 'https://api.github.com/repos/purestake/moonbeam/git/refs/tags/${{steps.get-latest-rt.outputs.latest_rt }}' | jq -r '.object.sha' | cut -c 1-8 )" >> $GITHUB_OUTPUT + echo "$(curl -s "https://api.github.com/repos/moonbeam-foundation/moonbeam/git/refs/tags/${{ steps.get-latest-rt.outputs.latest_rt }}" | jq -r '.object.sha' | cut -c 1-8)" + echo "latest_rt_sha8=$(curl -s 'https://api.github.com/repos/moonbeam-foundation/moonbeam/git/refs/tags/${{steps.get-latest-rt.outputs.latest_rt }}' | jq -r '.object.sha' | cut -c 1-8 )" >> $GITHUB_OUTPUT - name: Check existing docker image id: check-docker-image run: | TAG=sha-${{ steps.get-sha.outputs.sha8 }} - echo "image_exists=$(docker manifest inspect purestake/moonbeam:$TAG > /dev/null && echo "true" || echo "false")" >> $GITHUB_OUTPUT - name: Display variables run: | echo git_ref: ${{ steps.check-git-ref.outputs.git_ref }} echo sha: ${{ steps.get-sha.outputs.sha }} echo sha8: ${{ steps.get-sha.outputs.sha8 }} - echo image_exists: ${{ steps.check-docker-image.outputs.image_exists }} echo latest_rt: ${{ steps.get-latest-rt.outputs.latest_rt }} echo latest_rt_sha8: ${{ steps.get-sha.outputs.latest_rt_sha8 }} diff --git a/.github/workflows/prepare-binary.yml b/.github/workflows/prepare-binary.yml index d90f35f420..90e040970a 100644 --- a/.github/workflows/prepare-binary.yml +++ b/.github/workflows/prepare-binary.yml @@ -59,7 +59,7 @@ jobs: - name: Prepare id: prep run: | - DOCKER_IMAGE=purestake/moonbeam + DOCKER_IMAGE=moonbeamfoundation/moonbeam SHA8="$(git log -1 --format="%H" | cut -c1-8)" TAGS="${DOCKER_IMAGE}:sha-${SHA8}-opt" echo "tags=${TAGS}" >> $GITHUB_OUTPUT @@ -75,8 +75,8 @@ jobs: - name: Login to DockerHub uses: docker/login-action@v2.2.0 with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} + username: ${{ secrets.MBF_DOCKERHUB_USERNAME }} + password: ${{ secrets.MBF_DOCKERHUB_TOKEN }} - name: Build and push moonbeam id: docker_build uses: docker/build-push-action@v4 @@ -94,3 +94,14 @@ jobs: org.opencontainers.image.created=${{ steps.prep.outputs.created }} org.opencontainers.image.revision=${{ github.sha }} org.opencontainers.image.licenses=${{ github.event.repository.license.spdx_id }} + - name: Login to DockerHub + uses: docker/login-action@v2.2.0 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Tag it with purestake for 6 month + run: | + PURESTAKE_TAG=`echo "${{ steps.prep.outputs.tags }}" | sed 's/moonbeamfoundation/purestake/'` + docker pull ${{ steps.prep.outputs.tags }} + docker tag ${{ steps.prep.outputs.tags }} $PURESTAKE_TAG + docker push $PURESTAKE_TAG diff --git a/.github/workflows/publish-docker-runtime.yml b/.github/workflows/publish-docker-runtime.yml index f0bf7337fe..99e5674b49 100644 --- a/.github/workflows/publish-docker-runtime.yml +++ b/.github/workflows/publish-docker-runtime.yml @@ -16,6 +16,22 @@ jobs: with: fetch-depth: 0 - name: Login to DockerHub + uses: docker/login-action@v2.2.0 + with: + username: ${{ secrets.MBF_DOCKERHUB_USERNAME }} + password: ${{ secrets.MBF_DOCKERHUB_PASSWORD }} + - name: Publish runtime docker image + run: | + DOCKER_IMAGE=moonbeamfoundation/moonbeam + DOCKER_TAG="${{ github.event.inputs.tag }}" + COMMIT=`git rev-list -n 1 '${{ github.event.inputs.tag }}'` + SHA=sha-${COMMIT::8} + echo tagging "${DOCKER_IMAGE}:${SHA}" + docker pull "${DOCKER_IMAGE}:${SHA}" + docker tag "${DOCKER_IMAGE}:${SHA}" "${DOCKER_IMAGE}:${DOCKER_TAG}" + docker push "${DOCKER_IMAGE}:${DOCKER_TAG}" + + - name: Login to Purestake DockerHub uses: docker/login-action@v2.2.0 with: username: ${{ secrets.DOCKERHUB_USERNAME }} diff --git a/.github/workflows/publish-docker.yml b/.github/workflows/publish-docker.yml index cd03864c37..9797f2ab85 100644 --- a/.github/workflows/publish-docker.yml +++ b/.github/workflows/publish-docker.yml @@ -16,6 +16,48 @@ jobs: with: fetch-depth: 0 - name: Login to DockerHub + uses: docker/login-action@v2.2.0 + with: + username: ${{ secrets.MBF_DOCKERHUB_USERNAME }} + password: ${{ secrets.MBF_DOCKERHUB_PASSWORD }} + - run: | + DOCKER_IMAGE=moonbeamfoundation/moonbeam + VERSION="${{ github.event.inputs.tag }}" + COMMIT=`git rev-list -n 1 '${{ github.event.inputs.tag }}'` + SHA=sha-${COMMIT::8} + echo using "${DOCKER_IMAGE}:${SHA} as base image" + + mkdir -p build + wget https://github.com/moonbeam-foundation/moonbeam/releases/download/$VERSION/moonbeam -O build/moonbeam + wget https://github.com/moonbeam-foundation/moonbeam/releases/download/$VERSION/moonbeam-skylake -O build/moonbeam-skylake + wget https://github.com/moonbeam-foundation/moonbeam/releases/download/$VERSION/moonbeam-znver3 -O build/moonbeam-znver3 + + echo building "${DOCKER_IMAGE}:${VERSION}" + docker build \ + --build-arg DOCKER_IMAGE="$DOCKER_IMAGE" \ + --build-arg SHA="$SHA" \ + -f docker/moonbeam-release.Dockerfile \ + -t "${DOCKER_IMAGE}:${VERSION}" \ + . + + docker push "${DOCKER_IMAGE}:${VERSION}" + + if [[ $VERSION =~ ^v[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then + MINOR=${VERSION%.*} + echo tagging "${DOCKER_IMAGE}:${MINOR}" + docker tag "${DOCKER_IMAGE}:${VERSION}" "${DOCKER_IMAGE}:${MINOR}" + docker push "${DOCKER_IMAGE}:${MINOR}" + + MAJOR=${MINOR%.*} + echo tagging "${DOCKER_IMAGE}:${MAJOR}" + docker tag "${DOCKER_IMAGE}:${VERSION}" "${DOCKER_IMAGE}:${MAJOR}" + docker push "${DOCKER_IMAGE}:${MAJOR}" + + echo tagging "${DOCKER_IMAGE}:latest" + docker tag "${DOCKER_IMAGE}:${VERSION}" "${DOCKER_IMAGE}:latest" + docker push "${DOCKER_IMAGE}:latest" + fi + - name: Login to Purestake DockerHub uses: docker/login-action@v2.2.0 with: username: ${{ secrets.DOCKERHUB_USERNAME }} @@ -28,9 +70,9 @@ jobs: echo using "${DOCKER_IMAGE}:${SHA} as base image" mkdir -p build - wget https://github.com/PureStake/moonbeam/releases/download/$VERSION/moonbeam -O build/moonbeam - wget https://github.com/PureStake/moonbeam/releases/download/$VERSION/moonbeam-skylake -O build/moonbeam-skylake - wget https://github.com/PureStake/moonbeam/releases/download/$VERSION/moonbeam-znver3 -O build/moonbeam-znver3 + wget https://github.com/moonbeam-foundation/moonbeam/releases/download/$VERSION/moonbeam -O build/moonbeam + wget https://github.com/moonbeam-foundation/moonbeam/releases/download/$VERSION/moonbeam-skylake -O build/moonbeam-skylake + wget https://github.com/moonbeam-foundation/moonbeam/releases/download/$VERSION/moonbeam-znver3 -O build/moonbeam-znver3 echo building "${DOCKER_IMAGE}:${VERSION}" docker build \ diff --git a/.github/workflows/publish-runtime.yml b/.github/workflows/publish-runtime.yml index a2fb765d0b..f7f5c27e71 100644 --- a/.github/workflows/publish-runtime.yml +++ b/.github/workflows/publish-runtime.yml @@ -36,7 +36,7 @@ jobs: matrix: chain: ["moonbase", "moonriver", "moonbeam"] srtool_image: - - purestake/srtool + - moonbeamfoundation/srtool srtool_image_tag: - 1.69.0 steps: @@ -45,18 +45,18 @@ jobs: ref: ${{ github.event.inputs.to }} - name: Login to DockerHub uses: docker/login-action@v2.2.0 - if: github.repository == 'purestake/moonbeam' + if: github.repository == 'moonbeam-foundation/moonbeam' with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} + username: ${{ secrets.MBF_DOCKERHUB_USERNAME }} + password: ${{ secrets.MBF_DOCKERHUB_PASSWORD }} registry: index.docker.io - name: Download original scripts uses: actions/download-artifact@v3 with: name: original-scripts path: original-scripts - - name: Build & Push purestake/srtool image - if: github.repository == 'purestake/moonbeam' + - name: Build & Push moonbeamfoundation/srtool image + if: github.repository == 'moonbeam-foundation/moonbeam' run: | docker pull "${{ matrix.srtool_image }}:${{ matrix.srtool_image_tag }}" && image_exists=true || image_exists=false diff --git a/.github/workflows/upgrade-typescript-api.yml b/.github/workflows/upgrade-typescript-api.yml index f6686bb64e..03c5845f2b 100644 --- a/.github/workflows/upgrade-typescript-api.yml +++ b/.github/workflows/upgrade-typescript-api.yml @@ -17,7 +17,7 @@ jobs: - name: Retrieve moonbeam binary run: | COMMIT_SHA8=$(git log -1 --format="%H" | cut -c1-8) - DOCKER_TAG="purestake/moonbeam:sha-$COMMIT_SHA8" + DOCKER_TAG="moonbeamfoundation/moonbeam:sha-$COMMIT_SHA8" # Clear the dummy container if it wasn't properly cleaned up docker rm -f dummy 2> /dev/null docker create -ti --name dummy $DOCKER_TAG bash diff --git a/CONTRIBUTIONS.md b/CONTRIBUTIONS.md index 5621a2a46f..206849db12 100644 --- a/CONTRIBUTIONS.md +++ b/CONTRIBUTIONS.md @@ -11,7 +11,7 @@ You may also consider joining our [Discord server](https://discord.gg/PfpUATX) o ### Generated Documentation -You can explore our [crate-level documentation](https://purestake.github.io/moonbeam). +You can explore our [crate-level documentation](https://moonbeam-foundation.github.io/moonbeam). This documentation is automatically built and reflects the latest `master` commit. @@ -23,27 +23,27 @@ Moonbeam is following the In addition, we incorporate several tools to improve code quality. These are integrated into our CI and are expected to pass before a PR is considered mergeable. They can also be run locally. -* [clippy](https://github.com/rust-lang/rust-clippy) - run with `cargo clippy --release --workspace` -* [rustfmt](https://github.com/rust-lang/rustfmt) - run with `cargo fmt -- --check` -* [editorconfig](https://editorconfig.org/) - integrate into your text editor / IDE -* [prettier](https://prettier.io/) - run with `npx prettier --check --ignore-path .gitignore '**/*.(yml|js|ts|json)'` (runs against `typescript` code) +- [clippy](https://github.com/rust-lang/rust-clippy) - run with `cargo clippy --release --workspace` +- [rustfmt](https://github.com/rust-lang/rustfmt) - run with `cargo fmt -- --check` +- [editorconfig](https://editorconfig.org/) - integrate into your text editor / IDE +- [prettier](https://prettier.io/) - run with `npx prettier --check --ignore-path .gitignore '**/*.(yml|js|ts|json)'` (runs against `typescript` code) ### Directory Structure The following is a list of directories of interest in development. -|Directory |Purpose | -| --------------------- | -------------------------------------------------------------------------- | -|client/ | Debug & Trace related code (rust) | -|docker/ | Dockerfiles for running Moonbeam | -|moonbeam-types-bundle/ | PolkadotJs types definitions for Moonbeam (typescript) | -|node/ | Moonbeam's main node (rust) | -|pallets/ | Moonmeam's Substrate runtime pallets (rust) | -|primitives/ | More Debug & Trace related code (rust) | -|runtime/ | Moonbeam's runtime (on-chain) code (rust, compiled to WASM) | -|scripts/ | Utilities for launching and interacting with a Moonbeam chain (typescript) | -|specs/ | Spec files used to generate genesis for well-known Moonbeam networks | -|tools/ | Various tools generally related to development (typescript) | +| Directory | Purpose | +| ---------------------- | -------------------------------------------------------------------------- | +| client/ | Debug & Trace related code (rust) | +| docker/ | Dockerfiles for running Moonbeam | +| moonbeam-types-bundle/ | PolkadotJs types definitions for Moonbeam (typescript) | +| node/ | Moonbeam's main node (rust) | +| pallets/ | Moonmeam's Substrate runtime pallets (rust) | +| primitives/ | More Debug & Trace related code (rust) | +| runtime/ | Moonbeam's runtime (on-chain) code (rust, compiled to WASM) | +| scripts/ | Utilities for launching and interacting with a Moonbeam chain (typescript) | +| specs/ | Spec files used to generate genesis for well-known Moonbeam networks | +| tools/ | Various tools generally related to development (typescript) | ### PR labels conventions diff --git a/README.md b/README.md index 073110974b..8af162a04d 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,22 @@ # ![Moonbeam](media/moonbeam-cover.jpg) +# ⚠️ Moonbeam new github organization ⚠️ -# ⚠️ Moonbeam repository moving ⚠️ - -Moonbeam repository will soon (within a week) migrate to the Moonbeam Foundation organization: +Moonbeam repository has been migrated from purestake to the Moonbeam Foundation organization: https://github.com/moonbeam-foundation/moonbeam Github references/cloning as well as cargo build will keep working as expected. It is however recommended to change those references once the migration is done. -# Information +# Information -![Tests](https://github.com/PureStake/moonbeam/workflows/Release/badge.svg) +![Tests](https://github.com/moonbeam-foundation/moonbeam/workflows/Release/badge.svg) **An Ethereum compatible [Parachain](https://polkadot.network/technology/) built with [Substrate](https://substrate.dev).** 👉 _Discover the Moonbeam project at [moonbeam.network](https://moonbeam.network)._
👉 _Learn to [use the Moonbeam network](https://docs.moonbeam.network/) with our technical docs._
-👉 _Reference our [crate-level docs (rustdocs)](https://purestake.github.io/moonbeam) to contribute._ +👉 _Reference our [crate-level docs (rustdocs)](https://moonbeam-foundation.github.io/moonbeam) to contribute._ ## Run an alphanet node with Docker @@ -25,7 +24,7 @@ Docker images are published for every tagged release. Learn more with `moonbeam ```bash # Join the public testnet -docker run --network="host" purestake/moonbeam:v0.31.0 --chain alphanet +docker run --network="host" moonbeamfoundation/moonbeam:v0.31.0 --chain alphanet ``` You can find more detailed instructions to [run a full node in our TestNet](https://docs.moonbeam.network/node-operators/networks/full-node/) @@ -38,7 +37,7 @@ service. ```bash # Run a dev service node -docker run --network="host" purestake/moonbeam:v0.31.0 --dev +docker run --network="host" moonbeamfoundation/moonbeam:v0.31.0 --dev ``` For more information, see our detailed instructions to [run a development node](https://docs.moonbeam.network/getting-started/local-node/setting-up-a-node/) @@ -49,10 +48,10 @@ The command above will start the node in instant seal mode. It creates a block w ```bash # Author a block every 6 seconds. -docker run --network="host" purestake/moonbeam:v0.31.0 --dev --sealing 6000 +docker run --network="host" moonbeamfoundation/moonbeam:v0.31.0 --dev --sealing 6000 # Manually control the block authorship and finality -docker run --network="host" purestake/moonbeam:v0.31.0 --dev --sealing manual +docker run --network="host" moonbeamfoundation/moonbeam:v0.31.0 --dev --sealing manual ``` ### Prefunded Development Addresses @@ -116,11 +115,11 @@ To build Moonbeam, you will need a proper Substrate development environment. If If you need a refresher setting up your Substrate environment, see [Substrate's Getting Started Guide](https://substrate.dev/docs/en/knowledgebase/getting-started/). -Note that cloning master might result in an unstable build. If you want a stable version, check out the [latest releases](https://github.com/PureStake/moonbeam/releases). +Note that cloning master might result in an unstable build. If you want a stable version, check out the [latest releases](https://github.com/moonbeam-foundation/moonbeam/releases). ```bash # Fetch the code -git clone https://github.com/PureStake/moonbeam +git clone https://github.com/moonbeam-foundation/moonbeam cd moonbeam # Build the node (The first build will be long (~30min)) @@ -202,11 +201,11 @@ When modifying the git repository for these dependencies, a tool called [diener] ## Rustdocs Rustdocs for the Moonbeam codebase are automatically generated and published -[here](https://purestake.github.io/moonbeam/moonbeam_runtime/index.html). +[here](https://moonbeam-foundation.github.io/moonbeam/moonbeam_runtime/index.html). ## Contribute Moonbeam is open source under the terms of the GPL3. We welcome contributions. Please review our [CONTRIBUTIONS.md](CONTRIBUTIONS.md) document for more information. -Example of version bumping PR (runtime and node): https://github.com/PureStake/moonbeam/pull/601/files +Example of version bumping PR (runtime and node): https://github.com/moonbeam-foundation/moonbeam/pull/601/files diff --git a/RELEASE.md b/RELEASE.md index a721e1f710..d630beb30f 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -9,7 +9,7 @@ ### Notes - The `master` branch must refer to frontier `paritytech/frontier/master` or - `purestake/frontier/moonbeam-polkadot-vX.Y.Z` + `moonbeam-foundation/frontier/moonbeam-polkadot-vX.Y.Z` ### Release Workflow @@ -22,10 +22,10 @@ To release `vX.Y.Z`: 1. Review the generated Draft and clean a bit the messages if needed (keep it draft) 1. Test the new client on internal tests networks (stagenet/moonsama/moonlama) 1. Publish the client release draft -1. When everything is ok, publish the new docker image: start github action Publish Docker with -`vX.Y.Z` +1. When everything is ok, publish the new docker image: start github action Publish Docker with + `vX.Y.Z` 1. Publish the new tracing image: on repo moonbeam-runtime-overrides, start github action -Publish Docker with `vX.Y.Z` and master + Publish Docker with `vX.Y.Z` and master 1. Documentation/Website/Tutorials have been updated ## Moonbeam runtime release @@ -45,11 +45,11 @@ To release `runtime-XXYY`: 1. Tag master with `runtime-XXYY` and push to github 1. Start the github action "Publish Runtime Draft" 1. Review the generated Draft and clean a bit the messages if needed (keep it draft) -1. Create the tracing runtime: start the github action "Create tracing runtime" on `purestake/moonbeam-runtime-overrides` +1. Create the tracing runtime: start the github action "Create tracing runtime" on `moonbeam-foundation/moonbeam-runtime-overrides` 1. Upgrade runtime on our internal test network stagenet 1. Ensure Type changes are reflected into PolkadotJs -1. Test changes on stagenet +1. Test changes on stagenet 1. Create new tracing image for partners: start the github action "Publish Docker" - on `purestake/moonbeam-runtime-overrides` + on `moonbeam-foundation/moonbeam-runtime-overrides` 1. When everything is ok, publish the draft release 1. Upgrade runtime on alphanet diff --git a/client/rpc/debug/README.md b/client/rpc/debug/README.md index 1e9caf48cc..d46462f263 100644 --- a/client/rpc/debug/README.md +++ b/client/rpc/debug/README.md @@ -6,16 +6,17 @@ Runtime wasms compiled with the `tracing` evm feature will emit events related t Tracing wasms for each moonbeam/river/base runtime versions live at `moonbeam-runtime-overrides` repository in github. -Tracing functionality in Moonbeam makes heavy use of [environmental](https://crates.io/crates/environmental): +Tracing functionality in Moonbeam makes heavy use of [environmental](https://docs.rs/environmental/latest/environmental/): - The rpc request must create a runtime api instance to replay the transaction. The runtime api call is made `using` `environmental`. - Once in the wasm, the target evm transaction is replayed by calling the evm also `using` `environmental`. - This allows: - 1. Listen to new events from the evm in the moonbeam runtime wasm. - 2. Proxy those events to the client (through a host function), which is also listening for events from the runtime. + 1. Listen to new events from the evm in the moonbeam runtime wasm. + 2. Proxy those events to the client (through a host function), which is also listening for events from the runtime. - This way we don't make use of (limited) wasm memory, and instead store the evm emitted events content in the client. Once the evm execution concludes, the runtime context exited and all events have been stored in the client memory, we support formatting the captured events in different ways that are convenient for the end-user, like raw format (opcode level tracing), callTracer (used as a default formatter by geth) or blockscout custom tracer. + ## On Runtime Api versioning This text aims to describe the process of adding new Runtime Api versions and supporting old ones. @@ -34,7 +35,7 @@ sp_api::decl_runtime_apis! { } ``` -For the `trace_transaction` method above, we need a new header argument, and the response will no longer be a single::TransactionTrace but an empty result () because we will handle the result client side using environmental. +For the `trace_transaction` method above, we need a new header argument, and the response will no longer be a single::TransactionTrace but an empty result () because we will handle the result client side using environmental. Becomes: @@ -49,7 +50,7 @@ sp_api::decl_runtime_apis! { transaction: &Transaction, trace_type: single::TraceType, ) -> Result; - + fn trace_transaction( header: &Block::Header, extrinsics: Vec, @@ -67,7 +68,6 @@ Substrate provides two macro attributes to do what we want: `api_version` and `c The un-anotated method is considered the default implemetation, and holds the current `trace_transaction` signature, with the new header argument and the empty result. - ### Using a versioned runtime api from the client To identify which version to use depending on the Api version of the height we want to access the runtime in, we will use the `api_version` method available on a runtime api instance: @@ -91,4 +91,4 @@ if api_version >= 2 { } ``` -In the example above we updated the result type, that means we will need different logics to handle the response for each version in the client. This support needs to cover all versions added historically for any Runtime Api from genesis, as well as all have access to all the primitives that exist or existed in the runtime api methods' signatures. \ No newline at end of file +In the example above we updated the result type, that means we will need different logics to handle the response for each version in the client. This support needs to cover all versions added historically for any Runtime Api from genesis, as well as all have access to all the primitives that exist or existed in the runtime api methods' signatures. diff --git a/docker/moonbeam-fork-tests.Dockerfile b/docker/moonbeam-fork-tests.Dockerfile deleted file mode 100644 index 1dee78c9ee..0000000000 --- a/docker/moonbeam-fork-tests.Dockerfile +++ /dev/null @@ -1,31 +0,0 @@ -# Node for Moonbase Parachains. -# -# Requires to run from repository root and to copy the binary in the build folder (part of the release workflow) - -FROM node:16 -LABEL maintainer "alan@purestake.com" -LABEL description="Moonbeam Fork Test image" - -RUN apt update -RUN apt install -y jq - -RUN mkdir /moonbeam-fork-tests && \ - chown -R node:node /moonbeam-fork-tests - -RUN apt install -y git clang curl libssl-dev llvm libudev-dev pkg-config make - -USER node - -RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y -ENV PATH="/home/node/.cargo/bin:${PATH}" - -RUN rustup default stable && \ - rustup update && \ - rustup update nightly && \ - rustup target add wasm32-unknown-unknown --toolchain nightly - -COPY --chown=node ./run-fork-test.sh /moonbeam-fork-tests/run-fork-test.sh -RUN chmod uog+x /moonbeam-fork-tests/run-fork-test.sh - -ENV ROOT_FOLDER /moonbeam-fork-tests -CMD ["/moonbeam-fork-tests/run-fork-test.sh"] diff --git a/docker/polkadot-para-tests.Dockerfile b/docker/polkadot-para-tests.Dockerfile deleted file mode 100644 index 92857639fd..0000000000 --- a/docker/polkadot-para-tests.Dockerfile +++ /dev/null @@ -1,26 +0,0 @@ -# Node for Moonbase Parachains. -# -# Requires to run from repository root and to copy the binary in the build folder (part of the release workflow) - -FROM node -LABEL maintainer "alan@purestake.com" -LABEL description="Node image use to run Moonbeam para-tests" - -ARG HOST_UID=1001 - -RUN ((getent passwd $HOST_UID > /dev/null) || \ - useradd -m -u $HOST_UID -U -s /bin/sh -d /polkadot polkadot) && \ - mkdir -p /polkadot/.local/share/polkadot && \ - chown -R $HOST_UID /polkadot && \ - ln -s /polkadot/.local/share/polkadot /data - -RUN mkdir -p /binaries -COPY build/polkadot /binaries/ -RUN chmod -R uog+rwX /binaries - -USER $HOST_UID - -WORKDIR /polkadot - -ENTRYPOINT ["docker-entrypoint.sh"] -CMD [ "node" ] \ No newline at end of file diff --git a/docker/polkadot-relay.Dockerfile b/docker/polkadot-relay.Dockerfile deleted file mode 100644 index 4dedb54349..0000000000 --- a/docker/polkadot-relay.Dockerfile +++ /dev/null @@ -1,50 +0,0 @@ -# Inspired by Polkadot Dockerfile - -FROM docker.io/paritytech/ci-linux:1.69.0-bullseye as builder -LABEL maintainer "alan@purestake.com" -LABEL description="This is the build stage for Polkadot. Here we create the binary." - -ARG POLKADOT_COMMIT=master -ARG POLKADOT_REPO=https://github.com/paritytech/polkadot -RUN echo "Using polkadot ${POLKADOT_COMMIT}" -WORKDIR / - -# Grab the Polkadot Code -# TODO how to grab the correct commit from the lock file? -RUN git clone ${POLKADOT_REPO} -WORKDIR /polkadot -RUN rustc --version -RUN git checkout ${POLKADOT_COMMIT} - -# RUN sed -i 's/pub const EPOCH_DURATION_IN_SLOTS: BlockNumber = 1 \* HOURS/pub const EPOCH_DURATION_IN_SLOTS: BlockNumber = 2 \* MINUTES/' runtime/*/src/constants.rs -# Download rust dependencies and build the rust binary -RUN cargo build --profile production --locked - -# ===== SECOND STAGE ====== - -FROM debian:bookworm-slim -LABEL maintainer "alan@purestake.com" -LABEL description="Polkadot for Moonbeam Relay Chains" -COPY --from=builder /polkadot/target/production/polkadot /usr/local/bin - -RUN useradd -m -u 1000 -U -s /bin/sh -d /moonbase-alphanet moonbeam && \ - mkdir -p /moonbase-alphanet/.local/share/moonbase-alphanet && \ - chown -R moonbeam:moonbeam /moonbase-alphanet && \ - ln -s /moonbase-alphanet/.local/share/moonbase-alphanet /data && \ - rm -rf /usr/sbin - -USER moonbeam - -COPY --chown=moonbeam specs/alphanet/westend-embedded-specs-v8.json /moonbase-alphanet/alphanet-relay-raw-specs.json -RUN grep -v '/p2p/' /moonbase-alphanet/alphanet-relay-raw-specs.json > \ - /moonbase-alphanet/alphanet-relay-raw-specs-no-bootnodes.json - -# 30333 for p2p traffic -# 9933 for RPC call -# 9944 for Websocket -# 9615 for Prometheus (metrics) -EXPOSE 30333 9933 9944 9615 - -VOLUME ["/data"] - -CMD ["/usr/local/bin/polkadot"] diff --git a/moonbeam-types-bundle/package.json b/moonbeam-types-bundle/package.json index e43a0e9c44..a65e2ea7da 100644 --- a/moonbeam-types-bundle/package.json +++ b/moonbeam-types-bundle/package.json @@ -23,7 +23,7 @@ "license": "GPL-3.0-only", "repository": { "type": "git", - "url": "git+https://github.com/PureStake/moonbeam.git" + "url": "git+https://github.com/moonbeam-foundation/moonbeam.git" }, "dependencies": { "@polkadot/api": "^10.9.1", diff --git a/pallets/author-mapping/migrations.md b/pallets/author-mapping/migrations.md index 7f0c0b19c8..4400206d9c 100644 --- a/pallets/author-mapping/migrations.md +++ b/pallets/author-mapping/migrations.md @@ -2,9 +2,9 @@ ## Add session keys to author mapping pallet -- [Migration PR `#1407`](https://github.com/PureStake/moonbeam/pull/1407) +- [Migration PR `#1407`](https://github.com/moonbeam-foundation/moonbeam/pull/1407) ## Manage author mapping blake2 migration -- [Migration PR `#796`](https://github.com/PureStake/moonbeam/pull/796) -- [Migration Removal PR `#1434`](https://github.com/PureStake/moonbeam/pull/1434) +- [Migration PR `#796`](https://github.com/moonbeam-foundation/moonbeam/pull/796) +- [Migration Removal PR `#1434`](https://github.com/moonbeam-foundation/moonbeam/pull/1434) diff --git a/pallets/parachain-staking/README.md b/pallets/parachain-staking/README.md index e169fe702a..5d13a7382a 100644 --- a/pallets/parachain-staking/README.md +++ b/pallets/parachain-staking/README.md @@ -15,7 +15,7 @@ Implements Delegated Proof of Stake to Links: -- [Rust Documentation](https://purestake.github.io/moonbeam/pallet_parachain_staking/index.html) +- [Rust Documentation](https://moonbeam-foundation.github.io/moonbeam/pallet_parachain_staking/index.html) - [Unofficial Documentation](https://meta5.world/parachain-staking-docs/) - [(Outdated) Blog Post with Justification](https://meta5.world/posts/parachain-staking) diff --git a/pallets/parachain-staking/migrations.md b/pallets/parachain-staking/migrations.md index d2277ffcd0..2c020bebbb 100644 --- a/pallets/parachain-staking/migrations.md +++ b/pallets/parachain-staking/migrations.md @@ -2,41 +2,41 @@ ## Calculate outgoing rewards based on pending revoke and decrease changes -- [Migration PR `#1408`](https://github.com/PureStake/moonbeam/pull/1408) +- [Migration PR `#1408`](https://github.com/moonbeam-foundation/moonbeam/pull/1408) ## Patch delegations total mismatch -- [Migration PR `#1291`](https://github.com/PureStake/moonbeam/pull/1291) +- [Migration PR `#1291`](https://github.com/moonbeam-foundation/moonbeam/pull/1291) ## Split candidate state for PoV optimization -- [Migration PR `#1117`](https://github.com/PureStake/moonbeam/pull/1117) +- [Migration PR `#1117`](https://github.com/moonbeam-foundation/moonbeam/pull/1117) ## Increase max delegations per candidate -- [Migration PR `#1096`](https://github.com/PureStake/moonbeam/pull/1096) -- [Migratio bugfix `#1112`](https://github.com/PureStake/moonbeam/pull/1112) +- [Migration PR `#1096`](https://github.com/moonbeam-foundation/moonbeam/pull/1096) +- [Migratio bugfix `#1112`](https://github.com/moonbeam-foundation/moonbeam/pull/1112) ## Manual Exits and Patch Lack of Delay for bond\_{more, less} -- [Migration PR `#810`](https://github.com/PureStake/moonbeam/pull/810) +- [Migration PR `#810`](https://github.com/moonbeam-foundation/moonbeam/pull/810) - [Migration Removal PR `#?`]() ## Purge Stale Storage -- [Migration PR `#970`](https://github.com/PureStake/moonbeam/pull/970) +- [Migration PR `#970`](https://github.com/moonbeam-foundation/moonbeam/pull/970) ## Delay nominator exits by changing NominatorState and ExitQueue -- [Migration PR `#610`](https://github.com/PureStake/moonbeam/pull/610) -- [Migration Removal PR `#662`](https://github.com/PureStake/moonbeam/pull/662) +- [Migration PR `#610`](https://github.com/moonbeam-foundation/moonbeam/pull/610) +- [Migration Removal PR `#662`](https://github.com/moonbeam-foundation/moonbeam/pull/662) ## Patch nomination DOS attack vector by changing CollatorState -- [Migration PR `#505`](https://github.com/PureStake/moonbeam/pull/505) -- [Migration Removal PR `#553`](https://github.com/PureStake/moonbeam/pull/553) +- [Migration PR `#505`](https://github.com/moonbeam-foundation/moonbeam/pull/505) +- [Migration Removal PR `#553`](https://github.com/moonbeam-foundation/moonbeam/pull/553) ## Patch underflow bug and correct Total storage item -- [Migration PR `#502`](https://github.com/PureStake/moonbeam/pull/502) -- [Migration Removal PR `#553`](https://github.com/PureStake/moonbeam/pull/553) +- [Migration PR `#502`](https://github.com/moonbeam-foundation/moonbeam/pull/502) +- [Migration Removal PR `#553`](https://github.com/moonbeam-foundation/moonbeam/pull/553) diff --git a/scripts/build-alphanet-relay-image.sh b/scripts/build-alphanet-relay-image.sh deleted file mode 100755 index 5f0c68164a..0000000000 --- a/scripts/build-alphanet-relay-image.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -# Loading binary/specs variables - -if [ -z "$POLKADOT_COMMIT" ]; then - POLKADOT_COMMIT=`egrep -o '/polkadot.*#([^\"]*)' Cargo.lock | \ - head -1 | sed 's/.*#//' | cut -c1-8` -fi - -if [ -z "$POLKADOT_REPO" ]; then - POLKADOT_REPO=`egrep -o 'https://github.com/[^\/]*/polkadot\\?branch=' Cargo.lock | \ - head -1 | sed 's/?branch=//'` -fi - -echo "Using Polkadot from $POLKADOT_REPO revision #${POLKADOT_COMMIT}" - -docker build . --pull --no-cache -f docker/polkadot-relay.Dockerfile --network=host \ - --build-arg POLKADOT_COMMIT="$POLKADOT_COMMIT" \ - --build-arg POLKADOT_REPO="$POLKADOT_REPO" \ - -t purestake/moonbase-relay-testnet:sha-$POLKADOT_COMMIT diff --git a/scripts/build-last-tracing-runtime.sh b/scripts/build-last-tracing-runtime.sh index 84e9a3acc8..105972ca40 100755 --- a/scripts/build-last-tracing-runtime.sh +++ b/scripts/build-last-tracing-runtime.sh @@ -7,7 +7,7 @@ echo ${1:-"$LOCAL_GIT_BRANCH"} rm -rf build/{moonbeam-runtime-overrides,wasm} mkdir -p build/wasm -git clone --depth 1 -b master-without-wasm https://github.com/PureStake/moonbeam-runtime-overrides build/moonbeam-runtime-overrides +git clone --depth 1 -b master-without-wasm https://github.com/moonbeam-foundation/moonbeam-runtime-overrides build/moonbeam-runtime-overrides cd build/moonbeam-runtime-overrides ./scripts/import-tracing-runtime.sh local ${1:-"$LOCAL_GIT_BRANCH"} diff --git a/scripts/bump-node-version.sh b/scripts/bump-node-version.sh index d4e1b7e830..59bec28371 100755 --- a/scripts/bump-node-version.sh +++ b/scripts/bump-node-version.sh @@ -8,7 +8,7 @@ fi FROM=$1 TO=$2 -sed -i "s/purestake\/moonbeam:v$FROM/purestake\/moonbeam:v$TO/" README.md +sed -i "s/moonbeam-foundation\/moonbeam:v$FROM/moonbeam-foundation\/moonbeam:v$TO/" README.md sed -i "s/^version = '$FROM'$/version = '$TO'/" node/Cargo.toml sed -i "s/^version = '$FROM'$/version = '$TO'/" node/cli/Cargo.toml sed -i "s/^version = '$FROM'$/version = '$TO'/" node/cli-opt/Cargo.toml diff --git a/scripts/create-substrate-fork.sh b/scripts/create-substrate-fork.sh index 066159a888..171fd4d6bf 100755 --- a/scripts/create-substrate-fork.sh +++ b/scripts/create-substrate-fork.sh @@ -22,7 +22,7 @@ REPOS=( ) for REPO in ${REPOS[@]}; do - git clone --depth 1 git@github.com:purestake/$REPO.git -b $BASE_BRANCH + git clone --depth 1 git@github.com:moonbeam-foundation/$REPO.git -b $BASE_BRANCH cd $REPO git checkout -b $NEW_BRANCH find . -name "Cargo.toml" -exec sed -i "s/\"$BASE_BRANCH\"/\"$NEW_BRANCH\"/g" {} \; diff --git a/scripts/embed-specs.sh b/scripts/embed-specs.sh index 368281c658..50c24b7bc9 100755 --- a/scripts/embed-specs.sh +++ b/scripts/embed-specs.sh @@ -9,7 +9,7 @@ fi NETWORK=$1 DOCKER_TAG=$2 -PARACHAIN_DOCKER=purestake/moonbase-${NETWORK}:${DOCKER_TAG} +PARACHAIN_DOCKER=moonbeamfoundation/moonbase-${NETWORK}:${DOCKER_TAG} docker create --name moonbeam-tmp $PARACHAIN_DOCKER docker cp moonbeam-tmp:/moonbase-parachain/parachain-raw-specs.json specs/${NETWORK}/parachain-embedded-specs-${DOCKER_TAG}.json docker rm moonbeam-tmp diff --git a/scripts/generate-relay-specs.sh b/scripts/generate-relay-specs.sh deleted file mode 100755 index fe26e005d4..0000000000 --- a/scripts/generate-relay-specs.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash -set -e -source scripts/_init_var.sh - -if [ -z "$POLKADOT_VERSION" ]; then - POLKADOT_VERSION="sha-`egrep -o '/polkadot.*#([^\"]*)' Cargo.lock | \ - head -1 | sed 's/.*#//' | cut -c1-8`" -fi - -echo "Using Polkadot revision #${POLKADOT_VERSION}" - -echo "=================== Rococo-Local ===================" -docker run -it -v $(pwd)/build:/build purestake/moonbase-relay-testnet:$POLKADOT_VERSION \ - /usr/local/bin/polkadot \ - build-spec \ - --chain rococo-local \ - -lerror \ - --disable-default-bootnode \ - --raw \ - > $ROCOCO_LOCAL_RAW_SPEC -echo $ROCOCO_LOCAL_RAW_SPEC generated \ No newline at end of file diff --git a/scripts/get-alphanet-relay-image.sh b/scripts/get-alphanet-relay-image.sh deleted file mode 100755 index 04de3a315d..0000000000 --- a/scripts/get-alphanet-relay-image.sh +++ /dev/null @@ -1,16 +0,0 @@ -#/bin/sh - -POLKADOT_COMMIT=$(egrep -o '/polkadot.*#([^\"]*)' Cargo.lock | head -1 | sed 's/.*#//' | cut -c1-8) -DOCKER_TAG="purestake/moonbase-relay-testnet:sha-$POLKADOT_COMMIT" - -# Build relay binary if needed -POLKADOT_EXISTS=docker manifest inspect $DOCKER_TAG > /dev/null && "true" || "false" -if [[ "$POLKADOT_EXISTS" == "false" ]]; then - # $POLKADOT_COMMIT is used to build the relay image - ./scripts/build-alphanet-relay-image.sh -fi - -# Get relay binary -docker create -ti --name dummy $DOCKER_TAG bash -docker cp dummy:/usr/local/bin/polkadot target/release/polkadot -docker rm -f dummy diff --git a/scripts/run-rococo-local.sh b/scripts/run-rococo-local.sh deleted file mode 100755 index a26a7772a2..0000000000 --- a/scripts/run-rococo-local.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/bash - -# User port XX000 -# Relay port XX000 -# 1xx for each node -# 42 for p2p -# 43 for http -# 44 for ws -# -# Parachain port (XX+1)000 -# 52 for p2p -# 53 for http -# 54 for ws -# -# Ex: USER_PORT=20000 scripts/run-rococo-local.sh -# will open port 20042, 20043, 20044 - -# Loading binary/specs variables -source scripts/_init_var.sh - - -RELAY_PORT=$((USER_PORT + 42)) -RELAY_INDEX=0 -BOOTNODES_ARGS="" -while nc -z -v -w5 ${RELAY_IP} ${RELAY_PORT} 2> /dev/null -do - echo "Found existing relay on ${RELAY_PORT}." - BOOTNODES_ARGS="$BOOTNODES_ARGS --bootnodes \ - /ip4/$RELAY_IP/tcp/${RELAY_PORT}/p2p/${COMMON_LOCAL_IDS[$RELAY_INDEX]}" - RELAY_INDEX=$((RELAY_INDEX + 1)) - RELAY_PORT=$((RELAY_PORT + 100)) - - if [ $RELAY_PORT -ge $((USER_PORT + 300)) ] - then - echo "No more relay port available! (limited to 3 relays)" - exit 1 - fi -done - -echo "relay ${RELAY_INDEX} - p2p-port: $((RELAY_PORT)), \ -http-port: $((RELAY_PORT + 1)) , ws-port: $((RELAY_PORT + 2))" - -if [ -z "$POLKADOT_VERSION" ]; then - POLKADOT_VERSION="sha-`egrep -o '/polkadot.*#([^\"]*)' Cargo.lock | \ - head -1 | sed 's/.*#//' | cut -c1-8`" -fi - -echo "Using Polkadot revision #${POLKADOT_VERSION}" - -# The -v build:/build allows to pass the spec files from the build folder to the docker container -docker run \ - -v $(pwd)/build:/build \ - -p $RELAY_PORT:$RELAY_PORT \ - -p $((RELAY_PORT + 1)):$((RELAY_PORT + 1)) \ - -p $((RELAY_PORT + 2)):$((RELAY_PORT + 2)) \ - -it purestake/moonbase-relay-testnet:$POLKADOT_VERSION \ - /usr/local/bin/polkadot \ - --chain rococo-local \ - --${WELL_KNOWN_USERS[$RELAY_INDEX]} \ - --node-key ${COMMON_NODE_KEYS[$RELAY_INDEX]} \ - --base-path /tmp \ - --validator \ - --force-authoring \ - --name relay_$RELAY_INDEX \ - --rpc-methods=Unsafe \ - --unsafe-rpc-external \ - --unsafe-ws-external \ - --rpc-cors all \ - --listen-addr /ip4/0.0.0.0/tcp/$((RELAY_PORT)) \ - --rpc-port $((RELAY_PORT + 1)) \ - --ws-port $((RELAY_PORT + 2)) \ - $BOOTNODES_ARGS \ - '-linfo,evm=debug,ethereum=trace,rpc=trace,txpool=debug,validation-worker=debug' diff --git a/scripts/toml-sort.sh b/scripts/toml-sort.sh index 74cc71cb2a..7db1087f1b 100755 --- a/scripts/toml-sort.sh +++ b/scripts/toml-sort.sh @@ -7,7 +7,7 @@ # to only check the formatting. if ! type "toml-sort" > /dev/null; then - echo "Please install toml-sort with command 'cargo install --git https://github.com/PureStake/toml_sort'" + echo "Please install toml-sort with command 'cargo install --git https://github.com/moonbeam-foundation/toml_sort'" else find . -name "Cargo.toml" -not -path "*/target/*" -exec toml-sort {} $@ \; fi diff --git a/tests/README.md b/tests/README.md index 84c01bc48c..aa3e631e43 100644 --- a/tests/README.md +++ b/tests/README.md @@ -1,6 +1,6 @@ # Functional testing for Moonbeam -:information_source: This is the location of all the typescript based tests for Moonbeam/Moonriver. +:information_source: This is the location of all the typescript based tests for Moonbeam/Moonriver. In the future this will be replaced by the `/test/` folder which is using the [Moonwall](https://github.com/Moonsong-Labs/moonwall) framework. This folder contains a set of functional tests designed for Moonbeam network. @@ -149,24 +149,7 @@ Those tests are intended to run using an exported state from an existing network They require to specify the exported state, the runtime name and the parachain id. Also the exported state needs to be modified using the state-modifier.ts script. -> N.B. The most uptodate way of forking live chain state can be found in our tools-repo: https://github.com/PureStake/moonbeam-tools - -### End to end script (automated) - -You can run the full process using the docker image: - -``` -docker run -e GIT_TAG=perm-runtime-1605 -e NETWORK=moonriver -e RUNTIME_NAME=moonriver purestake/moonbeam-fork-tests:0.0.5 -``` - -or locally (for debugging pruposes) with the script: - -``` -ROOT_FOLDER=/tmp/moonbeam-states GIT_TAG=perm-runtime-1604 NETWORK=moonbase-alpha RUNTIME_NAME=moobase ./scripts/run-fork-test.sh -``` - -Where `ROOT_FOLDER` should be an empty folder - +> N.B. The most uptodate way of forking live chain state can be found in our tools-repo: https://github.com/Moonsong-Labs/moonbeam-tools ### Starting the node separately @@ -177,9 +160,3 @@ PARA_ID=2004 PORT_PREFIX=51 ./node_modules/.bin/ts-node spawn-fork-node.ts PARA_ID=1000 PORT_PREFIX=51 ./node_modules/.bin/ts-node spawn-fork-node.ts PARA_ID=2023 PORT_PREFIX=51 ./node_modules/.bin/ts-node spawn-fork-node.ts ``` - -### Generating moonbeam-fork-test image - -``` -docker build ./scripts -t purestake/moonbeam-fork-tests:0.0.5 -f docker/moonbeam-fork-tests.Dockerfile -``` diff --git a/tests/run-para-tests.sh b/tests/run-para-tests.sh deleted file mode 100755 index 60ff611a31..0000000000 --- a/tests/run-para-tests.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -POLKADOT_REPO=${POLKADOT_REPO:-$(egrep -o 'https.*/polkadot' ../Cargo.lock | head -1)} -POLKADOT_COMMIT=${POLKADOT_COMMIT:-$(egrep -o '/polkadot.*#([^\"]*)' ../Cargo.lock | head -1 | sed 's/.*#//' | cut -c1-8)} -DOCKER_TAG="purestake/moonbase-relay-testnet:sha-$POLKADOT_COMMIT" - -mkdir -p binaries -export RELAY_BINARY_PATH="binaries/polkadot-$POLKADOT_COMMIT" - -if [[ ! -e $RELAY_BINARY_PATH ]]; then - echo "missing $RELAY_BINARY_PATH - downloading..." - docker rm -f dummy 2> /dev/null - docker create -ti --name dummy $DOCKER_TAG bash - docker cp dummy:/usr/local/bin/polkadot $RELAY_BINARY_PATH - docker rm -f dummy -fi - - -export BINARY_PATH=${BINARY_PATH:-"../target/release/moonbeam"} -export FORCE_COMPILED_WASM=true - -node node_modules/.bin/mocha -r ts-node/register 'para-tests/**/test-*.ts' \ No newline at end of file diff --git a/tests/util/binaries.ts b/tests/util/binaries.ts index 2669fddb2b..4df35982e0 100644 --- a/tests/util/binaries.ts +++ b/tests/util/binaries.ts @@ -26,7 +26,7 @@ export async function getGithubReleaseBinary(url: string, binaryPath: string): P export async function getMoonbeamReleaseBinary(binaryTag: string): Promise { const binaryPath = path.join(BINARY_DIRECTORY, `moonbeam-${binaryTag}`); return getGithubReleaseBinary( - `https://github.com/PureStake/moonbeam/releases/download/${binaryTag}/moonbeam`, + `https://github.com/moonbeam-foundation/moonbeam/releases/download/${binaryTag}/moonbeam`, binaryPath ); } @@ -56,7 +56,7 @@ export async function getMoonbeamDockerBinary(binaryTag: string): Promise { if (binaryTag.startsWith(`v`)) { return getGithubReleaseBinary( - `https://github.com/PureStake/moonbeam/releases/download/${binaryTag}/moonbeam`, + `https://github.com/moonbeam-foundation/moonbeam/releases/download/${binaryTag}/moonbeam`, binaryPath ); } else if (binaryTag.startsWith(`sha`)) { - return getDockerBuildBinary(`purestake/moonbeam:${binaryTag}`, binaryPath); + return getDockerBuildBinary(`moonbeamfoundation/moonbeam:${binaryTag}`, binaryPath); } else if (/^[0-9]/g.test(binaryTag)) { // sha given without prefix - return getDockerBuildBinary(`purestake/moonbeam:sha-${binaryTag}`, binaryPath); + return getDockerBuildBinary(`moonbeamfoundation/moonbeam:sha-${binaryTag}`, binaryPath); } else { const sha = child_process.execSync(`git rev-list -n 1 ${binaryTag}`).toString(); - return getDockerBuildBinary(`purestake/moonbeam:sha-${sha.slice(0, 8)}`, binaryPath); + return getDockerBuildBinary(`moonbeamfoundation/moonbeam:sha-${sha.slice(0, 8)}`, binaryPath); } } diff --git a/tools/github/print-runtime-release-issue.ts b/tools/github/print-runtime-release-issue.ts index 08f0e9a1ac..74240a32d3 100644 --- a/tools/github/print-runtime-release-issue.ts +++ b/tools/github/print-runtime-release-issue.ts @@ -40,7 +40,7 @@ with runtime-${previousVersion} => runtime-${newVersion} `-f from=runtime-${previousVersion} -f to=runtime-${newVersion}\` - [ ] Review the generated Draft and clean a bit the messages if needed (keep it draft) - [ ] Create the tracing runtime on moonbeam-runtime-overrides -(see https://github.com/PureStake/moonbeam-runtime-overrides/blob/master/README.md) +(see https://github.com/moonbeam-foundation/moonbeam-runtime-overrides/blob/master/README.md) - [ ] Upgrade typescript API: Start the github action "Upgrade typescript API" - [ ] Add new tracing substitute in network configuration - [ ] Upgrade stagenet @@ -59,7 +59,7 @@ with ${lastClientVersion} and master ## Pre-Release - [ ] Cleanup previous migrations ( - https://github.com/PureStake/moonbeam/blob/master/runtime/common/src/migrations.rs) + https://github.com/moonbeam-foundation/moonbeam/blob/master/runtime/common/src/migrations.rs) - [ ] Check that proxy types are adapted to extrinsics changes ( read all PR descriptions with B7-runtimenoteworthy) - [ ] Re-run all extrinsics/hooks benchmarks. diff --git a/tools/github/print-version-bump-info.ts b/tools/github/print-version-bump-info.ts index 7d7962227a..92fc87d49d 100644 --- a/tools/github/print-version-bump-info.ts +++ b/tools/github/print-version-bump-info.ts @@ -7,7 +7,7 @@ async function printInfo(octokit: Octokit, previousVersion: string, nextVersion: substrate: "paritytech", polkadot: "paritytech", cumulus: "paritytech", - nimbus: "purestake", + nimbus: "moonbeam-foundation", }; const prefixes = { substrate: "polkadot-", diff --git a/typescript-api/package.json b/typescript-api/package.json index 1cc6c9c096..dda8e99d8a 100644 --- a/typescript-api/package.json +++ b/typescript-api/package.json @@ -6,10 +6,10 @@ "description": "Moonbeam types augment for @polkadot/api", "author": "PureStake", "license": "GPL-3.0-only", - "homepage": "https://github.com/PureStake/moonbeam/tree/master/typescript-api#readme", + "homepage": "https://github.com/moonbeam-foundation/moonbeam/tree/master/typescript-api#readme", "repository": { "type": "git", - "url": "https://github.com/PureStake/moonbeam.git", + "url": "https://github.com/moonbeam-foundation/moonbeam.git", "directory": "typescript-api" }, "engines": {