PeakeCoin Bots - dashboard.py


Hypothetically

🧠 Terminal Control Tower: Running Hive Bots Like a Pro

Let me paint the picture real quick — you’ve got five, maybe ten bots, each trading different tokens on Hive Engine. One’s flipping SWAP.LTC, another’s scalping SWAP.ETH, maybe there’s a DOGE one throwing hands with the meme market. All doing their thing.

But what’s not working?
You.
You’re stuck opening terminal windows like a server DJ. CTRL+TAB fatigue. Zero visibility. One crashes and you don’t even notice for an hour.

So I fixed it. Enter dashboard.py. It’s the no-BS control panel for managing and monitoring all your Hive bots in one terminal window.


đŸŽ›ïž What It Does

Here’s the deal:

  • Runs each bot script in its own threaded subprocess
  • Streams their live output with color-coded tags
  • Keeps the whole thing clean, readable, and press-CTRL+C-to-nuke friendly

It’s like tmux, but baked into Python — and without the overhead.


đŸ§± Core Structure

Here’s the bot list:

BOT_SCRIPTS = [
    ("LTC Bot", "uni_ltc.py"),
    ("ETH Bot", "uni_eth.py"),
    ("BTC Bot", "uni_btc.py"),
    ("DOGE Bot", "uni_doge.py"),
]

Each one is a tuple: friendly name, script name.

Color coding for visibility:

BOT_COLORS = {
    "LTC Bot": "\033[96m",
    "ETH Bot": "\033[92m",
    "BTC Bot": "\033[93m",
    "DOGE Bot": "\033[95m",
}
RESET_COLOR = "\033[0m"

🔄 How It Works

Here’s the heart of it:

def run_bot(name, script):
    color = BOT_COLORS.get(name, "")
    print(f"{color}[DASHBOARD] Launching {name} ({script})...{RESET_COLOR}")
    proc = subprocess.Popen(
        ["python", script],
        stdout=subprocess.PIPE,
        stderr=subprocess.STDOUT,
        text=True
    )
    while True:
        line = proc.stdout.readline()
        if not line:
            break
        print(f"{color}[{name}] {line.strip()}{RESET_COLOR}")

And we launch everything in threads:

for name, script in BOT_SCRIPTS:
    t = threading.Thread(target=run_bot, args=(name, script), daemon=True)
    t.start()
    threads.append(t)

Daemon threads keep the show running. No blocking. One dies? The rest live.


🧠 Why It Works

  • No more wondering if a bot is running — you see it live
  • If one bot fails, the dashboard doesn’t
  • You get color-coded logs in real time
  • You scale it by adding a tuple. Done.

đŸ§Ș Full dashboard.py

import subprocess
import threading
import time

BOT_SCRIPTS = [
    ("LTC Bot", "uni_ltc.py"),
    ("ETH Bot", "uni_eth.py"),
    ("BTC Bot", "uni_btc.py"),
    ("DOGE Bot", "uni_doge.py"),
]

BOT_COLORS = {
    "LTC Bot": "\033[96m",
    "ETH Bot": "\033[92m",
    "BTC Bot": "\033[93m",
    "DOGE Bot": "\033[95m",
}
RESET_COLOR = "\033[0m"

def run_bot(name, script):
    color = BOT_COLORS.get(name, "")
    print(f"{color}[DASHBOARD] Launching {name} ({script})...{RESET_COLOR}")
    proc = subprocess.Popen(
        ["python", script],
        stdout=subprocess.PIPE,
        stderr=subprocess.STDOUT,
        text=True
    )
    while True:
        line = proc.stdout.readline()
        if not line:
            break
        print(f"{color}[{name}] {line.strip()}{RESET_COLOR}")

def main():
    threads = []
    for name, script in BOT_SCRIPTS:
        t = threading.Thread(target=run_bot, args=(name, script), daemon=True)
        t.start()
        threads.append(t)
    print("[DASHBOARD] Monitoring bots. Press Ctrl+C to exit.")
    try:
        while True:
            time.sleep(2)
    except KeyboardInterrupt:
        print("[DASHBOARD] Exiting...")

if __name__ == "__main__":
    main()

🏁 Final Thoughts

This little dashboard gave me peace of mind. I went from chasing bot logs across tabs to having one central command center that tells me what’s happening in real time.

If you're running multiple bots for multiple Hive Engine tokens — and you’re doing it without this kind of visibility — you're flying blind.

This is free.
This is clean.
This is how I do it.



0
0
0.000
2 comments
avatar

Congratulations @peakecoin! You have completed the following achievement on the Hive blockchain And have been rewarded with New badge(s)

You received more than 400 upvotes.
Your next target is to reach 500 upvotes.

You can view your badges on your board and compare yourself to others in the Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

0
0
0.000