1

Started Geth using following command

geth --identity "testpvtnode" --rpc --rpcport "8545" --rpccorsdomain "*" --datadir <pvtnetdatapath> --port "30303" --rpcapi db,eth,net,web3,personal --networkid 123 console 2>> Logfile

Accessing the deployed contract through an UI created by referring the following links - (counter, Stack Exchange Question related to UI creation)

I have successfully created the UI and interacted with SmartContract, but the functions are not working properly(able to call the function and transaction done successfully,but counter value is not updating) after I restarted the Geth instance.

Please note : The private net is on my pc( did not set as a server)

Pt.AR
  • 112
  • 9

1 Answers1

0

I think you need to mine your transactions using : miner.start()

you should wait for a while once mined you can stop mining process using miner.stop()

But before doing that you should load miner api using in geth command line :

--rpcapi db,eth,net,web3,personal,miner 
Badr Bellaj
  • 18,780
  • 4
  • 58
  • 75
  • I have used miner.start() and miner.stop on my DApp code, but it is not executing (used as web3.miner.start() and web3.miner.stop()).The code stucks at web3.miner.start(). The same issue I am facing for web3.personal.unlockAccount also.So I always have to start the miner and unlock the account via geth console.Do you know how to solve this issue? – Pt.AR Oct 18 '18 at 03:38
  • use miner.start and stop on your geth console not on your code. – Badr Bellaj Oct 18 '18 at 09:22
  • I am always doing like that only.But it is very difficult to do it on console everytime.why the api can not use in DApp Code? – Pt.AR Oct 22 '18 at 06:46
  • 1
    you can use a script to automate mining https://ethereum.stackexchange.com/questions/10262/how-to-stop-mining-unwanted-blocks-on-private-net-on-geth-ethrereum – Badr Bellaj Oct 22 '18 at 08:04
  • But I want to add the mining Api to my DApp code. – Pt.AR Oct 22 '18 at 11:55