PRODUCTS AND SUPPORT


How to connect to Ethereum Full node for Development




If you would like to utilize the Ethereum fullnode for your development purpose using Web3 javascript api, you can do so by restarting Geth with RPC node opened . Below are the steps :

  1. First, stop the Geth process by running below command
  2. sudo killall -HUP geth

    /img/common/ethereum-fullnode/killall.png


  3. Now restart Geth with RCP port by running below command:
  4. sudo nohup geth --rpc --rpcaddr "0.0.0.0" --rpcport "8545" --config /home/ubuntu/ethereum/eth_config.toml >> /var/log/cloud-init-output.log 2>&1 &


    /img/common/ethereum-fullnode/restart-geth.png


  5. Before you can connect to the node from Javascript or other Ethereum supported API, make sure port 8545 is opened over the VM's public IP.
  6. How to add custom port on AWS

    How to add custom port on GCP

    How to add custom port on AZURE

  7. Once the port is opened over public ip, you can connect to the node . Below is a code snippet to connect to the node using Web3 javascript api assuming Web3 is installed on the client machine:

  8. Web3 = require('web3');

    var web3 = new Web3(new Web3.providers.HttpProvider("http://VM_PublicIP:8545"));