Skip to content

feat: adding rust client tutorial - #1582

Merged
distractedm1nd merged 4 commits into
mainfrom
lumina
Jun 18, 2024
Merged

feat: adding rust client tutorial#1582
distractedm1nd merged 4 commits into
mainfrom
lumina

Conversation

@distractedm1nd

@distractedm1nd distractedm1nd commented May 23, 2024

Copy link
Copy Markdown
Contributor

This is just an idea, so its in draft. I don't really know how or even IF we should add a rust client tutorial, given that the library is not maintained by us. However, I have encountered more people building on node with rust in the wild than with go, so we should think about it.

It is basically identical to the golang client tutorial, except the code snippets of course, so maybe tabs might work (but @jcstein mentioned something about the framework we use not having a good tab impl?) but we'll see. Just posting the work here as a checkpoint

https://celestiaorg.github.io/docs-preview/pr-1582/developers/rust-client-tutorial

Summary by CodeRabbit

  • Documentation
    • Updated the Golang client tutorial to redirect users to the Rust Client Library Tutorial.
    • Introduced a comprehensive tutorial for using Lumina's Rust client library, covering project setup, interaction with RPC endpoints, and providing links to API documentation.

@distractedm1nd
distractedm1nd requested a review from jcstein May 23, 2024 15:00
@distractedm1nd distractedm1nd self-assigned this May 23, 2024
@coderabbitai

coderabbitai Bot commented May 23, 2024

Copy link
Copy Markdown
Contributor

Warning

Rate limit exceeded

@jcstein has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 51 minutes and 26 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

Commits

Files that changed from the base of the PR and between a4e430e and 970dbe9.

Walkthrough

A new tutorial for using Lumina's Rust client library has been introduced, detailing how to interact with common RPC endpoints. This tutorial includes sections on project setup, submitting and retrieving blobs, subscribing to new headers, and fetching an Extended Data Square (EDS). Additionally, an update in the Golang client tutorial redirects users from a "Prompt Scavenger" page to a "Rust Client Library Tutorial" page.

Changes

Files Change Summaries
developers/golang-client-tutorial.md Updated a link and text in the tutorial, redirecting users from "Prompt Scavenger" to "Rust Client Library Tutorial".
developers/rust-client-tutorial.md Introduced a tutorial for using Lumina's Rust client library. Added submit_blob, subscribe_headers, and get_eds functions.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant GolangClient
    participant RustTutorial
    participant RustClient

    User->>GolangClient: Visit Golang tutorial
    GolangClient->>RustTutorial: Redirect to Rust tutorial

    User->>RustTutorial: Follow Rust tutorial setup
    RustTutorial->>RustClient: Use submit_blob, subscribe_headers, get_eds functions
    RustClient-->>RustTutorial: Receive responses

    Note over User,RustTutorial: Workflow showing new features in RustTutorial
Loading

Poem

In code, the rustling pages new,
A Rust client guide shines through,
From blobs to headers, and squares so grand,
With async calls, all planned.
Through bytes and data, we now will delve,
Majesty in Rust, we will shelve.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions

github-actions Bot commented May 23, 2024

Copy link
Copy Markdown
Contributor
PR Preview Action v1.4.7
🚀 Deployed preview to https://celestiaorg.github.io/docs-preview/./pr-1582/
on branch main at 2024-06-17 21:03 UTC

@distractedm1nd
distractedm1nd marked this pull request as ready for review June 17, 2024 13:32

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 0041149 and 55d2381.

Files selected for processing (2)
  • developers/golang-client-tutorial.md (1 hunks)
  • developers/rust-client-tutorial.md (1 hunks)
Additional context used
LanguageTool
developers/golang-client-tutorial.md

