It appears my events are not being fired in my node application when I transact the contract in the ethereum wallet gui.
- I deployed a custom contract via ethereum-wallet
- I have fired up
geth attach - in geth I have started the rpc
admin.startRPC("127.0.0.1", 8545, "*", "web3,db,net,eth") within the node repl shell I have done the following:
> var Web3 = require('web3') > web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545")); > var contractAddress = "0x807bF45B0245d8FA96F68E319116E18a15b07A10" > var contractCode = "<paste in the code above for the contract>" > var compiledContract = web3.eth.compile.solidity(contractCode) > var contractDefinition = compiledContract.ShareClass.info.abiDefinition > var reference = web3.eth.contract(contractDefinition).at(contractAddress) > reference.Transfer().watch( function(error, result){ console.log(result.args.from + " => "+result.args.to + " ["+result.args.value+"]"); });
When I then call the Transfer method on my contract in ethereum wallet, the contract balance changes, but the console logging does not take place in my node app.
You could try allEvents and see if it's a filtering issue.
– Paul S Mar 18 '16 at 20:38web3.eth.defaultAccountis not set or has no Ether. Then it can still call readonly functions, but won't emit events. – didi_X8 Nov 19 '16 at 17:08