RPC
Mock Stellar RPC
JSON-RPC 2.0 with the wire shapes of Stellar RPC. Supports getHealth, getNetwork, getLatestLedger and getLedgers (cursor paging over the corpus’s sparse ledgers). Point an RPC-backed indexer at https://rpc.istravex.com/{network} to replay the corpus. Batches of up to 20 requests; bodies up to 64 KB.
POST
/
rpc
/
{network}
Mock Stellar RPC
curl --request POST \
--url https://api.istravex.com/rpc/{network} \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": 1,
"method": "getLedgers",
"params": {
"startLedger": 65474279,
"pagination": {
"limit": 1
}
}
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
jsonrpc: '2.0',
id: 1,
method: 'getLedgers',
params: {startLedger: 65474279, pagination: {limit: 1}}
})
};
fetch('https://api.istravex.com/rpc/{network}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.istravex.com/rpc/{network}"
payload := strings.NewReader("{\n \"jsonrpc\": \"2.0\",\n \"id\": 1,\n \"method\": \"getLedgers\",\n \"params\": {\n \"startLedger\": 65474279,\n \"pagination\": {\n \"limit\": 1\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}import requests
url = "https://api.istravex.com/rpc/{network}"
payload = {
"jsonrpc": "2.0",
"id": 1,
"method": "getLedgers",
"params": {
"startLedger": 65474279,
"pagination": { "limit": 1 }
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"jsonrpc": "2.0",
"id": 1,
"result": {
"status": "healthy",
"latestLedger": 65474309,
"latestLedgerCloseTime": "1794657587",
"oldestLedger": 65474279,
"oldestLedgerCloseTime": "1794657437",
"ledgerRetentionWindow": 31
}
}{
"error": {
"code": "not_found",
"message": "Fixture not found"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Body
application/json
⌘I
Mock Stellar RPC
curl --request POST \
--url https://api.istravex.com/rpc/{network} \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": 1,
"method": "getLedgers",
"params": {
"startLedger": 65474279,
"pagination": {
"limit": 1
}
}
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
jsonrpc: '2.0',
id: 1,
method: 'getLedgers',
params: {startLedger: 65474279, pagination: {limit: 1}}
})
};
fetch('https://api.istravex.com/rpc/{network}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.istravex.com/rpc/{network}"
payload := strings.NewReader("{\n \"jsonrpc\": \"2.0\",\n \"id\": 1,\n \"method\": \"getLedgers\",\n \"params\": {\n \"startLedger\": 65474279,\n \"pagination\": {\n \"limit\": 1\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}import requests
url = "https://api.istravex.com/rpc/{network}"
payload = {
"jsonrpc": "2.0",
"id": 1,
"method": "getLedgers",
"params": {
"startLedger": 65474279,
"pagination": { "limit": 1 }
}
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"jsonrpc": "2.0",
"id": 1,
"result": {
"status": "healthy",
"latestLedger": 65474309,
"latestLedgerCloseTime": "1794657587",
"oldestLedger": 65474279,
"oldestLedgerCloseTime": "1794657437",
"ledgerRetentionWindow": 31
}
}{
"error": {
"code": "not_found",
"message": "Fixture not found"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}