Node APIs: the endpoints your dApp should call
Every node exposes its data and behavior through a set of endpoints, and which endpoints an application calls determines everything about its performance, cost, and reliability. Some endpoints are cheap reads that any node serves happily; others are heavy, stateful, or easily abused. Choosing endpoints deliberately — and knowing what each one costs the node that serves it — is the difference between an app that scales and one that melts its provider.
The endpoint classes every app needs
- State reads. Balance, storage, and account-state lookups. Cheap per call, frequent in practice: every page load multiplies them. Cache aggressively and batch what batches.
- Event and log queries. Historical lookups over blocks or time ranges. The most expensive read class: span length decides cost, and unbounded ranges are how nodes get hurt. Bound every range query by design.
- Subscriptions. Streaming updates for heads, logs, and state changes. Subscriptions shift the model from polling to push — the single biggest reliability win for interactive apps — at the cost of connection management.
- Submission endpoints. Transaction and message submission, with fee estimation and status tracking. These write to the chain's pipeline and deserve retry budgets and idempotency, not blind resends.
- Health and sync endpoints. Head height, sync status, and peer information. Applications should check these before trusting data: a node that is syncing answers questions with stale answers.
Endpoint choices that decide app quality
- Poll versus subscribe. Polling multiplies load and adds latency; subscriptions push updates and keep connections honest. Interactive apps subscribe; batch jobs poll on a schedule.
- Bounded versus unbounded ranges. Every historical query carries a span. Cap spans at the application layer, paginate beyond the cap, and never let a user's filter decide the node's workload.
- Read replicas versus the primary. Heavy reads belong on endpoints or replicas designed for them. Sending analytics traffic to the endpoint that serves submissions couples the two fates.
- Versioned endpoints. Endpoint shapes change across client versions. Pin versions, test upgrades, and treat endpoint deprecations as scheduled migrations, not surprises.
The contract with the node operator
Applications and node operators should agree on quotas, cost weights, and burst behavior before traffic arrives — the same conversation rate-limit design demands. Apps that know their limits build caching and batching in; apps that discover limits through errors build retry storms. Publishing endpoint guidance is part of running a node for others.
The takeaway
Node APIs split into state reads, bounded event queries, subscriptions, submissions, and health checks — and each class has a cost profile the application must respect. Subscribe instead of polling, bound every range, split heavy reads from submissions, and pin versions. The endpoints an app calls decide whether its node serves it well or survives it.