Add `stellar ledger meta fetch` subcommand to download ledger close meta
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
Research direction
Start by reading the existing stellar snapshot create and stellar ledger fetch commands, then consult SEP-54 for datastore layout and LedgerCloseMeta formats. Done means stellar ledger meta fetch handles a ledger or range, downloads over HTTP, supports xdr/json/json-formatted output, and reassembles requested ranges into one batch.
Written by the indexing model from the issue text.
Description
What problem does your feature solve?
There's no easy way to fetch ledger close meta from a network's ledger meta datastore. I have built one-off throw-away tools for this and I noticed @stellar/platform-eng discussing that they'd like a tool for this type of thing too (ref), although they may still build something else that collects the data directly from a stellar-core which isn't what this issue proposes, but regardless there's some evidence at least in my own workflows this would be a useful capability, and should be a very lightweight lift, because we are mostly talking about just downloading a file.
I have considered opening this issue in the past but struggled to imagine where in the cli such a command would fit. The recently added stellar ledger subcommand provides a natural home for this.
What would you like to see?
A new stellar ledger meta fetch subcommand that downloads LedgerCloseMetaBatch from a network's ledger meta datastore (as specified in SEP-54) for a specific ledger or a range of ledgers.
Usage:
# Single ledger
stellar ledger meta fetch --ledger 1000
# Range of ledgers
stellar ledger meta fetch --start 1000 --end 2000
--ledger is mutually exclusive with --start/--end.
Key details:
- Output type:
- Return a
LedgerCloseMetawhen--ledgeris used. - Return a
LedgerCloseMetaBatchwhen--startand--endare used. - Using different types may be a little confusing, but I think the common case looking at my own past usages was to get a single ledgers worth, and in that case it is more convenient to have it as just the
LedgerCloseMeta.
- Return a
- Output format: Support
--outputwith valuesxdr,json, andjson-formatted(consistent with other CLI commands). - Datastore access: The command should download the datastore config, then fetch the required batches over plain HTTP (no S3 SDK). This is important because not all datastores are S3-backed — e.g. Galexie in Quickstart serves over HTTP directly.
- Batch reassembly: The datastore partitions and batches ledgers according to the config file (often one ledger per batch). For the case when the CLI is returning a range, the CLI should download all batches needed to cover the requested range, unpack them, extract the relevant ledgers, and reassemble them into a single
LedgerCloseMetaBatch. Why: This tool isn't for copying a datastore, it's for collecting a range, and that is most useful if it is returned to the user in a single batch.
Network support:
| Network | Datastore URL |
|---|---|
| Mainnet (pubnet) | https://aws-public-blockchain.s3.us-east-2.amazonaws.com/v1.1/stellar/ledgers/pubnet |
| Testnet | https://aws-public-blockchain.s3.us-east-2.amazonaws.com/v1.1/stellar/ledgers/testnet/2025-12-17 |
| Local (Quickstart w/ Galexie) | http://localhost:8000/ledger-meta |
Futurenet does not currently have a ledger meta datastore.
The pubnet and maybe testnet URLs are I think already hardcoded today and are used by the stellar snapshot create command and selected based on the current network. We can do same for this subcommand and consider making it configurable in the future as a separate mini project.
What alternatives are there?
-
Building one-off scripts/tools each time (current state — duplicated effort).
-
⭐ The
stellar ledger fetchcommand pullsLedgerCloseMetafrom RPC. There's an argument I think that the existing ledger fetch command modified to support selecting different sources, because the data is so similar, with the repsonse being limited to meta information if the ledger meta datastore is the specific source. ⭐
- Dominant language
- Rust
- Stars
- 123
- Forks
- 141
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 17
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from stellar/stellar-cli
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
stellar/stellar-cli#2384 · 2 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
stellar/stellar-cli#2347 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
stellar/stellar-cli#2723 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
stellar/stellar-cli#2722 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
stellar/stellar-cli#2703 ·
All issues in stellar/stellar-cli
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
kwakseongjae/auto-hwp#319 ·
-
area:cli bug filter-quality good first issue priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
bevyengine/bevy#25861 ·
-
comp-datalake
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/ClickHouse#121222 ·
-
enhancement remote
Difficulty 2/5 1-3 hours Newbie friendliness 68/100