What Is Soroban RPC and Why It Matters for Stellar Smart Contracts
Soroban is Stellar's smart contract platform. The Soroban RPC (now called Stellar RPC) is how you interact with it — deploying contracts, invoking functions, reading storage, and monitoring events. If you are new to Stellar smart contracts, this article explains what the RPC does and why you need it.
What Soroban RPC Is
Soroban RPC is a JSON-RPC server that provides access to the current state of the Stellar network and smart contracts. Unlike Horizon, which indexes historical data into a database, the RPC gives you direct access to the live ledger.
Think of it this way:
Core RPC Methods
| Method | What It Does |
|---|---|
| `getLatestLedger` | Returns current ledger sequence and protocol version |
| `simulateTransaction` | Dry-runs a transaction — shows result, fees, and resource usage |
| `sendTransaction` | Submits a signed transaction to the network |
| `getTransaction` | Checks status of a submitted transaction |
| `getEvents` | Queries smart contract events by topic, contract, or ledger range |
| `getLedgerEntries` | Reads specific ledger entries (contract storage, account data) |
| `getHealth` | Returns RPC server health status |
| `getNetwork` | Returns network passphrase and protocol info |
Why You Need It
1. Transaction Simulation
Before you submit any Soroban transaction, you should simulate it. Simulation tells you:
{
"jsonrpc": "2.0",
"id": 1,
"method": "simulateTransaction",
"params": {
"transaction": "AAAAAgAAAAB..."
}
}Without simulation, you are guessing at resource limits and fees — which means either overpaying or having transactions rejected.
2. Contract Storage Access
Want to read the current state of a smart contract? That is RPC territory:
{
"jsonrpc": "2.0",
"id": 1,
"method": "getLedgerEntries",
"params": {
"keys": ["AAAAAAAAAA..."]
}
}Horizon does not understand Soroban contract internals. Only the RPC can read contract storage.
3. Event Monitoring
Smart contracts emit events when important things happen. The RPC lets you query these:
{
"jsonrpc": "2.0",
"id": 1,
"method": "getEvents",
"params": {
"startLedger": 61000000,
"filters": [{
"type": "contract",
"contractIds": ["CDLZFC3S..."],
"topics": [["*"]]
}]
}
}This is how you build reactive applications that respond to on-chain contract activity.
Horizon vs Soroban RPC
| Need | Use |
|---|---|
| Account balances | Horizon |
| Transaction history | Horizon |
| Payment tracking | Horizon |
| Asset listing | Horizon |
| Order book | Horizon |
| Submit Soroban transactions | **RPC** |
| Simulate transactions | **RPC** |
| Read contract storage | **RPC** |
| Monitor contract events | **RPC** |
| Get current ledger state | **RPC** |
Most apps need both. Horizon for historical reads, RPC for contract interaction and transaction submission.
Running Your Own vs Managed
Running your own Soroban RPC requires Captive Core, monitoring, and maintenance. A managed service like LumenQuery handles all of that.
*Interact with Soroban smart contracts on reliable infrastructure. LumenQuery provides managed Stellar RPC — start free.*