RPC refers to Remote Procedure Call, which is a software communication technology. Through RPC, one computer calls a program on another computer and executes it. RPC is a type of API (Application Programming Interface).
For example?: You bought a smart rice cooker. You can control this rice cooker remotely from your phone. In other words, when you are in the office, you can also use the mobile app to let the rice cooker start cooking automatically. This process is implemented through RPC.
RPC is a request-response protocol. The caller sends a request to execute a program with specified parameters on the remote computer. The executor then executes and sends the results back to the caller.
In Web2, RPC can be used for remote file access, remote software task management, remote monitoring program control, remote error logging, etc.
For blockchain, RPC is a communication method between nodes or between nodes and virtual machines. Specifically, each node can send instructions to other nodes through the RPC API, or query data in the blockchain network from other nodes (like a communication portal).
What is a virtual machine? What is the Ethereum Virtual Machine? Please refer to the "What is the Ethereum Virtual Machine" chapter.
If a decentralized application (DApp) wants to connect to the blockchain network, it needs to connect to the node first, and then interact with the blockchain network through the node (such as reading and writing data or executing intelligence contract). DApp connection nodes also need to use RPC technology.
DApp developers can connect to nodes in two ways. First, run a node yourself and interact with the blockchain network through your own node. Second, cooperate with other nodes, especially node service providers, to use their nodes. Compared with the first method, choosing a service provider will reduce the developer's time and development costs to a certain extent. However, choosing a service provider is also equivalent to linking the operation of some products to third-party service providers, which will cause certain centralization risks.
Infura is a provider of blockchain-related tools and infrastructure services. It is a centralized company that was acquired by Consensys in 2019.
The node service is one of Infura's main products, supporting Ethereum, Polygon, Optimism, Arbitrum, Avalanche, Near, etc.
MetaMask (the largest cryptocurrency wallet) is also an Infura user and accesses the blockchain through Infura nodes. Therefore, when using MetaMask, you are actually using the infrastructure services provided by Infura. (It’s worth noting that MetaMask is also owned by Consensys).
You may also be interested in:
- What is MetaMask?
- What is Ethereum?