3

We setup ethereum node on AWS Ubuntu Server 16.04 LTS (HVM) EC2 instance and configured it in the standard way before launching the geth console using the below command:

sudo geth --identity "EthereumMain" --datadir ~/.ethereum_private/ --networkid "123" --verbosity 3 --nodiscover --rpcapi "admin,db,eth,debug,miner,net,shh,txpool,personal,web3" --rpccorsdomain "*" --rpc --port "30301" --rpcport "8545" --rpcaddr "0.0.0.0" --nat "any" console 2>> ~/fm-ethchain/fm-ethchain.log

(Basically we tried to incorporate all the suggestions we found on various forums and websites to solve the problem!! )

Now, when we try to connect to this node from lambda function using the web3:

var web3 = new Web3( new Web3.providers.HttpProvider('http://xx.xxx.xx.xxx:8545') );

We keep getting the following error:

CONNECTION ERROR: Couldn't connect to node http://xx.xxx.xx.xxx:8545 (where xx.xxx.xx.xxx is the public IP address of the EC2 instance).

Can any AWS Ethereum experts please specify what is it that we are missing?

  • Hi there. Have you added port 8545 to the Inbound Rules of the relevant Security Group? – Richard Horrocks Jul 12 '17 at 21:57
  • Try giving your AWS box public IP in --rpcaddr "public IP" when you launch geth node and make sure that port 8545 is open. – Sanchit Jul 13 '17 at 1:06
  • Hi @RichardHorrocks - Yes, we have the usual range (8000 - 8599) open... – Kirti Jul 13 '17 at 13:53
  • Hi @Sanchit - We tried adding both the public IP and public DNS in the rpcaddr parameter but were still not able to connect. And yes, we have the port open... – Kirti Jul 13 '17 at 13:55
  • I am also facing the same issue I am running my node as geth --datadir "~/ethereum2/data2" --networkid 1606 --port 3001 --rpc --rpcport 8001 --rpcaddr "ec2-52-221-222-118.ap-southeast-1.compute.amazonaws.com" --rpcapi "eth,personal,web3,net,db,admin" --mine when i exit the node in Info i get the below messages INFO [10-04|13:51:15] HTTP endpoint closed: ec2-52-221-222-118.ap-northeast-1.compute.amazonaws.com:8001 INFO [10-04|13:51:15] IPC endpoint closed: /home/ubuntu/ethereum2/data2/geth.ipc I have changed my truffle.js file as `module.exports = { networks: { development: { host: "e – Manish Oct 4 '17 at 14:05
1

Maybe it's an issue stemming from AWS. Have you looked into the permissions your Lambda function was given?

AWS Lambda executes your Lambda function on your behalf by assuming the role you provided at the time of creating the Lambda function. Therefore, you need to grant the role the necessary permissions that your Lambda function needs, such as permissions for Amazon S3 actions to read an object.

You can read more about Lambda permissions here. I'm leaving this as an answer since I'm new to this exchange, but feel free to leave me a comment if you have more info or have tried that.

  • Hello.. Yes, we have tried your suggestions, and even tried accessing the node outside of Lambda as well to ensure there is no problem with the permissions. We are still experiencing the same issue! – Kirti Jul 13 '17 at 15:59
1

ICMP port is closed by default on AWS instances. You need to enable it in a security group.

Here is more detailed information: https://stackoverflow.com/questions/21981796/cannot-ping-aws-ec2-instance

TCP and UDP in inbound rules should be accessible by anywhere:enter image description here

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.