0

I try to interact with Ethereum node via web3 lib. (meteor add ethereum:web3)

Meteor 1.5.4.1

lib.js

if (typeof web3 === ‘undefined’){
web3 = new Web3(new Web3.providers.HttpProvider(‘http://127.0.0.1:21045’));
 }

main.js

web3.eth.defaultContractEvent = “0x*************************************”;
contract_event = web3.eth.contract(abi_event).at(web3.eth.defaultContractEvent);
 var events = contract_event.allEvents({fromBlock: 0, toBlock: ‘latest’});


get error at last line

C:\Users***\AppData\Local.meteor\packages\meteor-tool\1.5.2_2\mt-os.windows.x86_32\dev_bundle\server-lib\node_modules\fibers\future.js:280
 throw(ex);
 ^

TypeError: XHR2 is not a function
 at [object Object].HttpProvider.prepareRequest (packages\ethereum_web3.js:4315:15)
 at [object Object].HttpProvider.sendAsync (packages\ethereum_web3.js:4364:22)
 at [object Object].RequestManager.sendAsync (packages\ethereum_web3.js:6369:19)
 at Object.send [as newFilter] (packages\ethereum_web3.js:5080:42)
 at new Filter (packages\ethereum_web3.js:3568:25)
 at [object Object].AllSolidityEvents.execute (packages\ethereum_web3.js:2716:12)
at server/main.js:135:30

at Function.time (C:\***\.meteor\local\build\programs\server\profile.js:309:28)
at C:\***\.meteor\local\build\programs\server\boot.js:348:13
at C:\***\.meteor\local\build\programs\server\boot.js:389:5

Exited with code: 1

what is the problem?

0

Apparently there is a problem for event handling on server side when meteor+web3 is being used. I've been looking for an answer to this since 2 weeks now. :(

Link

I've found a guy trying to fix this in github but it was way out of my league.

Let me know if you find something... Cheers.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.