-
Notifications
You must be signed in to change notification settings - Fork 226
Configure stellar-core to use SQLite instead of PostgreSQL #876
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR migrates stellar-core from using PostgreSQL to SQLite across all network configurations (testnet, pubnet, local, futurenet). The changes remove the core database creation from PostgreSQL initialization and ensure PostgreSQL only starts when Horizon is enabled. Documentation is updated to reflect that PostgreSQL is now exclusively for Horizon data.
Key Changes
- Stellar-core configurations now use SQLite at
/opt/stellar/core/stellar.dbinstead of PostgreSQL - PostgreSQL database initialization only runs when Horizon is enabled
- Removed
coredatabase creation and related grants from PostgreSQL setup - Updated README to document that PostgreSQL is only for Horizon data
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| testnet/core/etc/stellar-core.cfg | Changed DATABASE from PostgreSQL to SQLite |
| pubnet/core/etc/stellar-core.cfg | Changed DATABASE from PostgreSQL to SQLite |
| local/core/etc/stellar-core.cfg | Changed DATABASE from PostgreSQL to SQLite and removed commented alternatives |
| futurenet/core/etc/stellar-core.cfg | Changed DATABASE from PostgreSQL to SQLite |
| start | Updated init_db to only run for Horizon, removed core database creation, removed PostgreSQL dependencies from stellar-core initialization and startup |
| README.md | Updated documentation to reflect PostgreSQL is only for Horizon; added note about historical PostgreSQL usage for stellar-core |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Testing side-by-side with the latest stellar/quickstart image in |
|
Updated the PR to retain PostgreSQL support for backwards compatibility. SQLite is now the default, but PostgreSQL can still be used by setting PostgreSQL support for stellar-core in Quickstart is marked as deprecated and may be removed in a future release. If you're currently using PostgreSQL for stellar-core, please comment on #875 with information about your use case. |
What
Switch stellar-core's database from PostgreSQL to SQLite by default across all network configurations (local, testnet, pubnet, futurenet). PostgreSQL support is retained for backwards compatibility via the
CORE_USE_POSTGRES=trueenvironment variable.Why
With RPC becoming more prevalent as the primary interface (vs Horizon), there may be scenarios where users run stellar-core and RPC instead of stellar-core, Horizon, and RPC - in which case PostgreSQL would be running solely for core's database.
Changes
CORE_USE_POSTGRES=trueCORE_USE_POSTGRES=trueClose #875
Todo