Skip to content

Conversation

Ferret-san
Copy link
Contributor

@Ferret-san Ferret-san commented Apr 24, 2025

Summary by CodeRabbit

  • Documentation
    • Updated the Golang client tutorial with new dependencies, revised import paths, simplified example code, and a comprehensive usage example demonstrating node connection, blob submission, and verification.
    • Removed the "Prompt Scavenger" tutorial and its sidebar navigation link.
    • Updated tutorial navigation links in related guides to reflect the removal of the "Prompt Scavenger" tutorial.
    • Removed the "Gateway API tutorial" section referencing the "Prompt Scavenger" tutorial.
    • Updated the "prev" navigation link in the Celestia Node Key tutorial.

Copy link
Contributor

coderabbitai bot commented Apr 24, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This update modifies the Golang client tutorial to replace its dependency on celestia-openrpc with celestia-node and go-square, updating import paths, dependency versions, and code examples to match the new libraries. Several function implementations within the tutorial are adjusted to reflect API changes, such as namespace creation and blob submission. Additionally, the tutorial for the "Prompt Scavenger" game is removed entirely, eliminating its instructions and code examples related to building a blockchain-integrated scavenger game using Celestia and OpenAI.

Changes

File(s) Change Summary
tutorials/golang-client-tutorial.md Updated tutorial to use celestia-node and go-square dependencies, revised import paths, updated code examples for namespace creation, blob submission, and subscription, and made minor formatting adjustments.
tutorials/prompt-scavenger.md Removed the entire tutorial, which previously guided users through building a "Prompt Scavenger" game integrating Celestia and OpenAI’s GPT-3.5 API.
.vitepress/config.ts Removed sidebar entry linking to the removed "Prompt Scavenger" tutorial.
tutorials/celestia-node-key.md Updated "prev" navigation link metadata to point to the "Rust client tutorial" instead of "New Blobstream X deployments".
tutorials/node-api.md Removed the "Gateway API tutorial" section referencing the "Prompt scavenger gateway API tutorial".
tutorials/rust-client-tutorial.md Updated "next" navigation link from "Prompt Scavenger" tutorial to "Create a wallet with celestia-node" tutorial.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Golang Client
    participant Celestia Node (via celestia-node/go-square)

    User->>Golang Client: Run tutorial code (e.g., SubmitBlob)
    Golang Client->>Celestia Node (via celestia-node/go-square): Submit blob / Subscribe / GetEDS
    Celestia Node (via celestia-node/go-square)-->>Golang Client: Response (blob status, subscription, EDS)
    Golang Client-->>User: Output result (success, error, data)
Loading

Possibly related PRs

Suggested labels

enhancement

Suggested reviewers

  • distractedm1nd
  • jcstein

Poem

In code’s bright field, a change takes root,
With new libraries in hot pursuit.
The scavenger’s game hops off the stage,
While blobs and nodes take center page.
A bunny cheers with every hop—
“Keep your docs fresh, don’t ever stop!”
🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 441c8b8 and 07ee5b2.

📒 Files selected for processing (1)
  • tutorials/golang-client-tutorial.md (6 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ 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>, please review it.
    • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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 using 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 generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this 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.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration 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.

Copy link
Contributor

github-actions bot commented Apr 24, 2025

PR Preview Action v1.6.1

🚀 View preview at
https://celestiaorg.github.io/docs-preview/pr-2011/

Built to branch main at 2025-04-25 22:02 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🔭 Outside diff range comments (3)
tutorials/golang-client-tutorial.md (3)

45-47: 🛠️ Refactor suggestion

Documentation mismatch: namespace creation API changed
The bullet list above still references share.NewBlobNamespaceV0, but the code uses share.NewV0Namespace. Please update the tutorial text to reflect the new function name.


113-117: ⚠️ Potential issue

Critical: outdated namespace constructor in subscription example
The subscription example still calls share.NewBlobNamespaceV0, which no longer exists in go-square/v2. It should be updated to:

-   namespace, err := share.NewBlobNamespaceV0([]byte{0xDE, 0xAD, 0xBE, 0xEF})
+   namespace, err := share.NewV0Namespace([]byte{0xDE, 0xAD, 0xBE, 0xEF})

183-193: 🛠️ Refactor suggestion

Update EDS tutorial text to match new API
The prose states “This method takes a header,” but the code now calls client.Share.GetEDS(ctx, height) directly. Please adjust the doc comment to reflect that the function uses a height parameter instead of a header.

🧹 Nitpick comments (2)
tutorials/golang-client-tutorial.md (2)

52-60: Group imports for idiomatic Go
Consider adding a blank line between standard-library imports (bytes, context, fmt) and third-party imports for clarity. E.g.:

-import (
-   "bytes"
-   "context"
-   "fmt"
-   client "github.com/celestiaorg/celestia-node/api/rpc/client"
-   "github.com/celestiaorg/celestia-node/blob"
-   share "github.com/celestiaorg/go-square/v2/share"
-)
+import (
+   "bytes"
+   "context"
+   "fmt"
+
+   client "github.com/celestiaorg/celestia-node/api/rpc/client"
+   "github.com/celestiaorg/celestia-node/blob"
+   share "github.com/celestiaorg/go-square/v2/share"
+)

82-87: Simplified Submit call: pass nil for default options
The example uses nil instead of blob.NewSubmitOptions(). It may help to note in the prose that passing nil triggers default gas-price behavior, so readers aren’t confused.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8eb5cb7 and bb7705b.

📒 Files selected for processing (2)
  • tutorials/golang-client-tutorial.md (6 hunks)
  • tutorials/prompt-scavenger.md (0 hunks)
💤 Files with no reviewable changes (1)
  • tutorials/prompt-scavenger.md
🧰 Additional context used
🪛 LanguageTool
tutorials/golang-client-tutorial.md

[style] ~31-~31: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...tutorials/node-tutorial.md#auth-token). To run your node without an auth token, yo...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)

🔇 Additional comments (4)
tutorials/golang-client-tutorial.md (4)

11-16: Dependency installation instructions look correct
The tutorial now instructs users to go get the new celestia-node and go-square modules with explicit versions. These commands are valid for adding module dependencies.


18-28: Replace directives updated appropriately
The replace block in go.mod aligns with the new Celestia forks and versions. No issues spotted.


70-74: Namespace creation usage is correct
The code now properly calls share.NewV0Namespace. This matches the updated go-square API.


119-123: Subscribe signature updated correctly
Passing namespace to client.Blob.Subscribe(ctx, namespace) aligns with the new method signature.

@jcstein jcstein self-requested a review April 24, 2025 22:20
Copy link
Member

@jcstein jcstein left a comment

Choose a reason for hiding this comment

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

LGTM and thank you :shipit:

@jcstein
Copy link
Member

jcstein commented Apr 25, 2025

https://mocha.celenium.io/tx/479d640cc35da97ef8fcf46a9ce9e3c8b6db52accfbb954e409f4774eb4c0643?tab=messages

using an example main.go that i'll add to this PR

./celestia-test
Testing connection to Celestia node...
Successfully connected to node, checking node status...
Current network height: 5867156
Connected to Celestia node
Submitting blob to the network...
Success! Blob was included at height 5867157
Retrieving blob from the network...
Retrieved blob successfully! Blobs are equal? true
Original message: Hello, World!
Retrieved message: %!s(func() []uint8=0x104911500)

@jcstein jcstein merged commit 6ef1256 into main Apr 25, 2025
4 of 5 checks passed
@jcstein jcstein deleted the golang-tutorial-cleanup branch April 25, 2025 22:02
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.

2 participants