Skip to content

BlockPredict is a project that utilizes historical data from a blockchain network to predict future block rewards. It combines data fetching, preprocessing, machine learning, and visualization techniques to provide insights into the block reward dynamics of a blockchain.

Notifications You must be signed in to change notification settings

aviroopjana/BlockPredict

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BlockPredict 🔮

This project aims to predict the block reward of a blockchain network using historical data and machine learning techniques.

Table of Contents 📑

About 👀

The project consists of two main components: server.js and BlockReward.ipynb. The server.js file is responsible for fetching data from an API, exporting it to a CSV file, and running a server to provide the data. The BlockReward.ipynb notebook uses the exported CSV data to train a machine learning model and predict future block rewards.

Installation 🚀

  1. Clone the repository.
  2. Install the project dependencies by running the command npm install.

Usage 📋

  1. Start the server by running npm start. This will fetch the data, export it to a CSV file, and start the server.
  2. Open the BlockReward.ipynb notebook in an environment like Jupyter Notebook or Google Colab.
  3. Ensure that the block_data.csv file generated by the server is in the same directory as the notebook.
  4. Run the notebook cells to load the data, train the model, and predict block rewards.

Data 📊

The data used in this project is obtained from the Ethereum blockchain through the Etherscan API. It includes the timestamp (in seconds) and the corresponding block reward in Ether. The server.js script fetches the data for a range of block numbers and exports it to a CSV file named block_data.csv.

Results 📈

The BlockReward.ipynb notebook visualizes the historical data, trains a random forest regressor model, and predicts future block rewards based on a given timestamp. The predictions are displayed on a scatter plot along with the actual data points.

Dependencies 📦

The project relies on the following dependencies:

  • axios: ^1.4.0
  • csv-writer: ^1.6.0
  • dotenv: ^16.3.1
  • ethers: ^5.0.0
  • express: ^4.18.2

Make sure to install these dependencies before running the project.

Contributing 🤝

Contributions to this project are welcome. Feel free to submit bug reports, feature requests, or pull requests to the repository.

About

BlockPredict is a project that utilizes historical data from a blockchain network to predict future block rewards. It combines data fetching, preprocessing, machine learning, and visualization techniques to provide insights into the block reward dynamics of a blockchain.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published