Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
1answer
208 views

Why myContract.events.MyEvent([options][, callback]) does not return “data” and “logs”?

We have an event as follows : event LogNewObject(address sender, bytes32 indexed id, bytes32 sub_states_types, bytes32 sub_states_values, address owner); This event is called in following function : ...
2
votes
1answer
253 views

Healtcheck on Websocket

I've looked through the documentation and haven't found that to be helpful. I would like to know the best way to do a healthcheck on my websocket connection to geth (Yesterday, I found out that I did ...
2
votes
1answer
216 views

How to filter indexed events and watch callback return value using Web3.py

For example, I have an event where using clusterAddress as key, I want to find the other arguments (storageID, desc, etc.), only having the clusterAddress indexed. I added the indexed keyword for the ...
1
vote
1answer
294 views

Show an event with nodejs

in my Smart Contract I have a function such that it fires an event at the end of its code. function sendTran(arguments) public { *code* emit Event(argument 1,argument 3,argument 3,...
1
vote
1answer
230 views

eth_getLogs only returns logs for last transaction

The following command only returns logs for the last transaction (or block). I'm currently running ganach-cli for the local testnet. There were previous transactions with events but when a new ...
2
votes
2answers
253 views

How do I use filter EVM log events by an indexed field in web3j?

I've looked through the documentation, but there doesn't seem to be this scenario listed. What I want to do is filter the Ethereum event log of a specific contract by an indexed field with Web3j. ...
0
votes
1answer
258 views

How to prevent callback event occur twice?

Hi this is my web3 code events.watch(function (error,result){ if (error) { console.log('Error:'+JSON.stringify(error)); res.send({'status':0,'message':...
0
votes
1answer
247 views

How to get only past 2 days events using getPastEvents everytime?

How can the following query be modified to only fetch the past two days worth of events: const events= await MyContract.getPastEvents("eventName", { fromBlock: 0, toBlock: "latest" });
1
vote
2answers
312 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
710 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 ...
0
votes
1answer
287 views

How to see event name in etherscan.io transaction event log?

In etherscan.io, I want to be able to see the event name (signature) in the transaction page event log, like here. Currently, I don't see it here. I'll note that the transaction is indeed sent to a ...
2
votes
1answer
245 views

Can we call two contracts in web3.eth.filter method?

I have two contract address and I want to check events on both in one call. I mean, can we pass two contract address in one option param like i do below? let web3 = new Web3(); web3.setProvider(...
0
votes
1answer
322 views

Proper way of using allEvents()

I'm trying to get all events for a contract: let events = token.allEvents({fromBlock: creationBlock, toBlock: 'latest'}, (err, res) => { try { let result = events.get(); ...
0
votes
1answer
41 views

Infura Web Sockets doesn't work on Infura

I have a problem with connecting via Websockets to Infura. I am listening on some events from my smart contract, so when some event is dispatched by calling some method from smart contract, I should ...
3
votes
1answer
200 views

How to access non-indexed event arguments from Go types.Log?

The Go bindings have a type called Log that has the following fields type Log struct { // Consensus fields: // address of the contract that generated the event Address common.Address `...
1
vote
1answer
377 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 ...
0
votes
1answer
27 views

Truffle Exec Return Events

I have set up a JavaScript file that takes in my contract and executes the various functions and then returns the correct events. The file runs through 'truffle exec'. I am using the following line ...
0
votes
1answer
35 views

Truffle, getPastEvents synchronously

I try to check that a total of 4 events have been emitted by my contract instance. Next code will fail in the assert.equal line since getPastEvents will process the events in a callback and so the ...
2
votes
1answer
721 views

Subscribe to events usign geth websocket

I'm trying to subscribe to geth using the websocket api. First step was to start geth: geth --ws --wsport=8456 --wsorigins="*" --fast --cache=512 --rpcport=8455 --rpc --rpcapi="personal,eth,network" ...
0
votes
1answer
20 views

Viewing transaction events by using web3 on geth console

According to https://web3py.readthedocs.io/en/stable/contracts.html#web3.contract.ContractEvents.myEvent web3 allows to extract the pertinent logs from a transaction receipt: tx_hash = contract....
12
votes
2answers
3k views

How to check events in Truffle Tests?

What's the best way to check that events were fired in a Truffle test?
0
votes
2answers
323 views

How to find the block, when contract was deployed

I have contract address, and I want to find the block number, when it was deployed, to use it for loading events for this contract. Is it possible?
0
votes
1answer
37 views

Is there an issue using event overloading and event logs that contain arrays?

My event fires, but the last parameter is never logged. It appears as if it doesn't even exist. Here is my solidity code: pragma solidity >=0.5.6; contract EventTest { event marketCreated(...
0
votes
0answers
17 views

How to listen contract event in Python

The test contract is pragma solidity ^0.5.0; contract Test{ event Here(uint256 indexed a); uint256 public a; function add() public returns (uint256){ a += 1; emit Here(...
3
votes
1answer
36 views

How is The Graph a decentralised solution?

I understand that querying for data on Ethereum is a pain in the neck and that The Graph indexes events so that developers can more easily get their most precious blockchain data. However, I'm not ...
3
votes
2answers
67 views

is it possible to get events from transactions that are in the `txpool`?

Is it possible to see the events that will be emitted in the txpool, or is only the transaction information available? For example, can I search in either the queued or pending transactions and ...
2
votes
1answer
43 views

How to handle require/revert/assert errors properly

I'm trying to find an easy pattern to revert/rollback a write transaction. The first idea was to log a GenericErrorEvent but then I noticed that it will never be emited if any require/revert/assert ...
0
votes
1answer
13 views

where does faile event go in eth contract?

If a function has multi events , the first successed but second faile. Can I get all of them in block? solidity code like this emit event1 throw emit event2
2
votes
1answer
35 views

NEthereum, Number of indexes don't match the number of topics

I would like to get all Transfer events for a specific interval of blocks. When I call GetAllChanges with the following parameters, I get this error message: 'Number of indexes don't match the ...
0
votes
1answer
46 views

Emit not firing event more than once

I'm experimenting a little bit with the blockchain, I'm currently trying to send from an oracle an address to store on the blockchain through a smart contract. The code (very simple and without checks)...
2
votes
0answers
39 views

How can I extract sidechains (transient forks) from a geth node before they get discarded?

According to my understanding, transient forks (also known as sidechains in geth's source code) are discarded or overwritten when a reorganization happens. But before that, when the node detects a ...
0
votes
1answer
718 views

How to use events to retrieve data from a transaction? PRIVATE CHAIN

i am using GETH for the architecture and deployment of my contract on a private chain and it works pretty fine, but unfortunately i want to return data from a transaction function and this makes me ...
0
votes
2answers
48 views

Solidity events and its's necessity

I don't understand solidity events at all. For example: https://rinkeby.etherscan.io/address/0xc5a79064168c0aa3706c33d70b94a09103e9656b#events Some events show its names, others show methods without ...
1
vote
0answers
11 views

Web3 Daemon Event listner

const DManage = new web3.eth.Contract(myABI, '0x9420D0904B2F696f8612239e5a507A86B5dA1b6a'); DManage.events.allEvents() .on('data', (response) => { console.log(event); }) .on('changed', (...
4
votes
1answer
659 views

Events not being detected in Nethereum

I have a function in one contract that looks like this: //Events event RequestReceived(bytes s); event WorldCreated(bytes32 indexed worldName, address indexed sender, address result ); ...
0
votes
2answers
44 views

How do I monitor 50k addresses for incoming ERC20 transactions?

I have a list of 50.000 Ethereum addresses which at any time may receive ERC20 transfers. I know I can create filters but I don't think it scales to send 50.000 RPC calls to an Ethereum node every 20 ...
0
votes
1answer
26 views

Mapping or indexed event

I want to store data on chain that is not needed within a smart contract but should be retrieved easily and particularly quickly from outside. I know that storing the data within an indexed event is ...
0
votes
1answer
26 views

Subscribing to multiple Transfer events of various ERC20s

I need to suscribe to Transfer events of couple of different ERC20s in order to catch transfers to my contract. And here is the question: to catch all those events I need to create instance of each ...
0
votes
1answer
485 views

Simple event watching with testrpc - unexpected output

Working with this example, I've been attempting to utilise event watching from the web js api. Window 1 (a testrpc instance with filled account): testrpc -a 1 Window 2 geth attach rpc:http://...
8
votes
1answer
550 views

Filtering on events of the entire blockchain not possible in testrpc via truffle

A contract I wrote has an event in its constructor. Since I want to find it back in the logs it doesn't seem possible to start listening to the latest block. Because the event is already 'fired' ...
0
votes
1answer
73 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 ...
0
votes
1answer
15 views

Trigger manual DB UPSERTs through smart contract

Can I add a trigger to smart contract to insert/update data to my traditional DB. E.g. Let's say I have students private blockchain where each student has to update their info. Once they insert/update ...
0
votes
2answers
480 views

Events with string argument not working (not indexed)

I am trying to listen to an event on rinkeby test which I run locally. Every thing works fine when my argument is int such as event EventTester(int values); When I change the event argument to string ...
0
votes
0answers
14 views

How do i retrieve the transaction hash to DApp's frontend?

I have a simple DApp that stores data, developed with truffle and deployed on rinkeby, and I want to show the transaction hash in the frontend. I've read a lot about web3.eth.getTransaction() or ...
0
votes
1answer
34 views

Problem watching events without invoke functions in the Smart Contract

I have an event which is sent each time when a contract is deployed. It is launched in the constructor. I have a Dapp where I want to watch this event to send a tx each time that a smart contract is ...
6
votes
4answers
1k views

Duplicate events firing in a Web3 listener

I'm experimenting with plugging Ethereum into a React web application, using this nice tutorial repo as a basis (thanks to uzyn): https://github.com/uzyn/ethereum-webpack-example-dapp I'm connecting ...
0
votes
1answer
100 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
1answer
36 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
22 views

How do newHeads and event subscriptions behave on past reorgs?

Based on the geth documentation, I understand that a subscription on both newHeads and logs will emit all new heads and events that come from a reorg. However, I couldn't find what the behaviour is ...
0
votes
1answer
42 views

A common error at time of using web3 options

When i use some web3 options as follows, I receive a common error i.e. TypeError: web3.[option] is not a function For example : TypeError: web3.toAscii is not a function web3.toAscii(...