Questions tagged [events]

Solidity events and logging problems. Events allow the convenient usage of the EVM logging facilities, which in turn can be used to “call” JavaScript callbacks in the user interface of a dapp, which listen for these events.

161 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
1
vote
1answer
385 views

Call `getPastEvents` with Drizzle raise error: “getPastEvents is not a function”

Calling getPastEvents with Drizzle will cause the exception: TypeError: this.drizzle.contracts.Contract.getPastEvents is not a function How to get all the past events in an array (in-one-shot) ...
1
vote
0answers
48 views

drizzle not updating events properly - duplicate events

I'm facing a peculiar problem while rendering event values in a component using drizzle. When a new event is created and is updated in the events array of drizzle (drizzleState.contracts.MyContract....
1
vote
1answer
195 views

How to handle events using drizzle?

strange that after much searching, i havent found even one piece of info out there which clearly elaborates on how the events are manipulated in drizzle. From what i understand, the event names (and ...
1
vote
0answers
221 views

using events in private blockchain raises leveldb not found error

i'm getting { [Error: Node error: {"code":-32000,"message":"leveldb: not found"}] when trying to use events on a private eth blockhain. What might be the problem? (I've installed Leveldb with brew) ...
1
vote
1answer
44 views

Accessing the Ethereum State Variables using web3js (Java Script)

I'm trying to run the below code to get the state variables using the getIdBytes method of the Smart Contract, and assign it to a java script array variable, but it doesn't seem to work. All I can ...
1
vote
1answer
236 views

About getPastLogs usage

"getPastLogs" can get past event log. I check the web3 documentation: fromBlock - Number|String: The number of the earliest block ("latest" may be given to mean the most recent and "pending" ...
1
vote
0answers
38 views

What is the most preferred way to listen to events

After studying about solidity events, my understanding is that receiving an event doesn’t guarantees that the transaction is final. Transaction may yet to be included into the block. And even if it ...
1
vote
3answers
177 views

Reading the result of a function that change state by using events in Solidity

I would like to get the result of a function by listening its emitted event. These are two pieces of code of my contrats CONTRACT 1: function createTradeableContract() public stopInEmergency ...
1
vote
1answer
50 views

Filter topic across multiple contracts

Is there something I could add to my contract which allows my application to filter for all the deployed contracts which also included this topic/identifier? The only other option to manage this I ...
1
vote
0answers
86 views

Watch Events with same Name but different params

using web3@0.0.xx is there a way to get Events overloaded (with the same name, but different params) ? I found contract.Transfer[‘address,address,uint256,address,bytes’]({ fromBlock: 0, ...
1
vote
0answers
123 views

Filtering blocks on basis of transaction logs in web3j

I want to filter blocks on the basis of a log present inside transactions. How can I do that? I don't have any contract address and want to filter all the blocks generated by all the contracts. ...
1
vote
0answers
100 views

Why would an Infura/MetaMask watch of a contract's allEvents() that works on Rinkeby fail sporadically on Mainnet

I have some code that immediately sets up an allEvents watch for the contract, then leaves that running and uses it to handle various events generated by the contract. I've been running it on Rinkeby ...
1
vote
0answers
61 views

Is there any specification for Decentralized Token Exchange?

Is the way of doing decentralized token exchange (DEX) on Ethereum blockchain specified in some ERC ? Exploring event data in Etherscan I found that there are many types of events: event Order(...
1
vote
3answers
485 views

Not able to export to csv all transfer events of a specific contract on Ethplorer.io

I'm able to use the Export to csv function, but it's only giving me the most recent 1000 events. Any suggestions on how to get ALL (2100+) of the events in a csv file? https://ethplorer.io/address/...
1
vote
1answer
148 views

Solidity triggered event that shows a message to everyone who is currently in the site

Just a small question regarding how solidity event works. Let's say I have a function buyCandy(). At the end of the function I attached event: emit LogBuyCandy(msg.sender); event LogBuyCandy(address ...
1
vote
0answers
181 views

Listen for Solidity Event With X Number of Confirmations

I presume Solidity events are fired the moment the block that includes its transaction is mined -- please correct me if I'm wrong. I need to sync the transaction status locally but wish to only save ...
1
vote
0answers
120 views

web3 got duplicate events and make data in server different from blockchain

I use web3j to listen ethereum smart contract events to synchronize data for the server, but sometimes I got duplicate events in one function. Let's consider Birth evens in CryptoKitties smart ...
1
vote
1answer
263 views

Event unique identifier

The web3.js (1.0) docs helpfully list the return values from a contract event subscription. I've noticed that there is an additional return value id that isn't listed there but is returned with the ...
1
vote
1answer
713 views

Geth settings for watching Events?

what are the optimal geth settings if you just want to listen to some events that are fired by smart contracts? I'm having a bit trouble to setup geth properly. Thanks a lot. PS: That is my ...
1
vote
0answers
748 views

Recommended way to watch events with MetaMask?

I always get in trouble with things like var filter = web3.eth.filter({fromBlock: '5139365', toBlock: 'latest'}); filter.watch(function(_err, _resp){ ... when using MetaMask as provider. What is the ...
1
vote
1answer
793 views

Web3 Solidity events do not work any more in Chrome?

Ok, it seems like this issue is only present in chrome browser I am working with Version 64.0.3282.140 (Official Build) Built on Ubuntu , running on Ubuntu 16.04 (64-bit) Actually I had some ...
1
vote
2answers
208 views

How to include the named of the called contract in Event Log

in my code I am using events in order to log some date. I would like to include the name of the contracts I am calling out of my main contract into this event log. Does anyone have an idea how to do ...
1
vote
0answers
67 views

Get root data of smart contract

I am deploying a Smart contract with set of fields. Updating some fields using events.Till here is fine. Now here i need to fetch the root data(data while deploying the contract) Please suggest. ...
1
vote
0answers
109 views

Tracking transaction attempts/failed attempts sent to a contract from unknown parties

In light of the recently killed parity library and how the person responsible went around randomly trying to kill contracts, is there a way of monitoring smart contracts for attempted and potentially ...
1
vote
0answers
105 views

How to best react to geth events from a server app?

I have a geth node running on a server. I want my Ruby app to take action every time a contract emits an event. The app cannot miss any events. One way would be to poll for transactions to that ...
1
vote
1answer
190 views

Remote geth node failing to retrieve past events

I have set up a remote geth node on AWS as a web3 provider for my DApp. The geth node is initialized with the following command (for testnet) as a daemon service: [Unit] Description=Ethereum go ...
1
vote
0answers
355 views

I am trying to query historical blocks for specific events from my contract. Is a full node required for this? Or is a light node or fast node fine?

I am having difficulty seeing any events for my contract. They show up in etherscan but not when trying to view them using web3. I am running a light node. Do I need a full or fast node to have access ...
1
vote
0answers
38 views

Date-Span in Event Filter

Want to provide an interface on my page to show filter based event data. Haven't come across a proper working example to fetch event data by providing a date span. So it will be helpful if one could ...
1
vote
0answers
743 views

How to continue to watch the `Events` from the point `geth` was closed?

I have a private Ethereum network. The bootnode(main node)'s goal is to watch Events and if a new Event is generated than trigger a contract's function that I want to run. The key point is triggered ...
1
vote
0answers
436 views

Need help understanding Events

Here's an example from solidity docs: [SOLIDITY] contract ClientReceipt { event Deposit( address indexed _from, bytes32 indexed _id, uint _value ); function ...
0
votes
0answers
15 views

How to find a specific event if it has no indexed params

I understand that I can filter for logs with indexed events like so: event Transfer(address indexed src, address indexed dst, uint wad); whereby, I can search for all Transfer events with src=...
0
votes
0answers
24 views

Which Ethereum library is the one to use nowadays? Contract events on mobile must work

I used drizzle in our dApp and contract events work fine on Desktop browsers with MetaMask. However, on mobile (tested with Rinkeby deployment on MetaMask and Status on Android) the contract events ...
0
votes
1answer
21 views

How to use truffle-assertions to verify parameters of an emit?

I have not been able to find any resources with usage instruction besides github and blog post by the author On github an example is show as such: truffleAssert.eventEmitted(result, 'TestEvent', (...
0
votes
1answer
19 views

Why eth_getLogs returns empty result for Ethereum account address?

I'm developing an Ethereum platform and need to fetch the events log of a desired address. I found a code like this: curl -X POST --data '{"jsonrpc":"2.0","method":"eth_getLogs","params":[{"topics":...
0
votes
0answers
26 views

How to listen for contract creation, or all block events?

I'm building a web app with web3 where users can deploy a certain contract and assign some people to it. Inside the constructor of that contract I also output a certain event. I want these assigned ...
0
votes
0answers
21 views

How to filter an indexed event parameter using web3j?

I am planning to use ethereum logs as a data storage on my private blockchain. I have defined event in my contract like this: event logDomainFilter(uint128 indexed _campaignId, uint128 indexed ...
0
votes
0answers
12 views

In EtherJs how to find account number of balance change event?

I am creating Ethereum Wallet application & I am using EtherJs for Web wallet development. When I try to listen for Balance Change event for multiple accounts then How do I find account number ...
0
votes
0answers
13 views

How can I listen for Truffle Actions such as TX_BROADCASTED, TX_ERROR via the Drizzle Vue Plugin?

In my Vue JS Dapp, which uses Drizzle Vue Plugin, I listen for contract events using $drizzleEvents like so: this.$drizzleEvents.$on('drizzle/contractEvent', (payload) => { this....
0
votes
0answers
17 views

Ethereum Logs since Beginning of Time

I can subscribe to all events in ethereum network (logs, pendingTransaction etc) so I can get only newly generated events (while I am subscribed). For my analysis I need to retrieve all logs from ...
0
votes
0answers
31 views

How to log an event which emits state of the contract in nethereum?

I am logging a specific event from a specific contract using nethereum. However, my event emits contract state (enum in solidity). My log processor shows 0 events instead of 2. Solidity code snippet:...
0
votes
0answers
9 views

Failed to get events from kovan testnet. Same code working in ganache testnet

I'm unable to get events from kovan testnet. The same code is working with ganache blockchain, but when using kovan testnet. I'm not getting any response. Can anyone tell me what I have done wrong?. I'...
0
votes
0answers
90 views

Listening to events in Ethers.js with websockets

I'm trying to listen to all emitted events from a contract with Ethers.js and Websockets. Any idea why this is not working? var wsProvider = new ethers.providers.WebSocketProvider("wss://rinkeby....
0
votes
0answers
29 views

web3 filter function not working

I am trying to filter Transfer events from my local Ethereum node using web3 py. I am accessing my local ethereum node remotely using teamviewer and it was running and fully synced as well. My code is ...
0
votes
0answers
13 views

get statistics by event filters or normal blockchain traversal

I want to ask what's the better approach among the following two: Filter events using address.eventFilter function or traversing the local blockchain block by block and getting events statistics. I ...
0
votes
0answers
22 views

web3.js function contract.once() not working on Kovan, but working on ganache

I am subscribing to an event (just once, queued after an update) of a contract to reload the data like this on my react frontend: const instance = new web3.eth.Contract(abi, address) instance.once( ...
0
votes
2answers
53 views

What is the websocket URL in Ethereum on Geth?

I've lunched an Ethereum server based on Geth. Now, I need to be notified about all incoming transactions on my generated accounts. In my previous Bitcoin Core server, I had an option in its config ...
0
votes
0answers
23 views

Unable to hear emitted events

I'm using Infura as my provider. From what I've read online, it seems that using a websocket with infura instead of http is the first step to being able to hear events however I only get an empty list ...
0
votes
0answers
8 views

Setting up listener using web3py

I'm setting up a proof of work contract. When a solution is found, the contract emits a Transfer event and the number that gets hashed with future solutions changes. I need to set up a listener so ...
0
votes
1answer
15 views

Web3.JS 1.2.6 reporting PastEvents but not new events

relevant code: token.getPastEvents('Approval', { fromBlock: 0, toBlock: 'latest' }, function (error, events) { console.log("ETHEREUM past events " + JSON.stringify(events)); }); token.events....
0
votes
0answers
43 views

Timeout when try to connect over websocket in web3.py

I am trying to listen for events emitted by a simple Solidity contract. I am not able to connect using ws though I can commit transactions using http. Here's my code for event listening - import ...