Initializing

Connect to the default RPC host at localhost:7076 and with a timeout of 500 seconds:

nanook = Nanook.new

To connect to another host instead:

nanook = Nanook.new("http://ip6-localhost.com:7076")

To give a specific timeout value:

Nanook.new(timeout: 600)
Nanook.new("http://ip6-localhost.com:7076", timeout: 600)
Namespace
Methods
A
B
I
K
N
W
Constants
VERSION = "1.0.0"
 
Class Public methods
new(uri=Nanook::Rpc::DEFAULT_URI, timeout:Nanook::Rpc::DEFAULT_TIMEOUT)

Arguments

  • uri - RPC host to connect to (default is “localhost:7076”)

  • timeout: - Connection timeout in number of seconds (default is 500)

Examples

Nanook.new # Connect to http://localhost:7076 with 500s timeout

Nanook.new(timeout: 600)
Nanook.new("http://ip6-localhost.com:7076", timeout: 600)
# File lib/nanook.rb, line 33
def initialize(uri=Nanook::Rpc::DEFAULT_URI, timeout:Nanook::Rpc::DEFAULT_TIMEOUT)
  @rpc = Nanook::Rpc.new(uri, timeout: timeout)
end
Instance Public methods
account(account=nil)

Returns a Nanook::Account instance.

nanook = Nanook.new

account = nanook.account
account = nanook.account("xrb_3e3j5tkog48pnny9dmfzj1r16pg8t1e76dz5tmac6iq689wyjfpi00000000")
# File lib/nanook.rb, line 44
def account(account=nil)
  Nanook::Account.new(@rpc, account)
end
block(block=nil)
# File lib/nanook.rb, line 48
def block(block=nil)
  Nanook::Block.new(@rpc, block)
end
inspect()
# File lib/nanook.rb, line 52
def inspect # :nodoc
  "#{self.class.name}(rpc: #{@rpc.inspect}, object_id: \"#{"0x00%x" % (object_id << 1)}\")"
end
key(key=nil)
# File lib/nanook.rb, line 56
def key(key=nil)
  Nanook::Key.new(@rpc, key)
end
node()
# File lib/nanook.rb, line 60
def node
  Nanook::Node.new(@rpc)
end
wallet(wallet=nil)
# File lib/nanook.rb, line 64
def wallet(wallet=nil)
  Nanook::Wallet.new(@rpc, wallet)
end
work_peers()
# File lib/nanook.rb, line 68
def work_peers
  Nanook::WorkPeer.new(@rpc)
end