Skip to content

A lightweight Rust app that displays real-time crypto prices on Dot devices

License

Notifications You must be signed in to change notification settings

Linus-Shyu/dot-crypto-ticker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

17 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“± Dot Crypto Ticker

A lightweight Rust application that displays real-time cryptocurrency prices on your Dot device

GitHub stars GitHub forks GitHub issues License

✨ Features

  • πŸͺ™ Multi-Crypto Support: Bitcoin (BTC), Ethereum (ETH), and Tether (USDT)
  • πŸ“± Optimized Display: Mini mode designed specifically for Dot device screens
  • πŸ“Š Real-time Updates: Live 24-hour price change indicators with trend arrows
  • ⚑ Configurable: Customizable refresh intervals (default: 10 minutes)
  • πŸ”’ Secure: Environment-based configuration for API keys
  • 🌐 Reliable: Uses Binance API for accurate, real-time data
  • πŸ”„ 24/7 Running: Background service support for continuous operation

πŸš€ Quick Start

Prerequisites

  • Rust 1.70+ installed
  • Dot device with Text API content enabled
  • Dot API key and device ID

Installation

  1. Clone the repository:
git clone https://github.com/Linus-Shyu/dot-crypto-ticker.git
cd dot-crypto-ticker
  1. Install dependencies:
cargo build --release
  1. Configure your environment:
cp env.example .env
  1. Edit .env with your Dot device credentials:
DOT_API_KEY=your_dot_api_key_here
DOT_DEVICE_ID=your_device_serial_number_here
DOT_TITLE=Crypto Prices
  1. Run the application:
cargo run

πŸ“± Display Format

The application displays cryptocurrency prices in a compact, easy-to-read format:

BTC $111,266.93 β†—+2.44%
ETH $4,039.08 β†—+1.23%
USDT $0.9997 β†—+0.01%
  • Price formatting: Includes thousand separators for large numbers
  • Change indicators: β†— for gains, β†˜ for losses
  • Percentage changes: Shows 24-hour price change percentage

βš™οΈ Configuration

Environment Variables

Variable Description Required Default
DOT_API_KEY Your Dot API key from the Dot app βœ… Yes -
DOT_DEVICE_ID Your Dot device serial number βœ… Yes -
DOT_TITLE Display title on Dot device ❌ No "Crypto Prices"

Command Line Options

Option Description Default Example
--interval-secs Update interval in seconds 600 (10 min) --interval-secs 300

Examples

# Run with default settings (10-minute updates)
cargo run

# Run with 5-minute updates
cargo run -- --interval-secs 300

# Run with 1-minute updates (for testing)
cargo run -- --interval-secs 60

πŸ”§ Setup Instructions

1. Get Your Dot API Credentials

  1. Open the Dot App on your phone
  2. Go to Content Studio
  3. Add "Text API content" to your device
  4. Note your API Key and Device Serial Number

2. Configure the Application

  1. Copy env.example to .env
  2. Fill in your actual API credentials
  3. Optionally customize the display title

3. Run the Application

cargo run

The application will start fetching prices and displaying them on your Dot device every 10 minutes.

πŸ”„ 24/7 Background Running

For continuous operation, set up the application to run as a background service on macOS.

Setup Background Service

  1. Build the release version:
cargo build --release
  1. Create LaunchAgent configuration:
# Create LaunchAgents directory if it doesn't exist
mkdir -p ~/Library/LaunchAgents

# Copy the provided plist file to LaunchAgents
cp com.username.dot-crypto-ticker.plist ~/Library/LaunchAgents/
  1. Edit the plist file with your actual username and paths

  2. Load and start the service:

# Load the service
launchctl load ~/Library/LaunchAgents/com.username.dot-crypto-ticker.plist

# Start the service
launchctl start com.username.dot-crypto-ticker

Service Management

Command Description
launchctl list | grep dot-crypto Check service status
launchctl start com.username.dot-crypto-ticker Start the service
launchctl stop com.username.dot-crypto-ticker Stop the service
launchctl unload ~/Library/LaunchAgents/com.username.dot-crypto-ticker.plist Unload service completely

Logs

  • Normal logs: crypto-ticker.log
  • Error logs: crypto-ticker-error.log
# View real-time logs
tail -f crypto-ticker.log

# View error logs
tail -f crypto-ticker-error.log

Features

  • βœ… Auto-start: Starts automatically on system boot
  • βœ… Auto-restart: Automatically restarts if the application crashes
  • βœ… Background: Runs in the background without terminal window
  • βœ… Logging: Comprehensive logging for monitoring and debugging
  • βœ… System Integration: Uses macOS native service management

πŸ› οΈ Development

Building

# Debug build
cargo build

# Release build (optimized)
cargo build --release

Running Tests

cargo test

Debug Logging

RUST_LOG=debug cargo run

πŸ“‹ Requirements

  • Rust: 1.70 or later
  • Internet: Required for API calls
  • Dot Device: With Text API content enabled
  • Memory: ~8MB RAM usage
  • Storage: ~2MB disk space

πŸ› Troubleshooting

Common Issues

Issue Solution
Device has no text API content Add "Text API content" in Dot App β†’ Content Studio
API key request too frequent Increase --interval-secs (minimum: 60 seconds)
Failed to fetch from Binance Check internet connection and API availability
Missing DOT_API_KEY Ensure .env file exists with correct API key

Getting Help

🀝 Contributing

Contributions are welcome! Here's how you can help:

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

Development Guidelines

  • Follow Rust naming conventions
  • Add tests for new features
  • Update documentation as needed
  • Keep the code clean and readable

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • Dot for the amazing device and API
  • Binance for reliable cryptocurrency data
  • Rust community for excellent tooling

πŸ“ˆ Changelog

v1.0.0 (2025-01-20)

  • πŸŽ‰ Initial stable release
  • ✨ Multi-cryptocurrency support (BTC, ETH, USDT)
  • πŸ“± Optimized Mini mode for Dot device screens
  • πŸ”„ 24/7 background running with LaunchAgent
  • πŸ“Š Real-time price change indicators
  • πŸ”’ Secure environment-based configuration
  • πŸ“ Comprehensive documentation and setup guides

πŸ“ˆ Roadmap

  • Support for more cryptocurrencies
  • Custom price alerts
  • Historical price charts
  • Multiple Dot device support
  • Web dashboard for configuration

Made with ❀️ for the Dot community

About

A lightweight Rust app that displays real-time crypto prices on Dot devices

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages