Telegram (AI) YouTube Facebook X
Ру
How to start building Web3 applications in 2024, according to GetBlock

How to start building Web3 applications in 2024, according to GetBlock

At the end of 2023, venture firm Andreessen Horowitz published a list of “big ideas” in crypto. The experts highlighted a reboot of UX in crypto-application design, as well as the rise of a modular technology stack in Web3 development.

Together with the RPC-node provider GetBlock, we outline what a Web3 engineer needs to know and do in 2024.

The Web3 developer’s technology stack

A technology stack is a set of technologies, tools and programming languages for building software. For instance, MEAN (MongoDB, Express.js, AngularJS/Angular, Node.js) and MERN (MongoDB, Express.js, React, Node.js) are popular stacks for web developers.

In Web3, four core components stand out:

  • libraries. They are used to build applications that run on a blockchain or interface with it;
  • smart contracts. Immutable code that runs within the network;
  • wallets. An address serves as a user or smart-contract identifier and a store for cryptocurrencies and tokens;
  • nodes. They store a copy of the blockchain. Without nodes, a Web3 library cannot interact with smart contracts.

The following tools are used to work with them:

  • GetBlock — a provider that connects to nodes; Remix — an IDE for testing, deploying and running smart contracts in the browser;
  • Hardhat — a local development environment for Ethereum. It allows you to deploy applications and smart contracts to the Mumbai and Goerli testnets and to Ethereum mainnet;
  • MetaMask — a browser-based Web3 wallet. Developers use it to test and deploy dapps; users — to store cryptoassets and interact with Web3;
  • Etherscan — an Ethereum explorer that shows transaction status and smart-contract details.

To build Web3 applications you will also need JavaScript and Solidity.

“By mastering these concepts and tools, a beginner developer will understand how, for instance, a cryptocurrency wallet is built and what it takes to create a similar product,” the GetBlock team comments.

Node providers

To exchange data with a blockchain, any crypto service needs a full node to query. A node provides data on transactions, blocks and balances and records subsequent changes.

For example, for Alice to send Bob 1 ETH, the wallet must check how much money both have before sending, verify that Alice authorised the transaction and that Bob’s wallet is valid, and then “tell” the blockchain that the balances have changed.

You can run a full node yourself: rent a virtual server or buy a physical one, install a node client and wait for it to sync with peers.

This is a fairly laborious process that requires constant upkeep (monitoring, installation, updates). Hence Web3 developers often turn to RPC-node providers. These offer access to a node via an API. The node address (the URL of the endpoint) is placed in the application code, which then sends requests to it.

“RPC nodes are also launched by blockchain teams to grow their audiences. But their public RPC nodes are overloaded and unsuitable for commercial development. Such nodes are better used for research,” GetBlock points out.

Providers operate on one model: the client pays for compute (the right to send requests to the blockchain) and the company keeps the node running.

“The first popular RPC provider was Infura, giving access to Ethereum nodes and EVM-compatible networks. 

GetBlock is a next-generation platform. We support more than 50 blockchains. If a team is building a multi-currency exchange, it can connect to Bitcoin, Ethereum, Tron and other networks through one service,” the project team comments.

An RPC node simplifies, accelerates and cuts the cost of developing and launching applications, and saves resources on their maintenance.

“GetBlock provides access to shared and dedicated nodes. The latter means a node deployed strictly for a client’s tasks, with maximum speed and uptime. It targets projects with solid traffic or scaling plans. For fast RPC-node responses we use servers in Europe, Asia and the US.  

Shared nodes are a solution for regular users. They share infrastructure with others yet still get high-speed access. You can choose plans with request limits (from 5 million blockchain requests) or unlimited plans for a month, half-year or a year,” GetBlock claims.

For beginner Web3 developers, GetBlock offers free access capped at 40,000 requests per day. Paid plans start at $29.

Web3 libraries

Libraries are collections of ready-made functions that speed up development of decentralized applications. Their main job is to enable interaction with smart contracts deployed on Ethereum or other networks. Most developers choose Web3.js and Ethers.js for this.

Web3.js is a popular library for working with Ethereum, created in 2015. Many projects use it to connect smart contracts to external JavaScript code, execute transactions and fetch blockchain data.

