Skip to content
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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Smephite
Copy link
Contributor

@Smephite Smephite commented Nov 5, 2022

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.

@Smephite Smephite marked this pull request as ready for review November 5, 2022 20:00
Copy link
Contributor

@quietbits quietbits left a 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
Copy link
Contributor

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 ?

Copy link
Contributor Author

@Smephite Smephite Jan 14, 2023

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

Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants