These are chat archives for DigixGlobal/ethereum-ruby

23rd
Feb 2016
5chdn
@5chdn
Feb 23 2016 09:35
hi @tymat, could you give us an example how to use the ipc client?
 ~ $ irb
irb(main):001:0> require 'ethereum'
=> true
irb(main):002:0> client = Ethereum::IpcClient.new("#{ENV['HOME']}/.ethereum/geth.ipc")
=> #<Ethereum::IpcClient:0x00000001f41248 @ipcpath="/home/user/.ethereum/geth.ipc", @id=1, @batch=[]>
irb(main):003:0> client.eth_coinbase
NoMethodError: undefined method `eth_coinbase' for #<Ethereum::IpcClient:0x00000001f41248>
Did you mean?  coinbase
  from (irb):4
  from /usr/bin/irb:11:in `<main>'
irb(main):004:0> client.coinbase
=> {"jsonrpc"=>"2.0", "error"=>{"code"=>-32600, "message"=>"EOF"}}
irb(main):005:0> client.eth_accounts
NoMethodError: undefined method `eth_accounts' for #<Ethereum::IpcClient:0x00000001f41248>
Did you mean?  new_account
  from (irb):5
  from /usr/bin/irb:11:in `<main>'
irb(main):006:0> client.new_account
=> {"jsonrpc"=>"2.0", "error"=>{"code"=>-32600, "message"=>"EOF"}}
irb(main):007:0> client.account
NoMethodError: undefined method `account' for #<Ethereum::IpcClient:0x00000001f41248>
Did you mean?  accounts
  from (irb):8
  from /usr/bin/irb:11:in `<main>'
irb(main):008:0> client.accounts
=> {"jsonrpc"=>"2.0", "error"=>{"code"=>-32600, "message"=>"EOF"}}
irb(main):009:0> client.accounts 0
=> {"jsonrpc"=>"2.0", "error"=>{"code"=>-32600, "message"=>"EOF"}}