Skip to main content
For production, we recommend running Stellar RPC with a TOML configuration file rather than CLI flags. This is similar to creating a configuration file for Stellar-Core as we did previously. For example, using our docker image:
Use this Stellar RPC subcommand to generate a starter configuration file:
The resulting configuration should look like this:
Example datastore configurations can be found on the data lake integration page.
Note that the above generated configuration contains the default values and you need to substitute them with proper values to run the image. For instance, when using a container, it is recommended to create a volume for the Captive Core and RPC persistent storage and point CAPTIVE_CORE_STORAGE_PATH and DB_PATH to it accordingly. Then, you should create a configuration file for Stellar Core. You can find sample configuration files for Testnet and Pubnet When using docker, you should create and mount a volume mount a volume on your container where the above configuration is stored. If you are running locally on a unix-style machine, you could create a folder in your home directory called ~/rpc-config
Then you would add the following config files to that local directory:
  • soroban-rpc-config.toml
  • stellar-captive-core.cfg
Then you would mount that volume using by adding the following parameter: -v /Users/<USERNAME>/test-rpc-config:/opt/stellar to your docker run command. Your running container would mount that volume at the path /opt/stellar

Backfilling History on Startup

Set BACKFILL = true to populate the database with a trailing window of history synchronously on startup, before live ingestion begins. This option was added in RPC v25.1.0 and defaults to false. HISTORY_RETENTION_WINDOW sets the target size of that window. The default is 120960 ledgers, which is about 7 days. RPC treats this value as a target, not an exact count. Datastore coverage, ledgers already in the local database, and checkpoint boundaries can each reduce what the node fetches. BACKFILL also requires datastore serving. Set SERVE_LEDGERS_FROM_DATASTORE = true. If you enable BACKFILL alone, RPC fails to start with this error:
To set up the datastore, see Data Lake Integration. That page also explains which requests the datastore serves directly.

Next Step

After installation is complete, you are now ready to proceed to Running RPC!