Remote Procedure Call (RPC) could be classified as a type of API (application programming interface) that allows for developers to run code that can be executed on servers remotely. In plain English, an RPC call is how a dApp communicates with the blockchain or accesses other information from remote servers. In this section, we will concern ourselves with RPC calls to the blockchain via Metamask to Ethereum testnets such as Rinkeby and RPC endpoint providers such as Infura, Alchemy and Ankr.
When opening up the Metamask browser extension, we can connect to the various testnets by clicking on the pull-down menu as seen below and chose your desired testnet network:
If you are trying to view a given network’s RPC connection information or add a network, it can be accessed in the Metamask extension by clicking on the Hamburger(round multi-color icon above) > Settings > Networks. In my case, I am connected to the Ropsten testnet, so its Network Name, RPC URL, Chain ID, Currency Symbol, and Block Explorer URL are shown below:
Add a Network
A new network can be added in Metamask by clicking on the Add a network button and adding the 5 data inputs seen in the image above given in your tutorial or other source.
In blockchain development, it is necessary to connect your dApp to the blockchain to deploy smart contracts and interact with the deployed contract. This can be done by either running your own blockchain node such as GETH or accessing the blockchain through an RPC endpoint service such as Infura, Alchemy or Ankr. Connecting through the 3 providers is much easier than running your own node. With all 3 services, it is quick, easy and FREE to open an account and get access to RPC endpoints of many different testnets including Goerli Ethereum, Polygon Mumbai, Optimism Kovan and Solana Devnet. The websites for the 3 RPC endpoint providers can be found below:
IT IS SUPER IMPORTANT TO ALWAYS DOUBLE-CHECK THE WEBSITE URL YOU ARE CLICKING ON AND THE POP-UP MESSAGE IN METAMASK WHEN CONNECTING YOUR WALLET. IF YOU ARE ON THE WRONG WEBSITE AND YOU ALLOW ACCESS TO YOUR METAMASK WALLET, YOU MAY BE ALLOWING HACKERS ACCESS TO YOUR WALLET. BE SAFE!! ALWAYS DOUBLE-CHECK!!