Class: Avalon::Bitcoind

Inherits:
Object
  • Object
show all
Defined in:
lib/avalon/bitcoind.rb

Overview

Block contains details about block found by the pool

Class Method Summary collapse

Class Method Details

.configObject



17
18
19
# File 'lib/avalon/bitcoind.rb', line 17

def config
  Avalon::Config[:bitcoind] || {}
end

.method_missing(*args) ⇒ Object



11
12
13
14
15
# File 'lib/avalon/bitcoind.rb', line 11

def method_missing *args
  rpc = "bitcoind -rpcuser=#{config[:rpcuser]} -rpcpassword=#{config[:rpcpassword]}"
  result = `ssh #{config[:ip]} "#{rpc} #{args.join(' ')}"`
  JSON.parse(result) unless result.empty?
end