-
Notifications
You must be signed in to change notification settings - Fork 535
No events captured #841
Comments
@perbergman Can you check the deployment of the contract with |
curl http://:10002 -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_getCode","params":["0x7d75a8C6531b38a93A3B9A47b03aB6dA715831e4", "latest"],"id":1}' > out.txt |
I can run transactions and see them in Block Scout, and with queries, but I don't see any events. BTW, I can't get it to work with hardhat at all, no big deal though. |
@perbergman What happens when you start the event listener? Do you get any errors? Can you try using it with |
I started it with the 'ws' and I don't see any errors, no output at all. Seems my paste removed stuff, the URL is const WEB3_PROVIDER = 'ws://x.y.x:10002/ws'; I am running remotely from macOS --> AWS/ubuntu. |
I don't see an eth_subscribe command in that list above, but there is eth_unsubscribe? |
Hi @perbergman , I'm back with updates. Your event subscription script actually works.
|
I will try that. The issue might be that we deploy to a remote chain and networking etc. I am running a four-node Polygon Edge network with remote clients. I will try to run the listener locally as well. I wonder if it has to do with the naming of the topic as well. We are using ERC1155. |
I am running the Test contract remote with a listener locally, and now I see those events. Thanks, |
I got it to work all the way. The difference was when I did not use Truffle to deploy, but straight web3. |
Hi @perbergman , Thank you for your updates. I'm glad it finally worked. Please feel free to open an issue whenever there's need. |
[Ethereum events]
I am trying to use standard Ethereum event subscriptions, but I don't see any events.
Is this not supported?
Description
`const Web3 = require('web3');
const delay = time => new Promise(res=>setTimeout(res,time));
const WEB3_PROVIDER = 'ws://:10002/ws';
const web3 = new Web3(WEB3_PROVIDER);
const address = '0x';
async function main() {
console.log(1);
let x = await web3.eth.subscribe('logs', {
address: address,
topics: [
web3.utils.sha3("Transfer(address,address,uint256)")
]
}, (error, result) => {
if (error) {
console.error(error);
} else {
console.log(result);
}
});
console.log(x);
await delay(5*60000);
console.log(3);
}
main()
.then(() => process.exit(0))
.catch(error => {
console.error(error);
process.exit(1);
});
`
Your environment
OS and version
Server runs ubuntu 22.04.
version of the Polygon Edge
0.5.0
branch that causes this issue
Release
Steps to reproduce
Start the nodes.
Deploy the contract.
Start the event listener (above).
Run a test case operating the contract.
Expected behaviour
To see events being logged.
Actual behaviour
No events appear.
The text was updated successfully, but these errors were encountered: