I am trying to run contracts on a fresh Geth installation of a private blockchain network. It is working fine in the sense that I can transfer ether between accounts. But if I try to execute a contract, the JS Web3 file gets loaded, I set the defaultAccount as web3.eth.defaultAccount = eth.accounts[0] , unlock the account and then after getting the mined address, call the class. But when I call a function, it simply returns

Error: invalid address

at web3.js:3879:15

at web3.js:3683:22

at web3.js:4948:28

at map (native code)

at web3.js:4947:12

at web3.js:4973:18

at web3.js:4998:23

at web3.js:4026:22

at apply (native code)

at web3.js:4151:12

For example, even if I execute a contract as simple as the greeter contract, greeter.greet() returns the above.

I assume that there must be a problem with my private network, but can't figure out what it is.

Any help with this would be appreciated.

I want this to run only on the private network, please refrain from suggesting trying it on public test network.

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.