Skip to content

JaredTate/dgbstats

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

168 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

DigiByte Blockchain Stats

A comprehensive real-time blockchain statistics dashboard for the DigiByte network. This React-based web application provides detailed analytics, visualizations, and monitoring tools for the DigiByte blockchain.

Features

πŸ“Š Real-time Dashboard

  • Live blockchain statistics with WebSocket updates
  • Current block height, network hashrate, and difficulty
  • Supply economics and market capitalization
  • Recent blocks and transaction monitoring

πŸ“ˆ Analytics Pages

15 pages total (13 mainnet, 12 testnet, 2 testnet-exclusive)

  1. Home - Main dashboard with key metrics and softfork status
  2. Blocks - Real-time block explorer with mining details
  3. Mining Pools - Pool distribution analysis with interactive charts (mainnet only)
  4. Algorithms - Multi-algorithm mining statistics (SHA256, Scrypt, Skein, Qubit, Odocrypt)
  5. Hashrate - Network hashrate trends and analysis
  6. Difficulties - Mining difficulty tracking per algorithm
  7. Nodes - Geographic visualization of network nodes worldwide
  8. Supply - Supply economics, emission rate, and distribution metrics
  9. Transactions - Transaction volume and fee analytics
  10. Taproot - Network upgrade activation monitoring
  11. Downloads - DigiByte Core wallet download statistics (mainnet only)
  12. Roadmap - Development priorities and upcoming features (mainnet only)
  13. DigiDollar - Decentralized stablecoin concept and collateral system
  14. Oracles - DigiDollar oracle network status and price feeds (testnet only)
  15. DD Stats - DigiDollar network-wide statistics dashboard (testnet only)

