1

Say I have testrpc set up:

testrpc -a 10

and have attached a geth console:

geth attach rpc:http://localhost:8545

If I want to run a contract call from the open geth console, but call it from the OS (windows in my case) command line, how might I do it?

e.g this command (contract from this question).

> UnitCounter.submitUnits(72,{from:eth.coinbase,gas:3000000})

  • 2
    You can use NodeJS + web3 for this, instead of the built-in console. – Tjaden Hess Jan 21 '17 at 21:14
  • 1
    When you attach, you get a console, right? Your command will work as long as the UnitCounter instance has been created. – Xavier Leprêtre B9lab Jan 22 '17 at 16:43
  • @XavierLeprêtreB9lab Yes, but I'd like to call that command from outside geth. Eg. in python pseudocode; import os os.cmd('geth command UnitCounter.submitUnits(72,{from:eth.coinbase,gas:3000000})'. As TjandenHess points out, this should be possible with NodeJS+web3. – atomh33ls Feb 1 '17 at 11:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.