gno icon indicating copy to clipboard operation
gno copied to clipboard

docs: add introduction to Blockchain Indexing

Open Davphla opened this issue 4 months ago • 7 comments

Close: #2295

Minimal Documentation to introduce Blockchain indexing through tx-indexer. I've as well made made an introduction video with a GraphQL live coding example : https://www.youtube.com/watch?v=8ld0nsV37SA.

Davphla avatar Jul 28 '25 10:07 Davphla

🛠 PR Checks Summary

🔴 Changes to 'docs' folder must be reviewed/authored by at least one devrel and one tech-staff

Manual Checks (for Reviewers):
  • [ ] IGNORE the bot requirements for this PR (force green CI check)
  • [ ] The pull request description provides enough details
Read More

🤖 This bot helps streamline PR reviews by verifying automated checks and providing guidance for contributors and reviewers.

✅ Automated Checks (for Contributors):

🟢 Maintainers must be able to edit this pull request (more info) 🔴 Changes to 'docs' folder must be reviewed/authored by at least one devrel and one tech-staff 🟢 Pending initial approval by a review team member, or review from tech-staff

☑️ Contributor Actions:
  1. Fix any issues flagged by automated checks.
  2. Follow the Contributor Checklist to ensure your PR is ready for review.
    • Add new tests, or document why they are unnecessary.
    • Provide clear examples/screenshots, if necessary.
    • Update documentation, if required.
    • Ensure no breaking changes, or include BREAKING CHANGE notes.
    • Link related issues/PRs, where applicable.
☑️ Reviewer Actions:
  1. Complete manual checks for the PR, including the guidelines and additional checks if applicable.
📚 Resources:
Debug
Automated Checks
Maintainers must be able to edit this pull request (more info)

If

🟢 Condition met
└── 🟢 And
    ├── 🟢 The base branch matches this pattern: ^master$
    └── 🟢 The pull request was created from a fork (head branch repo: Davphla/gno)

Then

🟢 Requirement satisfied
└── 🟢 Maintainer can modify this pull request

Changes to 'docs' folder must be reviewed/authored by at least one devrel and one tech-staff

If

🟢 Condition met
└── 🟢 And
    ├── 🟢 The base branch matches this pattern: ^master$
    └── 🟢 A changed file matches this pattern: ^docs/ (filename: docs/README.md)

Then

🔴 Requirement not satisfied
└── 🔴 And
    ├── 🔴 Or
    │   ├── 🔴 Pull request author is a member of the team: tech-staff
    │   └── 🔴 At least 1 user(s) of the team tech-staff reviewed pull request(with state "APPROVED")
    └── 🔴 Or
        ├── 🔴 Pull request author is a member of the team: devrels
        └── 🔴 At least 1 user(s) of the team devrels reviewed pull request(with state "APPROVED")

Pending initial approval by a review team member, or review from tech-staff

If

🟢 Condition met
└── 🟢 And
    ├── 🟢 The base branch matches this pattern: ^master$
    └── 🟢 Not (🔴 Pull request author is a member of the team: tech-staff)

Then

🟢 Requirement satisfied
└── 🟢 If
    ├── 🟢 Condition
    │   └── 🟢 Or
    │       ├── 🔴 At least one of these user(s) reviewed the pull request: [jefft0 leohhhn n0izn0iz notJoon omarsy x1unix] (with state "APPROVED")
    │       ├── 🟢 At least 1 user(s) of the team tech-staff reviewed pull request
    │       └── 🟢 This pull request is a draft
    └── 🟢 Then
        └── 🟢 Not (🔴 This label is applied to pull request: review/triage-pending)

Manual Checks
**IGNORE** the bot requirements for this PR (force green CI check)

If

🟢 Condition met
└── 🟢 On every pull request

Can be checked by

  • Any user with comment edit permission
The pull request description provides enough details

If

🟢 Condition met
└── 🟢 And
    ├── 🟢 Not (🔴 Pull request author is a member of the team: core-contributors)
    └── 🟢 Not (🔴 Pull request author is user: dependabot[bot])

Can be checked by

  • team core-contributors

Gno2D2 avatar Jul 28 '25 10:07 Gno2D2

I think you should use something else than balance as an example, since for that you can simply query the chain.

I think a good example is building a search tool.

Example, for social content: indexing blog posts and building a full-text-search feature over posts content on top of that, which is something that would cost a huge amount of gas if done on-chain. Also search for usernames is a good example.

n0izn0iz avatar Jul 31 '25 12:07 n0izn0iz

@n0izn0iz I modified the section to add more detailed and relevant example following your feedback! :+1:

Davphla avatar Jul 31 '25 14:07 Davphla

Hey @Davphla, let me know when you are ready for another round of reviews.

leohhhn avatar Aug 05 '25 20:08 leohhhn

I re-open it. I reworked it since it was not really great before.

I add a full example implementation step by step (i tried it it's all working great, I can upload it in a separate repository). It's a lot of code in the documentation, but I believe in that specific case that's the most efficient way to share knowledge. It's quite hard to implement when you don't know anything about it (as I got when writing this documentation). I'm open to listen any changes and review!

Davphla avatar Aug 20 '25 11:08 Davphla

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests.

:loudspeaker: Thoughts on this report? Let us know!

codecov[bot] avatar Aug 29 '25 22:08 codecov[bot]

Code available at: https://github.com/samouraiworld/tx-indexer-example (To be moved in Gnoverse).

I've modified through the new update:

  • Remove the database part from the documentation. I think is unrelated to the use of the indexer -- Though it is still available through the link above.
  • Use of embedmd to extract the code to the _assets folder.
  • Use a json structure to match the GraphQL structure

Davphla avatar Oct 08 '25 15:10 Davphla