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.

4
votes
0answers
399 views

Event and/or watch does not work

I have a contract for a simple bidding scenario as below: pragma solidity ^0.4.9; /* Contract accepting biddings during 30 minutes */ contract SimpleBidding { address contractOwnersAccount; ...
4
votes
0answers
116 views

Contract works fine in Solidity-browser but not against private node

I have been testing a contract using the Solidity Browser, but when I deploy the same contract on my private node, it doesn't seem to work the same as in the Solidity Browser. I have tried manually ...
4
votes
0answers
468 views

sendTransaction and events not working in NodeJS app

I have a contract deployed on the testnet, I can do the following within geth: reference.transfer.sendTransaction(bob, 467, {from:me}) However I can't do this within my node console (with web3 etc. ...
3
votes
0answers
187 views

Problem with multiple event listeners, duplicated event triggers

In my app i have multiple listeners (watchers) on different events of same contract. Nothing complicated. let songAddedEvent = instance.SongAdded({}, { fromBlock: 'latest', toBlock: '...
3
votes
0answers
521 views

Web3 Event Filtering timeout

This is the code I use to get all events from a certain contract. Solidity: event NewEvent(address indexed contractAddress, address newBOPAddress, address payer, uint commitThreshold, bool ...
3
votes
0answers
721 views

ERC20 Transfer Event error or intended?

I'm trying to get an Event "Transfer" for the ERC20 Token with web3 function getTransactionReceipt event Transfer(address indexed _from, address indexed _to, uint256 _value) You can see the term ...
2
votes
0answers
14 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 ...
2
votes
0answers
24 views

Accessing the network through light node

I've been trying, unsuccessfully, to make a web3.py app that needs to catch events, with the use of filters. After hours and hours of testing it appeared the problem was that Infura, which is the ...
2
votes
0answers
38 views

Truffle test to verify events can be queried by the address of the signing user?

I'm trying to write a test which verifies I can query a given type of events by the user/address which sign them. I would like to apply TDD (relevant to say I haven't made the implementation for this ...
2
votes
0answers
211 views

Parity syncing status for smart contract events with warp

So I'm trying to find the fastest way to fully sync a parity node in order to get all smart contract events, not just account states. The problem I've found is that when parity has warp syncing ...
2
votes
0answers
167 views

Web3 js events not listening after 5 mins of idle time

My contract is deployed on ropsten infura test-network and that contract has events which gets fired when there is some transaction. contract file function functionName(address from, address ...
2
votes
0answers
206 views

How to use logx in Solidity?

Aim: To log data from a smart contract. Following function is written in accordance with low level interface to Logs in ethereum. However, due to lack of documentation, and being new in Solidity, I ...
1
vote
0answers
10 views

Web3 Daemon Event listner

const DManage = new web3.eth.Contract(myABI, '0x9420D0904B2F696f8612239e5a507A86B5dA1b6a'); DManage.events.allEvents() .on('data', (response) => { console.log(event); }) .on('changed', (...
1
vote
0answers
20 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
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 ...
1
vote
0answers
20 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
0answers
110 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
0answers
34 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
0answers
73 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
89 views

Parity warp sync doesn't return event logs

Our Dapp uses events as a form of storage. For connection to blockchain we use local Parity node. A couple of days ago I needed to resync it after the server failure. After the resync all methods ...
1
vote
0answers
87 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
86 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
55 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
0answers
90 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
0answers
100 views

(1) Parity: why does syncing fall behind, (2) Why are events missing events because of (1)

Background: I have multiple parity nodes setup on Digital Ocean and AWS and event watchers attached to these nodes. I also have a service to query block numbers and compare versus etherscan's current ...
1
vote
0answers
560 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
0answers
63 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
95 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
103 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
0answers
268 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
34 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
684 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
427 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
9 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
0answers
11 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
0answers
12 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(...
0
votes
0answers
23 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 ...
0
votes
0answers
34 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....
0
votes
0answers
28 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
0answers
30 views

Get the entries of an event by an event filter in web3.py

here is my Solidity Contract: # Solidity source code contract_source_code = ''' pragma solidity ^0.4.1; contract Identities { event ExistProduction(bool); address private owner; mapping(address =&...
0
votes
0answers
28 views

Events show up on mined, disappear after

I have a function that fires an event at the end, I have more than one that works like this to create some kind of lifecycle through events. I get the full event history for every event as excpected,...
0
votes
0answers
37 views

How to read ALL logs of a certain event

When I read event logs like this: myContract.getPastEvents('myEventLogName', { fromBlock: 0, toBlock: 'latest' }) .then(function(events){ console.log(events) // same results as the ...
0
votes
0answers
249 views

“Invalid JSON RPC response” using web3.getPastEvent

I am using web3js to query a remote geth node (Geth/v1.8.14-unstable-35fcd2f4/linux-amd64/go1.10.3) for a particular event Ping emitted by a smart contract. myinstance = new web3.eth.Contract(myABI, ...
0
votes
0answers
53 views

can't read past event logs

const event = contractInst.Transfer({},{fromBlock: 0, toBlock: 'latest'}); events.get(function (error, result) { if (!error) { console.log(result); } }); The get ...
0
votes
0answers
203 views

Listen to filtered events using web3js 0.19 (provided by infura)

I am working on a uport dApp. uPort by default uses web3 from rinkeby.infura.io which is web3 version 0.19. So no WebSocket available. I tried ZeroClientProvider but that leads to this error: Error ...
0
votes
0answers
48 views

Events firing but bool variable not changing in value

Given a contract with an event as follows contract test { event LogEvent( address a, bool result ); function testInputs(some parameters) public (){ .... ...
0
votes
0answers
123 views

Unable to catch contract event using parity websockets

I have a contract deployed on ropsten which emits event when ether amount is deposited in it. I can see the event appearing in etherscan. this.web3Socket = new Web3(new Web3.providers....
0
votes
0answers
78 views

When exactly do events fire

I have a web3J application that is supposed to deploy a contract (by calling a function on another contract) then listen for the contractCreatedEvent that is fired by the factoryContract and then call ...
0
votes
0answers
19 views

Using two identical events with different names - does it have any additional cost?

More specifically, here is the dilemma that I'm facing: I have the following event: event MyEvent(address indexed addr, bool indexed state); Sometimes I emit it with false, and sometimes I emit it ...
0
votes
0answers
42 views

Are Event Logs mandatory and specified in ERC-20 or how to get transactions?

How do I get the transactions on ERC-20 contracts? What kind of information do I get and which is not included in event logs? Can I use same logic for reading logs of all erc-20 contracts or do I need ...