Skip to content

Conversation

@DeVikingMark
Copy link
Contributor

Implements support for multiple endpoints in celestia client library to provide failover capabilities for both Bridge DA and Core gRPC connections.

Changes

  • Add AdditionalBridgeDAAddrs field to ReadConfig for multiple bridge endpoints
  • Add AdditionalCoreGRPCConfigs field to CoreGRPCConfig for multiple core endpoints
  • Introduce MultiClient with NewMultiEndpoint() constructor
  • Add validation for additional endpoint configurations
  • Update documentation and examples

Usage

cfg := client.Config{
    ReadConfig: client.ReadConfig{
        BridgeDAAddr: "http://primary:26658",
        AdditionalBridgeDAAddrs: []string{"http://backup:26658"},
    },
    SubmitConfig: client.SubmitConfig{
        CoreGRPCConfig: client.CoreGRPCConfig{
            Addr: "primary:9090",
            AdditionalCoreGRPCConfigs: []client.CoreGRPCConfig{
                {Addr: "backup:9090", TLSEnabled: true},
            },
        },
    },
}

multiClient, err := client.NewMultiEndpoint(ctx, cfg, kr)

Fixes #4487

@github-actions github-actions bot added the external Issues created by non node team members label Oct 7, 2025
@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 33.33333% with 122 lines in your changes missing coverage. Please review.
✅ Project coverage is 35.26%. Comparing base (2469e7a) to head (3ec4c7b).
⚠️ Report is 592 commits behind head on main.

Files with missing lines Patch % Lines
api/client/client.go 27.86% 43 Missing and 1 partial ⚠️
api/client/grpc.go 17.77% 37 Missing ⚠️
api/client/example/example.go 0.00% 28 Missing ⚠️
api/client/read_client.go 73.46% 9 Missing and 4 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4617      +/-   ##
==========================================
- Coverage   44.83%   35.26%   -9.58%     
==========================================
  Files         265      304      +39     
  Lines       14620    24504    +9884     
==========================================
+ Hits         6555     8641    +2086     
- Misses       7313    14905    +7592     
- Partials      752      958     +206     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external Issues created by non node team members

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(api/celestia-client-lib): add support for multiple endpoint to celestia client lib

2 participants