-
-
Notifications
You must be signed in to change notification settings - Fork 189
feat: Mining video pipeline - RustChain x BoTTube integration #1920
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Scottcjn
merged 2 commits into
Scottcjn:main
from
yuzengbaao:feat/mining-video-pipeline
Mar 28, 2026
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,154 @@ | ||
| # RustChain × BoTTube Mining Video Pipeline | ||
|
|
||
| Automated pipeline that monitors RustChain miner attestations, generates animated mining visualization videos, and publishes them to BoTTube. | ||
|
|
||
| ## Architecture | ||
|
|
||
| ``` | ||
| RustChain API (/api/miners, /epoch) | ||
| │ | ||
| ▼ | ||
| ┌─────────────────┐ | ||
| │ Event Listener │ ← Polls miners + epoch data | ||
| └────────┬────────┘ | ||
| │ | ||
| ▼ | ||
| ┌─────────────────┐ | ||
| │ Prompt Generator │ ← Maps miner metadata to visual style | ||
| │ - Device arch │ | ||
| │ - Hardware type │ | ||
| │ - Multiplier │ | ||
| │ - Epoch stats │ | ||
| └────────┬────────┘ | ||
| │ | ||
| ▼ | ||
| ┌─────────────────┐ | ||
| │ Video Generator │ ← PIL frame rendering + ffmpeg encoding | ||
| │ - Per-arch style│ | ||
| │ - Stats overlay │ | ||
| │ - Hash stream │ | ||
| │ - Particles │ | ||
| └────────┬────────┘ | ||
| │ | ||
| ▼ | ||
| ┌─────────────────┐ | ||
| │ BoTTube Upload │ ← Playwright browser automation | ||
| │ - Title/desc │ | ||
| │ - Tags │ | ||
| │ - Category │ | ||
| └─────────────────┘ | ||
| ``` | ||
|
|
||
| ## Setup | ||
|
|
||
| ```bash | ||
| # Install dependencies | ||
| pip install requests pillow playwright | ||
| playwright install chromium | ||
|
|
||
| # Set BoTTube auth (export cookies from browser) | ||
| # Save to: /root/.openclaw/workspace/auth/bottube_state.json | ||
|
|
||
| # Run pipeline | ||
| python mining_video_pipeline.py --full --count 10 | ||
| ``` | ||
|
|
||
| ## Usage | ||
|
|
||
| ```bash | ||
| # List active miners | ||
| python mining_video_pipeline.py --list | ||
|
|
||
| # Generate videos from live data | ||
| python mining_video_pipeline.py --generate --count 10 | ||
|
|
||
| # Upload generated videos | ||
| python mining_video_pipeline.py --upload | ||
|
|
||
| # Full pipeline | ||
| python mining_video_pipeline.py --full --count 10 | ||
|
|
||
| # Generate for specific miner | ||
| python mining_video_pipeline.py --miner "power8-s824-sophia" | ||
| ``` | ||
|
|
||
| ## Video Features | ||
|
|
||
| ### Architecture-Specific Visual Styles | ||
|
|
||
| | Hardware Type | Color Theme | Device Icon | | ||
| |--------------|-------------|-------------| | ||
| | PowerPC (Vintage) | Bronze/Gold | Server rack with blinking LEDs | | ||
| | Apple Silicon | Silver/Blue | Chip with pulse effect | | ||
| | x86-64 (Modern) | Green/Neon | CPU with pins | | ||
| | Unknown/Other | Purple/Violet | Generic device | | ||
|
|
||
| ### On-Screen Stats Overlay | ||
|
|
||
| Every video includes real-time mining data: | ||
| - Miner ID and architecture | ||
| - Hardware type and antiquity multiplier | ||
| - Current epoch, slot, and epoch pot | ||
| - Total RTC supply | ||
| - Last attestation timestamp | ||
|
|
||
| ### Visual Effects | ||
|
|
||
| - Floating particle system (per-architecture color) | ||
| - Animated hash stream visualization | ||
| - Progress bars for attestation flow | ||
| - Device icon animation (bobbing, pulsing, LED blinking) | ||
| - Glow effects on branding text | ||
|
|
||
| ## Demo Videos | ||
|
|
||
| 12 videos generated and uploaded to BoTTube across 4 architecture types: | ||
|
|
||
| ### PowerPC (Vintage) | ||
| - https://bottube.ai/watch/9L4kkzKy-G9 | ||
|
|
||
| ### Apple Silicon | ||
| - https://bottube.ai/watch/FFFKydmQ-xt | ||
| - https://bottube.ai/watch/_5-9mdTJC-d | ||
|
|
||
| ### x86-64 (Modern) | ||
| - https://bottube.ai/watch/W9NecljXVat | ||
| - https://bottube.ai/watch/rbhkUDVQxk4 | ||
| - https://bottube.ai/watch/Xx1JtmMwfec | ||
| - https://bottube.ai/watch/cxgqL7veOUw | ||
| - https://bottube.ai/watch/ZeVIhTrWmq4 | ||
| - https://bottube.ai/watch/47asNJEK4pZ | ||
|
|
||
| ### Unknown/Other | ||
| - https://bottube.ai/watch/Xv0KHKqlXtH | ||
| - https://bottube.ai/watch/DTxm-SFZ5ZZ | ||
| - https://bottube.ai/watch/jDc_6tz4Cwq | ||
|
|
||
| ## Technical Details | ||
|
|
||
| - **Video backend**: PIL (Python Imaging Library) frame-by-frame rendering → ffmpeg H.264 encoding | ||
| - **Resolution**: 1280×720 (720p) | ||
| - **Duration**: 8 seconds per video | ||
| - **Frame rate**: 15 FPS | ||
| - **File size**: ~240-280 KB per video | ||
| - **Upload**: Playwright browser automation with cookie-based auth | ||
|
|
||
| ## Configuration | ||
|
|
||
| Edit constants at the top of `mining_video_pipeline.py`: | ||
|
|
||
| ```python | ||
| RUSTCHAIN_API = "https://50.28.86.131" | ||
| BOTTUBE_AUTH_FILE = "/path/to/auth/bottube_state.json" | ||
| OUTPUT_DIR = "/tmp/rustchain_videos" | ||
| WIDTH, HEIGHT = 1280, 720 | ||
| FPS = 15 | ||
| ``` | ||
|
|
||
| ## Dependencies | ||
|
|
||
| - Python 3.10+ | ||
| - `requests` — API calls | ||
| - `Pillow` — Image generation | ||
| - `playwright` — Browser automation for BoTTube upload | ||
| - `ffmpeg` — Video encoding (system package) | ||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Markdown table under “Architecture-Specific Visual Styles” is malformed (rows start with
||), which renders incorrectly in most Markdown viewers. Update it to standard table syntax with single leading/trailing pipes.