This Node.js script interacts with the Ethereum blockchain to fetch the current gas price, the latest block number, its details, and the balance of a specified Ethereum account. It uses the Infura API to connect to the Ethereum network and prompts the user for the necessary inputs via the console.
- Node.js (preferably the latest stable version)
- An Infura account and a Project ID created on the Infura platform
- An Ethereum address for which you want to check the balance
- Clone this repository or download the script to your local machine.
- Navigate to the script's directory in your terminal.
- Run
npm install
to install all dependencies.
To start the script, run:
node ethGasFetch-use.js
Follow the on-screen prompts to enter your Infura Project ID and the Ethereum address you want to check.