1

I was following this guide today https://medium.com/mercuryprotocol/how-to-create-your-own-private-ethereum-blockchain-dad6af82fc9f.

Right now I am at point where I have two geth nodes (gethn1 and gethn2) running locally on my machine. They are aware of each other and I was able to send a 100eth from an address on gethn1 -> address on gethn2.

What I want to do now is create a small web app. Given an address that exists on this private blockchain, this app would return a balance in that address.

I understand I could achieved this using the web3 library, but I am unsure of how to do this with a private blockchain.

1

It is a fairly straight forward process.

1) Tell geth to start the RPC interface and allow incoming requests,
2) Connect to the local node and use web3 to interact with the node.
3) Now call the APIs that you want explore on your blockchain.

In case above is not enough, feel free to check below article on the subject of matter.
http://hypernephelist.com/2016/06/21/a-simple-smart-contract-ui-web3.html

  • im trying to do this but it keeps saying CONNECTION ERROR: Couldn't connect to node 127.0.0.1:8545. – Robert Lemiesz Feb 4 '18 at 20:37
  • Show us your step-by-step approach, so we can reverse the answer to you :) – phant0m Feb 4 '18 at 20:40
  • I figured it out. I was starting my geth server with --maxpeers 0 flag. Which was making it refused outside web3 connections. – Robert Lemiesz Feb 4 '18 at 20:43
  • Ok great, let me know if you run into issues :-) – phant0m Feb 4 '18 at 23:17

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.