Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't perform any Action #5

Open
msantosh-rails opened this issue May 30, 2016 · 7 comments
Open

Can't perform any Action #5

msantosh-rails opened this issue May 30, 2016 · 7 comments

Comments

@msantosh-rails
Copy link

Hi,

 While I perform any action, getting below error. Please help me.

757: unexpected token at '{"jsonrpc":"2.0","error":{"code":-32600,"message":"EOF"}}

Thanks,
Santosh

@alexhanh
Copy link
Contributor

alexhanh commented Jun 23, 2016

+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

@alexhanh
Copy link
Contributor

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

@msantosh-rails
Copy link
Author

Thank You alexhanh, It's working

@alexhanh
Copy link
Contributor

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

@tymat
Copy link
Member

tymat commented Jun 27, 2016

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

Can you submit a pull request?

@alexhanh
Copy link
Contributor

#6

@ericsaupe
Copy link

ericsaupe commented Feb 4, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants