You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, in order to use the NetworkDropdown component, a developer would need to provide a list of network configs to the component, which can be quite a few lines of code. This would also create inconsistencies across different dapps because it is the developer's responsibility to find the rest/rpc endpoints, icon url, etc.
One potential solution is to export consts with network configs for mainnet, emerynet, devnet, localchain, etc and a default list of network configs like const defaultNetworkConfigs = [mainnet, emerynet, devnet, localchain];
I considered this but didn't commit to it yet. I had a couple concerns but possibly they're not dealbreakers:
I'm uncertain about the stability of chain IDs for testnets. For example devnet is agoricdev-23 which implies 22 previous iterations. I'm not sure if we expect it to change more in the future, but if so we'd have to be on top of it, do a PR in ui-kit, and publish a new version to NPM each time.
For mainnet, cosmos-kit actually has some default RPCs that it gets from the chain registry. However, there's a lot of defunct/unreliable RPCs in that list, and it's similarly difficult to keep up-to-date. So, I made it so you have to specify your own RPCs which override the ones in the chain registry.
The dynamic nature of this info is the reason we have resources such as https://devnet.agoric.net/network-config, so it would probably be better to build something that works with a network-config URL. However, getting the chain info asynchronously in a static app is kinda messy with <ChainProvider>, I'm not sure how to approach it. Maybe in AgoricProvider we can render an empty AgoricContext.Provider until the the network config loads, then swap it out for the AgoricProviderLite when all the chain info is available.
What is the Problem Being Solved?
Currently, in order to use the
NetworkDropdown
component, a developer would need to provide a list of network configs to the component, which can be quite a few lines of code. This would also create inconsistencies across different dapps because it is the developer's responsibility to find the rest/rpc endpoints, icon url, etc.Ref: https://github.com/Agoric/ui-kit/tree/main/packages/react-components#network-dropdown
Description of the Design
One potential solution is to export
const
s with network configs formainnet
,emerynet
,devnet
,localchain
, etc and a default list of network configs likeconst defaultNetworkConfigs = [mainnet, emerynet, devnet, localchain];
And the developer would only need to do
to use this component.
Security Considerations
This should help with security slightly as this repo would become the canonical place to provide network configs for all Agoric chains
Scaling Considerations
We should use load balanced DNS names, like https://main.api.agoric.net, to avoid overwhelming servers from a single validator
Test Plan
Open to any test plan
The text was updated successfully, but these errors were encountered: