diff --git a/.github/actionlint.yaml b/.github/actionlint.yaml new file mode 100644 index 000000000000..98bda8e929b5 --- /dev/null +++ b/.github/actionlint.yaml @@ -0,0 +1,9 @@ +--- +# Configuration for actionlint (https://github.com/rhysd/actionlint). +# Run locally via: `mise run lint:actions`. + +self-hosted-runner: + # WarpBuild self-hosted runners used by performance-sensitive jobs. + labels: + - warp-ubuntu-2404-arm64-8x + - warp-ubuntu-2404-x64-8x diff --git a/.github/workflows/actions-lint.yml b/.github/workflows/actions-lint.yml new file mode 100644 index 000000000000..8042e369d060 --- /dev/null +++ b/.github/workflows/actions-lint.yml @@ -0,0 +1,33 @@ +name: GitHub Actions lint +permissions: + contents: read + +# Cancel workflow if there is a new change to the branch. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} + +on: + merge_group: + pull_request: + branches: + - main + paths: + - ".github/workflows/**" + - ".github/actionlint.yaml" + - "mise.toml" + push: + branches: + - main + paths: + - ".github/workflows/**" + - ".github/actionlint.yaml" + - "mise.toml" + +jobs: + actions-lint: + runs-on: ubuntu-slim + steps: + - uses: actions/checkout@v6 + - uses: jdx/mise-action@v4 + - run: mise run lint:actions diff --git a/.github/workflows/cargo-advisories.yml b/.github/workflows/cargo-advisories.yml index a130ac4a804f..fa7bb4e8c680 100644 --- a/.github/workflows/cargo-advisories.yml +++ b/.github/workflows/cargo-advisories.yml @@ -18,8 +18,8 @@ jobs: if: failure() run: | export WORKFLOW_URL="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}" - echo ${WORKFLOW_URL} - echo "WORKFLOW_URL=${WORKFLOW_URL}" >> $GITHUB_ENV + echo "${WORKFLOW_URL}" + echo "WORKFLOW_URL=${WORKFLOW_URL}" >> "$GITHUB_ENV" - uses: JasonEtco/create-an-issue@v2 if: failure() env: diff --git a/.github/workflows/cargo-publish-dry-run.yml b/.github/workflows/cargo-publish-dry-run.yml index d08e9f6dc774..07cafb91cd1a 100644 --- a/.github/workflows/cargo-publish-dry-run.yml +++ b/.github/workflows/cargo-publish-dry-run.yml @@ -26,9 +26,11 @@ jobs: run: | # External PRs do not have access to 'vars' or 'secrets'. if [[ "${{secrets.AWS_ACCESS_KEY_ID}}" != "" ]]; then - echo "SCCACHE_ENDPOINT=${{ vars.SCCACHE_ENDPOINT}}" >> $GITHUB_ENV - echo "SCCACHE_BUCKET=${{ vars.SCCACHE_BUCKET}}" >> $GITHUB_ENV - echo "SCCACHE_REGION=${{ vars.SCCACHE_REGION}}" >> $GITHUB_ENV + { + echo "SCCACHE_ENDPOINT=${{ vars.SCCACHE_ENDPOINT}}" + echo "SCCACHE_BUCKET=${{ vars.SCCACHE_BUCKET}}" + echo "SCCACHE_REGION=${{ vars.SCCACHE_REGION}}" + } >> "$GITHUB_ENV" fi - name: Checkout Sources uses: actions/checkout@v6 @@ -42,8 +44,8 @@ jobs: if: failure() run: | export WORKFLOW_URL="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}" - echo ${WORKFLOW_URL} - echo "WORKFLOW_URL=${WORKFLOW_URL}" >> $GITHUB_ENV + echo "${WORKFLOW_URL}" + echo "WORKFLOW_URL=${WORKFLOW_URL}" >> "$GITHUB_ENV" - uses: JasonEtco/create-an-issue@v2 if: failure() env: diff --git a/.github/workflows/checkpoints.yml b/.github/workflows/checkpoints.yml index 40829ea1c46b..7571c3172e32 100644 --- a/.github/workflows/checkpoints.yml +++ b/.github/workflows/checkpoints.yml @@ -15,7 +15,7 @@ jobs: - uses: actions/checkout@v6 - name: Update checkpoints run: | - docker run --rm -v $PWD:/app -w /app --entrypoint forest-dev ghcr.io/chainsafe/forest:edge update-checkpoints + docker run --rm -v "$PWD":/app -w /app --entrypoint forest-dev ghcr.io/chainsafe/forest:edge update-checkpoints # This is needed in order to have the commits signed. - uses: actions/create-github-app-token@v3 id: generate-token diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index a3700d1bc699..4adb4a27da0c 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -71,9 +71,11 @@ jobs: run: | # External PRs do not have access to 'vars' or 'secrets'. if [[ "${{secrets.AWS_ACCESS_KEY_ID}}" != "" ]]; then - echo "SCCACHE_ENDPOINT=${{ vars.SCCACHE_ENDPOINT}}" >> $GITHUB_ENV - echo "SCCACHE_BUCKET=${{ vars.SCCACHE_BUCKET}}" >> $GITHUB_ENV - echo "SCCACHE_REGION=${{ vars.SCCACHE_REGION}}" >> $GITHUB_ENV + { + echo "SCCACHE_ENDPOINT=${{ vars.SCCACHE_ENDPOINT}}" + echo "SCCACHE_BUCKET=${{ vars.SCCACHE_BUCKET}}" + echo "SCCACHE_REGION=${{ vars.SCCACHE_REGION}}" + } >> "$GITHUB_ENV" fi - name: Setup sccache uses: mozilla-actions/sccache-action@v0.0.9 @@ -96,8 +98,8 @@ jobs: - name: Fetch proof params and RPC test snapshots run: | # Use the same profile to re-use some compilation artifacts and speed up the entire job. - cargo llvm-cov run --profile codecov --no-report --bin forest-dev --no-default-features -- fetch-test-snapshots --actor-bundle $FOREST_ACTOR_BUNDLE_PATH - ls -ahl $FIL_PROOFS_PARAMETER_CACHE + cargo llvm-cov run --profile codecov --no-report --bin forest-dev --no-default-features -- fetch-test-snapshots --actor-bundle "$FOREST_ACTOR_BUNDLE_PATH" + ls -ahl "$FIL_PROOFS_PARAMETER_CACHE" - name: Generate code coverage run: mise codecov env: diff --git a/.github/workflows/curio-devnet-publish.yml b/.github/workflows/curio-devnet-publish.yml deleted file mode 100644 index 9f7b8685ee8a..000000000000 --- a/.github/workflows/curio-devnet-publish.yml +++ /dev/null @@ -1,60 +0,0 @@ -name: Curio devnet image -permissions: - contents: read - packages: write - -# Only build and publish this image on demand. -# The compilation adds significant overhead to the CI and it is not supposed -# to change very often (roughly once per network upgrade; ~3-4 months). -# This image is used in the local curio devnet. -on: - workflow_dispatch: - -jobs: - build-and-push-docker-image: - name: Build image and push to GHCR - runs-on: ubuntu-24.04 - steps: - - name: List cached docker images - run: docker image ls - - - name: Checkout code - uses: actions/checkout@v6 - - name: Login to Github Packages - uses: docker/login-action@v4 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Login to Docker Hub - uses: docker/login-action@v4 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - # This step yields the following labels - # - latest, - # - date+sha, e.g. 2023-01-19-da4692d, - - name: Docker Meta - id: meta - uses: docker/metadata-action@v6 - with: - images: ghcr.io/chainsafe/curio-devnet - tags: | - type=raw,value={{date 'YYYY-MM-DD'}}-{{sha}} - type=raw,value=latest,enable={{is_default_branch}} - - - name: Build image and push to GitHub Container Registry - uses: docker/build-push-action@v7 - with: - build-args: | - LOTUS_IMAGE=ghcr.io/chainsafe/lotus-devnet:2024-10-10-600728e - GOFLAGS="-tags=debug" - file: ./scripts/devnet-curio/curio.dockerfile - context: ./scripts/devnet-curio - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - push: true - - name: List docker images - run: docker image ls diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index dced3f98ede5..615cb25662ee 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -49,9 +49,11 @@ jobs: run: | # External PRs do not have access to 'vars' or 'secrets'. if [[ "${{secrets.AWS_ACCESS_KEY_ID}}" != "" ]]; then - echo "SCCACHE_ENDPOINT=${{ vars.SCCACHE_ENDPOINT}}" >> $GITHUB_ENV - echo "SCCACHE_BUCKET=${{ vars.SCCACHE_BUCKET}}" >> $GITHUB_ENV - echo "SCCACHE_REGION=${{ vars.SCCACHE_REGION}}" >> $GITHUB_ENV + { + echo "SCCACHE_ENDPOINT=${{ vars.SCCACHE_ENDPOINT}}" + echo "SCCACHE_BUCKET=${{ vars.SCCACHE_BUCKET}}" + echo "SCCACHE_REGION=${{ vars.SCCACHE_REGION}}" + } >> "$GITHUB_ENV" fi - name: Checkout Sources uses: actions/checkout@v6 @@ -84,11 +86,13 @@ jobs: run: | # External PRs do not have access to 'vars' or 'secrets'. if [[ "${{secrets.AWS_ACCESS_KEY_ID}}" != "" ]]; then - echo "SCCACHE_ENDPOINT=${{ vars.SCCACHE_ENDPOINT}}" >> $GITHUB_ENV - echo "SCCACHE_BUCKET=${{ vars.SCCACHE_BUCKET}}" >> $GITHUB_ENV - echo "SCCACHE_REGION=${{ vars.SCCACHE_REGION}}" >> $GITHUB_ENV + { + echo "SCCACHE_ENDPOINT=${{ vars.SCCACHE_ENDPOINT}}" + echo "SCCACHE_BUCKET=${{ vars.SCCACHE_BUCKET}}" + echo "SCCACHE_REGION=${{ vars.SCCACHE_REGION}}" + } >> "$GITHUB_ENV" fi - echo "SCCACHE_S3_KEY_PREFIX=aarch64" >> $GITHUB_ENV + echo "SCCACHE_S3_KEY_PREFIX=aarch64" >> "$GITHUB_ENV" - name: Checkout Sources uses: actions/checkout@v6 if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') diff --git a/.github/workflows/dockerfile-check.yml b/.github/workflows/dockerfile-check.yml index dcafe66e5252..6972cbd6d800 100644 --- a/.github/workflows/dockerfile-check.yml +++ b/.github/workflows/dockerfile-check.yml @@ -22,8 +22,8 @@ jobs: if: always() run: | export WORKFLOW_URL="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}" - echo ${WORKFLOW_URL} - echo "WORKFLOW_URL=${WORKFLOW_URL}" >> $GITHUB_ENV + echo "${WORKFLOW_URL}" + echo "WORKFLOW_URL=${WORKFLOW_URL}" >> "$GITHUB_ENV" - uses: JasonEtco/create-an-issue@v2 if: failure() env: diff --git a/.github/workflows/forest.yml b/.github/workflows/forest.yml index d04e473e1441..fa76db579265 100644 --- a/.github/workflows/forest.yml +++ b/.github/workflows/forest.yml @@ -48,11 +48,13 @@ jobs: run: | # External PRs do not have access to 'vars' or 'secrets'. if [[ "$AWS_ACCESS_KEY_ID" != "" ]]; then - echo "SCCACHE_ENDPOINT=${{ vars.SCCACHE_ENDPOINT}}" >> $GITHUB_ENV - echo "SCCACHE_BUCKET=${{ vars.SCCACHE_BUCKET}}" >> $GITHUB_ENV - echo "SCCACHE_REGION=${{ vars.SCCACHE_REGION}}" >> $GITHUB_ENV + { + echo "SCCACHE_ENDPOINT=${{ vars.SCCACHE_ENDPOINT}}" + echo "SCCACHE_BUCKET=${{ vars.SCCACHE_BUCKET}}" + echo "SCCACHE_REGION=${{ vars.SCCACHE_REGION}}" + } >> "$GITHUB_ENV" fi - echo "SCCACHE_S3_KEY_PREFIX=macos" >> $GITHUB_ENV + echo "SCCACHE_S3_KEY_PREFIX=macos" >> "$GITHUB_ENV" - name: Checkout Sources uses: actions/checkout@v6 - name: Setup sccache @@ -75,9 +77,11 @@ jobs: run: | # External PRs do not have access to 'vars' or 'secrets'. if [[ "${{secrets.AWS_ACCESS_KEY_ID}}" != "" ]]; then - echo "SCCACHE_ENDPOINT=${{ vars.SCCACHE_ENDPOINT}}" >> $GITHUB_ENV - echo "SCCACHE_BUCKET=${{ vars.SCCACHE_BUCKET}}" >> $GITHUB_ENV - echo "SCCACHE_REGION=${{ vars.SCCACHE_REGION}}" >> $GITHUB_ENV + { + echo "SCCACHE_ENDPOINT=${{ vars.SCCACHE_ENDPOINT}}" + echo "SCCACHE_BUCKET=${{ vars.SCCACHE_BUCKET}}" + echo "SCCACHE_REGION=${{ vars.SCCACHE_REGION}}" + } >> "$GITHUB_ENV" fi - name: Checkout Sources uses: actions/checkout@v6 @@ -473,8 +477,8 @@ jobs: docker volume create devnet_filecoin-proofs docker run --rm \ -v devnet_filecoin-proofs:/proofs \ - -v $FIL_PROOFS_PARAMETER_CACHE:/cache \ - $SHELL_IMAGE \ + -v "$FIL_PROOFS_PARAMETER_CACHE":/cache \ + "$SHELL_IMAGE" \ sh -c "cp /cache/* /proofs" - uses: actions/checkout@v6 - uses: actions/download-artifact@v8 @@ -494,63 +498,10 @@ jobs: run: | docker run --rm \ -v devnet_filecoin-proofs:/proofs \ - -v $FIL_PROOFS_PARAMETER_CACHE:/cache \ - $SHELL_IMAGE \ + -v "$FIL_PROOFS_PARAMETER_CACHE":/cache \ + "$SHELL_IMAGE" \ sh -c "cp /proofs/* /cache" - sudo chmod -R 755 $FIL_PROOFS_PARAMETER_CACHE - local-devnet-curio-check: - # Disabling this job as it is not providing any value until the curio setup is fixed. See: https://github.com/ChainSafe/forest/issues/5171 - if: false - name: Devnet Curio checks - runs-on: ubuntu-24.04 - needs: - - build-ubuntu - env: - # We use a custom Dockerfile for CI to speed up the build process. - FOREST_DOCKERFILE_OVERRIDE: scripts/devnet/forest_ci.dockerfile - steps: - - uses: actions/cache@v5 - id: cache - with: - path: "${{ env.FIL_PROOFS_PARAMETER_CACHE }}" - key: proof-params-2k - - name: Load cache into volume - if: steps.cache.outputs.cache-hit == 'true' - run: | - docker volume create devnet_filecoin-proofs - docker run --rm \ - -v devnet_filecoin-proofs:/proofs \ - -v $FIL_PROOFS_PARAMETER_CACHE:/cache \ - $SHELL_IMAGE \ - sh -c "cp /cache/* /proofs" - - uses: actions/checkout@v6 - - uses: actions/download-artifact@v8 - with: - name: "forest-${{ runner.os }}" - - name: Devnet setup - run: | - cp ./scripts/devnet/setup.sh ./scripts/devnet-curio/setup.sh - chmod +x ./scripts/devnet-curio/setup.sh - ./scripts/devnet-curio/setup.sh - timeout-minutes: ${{ fromJSON(env.SCRIPT_TIMEOUT_MINUTES) }} - - name: Devnet check - run: | - cp ./scripts/devnet/check.sh ./scripts/devnet-curio/check.sh - chmod +x ./scripts/devnet-curio/check.sh - ./scripts/devnet-curio/check.sh - timeout-minutes: ${{ fromJSON(env.SCRIPT_TIMEOUT_MINUTES) }} - - name: Dump docker logs - if: always() - uses: jwalton/gh-docker-logs@v2 - - name: Prepare cache folder for uploading - if: steps.cache.outputs.cache-hit != 'true' - run: | - docker run --rm \ - -v devnet_filecoin-proofs:/proofs \ - -v $FIL_PROOFS_PARAMETER_CACHE:/cache \ - $SHELL_IMAGE \ - sh -c "cp /proofs/* /cache" - sudo chmod -R 755 $FIL_PROOFS_PARAMETER_CACHE + sudo chmod -R 755 "$FIL_PROOFS_PARAMETER_CACHE" bootstrap-checks-forest: needs: - build-ubuntu @@ -663,8 +614,8 @@ jobs: if: always() run: | export WORKFLOW_URL="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}" - echo ${WORKFLOW_URL} - echo "WORKFLOW_URL=${WORKFLOW_URL}" >> $GITHUB_ENV + echo "${WORKFLOW_URL}" + echo "WORKFLOW_URL=${WORKFLOW_URL}" >> "$GITHUB_ENV" - uses: JasonEtco/create-an-issue@v2 if: github.ref == 'refs/heads/main' && failure() env: diff --git a/.github/workflows/python-lint.yml b/.github/workflows/python-lint.yml index b0f4b6ec6020..81af81c639fe 100644 --- a/.github/workflows/python-lint.yml +++ b/.github/workflows/python-lint.yml @@ -32,8 +32,7 @@ jobs: with: python-version: "3.12" - run: pip install black flake8 - - name: Run Python linters - uses: wearerequired/lint-action@v2 - with: - black: true - flake8: true + - name: Run black + run: black --check scripts/ + - name: Run flake8 + run: flake8 scripts/ diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6be2770ffc03..20b4c66b3246 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -41,7 +41,7 @@ jobs: - name: Pack artifacts run: | for bin in forest-${{ github.ref_name }}/*; do - sha256sum $bin > $bin.sha256 + sha256sum "$bin" > "$bin".sha256 done cp -rv CHANGELOG.md LICENSE-APACHE LICENSE-MIT README.md forest-${{ github.ref_name }} zip -r ${{ matrix.file }} forest-${{ github.ref_name }} diff --git a/.github/workflows/release_dispatch.yml b/.github/workflows/release_dispatch.yml index 3c1b4d48302d..1ef1803ec4bd 100644 --- a/.github/workflows/release_dispatch.yml +++ b/.github/workflows/release_dispatch.yml @@ -45,7 +45,7 @@ jobs: - name: Pack artifacts run: | for bin in forest-${{ github.event.inputs.tag }}/*; do - sha256sum $bin > $bin.sha256 + sha256sum "$bin" > "$bin".sha256 done cp -rv CHANGELOG.md LICENSE-APACHE LICENSE-MIT README.md forest-${{ github.event.inputs.tag }} zip -r ${{ matrix.file }} forest-${{ github.event.inputs.tag }} diff --git a/.github/workflows/rpc-parity-report.yml b/.github/workflows/rpc-parity-report.yml index f08b8f77c167..024c9bd66c02 100644 --- a/.github/workflows/rpc-parity-report.yml +++ b/.github/workflows/rpc-parity-report.yml @@ -52,8 +52,8 @@ jobs: if: always() run: | export WORKFLOW_URL="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}" - echo ${WORKFLOW_URL} - echo "WORKFLOW_URL=${WORKFLOW_URL}" >> $GITHUB_ENV + echo "${WORKFLOW_URL}" + echo "WORKFLOW_URL=${WORKFLOW_URL}" >> "$GITHUB_ENV" - uses: JasonEtco/create-an-issue@v2 if: github.ref == 'refs/heads/main' && failure() env: diff --git a/.github/workflows/rpc-parity.yml b/.github/workflows/rpc-parity.yml index 492c29b7e010..3880e0ab5159 100644 --- a/.github/workflows/rpc-parity.yml +++ b/.github/workflows/rpc-parity.yml @@ -50,8 +50,8 @@ jobs: if: always() run: | export WORKFLOW_URL="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}" - echo ${WORKFLOW_URL} - echo "WORKFLOW_URL=${WORKFLOW_URL}" >> $GITHUB_ENV + echo "${WORKFLOW_URL}" + echo "WORKFLOW_URL=${WORKFLOW_URL}" >> "$GITHUB_ENV" - uses: JasonEtco/create-an-issue@v2 if: github.ref == 'refs/heads/main' && failure() env: diff --git a/.github/workflows/rust-lint.yml b/.github/workflows/rust-lint.yml index 4ef9517bfa20..bcfa0724f434 100644 --- a/.github/workflows/rust-lint.yml +++ b/.github/workflows/rust-lint.yml @@ -43,9 +43,11 @@ jobs: run: | # External PRs do not have access to 'vars' or 'secrets'. if [[ "$AWS_ACCESS_KEY_ID" != "" ]]; then - echo "SCCACHE_ENDPOINT=${{ vars.SCCACHE_ENDPOINT}}" >> $GITHUB_ENV - echo "SCCACHE_BUCKET=${{ vars.SCCACHE_BUCKET}}" >> $GITHUB_ENV - echo "SCCACHE_REGION=${{ vars.SCCACHE_REGION}}" >> $GITHUB_ENV + { + echo "SCCACHE_ENDPOINT=${{ vars.SCCACHE_ENDPOINT}}" + echo "SCCACHE_BUCKET=${{ vars.SCCACHE_BUCKET}}" + echo "SCCACHE_REGION=${{ vars.SCCACHE_REGION}}" + } >> "$GITHUB_ENV" fi - name: Checkout Sources uses: actions/checkout@v6 diff --git a/.github/workflows/snapshot-parity.yml b/.github/workflows/snapshot-parity.yml index d88ad840eac0..a4e9719f6138 100644 --- a/.github/workflows/snapshot-parity.yml +++ b/.github/workflows/snapshot-parity.yml @@ -23,8 +23,8 @@ jobs: if: always() run: | export WORKFLOW_URL="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}" - echo ${WORKFLOW_URL} - echo "WORKFLOW_URL=${WORKFLOW_URL}" >> $GITHUB_ENV + echo "${WORKFLOW_URL}" + echo "WORKFLOW_URL=${WORKFLOW_URL}" >> "$GITHUB_ENV" - uses: JasonEtco/create-an-issue@v2 if: github.ref == 'refs/heads/main' && failure() env: diff --git a/mise.toml b/mise.toml index 1e8e15d54413..5bd41cf01117 100644 --- a/mise.toml +++ b/mise.toml @@ -41,6 +41,13 @@ taplo fmt --check taplo lint ''' +[tasks."lint:actions"] +description = "Check GitHub Actions workflow files." +tools.actionlint = "1.7.12" +run = ''' +actionlint +''' + [tasks."lint:rust-fmt"] description = "Run cargo-fmt to check Rust code formatting." run = ''' diff --git a/scripts/devnet-curio/.env b/scripts/devnet-curio/.env deleted file mode 100644 index 10c6452445be..000000000000 --- a/scripts/devnet-curio/.env +++ /dev/null @@ -1,25 +0,0 @@ -LOTUS_IMAGE=ghcr.io/chainsafe/lotus-devnet:2024-12-06-2368695 -CURIO_IMAGE=ghcr.io/chainsafe/curio-devnet:2025-01-20-622bacd -FOREST_DATA_DIR=/forest_data -LOTUS_DATA_DIR=/lotus_data -CURIO_REPO_PATH=/var/lib/curio -FIL_PROOFS_PARAMETER_CACHE=/var/tmp/filecoin-proof-parameters -MINER_ACTOR_ADDRESS=t01000 -LOTUS_RPC_PORT=1234 -LOTUS_P2P_PORT=1235 -MINER_RPC_PORT=2345 -FOREST_RPC_PORT=3456 -FOREST_OFFLINE_RPC_PORT=3457 -F3_RPC_PORT=23456 -F3_FINALITY=10 -GENESIS_NETWORK_VERSION=25 -SHARK_HEIGHT=-10 -HYGGE_HEIGHT=-9 -LIGHTNING_HEIGHT=-8 -THUNDER_HEIGHT=-7 -WATERMELON_HEIGHT=-6 -DRAGON_HEIGHT=-5 -WAFFLE_HEIGHT=-4 -TUKTUK_HEIGHT=-3 -TEEP_HEIGHT=-2 -TARGET_HEIGHT=24 diff --git a/scripts/devnet-curio/README.md b/scripts/devnet-curio/README.md deleted file mode 100644 index d14e2623b2e3..000000000000 --- a/scripts/devnet-curio/README.md +++ /dev/null @@ -1,90 +0,0 @@ -# Local devnet setup - -The devnet consists of a: - -- Lotus miner, -- Lotus node, -- Forest node. -- Curio node. -- YugabyteDB. - -It's packed in a docker compose setup for convenience and ease of usage. By -default, running it will expose relevant RPC and P2P ports to the host: - -- 1234 - Lotus RPC, -- 9090 - Lotus P2P port, -- 2345 - Miner RPC, -- 3456 - Forest RPC. -- 12300 - Curio API. -- 4701 - Curio UI. -- 32100 - Curio Market. - -## Running the devnet - -Run it with: - -```shell -docker compose up --build -``` - -This will build the local Forest (using the Dockerfile in the project's root) -image, tagged Lotus and setup the devnet. Initial setup may be slow due to -fetching params and setting everything up. Consecutive starts will be quick. - -Stop the devnet with: - -```shell -docker compose down -``` - -Remove the devnet: - -```shell -docker compose rm -``` - -## Interacting with the devnet via CLI - -Exec into the `forest` container: - -```shell -docker exec -it forest /bin/bash -``` - -and setup credentials. Then run any command: - -```shell -export TOKEN=$(cat /forest_data/token.jwt) -export FULLNODE_API_INFO=$TOKEN:/dns/forest/tcp/1234/http - -forest-cli net peers -``` - -## Known problems - -- YugabyteDB sometimes fails to start. If this happens, restart the devnet. - -## Local devnet development - -If you prefer to have Forest running directly on the host, you can comment it -out and draw inspiration from the `docker-compose.yml` on how to connect it to -Lotus. In short, you will need to obtain the peer id, network name and the -genesis file. - -## Testing mining - -By default, Curio won't mine any sectors. You can add sectors by starting a new -container: - -``` -docker exec -it curio /bin/bash -``` - -And then run: - -``` -curio seal start --now --cc --actor t01002 -``` - -You can inspect the status at `localhost:4701`. After a few hours, the sectors -should be sealed and proven. diff --git a/scripts/devnet-curio/curio.dockerfile b/scripts/devnet-curio/curio.dockerfile deleted file mode 100644 index f8e5ffb4be0b..000000000000 --- a/scripts/devnet-curio/curio.dockerfile +++ /dev/null @@ -1,102 +0,0 @@ -##################################### -ARG LOTUS_IMAGE -# hadolint ignore=DL3006 -FROM ${LOTUS_IMAGE} as lotus-test -FROM golang:1.23.5-bullseye AS curio-builder - -RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates build-essential clang ocl-icd-opencl-dev ocl-icd-libopencl1 jq libhwloc-dev - -ENV XDG_CACHE_HOME="/tmp" - -ENV RUSTUP_HOME=/usr/local/rustup \ - CARGO_HOME=/usr/local/cargo \ - PATH=/usr/local/cargo/bin:$PATH \ - RUST_VERSION=1.73.0 - -SHELL ["/bin/bash", "-o", "pipefail", "-c"] - -RUN set -eux; \ - dpkgArch="$(dpkg --print-architecture)"; \ - case "${dpkgArch##*-}" in \ - amd64) rustArch='x86_64-unknown-linux-gnu'; rustupSha256='5cc9ffd1026e82e7fb2eec2121ad71f4b0f044e88bca39207b3f6b769aaa799c' ;; \ - arm64) rustArch='aarch64-unknown-linux-gnu'; rustupSha256='e189948e396d47254103a49c987e7fb0e5dd8e34b200aa4481ecc4b8e41fb929' ;; \ - *) echo >&2 "unsupported architecture: ${dpkgArch}"; exit 1 ;; \ - esac; \ - url="https://static.rust-lang.org/rustup/archive/1.25.1/${rustArch}/rustup-init"; \ - wget --quiet "$url"; \ - echo "${rustupSha256} *rustup-init" | sha256sum -c -; \ - chmod +x rustup-init; \ - ./rustup-init -y --no-modify-path --profile minimal --default-toolchain $RUST_VERSION --default-host ${rustArch}; \ - rm rustup-init; \ - chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \ - rustup --version; \ - cargo --version; \ - rustc --version; - -RUN git clone --depth 1 --branch v1.24.3 https://github.com/filecoin-project/curio.git /opt/curio - -WORKDIR /opt/curio - -### make configurable filecoin-ffi build -ARG FFI_BUILD_FROM_SOURCE=0 -ENV FFI_BUILD_FROM_SOURCE=${FFI_BUILD_FROM_SOURCE} - -RUN make clean deps - -ARG RUSTFLAGS="" -ARG GOFLAGS="" - -RUN make build - -##################################### -FROM ubuntu:22.04 AS curio-all-in-one - -RUN apt-get update && \ - apt-get install -y --no-install-recommends dnsutils vim curl aria2 && \ - apt-get clean && \ - rm -rf /var/lib/apt/lists/* - -# Copy libraries and binaries from curio-builder -COPY --from=curio-builder /etc/ssl/certs /etc/ssl/certs -COPY --from=curio-builder /lib/*/libdl.so.2 /lib/ -COPY --from=curio-builder /lib/*/librt.so.1 /lib/ -COPY --from=curio-builder /lib/*/libgcc_s.so.1 /lib/ -COPY --from=curio-builder /lib/*/libutil.so.1 /lib/ -COPY --from=curio-builder /usr/lib/*/libltdl.so.7 /lib/ -COPY --from=curio-builder /usr/lib/*/libnuma.so.1 /lib/ -COPY --from=curio-builder /usr/lib/*/libhwloc.so.* /lib/ -COPY --from=curio-builder /usr/lib/*/libOpenCL.so.1 /lib/ - -# Setup user and OpenCL configuration -RUN useradd -r -u 532 -U fc && \ - mkdir -p /etc/OpenCL/vendors && \ - echo "libnvidia-opencl.so.1" > /etc/OpenCL/vendors/nvidia.icd - -# Environment setup -ENV FILECOIN_PARAMETER_CACHE=/var/tmp/filecoin-proof-parameters \ - LOTUS_MINER_PATH=/var/lib/lotus-miner \ - LOTUS_PATH=/var/lib/lotus \ - CURIO_REPO_PATH=/var/lib/curio - -# Copy binaries and scripts -COPY --from=lotus-test /usr/local/bin/lotus /usr/local/bin/ -COPY --from=lotus-test /usr/local/bin/lotus-seed /usr/local/bin/ -COPY --from=lotus-test /usr/local/bin/lotus-shed /usr/local/bin/ -COPY --from=lotus-test /usr/local/bin/lotus-miner /usr/local/bin/ -COPY --from=curio-builder /opt/curio/curio /usr/local/bin/ -COPY --from=curio-builder /opt/curio/sptool /usr/local/bin/ - -# Set up directories and permissions -RUN mkdir /var/tmp/filecoin-proof-parameters \ - /var/lib/lotus \ - /var/lib/lotus-miner \ - /var/lib/curio && \ - chown fc: /var/tmp/filecoin-proof-parameters /var/lib/lotus /var/lib/lotus-miner /var/lib/curio - -# Define volumes -VOLUME ["/var/tmp/filecoin-proof-parameters", "/var/lib/lotus", "/var/lib/lotus-miner", "/var/lib/curio"] - -# Expose necessary ports -EXPOSE 1234 2345 12300 4701 32100 - -CMD ["/bin/bash"] diff --git a/scripts/devnet-curio/curio.env b/scripts/devnet-curio/curio.env deleted file mode 100644 index 6a8ebde12b73..000000000000 --- a/scripts/devnet-curio/curio.env +++ /dev/null @@ -1,6 +0,0 @@ -LOTUS_PATH=/lotus_data/lotus-local-net -LOTUS_MINER_PATH=/lotus_data/lotus-miner-local-net -LOTUS_SKIP_GENESIS_CHECK=_yes_ -LOTUS_API_LISTENADDRESS=/dns/lotus-miner/tcp/2345/http -CURIO_REPO_PATH=/var/lib/curio -CURIO_HARMONYDB_HOSTS=yugabyte diff --git a/scripts/devnet-curio/docker-compose.yml b/scripts/devnet-curio/docker-compose.yml deleted file mode 100644 index 63e47efc8d3f..000000000000 --- a/scripts/devnet-curio/docker-compose.yml +++ /dev/null @@ -1,297 +0,0 @@ -# Docker compose file to run a local devnet. -# The devnet consists of a: -# - Lotus node (2k build), -# - Lotus miner (2k build), -# - Forest node. -# - Curio node. -# - YugabyteDB. - -services: - # Basic devnet initialisation. This will populate Lotus data volume with necessary artifacts - # to run a devnet. The initialisation is a lengthy process and occurs only at the first - # `docker compose up`. - lotus_init: - image: ${LOTUS_IMAGE} - volumes: - - filecoin-proofs:${FIL_PROOFS_PARAMETER_CACHE} - - ./data/lotus:${LOTUS_DATA_DIR} - environment: - - LOTUS_SHARK_HEIGHT=${SHARK_HEIGHT} - - LOTUS_HYGGE_HEIGHT=${HYGGE_HEIGHT} - - LOTUS_LIGHTNING_HEIGHT=${LIGHTNING_HEIGHT} - - LOTUS_THUNDER_HEIGHT=${THUNDER_HEIGHT} - - LOTUS_WATERMELON_HEIGHT=${WATERMELON_HEIGHT} - - LOTUS_DRAGON_HEIGHT=${DRAGON_HEIGHT} - - LOTUS_GENESIS_NETWORK_VERSION=${GENESIS_NETWORK_VERSION} - - LOTUS_WAFFLE_HEIGHT=${WAFFLE_HEIGHT} - - LOTUS_TUKTUK_HEIGHT=${TUKTUK_HEIGHT} - - LOTUS_TEEP_HEIGHT=${TEEP_HEIGHT} - env_file: - - lotus.env - entrypoint: ["/bin/bash", "-c"] - command: - - | - set -euxo pipefail - if [ ! -f ${LOTUS_DATA_DIR}/NODE_INITIALISED ]; then - lotus --version - lotus fetch-params 2048 - lotus-seed --sector-dir ${LOTUS_DATA_DIR}/genesis-sectors pre-seal --sector-size 2KiB --num-sectors 2 - lotus-seed --sector-dir ${LOTUS_DATA_DIR}/genesis-sectors genesis new ${LOTUS_DATA_DIR}/localnet.json - lotus-seed --sector-dir ${LOTUS_DATA_DIR}/genesis-sectors genesis add-miner ${LOTUS_DATA_DIR}/localnet.json ${LOTUS_DATA_DIR}/genesis-sectors/pre-seal-${MINER_ACTOR_ADDRESS}.json - touch ${LOTUS_DATA_DIR}/NODE_INITIALISED - fi - - # Lotus node that communicates with the miner and the Forest node. - # The RPC and P2P listening ports are exposed so Forest does not necessarily need to be running inside Docker. - # For development purposes it might be practical to comment out Forest part altogether and use a local build. - lotus_node: - image: ${LOTUS_IMAGE} - depends_on: - lotus_init: - condition: service_completed_successfully - healthcheck: - test: >- - curl -s -x post -h "content-type: application/json" --data '{ "jsonrpc": "2.0", "method": "filecoin.chainhead", "params": [], "id": 1 }' http://lotus_node:${LOTUS_RPC_PORT}/rpc/v0 || exit 1 - interval: 10s - retries: 10 - timeout: 5s - container_name: lotus - networks: - - devnet - volumes: - - filecoin-proofs:${FIL_PROOFS_PARAMETER_CACHE} - - ./data/lotus:${LOTUS_DATA_DIR} - environment: - - LOTUS_SHARK_HEIGHT=${SHARK_HEIGHT} - - LOTUS_HYGGE_HEIGHT=${HYGGE_HEIGHT} - - LOTUS_LIGHTNING_HEIGHT=${LIGHTNING_HEIGHT} - - LOTUS_THUNDER_HEIGHT=${THUNDER_HEIGHT} - - LOTUS_WATERMELON_HEIGHT=${WATERMELON_HEIGHT} - - LOTUS_DRAGON_HEIGHT=${DRAGON_HEIGHT} - - LOTUS_GENESIS_NETWORK_VERSION=${GENESIS_NETWORK_VERSION} - - LOTUS_WAFFLE_HEIGHT=${WAFFLE_HEIGHT} - - LOTUS_TUKTUK_HEIGHT=${TUKTUK_HEIGHT} - - LOTUS_TEEP_HEIGHT=${TEEP_HEIGHT} - ports: - - ${LOTUS_RPC_PORT}:${LOTUS_RPC_PORT} - - ${LOTUS_P2P_PORT}:${LOTUS_P2P_PORT} - env_file: - - lotus.env - entrypoint: ["/bin/bash", "-c"] - command: - - | - set -euxo pipefail - lotus --version - lotus daemon --lotus-make-genesis=${LOTUS_DATA_DIR}/devgen.car --genesis-template=${LOTUS_DATA_DIR}/localnet.json --bootstrap=false - - # Lotus miner container. It communicates only with Lotus and not with Forest. - # Curio is supposed to replace this miner, but it is helpful for sanity checking to keep it around. - lotus_miner: - image: ${LOTUS_IMAGE} - depends_on: - lotus_node: - condition: service_healthy - container_name: lotus-miner - healthcheck: - test: >- - curl -s http://lotus-miner:${MINER_RPC_PORT} || exit 1 - interval: 20s - retries: 5 - start_period: 6000s - timeout: 10s - networks: - - devnet - volumes: - - filecoin-proofs:${FIL_PROOFS_PARAMETER_CACHE} - - ./data/lotus:${LOTUS_DATA_DIR} - environment: - - LOTUS_SHARK_HEIGHT=${SHARK_HEIGHT} - - LOTUS_HYGGE_HEIGHT=${HYGGE_HEIGHT} - - LOTUS_LIGHTNING_HEIGHT=${LIGHTNING_HEIGHT} - - LOTUS_THUNDER_HEIGHT=${THUNDER_HEIGHT} - - LOTUS_WATERMELON_HEIGHT=${WATERMELON_HEIGHT} - - LOTUS_DRAGON_HEIGHT=${DRAGON_HEIGHT} - - LOTUS_GENESIS_NETWORK_VERSION=${GENESIS_NETWORK_VERSION} - - LOTUS_WAFFLE_HEIGHT=${WAFFLE_HEIGHT} - - LOTUS_TUKTUK_HEIGHT=${TUKTUK_HEIGHT} - - LOTUS_TEEP_HEIGHT=${TEEP_HEIGHT} - ports: - - ${MINER_RPC_PORT}:${MINER_RPC_PORT} - env_file: - - lotus-miner.env - restart: on-failure # lotus node might not be ready - entrypoint: ["/bin/bash", "-c"] - command: - - | - set -euxo pipefail - lotus-miner --version - if [ ! -f ${LOTUS_DATA_DIR}/MINER_INITIALISED ]; then - lotus wallet import --as-default ${LOTUS_DATA_DIR}/genesis-sectors/pre-seal-${MINER_ACTOR_ADDRESS}.key - lotus-miner init --genesis-miner --actor=${MINER_ACTOR_ADDRESS} --sector-size=2KiB --pre-sealed-sectors=${LOTUS_DATA_DIR}/genesis-sectors --pre-sealed-metadata=${LOTUS_DATA_DIR}/genesis-sectors/pre-seal-${MINER_ACTOR_ADDRESS}.json --nosync - touch ${LOTUS_DATA_DIR}/MINER_INITIALISED - fi - lotus-miner run --nosync - - # This container dumps relevant (for Forest) Lotus configuration to the shared volume. - lotus_config: - image: ${LOTUS_IMAGE} - restart: on-failure # lotus node might not be ready. Even when healthy, it may be generating a genesis block. - depends_on: - lotus_node: - condition: service_healthy - volumes: - - ./data/lotus:${LOTUS_DATA_DIR} - environment: - - LOTUS_SHARK_HEIGHT=${SHARK_HEIGHT} - - LOTUS_HYGGE_HEIGHT=${HYGGE_HEIGHT} - - LOTUS_LIGHTNING_HEIGHT=${LIGHTNING_HEIGHT} - - LOTUS_THUNDER_HEIGHT=${THUNDER_HEIGHT} - - LOTUS_WATERMELON_HEIGHT=${WATERMELON_HEIGHT} - - LOTUS_DRAGON_HEIGHT=${DRAGON_HEIGHT} - - LOTUS_GENESIS_NETWORK_VERSION=${GENESIS_NETWORK_VERSION} - - LOTUS_WAFFLE_HEIGHT=${WAFFLE_HEIGHT} - - LOTUS_TUKTUK_HEIGHT=${TUKTUK_HEIGHT} - - LOTUS_TEEP_HEIGHT=${TEEP_HEIGHT} - entrypoint: ["/bin/bash", "-c"] - env_file: - - lotus.env - networks: - - devnet - command: - - lotus net id > ${LOTUS_DATA_DIR}/PEER_ID - - forest: - depends_on: - lotus_config: - condition: service_completed_successfully - build: - context: ../../. - dockerfile: ${FOREST_DOCKERFILE_OVERRIDE:-Dockerfile} - container_name: forest - healthcheck: - test: | - export TOKEN=$$(cat ${FOREST_DATA_DIR}/token.jwt) - export FULLNODE_API_INFO=$$TOKEN:/ip4/127.0.0.1/tcp/${FOREST_RPC_PORT}/http - forest-cli sync status || exit 1 - interval: 10s - retries: 10 - timeout: 5s - start_period: 15s - volumes: - - ./data/lotus:${LOTUS_DATA_DIR} - - filecoin-proofs:${FIL_PROOFS_PARAMETER_CACHE} - - ./data/forest:${FOREST_DATA_DIR} - - ./forest_config.toml.tpl:/forest/forest_config.toml.tpl - environment: - - FIL_PROOFS_PARAMETER_CACHE=${FIL_PROOFS_PARAMETER_CACHE} - - RUST_LOG=info,forest::blocks::header=trace - - FOREST_F3_SIDECAR_FFI_ENABLED=1 - - FOREST_F3_FINALITY=${F3_FINALITY} - - FOREST_F3_PERMANENT_PARTICIPATING_MINER_ADDRESSES=${MINER_ACTOR_ADDRESS} - - FOREST_F3_SIDECAR_RPC_ENDPOINT=127.0.0.1:${F3_RPC_PORT} - - FOREST_GENESIS_NETWORK_VERSION=${GENESIS_NETWORK_VERSION} - - FOREST_SHARK_HEIGHT=${SHARK_HEIGHT} - - FOREST_HYGGE_HEIGHT=${HYGGE_HEIGHT} - - FOREST_LIGHTNING_HEIGHT=${LIGHTNING_HEIGHT} - - FOREST_THUNDER_HEIGHT=${THUNDER_HEIGHT} - - FOREST_WATERMELON_HEIGHT=${WATERMELON_HEIGHT} - - FOREST_DRAGON_HEIGHT=${DRAGON_HEIGHT} - - FOREST_WAFFLE_HEIGHT=${WAFFLE_HEIGHT} - - FOREST_TUKTUK_HEIGHT=${TUKTUK_HEIGHT} - - FOREST_TEEP_HEIGHT=${TEEP_HEIGHT} - networks: - - devnet - ports: - - ${FOREST_RPC_PORT}:${FOREST_RPC_PORT} - entrypoint: ["/bin/bash", "-c"] - command: - - | - set -euxo pipefail - if [ ! -f ${FOREST_DATA_DIR}/forest_config.toml ]; then - export NETWORK_NAME=$$(grep -o \"localnet.*\" ${LOTUS_DATA_DIR}/localnet.json) - cp /forest/forest_config.toml.tpl ${FOREST_DATA_DIR}/forest_config.toml - echo name = $$NETWORK_NAME >> ${FOREST_DATA_DIR}/forest_config.toml - fi - forest --genesis ${LOTUS_DATA_DIR}/devgen.car --config ${FOREST_DATA_DIR}/forest_config.toml --save-token ${FOREST_DATA_DIR}/token.jwt --rpc-address 0.0.0.0:${FOREST_RPC_PORT} - - # At the moment of writing, Forest was not able to connect to a devnet node using its config. - # This is a workaround to force the connection. - forest_connecter: - depends_on: - forest: - condition: service_healthy - build: - context: ../../. - dockerfile: ${FOREST_DOCKERFILE_OVERRIDE:-Dockerfile} - volumes: - - ./data/lotus:${LOTUS_DATA_DIR} - - ./data/forest:${FOREST_DATA_DIR} - networks: - - devnet - entrypoint: ["/bin/bash", "-c"] - command: - - | - set -euxo pipefail - export TOKEN=$$(cat ${FOREST_DATA_DIR}/token.jwt) - export FULLNODE_API_INFO=$$TOKEN:/dns/forest/tcp/${FOREST_RPC_PORT}/http - forest-wallet --remote-wallet import ${LOTUS_DATA_DIR}/genesis-sectors/pre-seal-${MINER_ACTOR_ADDRESS}.key || true - forest-cli net connect /dns/lotus/tcp/${LOTUS_P2P_PORT}/p2p/$$(cat ${LOTUS_DATA_DIR}/PEER_ID) - - curio: - depends_on: - forest: - condition: service_healthy - yugabyte: - condition: service_started - lotus_node: - condition: service_healthy - container_name: curio - image: ${CURIO_IMAGE} - init: true - ports: - - "12300:12300" # API - - "4701:4701" # UI - - "32100:32100" # Market - restart: unless-stopped - volumes: - - ./data/curio:/var/lib/curio:rw - - filecoin-proofs:/var/tmp/filecoin-proof-parameters:rw - - ./data/lotus:${LOTUS_DATA_DIR} - - ./data/forest:${FOREST_DATA_DIR} - - ./run_curio.sh:/run_curio.sh - env_file: - - curio.env - - .env - networks: - - devnet - entrypoint: ["/bin/bash", "/run_curio.sh"] - - yugabyte: - container_name: yugabyte - image: yugabytedb/yugabyte:2024.1.0.0-b129 - init: true - environment: - - TINI_SUBREAPER=true - ports: - - "5433:5433" - - "9042:9042" - - "15433:15433" - restart: unless-stopped - volumes: - - ./data/yugabyte:/home/yugabyte/yb_data - command: - [ - "bin/yugabyted", - "start", - "--base_dir=/home/yugabyte/yb_data", - "--background=false", - ] - networks: - - devnet - -volumes: - # Shared proof parameter files. It is re-used by both Lotus and Forest. - filecoin-proofs: - -networks: - devnet: diff --git a/scripts/devnet-curio/forest_config.toml.tpl b/scripts/devnet-curio/forest_config.toml.tpl deleted file mode 100644 index 28ec1692a569..000000000000 --- a/scripts/devnet-curio/forest_config.toml.tpl +++ /dev/null @@ -1,12 +0,0 @@ -[client] -encrypt_keystore = false -data_dir = "/forest_data" - -[network] -kademlia = false -target_peer_count = 1 - -# Note that this has to come last. The actual TOML file will have -# the chain name appended. -[chain] -type = "devnet" diff --git a/scripts/devnet-curio/lotus-miner.env b/scripts/devnet-curio/lotus-miner.env deleted file mode 100644 index c819d8ddf19d..000000000000 --- a/scripts/devnet-curio/lotus-miner.env +++ /dev/null @@ -1,4 +0,0 @@ -LOTUS_PATH=/lotus_data/lotus-local-net -LOTUS_MINER_PATH=/lotus_data/lotus-miner-local-net -LOTUS_SKIP_GENESIS_CHECK=_yes_ -LOTUS_API_LISTENADDRESS=/dns/lotus-miner/tcp/2345/http diff --git a/scripts/devnet-curio/lotus.env b/scripts/devnet-curio/lotus.env deleted file mode 100644 index 41092fd0515d..000000000000 --- a/scripts/devnet-curio/lotus.env +++ /dev/null @@ -1,5 +0,0 @@ -LOTUS_PATH=/lotus_data/lotus-local-net -LOTUS_MINER_PATH=/lotus_data/lotus-miner-local-net -LOTUS_SKIP_GENESIS_CHECK=_yes_ -LOTUS_API_LISTENADDRESS=/dns/lotus/tcp/1234/http -LOTUS_LIBP2P_LISTENADDRESSES=/ip4/0.0.0.0/tcp/1235 diff --git a/scripts/devnet-curio/run_curio.sh b/scripts/devnet-curio/run_curio.sh deleted file mode 100644 index 868e31e14a3c..000000000000 --- a/scripts/devnet-curio/run_curio.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env bash -set -e - -echo CURIO_REPO_PATH="$CURIO_REPO_PATH" -echo Wait for lotus is ready ... -lotus wait-api -head=0 -# Loop until the head is greater than 9 -while [[ $head -le 9 ]]; do - head=$(lotus chain list | awk '{print $1}' | awk -F':' '{print $1}' | tail -1) - if [[ $head -le 9 ]]; then - echo "Current head: $head, which is not greater than 9. Waiting..." - sleep 1 # Wait for 4 seconds before checking again - else - echo "The head is now greater than 9: $head" - fi -done - -echo All ready. Lets go -myip=$(nslookup curio | grep -v "#" | grep Address | awk '{print $2}') - -if [ ! -f "$CURIO_REPO_PATH"/.init.curio ]; then - - if [ ! -f "$CURIO_REPO_PATH"/.init.setup ]; then - DEFAULT_WALLET=$(lotus wallet default) - echo Create a new miner actor ... - lotus-shed miner create "$DEFAULT_WALLET" "$DEFAULT_WALLET" "$DEFAULT_WALLET" 8MiB - touch "$CURIO_REPO_PATH"/.init.setup - lotus wallet export "$DEFAULT_WALLET" >"$CURIO_REPO_PATH"/default.key - fi - - if [ ! -f "$CURIO_REPO_PATH"/.init.config ]; then - newminer=$(lotus state list-miners | grep -v t01000) - echo "New Miner is $newminer" - echo Initiating a new Curio cluster ... - curio config new-cluster "$newminer" - touch "$CURIO_REPO_PATH"/.init.config - fi - - echo Starting Curio node to attach storage ... - curio run --nosync --layers seal,post,gui & - CURIO_PID=$! - until curio cli --machine "$myip":12300 wait-api; do - echo "Waiting for the curio CLI to become ready..." - sleep 5 - done - curio cli --machine "$myip":12300 storage attach --init --seal --store "$CURIO_REPO_PATH" - touch "$CURIO_REPO_PATH"/.init.curio - echo Stopping Curio node ... - echo Try to stop curio... - kill -15 $CURIO_PID || kill -9 $CURIO_PID - echo Done -fi - -TOKEN=$(cat "$FOREST_DATA_DIR"/token.jwt) -FULLNODE_API_INFO=$TOKEN:/dns/forest/tcp/${FOREST_RPC_PORT}/http -export FULLNODE_API_INFO -lotus wallet import "$CURIO_REPO_PATH"/default.key || true -echo Starting curio node ... -exec curio run --nosync --name devnet --layers seal,post,gui