Ethereum-compatible blockchain platforms are frequently deployed on networks other than Ethereum mainnet. Layer 2 scaling solutions including Arbitrum, Optimism, and Base, sidechains including Polygon, and application-specific chains all require MetaMask to be configured with the specific network's chain ID, RPC endpoint, and block explorer URL. Users who arrive at the platform with MetaMask configured for Ethereum mainnet need to switch networks or add the required network to their MetaMask configuration before they can interact with the platform's contracts.
27 Blockchain's MetaMask integration service handles network management as part of the standard integration scope. When the integration detects that the user's MetaMask is connected to a network that does not match the platform's required chain, it initiates the appropriate MetaMask API call to either switch to the required network if the user has it configured, or to add the network to MetaMask's network list if the user does not. The user sees a MetaMask popup requesting permission to switch or add the network, and the integration handles both the acceptance and rejection of that request without leaving the platform in an indeterminate state. For platforms deployed on multiple networks, the integration can manage network context dynamically based on which platform feature the user is accessing.