Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no value retuned for transaction? #1246

Closed
makc opened this issue Dec 22, 2017 · 3 comments
Closed

no value retuned for transaction? #1246

makc opened this issue Dec 22, 2017 · 3 comments

Comments

@makc
Copy link

makc commented Dec 22, 2017

I am running parity and then this code

var Web3 = require ('web3');

var web3 = new Web3 (new Web3.providers.HttpProvider ("http://localhost:8545"));

// https://etherscan.io/tx/0xfb8e4e5e112890ef60d279a047bf49923dd39f34efcc00d5c84272a7279fa584

web3.eth.getTransaction ("0xfb8e4e5e112890ef60d279a047bf49923dd39f34efcc00d5c84272a7279fa584", function () {
	console.log (arguments);
});

in node.js; the output is:

{ '0': null, '1': null }

why?

also tried this code:

web3.eth.getTransaction ("0xfb8e4e5e112890ef60d279a047bf49923dd39f34efcc00d5c84272a7279fa584").then (function (what) {
	console.log (what);
});

the result was

null

@eepstein
Copy link

From the code it looks like you were a) connecting to a local testrpc instance and b) (from the comment in) looking to find a transaction that was visible on the mainnet via etherscan.

The result you got - a null - is correct. There is no such transaction on your local testrpc.

This is not a bug.

If you want to use web3js to lookup live transactions on the mainnet, then you need to connect to a web3 provider on the mainnet. You have options for that from running your own parity or geth node to using Infura or similar, to using MetaMask if this is in a browser.

@eepstein
Copy link

This appears to be user error and not a bug. If so, it might be best to mark this issue resolved, close it, and continue the discussion on gitter.

@makc
Copy link
Author

makc commented Dec 24, 2017

okay, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants