Use web3.js
In this tutorial, you'll send a regular transaction of 0.001 ETH from one account to another using the Web3 JavaScript library.
Prerequisites
- A Web3 project on Infura
- Node.js installed
- An Ethereum account
info
Use MetaMask or similar to create an Ethereum account for testing.
Steps
1. Select your network and verify funds
-
Sepolia - To use the Sepolia testnet, ensure that your account has Sepolia ETH. You can use the MetaMask faucet to add more funds.
-
Alternative network - To use an alternative network, ensure that your account has testnet ETH for that network.
2. Create a project directory
Create a new directory for your project. This can be done from the command line:
mkdir sendTransaction
Change into the new directory:
cd sendTransaction