Thanks to visit codestin.com
Credit goes to github.com

Skip to content

andreransom58-coder/leakstream

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

💧 LeakStream - Real-Time Cryptocurrency Monitor

A beautiful, real-time cryptocurrency transaction monitoring website similar to FiatLeak, designed for Ubuntu servers. Monitor live transactions for XRP, XLM, XDC, HBAR, Flare, SOLO, and Bitcoin on an interactive world map.

LeakStream Screenshot License

Features

  • 🌍 Interactive World Map - Real-time visualization of crypto transactions across the globe
  • 💰 Multi-Crypto Support - Monitor XRP, XLM, XDC, HBAR, Flare, SOLO, and Bitcoin
  • 📊 Live Statistics - Track transaction counts, volumes, and prices for each cryptocurrency
  • Real-Time Updates - WebSocket-based live data streaming
  • 🎨 Modern Dark UI - Beautiful, responsive interface optimized for 24/7 monitoring
  • 📱 Responsive Design - Works on desktop, tablet, and mobile devices
  • 🔄 Auto-Reconnect - Automatic WebSocket reconnection on connection loss

Technologies Used

Backend

  • Node.js - Server runtime
  • Express - Web framework
  • WebSocket (ws) - Real-time bidirectional communication
  • Axios - HTTP client for fetching crypto prices
  • CoinGecko API - Real-time cryptocurrency price data

Frontend

  • Leaflet.js - Interactive map visualization
  • Vanilla JavaScript - No heavy frameworks, pure performance
  • CSS3 - Modern styling with gradients and animations

Installation

Prerequisites

  • Ubuntu Server (18.04 or later recommended)
  • Node.js (v14 or later)
  • npm (v6 or later)

Step 1: Install Node.js and npm

If you don't have Node.js installed, run:

# Update package list
sudo apt update

# Install Node.js and npm
sudo apt install nodejs npm -y

# Verify installation
node --version
npm --version

Step 2: Clone or Download the Repository

cd /home/user
git clone <your-repository-url> leakstream
cd leakstream

Or if you already have the files, navigate to the directory:

cd /home/user/leakstream

Step 3: Install Dependencies

npm install

This will install all required packages:

  • express
  • ws (WebSocket)
  • axios
  • cors
  • dotenv

Step 4: Start the Server

npm start

For development with auto-restart on file changes:

npm run dev

The server will start on port 3000 by default.

Configuration

Environment Variables

Create a .env file in the root directory to customize settings:

PORT=3000

Changing the Port

To run on a different port:

PORT=8080 npm start

Or modify the .env file:

PORT=8080

Usage

Access the Application

Once the server is running, open your web browser and navigate to:

http://your-server-ip:3000

For local access:

http://localhost:3000

Features Explained

Left Sidebar - Cryptocurrency Stats

  • View real-time statistics for each supported cryptocurrency
  • See current price, transaction count, total volume, and average transaction value
  • Each crypto is color-coded for easy identification

Center - Interactive Map

  • Watch transactions appear in real-time across the world
  • Transactions pulse on the map with size proportional to value
  • Click on transactions to see details

Right Panel - Transaction Feed

  • See the latest 20 transactions in real-time
  • View transaction amount, value, location, and timestamp
  • Transactions are color-coded by cryptocurrency

Bottom Stats

  • Total transactions monitored
  • Total volume in USD
  • Number of active cryptocurrencies

Running as a System Service

To keep LeakStream running 24/7 on your Ubuntu server, create a systemd service:

Step 1: Create Service File

sudo nano /etc/systemd/system/leakstream.service

Step 2: Add Configuration

[Unit]
Description=LeakStream Crypto Monitor
After=network.target

[Service]
Type=simple
User=your-username
WorkingDirectory=/home/user/leakstream
ExecStart=/usr/bin/node /home/user/leakstream/server.js
Restart=always
RestartSec=10
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=leakstream
Environment=NODE_ENV=production

[Install]
WantedBy=multi-user.target

Replace your-username with your actual Ubuntu username.

Step 3: Enable and Start Service

# Reload systemd
sudo systemctl daemon-reload

