0

Hello Ethereum community, I'm building a mobile app with ionic, i want that app to acces a specific smart contract address (that i made and own) and extract variables of that contract, at first i thought about using web3.js but it requires a RPC layer to work with and implies downloading the whole blockchain wich is not practical as a quick mobile app, second guess was using etherscan api but i dont find it usefull on that matter or i'm missing something. I need some suggestions thank you.

TL;DR Extract smart contract variables on a mobile app without downloading the whole blockchain.

1 Answer 1

0

You can use Infura. They're a public node that you can query directly. Something like this:

web3 = new Web3(new Web3.providers.HttpProvider("https://mainnet.infura.io/YOUR-API-KEY"));
web3.eth.contract(...).at("0x...").myPublicVariable(function (err, value) { ... });

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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