Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Improve multiple endpoints configuration

Đang mở
#1,925 0 bình luận 1 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
typescript

Hướng nghiên cứu

Begin by locating the existing endpoint representation in project manifests and CLI flag parsing, then trace how endpoint values flow into project execution. Define the backward-compatible configuration shape and verify CLI JSON input and config-file runs; done means headers, rate limits, weighting, batch size, and retries work without breaking existing strings or arrays.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

crucial New Feature
Description

Currently specifying endpoints is fairly limited. We can only specify a string for each one. But there are many use cases where you would want to have more control over these endpoints. This could include weighting them, specifying headers or rate limiting options.

Different api providers have different ways of providing api keys and other authentication. Currently the only way to do this is with path params and we convert them to headers. This is not very flexible and can lead to logging leaking api keys.

It is nearly impossible to determine the rate limit for an endpoint, being able to specify this will allow for optimal indexing speeds given a rate limited endpoint.

Requirements
  • Be backwards compatible with current flags and project manifests
  • Introduce a new data structure to specify endpoints details (this is a rough example):
type EndpointConfig = {
  headers?: Record<string, unknown>;
  rateLimit?: { requests: number, interval: 'second' | 'minute' | 'hour' };
  weighting: number; // TBD, this should allow users to specify a primary endpoint that gets used over other endpoints
  batchSize?: number; // JSON RPC batch size, where applicable (ethereum)
  retries?: number; // Number of retries this endpoint will make before throwing. Default 1.
}
  • Allow specifying a default EndpointConfig that applies to all endpoints

Manifests network endpoint would then have the following type string | string[] | Record<string, EndpointConfig>

  • CLI flags should accept json strings for this new functionality.
  • We should ensure that running a project from a config file works with this feature.
Ngôn ngữ chính
TypeScript
Star
18.7k
Fork
396
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của subquery/subql

Tất cả issue của subquery/subql

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.