I'd like to access local bitcoin node from ruby by using RPC client. The following is my code, and it returns the next code. Could you tell me how to call Bitcoin client on ruby?
#console
NoMethodError (undefined method `getblockcount' for #<BitcoinRpc:0x007fe4e2577050>):
#product_controller.rb
require 'net/http'
require 'uri'
require 'json'
class BitcoinRpc
def initialize(service_url)
@uri = URI.parse(service_url)
end
end
class ProductsController < ApplicationController
require 'openassets'
require 'bitcoin'
include Bitcoin::Util
include Bitcoin::Builder
h = BitcoinRpc.new('http://'rpcuser':'rpcpassword'@localhost:8332')
puts(h.getblockcount)
....
require 'bitcoin'
, what library are you referencing?