The library consists of several modules:

  • eth — helps connect to Ethereum testnets and mainnet, manage transactions, construct Solidity contracts and interact with them;
  • shh — enables information exchange between dapps;
  • utils — formats and converts data;
  • bzz — allows the use of Swarm as a decentralised data-storage system.

“The full list of Web3.js functions is huge. It is very popular thanks to compatibility with virtually all existing frameworks,” the GetBlock team notes.

You can install the library with a package manager such as NPM or YARN, and then integrate it into various consoles.

Ethers.js is an alternative to Web3.js, released in 2016 by developer Richard Moore. It offers a similar set of functions, but boasts additional features, including:

  • built-in support for the Ethereum Name Service;
  • a MIT licence allows code to be reused and remixed with minimal restrictions;
  • a small bundle size that avoids harming frontend performance;
  • use of TypeScript to increase safety and minimise the likelihood of errors and bugs.

The library is updated regularly and installs much like Web3.js. Unlike the latter, Ethers.js does not require loading the full bundle. That can be useful if you plan to use only specific modules.

Wallets

Web3 wallets are needed to interact with dapps. They provide an interface for managing cryptoassets via private keys (MetaMask, Phantom) or smart contracts (Safe, Argent).

As a rule, when interacting with blockchains, non-custodial wallets rely on RPC nodes. MetaMask by default uses the provider Infura (both products belong to ConsenSys).

“MetaMask tracks the IP addresses and wallets of users who have chosen Infura as their RPC provider. Thus it becomes much easier for ConsenSys to impose restrictions on the wallet, which does not quite align with the principle of decentralisation.

You can change the RPC provider at any time, for example to GetBlock. We do not share data/information with third parties and provide 40,000 requests to all blockchains after registration. That is quite enough for personal use,” the provider’s representatives note.

The next section explains how to change the RPC provider in MetaMask settings.

Smart contracts

A smart contract is a self-executing program that enables decentralised applications to perform automatic transactions and record data on a blockchain according to predefined conditions.

To create smart contracts on Ethereum and other EVM-compatible blockchains, most developers use the OpenZeppelin library and the Remix IDE, and for blockchain data access — RPC-node providers such as GetBlock.

Let us create an ERC-721 (NFT) token on Ethereum. Do the following:

  • open the Contracts Wizard and choose one of the available options (ERC-721 in our case), then enter the token name and ticker;
  • fill in the Base URI field with a link to IPFS (stores NFT metadata) and specify the asset’s properties;
  • click Open in Remix to move the contract into the development environment. You can add additional conditions there;
  • after making changes in Remix, click Solidity Compiler in the side panel to compile the code.
С чего начать разработку Web3-приложений в 2024 году ― рассказывает GetBlock
ERC-721 code in Remix. Data: GetBlock.

The contract is ready to deploy. You can test it on the Sepolia or Goerli testnets. To do this:

  • set GetBlock as the RPC-node provider — create an account and get a free endpoint for Sepolia;
  • add the network in MetaMask by pasting the RPC link.
С чего начать разработку Web3-приложений в 2024 году ― рассказывает GetBlock
Adding an RPC link in MetaMask. Data: GetBlock.

After that, in the side panel go to Deploy & Run Transactions and select Injected Provider ― MetaMask in the Environment field. If the Sepolia network is active in the wallet, it will connect to Remix automatically.

Make sure you have ETH to pay for gas. In Sepolia and other testnets it can be obtained for free using faucets.

С чего начать разработку Web3-приложений в 2024 году ― рассказывает GetBlock
Deploying a smart contract in Remix. Data: GetBlock.

Finally, click Deploy and confirm the transaction in the MetaMask extension that appears.

When deployed on mainnet, the created NFT will be displayed in the account at testnets.opensea.io or on OpenSea’s main site.

Conclusions

Web3 development comprises a technology stack of several interlinked components. RPC providers such as GetBlock play a central role: they simplify application development and save maintenance resources.

Even if you do not plan to build decentralised applications, understanding how each technology works will help you better make sense of different cryptocurrency projects.

Подписывайтесь на ForkLog в социальных сетях

Telegram (основной канал) Facebook X
Нашли ошибку в тексте? Выделите ее и нажмите CTRL+ENTER

Рассылки ForkLog: держите руку на пульсе биткоин-индустрии!

We use cookies to improve the quality of our service.

By using this website, you agree to the Privacy policy.

OK