Comments (7)
+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.
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.
Thank You alexhanh, It's working
from ethereum-ruby.
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.
@alexhanh That looks good. Batching needs to be refactored to work with Homestead.
Can you submit a pull request?
from ethereum-ruby.
from ethereum-ruby.
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)
- can i connect geth remotely HOT 1
- undefined method `eventName' for #<Ethereum::Contract:0x007fa63617ab40>
- How to store JSON information on blockchain?
- new_account is not working
- Unanable to run solc compliers HOT 2
- Various Version with rubygem and github
- unknown error - Unanable to run solc compliers HOT 1
- New IpcClient from docker container
- eth_compileSolidity does not exist HOT 2
- int, int64, etc do not work
- JSON::ParserError: 776 HOT 5
- Events
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ethereum-ruby.