Closed chumbalayaa closed 2 years ago
I assume you're running Etl against maybe a full node and not an archive node? That'd be my assumption
Thanks @FahdW, is there a param to select full vs. archive? I'm just querying BigQuery directly, and my understanding was the ethereum_blockchain was 100% complete
However, when I run the following I don't get data back - even though this is Justin Beiber's wallet and the guy has tons of Eth
function main() {
// Import the Google Cloud client library
const {BigQuery} = require('@google-cloud/bigquery');
async function getWalletBalances() {
// Create a client
const bigqueryClient = new BigQuery();
// The SQL query to run
const sqlQuery = `SELECT eth_balance
FROM \`bigquery-public-data.crypto_ethereum.balances\`
WHERE address = '0xE21DC18513e3e68a52F9fcDaCfD56948d43a11c6'`;
console.log(sqlQuery);
const options = {
query:
sqlQuery,
// Location must match that of the dataset(s) referenced in the query.
location: 'US',
params: {
},
};
// Run the query
const [rows] = await bigqueryClient.query(options);
console.log('Rows:');
rows.forEach(row => console.log(row));
}
getWalletBalances();
}
main();
Most likely because the public data set has not been updated in the recent times maybe?
You should be querying bigquery-public-data.crypto_ethereum
instead of bigquery-public-data.ethereum_blockchain
. The latter one is not being updated. Also the addresses should be lower-cased. Hope it helps
select *
from bigquery-public-data.crypto_ethereum.balances
where address = lower('0xE21DC18513e3e68a52F9fcDaCfD56948d43a11c6')
Some wallet addresses we have in our dao don't appear in queries we've written, but if we choose a random address from the preview data in BigQuery then it always returns a result. Happy to provide addresses but would rather not if it's a known issue why some might not appear?