Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --stop-at-ledger option to stellar run #4427

Open
leighmcculloch opened this issue Aug 12, 2024 · 4 comments
Open

Add --stop-at-ledger option to stellar run #4427

leighmcculloch opened this issue Aug 12, 2024 · 4 comments

Comments

@leighmcculloch
Copy link
Member

Description

Explain in detail the additional functionality you would like to see in stellar-core.

The ability to optionally specify a --stop-at-ledger when using stellar-core run.

When the option is provided the run stops and exits cleanly after having processed that ledger.

Explain why this feature is important

Today as a non-validator-operator user of the network I can use stellar-core to replay meta, starting at a specified ledger. For example, using the following command:

stellar-core run \
    --in-memory \
    --start-at-ledger 1000515 \
    --start-at-hash d73003ad99a048123bc2b6ef4b8b399728af53c7b57c3f599c8e09280cbe0a50 \
    --metadata-output-stream fd:1 > meta.xdr

However, the command keeps going indefinitely until the process is killed. But when replaying from a specific ledger I almost always want to collect some specific range, or even just one ledger. I have to monitor the current ledger of the stellar-core and then kill it when that ledger has been passed.

Describe the solution you'd like

The ability to optionally specify a --stop-at-ledger when using stellar-core run.

When the option is provided the run stops and exits cleanly after having processed that ledger.

Describe alternatives you've considered

Scripting reading the current ledger from the /info endpoint and killing the process, but that feels so brittle.

Additional context

N/A

@MonsieurNicolas
Copy link
Contributor

for replaying ranges, can't you just use catchup ?

@leighmcculloch
Copy link
Member Author

leighmcculloch commented Aug 13, 2024

🤦🏻 Ah of course, I can use the following command to get the same output but to have it stop:

stellar-core catchup \
    --in-memory \
    1000515/1 \
    --trusted-hash d73003ad99a048123bc2b6ef4b8b399728af53c7b57c3f599c8e09280cbe0a50 \
    --metadata-output-stream fd:1 > meta.xdr

Is that the only difference between catchup and run, they do the same thing, just one will stop at a ledger?

@MonsieurNicolas
Copy link
Contributor

run is used to connect to the network (so connects to peers, etc), catchup only uses history archives

@leighmcculloch
Copy link
Member Author

Ah, so if I want a ledger that isn't in an archive yet, I need to use run, but then run doesn't have a way to stop at the ledger I need. So I think the use case is still applicable, albeit narrow, and may not be meaningful since in the time it takes to catch up pubnet I could probably wait a similar amount of time for a checkpoint to be published.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants