Liking cljdoc? Tell your friends :D

obelisk-ui

A clojure wrapper for the api calls that the obelisk miner ui makes.

Installation

Include the following in your list of dependencies:

[obelisk-ui "0.0.1"]

Usage

The entirety of the api is in the api namespace:

(require '[obelisk-ui.api :as api])

First step is to get a cookie from the ui:

(def opts {:server-address "http://<your-obelisk-address>"
           :basic-auth ["username" "password"]}) ;; This key is optional

(def cookie (api/login "admin" "admin" opts))

(def opts (assoc opts :cookie cookie))

After getting a cookie you can get your outputs:

(api/curr-user opts)
; => {:username "admin", :deviceModel "SC1|DCR1"

(api/versions opts)
;=> {:firmwareVersion "SC1 v1.2.0", :cgminerVersion "4.10.0"

(keys (api/dashboard opts))
;=> (:diagnostics :hashrateData :systemInfo :poolStatus :hashboardStatus)

(api/pools opts)
;=>({:password "my-secure-pw", :url "pool-url", :worker "my-worker"

(api/mining opts)
;=> {:disableGeneticAlgo false, :rebootMinHashrate 150, :rebootIntervalMins 0, :maxHotChipTempC 105, :optimizationMode 2, :minFanSpeedPercent 10}

(api/system opts)
;=> {:timezone "Europe/London"

(api/network opts)
;=> {:macAddress "my-mac-address", :ipAddress "192.168.1.2", :subnetMask "255.255.255.0", :hostname "Obelisk", :dnsServer "8.8.8.8", :gateway "192.168.1.1", :dhcpEnabled false}

(count (api/diagnostics opts))
;=> 10315

License

Copyright © 2019 Oliver Marshall

Distributed under the MIT License.

Can you improve this documentation?Edit on GitHub

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close