paradigmxyz/rivet

Feature: Add, list & switch networks

jxom opened this issue · 4 comments

jxom commented

Adding networks

Problem: Right now, it is only possible to create a new network (aka Anvil instance) from the initial onboarding screens. After onboarding, it is not possible to add another network.

Solution: As a user, I want the ability to add a new network with a similar UI to that on the onboarding screens, so that I can switch between networks.

Listing networks

Problem: Right now, a user cannot see a list of available networks. This is partially because we don't have the ability to add more networks (see above) in Rivet.

Solution: As a user, I want to see a list of networks with some basic info (chain id, rpc url, etc).

Switching networks

Problem: Right now, a user cannot switch between networks. This is partially because we don't have the ability to list networks (see above) in Rivet.

Solution: As a user, I want the ability to switch between networks on the network list.

Hi , I want to take this feature, and I already finished add network part

Network List UI Design

截圖 2023-09-10 上午2 38 28

@jxom

Currently, rivet is using Anvil, so rivet will create a Client in Viem, and the chain ID will be defined at the time of anvil command initialization (ex: anvil --chain-id 1 --fork-url https://cloudflare-eth.com)
This means that if we want to support multiple networks, we will have multiple Viem Clients. Is this expected? Also, I'm unsure how to modify it during the Anvil initialization command. Additionally, the current NetworkStore and NetworkState use RpcUrl as the index record. If we want to add multi-network functionality, I think the first phase of the modification would be to index all Networks by key instead.