Project

expedition

0.0
No commit activity in last 3 years
No release in over 3 years
Expedition is an implementation of the cgminer client protocol. It allows you to write programs that interact with cgminer and cgminer-compatible software.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

Expedition

Expedition is a gem for interacting with cgminer and cgminer-compatible APIs. The goal of this project is to offer Rubyists easier integration with the cgminer API “the Ruby way.”

tl;dr This gem lets you interact with cgminer’s API the way a Ruby hipster would want to.

Now for some fancy badges:

Gem Version Dependency Status Build Status Code Climate Coverage Status

Installation

Add this line to your application's Gemfile:

gem 'expedition'

And then execute:

$ bundle

Or install it yourself as:

$ gem install expedition

Usage

A client can be initialized with an optional host and port (defaulting to localhost, port 4028):

client = Expedition.new(host, port)

Querying is done by calling the method you wish to send:

response = client.pools
# => #<Expedition::Response ...>

response.body
# => [{"pool"=>0,
#  "url"=>"stratum+tcp://pool.example.com:3333",
#  "status"=>"alive"
#  ...}]

response.status
# => #<Expedition::Status
#  @code=7
#  @description="sgminer 4.1.153",
#  @executed_at=2014-05-13 17:51:53 -0700,
#  @message="1 Pool(s)",
#  @severity=:success>>

response.ok?
# => true

Supported API Methods

Expedition overrides #method_missing to allow sending any method to a running miner. For convenience and additional sugar, the following methods are implemented which offer parsed timestamps, and more consistent responses:

  • #devices - Detailed information about devices.
  • #metrics - Detailed statistics for all devices.
  • #pools - Pool information and statistics.

In need of another method? Open an issue.

Contributing

  1. Fork it (http://github.com/gevans/expedition/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request