## WHAT THE HACK ARE EVENTS • Events are a mechanism which let the world know about the state change happening with in a blockchain. • This information plays an important role for processing further steps in process .i.e. information update on a dApp or execute next step in business process • Log entries represent the result of events having fired from a smart contract. ## HOW TO GET THE FISH OUT • Any receivers which are interested on events from a smart contract can listen the Ethereum node over JSON- RPC OR WS • This can be either a locally hosted node or can utilized a public hosted node like INFURA. Ex: /** HTTP provider using Infura**/ const provider = 'https://mainnet.infura.io/v3/<API - Key>' const web3 = new Web3(new Web3.providers.HttpProvider(provider)); /** Websocket provider using Infura**/ const provider = 'wss://mainnet.infura.io/ws'; const web3 = await new Web3(new Web3.providers.WebsocketProvider(provider)); • One who has missed the train to capture the real time event logs can also get the fish out using reading the past event logs using web3js methos getPastEvents Example : myContract.getPastEvents(event[, options][, callback]) Code Sample is reading ***event bidRevealed*** from ENS smart contract hosted on ethereum blockchain  Sample code Repo https://github.com/devrajsinghrawat/Web3nSolidity/tree/master/eventScan
author | devrajsinghrawat |
---|---|
permlink | ethereum-events-and-reading-past-events |
category | busy |
json_metadata | {"community":"busy","app":"busy/2.5.6","format":"markdown","tags":["busy","ethereum","solidity","events","devd-learning-blog"],"users":[],"links":["https://mainnet.infura.io/v3/<API","https://github.com/devrajsinghrawat/Web3nSolidity/tree/master/eventScan"],"image":["https://ipfs.busy.org/ipfs/QmWjPM8CoHhN1YNci8xN5YSHVsrprDPmapLGd1D1zMrB3g"]} |
created | 2019-05-10 06:47:00 |
last_update | 2019-05-10 06:47:00 |
depth | 0 |
children | 1 |
last_payout | 2019-05-17 06:47:00 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.052 HBD |
curator_payout_value | 0.015 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 1,453 |
author_reputation | 2,616,899,923,169 |
root_title | "Ethereum events and reading past events " |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 84,588,692 |
net_rshares | 132,105,219,399 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
busy.org | 0 | 148,679,666 | 0.77% | ||
minnowsupport | 0 | 123,378,924,475 | 3% | ||
broadcast | 0 | 7,413,811,164 | 10% | ||
trollshunter | 0 | 0 | -100% | ||
garena | 0 | 551,983,937 | 100% | ||
isalea | 0 | 551,628,990 | 100% | ||
gregoryhedrich | 0 | 60,191,167 | 100% |
<p>Congratulations! This post has been upvoted from the communal account, @minnowsupport, by DevD from the Minnow Support Project. It's a witness project run by aggroed, ausbitbank, teamsteem, someguy123, neoxian, followbtcnews, and netuoso. The goal is to help Steemit grow by supporting Minnows. Please find us at the <a href="https://discord.gg/HYj4yvw"> Peace, Abundance, and Liberty Network (PALnet) Discord Channel</a>. It's a completely public and open space to all members of the Steemit community who voluntarily choose to be there.</p> <p>If you would like to delegate to the Minnow Support Project you can do so by clicking on the following links: <a href="https://v2.steemconnect.com/sign/delegateVestingShares?delegator=&delegatee=minnowsupport&vesting_shares=102530.639667%20VESTS">50SP</a>, <a href="https://v2.steemconnect.com/sign/delegateVestingShares?delegator=&delegatee=minnowsupport&vesting_shares=205303.639667%20VESTS">100SP</a>, <a href="https://v2.steemconnect.com/sign/delegateVestingShares?delegator=&delegatee=minnowsupport&vesting_shares=514303.639667%20VESTS">250SP</a>, <a href="https://v2.steemconnect.com/sign/delegateVestingShares?delegator=&delegatee=minnowsupport&vesting_shares=1025303.639667%20VESTS">500SP</a>, <a href="https://v2.steemconnect.com/sign/delegateVestingShares?delegator=&delegatee=minnowsupport&vesting_shares=2053030.639667%20VESTS">1000SP</a>, <a href="https://v2.steemconnect.com/sign/delegateVestingShares?delegator=&delegatee=minnowsupport&vesting_shares=10253030.639667%20VESTS">5000SP</a>. <br><strong>Be sure to leave at least 50SP undelegated on your account.</strong></p>
author | minnowsupport |
---|---|
permlink | re-ethereum-events-and-reading-past-events-20190510t075716z |
category | busy |
json_metadata | "{"app": "beem/0.20.20"}" |
created | 2019-05-10 07:57:15 |
last_update | 2019-05-10 07:57:15 |
depth | 1 |
children | 0 |
last_payout | 2019-05-17 07:57:15 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 1,687 |
author_reputation | 148,902,805,319,183 |
root_title | "Ethereum events and reading past events " |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 84,592,492 |
net_rshares | 0 |