API
Astraea serves JSON-RPC over HTTP POST / and WebSocket on the same address, like Clio and rippled. Requests and responses follow Clio 2.x, including error tokens and codes, so existing client libraries work unchanged. Both API versions 1 and 2 are accepted (api_version), and version 2 is the default; Clio and xrpld default to version 1, so a client that relies on version 1 shapes, such as ledger_index as a string in a ledger header, should send api_version: 1.
Every response carries a warning that Astraea serves validated data only:
{"id": 2001, "message": "This is an Astraea server. It serves only validated data."}§Ledger range
server_info reports complete_ledgers as one range. It goes down as far as there is cold history with indexes that joins up with the hot store without a gap, and up to the last ledger the Proof Engine has confirmed by quorum. A ledger that was loaded but isn’t confirmed yet is not served.
Ledgers outside the range get lgrNotFound, as on any server that doesn’t have them. For account_tx with explicit bounds outside the range, version 2 returns lgrIdxMalformed like Clio.
account_tx and nft_history refuse a marker past the last ledger with invalidParams and the message markerOutOfRange, on every API version. Such a marker comes from a server further ahead, for example after a client failed over to this one. An empty page without a marker would read as “no more transactions”. This has not been compared with Clio.
A successful account_tx covers only what ledger_index_min and ledger_index_max in the answer say. With ledger_index_max of -1, or on version 1 with a higher bound, that ends at this server’s last ledger, which can be behind a live stream from another server. A client catching up must take its progress from ledger_index_max in the answer, not from the ledger it asked for or saw in the stream.
§Methods
§History
| Method | Notes |
|---|---|
ledger | by ledger_index or ledger_hash, with transactions, expand and binary |
tx | by hash or by ctid; binary supported |
account_tx | full range, both directions, markers; limit defaults to 200, at most 1000. tx_type and mpt_issuance_id filter as in Clio 2.8: after the page is read, so a page can hold fewer than limit transactions and still carry a marker |
book_changes | by ledger_index or ledger_hash, over the full range; volumes and rates match xrpld to the last digit |
nft_history | a token’s transactions over the full range, as in Clio: limit 1 to 100 (default 50); going forward, the marker is the position right after the last transaction returned |
These work over the whole range, hot and cold. Paging with markers is continuous across the hot/cold boundary and between cold partitions.
§State
| Method | Notes |
|---|---|
account_info | signer_lists supported |
account_lines, account_objects, account_offers | limit 10 to 400, default 200 |
ledger_entry | every selector of Clio 2.8: index, account_root, amendments, amm, bridge with bridge_account, check, credential, delegate, deposit_preauth (with authorized or authorized_credentials), did, directory, escrow, fee, hashes, loan, loan_broker, mpt_issuance, mptoken, nft_offer, nft_page, nunl, offer, oracle, payment_channel, permissioned_domain, ripple_state, signer_list, ticket, vault, xchain_owned_claim_id, xchain_owned_create_account_claim_id. A hex string in any of them is the object key, and the object must be of that type. Params are checked as Clio 2.8 checks them, field by field in its order, and a malformed one gets Clio’s error and message. With more than one selector the answer follows Clio’s order of preference too; xrpld 3.0 and later answer invalidParams there instead. include_deleted returns a deleted object as it was before the deleting ledger, with deleted_ledger_index |
ledger_data | up to 256 objects per page in JSON, 2048 in binary |
mpt_holders | as in Clio |
account_mptoken_issuances, account_mptokens | as in Clio: the account’s MPT issuances or balances from its owner directory, limit 10 to 400 (default 200, counting every entry walked), flags spelled out (mpt_can_transfer, mpt_immutable_require_auth…). mpt_issuance_id is the 24-byte MPTID, as in Clio 2.9; Clio 2.8 printed the issuance object’s key there |
vault_info | as in Clio: the Vault by vault_id, or by owner and seq, with its share issuance under shares, at any ledger with state. Errors and their codes are Clio’s. Clio ignores ledger_hash here and answers from its latest ledger; Astraea honours it |
feature | as in Clio: every amendment the server knows, or one by feature (its name or ID), with enabled from the Amendments object of the ledger asked and supported. The list is xrpld 3.4.1’s, the same release as the binary format, plus nine amendments older releases knew and dropped, which Clio 2.8 also lists, as not supported. Clio 2.8 was built with an older libxrpl, so its list lacks fixBatchV1_2 (enabled on mainnet) and fixCleanup3_4_0, and it does not support LendingProtocolV1_1. vetoed is refused with noPermission; ledger_index current or closed goes to the node |
account_nfts | as in Clio: limit counts NFT pages (20 to 400, default 100), and the marker is the key of the next page |
nft_buy_offers, nft_sell_offers | limit 50 to 500, default 250; the marker is the first offer of the next page |
nft_info | a token’s owner, whether it is burned, and its URI at any ledger in the range |
nfts_by_issuer | an issuer’s tokens by taxon and ID, each as of the ledger asked; limit 1 to 100 (default 50); a token minted after that ledger is left out but counts toward the page, as in Clio |
State exists from the hot store’s snapshot onward. A state query for an older ledger returns lgrNotFound, unless the server was started with a version index over cold history (--old-state): then account_info, ledger_entry, account_lines, account_objects, vault_info and feature also answer on the ledgers it covers, which server_info gives as astraea.old_state_ledgers. Other state methods, and every request to a public listener, still get lgrNotFound there.
§NFT index
nft_info, nft_history and nfts_by_issuer read an index built from the NFT transactions of every ledger, by the rules Clio uses: the minted token is the one added to the NFT pages, a burn takes the owner from the page that held the token, an accepted offer takes the buyer, or the new holder’s page when only a sell offer is given. Only successful transactions count. On mainnet the index starts at ledger 75,443,457, where NonFungibleTokensV1_1 was enabled. A server that adds the index fills the earlier ledgers in the background; until that is done these three methods answer notReady.
Where the answers differ from Clio’s:
ledger_indexofnft_infoand ofnfts_by_issuerentries is the ledger of the token’s last owner change. Clio fills its NFT tables from the state at the first ledger it loaded, and reports that ledger for every token that hasn’t changed since.- Tokens burned before a Clio server’s first ledger are unknown to it. Here they are found, with
is_burned: true, and their history is complete. - Clio keeps one record per token per ledger, so a token minted and sold in the same ledger loses its URI and its place in
nfts_by_issuer. Here the mint’s URI and issuer entry stay.
§Server
server_info and ping are answered locally. server_info includes Clio’s fields plus a few of Astraea’s own:
| Field | Meaning |
|---|---|
astraea, astraea_version | server identification |
confirmed_ledger | newest ledger confirmed by validator quorum |
loaded_ledger | newest ledger loaded and checked, possibly not confirmed yet |
confirmation_rule | the quorum rule in force |
state_root_checked | whether the state root is checked on every ledger |
load_factor and rippled_version are taken from a node when forwarding is configured. server_info never waits for a node: it uses the node’s last answer, refreshed in the background. If no node has answered for 10 seconds, or none has yet since the start, rippled_version is left out and load_factor is 1, so a load_factor of 1 does not by itself mean the network’s fees are at their base level.
§Forwarded to a node
When the server is started with --forward-rpc, these go to the node the way Clio sends them:
fee,server_state,ledger_current,server_definitions;- public read methods asked about the open ledger (
ledger_indexof"current"or"closed"):account_info,account_lines,account_objects,account_offers,account_channels,account_currencies,account_nfts,amm_info,book_offers,book_changes,deposit_authorized,gateway_balances,ledger,ledger_data,ledger_entry,nft_buy_offers,nft_sell_offers,noripple_check,ripple_path_find,vault_info; account_infoandledgerwith"queue": true.
Nothing else is forwarded, whatever its parameters say, and admin methods return unknownCmd. Forwarded answers carry "forwarded": true. A forwarded request has 8 seconds over all nodes, and a node that just failed is tried last. If all nodes fail, the server answers failedToForward at once for the next 5 seconds instead of waiting on a dead node.
submit and simulate are forwarded only on a server started with --forward-submissions, and never on a public listener; otherwise they return unknownCmd, or notSupported on a public listener. The node never signs for a client: submit takes only a signed tx_blob, and a request with secret, seed, seed_hex, passphrase or key_type gets invalidParams with the message signingNotSupported.
submit is not cached. Another node is tried only when the first can’t have received the transaction, because sending it again could give tefPAST_SEQ for a transaction that in fact went through. A failedToForward whose message says the transaction may have been sent means the outcome is unknown: look it up by hash before sending it again.
§Subscriptions (WebSocket)
subscribe and unsubscribe support the ledger, transactions, book_changes, validations and manifests streams and accounts. A ledger’s bookChanges message comes after its transactions, as in Clio. Validation and manifest messages are the nodes’ own, passed on as received, as Clio does; Astraea listens to several nodes, and a message that comes from more than one is sent once. The streams Clio offers that Astraea doesn’t (transactions_proposed, accounts_proposed, books) return notSupported instead of a silent subscription.
- Each confirmed ledger is published once, in order:
ledgerClosedfirst, then its transactions byTransactionIndex. - After subscribing to
ledger, the firstledgerClosedis for the ledger right after the one in the subscribe response. - An account receives a transaction if the account is affected by it, the same set that
account_txuses. - One subscribe can name at most 10,000 accounts.
- A session that falls 1500 messages behind is disconnected, like Clio’s
ws_max_sending_queue_size.
§Lending dashboards
A service that shows vaults, loan brokers and loans (a dashboard, an explorer, a risk monitor) needs the same few requests, and Astraea answers each of them as Clio does: vault_info for a vault with its share issuance, ledger_entry by index for a LoanBroker or a Loan, account_objects with type vault, loan_broker or loan for one owner, ledger with transactions and expand for the changes in a ledger, and feature to tell whether SingleAssetVault and LendingProtocol are enabled. The lending group of the Clio check sends them in these shapes (running.md). Vaults and lending gives the whole picture: the objects, their shares, and proving their state.
The one request that does not scale is listing every object of a type with ledger_data and type. The server walks the whole state tree in key order, up to 256 objects a page in JSON, and a page holds only the matches in the slice it walked, often none; only a page without marker ends the list. On mainnet that is tens of thousands of pages, hours of requests, on any server. A few capped pages give a sample, not a list.
To know every vault, loan broker and loan, follow ledgers instead, from the ledger where SingleAssetVault was enabled: no lending object can exist before it, so each one appears as a CreatedNode in the metadata of a transaction after it, and its changes and deletion follow in later ledgers. One ledger request with transactions and expand per ledger, or the transactions stream, keeps the list complete; current values come by ID from vault_info and ledger_entry.
Requests without api_version get version 2 (see above). A client that reads both shapes takes the transaction from tx_json or the top level, the metadata from meta or metaData, and the hash, ledger_index and close time from the envelope in version 2. ledger_data and an expanded ledger count 5 requests against the limits below, so a backend that polls should be whitelisted by the server’s operator.
§Limits
A server can limit each client’s requests, response bytes and open connections, like Clio’s DOS guard; a client over its limit gets slowDown (error_code 10), over HTTP with status 503. See running.md.
HTTP answers carry Cache-Control: public, max-age=86400, immutable for answers that can never change (a transaction, anything about a ledger named by sequence or hash), no-store for the rest.
Each request has 10 seconds, 5 on a public listener. The loops whose length depends on the request (owner directory pages, ledger_data objects, cold index partitions, the transactions of a page or a ledger) check the time, and a request past it ends with tooBusy instead of holding one of the request slots. Most requests take well under a second; the slowest, a full binary ledger_data page, about 0.7 s. A request that waits for a slot longer than 5 seconds, 0.5 on a public listener, also ends with tooBusy.
§Health
GET /health answers 200 with {"status": "ok", "ledger": <last ledger>, "age": <seconds since it closed>} while the last ledger is at most 60 seconds old. Past that it answers 503 with "status": "lagging", and with "status": "noLedger" when there is no ledger to serve yet.
§Proofs
| Method | Parameters | Proves |
|---|---|---|
proof_ledger | ledger_index or ledger_hash | the header and its hash were validated by quorum |
proof_tx | transaction (hash) | the transaction with this metadata is in a validated ledger |
proof_entry | the same selectors as ledger_entry, and ledger_index or ledger_hash | the object exists with this content, or does not exist, in the state of that ledger (the latest by default) |
The response holds the package under proof, the anchor ledger, and two plain lists: what the package proves and what it does not (for example, a transaction proof says nothing about server-derived fields like delivered_amount).
proof_ledger and proof_tx work for any ledger the server holds, back to ledger 32570. A target within 512 ledgers of an anchor is linked to it by a header chain (target_confirmed_by is quorum or hash-chain). An older one is reached through a skip list (skip-list, package format xrpl-witness/evidence/4): the latest state holds the hash of every 256th ledger since the start of history, so the package proves that list in the state of a recent ledger and adds at most 256 headers from the target up to the ledger in the list. proof_entry works on the latest state and on earlier ledgers back to the state snapshot: the server keeps, per ledger, the hashes of the state subtrees at depth 3 that changed, and rebuilds the path from those and the object versions. A ledger before the snapshot has no state and gets lgrNotFound; while a server is still rebuilding its tree history, a ledger below the rebuilt part gets noEvidence.
Check a package offline. By default the verifier trusts the same two UNL publishers as xrpld’s default configuration; --publisher <hex key> replaces them, --threshold sets how many lists must include a validator, and --trust <n9… key> adds a directly trusted validator.
witness-verify evidence package.json