Skip to content

gevans/expedition

Repository files navigation

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

About

Expedition is a Ruby implementation of the cgminer client protocol. It allows you to write programs that interact with cgminer and cgminer-compatible software.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages