Code Monkey home page Code Monkey logo

Comments (7)

alexhanh avatar alexhanh commented on July 29, 2024

+1 Facing the same error when using the IPC client. Works with HTTP.

Here's what the value of read is "{\"jsonrpc\":\"2.0\",\"id\":2,\"result\":\"0xe4a\"}\n{\"jsonrpc\":\"2.0\",\"error\":{\"code\":-32600,\"message\":\"EOF\"}}\n". So it seems to actually contain two JSON responses, and so JSON.parse(read) fails here https://github.com/DigixGlobal/ethereum-ruby/blob/master/lib/ethereum/ipc_client.rb#L32

from ethereum-ruby.

alexhanh avatar alexhanh commented on July 29, 2024

I believe the problem stems from using the close_write here https://github.com/DigixGlobal/ethereum-ruby/blob/master/lib/ethereum/ipc_client.rb#L29. Geth says:

I0625 11:21:05.501126 rpc/server.go:186] EOF
I0625 11:21:05.501410 rpc/notification.go:282] codec closed, stop subscriptions
I0625 11:21:05.501308 rpc/server.go:349] write unix /Users/alexhanh/EtherDev/data/geth.ipc->: use of closed network connection

Seems like Geth doesn't like closing of the connection. I was able to get it working using the following code:

socket = UNIXSocket.new(@ipcpath)
socket.puts(payload.to_json)
read = socket.gets
socket.close

from ethereum-ruby.

msantosh-rails avatar msantosh-rails commented on July 29, 2024

Thank You alexhanh, It's working

from ethereum-ruby.

alexhanh avatar alexhanh commented on July 29, 2024

Here's a working fork https://github.com/alexhanh/ethereum-ruby

  • Fixed the IPC
  • Refactored the client code
  • Removed batching as it was broken
  • Added missing RPC methods (including the management API)

I'm on OS X and I wonder if the Unix sockets work differently in Linux. Would appreciate if someone tests the fork on Linux.

Would also appreciate your input @tymat

from ethereum-ruby.

tymat avatar tymat commented on July 29, 2024

@alexhanh That looks good. Batching needs to be refactored to work with Homestead.

Can you submit a pull request?

from ethereum-ruby.

alexhanh avatar alexhanh commented on July 29, 2024

#6

from ethereum-ruby.

ericsaupe avatar ericsaupe commented on July 29, 2024

I'm still having this issue. Following the README for compiling contracts I get this error:

NoMethodError: undefined method `compile_solidity' for #<Ethereum::IpcClient:0x007fd1326271a8>
Did you mean?  eth_compile_solidity
	from /Users/ericsaupe/.rvm/gems/ruby-2.3.3@oasis/bundler/gems/ethereum-ruby-36c78cefda5f/lib/ethereum/initializer.rb:9:in `initialize'
	from (irb):2:in `new'
	from (irb):2
...

Running locally all specs are failing as well. Many due to the error listed above.

from ethereum-ruby.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.