4

I'm making a Hybrid mobile app and planning to use web3.js to access Geth.

What's the best way to expose Geth to the hybrid mobile app?

I will be running Geth on ubuntu 14.04 on Aws

1 Answer 1

3

You have not specified what the hardware, operating system, networking capabilities of the hybrid mobile app you are planning to develop, but I thought that I should mention that there is a Parity Ethereum client currently only available on the Mac, Ubuntu and as a Docker image.

The roadmap on their website shows that they are planning to provide a light client for ultra-minimal-resource IoT client, but there is no target date.

If you provide a bit more information on your intended target environment, the answers on the site would should be more suitably targeted.

Are you planning to run geth on a server on the Internet or on your mobile? By hybrid, do you mean the former?


Update with your additional information, and I also had a look at your previous post sendTransaction from iPhone app .

  • The main thing I would worry about is the security and authentication on the communications between your Geth instance on AWS and your mobile phone.
  • web3.js typically talks to the local Ethereum client via http using the XMLHttpRequest() object lib/web3/httpprovider.js. This object may be able to handle HTTPS W3C XMLHttpRequest. But you may have to do some hacking of the code, as you will have to work out some authentication. Client side certificates?
  • On your server side you could try a proxy like nginx (Configuring HTTPS servers) or even Apache mod_proxy with SSL (How To Use Apache HTTP Server As Reverse-Proxy Using mod_proxy Extension).
  • Alternatively you could try to create an SSH tunnel between your mobile and the server and this would protect the information passing through. Here are some libraries that you could potentially use (I don't know how good they are):

  • Another alternative is that you could just use JSON-RPC to connect to your Geth instance on AWS running a proxy with HTTP and authentication. I use the following curl command in my scripts and curl can be configured with with authentication and HTTPS. You could use JavaScript (e.g. JQuery) functions instead:

    curl -s -X POST --data '{"jsonrpc":"2.0", "method":"eth_getBalance", "params":["${account1}", "latest"], "id":1}' http://192.168.4.120:8545

1
  • I will be running ubuntu 14.04 on Aws Commented Apr 13, 2016 at 12:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.