JSON-RPC over HTTPS
Every call is an HTTP POST with amethod and, for methods that take arguments, a params object. The endpoint is HTTPS only — Stellar nodes on Chainstack do not expose a WebSocket endpoint.
getHealth is the fastest way to confirm the endpoint works and to see the ledger range the node holds:
YOUR_CHAINSTACK_ENDPOINT with your node’s HTTPS endpoint. For the credential in that endpoint and the other ways to authenticate, see Authentication methods for different scenarios.
Historical data availability
Stellar Global Nodes are Extended: they keep a rolling window of recent ledgers that is longer than the stellar-rpc default of about 7 days. Transaction and event queries are limited to that window on both networks. On Mainnet,getLedgers also serves ledgers older than the window, back to ledger 2. On Testnet, getLedgers is limited to the window. Billing is independent of the window — every Stellar request is billed as full, at 1 RU; see Request units.
Your node reports its own window in getHealth:
ledgerRetentionWindow— the configured size of the window, in ledgersoldestLedger— the oldest ledger in the retention window right nowlatestLedger— the current tip
oldestLedger, not from ledgerRetentionWindow. The configured size is the ceiling, and a node that has not been running long enough to fill its window holds less than that. A getTransactions or getEvents request that starts before oldestLedger returns -32600 with a message naming the range the node can serve. The same applies to getLedgers on Testnet. On Mainnet, getLedgers accepts any startLedger from 2 to the tip.
JavaScript
Use the official@stellar/stellar-sdk and point rpc.Server at your endpoint.
Read recent ledgers
getLedgers takes a single request object with startLedger and a pagination block, rather than positional arguments:
Python
Use the officialstellar-sdk and its SorobanServer, which speaks the Stellar RPC API.