Skip to content

docs: update golang client tut to use celestia-node/api/rpc/client instead of openrpc#2008

Closed
jcstein wants to merge 6 commits intomainfrom
jcs/update-golang-tut
Closed

docs: update golang client tut to use celestia-node/api/rpc/client instead of openrpc#2008
jcstein wants to merge 6 commits intomainfrom
jcs/update-golang-tut

Conversation

@jcstein
Copy link
Copy Markdown
Member

@jcstein jcstein commented Apr 24, 2025

Overview

WIP

Summary by CodeRabbit

  • Documentation
    • Updated faucet URLs in the Arabica devnet, Mammoth testnet, and Mocha testnet guides to reflect new web addresses.
    • Revised the Golang client tutorial to use the latest recommended client library, with updated setup instructions, example code, and improved error handling. Added a new example for retrieving blobs by height and namespace.

@jcstein jcstein requested a review from walldiss April 24, 2025 15:53
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 24, 2025

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

This update revises documentation in several how-to guides and a tutorial. Faucet URLs in the Arabica devnet, Mammoth, and Mocha testnet guides are updated to use new network-specific celenium subdomains. The Mammoth guide consolidates faucet references into a single URL. The Golang client tutorial is overhauled to replace the deprecated celestia-openrpc library with the newer celestia-node/api/rpc/client package, updating example code for blob submission and retrieval to match the new client API, and adding improved error handling and explanatory notes.

Changes

File(s) Change Summary
how-to-guides/arabica-devnet.md,
how-to-guides/mocha-testnet.md
Updated web faucet URLs to new network-specific celenium subdomains.
how-to-guides/mammoth.md Updated and consolidated faucet URLs, replacing two previous URLs with a single new network-specific celenium faucet URL.
tutorials/golang-client-tutorial.md Replaced deprecated Go client with new celestia-node/api/rpc/client package, rewrote blob submission/retrieval examples, and improved error handling and documentation.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant GoClientTutorial
    participant CelestiaNodeAPI

    User->>GoClientTutorial: Run SubmitBlob example
    GoClientTutorial->>CelestiaNodeAPI: Connect via rpc/client
    GoClientTutorial->>CelestiaNodeAPI: Submit blob with namespace
    CelestiaNodeAPI-->>GoClientTutorial: Return inclusion height
    GoClientTutorial-->>User: Print inclusion height

    User->>GoClientTutorial: Run GetBlobs example
    GoClientTutorial->>CelestiaNodeAPI: Retrieve blobs by height and namespace
    CelestiaNodeAPI-->>GoClientTutorial: Return blobs
    GoClientTutorial-->>User: Print blobs or error
Loading

Possibly related PRs

Suggested reviewers

  • distractedm1nd

Poem

A hop, a skip, a faucet link anew,
The networks now with URLs true!
The Go code shines, refreshed and bright,
With blobs that soar to blockchain height.
Rabbits cheer with every guide,
Hopping through docs, their pride undenied!
🐇✨


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.

@jcstein jcstein requested a review from Ferret-san April 24, 2025 15:53
@jcstein jcstein self-assigned this Apr 24, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 24, 2025

PR Preview Action v1.6.1
Preview removed because the pull request was closed.
2025-04-24 17:45 UTC

Copy link
Copy Markdown
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: 1

🧹 Nitpick comments (3)
how-to-guides/arabica-devnet.md (1)

169-169: Line length exceeds markdownlint recommendation. This line is over 190 characters and triggers MD013. Consider breaking it into a list or using reference-style links to improve readability and comply with the 80-character limit. For example:

The web faucet is available at:
- [https://arabica.celenium.io/faucet](https://arabica.celenium.io/faucet)
- [https://faucet.celestia-arabica-11.com/](https://faucet.celestia-arabica-11.com/)
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

169-169: Line length
Expected: 80; Actual: 191

(MD013, line-length)

tutorials/golang-client-tutorial.md (2)

11-14: Clarify deprecation note and section flow
The new deprecation note is helpful, but consider linking directly to the official celestia-openrpc deprecation announcement or issue for more context. Also, the horizontal rule and the repeated “## Project setup” header can be confusing—either remove the first heading or merge the two sections for better flow.


34-34: Align heading style with retrieving example
The “### Submitting a blob” heading is singular, while the retrieval heading is plural. For consistency, consider renaming to “### Submitting blobs”.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 0cbba6c and 5215d0b.

📒 Files selected for processing (4)
  • how-to-guides/arabica-devnet.md (1 hunks)
  • how-to-guides/mammoth.md (1 hunks)
  • how-to-guides/mocha-testnet.md (1 hunks)
  • tutorials/golang-client-tutorial.md (1 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
how-to-guides/arabica-devnet.md

169-169: Line length
Expected: 80; Actual: 191

(MD013, line-length)

🔇 Additional comments (18)
how-to-guides/mammoth.md (1)

125-125: LGTM — Faucet URL updated correctly
The link to the Mammoth testnet faucet now uses the consolidated mammoth.celenium.io subdomain, matching the pattern in other network guides.

how-to-guides/mocha-testnet.md (1)

239-239: Approved: Correct Mocha faucet URL update
The web faucet link has been updated to the Mocha-specific subdomain as intended. This aligns with the changes in other network guides for consistency across documentation.

how-to-guides/arabica-devnet.md (1)

169-169: Faucet URL update is correct. The web faucet link has been updated to the Arabica-specific subdomain, matching the changes in related network guides.

🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

169-169: Line length
Expected: 80; Actual: 191

(MD013, line-length)

tutorials/golang-client-tutorial.md (15)

25-26: Verify auth-token guide link
You’ve linked to /tutorials/node-tutorial.md#auth-token—please confirm that this path matches your docs structure (most env guides live under /how-to-guides), or update the URL to point at the correct location.


28-28: Confirm default RPC port
The default URL is set to http://localhost:26658. Please verify that Celestia’s RPC endpoint listens on port 26658 by default (some setups use 26657).


32-32: Introduction to blob examples is clear
This line succinctly sets up the upcoming examples.


38-42: Import block looks good
Standard-library imports (context, fmt) and external packages are correctly declared.


45-47: Function signature is clear
SubmitBlob(ctx, url, token) reads well and parameters are descriptive.


49-51: Error wrapping and cleanup are correct
You correctly wrap client creation errors and defer c.Close().


53-57: Namespace creation with error handling is solid
Using share.NewBlobNamespaceV0 and wrapping the error provides clear diagnostics.


59-62: Blob instantiation is correct
Creating blob.NewBlobV0 with proper error propagation is on point.


71-73: Output formatting and return look good
Printing the height and returning nil follows Go examples conventions.


79-82: GetBlobs initialization is well-structured
The signature, client creation, and wrapped error are implemented correctly.


84-85: Deferring client close is handled properly
Ensures WebSocket/HTTP connections are cleaned up.


86-89: Blob retrieval logic is correct
Calling c.Blob.GetAll with error wrapping provides clear flow.


90-91: Returning blob slice is straightforward
No further comments here.


98-100: Notes section is informative
These bullets clearly warn about temporary dependencies and point readers to advanced usage.


20-22: ⚠️ Potential issue

Fix duplicated and missing dependencies
The go get list currently installs the RPC client twice and omits the blob builder. To ensure users pull in all required packages, please update as follows:

-go get github.com/celestiaorg/celestia-node/api/rpc/client
-go get github.com/celestiaorg/celestia-node/api/rpc/client
-go get github.com/celestiaorg/celestia-node/nodebuilder/share
+go get github.com/celestiaorg/celestia-node/api/rpc/client
+go get github.com/celestiaorg/celestia-node/nodebuilder/blob
+go get github.com/celestiaorg/celestia-node/nodebuilder/share

Likely an incorrect or invalid review comment.

Comment thread tutorials/golang-client-tutorial.md
@jcstein jcstein marked this pull request as draft April 24, 2025 16:06
@jcstein
Copy link
Copy Markdown
Member Author

jcstein commented Apr 24, 2025

Screenshot 2025-04-24 at 12 30 38

added 2 examples but can't figure out how to make the client.go example work due to this dependency issue

@jcstein jcstein closed this Apr 24, 2025
@jcstein jcstein deleted the jcs/update-golang-tut branch April 28, 2025 17:01
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.

1 participant