diff --git a/.github/workflows/create-geth-image-legacy.yml b/.github/workflows/create-geth-image-legacy.yml deleted file mode 100644 index dd7c8a1c..00000000 --- a/.github/workflows/create-geth-image-legacy.yml +++ /dev/null @@ -1,167 +0,0 @@ -name: Create Legacy Geth Image -run-name: Creating Legacy Geth Image for ${{ inputs.tag }}-${{ inputs.genesis_validators }}-node-legacy -on: - workflow_dispatch: - inputs: - tag: - description: Which tag should we deploy against? - required: true - genesis_validators: - description: The aggregate key generated from generate-genesis-keys - type: choice - options: - - "1" - - "3" - chainflip_backend_ref: - description: The branch, tag or commit of chainflip-backend to use - required: true - default: "main" - docker_image_tag_suffix: - description: A suffix to append to the image tag - required: false - default: "" - -jobs: - build-geth-base-image: - runs-on: [self-hosted, linux, x64, ephemeral] - steps: - - name: Checkout - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - - - name: Set up QEMU - uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 - - - name: Docker meta - id: meta - uses: docker/metadata-action@31cebacef4805868f9ce9a0cb03ee36c32df2ac4 - with: - images: ghcr.io/${{ github.repository }}/geth-base - flavor: | - latest=true - tags: | - type=semver,pattern={{raw}} - type=raw,value=latest - - - name: Login to DockerHub - uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build and push - uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 - with: - context: ci/docker/geth/ - push: true - tags: ${{ steps.meta.outputs.tags }} - cache-from: type=gha - cache-to: type=gha,mode=max - - build-geth-network: - runs-on: [self-hosted, linux, x64, ephemeral] - env: - IMAGE_TAG: ${{ inputs.tag }}-${{ inputs.genesis_validators }}-node${{ inputs.docker_image_tag_suffix }}-legacy - needs: - - build-geth-base-image - services: - geth: - image: ghcr.io/${{ github.repository }}/geth-base:latest - ports: - - 8545:8545 - - 8546:8546 - - 8551:8551 - credentials: - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - steps: - - name: Checkout - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - with: - ref: ${{ inputs.tag }} - - - name: Checkout chainflip-backend @ ${{ inputs.chainflip_backend_ref }} - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - with: - token: ${{ secrets.CF_GITHUB_BOT_READONLY_BACKEND_REPO }} - repository: chainflip-io/chainflip-backend - path: chainflip-backend - ref: ${{ inputs.chainflip_backend_ref }} - - - name: Fetch agg_key - run: | - echo "AGG_KEY=$(jq -r .eth_agg_key chainflip-backend/localnet/init/keyshare/${{ inputs.genesis_validators }}-node/agg_keys.json)" >> $GITHUB_ENV - - - name: Login to DockerHub - uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Install Python virtualenv - run: pip install virtualenv - - - name: Setup Node - uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 - with: - node-version: "16" - - - name: Install Poetry - uses: snok/install-poetry@93ada01c735cc8a383ce0ce2ae205a21c415379b - - - run: npm install --global ganache-cli - - run: npm install --global yarn - - run: yarn - - run: poetry install - - # Ensure that the Deposit's bytecode hasn't changed - - run: npx hardhat node --port 10997 & - - run: poetry run brownie networks add Ethereum hardhat-modif host=http://localhost:10997 chainid=31337 - - run: poetry run brownie test tests/unit/vault/test_deployAndFetchBatch.py::test_getCreate2Addr --network hardhat-modif - - - name: Add the network - run: poetry run brownie networks add Ethereum docker host=http://localhost:8545 chainid=10997 - - - name: Deploy contracts - env: - SEED: test test test test test test test test test test test junk - NUM_GENESIS_VALIDATORS: ${{ inputs.genesis_validators }} - GOV_KEY: "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266" - COMM_KEY: "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266" - REDEMPTION_DELAY: "120" - GENESIS_STAKE: "1000000000000000000000" - DEPLOYER_ACCOUNT_INDEX: "0" - DEPLOY_ARTEFACT_ID: "docker" - run: poetry run brownie run deploy_contracts --network docker - - - name: Commit and push new geth image - run: | - CONTAINER=$(docker ps --format '{{.Names}}' | grep geth) - docker commit $CONTAINER ghcr.io/chainflip-io/chainflip-eth-contracts/geth:${{ env.IMAGE_TAG }} - docker push ghcr.io/chainflip-io/chainflip-eth-contracts/geth:${{ env.IMAGE_TAG }} - - - name: Summary - run: | - CONTRACTS=$(jq . ./scripts/.artefacts/docker.json) - echo "## Deployed Contracts for \`${{ inputs.genesis_validators }}-node\`" >> $GITHUB_STEP_SUMMARY - echo "\`agg_key\` = \`${{ env.AGG_KEY }}\`" >> $GITHUB_STEP_SUMMARY - echo "\`\`\`json" >> $GITHUB_STEP_SUMMARY - echo "$CONTRACTS" >> $GITHUB_STEP_SUMMARY - echo "\`\`\`" >> $GITHUB_STEP_SUMMARY - echo "## Docker Image" >> $GITHUB_STEP_SUMMARY - echo "\`ghcr.io/chainflip-io/chainflip-eth-contracts/geth:${{ env.IMAGE_TAG }}\`" >> $GITHUB_STEP_SUMMARY - - - name: Save agg key to file - run: echo ${{ env.AGG_KEY }} > agg_key - - - name: Save artifacts - uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 - with: - name: ${{ env.IMAGE_TAG }} - path: | - agg_key - ./scripts/.artefacts/docker.json