The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [filters]

filter for the logs fired by contract's events

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

Filters object not working for web3.eth.contract getPastEvents() method

I have referred, Web3 Events, but filters object is not working for me, I've got the same result for events before and after applying filter object. Here's the code: instance.getPastEvents( "...
0
votes
2answers
217 views

filter: logs.blockNumber = undefined

I have the following code: var filter = web3.eth.filter({ fromBlock:4076955, toBlock:"latest", address:"0x0123456789012345678901234567890123456789" }); filter.get(function(error,logs){ ...
0
votes
0answers
18 views

How to filter by string parameter , web3 2.0.0-alpha.1 Solidity events?

I'm trying to filter some events , and I noticed since I updated the web3 to version 2.0.0-alpha 1 the event catch is a little bit different. I have a Smart Contract with this event : event ...
1
vote
0answers
10 views

Changing from Filter to Subscribe with the current code im using

i'm having difficulties to change this line of code to web3.eth.subscribe anyone know how to write in subcribe for this since i want to change from old ver to new beta ver. const filter2 = web3....
1
vote
1answer
37 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 ...
0
votes
1answer
103 views

Query Ethereum Blockchain for functions return value of a Specified Smart Contract

I want to get smart contract functions return value sent by a specified smart contract within a range of blocks. I found a [manual] working method to achieve this: async function getTxsByAccount(...
0
votes
0answers
59 views

“Method not found” when trying to parity_subscribe to eth_getFilterChanges

Parity Ethereum version: 2.5.1-beta, tested on 2.4.6 as well Operating system: Linux (Ubuntu) Installation: binary Fully synchronized: yes Network: ethereum Restarted: yes I'm using a websocket. I ...
0
votes
1answer
121 views

How to use eth_newFilter to get pending incoming transactions to a contract?

I'm trying to get pending transactions to a certain contract using Infura. Is it possible to do that using eth_newFilter? Since apparently these filters only "trigger" from contract events, does that ...
2
votes
1answer
74 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
26 views

Catching FilterException web3j

I'm using web3j to subscribe for transactions: Flowable<Transaction> observable = web3.replayPastAndFutureTransactionsFlowable(startBlockParameter); Scheduler ...
0
votes
0answers
43 views

What does that Filter By means? in ropsten etherscan while deploying tokens on ropsten

I've deployed my token contract on ropsten etherscan. Sometimes it shows me some address besides Filter By what doed that filter by exactly means?
4
votes
3answers
3k views

filter indexed events from browser using web3.js

I Have a contract defined which logs 2 events : myEvent(string data, uint32 indexed id), myEvent1(string data, uint32 indexed id). I want to filter all the events on the browser using web3 by ...
2
votes
0answers
32 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 ...
0
votes
0answers
58 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 =&...
1
vote
2answers
807 views

How to get only latest log from my event?

I currently am using Oraclize in my contract and I make a call to a contract function from my front-end and don't want to continue onto the next call until the Oraclize function has returned. So I ...
6
votes
1answer
2k views

Understanding web3.eth.filter parameters

I have been looking through that web3.eth.filter function, and ran into a bit of a wall: var options = { fromBlock: "pending", toBlock: "latest", address: "...
5
votes
1answer
801 views

Cannot create filter on Infura via web3.py

I have an Infura account and I have the following code: ... web3 = Web3(HTTPProvider("https://ropsten.infura.io/mytoken") ) web3_pending_filter = web3.eth.filter('pending') ... when line ...
3
votes
2answers
981 views

Retrieving logs using filter is not working?

web3 has been connected to Infura node, can send signed transactions but web3.eth.filter is not working(405 error)?
1
vote
1answer
97 views

Using the same event name in different contracts

Suppose I have two different contracts, and I implement an event in each one of them. If I use the same event name in both contracts, will it make it more difficult (or even impossible) to filter the ...
10
votes
2answers
1k views

How can I trigger a PHP script when a transaction is received?

My goal is to have a PHP script be invoked whenever a transaction is received by a given address. I know Javascript but this is my first sally into Node.js. I think the right approach is to run a ...
3
votes
1answer
727 views

Filtering events by contract address and sender address

I need to watch events by two parameters: address of token contract and sender address. I found how to watch contract address, but not sure how to watch also by sender address? Shoud I specify address ...
1
vote
0answers
118 views

How to fix TypeError: 'xxx' is not a function

I have a project is to listen event of one deployed contract. Now I' m using BNB for testing. Here is my code: var Web3 = require("web3"); var fs = require("fs"); web3 = new Web3(new Web3.providers....
1
vote
0answers
106 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. ...
4
votes
1answer
239 views

web3.py createFilter: filter => SyntaxError: positional argument follows keyword argument

Web3.py version 4.2.1 geth version: 1.8.0-unstable I have followed web3.py guide for filtering. Through the contract instance api: event_filter = mycontract.events.myEvent.createFilter(fromBlock='...
52
votes
2answers
15k views

What does the indexed keyword do?

What does the "indexed" keyword do in the below line of code? I'm guessing it just tells the event object that the following input should be logged? Can we use it other places ie outside of events? ...
3
votes
0answers
560 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 ...
2
votes
1answer
234 views

Listing filters in geth. Do they timeout and expire?

Suppose I make a JSON-RPC call to create a new filter as follows (from the documention page): // Request curl -X POST --data '{"jsonrpc":"2.0","method":"eth_newFilter","params":[{"topics":["...
2
votes
1answer
2k views

web3.eth.filter({ fromBlock:1, toBlock: “latest” }).get() not working

web3.eth.filter({ fromBlock:1, toBlock: "latest" }).get() is not working on my geth console. I downgraded my geth from 1.5.9 to 1.3.5 to resolve this but it's still not working. Strange thing is that ...
1
vote
1answer
942 views

Python 3 How to make Event Filter via createFilter web3.py v4.2.1

According to the Web3.py Documentation: http://web3py.readthedocs.io/en/latest/filters.html Quote "event_filter = contract.events.myEvent.createFilter(fromBlock='latest', {'filter': {'arg1':10}})" ...
0
votes
1answer
69 views

Python How to make Filter topics: encode integers to its hex string representation

In the documentation: http://web3py.readthedocs.io/en/latest/filters.html Quote "Subsequent topic items are the hex encoded values for indexed event arguments. In the above example, the second item ...
1
vote
1answer
73 views

How to find all tokens that implements a specific contract

I'm trying to filter all the Tokens that implement a specific contract for a specific public address. I'm using web3 / metamask app. I'm trying to do it on via var options = { .... //address: ".......
1
vote
1answer
185 views

How reliable are Ethereum logs?

Do they have a lifespan? Can they be deleted? Have there been any cases of errors with logging or logs not being written? I'd like to know if I can rely on logs and build application logic on top of ...
2
votes
1answer
79 views

Is it possible Filter events with wildcards based on recorded indexed parameters

Let's say I have a contract that fire an event PersonCreated(uint personId, bytes32 indexed name) every time a person is created. To query for all the past events with name equal to Jason, we can ...
3
votes
1answer
566 views

web3.eth.getFilterChanges(web3_filter.filter_id) throws 'filter not found'

I am listening ethereum network through local geth node. I connected to geth through web3.py. I started a job in python code that periodically gets new blocks from filter. Here is the code: def main()...
1
vote
0answers
486 views

Web3.js filtering on allEvents

I'm struggling to figure out how to add a filter to allEvents requests. My current code: const contract = getState().web3Reducer.get('contract'); contract.getPastEvents('allEvents', { ...
4
votes
1answer
993 views

Are events in a contract triggered after that particular transaction is mined?

Let's say I have an event notify() in a function called buy(). event notify(); buy(){ //... notify(); } Problem here is that my the notify watch handle is triggered only after that ...
2
votes
1answer
887 views

Should I use Infura with Web3j for Event filter?

I'm using Web3j with Infura for smart contract deployment, calling contract method and transactions. Now I want to use Filter contract event from log. Should I use Infura for this? Is Web3j filter ...
1
vote
0answers
101 views

Why do null topics affect the output of filter logs in geth?

I'm connected to a private chain with geth and this is the output I get when trying to retreive logs (first topic is function signature): > eth.filter({'fromBlock': 0, 'toBlock': 'latest', address:...
0
votes
1answer
2k views

Mistake when using web3.eth.filter() and filter.get()

I went to the website https://etherscan.io/txs?block=4067373 and with that information choose the following address (third in line) to test on: 0x25f000254108a104A7127B5a5697cb3C12643e62 And the ...
1
vote
1answer
5k views

Using web3.eth.filter

The following link describes some of how the function web3.eth.filter(...) works: https://github.com/ethereum/wiki/wiki/JavaScript-API#web3ethfilter What I would like to do is get a list of the ...
0
votes
1answer
160 views

filter doesn't trigger events for my contract

I have a trivial contract and I want to get notification of all events for the contract. But I don't see any events being called for my contract: contract MainContract{ event Evt(address indexed ...
1
vote
1answer
339 views

Events in failed transactions

Can anybody say for sure, if the events that occur in failed transactions (i.e. before "throw") will not be logged?
3
votes
1answer
228 views

Events filtering with OR operator

I want to get all user's transactions from ERC20 compatible tokens. I can get all incoming transactions using this code: const to = token.Transfer({_to: account}, {fromBlock: 0, toBlock: 'latest'}); ...
1
vote
1answer
650 views

Problem with log filters in java (web3j). Maybe proble with geth parameters?

I'm having trouble trying to create a simple contract that "just log" to the blockchain what is being sent from a java client. The transaction executing the log looks to be correct (how can I be sure ...
4
votes
1answer
1k views

How do I filter an event by the hash of the transaction that generated the event?

I read the following in Andreas Olofsson's answer: Events can also be filtered by the hash of the transaction that generated the event Would someone please post an example of how to do this with ...
5
votes
3answers
763 views

How can I read log/events that have been triggered in the past?

I have a smart contract with an event. event NewContractCreated(address _callerAddress, address _newContractAddress); I know how to actively listen for new events: var newContractEvent = ...
2
votes
2answers
683 views

how to use filter from web3.js properly

I want to get the block number based on the transactionhash from filter,however, when I add the following codes to my project,I found it strange because sometimes it automatically transfer the money ...
5
votes
1answer
315 views

Filtering logs for entries greater than a specific value

I know that you can filter logs in web3 by topic using: web3.eth.filter({ topics: ["0x00..."] }).watch(console.log) Is it possible to filter for a topic value greater than a given value?
3
votes
1answer
1k views

How to extract all event logs from the blockchain?

I'm trying to extract all event logs from the blockchain, this is how I called an Event in the smart contract. function rateBook(uint id, uint rating, string comments) onlyMember { if (id > ...
16
votes
2answers
2k views

How do I retrieve the Voted events from TheDAO?

This question was asked by @Pablo Yabo in the comment section of the question How can I view The DAO proposals including the current voting status?.