DeveloperBreeze

Blockchain Development Programming Tutorials, Guides & Best Practices

Explore 30+ expertly crafted blockchain development tutorials, components, and code examples. Stay productive and build faster with proven implementation strategies and design patterns from DeveloperBreeze.

Tutorial

Understanding `crypto.randomBytes` and `ethers.randomBytes`: A Comparison

  • crypto.randomBytes:
  • Library: crypto.randomBytes is part of Node.js’s built-in crypto module. It requires no additional dependencies and is readily available in any Node.js environment.
  • Usage: The function takes a single argument specifying the number of bytes to generate and returns a Buffer object containing the random bytes.
  • Example:
    const crypto = require('crypto');
    const randomBytes = crypto.randomBytes(32);
    console.log(randomBytes.toString('hex')); // Prints a 32-byte random hex string

Oct 24, 2024
Read More
Tutorial

How to Query ERC-20 Token Balances and Transactions Using Ethers.js and Etherscan API

node getTokenTransactions.js

You should see a list of token transactions for the specified address, with details including the sender, recipient, value transferred, and transaction hash.

Oct 24, 2024
Read More
Tutorial

Sending Transactions and Interacting with Smart Contracts Using Infura and Ethers.js

This output is the token balance in the smallest unit (e.g., Wei for Ether or the smallest denomination for the token), and you can convert it to the token’s base unit if needed.

Deploying smart contracts is a more advanced topic, but here’s an example of how you can use Ethers.js with Infura to deploy a smart contract:

Oct 24, 2024
Read More
Tutorial

Getting Wallet Balance Using Ethers.js in Node.js

To follow along, you’ll need the following:

  • Node.js installed on your machine.
  • Basic understanding of JavaScript.
  • An Ethereum wallet (with private key or mnemonic phrase).
  • (Optional) An Infura account to access the Ethereum network.

Oct 24, 2024
Read More
Cheatsheet
solidity

Blockchain Libraries Cheatsheet

  • Description: A full-featured, open-source Bitcoin library for Node.js that allows you to build Bitcoin applications with ease.
  • Use Cases:
  • Build Bitcoin wallets and full-node implementations.
  • Integrate Bitcoin functionality into existing Node.js applications.
  • Develop custom Bitcoin transaction handling and mining scripts.
  • Key Features:
  • Full SPV and full-node support for Bitcoin.
  • Modular architecture for building custom Bitcoin services.
  • Detailed documentation and active community support.
  • Installation:
  npm install bcoin

Aug 23, 2024
Read More