blockchain-carbon-accounting
blockchain-carbon-accounting copied to clipboard
refactor chain code to work with new emissions type
Add new field for Emissions Type (UTILITY_EMISSIONS_ELECTRICITY, TRAVEL_CAR, TRAVEL_AIR) so that we can distinguish between different types of emissions for Scope 3 emissions calculation
Modify the data loading script, the recordEmissions chain code, and the tests to add support for this type field with UTILITY_EMISSIONS_ELECTRICITY. Current chain code for getEmissionsRecord should stay the same with UUID.
I think we can work with the flat file from https://www.gov.uk/government/publications/greenhouse-gas-reporting-conversion-factors-2019
We currently store the utility emissions factors from eGRID and EIA with country and state. Following the format of this spreadsheet, we can refactor the UtilityEmissionsFactorInterface in utilityEmissionsFactor.ts to have the following fields: Year Scope = "Scope 2" Level 1 = "Utility Emissions Factor" Level 2 = the current Country (ie USA) Level 3 = the current Division Type and ID, combining the two. So it could be "NERC_REGION: WECC" or "STATE: CA" Text = text field. Can be "Utility Emissions Factor" for utility emissions or the Text field from the UK file. Factor_uom = "MWH" co2_equivalent_emissions = same as now co2_equivalent_emissions_uom = same as now Source = This should be changed to a field in the loader, so we can enter "eGRID ... from ...." as needed.
Instead of changing the fabric emissions factors entities, create a new OrbitDB database.
Modify the egrid data loader to load the data into OrbitDB using this new format. Instead of using invokeChainCode, create a new function to record Emission factors on OrbitDB.
Modify the record emissions chain code to get the emissions factors from orbitdb using this new format.
Modify the test to use the existing OrbitDB database. You would not have to re-load it every time you run the tests.
@sichen1234 You mentioned
Level 1 = "Utility Emissions Factor" Level 2 = the current Country (ie USA) Level 3 = the current Division Type and ID, combining the two. So it could be "NERC_REGION: WECC" or "STATE: CA"
Could you just clarify if these "level-" fields are a replacement for our current 'division_type', 'division_id' and 'division_name' fields or not?
Yes, they do replace those fields. Also feel free to add some Level fields if the spreadsheet has them.