Class: Utxoracle::Node
- Defined in:
- lib/utxoracle/providers/node.rb
Instance Method Summary collapse
- #getblock(block_hash, verbosity = 2) ⇒ Object
- #getblockcount ⇒ Object
- #getblockhash(height) ⇒ Object
- #getblockheader(block_hash, verbose = true) ⇒ Object
-
#initialize(rpcuser, rpcpassword, ip, port) ⇒ Node
constructor
A new instance of Node.
Methods inherited from Provider
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 |
#getblockcount ⇒ Object
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 |