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.

Filter by
Sorted by
Tagged with
0
votes
1answer
133 views

How do I watch Events from multiple contracts

I wrote a script that is able to read events from one contract address and then paste it into a .csv. Now I would like to extend that script listening watching/reading the same event of several ...
0
votes
1answer
133 views

Watching for events returns 0 blocknumber

I am trying to listen for recently mined events from a live smartcontract(EtherDelta). //https://github.com/praneethmendu/ethualizer/blob/master/backnd.js tradeEvent = contractIns.Trade(...
1
vote
1answer
150 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
17 views

Can't get event data selecting the event by name

This is my contract pragma solidity ^'0.5.2'; contract MyContract { event ContractCreated(address newAddress); constructor() public { } function createOtherContract() public { ...
0
votes
1answer
133 views

myContract.getPastEvents(“allEvents”) returns empty array

I want to get all past events from a contract I deployed on the Ropsten network. Contract is: pragma solidity ^0.5.1; contract SampleContract { uint storageData; event MamboNumberTwo(uint ...
0
votes
1answer
42 views

Get past events of a contract without ABI using Web3?

I'm building a simple explorer and I would like to list events emitted by contracts. Since I can't know the ABI of each contract, is it possible to get past events from a contract using Web3? If I ...
1
vote
2answers
195 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 ...
0
votes
1answer
151 views

Iterating through events

I have events (fired some time ago by the contract) containing numbers. I need to load them all, and then to draw a chart. What I do: contract.getInitBlock(function(error, value) { var ...
2
votes
1answer
156 views

Indexed arguments can't be retrieved, why?

Indexed arguments will not be stored themselves. You can only search for the values, but it is impossible to retrieve the values themselves. This is a quote from the following docs: http://...
6
votes
4answers
2k views

Proving the Existence of Logs to the Blockchain

To preface this: I'm not entirely sure this question makes any sense. Just a thought I had that I wanted to check the feasibility of. I'm pretty sure it is possible to use a Merkle proof to show that ...
0
votes
1answer
273 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
288 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
245 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
339 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
263 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
302 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
287 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
323 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
1answer
741 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
376 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
261 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
155 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 ...
0
votes
1answer
47 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
52 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
38 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 ...
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
66 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
54 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
56 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
2answers
49 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
28 views

Web3 Daemon Event listner

const DManage = new web3.eth.Contract(myABI, '0x9420D0904B2F696f8612239e5a507A86B5dA1b6a'); DManage.events.allEvents() .on('data', (response) => { console.log(event); }) .on('changed', (...
0
votes
2answers
60 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
17 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
0answers
27 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 ...
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 ...
1
vote
0answers
31 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 ...
1
vote
3answers
1k views

How to see events in Remix - Solidity

I am new to solidity and trying to deploy a contract to see whether the address is EOA or Smart Contract. The code is listed below. I am not able to see the boolean value when I executed the contract ...
0
votes
0answers
28 views

Event - Filtering a BigInt (or a BigNumber)

I am trying to filter on a BigInt for an event (the number can fit in a uint256). I keep getting an error Error: invalid number value This is what the code looks like.. { filter: {fromID:BigInt(...
1
vote
0answers
158 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) ...
3
votes
2answers
746 views

Truffle test, logs do not include an emitted event

I am calling a contract function which emits an event in a transaction. This transaction should include the event and is typically visible via: const receipt = await contractInstance.someFunction() ...
3
votes
1answer
312 views

Could event watch() traverse from latest block number(tail) to head?

In general, I assume events traverse from smaller to larger block number. Example: contractDeployedBlockNumber = 10000 fromBlock: contractDeployedBlockNumber, toBlock: 'latest' [Q] Could event ...
1
vote
1answer
844 views

Solidity event listener

This web3js event listener is part of a Voting Dapp. The listener listens for a transactions and re-renders the page to show updates. listenForEvents: function() { App.contracts.Election.deployed()....
0
votes
0answers
49 views

Best way to support restoring of all the keys of a mapping

I have a contract, in which I maintain the keys of a mapping in two different ways: Storing each key in an array Emitting an event for each key I do this in order to be able to restore the keys (and ...
3
votes
0answers
178 views

The sendSignedTransaction function does not activate the on('receipt') event at an appropriate time

console.log(transacting...); web3.eth.sendSignedTransaction('0x' + serializedTx.toString('hex')).on('receipt', receipt => { log(receipt); log(`https://ropsten.etherscan.io/tx/${receipt....
1
vote
0answers
14 views

One rpc connection faster than another

I have four synced peer nodes running on two separate machines. Nodes 1-3 have been around since the beginning of the block chain and are all on one machine while Node 4 was just added around block ...
0
votes
0answers
35 views

Private blockchain losing access to older blocks

So, my private blockchain became out of sync and one of the nodes reset to block 0 – it then synced up with the other nodes. The node that went to block 0 is the node that is providing the rpc port ...
0
votes
1answer
28 views

Event suddenly disapears when i call another function in my contract

So i am doing a factory for an ERC20 token contract, here is my factory code: pragma solidity >= 0.4.0 < 0.6.0; import "./ERC20.sol"; import "./ERC20Interface.sol"; contract Factory { ...
1
vote
2answers
101 views

Events loading too slow

I have a dapp running on rinkeby at the moment, you can try it now on cryptogol.io, but I am facing a problem when reading events from the Blockchain. For example, yesterday I make the events happens, ...
0
votes
2answers
358 views

Contract event - transactionIndex and logIndex

I need to monitor contract events and perform off-chain processing. How do I uniquely identify a contract event? Can I use a combination of these fields? - transactionHash - transactionIndex - ...
3
votes
2answers
533 views

What is the difference between getPastEvents() vs events.MyEvent({ fromBlock: 0})?

What is the difference between using myContract.getPastEvents() to get past events and using myContract.events.MyEvent({ fromBlock: 0, }) ? Also, if I pass to fromBlock a block number that has not ...