Essential RPC Concepts for dApp Connectivity

Created by:

Connecting the Dots from Web1 to Web3

Have you ever wondered how all the data on the internet moves from one place to the next. And then to the next, and so on. Let's first have a very basic look at some concepts used in data decimination and retrieival on the web.

In the era of Web1, information retrieval was basic and primarily one-directional. Users consumed static content through technologies like HTTP (Hypertext Transfer Protocol), and the data fetching process was relatively straightforward.

Then came our now familiar Web2, and with it development, a paradigm shift occured, introducing a new era of interactivity, user-generated content, and the social web. Technologies like AJAX (Asynchronous JavaScript and XML) still play a crucial role in enabling dynamic, asynchronous function calls between the user's browser and the server.

The Rise of Web3

The protocols used in Web1, including HTTP, still form the backbone of communication, but the way data is managed and controlled has become more centralised, primarily through the social media, search and online retail giants, whose underlying structure often relies on centralised servers and databases. That gave cause for concern in a lot of quarters, and the result is the ever-evolving decentralised web, a.k.a. Web3.

Now, in the epoch of Web3, we witness a transformative phase. Web3 transcends these aforementioned structures, emphasising decentralisation, trustless systems, and blockchain technology. We are going to help you get set up with one integral aspect of this evolution for your Web3 development needs — the Remote Procedure Call (RPC).

RPCs

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 the Zerion wallet to Ethereum testnets such as Sepolia, and an RPC endpoint provider such as POKT Network.

Connecting to a Testnet with Zerion

When opening up the Zerion browser extension, we can connect to the various testnets as seen below by clicking on the extension's icon, the Settings gear ⚙️ wheel, choosing Networks, and selecting your desired test network:

Testnets on Zerion

If you are trying to view a given network’s RPC connection information, it can be accessed by clicking on the arrow to the right of the network name. In my case, I am connected to the Sepolia testnet. You can see its Network Name, RPC URL, Chain ID, Currency Symbol, Decimals and Block Explorer URL shown below:

Sepolia Network info Zerion

Add a Network

A lot of networks are already pre-loaded in the wallet, otherwise any new network's details should be provided to you, e.g. in a tutorial that you're working from. A new network can be added in Zerion by clicking on the Add Network button. Then add the 6 data inputs for your chosen network, similar to the Sepolia example in the image above.

An alternative way of adding network choices is through Chainlist's website. It's quite self-explanatory, but be sure to check ☑️ the Include Testnets option. Chainlist is a rich source of RPC statistics for EVM's (Ethereum Virtual Machine).

Connecting a dApp through an RPC Endpoint Provider

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. Connecting through one of these node providers is much easier than running your own node.

By using a node provider, it is quick and easy, and usually free to open an account that will get you access to RPC endpoints of many different testnets including Sepolia Ethereum, Polygon Mumbai, Optimistic Goerli and Scroll Sepolia.

Which RPC should I use?

There are many node providers nowadays, and you might recognise some names such as Ankr, Alchemy, and Infura among others. We're going to look at POKT Network, a decentralised RPC base layer that operates as an ecosystem of providers, as opposed to a monolithic RPC company. Its network's diverse ecosystem of web3 node operators ensures uptime, therefore resilience. We recommend choosing from one of the Gateways built on top of POKT Network's RPC baselayer:

With both, you can sign up with email, or Github, and proceed to 'create an application/project' to get your app's ID keys - don't worry, you don't have to write code for an application! 😁 You can use your key to gain access to many blockchain networks, e.g. by coding, configuring and deploying your smart contracts.

Are you a Developer DAO member?

If you're a Developer DAO member, you are hopefully aware of some of the "Developer DAO Perks" for Web3 we have. Let's take advantage of one of those, and get you hooked up with Grove:

  • for D_D Grove Perks deForm click here
  • connect and sign with your D4R NFT/$CODE 400+ wallet
  • register with your email
  • check your email for your Perks and further instructions
  • choose the development wallet to use with the Perks

Are you not yet a member of Developer DAO? There is no time like the present 😁

Important Security Notes

It is super important to always double-check the website URL you are clicking on and any pop-up messages in Zerion, when connecting your wallet. If you are on the wrong website and you allow access to your wallet, you may actually be allowing hackers access to it. You don't want that. Always double-check! At Developer DAO Academy, we strongly advise using a separate browser profile and wallet for development. Be safe!

Outro

We hope you now have enough insights on connecting to testnets and RPC endpoint providers, and that you're equipped to navigate the decentralised web in your development journey. Whether you're a seasoned Developer DAO member or just starting out, stay curious, stay secure, and keep building this dynamic digital wonderworld.