struggling getting events back via JSON RPC


I'm trying to put together an interface from a simulation framework I use, into ethereum, so I can publish simulation events and then have other components consume them back from the blockchain.

Rather than create a new transaction for every simulation event, I thought it might make more sense to create a 'environment' contract once at the start, and then any new simulation events call a function of that contract which logs the event.

I want to then poll for new events that have been logged, but this is where I'm stuck. I thought I misunderstood filters totally, but I can get the newBlockFilter working as expected. So I tried creating a filter by:

curl -X POST --data '{"jsonrpc":"2.0","method":"eth_newFilter","params":[{"fromBlock":"0x0","toBlock":"latest"}],"id":73}'

which returns 0x81c365c2b677685d38709642a4017812, so then checking it by
curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getFilterChanges","params":["0x81c365c2b677685d38709642a4017812"],"id":73}'

But I just get all the time:

I guess the other option is the event isn't firing - any other way to check? I tried eth_getFilterLogs with the same filter, which I thought might return all historical events (e.g. new contracts being added, which I'm sure are working) but I still get nothing..

Any suggestions?


Sign In or Register to comment.