Thanks to visit codestin.com
Credit goes to github.com

Skip to content

TOwInOK/matroskin

Repository files navigation

matroskin

Library for interacting with WhatsMiner ASIC miners.

⚠️ Currently under development ⚠️


Crates.io MIT licensed Apache licensed

Overview

matroskin is an actor-tokio based library for creating tools for ASIC infrastructure. It provides:

  • Easy to use Actor system
  • Build in commands
  • Easy scalable architecture

🚧 Development Status

Marks:

  • Ready to use: ✅
  • Unstable (do not use it in any ways, only at your own risk): ⚠️
  • without marks: not tested, only at your own risk

list of commands:

Example

[dependencies]
tokio = { version = "1.48.0", features = ["full"] }
matroskin = { version = "0" }
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter", "fmt"] }

Then, on your main.rs:

use tracing::Level;
use matroskin::{
    account::Account,
    actor::Actor,
    command::{Command, set_miner_fastboot::SetMinerFastboot},
    password::Password,
};

#[tokio::main]
async fn main() {
    // Init logger
    use tracing_subscriber::FmtSubscriber;
    tracing::subscriber::set_global_default(
        FmtSubscriber::builder()
            .compact()
            .with_max_level(level)
            .without_time()
            .finish(),
    ).expect("Fail to set global default subscriber");

    // Create connection with ASIC
    let actor = Actor::new("10.10.10.10:4433", Account::Super, Password::Super).await.expect("fail to establish connection");

    // Create command
    let command = GetDeviceInfo::default();
    // Run command
    //
    // - First variant (actor execute cmd)
    // - Second variant (run cmd using actor)
    let response = actor.send(&command).await.expect("fail to execute"); // or  let response = cmd.execute(&actor).await.unwrap();

    println!("All Device Info: {:#?}", response);
    Ok(())

About

whatsminer api client lib

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE.md
MIT
LICENSE-MIT.md

Stars

Watchers

Forks

Languages