[style] ~23-~23: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym. (ENGLISH_WORD_REPEAT_BEGINNING_RULE)
Context: ... need the node URL and your auth token. To get your auth token, see this [guide](....


[style] ~23-~23: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym. (ENGLISH_WORD_REPEAT_BEGINNING_RULE)
Context: ...guide. To run your node without an auth token, yo...

developers/rust-client-tutorial.md

[style] ~23-~23: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym. (ENGLISH_WORD_REPEAT_BEGINNING_RULE)
Context: ... need the node URL and your auth token. To get your auth token, see this [guide](....


[style] ~23-~23: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym. (ENGLISH_WORD_REPEAT_BEGINNING_RULE)
Context: ...guide. To run your node without an auth token, yo...


[uncategorized] ~35-~35: You might be missing the article “an” here. (AI_EN_LECTOR_MISSING_DETERMINER_AN)
Context: ...#blob.GetAll) method takes a height and array of namespaces, returning the array of b...

Markdownlint
developers/golang-client-tutorial.md

39-39: Column: 1 (MD010, no-hard-tabs)
Hard tabs


40-40: Column: 1 (MD010, no-hard-tabs)
Hard tabs


41-41: Column: 1 (MD010, no-hard-tabs)
Hard tabs


43-43: Column: 1 (MD010, no-hard-tabs)
Hard tabs


44-44: Column: 1 (MD010, no-hard-tabs)
Hard tabs


45-45: Column: 1 (MD010, no-hard-tabs)
Hard tabs


50-50: Column: 1 (MD010, no-hard-tabs)
Hard tabs


51-51: Column: 1 (MD010, no-hard-tabs)
Hard tabs


52-52: Column: 1 (MD010, no-hard-tabs)
Hard tabs


53-53: Column: 1 (MD010, no-hard-tabs)
Hard tabs


55-55: Column: 1 (MD010, no-hard-tabs)
Hard tabs


56-56: Column: 1 (MD010, no-hard-tabs)
Hard tabs


57-57: Column: 1 (MD010, no-hard-tabs)
Hard tabs


58-58: Column: 1 (MD010, no-hard-tabs)
Hard tabs


59-59: Column: 1 (MD010, no-hard-tabs)
Hard tabs


61-61: Column: 1 (MD010, no-hard-tabs)
Hard tabs


62-62: Column: 1 (MD010, no-hard-tabs)
Hard tabs


63-63: Column: 1 (MD010, no-hard-tabs)
Hard tabs


64-64: Column: 1 (MD010, no-hard-tabs)
Hard tabs


65-65: Column: 1 (MD010, no-hard-tabs)
Hard tabs


67-67: Column: 1 (MD010, no-hard-tabs)
Hard tabs


68-68: Column: 1 (MD010, no-hard-tabs)
Hard tabs


69-69: Column: 1 (MD010, no-hard-tabs)
Hard tabs


70-70: Column: 1 (MD010, no-hard-tabs)
Hard tabs


71-71: Column: 1 (MD010, no-hard-tabs)
Hard tabs


73-73: Column: 1 (MD010, no-hard-tabs)
Hard tabs


75-75: Column: 1 (MD010, no-hard-tabs)
Hard tabs


76-76: Column: 1 (MD010, no-hard-tabs)
Hard tabs


77-77: Column: 1 (MD010, no-hard-tabs)
Hard tabs


78-78: Column: 1 (MD010, no-hard-tabs)
Hard tabs


79-79: Column: 1 (MD010, no-hard-tabs)
Hard tabs


81-81: Column: 1 (MD010, no-hard-tabs)
Hard tabs


82-82: Column: 1 (MD010, no-hard-tabs)
Hard tabs


97-97: Column: 1 (MD010, no-hard-tabs)
Hard tabs


98-98: Column: 1 (MD010, no-hard-tabs)
Hard tabs


99-99: Column: 1 (MD010, no-hard-tabs)
Hard tabs


100-100: Column: 1 (MD010, no-hard-tabs)
Hard tabs


102-102: Column: 1 (MD010, no-hard-tabs)
Hard tabs


103-103: Column: 1 (MD010, no-hard-tabs)
Hard tabs


104-104: Column: 1 (MD010, no-hard-tabs)
Hard tabs


105-105: Column: 1 (MD010, no-hard-tabs)
Hard tabs


106-106: Column: 1 (MD010, no-hard-tabs)
Hard tabs


108-108: Column: 1 (MD010, no-hard-tabs)
Hard tabs


109-109: Column: 1 (MD010, no-hard-tabs)
Hard tabs


110-110: Column: 1 (MD010, no-hard-tabs)
Hard tabs


111-111: Column: 1 (MD010, no-hard-tabs)
Hard tabs


112-112: Column: 1 (MD010, no-hard-tabs)
Hard tabs


114-114: Column: 1 (MD010, no-hard-tabs)
Hard tabs


115-115: Column: 1 (MD010, no-hard-tabs)
Hard tabs


116-116: Column: 1 (MD010, no-hard-tabs)
Hard tabs


117-117: Column: 1 (MD010, no-hard-tabs)
Hard tabs


118-118: Column: 1 (MD010, no-hard-tabs)
Hard tabs


119-119: Column: 1 (MD010, no-hard-tabs)
Hard tabs


120-120: Column: 1 (MD010, no-hard-tabs)
Hard tabs


121-121: Column: 1 (MD010, no-hard-tabs)
Hard tabs


123-123: Column: 1 (MD010, no-hard-tabs)
Hard tabs


124-124: Column: 1 (MD010, no-hard-tabs)
Hard tabs


125-125: Column: 1 (MD010, no-hard-tabs)
Hard tabs


126-126: Column: 1 (MD010, no-hard-tabs)
Hard tabs


127-127: Column: 1 (MD010, no-hard-tabs)
Hard tabs


138-138: Column: 1 (MD010, no-hard-tabs)
Hard tabs


139-139: Column: 1 (MD010, no-hard-tabs)
Hard tabs


140-140: Column: 1 (MD010, no-hard-tabs)
Hard tabs


141-141: Column: 1 (MD010, no-hard-tabs)
Hard tabs


143-143: Column: 1 (MD010, no-hard-tabs)
Hard tabs


144-144: Column: 1 (MD010, no-hard-tabs)
Hard tabs


145-145: Column: 1 (MD010, no-hard-tabs)
Hard tabs


146-146: Column: 1 (MD010, no-hard-tabs)
Hard tabs


147-147: Column: 1 (MD010, no-hard-tabs)
Hard tabs


149-149: Column: 1 (MD010, no-hard-tabs)
Hard tabs


150-150: Column: 1 (MD010, no-hard-tabs)
Hard tabs

Additional comments not posted (4)
developers/golang-client-tutorial.md (1)

3-4: Update the next link and text to point to the Rust Client Library Tutorial.

This change aligns with the PR's objective to introduce the Rust tutorial alongside the existing Golang tutorial.

developers/rust-client-tutorial.md (3)

42-70: Review the submit_blob function for correctness and best practices.

The function correctly handles asynchronous operations, error handling, and demonstrates proper usage of the library's functionality.


78-116: Review the subscribe_headers function for correctness and best practices.

The function uses modern Rust async features effectively, handles errors gracefully, and logs appropriate messages, which are good practices for robust error handling and user feedback.


125-140: Review the get_eds function for correctness and best practices.

The function is well-structured, uses async-await properly, and includes comprehensive error handling. This is crucial for maintaining the reliability of the application.

Comment thread developers/rust-client-tutorial.md Outdated
@jcstein jcstein added documentation Improvements or additions to documentation enhancement New feature or request labels Jun 17, 2024
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 55d2381 and a4e430e.

Files selected for processing (1)
  • developers/rust-client-tutorial.md (1 hunks)
Additional context used
LanguageTool
developers/rust-client-tutorial.md

[style] ~23-~23: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym. (ENGLISH_WORD_REPEAT_BEGINNING_RULE)
Context: ... need the node URL and your auth token. To get your auth token, see this [guide](....


[style] ~23-~23: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym. (ENGLISH_WORD_REPEAT_BEGINNING_RULE)
Context: ...guide. To run your node without an auth token, yo...

Additional comments not posted (1)
developers/rust-client-tutorial.md (1)

23-23: Consider rephrasing to avoid repetitive sentence beginnings.
[REFACTOR_SUGGESTion]

- To use the following methods, you will need the node URL and your auth token. To get your auth token, see this [guide](./node-tutorial.md#auth-token). To run your node without an auth token, you can use the `--rpc.skip-auth` flag when starting your node.
+ To use the following methods, you will need the node URL and your auth token, which you can obtain following this [guide](./node-tutorial.md#auth-token). If you prefer to run your node without an auth token, use the `--rpc.skip-auth` flag when starting your node.
Tools
LanguageTool

[style] ~23-~23: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym. (ENGLISH_WORD_REPEAT_BEGINNING_RULE)
Context: ... need the node URL and your auth token. To get your auth token, see this [guide](....


[style] ~23-~23: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym. (ENGLISH_WORD_REPEAT_BEGINNING_RULE)
Context: ...guide. To run your node without an auth token, yo...

Comment thread developers/rust-client-tutorial.md
Comment thread developers/rust-client-tutorial.md
Comment thread developers/rust-client-tutorial.md

@jcstein jcstein left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

:shipit:

@distractedm1nd
distractedm1nd merged commit e3f080b into main Jun 18, 2024
@distractedm1nd
distractedm1nd deleted the lumina branch June 18, 2024 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants