Skip to content

provide best practices for using external RPC endpoints #866

Description

@beck-8

Problem

Public RPC endpoints such as glif are limited to 100 RPM, but the SDK's RPC usage grows with the amount of data in an account, so ordinary usage quickly exceeds the limit:

Scenario Cause Rough threshold
Listing/inspecting data sets (findDataSets, etc.) ~2 RPC calls per data set, fired concurrently with no concurrency cap ~50 data sets
Viewing a single data set's details (per-piece metadata reads) 1 eth_call per piece, serially, N times ~100 pieces in one data set
Resolving existing data sets during upload Iterates all of the account's data sets, enriching each with on-chain reads Triggered on every upload once data sets accumulate

Both piece count and data set count grow monotonically with usage (every upload adds a piece), so a user doing a bulk upload/migration hits 429s on day one — this is not an edge case.

Request

Add a "Using an external RPC endpoint / avoiding rate limits" best-practices doc, covering:

  • How to pass a custom transport and enable batching: http(url, { batch: true }), client-level batch: { multicall: true };
  • How to use token-authenticated endpoints with higher limits, e.g. https://api.node.glif.io/rpc/v1?token=<TOKEN> or an Authorization: Bearer header.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

Status
🎉 Done

Relationships

None yet

Development

No branches or pull requests

Issue actions