0

Getting below rahul@rahul-Inspiron-5559:~/Desktop/web3js$ node index.js /home/rahul/Desktop/web3js/node_modules/web3/lib/web3/requestmanager.js:61 throw errors.InvalidResponse(result); ^

Error: invalid argument 0: hex string has length 40, want 64 for common.Hash at Object.InvalidResponse (/home/rahul/Desktop/web3js/node_modules/web3/lib/web3/errors.js:38:16) at RequestManager.send (/home/rahul/Desktop/web3js/node_modules/web3/lib/web3/requestmanager.js:61:22) at Eth.send [as getTransactionReceipt] (/home/rahul/Desktop/web3js/node_modules/web3/lib/web3/method.js:145:58) at Object. (/home/rahul/Desktop/web3js/index.js:8:24) at Module._compile (module.js:652:30) at Object.Module._extensions..js (module.js:663:10) at Module.load (module.js:565:32) at tryModuleLoad (module.js:505:12) at Function.Module._load (module.js:497:3)

My code is const express = require('express');

var app = express();
var Web3 = require('web3');

var web3 = new Web3(new Web3.providers.HttpProvider("https://mainnet.infura.io/3pyhj9C8itCWCabZpOcz"));

var receipt = web3.eth.getTransactionReceipt('0xf265505cCB849165B6DF6522C8e6823eC61491CD');
console.log(receipt);
  • I done it by myself. – Rahul Jun 29 '18 at 13:19

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.