Skip to content

docs(v2): add Examples showcase, and make the examples runnable#939

Merged
scarmuega merged 2 commits into
mainfrom
docs/v2-examples-showcase
Jun 14, 2026
Merged

docs(v2): add Examples showcase, and make the examples runnable#939
scarmuega merged 2 commits into
mainfrom
docs/v2-examples-showcase

Conversation

@scarmuega

@scarmuega scarmuega commented Jun 14, 2026

Copy link
Copy Markdown
Member

What

Adds an Examples section to the v2 docs that showcases the ready-to-run
configs under examples/, and fixes the examples themselves so that
following the docs verbatim actually works.

Docs

  • New docs/v2/examples/ section (_meta.yaml + index.mdx): how to run an
    example, companion-file/setup notes, categorized index of every example
    (sources, filters, sinks, cursors, observability, library), and a few inlined
    end-to-end recipes.
  • Cross-link from the v2 introduction.

Example fixes

Validated by building v2.1.0 from source and running every example.

  • Dead relay swept (21 configs + 2 inlined recipes). The examples pointed at
    relays-new.cardano-mainnet.iohk.io:3001, which no longer resolves
    (NXDOMAIN) — run verbatim they only looped on error connecting bearer. Now
    they use the live backbone.mainnet.cardanofoundation.org:3001.
  • dolos_source (broken → fixed). The U5C source's metadata field is
    required (no serde default), so the example failed to load with
    missing field metadata. Added an empty metadata table, pointed the URL at a
    local Dolos, and documented the Demeter API-key pattern.
  • hydra source (panic → graceful). bootstrap called
    .expect("Can't connect"), so an unreachable Hydra node panicked the process.
    It now logs the error and returns a retryable WorkerError, like the rest of
    the source.

Not included

  • examples/pool_metadata still uses the removed Deno filter (separate
    removal/port decision) and is excluded from the showcase.
  • Dead-relay references outside the examples (other docs pages, CONTRIBUTING.md,
    v1 docs) are left for a follow-up.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation

    • Added comprehensive examples documentation with setup guidance and categorized example descriptions.
    • Added Examples section to main documentation.
  • Configuration

    • Updated all example peer endpoints to new Cardano Foundation backbone.
    • Dolos example now uses local gRPC endpoint by default.
  • Bug Fixes

    • Improved Hydra WebSocket connection error handling to prevent panics.

Surface the ready-to-run configs under examples/ in the v2 docs. Adds a
new Examples section with a how-to-run intro (run from the example dir),
a companion-files/setup guide, categorized index tables linking each
example to GitHub with a Setup column, and three inlined end-to-end
recipes. Cross-linked from the introduction page.

Excludes examples/pool_metadata (references the removed Deno filter) and
examples/_deprecated.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@scarmuega scarmuega requested a review from paulobressan as a code owner June 14, 2026 13:33
@coderabbitai

coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 51ccf33b-0484-44fe-a780-3e2cbd50ad06

📥 Commits

Reviewing files that changed from the base of the PR and between f0ee7d9 and b3d8ba8.

📒 Files selected for processing (26)
  • docs/v2/examples/_meta.yaml
  • docs/v2/examples/index.mdx
  • docs/v2/index.mdx
  • examples/assert/daemon.toml
  • examples/aws_lambda/daemon.toml
  • examples/aws_s3/daemon.toml
  • examples/aws_sqs/daemon.toml
  • examples/dolos_source/daemon.toml
  • examples/elasticsearch/daemon.toml
  • examples/file_cursor/daemon.toml
  • examples/file_rotate/daemon.toml
  • examples/gcp_cloudfunction/daemon.toml
  • examples/gcp_pubsub/daemon.toml
  • examples/into_json/daemon.toml
  • examples/kafka/daemon.toml
  • examples/metrics/daemon.toml
  • examples/parse_cbor/daemon.toml
  • examples/postgresql/daemon.toml
  • examples/rabbitmq/daemon.toml
  • examples/redis/daemon.toml
  • examples/select/daemon.toml
  • examples/stdout/daemon.toml
  • examples/wasm_basic/daemon.toml
  • examples/webhook_basics/daemon.toml
  • examples/zeromq/daemon.toml
  • src/sources/hydra.rs

📝 Walkthrough

Walkthrough

Adds a new docs/v2/examples/ documentation section with an index page containing categorized example tables, setup instructions, and three TOML pipeline recipes. Updates the N2N peers endpoint in all 22 example daemon.toml files to backbone.mainnet.cardanofoundation.org:3001. Adjusts the dolos_source config to a local gRPC URL. Replaces a panic with logged error propagation in the Hydra WebSocket source.

Changes

Examples Documentation and Configuration

Layer / File(s) Summary
Examples documentation page and navigation
docs/v2/examples/_meta.yaml, docs/v2/examples/index.mdx, docs/v2/index.mdx
Adds _meta.yaml nav settings (label, order, collapsed), creates the full index.mdx with running instructions, categorized tables (Sources, Filters & pipelines, Sinks, Cursors, Observability), library section, and three complete TOML recipe snippets; links the new page from the v2 main index.
Bulk peer endpoint update across example configs
examples/dolos_source/daemon.toml, examples/assert/daemon.toml, examples/aws_lambda/daemon.toml, examples/aws_s3/daemon.toml, examples/aws_sqs/daemon.toml, examples/elasticsearch/daemon.toml, examples/file_cursor/daemon.toml, examples/file_rotate/daemon.toml, examples/gcp_cloudfunction/daemon.toml, examples/gcp_pubsub/daemon.toml, examples/into_json/daemon.toml, examples/kafka/daemon.toml, examples/metrics/daemon.toml, examples/parse_cbor/daemon.toml, examples/postgresql/daemon.toml, examples/rabbitmq/daemon.toml, examples/redis/daemon.toml, examples/select/daemon.toml, examples/stdout/daemon.toml, examples/wasm_basic/daemon.toml, examples/webhook_basics/daemon.toml, examples/zeromq/daemon.toml
All N2N peers entries are changed from relays-new.cardano-mainnet.iohk.io:3001 to backbone.mainnet.cardanofoundation.org:3001; dolos_source additionally switches url to http://localhost:50051 and adds an empty metadata = {} field with gRPC header comments.

Hydra WebSocket Error Handling

Layer / File(s) Summary
Hydra WebSocket graceful error handling
src/sources/hydra.rs
Replaces connect_async(url).await.expect(...) with inspect_err-based tracing::error! logging and .or_restart()? propagation so connection failures trigger a restart instead of a panic.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 Hop hop, the backbone now leads the way,
No more old relays to cause dismay!
New docs appear with tables and tips,
While Hydra no longer panics and flips.
A restart instead, a graceful retreat—
The rabbit approves: these changes are neat! 🌟

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding documentation for the Examples section and making example configurations executable.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/v2-examples-showcase

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

Comment @coderabbitai help to get the list of available commands and usage tips.

The shipped examples pointed at relays-new.cardano-mainnet.iohk.io:3001,
which no longer resolves (NXDOMAIN), so running them verbatim only looped
on "error connecting bearer". Point all 21 N2N example configs (and the two
inlined recipes in the Examples docs) at the live
backbone.mainnet.cardanofoundation.org:3001 relay.

Also fix the two broken source examples:

- dolos_source: the U5C source's `metadata` field is required (no serde
  default), so the example failed to load with `missing field metadata`.
  Add an empty `metadata` table, point the URL at a local Dolos, and
  document the Demeter API-key pattern.
- hydra: the source called `.expect("Can't connect")` on bootstrap, so an
  unreachable Hydra node panicked the process instead of erroring. Log the
  error and return a retryable WorkerError, matching the rest of the source.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@scarmuega scarmuega changed the title docs(v2): add Examples showcase section docs(v2): add Examples showcase, and make the examples runnable Jun 14, 2026
@scarmuega scarmuega merged commit 44da48e into main Jun 14, 2026
11 of 12 checks passed
@scarmuega scarmuega deleted the docs/v2-examples-showcase branch June 14, 2026 14:56
scarmuega added a commit that referenced this pull request Jun 14, 2026
The v2 docs and CONTRIBUTING still referenced
relays-new.cardano-mainnet.iohk.io:3001, which no longer resolves
(NXDOMAIN), so copy-pasted config snippets and `oura watch` commands fail
to connect. Point them at the live
backbone.mainnet.cardanofoundation.org:3001 relay, matching the example
configs fixed in #939.

(v1 docs are maintained on the lts/v1 branch and fixed separately.)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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