Skip to content

Instantly share code, notes, and snippets.

@tomibennett
Created August 12, 2017 15:29
Show Gist options
  • Save tomibennett/ee01f670f29217457cc875ebab5cb6d0 to your computer and use it in GitHub Desktop.
Save tomibennett/ee01f670f29217457cc875ebab5cb6d0 to your computer and use it in GitHub Desktop.
bad credentials but still having a client
irb(main):001:0> require 'ipfs-api'
=> true
irb(main):002:0> client = Ipfs::Client.new host: "192.168.1.42", port: 1337, base_path: '/api/v1' # neither of these options are correct
=> #<Ipfs::Client:0x007fc514afd350 @request=#<Ipfs::Request:0x007fc514afd328 @host="192.168.1.42", @port=1337, @base_path="/api/v1">>
irb(main):007:0> client.id # looking for the api for a very, very, very, long time...
^CIRB::Abort: abort then interrupt!
from /Users/tom/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/http-2.2.2/lib/http/timeout/null.rb:20:in `initialize'
from /Users/tom/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/http-2.2.2/lib/http/timeout/null.rb:20:in `open'
from /Users/tom/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/http-2.2.2/lib/http/timeout/null.rb:20:in `connect'
from /Users/tom/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/http-2.2.2/lib/http/connection.rb:41:in `initialize'
from /Users/tom/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/http-2.2.2/lib/http/client.rb:60:in `new'
from /Users/tom/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/http-2.2.2/lib/http/client.rb:60:in `perform'
from /Users/tom/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/http-2.2.2/lib/http/client.rb:41:in `request'
from /Users/tom/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/http-2.2.2/lib/http/chainable.rb:75:in `request'
from /Users/tom/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/ruby-ipfs-api-0.1.0/lib/request.rb:19:in `call_api'
from /Users/tom/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/ruby-ipfs-api-0.1.0/lib/ipfs-api.rb:27:in `execute'
from /Users/tom/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/ruby-ipfs-api-0.1.0/lib/ipfs-api.rb:13:in `id'
from (irb):7
from /Users/tom/.rbenv/versions/2.4.0/bin/irb:11:in `<main>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment