Skip to main content

ledger_engine/
lib.rs

1//! Astraea Ledger Engine.
2//!
3//! Loads validated ledgers from xrpld, checks them before writing and
4//! stores the header, transactions with metadata, and state changes.
5//!
6//! - `api`: Clio-compatible API (ledger, tx, account_tx and others);
7//! - `bookchanges`: `book_changes`, order book volumes and rates of a ledger;
8//! - `nft`: `account_nfts`, `nft_buy_offers`, `nft_sell_offers` from the state,
9//!   `nft_info`, `nft_history`, `nfts_by_issuer` from the NFT index;
10//! - `nftindex`: what NFT transactions do to tokens, for the NFT index;
11//! - `proof`: Proof API, evidence bundles for a ledger, transaction or object;
12//! - `selector`: the object key from `ledger_entry` params (all selectors of Clio 2.8);
13//! - `server`: HTTP JSON-RPC and WebSocket for `api`;
14//! - `guard`: request limits per client, like Clio's DOS guard;
15//! - `source`: xrpld gRPC client (same as Clio: `GetLedger` with objects);
16//! - `limits`: the time limit of one request;
17//! - `ledger`: a whole ledger, its verification and serialization for the log;
18//! - `blocks`: block storage with random access by ledger;
19//! - `confirm`: confirmation of ledgers by a quorum of UNL validators;
20//! - `delta`: state changes, diffed against the previous version and metadata;
21//! - `coldpatch`: state patches of cold segments, stored only where the metadata
22//!   doesn't give them;
23//! - `history`: history, format 2: transactions as one frame per ledger with a
24//!   dictionary, state changes in separate blocks;
25//! - `index`: transaction by hash, ledger by hash, account history;
26//! - `statetree`: the state tree and its root at every ledger;
27//! - `state`: state over time, a snapshot plus object versions (fjall);
28//! - `metrics`: loader metrics for Prometheus;
29//! - `xrpl_json`: XRPL binary objects as JSON, like `getJson` in xrpld;
30//! - `log`: a segmented ledger log. This is the first storage version; a
31//!   format with indexes and random access belongs to the storage format work.
32//!
33//! The node is not trusted blindly: the transaction tree must match the root in
34//! the header, otherwise the ledger is not written. Whether the header itself
35//! was validated by the network is up to the Proof Engine (witness-core: quorum of validations).
36
37pub mod amendments;
38pub mod api;
39pub mod blocks;
40pub mod bookchanges;
41pub mod cold;
42pub mod coldindex;
43pub mod coldpatch;
44pub mod coldreplay;
45pub mod coldstate;
46pub mod coldversions;
47pub mod confirm;
48pub mod delta;
49mod entry_spec;
50pub mod forward;
51pub mod guard;
52pub mod history;
53pub mod index;
54pub mod ledger;
55pub mod limits;
56pub mod log;
57pub mod metrics;
58pub mod nft;
59pub mod nftindex;
60pub mod owned;
61pub mod proof;
62mod selector;
63pub mod server;
64pub mod source;
65pub mod state;
66pub mod statetree;
67pub mod subs;
68pub mod ter;
69pub mod txindex;
70pub mod unknown;
71mod varint;
72pub mod xrpl_json;
73pub mod xrpla;
74
75/// gRPC client code generated from proto/ at build time.
76#[allow(clippy::all, clippy::pedantic, missing_debug_implementations)]
77pub mod proto {
78    tonic::include_proto!("org.xrpl.rpc.v1");
79}