🌐 Network Support

  • Mainnet: Full production network with all features
  • Testnet: Dedicated testnet support at /testnet/* routes
  • Network Switching: Easy toggle between networks via header navigation
  • Separate WebSocket: Independent real-time connections per network

🎨 Modern UI/UX

  • Material-UI v5 components with DigiByte branding
  • Responsive design optimized for mobile and desktop
  • Interactive D3.js and Chart.js visualizations
  • Dark theme with gradient backgrounds
  • Real-time data updates without page refresh

πŸ” SEO & Social Sharing

  • Comprehensive Open Graph meta tags for social previews
  • Twitter Card integration with large image previews
  • JSON-LD structured data for search engines
  • XML sitemap with all pages (mainnet and testnet)
  • robots.txt optimized for search engines and AI crawlers

Prerequisites

  • Node.js v14.x or higher (tested with v21.7.2)
  • DigiByte Node with RPC enabled (digibyte-core)
  • dgbstats-server backend (repository)

Installation

1. Install Node.js (macOS with Homebrew)

# Install Homebrew if not already installed
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# Install Node.js
brew update
brew install node

# Verify installation
node -v
npm -v

# Optional: Install specific Node version
sudo npm install -g n
sudo n install 21.7.2
sudo n use 21.7.2

2. Clone Repositories

# Clone frontend and backend
git clone https://github.com/JaredTate/dgbstats.git
git clone https://github.com/JaredTate/dgbstats-server.git

# Install dependencies
cd dgbstats
npm install

Configuration

1. DigiByte Node Setup

Edit your digibyte.conf file:

# RPC Configuration
rpcuser=your_username
rpcpassword=your_password
server=1
txindex=1
debug=1

# Performance Settings
rpcworkqueue=64
rpcthreads=8
maxconnections=128

# Network Settings
dandelion=0

# Block Notifications (optional)
blocknotify=/path/to/dgbstats-server/blocknotify.sh %s

2. Backend Server Configuration

Update credentials in dgbstats-server/server.js:

const rpcUser = 'your_username';
const rpcPassword = 'your_password';
const rpcUrl = 'http://127.0.0.1:14022';

3. Frontend Configuration

The frontend configuration is in src/config.js (currently hardcoded to development):

const config = {
  development: {
    apiBaseUrl: 'http://localhost:5001',
    wsBaseUrl: 'ws://localhost:5002'
  },
  production: {
    apiBaseUrl: 'https://digibyte.io',
    wsBaseUrl: 'wss://digibyte.io/ws'
  }
};
const env = 'development'; // Currently hardcoded
export default config[env];

Network-specific configuration (mainnet/testnet) is managed by src/context/NetworkContext.js:

  • Mainnet WebSocket: port 5002
  • Testnet WebSocket: port 5003

Running the Application

Start Backend Server

cd dgbstats-server
sudo npm start
# Server runs on port 5001 (API) and 5002 (WebSocket)

Start Frontend Application

cd dgbstats
npm start
# Application opens at http://localhost:3005

Development

Project Structure

dgbstats/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ pages/          # Page components (15 pages)
β”‚   β”œβ”€β”€ components/     # Reusable components (Header, Footer, Layouts)
β”‚   β”œβ”€β”€ context/        # React Context providers (NetworkContext)
β”‚   β”œβ”€β”€ hooks/          # Custom hooks (5 hooks in useNetworkData.js)
β”‚   β”œβ”€β”€ tests/          # Test suites (unit, integration, mocks)
β”‚   β”œβ”€β”€ config.js       # API configuration
β”‚   β”œβ”€β”€ utils.js        # Utility functions
β”‚   └── App.js          # Main application with routing
β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ og-images/      # Open Graph preview images
β”‚   β”œβ”€β”€ sitemap.xml     # XML sitemap
β”‚   β”œβ”€β”€ robots.txt      # Crawler rules
β”‚   └── index.html      # HTML template with meta tags
β”œβ”€β”€ e2e/                # Playwright E2E tests (21 specs)
└── package.json        # Dependencies

Available Scripts

npm start              # Start development server
npm run build          # Create production build
npm test               # Run tests in watch mode
npm run test:run       # Run tests once
npm run test:coverage  # Generate coverage report
npm run test:e2e       # Run end-to-end tests
npm run test:all       # Run all test suites

Testing

Comprehensive Test Coverage

The project maintains 95%+ code coverage with:

  • 214 Unit Tests - Component and function testing
  • 1,112 E2E Tests - Cross-browser integration testing
  • 7 Browser Engines - Chrome, Firefox, Safari, Edge, Mobile Chrome, Mobile Safari

Test Features

  • βœ… WebSocket mocking for real-time data
  • βœ… D3.js and Chart.js visualization testing
  • βœ… WCAG accessibility compliance
  • βœ… Performance benchmarking
  • βœ… Mobile responsiveness testing
  • βœ… Cross-browser compatibility

Running Tests

# Unit & Integration Tests (Vitest)
npm test                 # Watch mode
npm run test:run         # Single run
npm run test:coverage    # Coverage report
npm run test:ui          # Vitest UI

# End-to-End Tests (Playwright)
npm run test:e2e         # All browsers
npm run test:e2e:ui      # Playwright UI

# Combined Testing
npm run test:all         # All tests
npm run test:all:clean   # Tests + cleanup

Performance

Optimization Features

  • React.memo for component memoization
  • useMemo/useCallback for expensive operations
  • WebSocket batching for real-time updates
  • Virtual scrolling for large datasets
  • Responsive charts with mobile optimizations
  • Code splitting for faster initial load

Lighthouse Scores

  • Performance: 90+
  • Accessibility: 95+
  • Best Practices: 100
  • SEO: 90+

Browser Support

  • Chrome (latest 2 versions)
  • Firefox (latest 2 versions)
  • Safari (latest 2 versions)
  • Edge (latest 2 versions)
  • Mobile Chrome
  • Mobile Safari

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit changes (git commit -m 'Add amazing feature')
  4. Push to branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Guidelines

  • Follow existing code patterns and styling
  • Maintain 95%+ test coverage
  • Test on mobile and desktop viewports
  • Ensure WCAG 2.1 AA accessibility compliance
  • Update documentation for new features

Recent Updates

  • Full Testnet Support: Complete testnet implementation with dedicated WebSocket, routing, and peer tracking
  • Deployment Info: Updated to use getdeploymentinfo RPC for softfork status (replaces deprecated softforks field)
  • SEO Enhancements: Added Open Graph images, sitemap, and AI crawler support
  • DigiDollar Page: New page explaining the decentralized stablecoin concept
  • TAP Route Activation: Successfully activated and buried - UI elements removed
  • Enhanced Testing: Comprehensive test suite with 95%+ coverage
  • Performance Improvements: Optimized chart rendering and WebSocket handling
  • Mobile Optimization: Improved responsive design for all screen sizes

Documentation

License

This project is open-source and available under the MIT License.

Support

For issues, feature requests, or questions:

  • Open an issue on GitHub
  • Contact the development team

Credits

Developed by the DigiByte community for real-time blockchain analytics and monitoring.

About

DigiByte Stats front end site.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages