How do display all the events logs from a smart contract

0 votes
web3.eth.sendTransaction({from : web3.eth.accounts[0], to : c.address, value : web3.toWei(50)}, console.log);

I am able to return the transaction hash.

But how do I capture all the event logs from that transaction that the smart contract returns?

Oct 3, 2018 in Blockchain by slayer
• 29,370 points
3,240 views

1 answer to this question.

0 votes

You'll need to watch the events.

const filter = { address: web3.eth.accounts[0] }; // filter for your address
const events = c.allEvents(filter); // get all events

events.watch(function(error, result) {
  if (!error)
    console.log(log);
  });
});
answered Oct 3, 2018 by digger
• 26,740 points
I am using node.js, But when I deploy code to server with pm2. it is stoped listening after some hours

Hello, @There,

Are you facing any kind of error like file does not exist or some other while deploying?

Related Questions In Blockchain

0 votes
1 answer

How do I send back ethers to the sender of the tokens in a smart contract?

Whenever a smart contract receives ether via ...READ MORE

answered May 30, 2018 in Blockchain by Perry
• 17,100 points
3,601 views
0 votes
1 answer

How do I withdraw the balance from a contract on Ethereum test blockchain?

Your need to improvise your code a ...READ MORE

answered Aug 3, 2018 in Blockchain by Perry
• 17,100 points
2,663 views
0 votes
0 answers
0 votes
1 answer

How is a request sent from an app to a smart contract?

Yes, the contract is distributed by every node ...READ MORE

answered Jun 4, 2018 in Blockchain by Perry
• 17,100 points
713 views
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,790 points
1,922 views
0 votes
1 answer

Hyperledger Sawtooth vs Quorum in concurrency and speed Ask

Summary: Both should provide similar reliability of ...READ MORE

answered Sep 26, 2018 in IoT (Internet of Things) by Upasana
• 8,620 points
1,451 views
+3 votes
2 answers

How to run ethereumjs using Node.JS

You need to install testrpc globally on ...READ MORE

answered Mar 27, 2018 in Blockchain by ned_crew
• 1,610 points
1,413 views
0 votes
1 answer

How do I send ether from an EOA to a smart contract?

You include ether to send in the ...READ MORE

answered Sep 27, 2018 in Blockchain by digger
• 26,740 points
1,574 views
0 votes
1 answer

How connect library to smart contract from external resources?

pragma solidity ^0.4.0; import "github.com/OpenZeppelin/zeppelin-solidity/contracts/math/SafeMath.sol"; contract MathExtended { ...READ MORE

answered Sep 26, 2018 in Blockchain by digger
• 26,740 points
592 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP