status-im / status-go

The Status module that consumes go-ethereum
https://status.im
Mozilla Public License 2.0
728 stars 246 forks source link

Switch from HTTP server to internal IPC #134

Closed 0xc1c4da closed 7 years ago

0xc1c4da commented 7 years ago

Now things are 'working', we can consider a switch to an internal IPC for the node on the device, this will fix the API unavailability on node restart on Android, improve battery life and secure the node from other apps on the device.

farazdagi commented 7 years ago

We already have IPC support, one just needs to pass two extra configuration variables:

{
    "IPCFile": "geth.ipc", # relative to DataDir
    "IPCEnabled": true, # false by default
}

Now, the only thing I can add, is HTTPEnabled flag, so that HTTP server is not started (right now IPC or WS are started alongside the running HTTP server)?

0xc1c4da commented 7 years ago

oh neat!

farazdagi commented 7 years ago

Btw, we do not even need HTTPEnabled flag, since if you pass empty string as HTTPHost parameter, HTTP RPC server will not be started.

So, it seems we have everything necessary (on status-go side) to switch to IPC.

0xc1c4da commented 7 years ago

So we need to see how to deal with Unix Domain Sockets in Java and Objective-C.

Going to leave this issue open here and compile list for now https://github.com/kohlschutter/junixsocket https://github.com/jnr/jnr-unixsocket http://stackoverflow.com/questions/22220743/how-to-use-a-local-domain-socket-in-objective-c https://github.com/coffellas-cto/GDUnixSocket

farazdagi commented 7 years ago

This issue will be probably outdated once #144 (JSONRPCCall instead of HTTP/IPC/WebSocket RPC) is implemented

farazdagi commented 7 years ago

Closing, as we now rely on CallRPC() exposed method (which uses in-proc RPC handler), and do not need to expose anything.