Class: Utxoracle::Node

Inherits:
Provider show all
Defined in:
lib/utxoracle/providers/node.rb

Instance Method Summary collapse

Methods inherited from Provider

#init

Constructor Details

#initialize(rpcuser, rpcpassword, ip, port) ⇒ Node

Returns a new instance of Node.



6
7
8
# File 'lib/utxoracle/providers/node.rb', line 6

def initialize(rpcuser, rpcpassword, ip, port)
  @rpc = Cleanrpc::Rpc.new("http://#{rpcuser}:#{rpcpassword}@#{ip}:#{port}")
end

Instance Method Details

#getblock(block_hash, verbosity = 2) ⇒ Object



22
23
24
# File 'lib/utxoracle/providers/node.rb', line 22

def getblock(block_hash, verbosity = 2)
  @rpc.getblock(block_hash, verbosity)
end

#getblockcountObject



10
11
12
# File 'lib/utxoracle/providers/node.rb', line 10

def getblockcount
  @rpc.getblockcount
end

#getblockhash(height) ⇒ Object



14
15
16
# File 'lib/utxoracle/providers/node.rb', line 14

def getblockhash(height)
  @rpc.getblockhash(height)
end

#getblockheader(block_hash, verbose = true) ⇒ Object



18
19
20
# File 'lib/utxoracle/providers/node.rb', line 18

def getblockheader(block_hash, verbose = true)
  @rpc.getblockheader(block_hash, verbose)
end