-
Notifications
You must be signed in to change notification settings - Fork 223
Use RPC for friendbot when available #840
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
base: main
Are you sure you want to change the base?
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 pull request enables friendbot to use RPC as its backend instead of requiring Horizon, supporting RPC-only deployments. The changes allow friendbot to dynamically configure either RPC or Horizon backends, with RPC being the preferred option when both are available to support future contract funding functionality.
- Removed hardcoded
horizon_urlfrom friendbot config and made backend URL injection dynamic based on which service is enabled - Updated startup scripts to conditionally wait for either RPC or Horizon based on friendbot's configuration
- Removed the forced enabling of Horizon when RPC is enabled for local networks
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| start | Removed forced ENABLE_HORIZON when ENABLE_RPC is true; added dynamic backend URL injection in init_friendbot(); updated upgrade_local() to start friendbot when either RPC or Horizon is enabled |
| common/friendbot/etc/friendbot.cfg | Removed hardcoded horizon_url to allow dynamic backend configuration |
| common/friendbot/bin/start | Added conditional waiting logic for RPC and Horizon backends based on configuration file contents |
| images.json | Added temporary "friendbot-with-rpc" image for testing the dependent friendbot changes with specific commit reference |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
sreuland
left a comment
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.
looks good, left one comment on friendbot startup config.
|
TODO:
|
|
The intermittent race condition failure is difficult to debug because the container log collection is broken. Opened issue to track fixing that: And pull request with fix: |
|
This is an example of intermittent failure now that the logging has been fixed: |
|
These are Friendbot logs. It looks like it's failing trying to create the minion accounts. |
What
Use the RPC backend support of friendbot instead of Horizon. Update startup script to wait for either RPC or Horizon based on configuration. Remove hardcoded horizon_url from config and dynamically inject the appropriate backend URL. Allow friendbot to start when only RPC is enabled without requiring Horizon.
Why
Friendbot previously required Horizon to fund accounts. With RPC support, friendbot can operate in RPC-only deployments without needing Horizon running. RPC is the preferred integration point, because in the future Friendbot will support funding contracts, and so even if both RPC and Horizon are available it will default to RPC to be able to support contract functionality.
Merging
Dependent on:
Cannot be merged until all images are updated to use a version of friendbot that contains the two dependent changes above.
Testing
This change includes a new image,
friendbot-with-rpc, temporarily just while in pull request that can be used for testing the dependent changes above.Close stellar/friendbot#5
Close #791