Skip to main content

Build Status Maintainability Test Coverage PyPI version

🐲👸🔥🐉 Mother of Dragons 🐲👸🔥🐉

Be smart. Be mother. Be Mother of Dragons.

DragonMint/Innosilicon T1/T2/B29/B52/A9 management tool based on dragon-rest

Mom with dragons

Features

Mother of Dragons can:

  • Auto-detect new dragons on your local network and configure them: just plug in your miners and they're ready to go!
  • Scale easily to 1000s of miners using the gevent library
  • Collect metrics from dragons and forward them to statsd
  • Automatically update to the latest firmware version when new miners are added
  • Keep your dragons happy and healthy by rebooting them when they’re sick
  • Apply different pool configurations to different dragons based on their MAC address
  • Should work with both most DragonMint or Innosilicon branded miners
  • Free you up from having to manually manage your dragons so you can go vacation like a movie star 😎

How it works

When you run mother-of-dragons, it will start 3 separate closed loops:

  • Scan loop: scans the local network at a specified interval (main.scan_interval) looking for dragons. It checks for the dragons by making an HTTP request and checking the result. The scan only works if your local network allows traffic on port 80 to all the specified IPs, which you define with the main.local_network.network parameter.

    • When a new dragon is found, the dragon will be configured with the desired pool and autotune. If you specify a pool configuration with a MAC address, mother will assign the pool config with the matching address.

    • If auto_upgrade is set, dragons will be updated to the latest firmware version when added.

  • Metrics loop: fetches metrics from every known dragon according to main.statsd.interval and forwards those metrics to statsd provided you have configured main.statsd.host.

  • Health loop: checks each dragon according to the specified interval health_check_interval and may (optionally) reboot a dragon if:

    • The dragon has 1 or more devices (ASIC boards) marked as 'Dead'.

    • The dragon has 1 or more devices which have been below health_hashrate_minimum for at least health_hashrate_duration.

The tool itself can be run on a low-cost server, such as a Raspberry Pi or Intel NUC. If you intend to set up a Prometheus/Grafana dashboard for metrics, it's probably worthwhile to use a more powerful machine such as an Intel NUC with adequate storage.

It's recommended you use a mainline Linux distro, such as Debian, Ubuntu or CentOS.

Super Quickstart

$ pip install mother-of-dragons
$ mother-of-dragons --print-config-toml > config.toml
### Edit config.toml to your liking ###
$ mother-of-dragons --config=config.toml

Alternatively, using Docker:

$ docker run -it mother-of-dragons --print-config-toml
...

Configuration

See the default config.toml for details on configuration.

Usage

usage: mother-of-dragons [-h] [-c CONFIG] [--print-config-toml]
                         [--print-config-json]

Management tool for DragonMint/Innosilicon miners.

optional arguments:
  -h, --help            show this help message and exit
  -c CONFIG, --config CONFIG
                        Path to config file in either TOML or JSON format.
                        (default: config.toml)
  --print-config-toml   Print default config in TOML and exit (default: False)
  --print-config-json   Print default config in JSON and exit (default: False)

The script is meant to be run continuously within the same local network as your dragons. The script can be installed with Python's pip by running a pip install mother-of-dragons.

An example systemd unit might look like this (assuming the user mother-of-dragons exists):

[Unit]
Description=mother-of-dragons
After=network.target

[Service]
ExecStart=/usr/local/bin/mother-of-dragons \
  --config=config.toml
Restart=always
User=mother-of-dragons
Group=users

[Install]
WantedBy=multi-user.target

Sample Dashboard

One of the significant value-adds of this tool is the StatsD integration. It allows you to forward metrics to Prometheus/Grafana, DataDog, or another time series metrics and dashboarding tool.

Sample Grafana Dashboard

Tip Jar

  • BTC: 3EEAE1oKEMnmHGU5Qxibv9mBQyNnes8j8N

Metadata

Release files for mother-of-dragons 0.2.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mother-of-dragons 0.2.8
File Size Uploaded
mother-of-dragons-0.2.8.tar.gz 19.0 kB Details

Release files / mother-of-dragons-0.2.8.tar.gz

Download URL mother-of-dragons-0.2.8.tar.gz
Size 19.0 kB
Tags Source
SHA-256 checksum
How to use checksums
61eff5f4ff55c6c9b5d71e0d6e208bb356733c722d5e1a54de3c4d92ea9dd544
BLAKE2b-256 checksum
How to use checksums
e91f6236b9ead14ef77d7d4372c339ca9d1744b7d388509edc0942be038073ff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

Release history Release notifications | RSS feed

This release

0.2.8 This release

1 release file

0.2.7

1 release file

0.2.6

1 release file

0.2.5

1 release file

0.2.3

1 release file

0.2.2

1 release file

0.2.1

1 release file

0.2.0

1 release file

0.1.9

1 release file

0.1.8

1 release file

0.1.6

1 release file

0.1.5

1 release file

0.1.4

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

0.0.8

1 release file

0.0.7

1 release file

0.0.6

1 release file

0.0.5

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page