This is a command-line interface (CLI) tool that fetches and displays real-time gas prices (in Gwei) on the PulseChain network. It calculates and shows the current, 5-minute, and hourly averages. The data updates every 5 seconds using G4MM4's PulseChain RPC endpoint (https://www.g4mm4.io/).
- Fetches the current gas price from PulseChain.
- Calculates 5-minute and 1-hour averages.
- Displays prices in Gwei in a live updating table format.
- Python 3 installed on your system.
- Basic knowledge of the terminal/command line.
Clone the repository:
git clone https://github.com/yourusername/pulsechain-gas-cli.git
Navigate to the project directory:
cd pulsechain-gas-cli
Install dependencies (e.g., requests library):
pip install -r requirements.txt
Run the CLI:
python gas_price_cli.py
The gas prices will be fetched and displayed in the terminal, updating every 5 seconds with both the current price and rolling averages.
Time Current Gas Price (Gwei) 5-Minute Avg (Gwei) 1-Hour Avg (Gwei)
2024-10-06 12:34:56 10.45 9.89 10.02
2024-10-06 12:35:01 10.87 10.12 10.04
- The script uses Python's
requests
library to make JSON-RPC requests to G4MM4's PulseChain RPC API (https://www.g4mm4.io/). - Gas prices are fetched, stored, and averages are calculated in Gwei.
- The terminal table is refreshed every 5 seconds with the latest values.
To change the update interval, modify the sleep time in the script:
time.sleep(5) # Change 5 (seconds) to your desired interval
requests
: HTTP library for API calls.
This project is licensed under the MIT License. See the LICENSE file for details.