# Enable service to start on boot
sudo systemctl enable leakstream

# Start the service
sudo systemctl start leakstream

# Check status
sudo systemctl status leakstream

Service Management Commands

# Stop the service
sudo systemctl stop leakstream

# Restart the service
sudo systemctl restart leakstream

# View logs
sudo journalctl -u leakstream -f

Firewall Configuration

If you have a firewall enabled (UFW), allow access to the port:

# Allow port 3000
sudo ufw allow 3000/tcp

# Check firewall status
sudo ufw status

Nginx Reverse Proxy (Optional)

For production deployment with a domain name:

Step 1: Install Nginx

sudo apt install nginx -y

Step 2: Create Nginx Configuration

sudo nano /etc/nginx/sites-available/leakstream

Add:

server {
    listen 80;
    server_name your-domain.com;

    location / {
        proxy_pass http://localhost:3000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }
}

Step 3: Enable Configuration

sudo ln -s /etc/nginx/sites-available/leakstream /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl restart nginx

Monitoring Cryptocurrencies

The application currently monitors:

  1. Bitcoin (BTC) - The original cryptocurrency
  2. Ripple (XRP) - Fast, low-cost international payments
  3. Stellar (XLM) - Cross-border transactions
  4. XDC Network (XDC) - Enterprise-ready blockchain
  5. Hedera (HBAR) - Fast, fair, and secure network
  6. Flare (FLR) - Data acquisition network
  7. Sologenic (SOLO) - Tokenization platform

API Endpoints

The server exposes REST API endpoints:

  • GET /api/stats - Get current statistics for all cryptocurrencies
  • GET /api/config - Get cryptocurrency configuration

WebSocket Protocol

The application uses WebSocket for real-time updates:

Message Types

Transaction Message:

{
  "type": "transaction",
  "data": {
    "symbol": "BTC",
    "name": "Bitcoin",
    "color": "#F7931A",
    "amount": 0.5,
    "value": "25000.00",
    "price": "50000.000000",
    "lat": 40.7128,
    "lon": -74.0060,
    "location": "New York",
    "timestamp": 1698765432000
  }
}

Statistics Message:

{
  "type": "stats",
  "data": {
    "BTC": {
      "totalVolume": 1500000,
      "transactionCount": 234,
      "lastPrice": 50000,
      "averageValue": 6410.25
    }
  }
}

Troubleshooting

Port Already in Use

If you get an error that the port is already in use:

# Find process using port 3000
sudo lsof -i :3000

# Kill the process
sudo kill -9 <PID>

WebSocket Connection Failed

  • Check if the server is running
  • Verify firewall settings
  • Ensure WebSocket connections are allowed through your proxy (if using one)

Cannot Connect from External Network

  • Check Ubuntu firewall: sudo ufw status
  • Verify router port forwarding if accessing from outside your network
  • Ensure the correct IP address is being used

Development

Project Structure

leakstream/
├── server.js           # Main server file
├── package.json        # Project dependencies
├── README.md          # This file
└── public/            # Frontend files
    ├── index.html     # Main HTML file
    ├── styles.css     # Stylesheets
    └── app.js         # Client-side JavaScript

Adding New Cryptocurrencies

To add support for more cryptocurrencies:

  1. Update cryptoConfig in server.js
  2. Add CoinGecko API ID in fetchCryptoPrices()
  3. Update frontend cryptoConfig in app.js

Performance

  • Server Requirements: Minimal (1GB RAM, 1 CPU core sufficient)
  • Network: Low bandwidth usage (WebSocket compression)
  • Browser: Works best in modern browsers (Chrome, Firefox, Edge, Safari)

License

MIT License - feel free to use this project for personal or commercial purposes.

Support

For issues or questions:

  1. Check the troubleshooting section
  2. Review server logs: sudo journalctl -u leakstream -f
  3. Ensure all dependencies are installed: npm install

Acknowledgments

  • Map tiles provided by OpenStreetMap
  • Cryptocurrency prices from CoinGecko API
  • Inspired by FiatLeak

Enjoy monitoring the crypto world in real-time! 🚀

About

check realtime crpyto prices

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •