-
Notifications
You must be signed in to change notification settings - Fork 88
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
Enable Friendbot and Soroban on custom network #675
base: master
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.
Thanks for adding this feature, @Smephite ! 🚀 It looks good. I just added a comment about the check that would be nice to have. Let me know what you think. 🙏
? "https://friendbot-futurenet.stellar.org" | ||
: "https://friendbot.stellar.org"; | ||
export function startFriendbotRequest(target, isSoroban = false, isCustom = false) { | ||
const friendbotURL = isCustom ? (networkLocalStorageGetValue()?.horizonURL + "/friendbot"): (isSoroban |
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.
To make sure that the friendbot exists on the custom network, maybe we could fetch the URL to see if we get a response. Only if we do get a response (even if it's a 400), we show the fund the account section. What do you think, @Smephite ?
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.
That would definitely work.
The question is if we care to check this every single time when showing the fund the account section thus creating quite a lot of duplicate queries or if we want to store a map of all custom networks we ever encountered (storing true/false whether friendbot was encountered or not) in local storage
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.
We could set a flag in the store for friendbot for custom network only. Something like isCustomFriendbotEnabled
(with a better name 😅). So this check would happen only once when the network is set, then data is taken from the store.
When working with a local instance of the quickstart custom network to develop on Soroban it is quite useful to still be able to use laboratory via the
custom
network option.Sadly this type of network does not include the UI for friendbot nor the new changes needed to parse Soroban compatible XDRs.
This PR enables both of these features.