0

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.WebsocketProvider('ws://18.221.50.19:8546'));

let contract = new this.web3Socket.eth.Contract(abi, walletAddr);

contract.events.allEvents({ fromBlock: 'latest' }, function (error: any, event: any) { console.log(error) })
    .on('data', async (log: any) => {                    
        console.log('Event Occured', log.event);
        if (log.event == 'Deposited') {
            // other operations
        }
    })

The parity server is running on a remote machine. When I run the code in my local machine it's able to detect the event but when I run the same code in that remote machine with the url set as 'ws://localhost:8546' it's not able to catch any event.

Parity - v1.10.6-stable-bc0d134-20180605, Web3 - 1.0.0-beta.34

  • I am also facing this same problem. Did you sorted it out? If so kindly help – Immanuel John Oct 10 '18 at 9:58
  • This does not really answer the question. If you have a different question, you can ask it by clicking Ask Question. You can also add a bounty to draw more attention to this question once you have enough reputation. - From Review – ivicaa Oct 10 '18 at 17:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.