This is a JavaScript backend application that tracks real-time blockchain data of USDT (Tether) token transfers on the Mumbai Polygon Testnet. The application utilizes MongoDB for data storage and Moralis Streams for real-time data retrieval from the blockchain.
The purpose of this project is to demonstrate how to build a simple backend system that can efficiently monitor and store USDT token transfer events on the Mumbai Polygon Testnet. It can be used as a foundation for building more complex blockchain data tracking applications or as a reference for integrating Moralis Streams with MongoDB.
- Real-time tracking of USDT token transfers on the Mumbai Polygon Testnet.
- Storing relevant transaction data (sender, receiver, amount, timestamp) in a MongoDB database.
- Easy setup and configuration.
- Minimal and efficient codebase.
Before running the application, make sure you have the following installed:
- Node.js (version 18.5.0 or higher)
- MongoDB cluster connection string
- Clone the repository:
git clone https://github.com/Guap-Codes/usdt-token-tracker.git
- Install the dependencies:
cd usdt-token-tracker
npm install
-
Rename the
.env.example
file to.env
. -
Replace the placeholder values in the
.env
file with your actual MongoDB connection URI. -
Create an account on Moralis.io & create a new stream
-
Get the token address of USDT on the polygon mumbai testnet from mumbai.polygonscan.com
To start the application, run the following command:
node index.js
The application will begin tracking USDT token transfers on the Mumbai Polygon Testnet in real-time. The incoming transactions will be stored in the MongoDB database specified in the .env
file.
The data stored in the MongoDB database will have the following schema:
{
"_id": "ObjectId", // MongoDB autogenerated ID
"fromAddress": "string", // Ethereum address of the sender
"toAddress": "string", // Ethereum address of the receiver
"value": "string", // USDT token amount transferred
"valueWithDecimal": "string", // USDT token amount transferred in decimal
"timestamp": "number" // UNIX timestamp of the transaction
}
We welcome contributions to improve the project. To contribute, follow these steps:
- Fork the repository.
- Create a new branch for your feature/fix:
git checkout -b feature/your-feature
. - Commit your changes:
git commit -m 'Add some feature'
. - Push to the branch:
git push origin feature/your-feature
. - Open a pull request and describe the changes you made.
This project is licensed under the MIT License.
We would like to thank the contributors and maintainers of the following libraries and services:
- Moralis Streams
- MongoDB
If you have any questions or need further assistance, feel free to contact the project maintainers at yahayajelil@yahoo.com
.