diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 5587b32c3..ac656edc1 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -1,12 +1,15 @@ +--- name: Bug Report description: Let us know about an issue you experienced with this software labels: [I2-bug, I10-unconfirmed] - body: - type: checkboxes attributes: label: Is there an existing issue? - description: Please search to see if an issue already exists and leave a comment that you also experienced this issue or add your specifics that are related to an existing issue. + description: + Please search to see if an issue already exists and leave a comment + that you also experienced this issue or add your specifics that are related + to an existing issue. options: - label: I have searched the existing issues required: true diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 663e9560e..baa3c304d 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,7 +1,10 @@ +--- blank_issues_enabled: true + contact_links: - name: Support & Troubleshooting with Madara Community url: https://t.me/madara - about: | + about: >- For general problems with Madara or related technologies, please ask - and questions in our community! We highly encourage everyone also share their understanding by answering questions for others. + questions in our community! We highly encourage everyone to also share + their understanding by answering questions for others. diff --git a/.github/ISSUE_TEMPLATE/feature.yml b/.github/ISSUE_TEMPLATE/feature.yml index fc4d45b26..75864d52d 100644 --- a/.github/ISSUE_TEMPLATE/feature.yml +++ b/.github/ISSUE_TEMPLATE/feature.yml @@ -1,3 +1,4 @@ +--- name: Feature Request description: Submit your requests and suggestions to improve! labels: [I5-enhancement] @@ -6,7 +7,10 @@ body: id: existing attributes: label: Is there an existing issue? - description: Please search to see if an issue already exists and leave a comment that you also experienced this issue or add your specifics that are related to an existing issue. + description: + Please search to see if an issue already exists and leave a comment + that you also experienced this issue or add your specifics that are related + to an existing issue. options: - label: I have searched the existing issues required: true @@ -39,9 +43,6 @@ body: attributes: label: Are you willing to help with this request? multiple: true - options: - - Yes! - - No. - - Maybe (please elaborate above) + options: [Yes!, No., Maybe (please elaborate above)] validations: required: true diff --git a/.github/dependabot.yml b/.github/dependabot.yml index e2f1deb4d..563b4dd03 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,7 +1,8 @@ +--- version: 2 updates: - - package-ecosystem: "cargo" - directory: "/" + - package-ecosystem: cargo + directory: / schedule: - interval: "weekly" # can be `daily` or `monthly` also + interval: weekly # can be `daily` or `monthly` also open-pull-requests-limit: 10 diff --git a/.github/labels.yml b/.github/labels.yml index 20c2550b2..f62aa125e 100644 --- a/.github/labels.yml +++ b/.github/labels.yml @@ -1,87 +1,84 @@ --- -- name: "breaking-change" +- name: breaking-change color: ee0701 - description: "A change that changes the API or breaks backward compatibility for users." -- name: "bump_db" + description: + A change that changes the API or breaks backward compatibility for + users. +- name: bump_db color: ee0701 - description: "Changes requiring a database version increment." -- name: "bugfix" + description: Changes requiring a database version increment. +- name: bugfix color: ee0701 - description: - "Inconsistencies or issues which will cause a problem for users or - implementors." -- name: "documentation" + description: Inconsistencies or issues which will cause a problem for users or + implementors. +- name: documentation color: 0052cc - description: "Solely about the documentation of the project." -- name: "enhancement" + description: Solely about the documentation of the project. +- name: enhancement color: 1d76db - description: "Enhancement of the code, not introducing new features." -- name: "refactor" + description: Enhancement of the code, not introducing new features. +- name: refactor color: 1d76db description: - "Updating the code with simpler, easier to understand or more efficient - syntax or methods, but not introducing new features." -- name: "performance" + Updating the code with simpler, easier to understand or more efficient + syntax or methods, but not introducing new features. +- name: performance color: 1d76db - description: "Improving performance of the project, not introducing new features." -- name: "new-feature" + description: Improving performance of the project, not introducing new features. +- name: new-feature color: 0e8a16 - description: "New features or options." -- name: "maintenance" + description: New features or options. +- name: maintenance color: 2af79e - description: "Generic maintenance tasks." -- name: "ci" + description: Generic maintenance tasks. +- name: ci color: 1d76db - description: "Work that improves the continuous integration." -- name: "dependencies" + description: Work that improves the continuous integration. +- name: dependencies color: 1d76db - description: "Change in project dependencies." - -- name: "in-progress" + description: Change in project dependencies. +- name: in-progress color: fbca04 - description: "Issue is currently being worked on by a developer." -- name: "stale" + description: Issue is currently being worked on by a developer. +- name: stale color: fef2c0 - description: "No activity for quite some time." -- name: "no-stale" + description: No activity for quite some time. +- name: no-stale color: fef2c0 - description: "This is exempt from the stale bot." - -- name: "security" + description: This is exempt from the stale bot. +- name: security color: ee0701 - description: "Addressing a vulnerability or security risk in this project." -- name: "incomplete" + description: Addressing a vulnerability or security risk in this project. +- name: incomplete color: fef2c0 - description: "Missing information." -- name: "invalid" + description: Missing information. +- name: invalid color: fef2c0 - description: "This is off-topic, spam, or otherwise doesn't apply to this project." - -- name: "beginner-friendly" + description: This is off-topic, spam, or otherwise doesn't apply to this project. +- name: beginner-friendly color: 0e8a16 - description: "Good first issue for people wanting to contribute to this project." -- name: "help-wanted" + description: Good first issue for people wanting to contribute to this project. +- name: help-wanted color: 0e8a16 - description: "We need some extra helping hands or expertise in order to resolve this!" - -- name: "priority-critical" + description: We need some extra helping hands or expertise in order to resolve + this! +- name: priority-critical color: ee0701 - description: "Must be addressed as soon as possible." -- name: "priority-high" + description: Must be addressed as soon as possible. +- name: priority-high color: b60205 description: - "After critical issues are fixed, these should be dealt with before any - further issues." -- name: "priority-medium" + After critical issues are fixed, these should be dealt with before + any further issues. +- name: priority-medium color: 0e8a16 - description: "This issue may be useful, and needs some attention." -- name: "priority-low" + description: This issue may be useful, and needs some attention. +- name: priority-low color: e4ea8a - description: "Nice addition, maybe... someday..." - -- name: "major" + description: Nice addition, maybe... someday... +- name: major color: b60205 - description: "This PR causes a major bump in the version number." -- name: "minor" + description: This PR causes a major bump in the version number. +- name: minor color: 0e8a16 - description: "This PR causes a minor bump in the version number." + description: This PR causes a minor bump in the version number. diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 66647a167..b2205c736 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,5 +1,6 @@ +--- name: Task - Build Madara -on: +"on": workflow_dispatch: workflow_call: jobs: @@ -7,7 +8,6 @@ jobs: permissions: pull-requests: write runs-on: ubuntu-latest - steps: - uses: actions/checkout@v3 with: @@ -23,7 +23,7 @@ jobs: - uses: rui314/setup-mold@v1 - uses: software-mansion/setup-scarb@v1 with: - scarb-version: "2.8.2" + scarb-version: 2.8.2 - uses: foundry-rs/foundry-toolchain@v1 with: version: nightly diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 418fb07d3..b31676e3c 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -1,12 +1,11 @@ +--- name: Task - Integration Tests - -on: +"on": workflow_dispatch: workflow_call: secrets: ETH_FORK_URL: required: true - jobs: coverage: permissions: @@ -17,28 +16,35 @@ jobs: - name: Setup build deps run: | sudo apt-get update - sudo apt-get install -y clang llvm libudev-dev protobuf-compiler gcc g++ build-essential libssl-dev pkg-config curl wget git + sudo apt-get install -y \ + clang \ + llvm \ + libudev-dev \ + protobuf-compiler \ + gcc \ + g++ \ + build-essential \ + libssl-dev \ + pkg-config \ + curl \ + wget \ + git - uses: dtolnay/rust-toolchain@master with: toolchain: 1.81 - - uses: Swatinem/rust-cache@v2 # use a different cache key as coverae uses custom rustc args with: cache-provider: buildjet - key: "coverage" - + key: coverage - uses: rui314/setup-mold@v1 - name: Install cargo-llvm-cov uses: taiki-e/install-action@cargo-llvm-cov - - uses: software-mansion/setup-scarb@v1 with: - scarb-version: "2.8.2" - + scarb-version: 2.8.2 - uses: foundry-rs/foundry-toolchain@v1 with: version: nightly - - name: Build and run tests env: ETH_FORK_URL: ${{ secrets.ETH_FORK_URL }} @@ -50,12 +56,10 @@ jobs: export COVERAGE_BIN=$(realpath target/debug/madara) rm -f target/madara-* lcov.info cargo test --profile dev --workspace -- --test-threads=1 - - name: Generate coverage info run: | source <(cargo llvm-cov show-env --export-prefix) cargo llvm-cov report --lcov --output-path lcov.info - - name: Coveralls uses: coverallsapp/github-action@v2 with: diff --git a/.github/workflows/cron-daily.yml b/.github/workflows/cron-daily.yml index b0575ac36..0dd1d8e58 100644 --- a/.github/workflows/cron-daily.yml +++ b/.github/workflows/cron-daily.yml @@ -1,16 +1,13 @@ --- name: Workflow - Daily Cron - -on: +"on": workflow_dispatch: schedule: - - cron: "0 0 * * *" - + - cron: 0 0 * * * jobs: stale_issues: name: Stale issues uses: ./.github/workflows/stale-issues.yml - security_audit: name: Security audit uses: ./.github/workflows/security-audit.yml diff --git a/.github/workflows/db-version.yml b/.github/workflows/db-version.yml index b64c83fb8..4abedad04 100644 --- a/.github/workflows/db-version.yml +++ b/.github/workflows/db-version.yml @@ -1,20 +1,16 @@ --- name: DB Version Management - -on: +"on": workflow_dispatch: workflow_call: - jobs: update-db-version: runs-on: ubuntu-latest if: contains(github.event.pull_request.labels.*.name, 'bump_db') steps: - uses: actions/checkout@v3 - - name: Install yq run: sudo apt-get install -y yq - - name: Check if PR already bumped id: check_bump run: | @@ -24,21 +20,18 @@ jobs: else echo "already_bumped=false" >> $GITHUB_OUTPUT fi - - name: Configure Git if: steps.check_bump.outputs.already_bumped == 'false' run: | git config user.name 'github-actions[bot]' git config user.email 'github-actions[bot]@users.noreply.github.com' - - name: Update DB Version if: steps.check_bump.outputs.already_bumped == 'false' run: | ./scripts/update-db-version.sh "${{ github.event.pull_request.number }}" - - name: Commit and Push if: steps.check_bump.outputs.already_bumped == 'false' - run: | + run: |- if [[ -n "$(git status --porcelain)" ]]; then git add .db-versions.toml git commit -m "chore: bump db version" diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index fe4cdb87d..24e91df3b 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -1,33 +1,28 @@ +--- name: Build/Push Docker Image to ghcr - -on: +"on": release: types: [published] workflow_dispatch: - permissions: contents: read packages: write - jobs: build_and_push: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v3 - - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 with: driver: docker - - name: Log in to GitHub Container Registry uses: docker/login-action@v2 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Set Docker image tag id: vars run: | @@ -36,11 +31,12 @@ jobs: else echo "TAG=latest" >> $GITHUB_ENV fi - - name: Build and push Docker image uses: docker/build-push-action@v4 with: context: . file: ./Dockerfile push: true - tags: ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}:${{ env.TAG }} + tags: + ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name + }}:${{ env.TAG }} diff --git a/.github/workflows/linters-cargo.yml b/.github/workflows/linters-cargo.yml index 41f3b7fa9..9285ebd0a 100644 --- a/.github/workflows/linters-cargo.yml +++ b/.github/workflows/linters-cargo.yml @@ -1,10 +1,8 @@ --- name: Task - Linters Cargo - -on: +"on": workflow_dispatch: workflow_call: - jobs: cargo-lint: runs-on: ubuntu-latest @@ -12,23 +10,20 @@ jobs: - uses: actions/checkout@v4 - uses: Swatinem/rust-cache@v2 with: - shared-key: "cache" + shared-key: cache - uses: dtolnay/rust-toolchain@master with: toolchain: 1.81 components: rustfmt, clippy - - uses: software-mansion/setup-scarb@v1 with: - scarb-version: "2.8.2" - + scarb-version: 2.8.2 - name: Setup build deps run: | sudo apt-get update sudo apt-get install -y clang llvm libudev-dev protobuf-compiler libasound2-dev - - name: Format and clippy - run: | + run: |- cargo fmt -- --check cargo clippy --workspace --no-deps -- -D warnings cargo clippy --workspace --tests --no-deps -- -D warnings diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index fc9c47c9f..77071eaca 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -1,12 +1,11 @@ --- name: Task - Linters - -on: +"on": workflow_dispatch: workflow_call: - jobs: - prettier: + # Check code formatting using Prettier + prettier-check: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -14,20 +13,48 @@ jobs: run: |- npx prettier --check . - markdown-lint: + # Validate Markdown files against style rules + markdown-style: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: avto-dev/markdown-lint@v1 with: - config: "./.markdownlint.json" - args: "." - ignore: "./target" + config: ./.markdownlint.json + args: . + ignore: ./target - toml-lint: + # Verify TOML files formatting + toml-format: runs-on: ubuntu-latest steps: - name: Checkout toml files uses: actions/checkout@v4 - name: Run toml check run: npx @taplo/cli@0.5.2 fmt --config ./taplo/taplo.toml --check + + # Validate YAML files formatting and structure + yaml-format: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install linting tools + run: | + pip install yamllint + - name: Check YAML files + run: | + yamllint -c .yamllint.yml -s . + + # Validate Nix files formatting using Alejandra + nix-format: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Install Nix + uses: DeterminateSystems/nix-installer-action@main + - name: Install Alejandra + run: | + nix-env -f '' -iA alejandra + - name: Check formatting + run: alejandra --check . diff --git a/.github/workflows/pull-request-close.yml b/.github/workflows/pull-request-close.yml index 78614c6c4..1214555c5 100644 --- a/.github/workflows/pull-request-close.yml +++ b/.github/workflows/pull-request-close.yml @@ -1,11 +1,8 @@ --- name: Workflow - Pull Request (on Close) - -on: +"on": pull_request: - types: - - closed - + types: [closed] jobs: cleanup: runs-on: ubuntu-latest diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 915d41ad1..40487fd04 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -1,53 +1,44 @@ +--- name: Workflow - Pull Request - -on: +"on": workflow_dispatch: pull_request: branches: [main] types: [opened, synchronize, reopened, ready_for_review] - concurrency: group: pr-checks-${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true - permissions: pull-requests: write - jobs: update_db_version: name: Update DB Version if: github.event.pull_request.draft == false uses: ./.github/workflows/db-version.yml - linters: name: Run linters needs: update_db_version if: ${{ always() }} uses: ./.github/workflows/linters.yml - rust_check: name: Run check if: github.event.pull_request.draft == false uses: ./.github/workflows/rust-check.yml - linters_cargo: name: Run Cargo linters needs: rust_check uses: ./.github/workflows/linters-cargo.yml - coverage: name: Run Coverage needs: update_db_version if: ${{ always() }} secrets: inherit uses: ./.github/workflows/coverage.yml - build: name: Build Madara needs: update_db_version if: ${{ always() }} uses: ./.github/workflows/build.yml - js_test: name: Run JS Tests needs: build diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 2fcdab677..461d9c92f 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -1,20 +1,16 @@ --- name: Workflow - Push - -on: +"on": workflow_dispatch: push: branches: [main] - jobs: linters: name: Run linters uses: ./.github/workflows/linters.yml - rust_check: name: Run check uses: ./.github/workflows/rust-check.yml - linters_cargo: name: Run Cargo linters uses: ./.github/workflows/linters-cargo.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a00635d05..a6084382d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,13 +1,11 @@ +--- name: Create Release - -on: +"on": push: tags: - - "v*.*.*" # Triggers on version tags like v1.0.0 - + - v*.*.* # Triggers on version tags like v1.0.0 permissions: contents: write - jobs: create_release: runs-on: ubuntu-latest @@ -18,13 +16,11 @@ jobs: uses: actions/checkout@v3 with: fetch-depth: 0 - - name: Generate Release Notes id: generate_notes uses: conventional-changelog/releaser-action@v1 with: - preset: "angular" - + preset: angular - name: Create GitHub Release uses: ncipollo/release-action@v1 with: diff --git a/.github/workflows/rust-check.yml b/.github/workflows/rust-check.yml index 63efbf51b..d0e8e588b 100644 --- a/.github/workflows/rust-check.yml +++ b/.github/workflows/rust-check.yml @@ -1,10 +1,8 @@ --- name: Task - Run check - -on: +"on": workflow_dispatch: workflow_call: - jobs: rust_check: runs-on: ubuntu-latest @@ -12,15 +10,13 @@ jobs: - uses: actions/checkout@v4 - uses: Swatinem/rust-cache@v2 with: - shared-key: "cache" + shared-key: cache - uses: dtolnay/rust-toolchain@master with: toolchain: 1.81 - - uses: software-mansion/setup-scarb@v1 with: - scarb-version: "2.8.2" - + scarb-version: 2.8.2 - name: Check the project - run: | + run: |- cargo check --release --workspace diff --git a/.github/workflows/rust-test.yml b/.github/workflows/rust-test.yml index 6d13fd4ed..35b563e50 100644 --- a/.github/workflows/rust-test.yml +++ b/.github/workflows/rust-test.yml @@ -1,10 +1,8 @@ --- name: Task - Run Cargo tests - -on: +"on": workflow_dispatch: workflow_call: - jobs: rust_test: runs-on: ubuntu-latest @@ -12,11 +10,10 @@ jobs: - uses: actions/checkout@v4 - uses: Swatinem/rust-cache@v2 with: - shared-key: "cache" + shared-key: cache - uses: dtolnay/rust-toolchain@master with: toolchain: 1.81 - - uses: foundry-rs/foundry-toolchain@v1 with: version: nightly diff --git a/.github/workflows/security-audit.yml b/.github/workflows/security-audit.yml index 65e258f2f..802aa02d4 100644 --- a/.github/workflows/security-audit.yml +++ b/.github/workflows/security-audit.yml @@ -1,10 +1,8 @@ --- name: Task - Security Audit - -on: +"on": workflow_dispatch: workflow_call: - jobs: security_audit: name: Security audit diff --git a/.github/workflows/stale-issues.yml b/.github/workflows/stale-issues.yml index f7a885056..e551c2e2d 100644 --- a/.github/workflows/stale-issues.yml +++ b/.github/workflows/stale-issues.yml @@ -1,10 +1,8 @@ --- name: Task - Stale Issues - -on: +"on": workflow_dispatch: workflow_call: - jobs: stale: name: ๐Ÿงน Clean up stale issues and PRs @@ -17,26 +15,21 @@ jobs: days-before-stale: 30 days-before-close: -1 remove-stale-when-updated: true - stale-issue-label: "stale" - exempt-issue-labels: "no-stale,help-wanted" + stale-issue-label: stale + exempt-issue-labels: no-stale,help-wanted stale-issue-message: > There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale. - Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a ๐Ÿ‘ - Because this issue is marked as stale, it will be closed and locked in 7 days if no further activity occurs. - Thank you for your contributions! - stale-pr-label: "stale" - exempt-pr-labels: "no-stale" - stale-pr-message: > + stale-pr-label: stale + exempt-pr-labels: no-stale + stale-pr-message: >- There hasn't been any activity on this pull request recently, and in order to prioritize active work, it has been marked as stale. - This PR will be closed and locked in 7 days if no further activity occurs. - Thank you for your contributions! diff --git a/.github/workflows/starknet-js-test.yml b/.github/workflows/starknet-js-test.yml index 8f2bc2898..1158ff66b 100644 --- a/.github/workflows/starknet-js-test.yml +++ b/.github/workflows/starknet-js-test.yml @@ -1,9 +1,8 @@ +--- name: Starknet-js Compatibility Tests - -on: +"on": workflow_dispatch: workflow_call: - jobs: js-test: runs-on: ubuntu-latest @@ -25,8 +24,20 @@ jobs: key: ${{ runner.os }}-madara-${{ hashFiles('Scarb.lock') }} fail-on-cache-miss: true - name: Setup dev chain and run tests - run: | - ./target/release/madara --name madara --base-path ../madara_db --rpc-port 9944 --rpc-cors "*" --rpc-external --devnet --preset devnet --gas-price 0 --blob-gas-price 0 --strk-gas-price 0 --strk-blob-gas-price 0 --no-l1-sync & + run: |- + ./target/release/madara \ + --name madara \ + --base-path ../madara_db \ + --rpc-port 9944 \ + --rpc-cors "*" \ + --rpc-external \ + --devnet \ + --preset devnet \ + --gas-price 0 \ + --blob-gas-price 0 \ + --strk-gas-price 0 \ + --strk-blob-gas-price 0 \ + --no-l1-sync & MADARA_PID=$! while ! echo exit | nc localhost 9944; do sleep 1; done cd tests/js_tests diff --git a/.yamllint.yml b/.yamllint.yml new file mode 100644 index 000000000..a968068fd --- /dev/null +++ b/.yamllint.yml @@ -0,0 +1,60 @@ +--- +# This file configures yamllint, a linter for YAML files +# See https://yamllint.readthedocs.io/ for detailed documentation + +extends: default + +# Custom rules configuration +rules: + # Maximum line length - increased from default 80 + line-length: + max: 120 + level: warning + allow-non-breakable-words: true + allow-non-breakable-inline-mappings: true + + # Enforce document start marker (---) + document-start: + present: true + level: warning + + # Indentation rules + indentation: + spaces: 2 + indent-sequences: true + check-multi-line-strings: false + + # Enforce spacing between keys and values + colons: + max-spaces-before: 0 + max-spaces-after: 1 + + # Comments formatting + comments: + require-starting-space: true + min-spaces-from-content: 1 + + # Enforce consistent empty lines + empty-lines: + max: 1 + max-start: 0 + max-end: 0 + + # Key ordering is not required + key-ordering: disable + + # Trailing spaces not allowed + trailing-spaces: enable + + # New line at end of file + new-line-at-end-of-file: enable + + # Enforce truthy values + truthy: + level: warning + allowed-values: ["true", "false", "yes", "no"] + +# Files to ignore during linting +ignore: | + .git + .db-versions.yml diff --git a/compose.yaml b/compose.yaml index 8e50fea0e..01be65c62 100644 --- a/compose.yaml +++ b/compose.yaml @@ -1,32 +1,26 @@ +--- name: madara_runner - services: madara: image: madara:latest - container_name: "madara_runner" + container_name: madara_runner cpus: "4.0" - mem_limit: "16gb" - ports: - - 9944:9944 - labels: - - "autoheal=true" - environment: - - RPC_API_KEY_FILE=/run/secrets/rpc_api_key - secrets: - - rpc_api_key + mem_limit: 16gb + ports: [9944:9944] + labels: [autoheal=true] + environment: [RPC_API_KEY_FILE=/run/secrets/rpc_api_key] + secrets: [rpc_api_key] volumes: - /var/lib/madara:/tmp/madara - ./madara-runner.sh:/usr/local/bin/runner.sh:ro - entrypoint: - - /usr/local/bin/runner.sh + entrypoint: [/usr/local/bin/runner.sh] healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:9944/health"] + test: [CMD, curl, -f, http://localhost:9944/health] interval: 10s timeout: 5s retries: 3 start_period: 10s restart: on-failure:3 - autoheal: image: willfarrell/autoheal:latest tty: true @@ -34,7 +28,6 @@ services: volumes: - /etc/localtime:/etc/localtime:ro - /var/run/docker.sock:/var/run/docker.sock - secrets: rpc_api_key: file: .secrets/rpc_api.secret diff --git a/configs/chain_config.example.yaml b/configs/chain_config.example.yaml index fd8d7df2f..d21a5b5e8 100644 --- a/configs/chain_config.example.yaml +++ b/configs/chain_config.example.yaml @@ -1,45 +1,42 @@ +--- # Human readable chain name, for displaying to the console. -chain_name: "Starknet Mainnet" - -chain_id: "SN_MAIN" +chain_name: Starknet Mainnet +chain_id: SN_MAIN # The URL of the gateway and Feeder Gateway your nodes should sync from. -feeder_gateway_url: "http://localhost:8080/feeder_gateway/" -gateway_url: "http://localhost:8080/gateway/" +feeder_gateway_url: http://localhost:8080/feeder_gateway/ +gateway_url: http://localhost:8080/gateway/ # For starknet, this is the STRK ERC-20 contract on starknet. native_fee_token_address: "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d" # For starknet, this is the ETH ERC-20 contract on starknet. parent_fee_token_address: "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7" - # Paths to JSON files containing blockifier's constants for different versions versioned_constants_path: - "0.13.0": "crates/primitives/chain_config/resources/versioned_constants_13_0.json" - "0.13.1": "crates/primitives/chain_config/resources/versioned_constants_13_1.json" - "0.13.1.1": "crates/primitives/chain_config/resources/versioned_constants_13_1_1.json" - "0.13.2": "crates/primitives/chain_config/resources/versioned_constants_13_2.json" - + 0.13.0: crates/primitives/chain_config/resources/versioned_constants_13_0.json + 0.13.1: crates/primitives/chain_config/resources/versioned_constants_13_1.json + 0.13.1.1: crates/primitives/chain_config/resources/versioned_constants_13_1_1.json + 0.13.2: crates/primitives/chain_config/resources/versioned_constants_13_2.json # The Starknet core contract address for the L1 watcher. eth_core_contract_address: "0xc662c410C0ECf747543f5bA90660f6ABeBD9C8c4" # Most recent Starknet version supported -latest_protocol_version: "0.13.2" +latest_protocol_version: 0.13.2 # /!\ Only used for block production. # Target time interval between blocks, in seconds -block_time: "30s" +block_time: 30s # /!\ Only used for block production. # Block time is divided into "ticks": everytime this duration elapses, the pending block is updated. -pending_block_update_time: "2s" +pending_block_update_time: 2s # /!\ Only used for block production. # Block production is handled in batches; each batch will pop this number of transactions from the mempool. This is # primarily useful for optimistic parallelization. # A value too high may have a performance impact - you will need some testing to find the best value for your network. execution_batch_size: 16 - # /!\ Only used for block production. # The bouncer is in charge of limiting block sizes. This is where the max number of step per block, gas etc are. bouncer_config: @@ -65,7 +62,6 @@ bouncer_config: n_events: 18446744073709551615 # Maximum size of state differences per block state_diff_size: 131072 - # /!\ Only used for block production. # Address of the sequencer (0x0 for a full node). sequencer_address: "0x0" @@ -76,4 +72,4 @@ mempool_tx_limit: 10000 mempool_declare_tx_limit: 20 # Max age of a transaction in the mempool. Null for no age limit. # mempool_tx_max_age: "5h" -mempool_tx_max_age: null +mempool_tx_max_age: diff --git a/configs/chain_config.template.yml b/configs/chain_config.template.yml index 68962e6b0..465bd219b 100644 --- a/configs/chain_config.template.yml +++ b/configs/chain_config.template.yml @@ -1,3 +1,4 @@ +--- chain_name: "" chain_id: "" feeder_gateway_url: "" diff --git a/configs/presets/devnet.yaml b/configs/presets/devnet.yaml index 4e562cbc9..3f09adb60 100644 --- a/configs/presets/devnet.yaml +++ b/configs/presets/devnet.yaml @@ -1,12 +1,13 @@ -chain_name: "Madara" -chain_id: "MADARA_DEVNET" -feeder_gateway_url: "http://localhost:8080/feeder_gateway/" -gateway_url: "http://localhost:8080/gateway/" +--- +chain_name: Madara +chain_id: MADARA_DEVNET +feeder_gateway_url: http://localhost:8080/feeder_gateway/ +gateway_url: http://localhost:8080/gateway/ native_fee_token_address: "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d" parent_fee_token_address: "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7" -latest_protocol_version: "0.13.2" -block_time: "10s" -pending_block_update_time: "2s" +latest_protocol_version: 0.13.2 +block_time: 10s +pending_block_update_time: 2s execution_batch_size: 16 bouncer_config: block_max_capacity: @@ -31,4 +32,4 @@ eth_core_contract_address: "0xe7f1725e7734ce288f8367e1bb143e90bb3f0512" eth_gps_statement_verifier: "0xf294781D719D2F4169cE54469C28908E6FA752C1" mempool_tx_limit: 10000 mempool_declare_tx_limit: 20 -mempool_tx_max_age: null +mempool_tx_max_age: diff --git a/configs/presets/integration.yaml b/configs/presets/integration.yaml index 4688a9bdc..340da885d 100644 --- a/configs/presets/integration.yaml +++ b/configs/presets/integration.yaml @@ -1,12 +1,13 @@ -chain_name: "Starknet Sepolia" -chain_id: "SN_INTEGRATION_SEPOLIA" -feeder_gateway_url: "https://integration-sepolia.starknet.io/feeder_gateway/" -gateway_url: "https://integration-sepolia.starknet.io/gateway/" +--- +chain_name: Starknet Sepolia +chain_id: SN_INTEGRATION_SEPOLIA +feeder_gateway_url: https://integration-sepolia.starknet.io/feeder_gateway/ +gateway_url: https://integration-sepolia.starknet.io/gateway/ native_fee_token_address: "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d" parent_fee_token_address: "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7" -latest_protocol_version: "0.13.2" -block_time: "30s" -pending_block_update_time: "2s" +latest_protocol_version: 0.13.2 +block_time: 30s +pending_block_update_time: 2s execution_batch_size: 16 bouncer_config: block_max_capacity: @@ -31,4 +32,4 @@ eth_core_contract_address: "0x4737c0c1B4D5b1A687B42610DdabEE781152359c" eth_gps_statement_verifier: "0x2046B966994Adcb88D83f467a41b75d64C2a619F" mempool_tx_limit: 10000 mempool_declare_tx_limit: 20 -mempool_tx_max_age: null +mempool_tx_max_age: diff --git a/configs/presets/mainnet.yaml b/configs/presets/mainnet.yaml index 6d6d387e7..18c51c88c 100644 --- a/configs/presets/mainnet.yaml +++ b/configs/presets/mainnet.yaml @@ -1,12 +1,13 @@ -chain_name: "Starknet Mainnet" -chain_id: "SN_MAIN" -feeder_gateway_url: "https://alpha-mainnet.starknet.io/feeder_gateway/" -gateway_url: "https://alpha-mainnet.starknet.io/gateway/" +--- +chain_name: Starknet Mainnet +chain_id: SN_MAIN +feeder_gateway_url: https://alpha-mainnet.starknet.io/feeder_gateway/ +gateway_url: https://alpha-mainnet.starknet.io/gateway/ native_fee_token_address: "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d" parent_fee_token_address: "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7" -latest_protocol_version: "0.13.2" -block_time: "30s" -pending_block_update_time: "2s" +latest_protocol_version: 0.13.2 +block_time: 30s +pending_block_update_time: 2s execution_batch_size: 16 bouncer_config: block_max_capacity: @@ -31,4 +32,4 @@ eth_core_contract_address: "0xc662c410C0ECf747543f5bA90660f6ABeBD9C8c4" eth_gps_statement_verifier: "0x47312450B3Ac8b5b8e247a6bB6d523e7605bDb60" mempool_tx_limit: 10000 mempool_declare_tx_limit: 20 -mempool_tx_max_age: null +mempool_tx_max_age: diff --git a/configs/presets/sepolia.yaml b/configs/presets/sepolia.yaml index 7c61fd632..de48c0e3a 100644 --- a/configs/presets/sepolia.yaml +++ b/configs/presets/sepolia.yaml @@ -1,12 +1,13 @@ -chain_name: "Starknet Sepolia" -chain_id: "SN_SEPOLIA" -feeder_gateway_url: "https://alpha-sepolia.starknet.io/feeder_gateway/" -gateway_url: "https://alpha-sepolia.starknet.io/gateway/" +--- +chain_name: Starknet Sepolia +chain_id: SN_SEPOLIA +feeder_gateway_url: https://alpha-sepolia.starknet.io/feeder_gateway/ +gateway_url: https://alpha-sepolia.starknet.io/gateway/ native_fee_token_address: "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d" parent_fee_token_address: "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7" -latest_protocol_version: "0.13.2" -block_time: "30s" -pending_block_update_time: "2s" +latest_protocol_version: 0.13.2 +block_time: 30s +pending_block_update_time: 2s execution_batch_size: 16 bouncer_config: block_max_capacity: @@ -31,4 +32,4 @@ eth_core_contract_address: "0xE2Bb56ee936fd6433DC0F6e7e3b8365C906AA057" eth_gps_statement_verifier: "0xf294781D719D2F4169cE54469C28908E6FA752C1" mempool_tx_limit: 10000 mempool_declare_tx_limit: 20 -mempool_tx_max_age: null +mempool_tx_max_age: diff --git a/crates/madara/tests/test_devnet.yaml b/crates/madara/tests/test_devnet.yaml index eb50e6487..d86069b9c 100644 --- a/crates/madara/tests/test_devnet.yaml +++ b/crates/madara/tests/test_devnet.yaml @@ -1,12 +1,13 @@ -chain_name: "Test devnet" -chain_id: "MADARA_DEVNET" -feeder_gateway_url: "http://localhost:8080/feeder_gateway/" -gateway_url: "http://localhost:8080/gateway/" +--- +chain_name: Test devnet +chain_id: MADARA_DEVNET +feeder_gateway_url: http://localhost:8080/feeder_gateway/ +gateway_url: http://localhost:8080/gateway/ native_fee_token_address: "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d" parent_fee_token_address: "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7" -latest_protocol_version: "0.13.2" -block_time: "10s" -pending_block_update_time: "500ms" +latest_protocol_version: 0.13.2 +block_time: 10s +pending_block_update_time: 500ms execution_batch_size: 16 bouncer_config: block_max_capacity: @@ -31,4 +32,4 @@ eth_core_contract_address: "0xe7f1725e7734ce288f8367e1bb143e90bb3f0512" eth_gps_statement_verifier: "0xf294781D719D2F4169cE54469C28908E6FA752C1" mempool_tx_limit: 10000 mempool_declare_tx_limit: 20 -mempool_tx_max_age: "5h" +mempool_tx_max_age: 5h diff --git a/evm/docker-compose.yml b/evm/docker-compose.yml index f1199f262..48de6ffb3 100644 --- a/evm/docker-compose.yml +++ b/evm/docker-compose.yml @@ -1,16 +1,14 @@ +--- services: starknet: build: context: ../ dockerfile: Dockerfile restart: unless-stopped - ports: - - 9944:9944 - networks: - - internal_prod - volumes: - - madara_files_prod:/var/lib/madara - entrypoint: ["tini", "--"] + ports: [9944:9944] + networks: [internal_prod] + volumes: [madara_files_prod:/var/lib/madara] + entrypoint: [tini, --] command: > /usr/local/bin/madara --base-path=${MADARA_BASE_PATH:-/var/lib/madara} @@ -27,25 +25,20 @@ services: - MADARA_CHAIN_CONFIG=${MADARA_CHAIN_CONFIG:-} - MADARA_RPC_PORT=${MADARA_RPC_PORT:-9944} healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:${MADARA_RPC_PORT:-9944}/"] + test: [CMD, curl, -f, "http://localhost:${MADARA_RPC_PORT:-9944}/"] interval: 10s timeout: 5s retries: 5 start_period: 10s - mongo: image: mongo:6.0.8 restart: always - ports: - - 27017:27017 - volumes: - - mongo_data_prod:/data/db - networks: - - internal_prod + ports: [27017:27017] + volumes: [mongo_data_prod:/data/db] + networks: [internal_prod] environment: MONGO_INITDB_ROOT_USERNAME: mongo MONGO_INITDB_ROOT_PASSWORD: mongo - apibara-dna: image: quay.io/apibara/starknet:1.5.0 command: @@ -54,19 +47,13 @@ services: - --wait-for-rpc - --data=/data - --head-refresh-interval-ms=1000 - ports: - - 7171:7171 - volumes: - - apibara_prod:/data - networks: - - internal_prod + ports: [7171:7171] + volumes: [apibara_prod:/data] + networks: [internal_prod] restart: on-failure - indexer: image: quay.io/apibara/sink-mongo:0.9.2 - command: - - run - - /indexer/src/main.ts + command: [run, /indexer/src/main.ts] environment: - ALLOW_ENV_FROM_ENV=DEBUG,APIBARA_AUTH_TOKEN,STARTING_BLOCK,STREAM_URL,SINK_TYPE,MONGO_CONNECTION_STRING,MONGO_DATABASE_NAME,STARKNET_NETWORK,KAKAROT_ADDRESS,ALLOW_NET,MONGO_REPLACE_DATA_INSIDE_TRANSACTION,DEFAULT_BLOCK_GAS_LIMIT - DEBUG="" @@ -82,19 +69,13 @@ services: - KAKAROT_ADDRESS=0x6b09c5cca7e5ef944dc3be7514cc1ae5a6e267f0f1f2b5520e90dc00aecf6e1 - DEFAULT_BLOCK_GAS_LIMIT=7000000 restart: on-failure - volumes: - - indexer_code_prod:/indexer - networks: - - internal_prod - depends_on: - - starknet - - kakarot-deployer - + volumes: [indexer_code_prod:/indexer] + networks: [internal_prod] + depends_on: [starknet, kakarot-deployer] kakarot-rpc: image: ghcr.io/kkrt-labs/kakarot-rpc/node:v0.7.1-alpha1 pull_policy: always - ports: - - 3030:3030 + ports: [3030:3030] environment: - KAKAROT_RPC_URL=0.0.0.0:3030 - STARKNET_NETWORK=http://starknet:${MADARA_RPC_PORT:-9944}/ @@ -110,14 +91,9 @@ services: - RELAYER_PRIVATE_KEY=0x1234 - RELAYERS_ADDRESSES=0x12,0x34 restart: on-failure - volumes: - - indexer_code_prod:/usr/src/indexer - depends_on: - - starknet - - kakarot-deployer - networks: - - internal_prod - + volumes: [indexer_code_prod:/usr/src/indexer] + depends_on: [starknet, kakarot-deployer] + networks: [internal_prod] kakarot-deployer: image: ghcr.io/madara-alliance/kakarot:v0.9.2 depends_on: @@ -129,8 +105,7 @@ services: MADARA_ACCOUNT_ADDRESS: 0x04c8c5928b98558300b2c5769f5306ff85864b8f1aee449dde8e4cfc53b42944 MADARA_PRIVATE_KEY: 0x077e56c6dc32d40a67f6f7e6625c8dc5e570abe49c0a24e9202e4ae906abcc07 MADARA_EVM_PRIVATE_KEY: 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 - networks: - - internal_prod + networks: [internal_prod] command: > bash -c ' export PATH=$$PATH:/root/.cargo/bin; @@ -142,11 +117,9 @@ services: exec uv run deploy ' restart: "no" - networks: internal_prod: driver: bridge - volumes: madara_files_prod: mongo_data_prod: diff --git a/flake.nix b/flake.nix index 6fbd4c5cd..42371b67b 100644 --- a/flake.nix +++ b/flake.nix @@ -1,21 +1,25 @@ { inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; rust-overlay.url = "github:oxalica/rust-overlay"; - flake-utils.url = "github:numtide/flake-utils"; + flake-utils.url = "github:numtide/flake-utils"; }; - outputs = { self, nixpkgs, rust-overlay, flake-utils, ... }: - flake-utils.lib.eachDefaultSystem (system: - let - overlays = [ (import rust-overlay) ]; + outputs = { + self, + nixpkgs, + rust-overlay, + flake-utils, + ... + }: + flake-utils.lib.eachDefaultSystem ( + system: let + overlays = [(import rust-overlay)]; pkgs = import nixpkgs { inherit system overlays; }; rustToolchain = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml; - in - { - + in { devShells.default = pkgs.mkShell { nativeBuildInputs = with pkgs; [ openssl @@ -26,13 +30,15 @@ yq ]; - buildInputs = with pkgs; [ - rustToolchain - clang - rocksdb - ] ++ lib.optionals stdenv.isDarwin [ - darwin.apple_sdk.frameworks.Security - ]; + buildInputs = with pkgs; + [ + rustToolchain + clang + rocksdb + ] + ++ lib.optionals stdenv.isDarwin [ + darwin.apple_sdk.frameworks.Security + ]; LIBCLANG_PATH = "${pkgs.llvmPackages.libclang.lib}/lib"; PROTOC = "${pkgs.protobuf}/bin/protoc"; diff --git a/infra/docker-compose.yml b/infra/docker-compose.yml index 9740cc0c6..e0e09f200 100644 --- a/infra/docker-compose.yml +++ b/infra/docker-compose.yml @@ -1,5 +1,5 @@ +--- version: "3.8" - services: madara: build: @@ -7,47 +7,34 @@ services: dockerfile: Dockerfile container_name: madara restart: unless-stopped - ports: - - "9944:9944" - - "9615:9615" - volumes: - - /var/lib/madara:/var/lib/madara + ports: [9944:9944, 9615:9615] + volumes: [/var/lib/madara:/var/lib/madara] command: - [ - "--madara", - "--rpc-port", - "9944", - "--network", - "main", - "--rpc-external", - "--rpc-cors", - "*", - "--rpc-methods", - "Safe", - "--l1-endpoint", - "${DEOXYS_ETHEREUM_API_URL}", - "--rpc-max-connections", - "100", - "--base-path", - "/var/lib/madara", - "--prometheus-external", - ] - + - --madara + - --rpc-port + - "9944" + - --network + - main + - --rpc-external + - --rpc-cors + - "*" + - --rpc-methods + - Safe + - --l1-endpoint + - ${DEOXYS_ETHEREUM_API_URL} + - --rpc-max-connections + - "100" + - --base-path + - /var/lib/madara + - --prometheus-external prometheus: container_name: prometheus image: prom/prometheus:latest restart: unless-stopped - volumes: - - ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml - ports: - - "9090:9090" - links: - - cadvisor:cadvisor - - influxdb:influxdb - depends_on: - - cadvisor - - influxdb - + volumes: [./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml] + ports: [9090:9090] + links: [cadvisor:cadvisor, influxdb:influxdb] + depends_on: [cadvisor, influxdb] node-exporter: image: quay.io/prometheus/node-exporter:latest restart: unless-stopped @@ -57,42 +44,35 @@ services: - /:/rootfs:ro - /:/host:ro,rslave command: - - "--path.rootfs=/host" - - "--path.procfs=/host/proc" - - "--path.sysfs=/host/sys" + - --path.rootfs=/host + - --path.procfs=/host/proc + - --path.sysfs=/host/sys - --collector.filesystem.ignored-mount-points - - "^/(sys|proc|dev|host|etc|rootfs/var/lib/docker/containers|rootfs/var/lib/docker/overlay2|rootfs/run/docker/netns|rootfs/var/lib/docker/aufs)($$|/)" - ports: - - "9100:9100" - + - ^/(sys|proc|dev|host|etc|rootfs/var/lib/docker/containers|rootfs/var/lib/docker/overlay2|rootfs/run/docker/netns|rootfs/var/lib/docker/aufs)($$|/) + ports: [9100:9100] cadvisor: container_name: cadvisor image: gcr.io/cadvisor/cadvisor:latest restart: unless-stopped - ports: - - "8080:8080" + ports: [8080:8080] volumes: - - "/:/rootfs" - - "/var/run:/var/run" - - "/sys:/sys" - - "/var/lib/docker/:/var/lib/docker" - - "/dev/disk/:/dev/disk" + - /:/rootfs + - /var/run:/var/run + - /sys:/sys + - /var/lib/docker/:/var/lib/docker + - /dev/disk/:/dev/disk privileged: true - devices: - - "/dev/kmsg" - + devices: [/dev/kmsg] grafana: image: grafana/grafana user: "472" container_name: grafana - ports: - - 3001:3000 + ports: [3001:3000] restart: unless-stopped volumes: - ./grafana/dashboard.yml:/etc/grafana/provisioning/dashboards/main.yml - ./grafana/dashboards:/var/lib/grafana/dashboards - ./grafana/datasources/datasource.yml:/etc/grafana/provisioning/datasources/main.yml - networks: loki-net: external: true diff --git a/infra/grafana/dashboard.yml b/infra/grafana/dashboard.yml index d7b6d0034..7fb1f5604 100644 --- a/infra/grafana/dashboard.yml +++ b/infra/grafana/dashboard.yml @@ -1,7 +1,7 @@ +--- apiVersion: 1 - providers: - - name: "Dashboard Provider" + - name: Dashboard Provider orgId: 1 folder: "" folderUid: "" diff --git a/infra/grafana/datasources/datasource.yml b/infra/grafana/datasources/datasource.yml index 36e4037c3..4d890765a 100644 --- a/infra/grafana/datasources/datasource.yml +++ b/infra/grafana/datasources/datasource.yml @@ -1,5 +1,5 @@ +--- apiVersion: 1 - datasources: - name: Prometheus type: prometheus diff --git a/infra/prometheus/prometheus.yml b/infra/prometheus/prometheus.yml index 4707e1dde..0d4200776 100644 --- a/infra/prometheus/prometheus.yml +++ b/infra/prometheus/prometheus.yml @@ -1,22 +1,19 @@ +--- global: scrape_interval: 15s - scrape_configs: - - job_name: "prometheus" + - job_name: prometheus scrape_interval: 5s scrape_timeout: 5s static_configs: - - targets: ["prometheus:9090"] - - - job_name: "node-exporter" + - targets: [prometheus:9090] + - job_name: node-exporter static_configs: - - targets: ["node-exporter:9100"] - - - job_name: "substrate_node" + - targets: [node-exporter:9100] + - job_name: substrate_node scrape_interval: 5s static_configs: - - targets: ["madara:9615"] - - - job_name: "cadvisor" + - targets: [madara:9615] + - job_name: cadvisor static_configs: - - targets: ["cadvisor:8080"] + - targets: [cadvisor:8080]