The nitty-gritty of dapp development: the Ethereum JSON-RPC API

Have more questions? Submit a request

At some point, you’ll have to stop architecting, and start coding. The good news is that web3 is full of dapp-building tutorials and templates:  

The Ethereum API: Reference and learning resources

As you build out from one of these wireframes, you’ll need to begin familiarizing yourself with the Ethereum JSON-RPC API. This is how your dapp will communicate with the blockchain in order to get the information it needs to serve its users. The Ethereum API is, of course, a publicly maintained API, and there are multiple sources of information about it. The Ethereum Foundation's specification is available here.

We recommend Truffle's ganache.dev interactive Ethereum JSON-RPC API documentation. It includes not just a very complete set of API information, with descriptions, return object definitions, and code examples; it also features an environment where you can run the code, live.

Truffle Ganache documentation

An API this big can be overwhelming. If you're looking for a place to start, we recommend Infura's orientation to the Ethereum API, focusing on key methods and diving deep into important topics surrounding tokens and transactions.

As a dapp developer, though, you’ll want to be thinking of user experience, and you should be aware of MetaMask’s Permissions System, and how that interacts with the Ethereum API

For a list of which public blockchain networks use all, or part of the Ethereum JSON-RPC API on their own networks, check out Infura’s reference material

So, you’ve got your API reference, you’re ready to make some calls; where are you sending those calls? 

Again–for local development, you can spin up a local test blockchain with Ganache, to imitate a production environment without spending live gas tokens. But what happens when you’re ready to move your project off of local development, and start testing on a live testnet, or mainnet? 

Which network are you deploying to?

If you haven’t thought about this yet, now is the time to jump to our Network Node, and figure out which network(s) will be the best fit for your project.

Scaling your dapp

For those planning on deploying to Ethereum or another public blockchain network: What happens when your dapp gets really popular, and you need a scaling solution that allows your dapp to make hundreds of thousands, millions of API calls per month?

You do what one blue chip crypto project after another has done: use Infura.

Next:

Infura: Your always-on, reliable, scalable blockchain endpoint provider

Previous:

Truffle Dashboard with MetaMask

Articles in this section

Was this article helpful?
0 out of 0 found this helpful
Share