Skip to main content

Commands

Stellar Core can be controlled using a robust CLI.

info

We will cover a selection of the essential commands and syntax here, but the very best resource for utilizing the stellar-core command line is located in the stellar-core GitHub repo.

Additionally, while the commands on this page are CLI commands, there is an additional set of HTTP endpoint commands that provide further administrative control over a running core node.

Get --help Anywhere

The --help (aliases: -h or -?) option can be specified at any place in the command line. It will show you the help message for the relevant command. Some example useage is as follows:

stellar-core --help
stellar-core run --help
stellar-core --help new-db
stellar-core catchup --help

Essential Commands

For all stellar-core commands, options can only by placed after the command.

new-db

The new-db command creates or restores the local database to the genesis ledger.

new-db Options

  • --minimal-for-in-memory-mode: Reset the special database used only for in-memory mode. (see the --in-memory flag in run options)

run

The run command will run the stellar-core node.

run Options

  • --disable-bucket-gc: Keeps all, even old, buckets on disk.
  • --metadata-output-stream <STREAM>: Filename or file-descriptor number fd:N to stream metadata to.
  • --in-memory: Stores working ledger in memory rather than database.
  • --wait-for-consensus: Wait to hear from the network before voting, for validating nodes only.
  • --start-at-ledger <LEDGER>: Start in-memory run with replay from historical ledger number.
  • --start-at-hash <HASH>: Start in-memory run with replay from historical ledger hash.

catchup

The catchup command will execute a catchup from history archives without connecting to the network.

catchup Options

  • <DESTINATION_LEDGER/LEDGER_COUNT>: (required) Destination ledger is any valid number or current and ledger count is any valid number or max.
  • --archive <ARCHIVE-NAME>: Archive name to be used for catchup. Use any to select randomly.
  • --trusted-checkpoint-hashes <FILE-NAME>: Get destination ledger hash from trusted output of verify-checkpoints.
  • --output-file <FILE-NAME>: Output file.
  • --disable-bucket-gc: Keeps all, even old, buckets on disk.
  • --extra-verification: Verify all files from the archive for the catchup range.
  • --in-memory: Store working ledger in memory rather than database.
  • --trusted-hash <HASH>: Hash of the ledger to catchup to.
  • --force-untrusted-catchup: Force unverified catchup.
  • --metadata-output-stream <STREAM>: Filename or file-descriptor number fd:N to stream metadata to.
  • --force-back: Force ledger state to a previous state, preserving older historical data.
info

To reiterate, this page covers a selection of the essential commands, but we've only scratched the surface. The very best, most comprehensive resource for utilizing the stellar-core command line is located in the stellar-core GitHub repo.