Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhancement: forc index status: report indexer status and errors #1412

Merged
merged 12 commits into from
Oct 18, 2023

Conversation

lostman
Copy link
Contributor

@lostman lostman commented Oct 13, 2023

Description

Closes #1316.

This PR adds information about active indexers to forc index status.

Testing steps

Start Fuel Indexer Service:

cargo run -p fuel-indexer -- run --fuel-node-host beta-4.fuel.network --fuel-node-port 80 --replace-indexer

Modify fuel-explorer to trigger a panic:

    fn index_block(block_data: BlockData) {
        let _x: Option<usize> = None.unwrap();
        ...
    }

Deploy:

forc-index deploy --path examples/fuel-explorer/fuel-explorer

Deploy another indexer:

forc-index deploy --path examples/hello-world/hello-world/

Check the status

cargo run -p forc-index -- status

Screenshot 2023-10-17 at 5 09 32 PM

fuel-explorer's status should be an error while the other indexer's status should be running, and the status message should show an increasing block count.

Changelog

  • Add additional information to forc index status
  • Add IndexerStatus and IndexerStatusKind types
  • Create index_status table to hold the new information
  • Add humantime formatting of created at, e.g. (23 min 30s ago)

@lostman lostman self-assigned this Oct 13, 2023
@lostman lostman force-pushed the maciej/1316-forc-index-status-report-errors branch from decaa21 to 399f258 Compare October 16, 2023 16:15
@lostman lostman changed the title enhancement: forc index status enhancement: forc index status: report indexer status and errors Oct 16, 2023
@lostman lostman force-pushed the maciej/1316-forc-index-status-report-errors branch from 7a8c7a0 to 5c5daee Compare October 16, 2023 22:46
@lostman lostman force-pushed the maciej/1316-forc-index-status-report-errors branch from da95581 to 6a52757 Compare October 17, 2023 11:48
@lostman lostman linked an issue Oct 17, 2023 that may be closed by this pull request
@lostman lostman marked this pull request as ready for review October 17, 2023 18:15
deekerno
deekerno previously approved these changes Oct 17, 2023
Copy link
Contributor

@deekerno deekerno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is excellent. Thanks @lostman!

packages/fuel-indexer-database/postgres/src/lib.rs Outdated Show resolved Hide resolved
packages/fuel-indexer-database/src/queries.rs Outdated Show resolved Hide resolved
@lostman lostman requested a review from deekerno October 18, 2023 12:01
Copy link
Contributor

@ra0x3 ra0x3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lostman

  • This mostly looks OK
  • However, I'm personally not sure how this works
  • Does this work for a single indexer? For a single public key? This works for all indexers under a given public key? What if I want to check the status of a single indexer?
    • If these have simple answers, I don't think we need docs
    • If these answers are a bit more invovled, maybe we'll have to add a ## Usage section in docs > src > forc-index > status.md

@lostman lostman requested a review from ra0x3 October 18, 2023 16:50
@lostman lostman force-pushed the maciej/1316-forc-index-status-report-errors branch from ab26d1b to e537288 Compare October 18, 2023 18:12
@lostman lostman force-pushed the maciej/1316-forc-index-status-report-errors branch from e537288 to 0498316 Compare October 18, 2023 18:36
@lostman lostman requested a review from ra0x3 October 18, 2023 18:37
ra0x3
ra0x3 previously approved these changes Oct 18, 2023
deekerno
deekerno previously approved these changes Oct 18, 2023
@lostman lostman dismissed stale reviews from deekerno and ra0x3 via 1df2494 October 18, 2023 19:35
@ra0x3 ra0x3 enabled auto-merge (squash) October 18, 2023 20:59
@ra0x3 ra0x3 merged commit 7172ee2 into develop Oct 18, 2023
19 checks passed
@ra0x3 ra0x3 deleted the maciej/1316-forc-index-status-report-errors branch October 18, 2023 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

enhancement: forc index status: report errors and indexed blocks
3 participants