0

I have an NodeJS app running on AWS instance(the one you get for free). I want to get access to Web3 object in my server.js file. I don't think that installing and running full client like Geth on AWS instance is possible/viable, because of how much computational resources it requires or some other technical reasons, I'm talking out of my armpit right now. Maybe some kind of light client is the answer, idk.

I've also read somewhere that it's possible to connect an app to a remote node through and RPC or something like that, but I also remember that it's not secure for some reasons.

So, what are my options, good sirs?

2

You can use an external API to have access to information from the Ethereum Blockchain. Some APIs you can use are EtherChain and EtherScan.

To send a transaction in a secure way, you will need to create the transaction by yourself, sign it, and then send the transaction to a node so it can propagate it for you.

The way to do this is to use a library such as ETH-LighWallet to manage your accounts/create and sign transactions (in your server/client side) and then send those transactions to the previous mentioned APIs (function sendrawtransaction).

I'm currently working in an app to make this process easier, but I think that that is the easiest way right now.

  • thank you very much, good sir!!! That's exactly what I was looking for! Consensys is awesome! – manidos Aug 25 '16 at 10:24
  • hey, could you look at this question. I'm trying to do what you've suggested here. – manidos Jan 10 '17 at 12:28
0

You can use Web3.js to connect your client to any Ethereum node out there. Using a Web3 provider (for example, HttpProvider):

new Web3(new Web3.providers.HttpProvider('http://localhost:8545'));

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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