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)

1
  • have you mined the transactions?
    – Badr Bellaj
    Oct 17, 2018 at 9:01

1 Answer 1

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 
5
  • 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, 2018 at 3:38
  • use miner.start and stop on your geth console not on your code.
    – Badr Bellaj
    Oct 18, 2018 at 9: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, 2018 at 6:46
  • 1
    you can use a script to automate mining ethereum.stackexchange.com/questions/10262/…
    – Badr Bellaj
    Oct 22, 2018 at 8:04
  • But I want to add the mining Api to my DApp code.
    – Pt.AR
    Oct 22, 2018 at 11:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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