is there a way to view all events on all blocks for Eris Blockchain? Currently I've managed to just subscribe a particular event
Contract
contract IdisContractsFTW {
uint storedData;
string name;
event SetName(address indexed _from, string _name);
function set(uint x) {
storedData = x;
}
function get() constant returns (uint retVal) {
return storedData;
}
function setName(string _name){
name = _name;
SetName(msg.sender, _name);
}
function getName() constant returns (string retVal){
return name;
}
}
Node.js
var myContract;
var IdisContractsFTW = JSON.parse(fs.readFileSync('./abi/' + 'IdisContractsFTW', 'utf8'));
var myContractFactory = manager.newContractFactory(IdisContractsFTW);
myContractFactory.at(incoming.address, function(error, contract){
if(error) {throw error}
myContract = contract;
if(myContract){
myContract.SetName(
function(error,eventSub){
if(error){
throw error;
}
if(eventSub){
console.log(JSON.stringify(eventSub));
response.statusCode = 200;
response.setHeader('Content-Type', 'application/json');
response.write(JSON.stringify(eventSub));
response.end('\n');
}
}, function (error,event) {
if(error){
console.log("listenContractEvent error:"+error);
}
if(event){
console.log("event:"+JSON.stringify(event));
}
}
);
}
});
My current code in node.js just prints out an event whenever it's created. I'm trying to get an array of events ever created by this contract IdisContractFTW. Appreciate your advice on this one.
The manager object here is created using
var contracts = require('eris-contracts');
manager = contracts.newContractManagerDev(chainUrl, accounts.simplechain_full_000);
This is not possible today but it's a commonly requested feature.