Skip to content

Overview

RPCs (Remote Procedure Call) are a set of protocols and interfaces that allow communication with remote servers to execute programs in a separate location. They provide a way for developers and their applications to retrieve data from blockchains and execute code on remote decentralized servers, known as nodes. When developers create decentralized applications (dApps) that connect to RPCs, these dApps can respond to users’ requests for blockchain-related information and perform actions like cryptocurrency transactions.

When users interact with a dApp to carry out transactions, their requests travel through a RPC to connect with the nodes housing blockchain data. This data is then forwarded to the mempool, where it waits to be processed by validator nodes and added to the blockchain.

Remote Procedure Calls (RPCs) underpin multiple functionalities in the blockchain ecosystem. They are commonly used for:

  • Retrieving Data: Decentralized applications use RPCs to fetch data from the blockchain network. For instance, a blockchain explorer application can employ RPC to inquire about transaction specifics, verify account balances, or extract information concerning specific blocks. This data retrieval capability remains crucial for building wallets, analytical tools, and other services reliant on blockchain.
  • Executing Transactions: RPCs allow applications to initiate and carry out transactions on the blockchain network. A decentralized exchange platform, for instance, uses RPCs to dispatch transaction details, encompassing the sender’s address, the recipient’s address, and the transfer amount. Subsequently, RPCs facilitate the transaction verification and confirmation process, ensuring its integration into the blockchain.
  • Interacting with Smart Contracts: RPCs play a pivotal role in engaging with smart contracts on the blockchain. Applications can invoke functions within smart contracts through an RPC, supplying the requisite parameters and recovering the resultant data. This empowers developers to construct decentralized applications (dApps) capitalizing on smart contracts’ programmable and self-executing capabilities.
  • Monitoring and Managing Blockchains: RPCs provide a suite of tools for monitoring and managing blockchain nodes. Applications can employ RPC commands to acquire insights into the network, such as the count of connected peers, synchronization status, or mining difficulty. This data is valuable for network analysis, performance oversight, and maintenance objectives.
  • Facilitating Cross-Chain Interactions: RPCs streamline cross-chain interactions and enhance interoperability. By leveraging RPCs, applications can communicate with nodes across diverse blockchain networks, enabling data exchange or transaction execution spanning multiple chains. This capacity to interface with many blockchains promotes the development of decentralized applications that harness the combined capabilities of various networks.

There are typically two different types of nodes that one can run for any specific blockchain network, a full node and an archive node.

Archive nodes contain the full block history from genesis to the current state for a specific blockchain ledger. They are used by dApps that need the ability to retrieve data for any time period of the blockchain’s history.

Full nodes typically have settings enabled that prune away data older than a specific number of blocks to save disk space. These nodes do not store all state data back to the Genesis block but all state data can be retrieved from local storage or a snapshot if needed. Full nodes are used for reading or writing data in a “live” time period.