A question about geth attach. I am opening a geth console and then in another terminal I make geth attach. Everything looks OK when I execute web3 commands etc. (like eth.accounts) in both terminals. Then, I deploy a contract through the console (1st terminal) using loadScript(), and as usual it is successfully mined as I see from the console messages. However, after that moment, when I want to use the deployed contract through the attached console (2nd terminal), I am unable to do it. It does not event see it.

Any ideas?

  • The different terminals only share the same backend node- all the JS variables are local to the specific console you are using – Tjaden Hess Apr 4 '17 at 3:10
  • But when we deploy a contract, isn't it added to the blockchain which in my logic should be accessable via all the terminals? – Önder Gürcan Apr 4 '17 at 6:40

Looks like the contract deployed through terminal 1 is only local scope. To get it in terminal 2 you have to invoke the contract by address/api and perform functions on it.


You need to let terminal 2 know where the contract is and what it's ABI is.

myContract = eth.contract(ABI).at(address)

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.