fix(studio, webapp, shinzohub): chain switching - #290
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
shinzo-studio | 609b3a0 | Commit Preview URL Branch Preview URL |
Jul 14 2026, 10:27 AM |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
shinzo-webapp-staging | 609b3a0 | Commit Preview URL Branch Preview URL |
Jul 14 2026, 10:28 AM |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
shinzo-explorer | 609b3a0 | Commit Preview URL Branch Preview URL |
Jul 14 2026, 10:28 AM |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
faucet-internal | e50f0a0 | Commit Preview URL Branch Preview URL |
Jul 14 2026, 10:59 AM |
|
Ran into an issue. Here's what I did:
It's probably worth noting that I'm on Firefox. |
|
@johnnymatthews thanks for this report! I've made a fix to point 3 in your list. As for the HTTP not allowed in Metamask, I've made a workaround. Studio will now show an error in case their wallet doesn't allow switching to a chain with HTTP-based RPC, and prompt users to add the chain manually. For wallets like Rabby, chain switching should be automatic as intended. Can you try adding the chain manually and proceeding with view deployment?
|
| import { | ||
| getView, | ||
| listViews, | ||
| shinzoHubTestnet as shinzoChain, |
There was a problem hiding this comment.
Question: If we use the hardcoded chain details specific to testnet here, wont that add unnecessary rework when we release mainnet ? or when we need to switch between chain during dev?
There was a problem hiding this comment.
I think this is a necessary step at the moment. The env that used to be here was not configured dynamically enough to allow simple switching. I'd plan this as a separate feature for all apps: studio, webapp, faucet, etc.
|
|
||
| void (async () => { | ||
| try { | ||
| const chain = await fetchShinzoHubChain(controller.signal); |
There was a problem hiding this comment.
Curious: Do we have to replace the dynamic fetching for chainId in webapp?, This might cause connecting to testnet from https://registraion-staging.shinzo.network. It is configured to use http://testnet-internal.shinzo.network
There was a problem hiding this comment.
I've changed this to SHINZOHUB_CHAIN env in all application. Static data now
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
faucet | e50f0a0 | Commit Preview URL Branch Preview URL |
Jul 14 2026, 11:00 AM |
| } as const; | ||
|
|
||
| /** Builds a live ShinzoHub viem chain definition from RPC endpoints. */ | ||
| export async function shinzoHubChain({ |
There was a problem hiding this comment.
[nit]: It looks like we are not using this anywhere, may be we can remove it.
| } | ||
|
|
||
| /** Fetches the live ShinzoHub chain definition through the webapp API proxy. */ | ||
| export async function fetchShinzoHubChain( |
There was a problem hiding this comment.
With new chain switching changes, I think we no longer need these. We could remove this whole page and use the shinzoChain directly where we are calling the resolveShinzoHubChain()
There was a problem hiding this comment.
I have added some comments in webapp to remove some deadcodes after the new changes. I am currently doing a cleanup PR for registration v2 feature flag. If you want to go ahead merge this PR, I can include the dead code removal in my PR. Let me know what works better for you.
There was a problem hiding this comment.
This sounds good. I'd appreciate if you could take on removing dead code
| export async function fetchShinzoHubChain( | ||
| signal?: AbortSignal | ||
| ): Promise<Chain> { | ||
| const response = await fetch("/api/shinzohub/chain", { signal }); |
There was a problem hiding this comment.
I think we could also remove the route at this path, I did a quick search and could not find fetch from this route.
| /** Proxies browser EVM requests to the selected chain's HTTP RPC without mixed-content errors. */ | ||
| export async function POST(request: Request) { | ||
| try { | ||
| const response = await fetch( |
There was a problem hiding this comment.
This will help to resolve the CORS error we are facing in the browser for the rpc urls, right? Once this merge can we remove the rpc-proxy and staging-rpc-proxy workers from our projects?
There was a problem hiding this comment.
Yes, this is exactly why I made it
|
Note:- Not sure if it is currently valid since we do not have a internal app for the explorer ( actually I am not sure if need one since explorer is only fetching the data from the network not altering or updating the network) , but the txnhash and the address data after the faucet transaction is currently connecting to https://explorer.shinzo.network which is showing wrong data in the case of |
NiranjanaBinoy
left a comment
There was a problem hiding this comment.
I have added some comments but nothing major mostly clean up. but let me know how you want to handle the clean up in webapp. I can add that as part of #185
|
I did not test the studio, since we do not have the internal app yet and I did not want to add test data to the testnet. |
@NiranjanaBinoy yes, this is expected for now. We will create internal explorer deployments soon, and the links will start working as expected |

Deploying ShinzoHub to testnet produced new chain id. This update broke Studio view deployment feature - wallets like Metamask or Rabby weren't able to use the correct chain, thus failing in any transaction sending actions.
This PR creates the testnet global var in Shinzohub package and reuses it in Studio, Webapp, Explorer, and Faucet.
Adds new
SHINZOHUB_CHAIN=testnet | internal | devnet | localenv variable to every mentioned app.Steps to test: