cosmology-tech / cosmos-kit

Universal wallet connector for the Cosmos βš›οΈ
https://cosmology.zone/products/cosmos-kit
BSD 3-Clause Clear License
183 stars 135 forks source link

when adding chains from cosmos/chain-registry, cosmos.directory endpoints overrides functional chain-registry endpoints #173

Closed jcstein closed 1 year ago

jcstein commented 1 year ago

On version 1.10.0 of chain registry on this repository and live site's multi-chain page, I am adding "Celestia's Mocha Testnet", which has endpoints in 1.10.0 of chain-registry

However, the endpoints that are suggested when I add the chain are from cosmos.directory. If I add the chain, and modify the endpoints manually in keplr > settings > endpoints > change RPC/API, I am able to successfully add the chain

So, I think there is a check happening before the chain is suggested, that is switching from the working endpoint to one on cosmos.directory that doesn't exist. Ideally, the endpoints that are added are the same as these

Here's a video overview, if it helps clarify anything πŸ˜„

pyramation commented 1 year ago

just transferring this to cosmos-kit β€”Β is this more likely a create-cosmos-app issue with the particular example?

@liujun93 let me know we can move it back, but I thought it was potentially cosmos-kit

liujun93 commented 1 year ago

@jcstein It should be from cosmos-kit. By default cosmos-kit pick the fasted endpoint from all endpoints. There is a validation process. You can choose to disable validation by setting isLazy. Here is the doc. https://docs.cosmoskit.com/provider/chain-provider#islazy

In you code I suggest setting like this:

endpointOptions={{
  celestiatestnet3: {
    isLazy: true
  }
}}

and you need to upgrade cosmos-kit version to the latest and in the latest I moved the priority of cosmos.directory to the lowest

jcstein commented 1 year ago

thank you so much @pyramation and @liujun93. I added isLazy: true to endpointOptions and also updated version of cosmos-kit. working as expected now after https://github.com/jcstein/rollkit-frontend/commit/5dfbaf7eab9737b82606f61ad4ad8297dfa738db πŸ˜„