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

Swap old Digiconomist model for new ethereum-emissions model #14

Closed
5 tasks done
kylemcdonald opened this issue Dec 15, 2021 · 1 comment
Closed
5 tasks done

Comments

@kylemcdonald
Copy link
Owner

kylemcdonald commented Dec 15, 2021

ethereum_footprint.py needs to be almost completely replaced:

  • 1. In __init__, instead of loading the digiconomist energy consumption and etherscan gasUsed data, load the ethereum-emissions file daily-ktco2.csv which is regularly update on the gh-pages branch. Also, load an instance of the EthereumStats class, which will give you access to the tx_fees dict (mapping dates to total tx_fees).
  • 2. Remove kgco2_per_gas() from EthereumFootprint
  • 3. Remove get_etherscan_data() from EthereumFootprint
  • 3. sum_kgco2() should run a different calculation. First, sum all transactions fees (using tx.get_fees()) based on the date of the transaction (using tx.get_datetime()). Then for each day, divide the total fees from those transactions by the total fees on that day (using tx_fees from the EthereumStats instance). Finally, sum all values, then convert from kilotons to kilograms.

Separately:

  • 1. In contracts_footprint.py: add fees to each row and remove gas. Then re-run contracts_footprint.py and update the table in the readme.

Note: any server that regularly computes these numbers is going to need to run ethereum_stats.py on a daily basis to update the total transaction fees. Also, any emissions estimated for the current day should be treated with suspicion, as different data sources may be out of sync with each other.

@kylemcdonald
Copy link
Owner Author

closed by b674979

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

1 participant