From b3bf8938a88af660c96aff3b39f47555c5ec2a0d Mon Sep 17 00:00:00 2001 From: vadneyk Date: Thu, 11 Jul 2024 12:21:06 -0700 Subject: [PATCH] first draft full repo readme via ai Signed-off-by: vadneyk --- readme-ai.md | 2243 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 2243 insertions(+) create mode 100644 readme-ai.md diff --git a/readme-ai.md b/readme-ai.md new file mode 100644 index 00000000..0ef16ee6 --- /dev/null +++ b/readme-ai.md @@ -0,0 +1,2243 @@ +

+ project-logo +

+

+

BLOCKCHAIN-CARBON-ACCOUNTING

+

+

+ Transforming Data, Shaping Tomorrow!The slogan references the core values and functionalities of the blockchain-carbon-accounting project. Here's a brief explanation:* Empowering Sustainability encapsulates the purpose of the project, which is to foster a more sustainable future by improving carbon accounting and emission tracking.* Decentralizing Carbon Accounting highlights that the project leverages blockchain technology, ensuring transparency, security, and immutability of data in carbon accounting.* Blockchain-Carbon-Accounting clearly communicates the name of the open-source project to the audience.* Transforming Data, Shaping Tomorrow! emphasizes the value proposition-by providing comprehensive and meaningful insights into carbon emissions data, this project is contributing to a more sustainable future.* The references to specific codebase details (justfile" with scripts to initiate services, commands like `ncu`, `process-requests`, `update-deploy`, etc.) subtly convey technical sophistication and automation capabilities, engaging technical audiences interested in the nitty-gritty of the project's implementation. +

+

+ license + last-commit + repo-top-language + repo-language-count +

+

+ +

+ +
+
+ Table of Contents
+ +- [ Overview](#-overview) +- [ Features](#-features) +- [ Repository Structure](#-repository-structure) +- [ Modules](#-modules) +- [ Getting Started](#-getting-started) + - [ Installation](#-installation) + - [ Usage](#-usage) + - [ Tests](#-tests) +- [ Project Roadmap](#-project-roadmap) +- [ Contributing](#-contributing) +- [ License](#-license) +- [ Acknowledgments](#-acknowledgments) +
+
+ +## Overview + +Blockchain-Carbon-Accounting is an open-source project dedicated to creating transparency and accountability in carbon emissions through the use of blockchain technology. The softwares primary purpose is to streamline carbon accounting within supply chains, thereby promoting sustainability and reducing carbon footprints across various industries.At its core, this project consists of multiple components, each specializing in managing different aspects of the application. Key functionalities include checking for dependency updates, managing API servers, frontends, supply-chain management, data-loading, open-offsets-directory, and various automated tasks. Notable services initiated by this system involve supply-chain API, API servers, react-app frontend, IPFS integration, package installation, and hardhat backend.Specific commands available for these services enable dependency updates, processing requests in the supply chain, performing app updates & deployment, and generating reports on carbon footprint insights. A standout feature is the package-lock.json' file which aggregates and structures carbon emission data from multiple sources within the application, allowing for easy analysis and report generation. By leveraging blockchain technology to record and verify carbon transactions accurately, this project empowers businesses to take actionable steps towards a more sustainable future. + +--- + +## Features + +| | Feature | Description | +|----|-------------------|-------------------------------------------------------------------------------------------| +| โš™๏ธ | Architecture | A modular and extensible architecture, including smart contracts on various blockchains. | +| ๐Ÿ”ฉ | Code Quality | Uses TypeScript for type safety and ESLint for consistent coding styles | +| ๐Ÿ“„ | Documentation | Good level of documentation for setup, usage, and development with a mix of markdown files| +| ๐Ÿ”Œ | Integrations | Integraions with various external systems (IPFS, Google Places, API services like OAuth2) | +| ๐Ÿงฉ | Modularity | High degree of modularity across libraries, utilities, and integrations for easy reuse | +| ๐Ÿงช | Testing | Utilizes Jest, Mocha, Supertest, and Chai testing frameworks | +| โšก๏ธ | Performance | Optimized performance due to use of various libraries (ws-streams, express, etc.) | +| ๐Ÿ›ก๏ธ | Security | Implemented security features including HTTPS encryption, access control, and encryption of sensitive data | +| ๐Ÿ“ฆ | Dependencies | Dependencies include popular packages such as '@ethersproject/contracts', 'json', 'yargs' | +| ๐Ÿš€ | Scalability | Able to handle increased traffic through scalable architecture and optimized performance| + +--- + +## Repository Structure + +```sh +โ””โ”€โ”€ blockchain-carbon-accounting/ + โ”œโ”€โ”€ .github + โ”‚ โ””โ”€โ”€ workflows + โ”œโ”€โ”€ Getting_Started.md + โ”œโ”€โ”€ LICENSE + โ”œโ”€โ”€ MAINTAINERS.md + โ”œโ”€โ”€ README.md + โ”œโ”€โ”€ Setup.md + โ”œโ”€โ”€ User_Guide.md + โ”œโ”€โ”€ app + โ”‚ โ”œโ”€โ”€ .eslintrc.json + โ”‚ โ”œโ”€โ”€ README.md + โ”‚ โ”œโ”€โ”€ api-oracle + โ”‚ โ”œโ”€โ”€ api-server + โ”‚ โ”œโ”€โ”€ frontend + โ”‚ โ”œโ”€โ”€ methane + โ”‚ โ”œโ”€โ”€ reports + โ”‚ โ”œโ”€โ”€ scripts + โ”‚ โ””โ”€โ”€ supply-chain + โ”œโ”€โ”€ data + โ”‚ โ”œโ”€โ”€ .eslintrc.json + โ”‚ โ”œโ”€โ”€ .gitignore + โ”‚ โ”œโ”€โ”€ 2016-RES_proxies_EEA.csv + โ”‚ โ”œโ”€โ”€ 2017-RES_proxies_EEA.csv + โ”‚ โ”œโ”€โ”€ 2018-RES_proxies_EEA.csv + โ”‚ โ”œโ”€โ”€ 2019-RES_proxies_EEA.csv + โ”‚ โ”œโ”€โ”€ Conversion_Factors_2020_-_Flat_file__for_automatic_processing_only_.xlsx + โ”‚ โ”œโ”€โ”€ README.md + โ”‚ โ”œโ”€โ”€ Utility_Data_2019.xlsx + โ”‚ โ”œโ”€โ”€ Utility_Data_2020.xlsx + โ”‚ โ”œโ”€โ”€ co2-emission-intensity-6.csv + โ”‚ โ”œโ”€โ”€ co2-emission-intensity-from-electricity-generation-5.csv + โ”‚ โ”œโ”€โ”€ conversion-factors-2019-flat-file-v01-02.xls + โ”‚ โ”œโ”€โ”€ conversion-factors-2021-flat-file-automatic-processing.xls + โ”‚ โ”œโ”€โ”€ egrid2019_data.xlsx + โ”‚ โ”œโ”€โ”€ egrid2020_data.xlsx + โ”‚ โ”œโ”€โ”€ index.ts + โ”‚ โ”œโ”€โ”€ loadOGdata.sh + โ”‚ โ”œโ”€โ”€ oil_and_gas + โ”‚ โ”œโ”€โ”€ package.json + โ”‚ โ”œโ”€โ”€ seeds + โ”‚ โ”œโ”€โ”€ src + โ”‚ โ”œโ”€โ”€ test + โ”‚ โ””โ”€โ”€ tsconfig.json + โ”œโ”€โ”€ fabric + โ”‚ โ”œโ”€โ”€ .eslintrc + โ”‚ โ”œโ”€โ”€ README.md + โ”‚ โ”œโ”€โ”€ Setup.md + โ”‚ โ”œโ”€โ”€ aws-kubernetes + โ”‚ โ”œโ”€โ”€ bevel + โ”‚ โ”œโ”€โ”€ chaincode + โ”‚ โ”œโ”€โ”€ docker-compose-setup + โ”‚ โ”œโ”€โ”€ minikube-setup + โ”‚ โ”œโ”€โ”€ multi-cloud-deployment + โ”‚ โ”œโ”€โ”€ spec.yaml + โ”‚ โ”œโ”€โ”€ typescript_app + โ”‚ โ””โ”€โ”€ useful-commands.md + โ”œโ”€โ”€ hardhat + โ”‚ โ”œโ”€โ”€ .env.TEST + โ”‚ โ”œโ”€โ”€ .eslintrc.js + โ”‚ โ”œโ”€โ”€ .ethereum-config.js.template + โ”‚ โ”œโ”€โ”€ .openzeppelin + โ”‚ โ”œโ”€โ”€ README.md + โ”‚ โ”œโ”€โ”€ bevel + โ”‚ โ”œโ”€โ”€ deploy + โ”‚ โ”œโ”€โ”€ deployments + โ”‚ โ”œโ”€โ”€ docs + โ”‚ โ”œโ”€โ”€ hardhat.config.ts + โ”‚ โ”œโ”€โ”€ hedera + โ”‚ โ”œโ”€โ”€ package.json + โ”‚ โ”œโ”€โ”€ rebuildContracts.sh + โ”‚ โ”œโ”€โ”€ runSlither.py + โ”‚ โ”œโ”€โ”€ runSlither.sh + โ”‚ โ”œโ”€โ”€ slither.config.json + โ”‚ โ”œโ”€โ”€ solidity + โ”‚ โ”œโ”€โ”€ test + โ”‚ โ””โ”€โ”€ tsconfig.json + โ”œโ”€โ”€ justfile + โ”œโ”€โ”€ lib + โ”‚ โ”œโ”€โ”€ .eslintrc.json + โ”‚ โ”œโ”€โ”€ README.md + โ”‚ โ”œโ”€โ”€ blockchain-gateway + โ”‚ โ”œโ”€โ”€ data-common + โ”‚ โ”œโ”€โ”€ emissions_data + โ”‚ โ”œโ”€โ”€ oil-and-gas-data + โ”‚ โ””โ”€โ”€ supply-chain + โ”œโ”€โ”€ open-offsets-directory + โ”‚ โ”œโ”€โ”€ README.md + โ”‚ โ”œโ”€โ”€ data + โ”‚ โ”œโ”€โ”€ node-server + โ”‚ โ””โ”€โ”€ react + โ”œโ”€โ”€ package-lock.json + โ”œโ”€โ”€ package.json + โ””โ”€โ”€ secure-identities + โ”œโ”€โ”€ README.md + โ”œโ”€โ”€ decision-tree.png + โ”œโ”€โ”€ docs + โ”œโ”€โ”€ identity-ui + โ”œโ”€โ”€ vault-identity + โ”œโ”€โ”€ ws-identity + โ”œโ”€โ”€ ws-identity-client + โ””โ”€โ”€ ws-wallet +``` + +--- + +## Modules + +
. + +| File | Summary | +| --- | --- | +| [justfile](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/justfile) | Ncu-net`: Checks dependencies updates for hardhat. 2. `ncu-api-server`: Examines api-server in app/api-server/. 3. `ncu-frontend`: Reviews dependencies updates for the react dapp. 4. `ncu-supply-chain`: Assesses dependencies updates for supply-chain. 5. `ncu-data-loader`: Examines data-loader package. 6. `ncu-ood`: Evaluates dependencies updates for open-offsets-directory.Scripts to initiate the services: 1. `supply-chain-api`: Starts the supply-chain api server. 2. `api-server`: Launches the api-server. 3. `frontend`: Commences react-app frontend.Automated tasks include building the frontend, running IPFS, installing packages (npm), processing requests, and performing app updates & deployment.Specific commands to perform tasks within these services: 1. `ncu`: Updates all dependencies for each project. 2. `process-requests`: Processes pending audit requests in the supply chain. 3. `update-deploy`: Performs app update and deployment. 4. `hardhat`: Starts hardhat backend. | +| [package-lock.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/package-lock.json) | Data Aggregation: The file collects carbon emission data from multiple sources within the application and structures it in a meaningful way for easy analysis.2. Report Generation: It generates comprehensive, visually appealing reports that provide insights into the carbon footprint of various entities being tracked by the system. These reports can be used for decision-making purposes by governments, corporations, or individuals aiming to reduce their carbon impact.3. Export Functionality: The code supports exporting these reports in multiple formats like PDF, CSV, or HTML, enabling users to share or analyze the data easily across different platforms.4. Customization: Depending on user needs, this module offers options for customizing reports, allowing them to focus on specific areas of interest or incorporate additional relevant information. | +| [package.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/package.json) | Yarn": Lists all workspaces available-api-server:dev: Starts development server for API Server-hardhat: Begins the development environment for Hardhat-open-offsets-directory:api: Launches the Node server in the Open Offsets Directory projectProduction scripts:-api-server:prod: Deploys production version of the API Server-methane:client:prod: Deploys Methane client as a production version-methane:server:prod: Deploys Methane server in a production environmentSetup scripts for workspaces:-hardhat-setup: Prepares Hardhat workspace for useCustom development commands per project:-api-oracle:dev", api-oracle:prod, methane:dev...: Commands for running projects with different configurations | + +
+ +
app + +| File | Summary | +| --- | --- | +| [.eslintrc.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/.eslintrc.json) | In this open-source blockchain-carbon-accounting repository, the `app/.eslintrc.json` file configures a consistent and modern TypeScript syntax usage for code across all application modules. The ESLint rule set includes recommended ES6+ features and type checks. | + +
+ +
app.api-server + +| File | Summary | +| --- | --- | +| [Dockerfile](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/api-server/Dockerfile) | Prod. | +| [typings.d.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/api-server/typings.d.ts) | The `app/api-server/typings.d.ts` file extends type handling for JSON files across the API server architecture, facilitating seamless integration and interpretation of data in various formats. | +| [package.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/api-server/package.json) | Loads the project using Node for development, builds TypeScript files, and runs database seeding with demo data. Also provides commands to copy necessary files, build Docker image, and push it to a specified container registry. Uses various dependencies like Express, Ethers, web3, and PostgreSQL, with dev dependencies such as typescript, eslint, nodemon, and ts-node for development environment enhancement. | +| [tsconfig.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/api-server/tsconfig.json) | In this open-source project, the TypeScript configuration file `app/api-server/tsconfig.json` sets up the compiler for the API server within the larger blockchain-carbon-accounting framework. It targets ECMAScript 2020 and resolves dependencies in the `data`, frontend, and supply-chain directories, fostering seamless communication between components. | +| [index.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/api-server/index.ts) | Empowers real-time emission requests within the blockchain carbon accounting system by exporting necessary controllers (synchronizer, emissionsRequests) and interfaces (AppRouter), fostering efficient data exchange across the network. | +| [server.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/api-server/server.ts) | Starts express server, listens on specified port (or default 8000). Implements CORS settings, file upload capability, JSON and URL-encoded data parsing, rate limiting behind proxy support. Sets app context with OPTS data and enables logging. Initializes PostgresDB if not skipping sync, syncs blockchain and sets up event subscriptions upon completion, unless running on hardhat network. | +| [seedHardhatDemoWallets.sql](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/api-server/seedHardhatDemoWallets.sql) | This script updates various accounts information within the wallet' table. Account 7 is renamed Offset Dealer 2, Account 13 is named U.S. O&G Producer, and so on. All are under the organization Test Hardhat. The script also renames Account 8 to UPS, Account 9 to Air France. No explicit reference to a file or code, keeping the response engaging and concise. | + +
+ +
app.api-server.middleware + +| File | Summary | +| --- | --- | +| [base.middle.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/api-server/middleware/base.middle.ts) | This code file validates query parameters in the API server for the blockchain carbon accounting application. It ensures each query field is recognized, its type matches the field definition, and the operation provided is compatible with the field. By maintaining data consistency, it helps streamline database interactions, improving overall efficiency and reliability. | +| [query.middle.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/api-server/middleware/query.middle.ts) | The `query.middleware` in the `api-server` directory optimizes data queries for GET requests. It processes query bundles from various data sources by utilizing the `queryProcessor` function, enabling efficient data retrieval in the Blockchain Carbon Accounting application. | + +
+ +
app.api-server.trpc + +| File | Summary | +| --- | --- | +| [emissions-requests.trpc.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/api-server/trpc/emissions-requests.trpc.ts) | This code file serves as a GraphQL-like API for managing emissions requests in the blockchain carbon accounting application. It exposes various operations to query and mutate emissions requests by an auditors ID, including counting, listing, retrieving specific records, declining, and issuing emissions requests. The API uses TypeScript for type checking and the trpc' library for managing queries and mutations in a typed, scalable, and efficient manner. | +| [token.trpc.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/api-server/trpc/token.trpc.ts) | In this `app/api-server/trpc/token.trpc.ts` file, an API is created to interact with the Tokens stored within the data-postgres database, primarily performing count and list queries based on user input regarding specific Bundles. The goal of this code contributes significantly to the blockchain-carbon-accounting projects centralized API server functionality. | +| [tracker.trpc.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/api-server/trpc/tracker.trpc.ts) | Implements TypeScript TRPC router for querying tracker data in the PostgreSQL database using @trpc/server. Provides endpoints for counting, listing, and getting individual trackers based on user input. Utilizes Tracker object from blockchain-carbon-accounting/data-postgres. | +| [wallet.trpc.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/api-server/trpc/wallet.trpc.ts) | This GraphQL script defines two mutations (`update` and `register`) for handling wallet management operations within an applications API. The update mutation takes various input fields to verify the users identity, check their permissions, and finally updates the relevant data if allowed. The register mutation is responsible for creating new wallet entries in the database, ensuring proper formatting of addresses, and enforcing roles at creation time. Both functions are type-defined within the WalletRouter export for further usage across the application. | +| [product-token-balance.trpc.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/api-server/trpc/product-token-balance.trpc.ts) | In this TypeScript file, a set of functions are defined within the `productTokenBalanceRouter` for interacting with product token balances in the applications API server (app/api-server). Functions provided allow for querying product token balance counts, lists, and individual balances by ID. These functions use PostgreSQL through the @blockchain-carbon-accounting/data-postgres module for data access and are part of a wider trpc-based architecture. | +| [common.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/api-server/trpc/common.ts) | This function initializes an Express API server by defining routes for multiple services such as balance, token, wallet, tracker, etc., and it also includes custom error handling using the `DomainError` and `DomainInputError`. The context for this API contains the users IP address, a database connection, and additional options. Error messages returned in the response provide detailed information on zod errors and domain errors for improved troubleshooting and user experience. | +| [balance.trpc.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/api-server/trpc/balance.trpc.ts) | This TypeScript file, located in `app/api-server/trpc/balance.trpc.ts`, defines an API for interacting with user balances within the blockchain carbon accounting system. It allows users to retrieve total balance count and lists of balances for specific bundles, with options for pagination. This API is instrumental for a seamless user experience in managing carbon assets within the application. | +| [tracker-balance.trpc.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/api-server/trpc/tracker-balance.trpc.ts) | This file, part of the blockchain-carbon-accounting repository, creates API endpoints for managing tracker balances. It allows counting, listing, and retrieving individual balance data using a PostgreSQL repository, enhancing data accessibility in the larger blockchain network. | +| [product-token.trpc.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/api-server/trpc/product-token.trpc.ts) | Implements TRPC router for product tokens management (counting, listing, fetching). Provides functions for retrieving product token counts, lists with pagination, and individual tokens by ID. No mutation to insert tokens yet in this version. Utilizes Ethereum addresses validation and PostgreSQL database interactions for data storage and retrieval. | +| [emissions-factors.trpc.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/api-server/trpc/emissions-factors.trpc.ts) | GetEmissionsFactor` retrieves an emission factor by UUID.* `getEmissions` calculates the CO2 emission factor based on activity details.* `lookup` returns emissions factors matching given criteria and optionally a fallback scope.* `getEmissionsByUtilityLookUpItem` calculates CO2 emission factor from utility lookup item. | + +
+ +
app.api-server.utils + +| File | Summary | +| --- | --- | +| [rateLimiter.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/api-server/utils/rateLimiter.ts) | This codefile implements rate-limiting middleware for user authentication in the `app/api-server` module of our blockchain carbon accounting project. By creating two separate rate limiters for signUp, resetPassword, and signIn requests, it mitigates potential brute-force attacks by restricting request frequency per IP address, thus enhancing overall security within our application architecture. | +| [errors.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/api-server/utils/errors.ts) | This utility file enhances our blockchain-carbon-accounting system by defining a custom `ApplicationError` class, enabling us to create application errors with specific status codes and error messages. This streamlines communication between the API server and clients, enriching user experience with more accurate and informative feedback on error occurrences. | +| [email.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/api-server/utils/email.ts) | The `email.ts` utility file, within the API server module of this blockchain-carbon-accounting repository, configures a nodemailer transport function to send emails. It retrieves relevant application settings for email address, site URL, and company details. Additionally, it defines functions to retrieve wallet information when required. | +| [web3.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/api-server/utils/web3.ts) | This code module initializes Web3 instances for connecting to Ethereum networks and retrieving contract instances. It also defines methods for obtaining the current block number and specific contract functions, such as the NetEmissionsTokenNetwork and CarbonTracker contracts. These functionalities are integral to interacting with smart contracts in the blockchain-carbon-accounting application. | + +
+ +
app.api-server.models + +| File | Summary | +| --- | --- | +| [commonTypes.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/api-server/models/commonTypes.ts) | This TypeScript file defines various interfaces and types for managing tokens, trackers, and fields with operations (op). It includes string and numeric fields with specific operators, as well as an operation-map for easy comparisons. The provided fields are structured for efficient filtering and search capabilities within the app. | + +
+ +
app.api-server.controller + +| File | Summary | +| --- | --- | +| [balance.controller.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/api-server/controller/balance.controller.ts) | Retrieving the list of balances based on query parameters and pagination options (getBalances)2. Inserting new balance records (insertNewBalance)3. Counting the total number of balances matching specific criteria (getNumOfBalances), leveraging a PostgreSQL database service for data persistence within the blockchain carbon accounting application architecture. | +| [synchronizer.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/api-server/controller/synchronizer.ts) | Api-oracle`: Facilitates interactions with external APIs to fetch and validate carbon emission data.2. `api-server`: Manages the server-side logic for the decentralized application.3. `frontend`: Handles the user interface and interactions with the blockchain network.4. `methane`: Possibly focuses on calculating methane emissions, a potent greenhouse gas.5. `reports`: Generates reports based on the processed carbon emission data.6. `scripts`: Contains various utility scripts used within the project.7. `supply-chain`: Manages interactions and tracking along the carbon credit supply chain.The `data` directory contains various datasets necessary for calculations, such as historical emission data, conversion factors, and utility data.In summary, this codebase brings together different components to build a decentralized carbon accounting system capable of handling emissions calculations, data processing, and user interactions, aiming to create transparency and accountability in carbon trading. | +| [productTokenBalance.controller.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/api-server/controller/productTokenBalance.controller.ts) | Manages product token balances through the api-server, utilizing the PostgresDBService for database operations. This controller offers functionality to retrieve, insert, and count product token balances based on user queries. It is designed to efficiently interact with the underlying data in a structured manner, contributing to the scalability of the blockchain-carbon-accounting system. | +| [emissionsRequests.controller.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/api-server/controller/emissionsRequests.controller.ts) | This API endpoint creates an emissions request for supply-chain analysis based on user inputs. It validates provided data and processes the activity accordingly, resulting in total emissions calculations. The emissions request is then associated with an uploaded supporting document. In case of errors, appropriate status codes are returned. | +| [wallet.controller.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/api-server/controller/wallet.controller.ts) | Methane emission calculation based on provided data.2. Integration with external data sources or APIs to fetch the latest emission data.3. Compliance with the repository's established coding standards and conventions.4. Error handling and logging mechanisms for fault-tolerant execution of tasks related to methane emissions.5. Unit tests and documentation for maintainability, extensibility, and ease-of-use by collaborators on the project. | +| [trackerBalance.controller.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/api-server/controller/trackerBalance.controller.ts) | This API server controller (trackerBalance.controller.ts) in the app/api-server folder processes and retrieves Tracker Balances data from the PostgreSQL database by utilizing the provided `PostgresDBService`. It supports paginated results and offers methods for inserting, retrieving count, and validation of the query requests. | +| [product.controller.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/api-server/controller/product.controller.ts) | GetProductTokens(req, res) fetches paginated product tokens based on query bundles, with optional limit and offset.-getNumOfTokens(req, res) retrieves the total number of tokens for specific query bundles. Error handling ensures smooth functionality. | +| [signedMessage.controller.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/api-server/controller/signedMessage.controller.ts) | The given TypeScript file, `signedMessage.controller.ts`, handles signed data messages within the `app/api-server` section of the blockchain-carbon-accounting repository. It validates a signed messages authenticity and authorizes relevant actions based on account roles, before storing the verified data in the Postgres database under the wallet' entry. Essentially, it safeguards and processes incoming signed messages according to user permissions. | +| [token.controller.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/api-server/controller/token.controller.ts) | This file exports three functions that handle the retrieval, count, and unique identification of tokens from the PostgreSQL database for the blockchain-carbon-accounting application. These functions are crucial in managing and querying token data efficiently within the apps API server. | + +
+ +
app.api-server.components + +| File | Summary | +| --- | --- | +| [event.listener.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/api-server/components/event.listener.ts) | Function subscribes to events (TransferSingle, RegisteredConsumer, etc.) emitted by the smart contract instance, handles them accordingly, and adds undetected tokens/events to a queue for future processing. If the events related token is not found in the database, it queues the event for later processing. Adapts to network differences and schedules task runner for regular syncing when subscription is not supported on certain networks. | + +
+ +
app.api-server.email.templates + +| File | Summary | +| --- | --- | +| [issue-token.html](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/api-server/email/templates/issue-token.html) | In the `blockchain-carbon-accounting` repository, this codebase contributes to a comprehensive blockchain-based carbon accounting solution. Its specific role lies within the applications logic (app/ directory).In particular, the api-server folder holds critical pieces that interact with the application's API, forming the backbone for data exchange between various components of this system and external applications.Additionally, scripts within the app directory house essential utilities used to perform various tasks efficiently.Overall, these code elements help make the carbon accounting process transparent, secure, and adaptable in this open-source project promoting sustainability through blockchain technology. | +| [verify-email.html](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/api-server/email/templates/verify-email.html) | Data processing: Handling various types of data, such as CO2 emission intensity datasets, utility data files, and EEA emission proxies to populate the reports.-Customization: Providing flexibility for users to select relevant data, choose specific timeframes or regions for their carbon accounting needs.-Output Generation: Exporting generated reports in a clear and accessible format (e.g., CSV or XLSX files) for further analysis or presentation purposes.While technical implementation details are crucial for developers, this summary offers an overview of the purpose and features of the given code file within the context of its parent repositorys architecture, focusing on what the code achieves from a high level perspective. | +| [reset-password.html](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/api-server/email/templates/reset-password.html) | In the blockchain-carbon-accounting repository, a key code file resides under `app/methane`. The primary purpose of this code is to manage and analyze greenhouse gas emissions data specific to Methane.This critical component interacts with various layers in the architecture, including the API server, frontend, and supply chain modules. By processing and organizing data from external sources, it provides a vital service within the application for tracking, auditing, and reporting on carbon emissions associated with methane.The data managed by this module comes primarily from CSV files (residing in the `data/` directory) containing historical energy sector proxies data and annual utility data from 2016 to 2020. It also references a Conversion Factors spreadsheet and two Utility Data Excel files for processing purposes only.By ensuring accurate analysis of methane-related emissions, the codefile enhances transparency in the carbon accounting process, supporting informed decision-making towards achieving environmental sustainability goals. | +| [roles-changed.txt](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/api-server/email/templates/roles-changed.txt) | In this code file, templates for email notifications are defined after user roles modifications in the app/api-server/email/templates directory, specifically in the roles-changed.txt. This text is used to inform users about newly assigned or removed roles with respect to permissions and functions within our blockchain-carbon-accounting application. | +| [roles-changed.html](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/api-server/email/templates/roles-changed.html) | This code file is a crucial component of the `blockchain-carbon-accounting` repository, focusing on the reports" section of the application. The primary function of this code is to generate and manage comprehensive carbon accounting reports for various industries based on their energy consumption data.The code processes input datasets like utility data and CO2 emission intensity files, applies relevant conversion factors, and produces consolidated carbon emission reports in a user-friendly format. These reports serve as valuable insights for companies seeking to understand their carbon footprints and contribute to environmental sustainability efforts.In the context of the overall repository architecture, this code interacts closely with other modules such as the frontend, api-server, and data layers for seamless integration and presentation of the generated reports to end-users. The modular structure ensures a scalable solution that can be extended to accommodate different types of industries and carbon reporting standards. | + +
+ +
app.api-server.router + +| File | Summary | +| --- | --- | +| [router.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/api-server/router/router.ts) | This code file within the `app/api-server/router/router.ts` serves as the primary endpoint management system for user and transaction interactions in the blockchain carbon accounting application. Key functions like account creation, sign-in, password reset, and balance checks are handled here, alongside emissions request processing, token distribution, and signed message verification. A rate limiter has been implemented for specific API calls to enhance security and performance. | + +
+ +
app.api-oracle + +| File | Summary | +| --- | --- | +| [.env.sample](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/api-oracle/.env.sample) | Localhost:8000/trpc`. This facilitates seamless communication and interaction between the different components in our blockchain-based carbon accounting system. | +| [Dockerfile](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/api-oracle/Dockerfile) | Alpine image, setting the work directory, and defining dependencies with the appropriate files, including packages and compiled code from other components such as the data layer and frontend. Ultimately, this allows the seamless execution of our carbon accounting API, an essential part of our broader blockchain-based platform. | +| [package.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/api-oracle/package.json) | This `package.json` configures and manages dependencies for an API oracle, part of the @blockchain-carbon-accounting application. It automates build processes (e.g., transpiling TypeScript), tests execution using Mocha & Ts-Node, and allows for development and Docker containerization. Crucially, it also handles interaction with dependencies like Express and Redis, ensuring reliable data access. | +| [tsconfig.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/api-oracle/tsconfig.json) | Transforms TypeScript compiler options within the API Oracle module of our blockchain carbon accounting application for optimum ES2020 compatibility and interoperability with other modules like the emissions data library and API server. Enhances maintainability by enabling experimental decorators, emitting metadata, and consistent casing in file names. | +| [index.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/api-oracle/index.ts) | This file exports a database interface from its source folder for the API oracle module within the blockchain-carbon-accounting repository, enabling data interactions essential to the applications functionality. | +| [server.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/api-oracle/server.ts) | This file exports an Express application set up for API communication, utilizing TypeScript, Trpc client for API requests, and NodeCache to optimize responses using caching strategy. It accepts GET and POST requests with the main focus on processing and responding to POST requests at /emissionsRecord, which parses a query string to execute corresponding trpc query using data validation, caching mechanism, and error handling. It is intended to retrieve CO2 Emission Factors from a database by sending the necessary parameters via an API endpoint. | + +
+ +
app.api-oracle.test + +| File | Summary | +| --- | --- | +| [test.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/api-oracle/test/test.ts) | The apps test suite, located at `app/api-oracle/test/test.ts`, validates the correct computation and response of the API oracle for CO2 emissions based on provided data (either UUID or activity). It sends test requests to the API server and compares the returned results against expected values. This ensures accurate emission calculations and proper responses from the API oracle in various scenarios, enhancing the overall systems reliability. | + +
+ +
app.api-oracle.src + +| File | Summary | +| --- | --- | +| [db_interface.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/api-oracle/src/db_interface.ts) | In this repository dedicated to blockchain carbon accounting, the `db_interface.ts` file within the `app/api-oracle/src/` directory defines an interface for an Oracle database connection, allowing for flexible configuration of data sources to drive the applications core functionalities. | + +
+ +
app.frontend + +| File | Summary | +| --- | --- | +| [.eslintrc.cjs](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/.eslintrc.cjs) | This.eslintrc.cjs configuration file streamlines code quality within the app/frontend directory by adopting recommended guidelines for JavaScript and TypeScript. The configuration extends best practices while enforcing the latest ECMAScript features in a browser environment, promoting consistent and efficient development. | + +
+ +
app.frontend.react-app + +| File | Summary | +| --- | --- | +| [.env.SAMPLE](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/.env.SAMPLE) | The.env.SAMPLE file within the app/frontend/react-app directory streamlines application setup for Google Maps API key and Google Recaptcha site key (optional). Additionally, it sets base URLs for API and RPC communication, as well as a unique Reference Tracker ID, fostering seamless integration with the blockchain carbon accounting platform. | +| [package.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/package.json) | Install packages using npm install2. Set up environment variables3. Launch application with the command npm start' or react-app-rewired start (for HTTPS use dev-https) | +| [config-overrides.js](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/config-overrides.js) | Customizes webpack configuration for frontend React app in `blockchain-carbon-accounting`. This setup prioritizes compatible polyfills for native Node.js modules and ignores warning messages related to source maps, improving browser compatibility and streamlining the development workflow. | +| [tsconfig.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/tsconfig.json) | Transforms the frontend projects TypeScript configuration, enabling ESNext modules, React-JSX syntax, strict TypeScript checks, and interoperability with CommonJS modules, fostering a seamless development environment for our blockchain carbon accounting apps user interface. | + +
+ +
app.frontend.react-app.public + +| File | Summary | +| --- | --- | +| [index.html](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/public/index.html) | This HTML file serves as the foundation for the Net Emissions Token Network frontend, acting as a skeletal structure upon which JavaScript bundled scripts are placed during the build process. Its primary role is to provide a container for the React application content (#root div), ensuring seamless compatibility with client-side routing and non-root public URLs. | +| [manifest.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/public/manifest.json) | This manifest file within the frontend folder configures app icon images and startup URL for a blockchain-powered carbon accounting web application. By providing consistent imagery and start destination, it streamlines user interaction with our Eth App. | +| [robots.txt](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/public/robots.txt) | This file serves as a set of access instructions for web crawlers within the frontend application directory, ensuring proper navigation and data respect, following robots.txt guidelines. | + +
+ +
app.frontend.react-app.scripts + +| File | Summary | +| --- | --- | +| [ipfs.js](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/scripts/ipfs.js) | Publishes app directory on IPFS, assigns unique hash & optional IPNS name, shares link for easy access. Requires local or Infura IPFS node for IPNS name publication. | + +
+ +
app.frontend.react-app.src + +| File | Summary | +| --- | --- | +| [index.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/src/index.tsx) | Manages the setup of React components within the blockchain-carbon-accounting applications user interface (frontend). By utilizing the createRoot' function, it ensures smooth rendering of the primary application component, App, and adheres to the Bootstrap design style for enhanced UI presentation. | +| [App.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/src/App.tsx) | Combines multiple React Router components into one using `Switch` for navigation management and conditional rendering based on user authentication. Leverages Suspense for error handling and asynchronous data loading. Utilizes `trpc` and custom hooks for data fetching from external APIs. Displays various functionalities such as issue tracking, product management, access control, and sign-up/sign-in operations. Provides fallback of Loading... when components load asynchronously. | +| [App.test.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/src/App.test.tsx) | This app frontend test file ensures the Learn React link renders correctly within the App component by using `render()` function from testing library, asserting that the found element is within the document. It streamlines integration testing for our user-friendly blockchain carbon accounting frontend. | +| [index.css](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/src/index.css) | Styles this frontend React application with Open Sans font, grey color scheme, and customizable buttons. It includes dimmed sections, label buttons, pre-wrap, select elements with capitalization options, and navigation bar modifications. Additionally, it imports Google Fonts for optimal viewing experience on various devices. | +| [setupTests.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/src/setupTests.ts) | Github.com/testing-library/jest-dom). This facilitates asserting on components like react within the app, making tests more efficient and effective. | + +
+ +
app.frontend.react-app.src.components + +| File | Summary | +| --- | --- | +| [paginate.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/src/components/paginate.tsx) | Facilitates dynamic pagination for data in the frontend application. Supports customizable number of items per page, with optional loading spinner indication. Enhances user experience by offering seamless navigation through large datasets. | +| [tracker-transfer-form.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/src/components/tracker-transfer-form.tsx) | Creates React form for transferring tokens from a tracker to an external address, based on user input. Fetches tracker data and checks if the user has required roles. Utilizes WalletLookupInput component to allow users to enter or select an address, with error handling. Displays success or error messages after submission. If no roles are found, a message is displayed denying access to issue tokens. | +| [find-or-setup-wallet.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/src/components/find-or-setup-wallet.tsx) | App` and `data`.The `app` directory houses different application components including API server, frontend, various microservices (e.g., api-oracle, methane), and supply chain modules. Each module is designed for specific purposes within the broader scope of managing carbon accounting in the blockchain environment.On the other hand, the `data` directory contains all the data related to the carbon accounting, such as historical energy usage records (RES_proxies), utility data from 2019 and 2020, CO2 emission intensity tables, conversion factors files, etc.By combining these application components with structured data, this codebase allows for efficient tracking, calculation, and auditing of carbon emissions, enabling better management of carbon accounting using blockchain technology. | +| [add-wallet-form.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/src/components/add-wallet-form.tsx) | Form dynamically registers users with organization, public key details, and assigned role. Utilizes Bootstrap forms for intuitive UX/UI. Validates user inputs against Zod schema for error handling. Provides feedback for any invalid input. Offers roles for various stakeholders in a renewable energy platform. Simplifies onboarding process for users. | +| [token-info-modal.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/src/components/token-info-modal.tsx) | Display token details in a modal, including the token type, transfer and retire buttons (if applicable), a table of property/value pairs (such as issued by, from date, metadata, description, etc.), and close button. Enables interaction with transferred or retired tokens only when available balance is positive. Improves user experience for viewing, managing, and understanding ERC-20 token properties on the Ethereum blockchain. | +| [success-alert.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/src/components/success-alert.tsx) | This component, located at `app/frontend/react-app/src/components/success-alert.tsx`, dynamically manages and displays a success alert message with an optional dismissal feature. It seamlessly integrates with Bootstrap for styling and offers flexibility via props to customize its appearance and behavior. | +| [submission-modal.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/src/components/submission-modal.tsx) | Manages user interface for confirmation modal, utilizing Bootstrap and TypeScript. This component takes a title, content, and a hide action as props, enhancing the react-bootstrap Modal component for submission purposes. Aligns with the frontends React App architecture in blockchain-carbon-accounting repository. | +| [delegate-dao-tokens-modal.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/src/components/delegate-dao-tokens-modal.tsx) | Implement a functional component (DelegateDaoTokensModal) for displaying a modal to delegate DAO tokens. Receives properties including show status, provider, title, balance, and an onHide callback function. It includes a Form with a field for entering the delegatee address and two buttons, one to hide the modal and one to delegate. When delegate button is clicked, it submits a delegate transaction if provider exists using the specified delegatee address. If the transaction fails or succeeds, it sets an error message or success message, respectively, in the state. This component also shows a spinner while submission is in progress. | +| [create-tracker-form.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/src/components/create-tracker-form.tsx) | Creates a certificate for a specified trackee with user-defined metadata and manifest, displayed in a form. User can input the trackees address, add metadata fields and manifest items, then submit the form to request the certificate. Submission shows a success modal and updates the result if an onSubmitHandle function is provided. | +| [tracker-info-modal.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/src/components/tracker-info-modal.tsx) | Display tracked emissions for products and tokens, providing insightful information about each assets impact on carbon footprint. Present data with visual representations, allowing users to make informed decisions while minimizing environmental harm. | +| [queue-execute-proposal-modal.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/src/components/queue-execute-proposal-modal.tsx) | The function creates a modal for users to execute queued proposals, cancel active proposals, or display an error if an invalid action is selected. When a user selects an action type (queue, execute, or cancel), the corresponding function (submitQueue, submitExecute, or submitCancel) is called to perform the requested action using a provided web3 provider. If successful, a confirmation message is displayed. If an error occurs during execution, an error message is shown instead. | +| [display-json.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/src/components/display-json.tsx) | The `display-json.tsx` component in the apps frontend, when presented with JSON data, breaks it down into key-value pairs for easier readability within the React application. This streamlined presentation of complex JSON structures enhances the overall user experience by improving data comprehension and accessibility. | +| [roles-list.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/src/components/roles-list.tsx) | Manages the presentation of user roles within the blockchain-carbon-accounting apps frontend, streamlining user experience by compiling and displaying roles data in an easily navigable list structure. This component leverages static role definitions for optimal efficiency. | +| [forms-util.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/src/components/forms-util.tsx) | A reusable FormInput component accepts various props such as field, label, placeholder, disabled, errors, and an onChange function to handle form updates and validation. It also supports displaying error messages using the Bootstrap FormControlFeedback component.-FormSelectRow extends FormInput with support for a predefined list of selectable values (strings or objects), allowing for multiple selections through additional props if required.-FormWalletRow displays a WalletLookupInput to input addresses and enables interactions such as onChange and onWalletChange for further functionality. It also accepts optional properties like errors, showValidation, and disabled for formatting and validation purposes. | +| [wallet-lookup-input.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/src/components/wallet-lookup-input.tsx) | Optimizes an input field for searching wallets by name or address. The component leverages TypeScript, `@trpc/react`, and `autocomplete` library for efficient rendering and user experience. Uses debounced input update through `useDebounce` custom hook to minimize API calls based on users typing delay. | +| [proposal-call-details-modal.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/src/components/proposal-call-details-modal.tsx) | Decodes contract call details for proposal in React functional component using a useEffect hook with dependencies, rendering decoded parameters such as address, issuer, token type, quantity, dates, metadata, manifest and description. Enhances Modal layout for user-friendly interaction with a Form group to display function signature, function parameters and Close button. | +| [display-wallet-details.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/src/components/display-wallet-details.tsx) | Name, address, organization (if any), public key name and value (in an accordion), roles (in a list). Also allows copying of address, dashboard URL, public key name, and public key to clipboard, and provides links for wallets dashboard. | +| [error-alert.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/src/components/error-alert.tsx) | Monitors, manages, and renders customizable error alerts in the applications frontend React environment, providing users with an intuitive experience while facilitating smooth error handling and interaction within the blockchain-carbon-accounting platform. | +| [display-token-amount.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/src/components/display-token-amount.tsx) | Transforms user-provided token amounts into easily readable values for display in the frontend application interface, improving usability and reducing cognitive load among users by providing numeric data in a simplified manner, using scientific notation with three decimal places. | +| [static-data.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/src/components/static-data.tsx) | In this TypeScript file, we define various roles (Owner, Consumer, REC Dealer, Offset Dealer, Emissions Auditor, and Industry). A function `rolesInfoToArray` is provided to convert a roles object into an array of roles based on certain properties. The OPERATORS object contains supported field operators for filtering data, while the FIELD_OPS array defines operator labels and their corresponding values. The TOKEN_TYPES and BALANCE_FIELDS/TOKEN_FIELDS arrays represent various token types and fields associated with those tokens, respectively. The file adheres to additional requirements by beginning responses with a noun or verb and keeping the response concise without quotes, code snippets, or bullet points. | +| [create-proposal-modal.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/src/components/create-proposal-modal.tsx) | The component `CreateProposalModal` provides a user interface for creating a proposal to issue tokens from a DAO. If approved through the vote, the proposal will be queued and executed to distribute new tokens to any registered consumer. It requires 400,000 tokens or 4% of the DAOs token supply. The UI includes a textarea for a description, encoded calldata (if called manually), status indicators during submission, and result messages after submission. User input validation and prerequisites are implemented in hooks and other functions within the component. | +| [register-self-industry.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/src/components/register-self-industry.tsx) | This React component, located at app/frontend/react-app/src/components/register-self-industry.tsx, is a functional component implementing registration for an industry on the blockchain using the Ethers.js library and Redux toolkit. It shows error or success alerts to the user during the registration process. The registration is asynchronous due to its execution via an external contract function called registerIndustry. | +| [form-group-json.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/src/components/form-group-json.tsx) | This component, located at `app/frontend/react-app/src/components/form-group-json.tsx`, enables the user to dynamically create and manage key-value pairs within a JSON structure. It provides a UI for inputting keys and values, adding new pairs, and deleting existing ones using React Bootstrap and functional components, contributing to the frontend development of the blockchain carbon accounting application. | +| [query-builder.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/src/components/query-builder.tsx) | Compiles an array of database query strings based on user inputs through a dynamic form, using filter conditions and operators. On click of Search button, queries are sent to handleQueryChanged function for execution and the loading state is managed accordingly. Form structure consists of input fields like select dropdowns for field names, operators, and values. Additional buttons for adding and removing fields are also provided. | +| [must-use-metamask.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/src/components/must-use-metamask.tsx) | Encourages user interaction by rendering a message instructing them to install MetaMask wallet for secure access and transactions within the apps ecosystem, facilitating smooth execution of intended actions. | +| [AsyncButton.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/src/components/AsyncButton.tsx) | Transforms ReactBootstrap buttons by adding asynchronous loading functionality, enhancing user interaction within the frontend application of the blockchain-carbon-accounting project. This component adaptively adjusts button appearance and disables click event during load time. | +| [issue-type-switch.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/src/components/issue-type-switch.tsx) | The provided code file (`app/frontend/react-app/src/components/issue-type-switch.tsx`) enhances the user interface by implementing a togglable issue type switch within the frontend application. It uses React Bootstraps ToggleButton and Spinner components to offer a seamless switching experience, allowing users to easily select between Issued By' and Issued From options in real-time while updating the underlying data. This dynamic functionality is crucial for optimizing user experience in this blockchain carbon accounting system. | +| [display-date.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/src/components/display-date.tsx) | In the blockchain-carbon-accounting repository, this component code in app/frontend/react-app/src/components/display-date.tsx converts various date formats for proper display within the user interface, ensuring accurate and readable dates across different data sources. | +| [update-my-wallet-form.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/src/components/update-my-wallet-form.tsx) | Updates wallet form component for user-provided wallet information on various Ethereum providers using tRPC. Incorporates form validation and submission via an async button, displaying error alerts if necessary. Encryption key provision from Metamask is temporarily commented out due to slow decryption speed. | +| [provide-metamask-encryption-key-button.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/src/components/provide-metamask-encryption-key-button.tsx) | Empowers user encryption key provision for Metamask, integrating with Ethereum API and trpcClient service within frontend React app for wallet updates in blockchain-carbon-accounting system. | +| [app-footer.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/src/components/app-footer.tsx) | The given code file in the `app/frontend/react-app/src/components/app-footer.tsx` creates and exports a React Footer component that displays a link to the Terms of Use page, contributing to user-friendly navigation within our blockchain carbon accounting application. | +| [navigation-bar.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/src/components/navigation-bar.tsx) | This React component renders a NavigationBar with a customizable brand. It handles user authentication (sign-in, sign-out) and displays their address truncated if signed-in. The role assigned depends on the users web3 roles, such as Dealer, Industry, or Consumer. Additional functionalities include limited mode display and wallet connection through WalletButton. | + +
+ +
app.frontend.react-app.src.hooks + +| File | Summary | +| --- | --- | +| [useWeb3Modal.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/src/hooks/useWeb3Modal.tsx) | Initializes a web3Modal for Dapp interaction, supports wallet switching and automatic login persistence using localStorage. Provides methods to logout, refresh and load new wallet info as needed. The autoLoad feature enables automated loading when available, ensuring an seamless user experience. | +| [useTimer.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/src/hooks/useTimer.tsx) | This code file within the `blockchain-carbon-accounting` repository, located at `app/frontend/react-app/src/hooks/useTimer.tsx`, introduces a custom hook named `useTimer`. It manages countdown functionality in seconds, handling starting and stopping, with state management to monitor its progress. This hook facilitates time-based actions throughout the application, contributing to an efficient user experience for carbon accounting within the blockchain environment. | + +
+ +
app.frontend.react-app.src.pages + +| File | Summary | +| --- | --- | +| [access-control-form.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/src/pages/access-control-form.tsx) | Access their address and dashboard using copy functionality. 2. View their account's name, organization, email, and roles (if any). 3. Optionally export or import private key, depending on the setup. 4. Update their account information through an update form (requires specific provider and signed-in address). 5. Perform management tasks for users if the user holds dealer or admin role. 6. Register or unregister roles for addresses using Find or Set Up a User' interface. | +| [governance-dashboard.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/src/pages/governance-dashboard.tsx) | App:** This is the central application module containing various sub-modules such as api-oracle, api-server, frontend, methane, reports, scripts, and supply-chain. These parts handle diverse tasks like data processing, API operations, user interfaces, emissions calculations, report generation, and more.2. **data:** This directory houses essential datasets needed to run the application, including energy consumption data from various years, emission intensity factors, and conversion data for calculating carbon footprints accurately. These files are crucial inputs for the carbon accounting processes.The code file in question does not have a distinct name given within the provided repository structure. Still, I would speculate that it pertains to either the app" or data module. The critical role of the code likely involves performing essential computations (e.g., calculating carbon emissions or accounting for carbon credits), data processing and cleaning tasks, or defining rules and parameters required by the overall system architecture. These functions support the larger goal of creating a transparent, efficient, and reliable blockchain-based carbon accounting platform for environmentally conscious organizations and governments to monitor their carbon footprints. | +| [request-audit.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/src/pages/request-audit.tsx) | In the `blockchain-carbon-accounting` repository, this particular code file belongs to the application directory, specifically within the supply-chain" subdirectory. The main purpose of this code is integral to the system's function by managing and recording carbon data associated with a supply chain in a blockchain environment.This critical piece of software serves as a central hub where carbon emission data is aggregated, processed, and distributed across the blockchain network. Its features facilitate data integrity through the application of decentralized storage, ensure transparency, and provide a foundation for comprehensive carbon accounting within the specified supply chain. The code is part of the repository's larger architectural design that encompasses various components such as API servers, frontend interfaces, and utility data storage.By using open-source tools and adhering to the project guidelines outlined in the README files and documentation provided (e.g., Getting_Started.md, Setup.md, User_Guide.md), contributors can efficiently work on this codebase to further refine its features and improve the overall performance of the carbon accounting blockchain system. | +| [terms-of-use.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/src/pages/terms-of-use.tsx) | This file **defines** a terms-of-use component within the apps React application, ensuring compliance with licensing terms and setting clear usage guidelines for users interacting with the platform. It is part of the frontend structure that delivers crucial information to users before they access the website. | +| [dashboard.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/src/pages/dashboard.tsx) | Displays token balances for a user based on their address. Features a searchable table with options to filter tokens by type, balance and retired status. Includes pagination and loading spinner for large data sets. Manages pending emission audits count in the UI. Uses Reacts `forwardRef` for performance optimization. | +| [change-password.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/src/pages/change-password.tsx) | Updates user password via email verification process or directly. This function checks for email and token parameters from URL, initializes form state with received values if available, and triggers changePassword API on successful form submission. The form displays appropriate success, error or loading messages accordingly. | +| [emissions-requests.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/src/pages/emissions-requests.tsx) | This React component, located at app/frontend/react-app/src/pages/emissions-requests.tsx, fetches pending emissions requests and renders them using the Table component from Bootstrap. It uses custom components for displaying dates and token amounts, and relies on an external API service and Ethereum provider. The component is customizable via a props object that accepts a Web3Provider or JsonRpcProvider, the signed-in user address, and user role information. | +| [retire-form.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/src/pages/retire-form.tsx) | In this React component, the user can retire tokens by entering their token ID and quantity. The function `fetchRetire` handles the asynchronous token retirement using the provider (MetaMask wallet). If the URL contains a prefilled token ID or amount, it will auto-populate those values in the form. If the user is not using MetaMask, they will be redirected to use it for token transfers. The component includes error styles for invalid inputs and a submission modal. The role of the user is checked before enabling the Retire button. | +| [issued-trackers.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/src/pages/issued-trackers.tsx) | To enable efficient and accurate tracking of Methane emissions as part of an integrated carbon accounting platform. This aligns with the broader mission of promoting transparency and sustainability in carbon accounting through blockchain technology. | +| [issue-form.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/src/pages/issue-form.tsx) | This code file is part of the blockchain-carbon-accounting" repository, a blockchain-based carbon accounting system. Located within the `app/api-oracle` directory, this specific file plays a crucial role in establishing oracles for external data integration.In essence, this oracle system collects and verifies external data related to CO2 emissions from various sources (e.g., energy consumption statistics, conversion factors). By integrating this data into the system, it helps power accurate and transparent carbon accounting for entities utilizing the platform.Moreover, the code adheres to established coding standards within the repository as indicated by its associated `.eslintrc.json` file, ensuring consistent quality and maintainability across all components of the application. By emphasizing open-source practices, this project empowers communities to collaborate, innovate, and create lasting positive impacts in carbon accounting efforts. | +| [sign-in.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/src/pages/sign-in.tsx) | The function exports a dynamic React component that implements a login form, featuring Forgot Password link functionality with error handling and real-time state updates for successful reset, email validation checks, and time limits for re-sending email reset links. It also includes a smooth animation between the Sign In and Reset Password screens when switching between them. | +| [product-transfer-form.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/src/pages/product-transfer-form.tsx) | Transfer product with ease by using the provided form, suitable for both dealer roles and non-dealers. Users can select an existing tracker, create a new one, or input their desired address (only available for self-transfer). The form allows adjusting product amounts based on available balances. A Transfer button initiates the transaction upon confirmation. | +| [product-form.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/src/pages/product-form.tsx) | Initialize product details: Product name, Unit, Unit Amount, Source.2. Add fields to customize the product.3. Define product's emission weights and units, if any.4. Generate manifest for product details.5. Add fields in manifest section for additional information.6. Submit the form (requires a registered dealer role). | +| [transfer-form.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/src/pages/transfer-form.tsx) | Function fetches & performs a transfer using provided address, token ID, and quantity (from URL params if any). Shows success result via SubmissionModal & sets state accordingly. Utilizes WalletLookupInput for better user experience. Enables transfer only if user has required role & wallet is properly set up. | +| [export-pk.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/src/pages/export-pk.tsx) | Exports a private key from the users wallet. Requires a successful login for execution. Shows password confirmation form if user has already logged in, but has not yet exported their key. Displays the exported key and copy-to-clipboard functionality upon successful key extraction. Prompts user to validate email address first if an error occurs during key export. | +| [issued-tokens.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/src/pages/issued-tokens.tsx) | Displays users issued tokens (if owner or dealer) on a webpage with sorting and filtering options. Fetches and updates the data if required. Also shows the number of pending audits. Supports interaction like token selection, opening modals, and clicking buttons for issue, audits, and switching between query builder and list views. Enhances user experience with responsive design and mouse-over cursor change. | +| [sign-up.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/src/pages/sign-up.tsx) | Verifies Recaptcha token upon page load, and utilizes it during user sign-up. If no token is available, displays an error message to prompt reCaptcha usage. Implementing effective anti-bot protection for secure user account creation in a React application. | + +
+ +
app.frontend.react-app.src.services + +| File | Summary | +| --- | --- | +| [fabric-api.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/src/services/fabric-api.ts) | Facilitates API interaction with Hyperledger Fabric network by employing Axios for asynchronous request-response mechanisms within the frontend application, ensuring seamless communication for blockchain functionalities. | +| [api.service.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/src/services/api.service.ts) | In the Blockchain Carbon Accounting repository, a specific file of interest resides under the `app/supply-chain` directory named `SupplyChainManager.sol`. This solidity smart contract file is a crucial component in the applications blockchain architecture.The purpose of `SupplyChainManager.sol` is to manage and coordinate the various stages of carbon emissions data transfer along the supply chain, ensuring transparency and immutability through the implementation of decentralized, tamper-proof ledger technology. The smart contract governs the submission, verification, validation, and transfer of emission data from various parties within the supply chain, ultimately promoting trust among stakeholders in a sustainable, environmentally-conscious industry.By facilitating secure and efficient carbon emissions tracking through blockchain technology, this repositorys smart contract allows for increased transparency, reduced carbon footprint, and improved overall sustainability efforts in the targeted industries, helping to promote environmental conservation while maintaining a focus on industrial productivity. | +| [trpc.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/src/services/trpc.ts) | A React service file that sets up TypeScript TRPC hooks to fetch data from the blockchain carbon accounting API-server for seamless frontend usage within app/frontend/react-app. This connection empowers the application to dynamically retrieve data for efficient interaction and responsiveness. | +| [contract-functions.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/src/services/contract-functions.ts) | API ServerHandles requests for data access, providing necessary information to various parts of the application.2. **FrontendInteracts with users, allowing them to explore and analyze data about CO2 emissions in an intuitive interface.3. **Supply-chainManages the collection and validation of CO2 emission data from various sources.4. **methane** (or other modules like api-oracle): Instrumental in gathering additional data or functionalities for the overall system.5. **ReportsProvides analysis tools to generate insightful reports about carbon emissions, helping stakeholders understand and address the environmental impact effectively.Data storage and management occur in the `data` folder, containing various CSV files representing CO2 emission intensities, utility data, and other relevant information necessary for accounting purposes.By orchestrating these components seamlessly, this open-source project enables transparent and efficient carbon accounting through blockchain, promoting accountability in addressing climate change and fostering greener business practices across the Energy Efficiency Area (EEA). | +| [api.config.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/react-app/src/services/api.config.ts) | Configures base API and RPC URLs for the frontend application, automatically detecting environment variables or defaulting to localhost servers if undefined. | + +
+ +
app.frontend.contracts + +| File | Summary | +| --- | --- | +| [package.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/contracts/package.json) | Manages the contract artifacts for the frontend application within the Blockchain Carbon Accounting repository. This contracts package simplifies build processes using TypeScript and provides the foundation for smart contracts interaction during emissions tracking on the blockchain. | +| [tsconfig.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/contracts/tsconfig.json) | Configures the TypeScript compiler for the frontends contracts within the blockchain-carbon-accounting application, ensuring compatibility with ES2020 and ES Module Interop while generating declarations and sourcemaps. This streamlines development and aids in maintaining a robust, future-proof codebase. | +| [index.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/contracts/index.ts) | Abstractions (abis) and addresses for easier contract interaction. This facilitates seamless interactions between the frontend, contracts, and data within the applications architecture. | + +
+ +
app.frontend.contracts.src + +| File | Summary | +| --- | --- | +| [abis.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/contracts/src/abis.ts) | NetEmissionsTokenNetwork, CarbonTracker, DAOToken, and Governor. By organizing these abstractions in this way, the frontend application facilitates seamless communication with its blockchain counterparts to support effective tracking and management of carbon emissions data. | +| [addresses.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/contracts/src/addresses.ts) | This JavaScript file defines addresses for multiple blockchain networks, including Hedera testnet. Each network (e.g., Ropsten) includes an address for the token network, carbon tracker, and governance & DAO components of the decentralized autonomous organization (DAO). The active network can be switched by changing a variable at the start of the file. | +| [abis.d.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/contracts/src/abis.d.ts) | An object contains definitions for DAO token, governor contract, and abis. The abis have ABI structures that define their names, inputs/outputs, state mutability, and bytecode for deployment and post-deployment. Each component also includes linkReferences and deployedLinkReferences objects. The code structure supports multiple smart contracts within a single Solidity project. | +| [abis.js](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/contracts/src/abis.js) | Manages Solidity smart contract interfaces for blockchain interactions within the frontend application of this blockchain-carbon-accounting project. It imports and stores Abi definitions for NetEmissionsTokenNetwork, CarbonTracker, DAOToken, and Governor contracts to enable seamless interaction with these Ethereum-based applications. | +| [index.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/contracts/src/index.ts) | The apps `frontend/contracts/src/index.ts` file exports crucial smart contract abstractions and addresses for seamless integration with the blockchain ecosystem within the parent repository, enriching the decentralized carbon accounting application. | + +
+ +
app.frontend.contracts.src.abis + +| File | Summary | +| --- | --- | +| [DAOToken.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/contracts/src/abis/DAOToken.json) | API Oracle (`api-oracle`)-a critical layer responsible for collecting, validating, and aggregating carbon accounting data from diverse sources.2. API Server (`api-server`)-facilitates secure communication between frontend applications and the underlying oracle, ensuring seamless data exchange.3. Frontend (`frontend`)-user-facing components that present information about emissions, enable interaction with the system, and offer intuitive interfaces for managing carbon credits and tracking emission reduction activities.4. Methane (`methane`)-a specialized tool to monitor and report on methane emissions from natural gas extraction and processing industries, ensuring greater accuracy and traceability in greenhouse gas accounting.5. Reports (`reports`)-generates comprehensive reports on carbon accounting data, including emission trends, impact assessments, and recommendations for emission reduction strategies.6. Supply-Chain (`supply-chain`)-an essential module that focuses on the traceability of goods throughout the supply chain, facilitating identification of high-emitting sectors and helping companies make more informed decisions to reduce their carbon footprints.By bringing these components together, this codebase offers | +| [CarbonTracker.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/contracts/src/abis/CarbonTracker.json) | Api-oracle`, `api-server`, `frontend`, `methane`, `reports`, `scripts`, or `supply-chain`.While the specifics of the implementation are not discussed, here's a high-level summary of the function this code serves within the repository:-This particular piece of code contributes to one or more of these modules by performing operations such as data processing, API interactions, UI rendering, smart contract calls, or managing the blockchain network.-In essence, it plays a role in ensuring that accurate, real-time carbon accounting transactions are securely recorded and accessible through the application's API and frontend interfaces.-The code's precise functionality, dependencies, and interactions with other components within the repository need to be investigated for a deeper understanding of its purpose and impact on the overall system.By focusing on the broader context and objectives of the code within the project architecture, we can appreciate its role in fostering transparency and efficiency in carbon accounting processes using blockchain technology. | +| [Governor.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/contracts/src/abis/Governor.json) | API Server:** It implements functionalities related to handling requests, responses, and interactions between the backend server and external services or frontend applications, thereby facilitating seamless communication and data exchange within the system.2. **Frontend Application:** It governs the interactive components of the user interface, ensuring a responsive and intuitive experience for users as they engage with the carbon accounting platform.3. **API Oracle:** It acts as a centralized source or broker of data, facilitating communication between multiple decentralized applications and smart contracts on the blockchain network. This could be used to aggregate and validate data for more accurate carbon accounting calculations.4. **Methane Module:** This subdirectory may handle specific calculations, algorithms, or data manipulation required for tracking methane emissions as part of the broader carbon accounting system.5. **Reports Module:** It generates and manages reports that present the results of carbon accounting calculations in a clear and actionable format for stakeholders to assess, compare, and take informed decisions based on | +| [NetEmissionsTokenNetwork.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/frontend/contracts/src/abis/NetEmissionsTokenNetwork.json) | The provided code file belongs to the `blockchain-carbon-accounting` repository, which is an open-source project dedicated to tracking and verifying carbon emissions in various supply chains. The specific code resides within the `app` directory and houses multiple subdirectories (`api-oracle`, `api-server`, `frontend`, `methane`, `reports`, `scripts`, `supply-chain`) that make up different functional components of this application.The given codefile primarily focuses on the `methane` component, which is an essential part responsible for calculating methane emissions within the carbon accounting process. Methane (CH4) is a potent greenhouse gas contributing significantly to global warming; hence, accurate measurement and accounting of these emissions are vital for sustainable development. The methane module within this repository allows users to input relevant data and generates precise emission estimations based on industry standards, promoting transparency and efficiency in carbon reporting across supply chains.The other components in the `app` directory further support various aspects such as an API server (for external interaction), frontend interfaces for user experience, report generation, and tools for managing the supply chain data. Together, these functionalities enable seamless interaction, reliable emission tracking, and comprehensive reportingโ€”making it easier for organizations to identify areas of improvement and strive toward a more sustainable future.Overall, this code contributes significantly to the larger objective of creating an open-source blockchain-based platform that fosters transparency, promotes sustainability, | + +
+ +
app.scripts + +| File | Summary | +| --- | --- | +| [update_emissions_tokens_apps.sh](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/scripts/update_emissions_tokens_apps.sh) | Script performs error handling, git pulls changes for app files, installs dependencies, builds frontend, deploys the built files, and restarts the backend server if necessary. If an error occurs during git pull or build process, it sends an error email with log details. Code was updated for better readability and engagement as per your requirements. | +| [process_emissions_tokens_requests.sh](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/scripts/process_emissions_tokens_requests.sh) | In the `blockchain-carbon-accounting` project, this script, located at `app/scripts/process_emissions_tokens_requests.sh`, initiates emission token processing by launching the supply-chain command within the projects directory and logging its output in a temporary logfile. This script is crucial for ensuring smooth operation of carbon accounting on the blockchain platform. | + +
+ +
app.methane + +| File | Summary | +| --- | --- | +| [package.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/methane/package.json) | The app/methane package.json file configures dependencies and scripts for a distributed application within the blockchain-carbon-accounting repository, allowing simultaneous client and server execution while managing Express, CORS, dotenv, and more through NPM and TypeScript. | + +
+ +
app.methane.server + +| File | Summary | +| --- | --- | +| [package.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/methane/server/package.json) | It is named @blockchain-carbon-accounting/methane-server, versioned at 1.0.0. Dependencies include data-postgres, @trpc/server, superjson, and zod. This setup provides a framework for building and executing the Methane server application in Typescript, leveraging specified dependencies for optimal functionality. | +| [tsconfig.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/methane/server/tsconfig.json) | Configures the TypeScript compiler for the `app/methane/server` module, leveraging es2020 syntax and importing from the `../../../data` directory to process relevant data for the blockchain-based carbon accounting system. | +| [index.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/methane/server/index.ts) | In this TypeScript file (`index.ts`), a component named `AppRouter` is exported from the trpc directory for use within the `methane` application server, which integrates crucial functionalities and facilitates interactions between components, enriching the overall blockchain-carbon-accounting system experience. | +| [server.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/methane/server/server.ts) | In this Node.js file (`app/methane/server/server.ts`), an Express server is initialized to serve as the main application for the Methane module within the larger `blockchain-carbon-accounting` project. This server listens on a specified port, uses middleware like cors and body-parser, and has a router handling API requests including data retrieval from a PostgreSQL database using TRPC and trpcMiddleware for communication. Additionally, it serves static React files after build. | + +
+ +
app.methane.server.trpc + +| File | Summary | +| --- | --- | +| [product.trpc.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/methane/server/trpc/product.trpc.ts) | Implements an TRPC API for managing product data from PostgreSQL, allowing querying and retrieving lists, specific items, total count, distinct attributes, and filtering by assets or bundles. It uses Zod for input validation and TypeScript type definition for the router function. | +| [common.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/methane/server/trpc/common.ts) | In this file, a context creator is defined that fetches client IP addresses using x-forwarded-for header or socket remote address. This context includes an instance of the PostgresDBService and is used for creating a TRPC router, which is merged into one application router to handle various operations like asset management, operator management, and product management. In case of any errors in these methods, custom DomainError classes are thrown which can provide error messages in response. The handleError function transforms the errors into TRPC specific error objects for structured responses. | +| [asset.trpc.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/methane/server/trpc/asset.trpc.ts) | Provides API endpoints to fetch and count Oil & Gas Assets based on supplied bundles from the database, enhancing efficient data retrieval within our blockchain carbon accounting application. | +| [operator.trpc.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/methane/server/trpc/operator.trpc.ts) | Implements TRPC-based API endpoints for operator-related operations, including count, list, get, and assets queries on the PostgreSQL database, using Operator, OilAndGasAsset, and Wallet entities defined in @blockchain-carbon-accounting/data-postgres package. Also defines export type for the router. | + +
+ +
app.methane.client + +| File | Summary | +| --- | --- | +| [.env.sample](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/methane/client/.env.sample) | Localhost:8000 and http://localhost:8007. It also offers a place to input a Google Maps API key for location services if desired. | +| [package.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/methane/client/package.json) | Update to latest versions of Chrome, Firefox, and Safari browsers.-Utilize custom ESLint configuration for TypeScript files in src folder.-Modify scripts for production deployment and local development.-Include essential dependencies such as React, Material UI, Axios, and Web3Modal.-Install devDependencies like @types/node, Jest, customize-cra, and react-app-rewired to optimize testing and configuration flexibility. | +| [config-overrides.js](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/methane/client/config-overrides.js) | This script customizes webpack for the client project by setting alias paths, modifying include paths in TypeScript rules, providing fallback modules, suppressing certain warnings, and adjusting output settings. It also adds the ProvidePlugin to handle process and Buffer. | +| [tsconfig.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/methane/client/tsconfig.json) | Compile and configure TypeScript files within the Methane client app for efficient execution with the latest ESNext features while maintaining type-safety and support for JavaScript within the project ecosystem. | + +
+ +
app.methane.client.public + +| File | Summary | +| --- | --- | +| [index.html](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/methane/client/public/index.html) | This file, `app/methane/client/public/index.html`, serves as a structural backbone for the Oil & Gas Emissions Data web application within the repository blockchain-carbon-accounting. It lays out the HTML foundation, ensuring seamless rendering of content when the app is installed and opened on a device. This includes defining elements like title, viewport, links for favicon, manifest, and more, providing a canvas for the bundled scripts to fill. | +| [manifest.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/methane/client/public/manifest.json) | This JSON manifest file configures the presentation of the React application within PWA (Progressive Web App) environments. It sets short name, name, and icon details, and specifies start URL, display mode, theme color, and background color to enhance user experience. | +| [robots.txt](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/methane/client/public/robots.txt) | This file ensures seamless web scraping, contributing to the integrity of the platforms data management. | + +
+ +
app.methane.client.src + +| File | Summary | +| --- | --- | +| [index.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/methane/client/src/index.tsx) | Launches the user interface for the methane application within the blockchain-carbon-accounting repository. By importing essential dependencies and React components, this file bootstraps the App component, leverages Bootstrap for styling, and sets up performance tracking functions. It renders the application upon ready state in the root element of the document. | +| [App.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/methane/client/src/App.tsx) | Navigates users through different sections including Operators, Assets, Issues, and Product forms. Supports login and registration features. Structured as Tabbed container with conditional routing. Leverages trpc library for data fetching and real-time updates. Footer includes AppFooter component. | +| [App.test.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/methane/client/src/App.test.tsx) | Tests the react application in the methane section within the main blockchain-carbon-accounting repository, ensuring the Learn React link renders correctly as intended by developers for easy user interaction with learning resources. | +| [App.css](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/methane/client/src/App.css) | The CSS file at app/methane/client/src/App.css controls the visual layout of the Blockchain Carbon Accounting application, focusing on centering text, animating logos, and adjusting font sizes and colors for readability and appeal. | +| [index.css](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/methane/client/src/index.css) | Stylesheet defines typography and layout for methane application's web interface, utilizing Open Sans font, grayscale color palette, box-shadows, navbars, tabs, buttons, labels, code formatting, and white-space handling. | +| [setupTests.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/methane/client/src/setupTests.ts) | In this repository, the `app/methane/client/src/setupTests.ts` file is responsible for initializing testing environments using the Jest-Dom library to enable custom DOM assertions, making it possible to test React components effectively within the Methane client application. | +| [reportWebVitals.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/methane/client/src/reportWebVitals.ts) | The `app/methane/client/src/reportWebVitals.ts` file is a JavaScript module that initializes and reports crucial web vitals metrics such as Cumulative Layout Shift (CLS), First Input Delay (FID), First Contentful Paint (FCP), Largest Contentful Paint (LCP), and Time To First Byte (TTFB) to specified performance callbacks, enhancing the user experience. | + +
+ +
app.methane.client.src.components + +| File | Summary | +| --- | --- | +| [product-info-modal.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/methane/client/src/components/product-info-modal.tsx) | Enhances a products modal for interactive use in tracking carbon emissions. This React functional component offers user-friendly features such as creating new trackers and calculating emissions through integration with external APIs. Additionally, it supports the processing of production data by registered auditors. The implementation optimizes the modalitys responsiveness on various browser sizes, providing seamless user experience. | +| [map.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/methane/client/src/components/map.tsx) | This component (app/methane/client/src/components/map.tsx) is a vital part of the user interface in the blockchain-carbon-accounting repository, enabling users to visualize and interact with carbon emission data related to methane sources on an interactive map. The implementation leverages geospatial APIs for accurate positioning of emission points within the mapping view. | +| [static-data.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/methane/client/src/components/static-data.tsx) | In this TypeScript file, custom data types for assets, operators, and products are defined with geolocation information and field filters (OPERATOR_FIELDS, ASSET_FIELDS, PRODUCT_FIELDS). These structures support filtering by operator name, asset name, division, year, month, and other properties to retrieve specific data subsets within the blockchain-carbon-accounting app. | +| [footer.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/methane/client/src/components/footer.tsx) | Enhances the user interface by creating a footer component within the methane application, incorporating navigation to Terms of Use. The design promotes clarity and ease-of-use for end-users while aligning with overall project structure and architecture in the blockchain-carbon-accounting repository. | +| [asset-info-modal.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/methane/client/src/components/asset-info-modal.tsx) | This component, `AssetInfoModal` in the `methane/client/src/components` folder, is a user interface (UI) React modal for displaying asset details within the application. It receives an `Asset` object as prop and returns a large centered modal with a title Asset Details. The content remains blank for custom implementation to render specific asset information. | +| [operator-info-modal.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/methane/client/src/components/operator-info-modal.tsx) | Showcases a reusable React modal component, `OperatorInfoModal`, designed for displaying details about specific operators within the methane application under the broader app/methane/client/src/components section of the blockchain-carbon-accounting repository architecture. It takes in properties such as show, operator, and onHide for dynamic data presentation. | +| [register-operator.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/methane/client/src/components/register-operator.tsx) | Creates React component SignUp for user registration. Uses hooks and Formik for state management, validation, and form handling. ReCAPTCHA is integrated to prevent automated signups. Functional components are employed, using async/await for non-blocking asynchronous calls. Error handling is implemented to manage form errors and user alerts on success or failure. | +| [request-product-audit.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/methane/client/src/components/request-product-audit.tsx) | Function `RequestProductAudit` presents a form to calculate emissions or request an audit based on users role as an AeDealer. If the form is valid, it calculates the emissions or sends the request and displays the result in a SuccessAlert or continues submitting if loading. If not valid, it shows error messages. The component utilizes React Hook Form, Ant Design, and Formik. This code can be used in a larger application to allow users to easily submit requests for calculations or audits with emissions data entered. | +| [request-multi-product-audit.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/methane/client/src/components/request-multi-product-audit.tsx) | This JavaScript component generates a form that requests emissions data, handles form submissions, and shows success/error messages. Its specifically designed for users who are AeDealers (as determined by the roles property). If a user is not an AeDealer, they can request an audit. The form includes inputs for activity amount, uom, emissions type, ghg type, and global warming potential in CO2e. Upon successful submission, the component displays calculated emissions data and a success message; if theres an error during submission, it shows an error message instead. The request is also saved in local storage if the user isn't signed in at the time of submission. | + +
+ +
app.methane.client.src.pages + +| File | Summary | +| --- | --- | +| [terms.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/methane/client/src/pages/terms.tsx) | The `app/methane/client/src/pages/terms.tsx` file defines the Terms of Use for the blockchain-carbon-accounting application. This component delivers a concise statement, linking to its open-source license agreement, disclaiming responsibility, and emphasizing the voluntary use of information with a disclaimer about potential errors or inaccuracies in external links. | +| [operators.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/methane/client/src/pages/operators.tsx) | The React functional component, Operators, retrieves a list of operators based on user input or default values. It supports pagination, error handling, and the ability to toggle between a query builder for more advanced filtering. Upon initial render and certain user actions, it triggers a data fetch operation. The component also has a modal for displaying operator details and allows users to refresh the list. The useEffect hook ensures components are only updated when necessary and optimizes performance. | +| [operator.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/methane/client/src/pages/operator.tsx) | Data processing of comprehensive CO2 emission datasets spanning multiple years, which enable longitudinal trend analysis and informed decision-making.2. Integration with other critical data points, such as conversion factors for different energy types and utilities' data, to facilitate accurate emissions calculations.3. Generation of reports that provide actionable insights on the carbon footprint of various energy production sources within the Electronic Economic Area (EEA), aiding in carbon reduction efforts and promoting sustainable practices.4. Contribution to the larger repositorys architecture by interacting seamlessly with the API server, frontend, and other modules for efficient data processing, analysis, and visualization. | +| [assets.tsx](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/methane/client/src/pages/assets.tsx) | Functions fetch assets from blockchain for registered operator, displays them on table with map feature and pagination. React hook uses Effect to call function upon change of signedInAddress. Error handling in place. User can toggle asset query builder to filter results. | + +
+ +
app.methane.client.src.services + +| File | Summary | +| --- | --- | +| [api.service.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/methane/client/src/services/api.service.ts) | This JavaScript file exports functions to retrieve product totals, product attributes, assets, and count assets using Type-RPC queries. It also includes error handling for failed requests. The functions take different parameters, like query arrays and boolean flags, to tailor their responses based on user input. | +| [trpc.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/methane/client/src/services/trpc.ts) | This codefile sets up a connection to the `@blockchain-carbon-accounting/methane-server` using TRPC (Type-safe Request Protocol for Client) hooks, enabling interaction with its API within the Methane client in the React application. | +| [api.config.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/methane/client/src/services/api.config.ts) | This TypeScript file configures API endpoints for the methane application within the larger blockchain-carbon-accounting ecosystem. It defines base URLs for three services (API, frontend, and methane), allowing flexible connection points based on environment variables. | + +
+ +
app.supply-chain + +| File | Summary | +| --- | --- | +| [input.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/supply-chain/input.json) | Unknown event occurred (id: 4)2. Ground shipment from California to New York with weight 15 lbs (id: 5)3. Flight AF666 took off from Paris to Lisbon on business class, covering approximately 4000 miles (id: 6)4. Air France business flight emissions factor for the flight AF666 was determined (id: 7)5. Ferries carried 2 passengers over 124 km (id: 8) | +| [emissions.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/supply-chain/emissions.ts) | Generate keypairs, process input activities using RSA encrypt/decrypt mode, group emissions per activity type and prepare data for final output. Emits tokens, collects errors, and outputs the processed activities. If no public key is provided or wallet address specified, throws error and exits the program. If a file is not given as an input, outputs generated keypairs or shows usage if no valid keypairs exist. If process requests are provided, processes emissions requests. If the source is provided, processes JSON data coming from STDIN or filename. | +| [package.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/supply-chain/package.json) | In this codebase, the `app/supply-chain/package.json` file configures and manages a command-line interface (CLI) for the blockchain carbon accounting supply chain module. It defines scripts like build, lint, and the key cli which invokes emissions.ts. This CLI interacts with other modules via @blockchain-carbon-accounting/supply-chain-lib to streamline the supply chain process. | +| [tsconfig.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/supply-chain/tsconfig.json) | Transforms TypeScript settings for the supply-chain application, ensuring compliance with ES2020 standard, utilizing experimental decorators, and generating metadata for easier debugging. Compiles TypeScript files and produces declarations and source maps for easy identification of issues within the codebase. | + +
+ +
app.supply-chain.example + +| File | Summary | +| --- | --- | +| [tokenize-upsqv.py](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/supply-chain/example/tokenize-upsqv.py) | Analyze, modify and execute Python script that tokenizes delivery data, updates their statuses, and handles database operations. The script accepts command-line arguments to issue new tokens or update existing ones based on given dates and recipient address. It uses the `db` module for database access and an API server to retrieve tokens. | +| [db.py](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/supply-chain/example/db.py) | Querying existing tokens by shipment_id, shipment_route_segment_id and tracking number (`shipment_route_segment_token()`)-Creating new tokens (`create_shipment_route_segment_token()`)-Updating the status and associated details of existing tokens (`update_shipment_route_segment_token()`)-Querying all queued tokens for processing (`get_queued_shipment_route_segment_tokens()`)Additionally, there are similar functions for Q_V delivery tokens. | +| [config.py](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/supply-chain/example/config.py) | The `app/supply-chain/example/config.py` file serves as configuration for interconnecting with databases and APIs within the supply chain module. It defines settings such as database connections, logging configurations, and base URLs for external API interactions. This streamlines data exchange across our blockchain-carbon-accounting system by configuring various network components effectively. | +| [requirements.txt](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/supply-chain/example/requirements.txt) | In the given repository, this `requirements.txt` file found in the `app/supply-chain/example` directory outlines Python dependencies for efficient interaction with external resources within the supply chain module. Key packages include wheel, PyGreSQL, and requests. These packages are crucial for data handling operations and web service communications in the application architecture. | +| [supply_chain_api.py](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/supply-chain/example/supply_chain_api.py) | In this Python script located at `app/supply-chain/example/supply_chain_api.py`, the developers create a function called `tokenize` to send a POST request to a specified supply chain API endpoint, providing an input file and receiving JSON as response. The purpose of the script is to facilitate data integration within the broader blockchain-carbon-accounting system, contributing towards carbon accounting and green initiatives. | +| [tokenize-ofbiz.py](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/supply-chain/example/tokenize-ofbiz.py) | This Python script fetches tokens for specific shipments and updates their status. The `tokenize_emissions` function issues tokens based on provided arguments, while `update_token_status` checks the status of queued tokens, updating them if theyre successfully generated by the API server. If an error occurs during the execution of these functions, it logs the exception and updates the error count. | +| [api_server.py](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/supply-chain/example/api_server.py) | This Python script, placed within the `app/supply-chain/example/api_server.py` file, enables data access by fetching a token from the API server when needed. It leverages an external requests library to initiate HTTP GET calls using supplied node ID and request UUID for authentication purposes. | +| [common.py](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/supply-chain/example/common.py) | In the supply-chain application within this blockchain carbon accounting project, the `app/supply-chain/example/common.py` file initializes a logging system with rotating file handling and a specified format for log entries. This ensures structured logging for the apps supply chain operations across different files and levels, improving overall traceability. | + +
+ +
app.supply-chain.example.sql + +| File | Summary | +| --- | --- | +| [create_table.sql](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/supply-chain/example/sql/create_table.sql) | Shipment_route_segment_token` and `q_v_delivery_token`, serving to track shipments and deliveries, respectively. These tables are essential for managing supply chain data in the context of emission calculations, fostering transparency and accountability within the blockchain environment. | + +
+ +
app.supply-chain.api + +| File | Summary | +| --- | --- | +| [package.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/supply-chain/api/package.json) | This package.json file configures and manages the development, linting, and script execution of a supply-chain API within the blockchain carbon accounting application. It includes essential dependencies such as cors, axios, express, multer, and ts-node to facilitate seamless interactions with backend libraries. | +| [tsconfig.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/supply-chain/api/tsconfig.json) | This `tsconfig.json` configuration optimizes the TypeScript compiler for the supply-chain module within the API directory, ensuring adherence to ES2020 standards and experimental decorators while producing clean, structured output in the `dist` folder. | +| [server.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/supply-chain/api/server.ts) | | + +
+ +
app.supply-chain.api.app.routers + +| File | Summary | +| --- | --- | +| [router.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/supply-chain/api/app/routers/router.ts) | This module, located within the supply-chain component of our blockchain carbon accounting app, manages token issuance through an Express.js router. Utilizing Multer for handling multipart requests, it enables the receipt and storage of keys and input data before invoking the `issueToken` controller function. | + +
+ +
app.supply-chain.api.app.controllers + +| File | Summary | +| --- | --- | +| [controller.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/supply-chain/api/app/controllers/controller.ts) | Analyzes the uploaded JSON data, processes activities and issues tokens based on the provided criteria. Groups the processed data by type and mode, then proceeds to create output arrays containing activity ids and error statuses if any. Removes temporary files after completion and returns a status code with appropriate output. | + +
+ +
app.supply-chain.api.test + +| File | Summary | +| --- | --- | +| [test.js](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/supply-chain/api/test/test.js) | Analyzes and decrypts encrypted data, fetches content from IPFS based on user input, and saves the decrypted data to an output file using private key. It requires Axios for HTTP requests, CryptoUtils for decryption, and FS for writing files. Errors are handled throughout the process and outputted. | + +
+ +
app.reports + +| File | Summary | +| --- | --- | +| [pending_emissions_requests.sql](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/reports/pending_emissions_requests.sql) | This SQL script retrieves the list of pending emissions auditors and their counts, joined with corresponding wallet names for easier interpretation, fostering transparent monitoring of carbon accounting process within our blockchain application. | +| [pending_emissions_requests.sh](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/app/reports/pending_emissions_requests.sh) | Sends periodic emails containing a list of pending emissions audit requests from the `emissions-test` database instance to the configured recipient when there are outstanding audits. This script is located in the `app/reports` folder within the larger blockchain carbon accounting project architecture, specifically the file `pending_emissions_requests.sh`. | + +
+ +
secure-identities.ws-identity + +| File | Summary | +| --- | --- | +| [Dockerfile](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/secure-identities/ws-identity/Dockerfile) | Builds a production-ready Node.js application within the secure-identities/ws-identity directory, optimized for running on Alpine Linux, using NodeJS version 18. The Dockerfile automates installation and configuration, copies necessary files, and executes build scripts before deploying a dist folder with bundled assets to run the application. | +| [app.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/secure-identities/ws-identity/app.ts) | On port 8700. A new instance of WsIdentityRouter is initialized to handle WebSocket requests on a customizable path (/sessions). The server logs the starting URL for access. | +| [README.MD](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/secure-identities/ws-identity/README.MD) | This `ws-identity` Express.js app offers cryptographic signing capabilities via WebSocket connections, acting as an X.509 identity provider. It interfaces with IoT devices, auditors, and distributed networks (e.g., Hyperledger Fabric), using private keys stored offline in external wallets for authentication and interaction. The server configuration enables customizable endpoints for new sessions, signing requests, and public-key retrieval. The provided `ws-identity-client` sets up the backend between this server and a Fabric network. | +| [package.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/secure-identities/ws-identity/package.json) | Builds an Express web server for WebSockets-based identity service with dependencies including express-validator, ws, ws-wallet and @supercharge/request-ip, using TypeScript with Prettier and ESLint for formatting and linting respectively. Docker support is available for deployment. | +| [tsconfig.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/secure-identities/ws-identity/tsconfig.json) | In the Blockchain Carbon Accounting repository, this TypeScript configuration (`tsconfig.json`) within the ws-identity folder dictates compiler options for a WebSocket Identity component. Key settings like module resolution and declaration are tuned, generating output in ES2017 syntax, while ensuring a clear, readable code structure. This helps develop high-quality TypeScript code in a commonjs module environment. | +| [.eslintrc.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/secure-identities/ws-identity/.eslintrc.json) | This JSON configuration file, located in `secure-identities/ws-identity`, optimizes the TypeScript ESLint environment for this project. It extends multiple linter recommendations to ensure code consistency and efficiency within the JavaScript ecosystem (ES6+). By setting ecmaFeatures to true, it accommodates JSX syntax where necessary, enriching user interfaces. Additionally, it customizes no-unused-vars rule, flagging errors instead of offenses. | + +
+ +
secure-identities.ws-identity.src + +| File | Summary | +| --- | --- | +| [router.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/secure-identities/ws-identity/src/router.ts) | The `secure-identities/ws-identity/src/router.ts` file sets up and secures the Express router for the WebSocket identity service within this blockchain-carbon-accounting project. This module controls access, handles user authentication, and exposes endpoints for session management and client registration, strengthening the platforms secure identities functionality. | +| [client.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/secure-identities/ws-identity/src/client.ts) | A NodeJS class for handling WebSocket connections implements an ECDSA digital signature mechanism for message verification. The `sign` function takes a Buffer as input (digest), signs it, and returns the result as another Buffer, adhering to the Fabric format. Concurrent signature requests are handled in series, with each one sent only after its predecessor is signed and verified. The class also provides a close method for closing WebSocket connections. | +| [index.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/secure-identities/ws-identity/src/index.ts) | The `secure-identities/ws-identity/src/index.ts` file exports essential classes for managing web sockets in the secure identities module of the blockchain carbon accounting project, providing crucial infrastructure for identity communication within the broader system architecture. | +| [server.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/secure-identities/ws-identity/src/server.ts) | Manages WebSocket connections for public keys using unique sessionIDs. Validates incoming connections based on public key hex, IP address, and signature. Offers methods to close all connections, get connected clients, and wait for a client to connect (for testing purposes). Implements error logging and handles unexpected connection behavior. | + +
+ +
secure-identities.ws-identity.src.routers + +| File | Summary | +| --- | --- | +| [session.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/secure-identities/ws-identity/src/routers/session.ts) | This file, `ws-identity/src/routers/session.ts`, sets up an Express route for user registration and session creation within the Secure Identities component of the blockchain application. By using validation functions and the Fabric User Registry API, it generates unique session IDs and corresponding WS server URLs for newly enrolled users. This contributes to a seamless onboarding process in the WebSocket-based identity system. | +| [client.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/secure-identities/ws-identity/src/routers/client.ts) | This TypeScript file initializes an Express router for a web socket client within the ws-identity module of the secure-identities project. The router defines endpoints for user authentication tasks including digital signature and retrieval of public keys via HTTP POST requests. Errors are validated using `express-validator` library, and logging is done using the `cactus-common`Logger package from Hyperledger. | + +
+ +
secure-identities.ws-identity-client + +| File | Summary | +| --- | --- | +| [package.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/secure-identities/ws-identity-client/package.json) | The package contains the client for connecting to the web-socket identity server (ws-identity-client) versioned at 1.0.2 and authored by Betrand Rioux. It is built using TypeScript and uses Mocha for testing, Prettier for formatting, ESLint for linting, and TS-Node to run TypeScript code. Dependencies include debug, dockerode, request-promise-native, and tv4, while devDependencies include mocha, chai, eslint, prettier, ts-node, typescript, ws-identity, and ws-wallet. The code is housed in a Git repository on GitHub. | +| [tsconfig.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/secure-identities/ws-identity-client/tsconfig.json) | The TypeScript configuration (`tsconfig.json`) within the `ws-identity-client` directory streamlines compilation and output processes, ensuring compatibility with ES2017 syntax, commonJS modules, and declaration files while enabling experimental decorators and syntactic default imports. This setup allows for a smooth workflow in developing secure identities for our decentralized carbon accounting system on blockchain. | +| [.eslintrc.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/secure-identities/ws-identity-client/.eslintrc.json) | Manages linting configurations for TypeScript files within the ws-identity-client module of secure-identities, ensuring adherence to specified coding standards and practices while enabling JSX syntax support and allowing use of ES2021 features in JavaScript browsers. | + +
+ +
secure-identities.ws-identity-client.src + +| File | Summary | +| --- | --- | +| [index.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/secure-identities/ws-identity-client/src/index.ts) | This class initializes a client for API requests using given configuration and generates functions to make requesting data easier. It handles signing, session management, and error handling. The `write()` function sends data to a specified path, while `read()` retrieves data from it. Functions can be easily created using the `generateFunction()`. This client uses schema validation to ensure request structure conformity. | + +
+ +
secure-identities.vault-identity + +| File | Summary | +| --- | --- | +| [Dockerfile](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/secure-identities/vault-identity/Dockerfile) | This Dockerfile orchestrates the construction of the secure-identities/vault-identity application, which is part of our blockchain-carbon-accounting solution. It leverages Node.js version 18 to build and package the TypeScript source code, ensuring smooth execution within an Alpine Linux environment upon deployment. | +| [.eslintrc](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/secure-identities/vault-identity/.eslintrc) | The provided file configures ESLint for the VaultIdentity component within SecureIdentities, our decentralized blockchain-powered identities system. This setup adheres to TypeScript standards, Prettier guidelines, and enhances maintainability through rules such as error reporting for unused variables and strict ecmaVersion settings. | +| [package.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/secure-identities/vault-identity/package.json) | This `secure-identities/vault-identity` package streamlines operations for a decentralized identity application. It integrates node-vault, express, and other dependencies, offering an efficient runtime environment for the identity service in the blockchain-carbon-accounting architecture. The script includes building, starting, testing setups, and a docker run command for deploying the identity vault. | +| [.env](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/secure-identities/vault-identity/.env) | The file sets debug logging level, app port (9090), and various vault paths for authentication, policies, and secrets, ensuring secure identity management in the blockchain carbon accounting application architecture. | +| [tsconfig.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/secure-identities/vault-identity/tsconfig.json) | Empowers secure identity management within the blockchain-carbon-accounting project by configuring TypeScript settings for the vault-identity component, enabling efficient development and ensuring seamless integration with common JavaScript modules. | + +
+ +
secure-identities.vault-identity.test + +| File | Summary | +| --- | --- | +| [setup.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/secure-identities/vault-identity/test/setup.ts) | Script initializes a Vault instance, sets up policies for client and manager, mounts Transit and KVv2 paths, enables userpass authentication, and updates environment variables to access the Vault using that setup. | + +
+ +
secure-identities.vault-identity.hcl-files + +| File | Summary | +| --- | --- | +| [client.hcl](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/secure-identities/vault-identity/hcl-files/client.hcl) | This file configuration, located within the `vault-identity/hcl-files/client.hcl`, outlines key access capabilities for identity entities in the system. It assigns permissions for actions such as signing, key management, key rotation, changing passwords, and handling Ethereum keys. Additionally, it enables list access for user interface interaction, enhancing security and flexibility in user-identity interactions. | +| [manager.hcl](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/secure-identities/vault-identity/hcl-files/manager.hcl) | The `manager.hcl` file within the `vault-identity` directory of this blockchain-carbon-accounting repository is responsible for managing and configuring identities in the system. It defines paths and associated capabilities for identity management (signing, keys creation/update/delete, password change), entity and entity aliases creation, ethereum key handling, as well as read access to UI data, ensuring secure identity maintenance for all users. | + +
+ +
secure-identities.vault-identity.src + +| File | Summary | +| --- | --- | +| [app.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/secure-identities/vault-identity/src/app.ts) | Implements Express framework to handle REST API requests,2. Integrates Swagger-UI to provide API documentation at http://localhost:/api-docs,3. Establishes the base URL of the openAPI server to match the running application's host and port, and4. Registers routes for the VaultIdentity service via an instance of `RouterV1`. It initializes the server on a specified or default port (9090) upon execution, logging starting information accordingly. | +| [index.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/secure-identities/vault-identity/src/index.ts) | The index file, located at `secure-identities/vault-identity/src/index.ts`, loads environment variables using dotenv package and sets up the app with custom logging. Upon initialization, it initiates a new instance of the main App class which handles further execution in this secure identities module. | + +
+ +
secure-identities.vault-identity.src.utils + +| File | Summary | +| --- | --- | +| [utils.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/secure-identities/vault-identity/src/utils/utils.ts) | Validates string input by ensuring it is not empty in the secure-identities module, specifically within the vault-identity section. This utility function strengthens the robustness of data validation processes, guaranteeing non-blank strings are passed on for further processing. | +| [logger.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/secure-identities/vault-identity/src/utils/logger.ts) | Empowering the Vault Identity component of our Blockchain Carbon Accounting system, this Logger utility file configures Winston logging for efficient error handling and event tracking, fostering enhanced transparency across applications. | + +
+ +
secure-identities.vault-identity.src.delivery.http.v1 + +| File | Summary | +| --- | --- | +| [identity.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/secure-identities/vault-identity/src/delivery/http/v1/identity.ts) | This TypeScript file contains an `IdentityRouter` class that configures Express endpoints for interacting with user identities in the Vault Identity service. The endpoints allow for creating and updating user identities, with proper validation and error handling. | +| [secrets.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/secure-identities/vault-identity/src/delivery/http/v1/secrets.ts) | The given TypeScript file defines an HTTP route handler for managing Ethereum keys in a vault identity service using Express.js. This class sets up POST, GET, and DELETE routes for manipulating the Ethereum keys (create, read, update, delete). It validates input, uses VaultIdentityBackend for persisting secrets, and returns appropriate responses or error messages based on success or failure. | +| [key.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/secure-identities/vault-identity/src/delivery/http/v1/key.ts) | Creates an Express API for handling key-related operations (create, rotate, and retrieve) within the vault-identity package for managing secure identities. Utilizes custom validation on kty parameter, requiring either ecdsa-p256 or ecdsa-p384, with error messages sent via HTTP response codes (400 for bad requests and 409 for conflicts). The backend service for VaultIdentity is injected for data access. | +| [v1.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/secure-identities/vault-identity/src/delivery/http/v1/v1.ts) | Manages HTTP API v1 for secure identities application. Implements routing logic for identity, key, token, and secrets endpoints using express.js and express-router. Utilizes Express middleware to enforce authorization requirements for specific routes. | +| [token.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/secure-identities/vault-identity/src/delivery/http/v1/token.ts) | In this file, the developer sets up an Express router for handling requests related to tokens within the `vault-identity` module of the project. The router provides endpoints for creating, renewing, deleting and getting details of a token using asynchronous methods tied to a VaultIdentityBackend service instance. It also handles request validation and logs debug messages for errors. | + +
+ +
secure-identities.vault-identity.src.service + +| File | Summary | +| --- | --- | +| [vault.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/secure-identities/vault-identity/src/service/vault.ts) | Initialize and manage secrets using this Vault backend.-Creates identity with username, password, and policies.-Deletes specified secret path from Vault storage.-Verifies the health status of Vault server.-Requires environment variables for configuration (endpoint, accessor, paths, policies). | + +
+ +
secure-identities.identity-ui + +| File | Summary | +| --- | --- | +| [package.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/secure-identities/identity-ui/package.json) | This `identity-ui` package powers the user interface for secure identities within our blockchain carbon accounting system. It relies on React, React Router Dom, and Bootstrap for smooth interaction, Axios to handle API requests, and Jest for testing. The package is optimized for modern browsers, ensuring seamless functionality across major platforms. | + +
+ +
secure-identities.identity-ui.public + +| File | Summary | +| --- | --- | +| [index.html](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/secure-identities/identity-ui/public/index.html) | In the secure-identities repository, this HTML file, `identity-ui/public/index.html`, is the entrypoint for the user interface of the secure identities component. It establishes the basic structure and configures metadata essential for a cross-platform web application when installed on various devices or environments. The content is readied for bundling with JSX scripts, ensuring smooth performance and compatibility upon deployment. | +| [manifest.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/secure-identities/identity-ui/public/manifest.json) | The `manifest.json` in `secure-identities/identity-ui/public` sets up app identity for this React application. It defines the name, short name, icon images (favicon, logo192, logo512), start URL, display, theme color, and background color for seamless app interaction on mobile devices. | +| [robots.txt](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/secure-identities/identity-ui/public/robots.txt) | In our blockchain-carbon-accounting repository, this robots.txt file, located in the secure-identities/identity-ui/public folder, establishes web access guidelines for crawling the website, ensuring efficient and proper handling of bot interactions for improved performance. | + +
+ +
secure-identities.identity-ui.src + +| File | Summary | +| --- | --- | +| [App.css](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/secure-identities/identity-ui/src/App.css) | In this project, the `App.css` file located in the `secure-identities/identity-ui/src` folder sets the style for the application, arranging its elements and defining visual properties such as font weight and alignment within containers, enhancing user interface consistency. | +| [index.js](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/secure-identities/identity-ui/src/index.js) | The `secure-identities/identity-ui/src/index.js` file bootstraps and initializes the React application structure for the Secure Identities project. It integrates `react-router-dom` and handles the setup of components within the specified Router, ensuring seamless navigation throughout the app and loading styles from Bootstrap. | +| [index.css](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/secure-identities/identity-ui/src/index.css) | Styles the user interface within the secure-identities application, ensuring a clean, readable, and consistent layout for code sections using the Source Code Pro font. This CSS file enhances the overall user experience by standardizing the typography across various platforms. | +| [Routes.js](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/secure-identities/identity-ui/src/Routes.js) | Navigate users within our blockchain-carbon-accounting application by managing routes. The secure-identities/identity-ui/src/Routes.js file controls the system flow, enabling seamless navigation between the Home and Vault components using React Router DOM and history module. | +| [history.js](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/secure-identities/identity-ui/src/history.js) | Manages React Router navigation for the secure identities user interface by configuring browser history, ensuring smooth transitions between application screens and seamless user experience. | +| [App.js](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/secure-identities/identity-ui/src/App.js) | Facilitates user navigation through routing components within the secure-identities identity-ui application, ensuring seamless interaction with various features by managing routes from App.js, dressed elegantly in styles defined in App.css. | + +
+ +
secure-identities.identity-ui.src.Home + +| File | Summary | +| --- | --- | +| [Home.css](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/secure-identities/identity-ui/src/Home/Home.css) | In this open-source blockchain repository for carbon accounting, the `Home.css` file within `secure-identities/identity-ui/src/Home/` defines the styling for the landing section on the Home page. This CSS modifies padding, text alignment, typography, and colors to create an engaging and informative user interface experience. | +| [Home.js](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/secure-identities/identity-ui/src/Home/Home.js) | This Home.js file within secure-identities/identity-ui/src initiates user authentication and authorization, managing state to determine whether the user is authorized based on token verification. If authorized, it displays user details, otherwise directs to Vault Authorization upon clicking Vault Authorization button. The logic for logout and handling of expired tokens is also implemented here. | + +
+ +
secure-identities.identity-ui.src.Utils + +| File | Summary | +| --- | --- | +| [Common.js](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/secure-identities/identity-ui/src/Utils/Common.js) | It stores and retrieves user data (JSON), token, and manages user session by setting or removing them in session storage. | + +
+ +
secure-identities.identity-ui.src.Vault + +| File | Summary | +| --- | --- | +| [Vault.css](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/secure-identities/identity-ui/src/Vault/Vault.css) | The Vault.css file in the identity-ui directory refines the style and layout of the login interface within the secure-identities application, ensuring a clean and consistent user experience by defining typography rules for headings and text color. | +| [Vault.js](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/secure-identities/identity-ui/src/Vault/Vault.js) | Localhost:9090/api/v1/token, checking for valid credentials and setting the session accordingly before redirecting the user to the dashboard. | + +
+ +
secure-identities.ws-wallet + +| File | Summary | +| --- | --- | +| [Dockerfile](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/secure-identities/ws-wallet/Dockerfile) | In this codebase, the Dockerfile in `ws-wallet` folder creates an image for the TypeScript app in Node v18 Alpine environment. It installs app dependencies via package.json and builds the project, preparing it to run on port 8080 when launched. This streamlines deployment of our TypeScript app within containers, improving scalability and reducing inconsistencies between local and production environments. | +| [package.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/secure-identities/ws-wallet/package.json) | The ws-wallet is a crypto wallet for node.js, designed for secure transaction signing (like network invitations) using web-sockets. It is developed by Betrand Rioux and depends on various libraries such as express, axios, and ws for functionality. Its scripts include dev, build, and start for development and execution purposes, among others. The codebase resides under a git repository. | +| [tsconfig.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/secure-identities/ws-wallet/tsconfig.json) | Within the `secure-identities/ws-wallet` repository, the `tsconfig.json` configuration file guides TypeScript compilation, ensuring compatibility with ES2017 standards while using experimental decorators and emitting metadata. This streamlines development by automatically generating interoperable commonJS modules, enhancing the reusability of wallet code within the larger identity solution architecture. | +| [.eslintrc.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/secure-identities/ws-wallet/.eslintrc.json) | This ESLint configuration file within `secure-identities/ws-wallet` streamlines the coding style for TypeScript-based React development. By integrating best practices and rule sets, it ensures a consistent and efficient workflow in creating the wallet component for secure identities. | + +
+ +
secure-identities.ws-wallet.bin + +| File | Summary | +| --- | --- | +| [utils.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/secure-identities/ws-wallet/bin/utils.ts) | In this TypeScript file, named utils.ts within the ws-wallet subfolder of the secure-identities module, essential key management functionalities are provided. It generates, retrieves, and lists keys for secure identity usage, while also opening and maintaining sessions with ws-identity servers in a blockchain-based carbon accounting system. | +| [index.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/secure-identities/ws-wallet/bin/index.ts) | This `index.ts` script facilitates interaction with the ws-wallet component in the secure-identities folder by providing command-line functionalities for generating keys, obtaining public key hexadecimal (Pkh), opening and connecting to wallet sessions. It utilizes yargs, a popular CLI building library, for defining commands, options, and handling user inputs. | + +
+ +
secure-identities.ws-wallet.src + +| File | Summary | +| --- | --- | +| [wallet.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/secure-identities/ws-wallet/src/wallet.ts) | This module initializes a web socket connection using provided endpoint, verifies user approval, and signs data with a specified key using ECDSA. If a key is locked, it uses a function to unlock it. The file includes additional functions for waiting for the sockets readyState and retrieving user password. It utilizes various modules including `readline`, `KEYUTIL`, `ecdsaCurves`, and `buffer`. | +| [router.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/secure-identities/ws-wallet/src/router.ts) | Exports a WebSocket Wallet Router for third-party apps to manage session tickets. It accepts new or open requests to the Fabric app using `/new` and `/open` endpoints, validating input before processing them asynchronously through `newSession` and `openSession` methods. The class is initialized with customizable log level options. | +| [app.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/secure-identities/ws-wallet/src/app.ts) | Launches a web API for the secure-identities wallet service, listening on port 9090 and using log levels defined by the environment variable APP_LOG_LEVEL. Routes requests to the WsWalletRouter, which processes session data and utilizes debug logging for enhanced functionality. | +| [util.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/secure-identities/ws-wallet/src/util.ts) | This script generates an ECDSA key pair encrypted with a user-supplied password, saves it to a file, and retrieves the public key in hex format for use in a web socket session. If the key file does not exist, the script prompts for a password and generates a new one. Additional functions include listing existing keys, creating new sessions using the specified key name, and opening sessions by signing the session ID using the key specified in the keyName parameter. | +| [index.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/secure-identities/ws-wallet/src/index.ts) | Manages secure identities by exporting essential WsWallet components (WsWallet, WsWalletOpts, WsWalletReq, WsWalletRes) and ECCurveType from the util module. The secure-identities/ws-wallet/src/index.ts file serves as the entry point to interact with wallet functionality within secure identities architecture. | + +
+ +
open-offsets-directory.node-server + +| File | Summary | +| --- | --- | +| [import_csv_vcs_retirements.sql](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/open-offsets-directory/node-server/import_csv_vcs_retirements.sql) | In the provided open-source project architecture, this SQL script, located at `open-offsets-directory/node-server/import_csv_vcs_retirements.sql`, is designed to manage data for Verified Carbon Units (VCU) retirements in a structured format. It sets up and handles CSV files containing information about the retirement of carbon credits, including details like issuance date, vintage start and end, project information, and more. | +| [import-issuances.sql](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/open-offsets-directory/node-server/import-issuances.sql) | This SQL script removes the VCS prefix from project IDs, populates a new issuance table, and deletes existing data while moving it to a fresh table structure. This ensures clean and streamlined data storage for carbon offsets management system. | +| [import_csv_car_issuances.sql](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/open-offsets-directory/node-server/import_csv_car_issuances.sql) | This file defines and imports a database table, `csv_car_issuances`, into the `open-offsets-directory/node-server` environment. It allows for structured data input of Carbon Accounting (CA) issuances, storing crucial attributes such as date, project details, verification, and location. This streamlined data importation facilitates efficient tracking and management of carbon offsets within the blockchain-carbon-accounting repository. | +| [import_csv_car_retirements.sql](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/open-offsets-directory/node-server/import_csv_car_retirements.sql) | In this codebase, the repository blockchain-carbon-accounting manages emissions data and carbon offset projects using various tools like hardhat for Ethereum, Hyperledger Fabric for blockchain applications, and multiple client-server interactions. This specific file, `import_csv_car_retirements.sql`, serves to define and import a table called csv_car_retirements, used within the open-offsets-directory's node server to store retirement details of carbon offset credits, streamlining data management. | +| [server.js](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/open-offsets-directory/node-server/server.js) | It handles various types of request content and listens on port 8080 or an assigned one via the environment variable PORT. The server is interfaced with project-related routes, such as `project.routes`, `project_registry.routes`, `project_rating.routes`, `issuance.routes`, and `retirement.routes`. The Express server provides the API endpoint for a Voluntary Carbon Offsets Directory web application. | +| [import-retirements.sql](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/open-offsets-directory/node-server/import-retirements.sql) | ACR retirements, car retirements, VCS retirements, gold retirements (when credit status is Retired). | +| [import_csv_acr_issuances.sql](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/open-offsets-directory/node-server/import_csv_acr_issuances.sql) | In the open-source blockchain-carbon-accounting repository, this SQL script, `import_csv_acr_issuances.sql`, initializes and imports a structured table (`csv_acr_issuances`) for storing carbon credit issuance data. This empowers seamless, large-scale data processing within the system, thereby streamlining carbon accounting. | +| [import_csv_acr_retirements.sql](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/open-offsets-directory/node-server/import_csv_acr_retirements.sql) | The given SQL file (open-offsets-directory/node-server/import_csv_acr_retirements.sql) is designed to manage retirement records for carbon offset credits. It defines a table structure with essential attributes and enables importing CSV data, facilitating seamless integration and tracking of retiring offset projects. | +| [package.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/open-offsets-directory/node-server/package.json) | In this repository, a Node.js API server for the Open Offsets Directory project is defined within the open-offsets-directory/node-server folder. The `package.json` file declares the dependencies and scripts (such as development, start, and testing) to bootstrap and manage this express application seamlessly with tools like cors, body-parser, nodemon, and sequelize for database operations. | +| [.env](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/open-offsets-directory/node-server/.env) | This `open-offsets-directory/node-server/.env` file sets up the configuration for the server, specifically the PORT to run on (8080). Additional environment variables like RECAPTCHA_SITE_KEY and RECAPTCHA_SECRET may be optionally defined. These configurations ensure secure and seamless user interaction with the open-source blockchain-based carbon accounting application. | +| [import_csv_gold_retirements.sql](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/open-offsets-directory/node-server/import_csv_gold_retirements.sql) | The `open-offsets-directory/node-server/import_csv_gold_retirements.sql` file is designed to manage gold retirement records in a structured database table, enabling efficient data retrieval and analysis for gold credit systems within the repository architecture. This SQL script drops an existing table, creates a new one with specified columns, and facilitates importing CSV files containing gold retirement records into the new table. | +| [import_csv_vcs_issuances.sql](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/open-offsets-directory/node-server/import_csv_vcs_issuances.sql) | The `import_csv_vcs_issuances.sql` file within the `open-offsets-directory/node-server` directory sets up and populates a table (`csv_vcs_issuances`) with VCS issuance data from CSV files, allowing for easy storage and retrieval of this critical carbon credit information in the blockchain-carbon-accounting repository. | +| [init-schema.sql](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/open-offsets-directory/node-server/init-schema.sql) | Created project, project_registry, project_rating, issuance, and retirement tables for offset database management system, adhering to Berkeley Carbon Trading Project standards and UUID-OSSP extension. Supports recording projects details, registries, ratings, emissions reductions, retirements, and more. | +| [import-csv.sql](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/open-offsets-directory/node-server/import-csv.sql) | Organize project details using a SQL query, creating tables project_registry' and project_rating.2. Import project data into the new tables.3. Modify project details (e.g., remove null or empty values) and set Verra registry links for VCS entries.4. Create project_ratings with standards organizations ratings and assign Verifiers as well.5. Link each project rating with its respective Verra registry link based on the associated Verra project ID. | +| [import_csv_gold_issuances.sql](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/open-offsets-directory/node-server/import_csv_gold_issuances.sql) | Manage and streamline the storage of gold emission offset issuance data with this SQL script found at `open-offsets-directory/node-server/import_csv_gold_issuances.sql`. It clears and recreates the csv_gold_issuances table, readying it to import CSV data with specified column headers. This streamlined data process is a vital component of the blockchain-carbon-accounting system's infrastructure, enabling accurate tracking of gold emission offset issuances. | + +
+ +
open-offsets-directory.node-server.app.config + +| File | Summary | +| --- | --- | +| [db.config.js](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/open-offsets-directory/node-server/app/config/db.config.js) | Configures connection settings for a PostgreSQL database, named open-offsets-directory, within the `node-server` application in the `open-offsets-directory` directory. It sets parameters including host, password, and pool limits to manage connections. This facilitates database access when running the application. | + +
+ +
open-offsets-directory.node-server.app.middlewares + +| File | Summary | +| --- | --- | +| [recaptcha.js](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/open-offsets-directory/node-server/app/middlewares/recaptcha.js) | Implemented is a security feature for verifying user responses from reCAPTCHA v3 in the `open-offsets-directory/node-server` application. This setup allows for enhanced protection against automated attacks, ensuring human verification when required. Users are prompted to solve CAPTCHAs if needed, enhancing the overall systems security and user experience. | + +
+ +
open-offsets-directory.node-server.app.models + +| File | Summary | +| --- | --- | +| [issuance.model.js](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/open-offsets-directory/node-server/app/models/issuance.model.js) | The `issuance.model.js` defines a database model for tracking carbon offset issuances within the open-source Blockchain Carbon Accounting project. It records essential attributes such as project ID, vintage year, quantity issued, and serial number. This model underpins the ability to verify and manage the issuance of carbon credits on the blockchain platform. | +| [project_registry.model.js](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/open-offsets-directory/node-server/app/models/project_registry.model.js) | In this Node.js file, youll find a model definition for project_registry in the open-offsets-directory/node-server/app'. This data model is designed to structure and manage carbon offset projects within the application. Fields like `project_id`, `registry_project_id`, and others store essential metadata related to these projects. This structure facilitates efficient tracking, management, and interaction with various project data in the context of carbon accounting. | +| [index.js](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/open-offsets-directory/node-server/app/models/index.js) | Initializes Sequelize database instance based on config file and creates models for projects, project_registries, project_ratings, issuances, and retirements. The project model has many-to-many relationships with other models using Sequelizes association methods to define multiple associations between a single project and each respective table (project_ratings, project_registries, issuances, retirements). Each relationship is defined bi-directionally. Exports the database object. | +| [project_rating.model.js](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/open-offsets-directory/node-server/app/models/project_rating.model.js) | This code file creates a SQL model named project_rating within the database schema of the `open-offsets-directory/node-server` project. The model is designed to store project rating data, including project ID, rater, rating type, and associated documents, in the `project_rating` table. This enables efficient retrieval and management of ratings for various projects within the application. | +| [retirement.model.js](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/open-offsets-directory/node-server/app/models/retirement.model.js) | In this repository for blockchain-carbon-accounting, a Retirement Model has been implemented within the open-offsets-directorys node-server, allowing for structured data storage related to carbon credits retirements in terms of project ID, quantity, and retirement details, enhancing transparency and traceability. | +| [project.model.js](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/open-offsets-directory/node-server/app/models/project.model.js) | Defines and manages a database schema for carbon accounting project records within the open-offsets-directory/node-server application. This model covers key project details such as name, location, developer, owner, offset status, and more, enabling efficient data tracking and reporting. | + +
+ +
open-offsets-directory.node-server.app.controllers + +| File | Summary | +| --- | --- | +| [retirement.controller.js](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/open-offsets-directory/node-server/app/controllers/retirement.controller.js) | In this JavaScript file located in `open-offsets-directory/node-server/app/controllers/retirement.controller.js`, a set of functions are defined to manage data retrieval related to retirements within the project. Specifically, it allows for filtering retirements by project_id and pagination when fetching results. This file is a crucial part of the application, as it serves as an interface for accessing retirement records in the database, enhancing user experience and facilitating analysis of this data. | +| [issuance.controller.js](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/open-offsets-directory/node-server/app/controllers/issuance.controller.js) | Manages issuance data for blockchain-carbon-accounting by retrieving and filtering all or single records based on project_id, paginated according to the requested page and size. Enables users to easily access and view carbon offset data for specific projects efficiently. | +| [project_registry.controller.js](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/open-offsets-directory/node-server/app/controllers/project_registry.controller.js) | Manages project registrations by retrieving and filtering all project registries from the database based on provided filters. The controller also paginates the data, allowing for efficient navigation through multiple results. This enhances usability within the blockchain-carbon-accounting applications registry system. | +| [project_rating.controller.js](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/open-offsets-directory/node-server/app/controllers/project_rating.controller.js) | In this JavaScript file, the project_rating.controller.js serves as a data handler for project ratings within the blockchain-carbon-accounting repository. It retrieves and processes rating data from a SQL database following specific filters and pagination requirements. The code dynamically applies project ID-based filters while efficiently organizing the data into pages, making it easily accessible for API requests. | +| [project.controller.js](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/open-offsets-directory/node-server/app/controllers/project.controller.js) | This script defines CRUD (Create, Read, Update, Delete) functions for handling projects in a Node.js Express application using Sequelize ORM. The findAll function fetches data based on user-defined conditions and pagination settings; it also supports nested includes by adding sub-associations as needed. The findOne function retrieves a single project by its unique ID, while the update and delete functions allow updating or deleting an existing project in the database, respectively. | + +
+ +
open-offsets-directory.node-server.app.routes + +| File | Summary | +| --- | --- | +| [issuance.routes.js](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/open-offsets-directory/node-server/app/routes/issuance.routes.js) | This Node.js server route (`issuances.routes.js`) handles API calls for blockchain carbon accountings issuance resource. It connects to the issuance controller to fetch all or a specific issuance record based on its unique ID. Integrated with Express Router, it enables seamless retrieval and management of issuance data within our decentralized application infrastructure. | +| [project_registry.routes.js](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/open-offsets-directory/node-server/app/routes/project_registry.routes.js) | Manages routes for the project registry API, interacting with project registry controller functions to retrieve all or a specific project from the database based on their unique ID. Crucial for RESTful API endpoints within the open-offsets-directorys node-server in this blockchain-based carbon accounting application. | +| [retirement.routes.js](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/open-offsets-directory/node-server/app/routes/retirement.routes.js) | This JavaScript module exports a router for handling requests related to retirements within the open-offsets-directory/node-server application. It provides functions to retrieve all retirements and a single retirement by its unique ID, serving as a gateway for accessing retirement data. | +| [project.routes.js](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/open-offsets-directory/node-server/app/routes/project.routes.js) | This node-server module routes API requests for projects data in the blockchain-carbon-accounting repository. It configures Express Router to handle GET requests for retrieving all and individual project details, using a Recaptcha middleware when enabled. Other actions like creating, updating, or deleting projects are optional and not yet implemented. | +| [project_rating.routes.js](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/open-offsets-directory/node-server/app/routes/project_rating.routes.js) | Manages routes for retrieving project rating data in an Express server application. The `project_rating.routes.js` file exports functions to retrieve all ratings and individual ratings by ID, as part of the API endpoint /api/ratings. Integrated with the larger open-offsets-directory node server structure within the parent repository blockchain-carbon-accounting. | + +
+ +
open-offsets-directory.react + +| File | Summary | +| --- | --- | +| [package.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/open-offsets-directory/react/package.json) | Manages frontend interactions within the open-source blockchain-carbon-accounting project. Utilizing Material UI for an intuitive design and Axios to handle API calls, this package brings life to user interfaces such as the dashboard and data exploration tools. Enhances user experience in carbon accounting, making complex transactions simple and engaging. | +| [.env](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/open-offsets-directory/react/.env) | Localhost:8080) to communicate with the API server efficiently in a single-page React application context. | + +
+ +
open-offsets-directory.react.public + +| File | Summary | +| --- | --- | +| [index.html](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/open-offsets-directory/react/public/index.html) | The index.html file in the open-offsets-directory/react/public directory serves as the foundation for The Open Offsets Directory web application. It structures the webpage, defining its metadata, links, title, and a placeholder for React components. Upon build and deployment, this template becomes the main webpage of the application. | +| [manifest.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/open-offsets-directory/react/public/manifest.json) | In this repository, the `manifest.json` file within the `open-offsets-directory/react/public` directory sets up the applications icon and launch configurations for standalone operation, ensuring smooth app deployment and a consistent user interface experience. | +| [robots.txt](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/open-offsets-directory/react/public/robots.txt) | In this repository, the `open-offsets-directory/react/public/robots.txt` file is a robot exclusion protocol file that welcomes all web robots and grants them full access to its content within this project, promoting transparency and seamless interaction with search engines. | + +
+ +
open-offsets-directory.react.src + +| File | Summary | +| --- | --- | +| [App.css](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/open-offsets-directory/react/src/App.css) | In this open-source project, the `open-offsets-directory/react/src/App.css` file styles the primary React application structure. It ensures flexible column layout, hover interactivity, and placeholder heights for improved user interface (UI) functionality within the projects list, forms, and spinner elements, contributing to a seamless browsing experience. | +| [index.js](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/open-offsets-directory/react/src/index.js) | In this React application, the `open-offsets-directory/react/src/index.js` file initializes and renders the user interface with reCAPTCHA functionality to prevent bots from interacting within it, ensuring authenticity in its use for carbon accounting on the blockchain platform. | +| [index.css](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/open-offsets-directory/react/src/index.css) | Stylizes the Open-Offsets-Directory React application, establishing a sleek, developer-friendly aesthetic for readable source code using fonts such as Source Code Pro and Segoe UI. | +| [http-common.js](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/open-offsets-directory/react/src/http-common.js) | Facilitates HTTP communication within the open-offsets-directorys React application by defining an axios instance with a specified base URL and Content-type header for API interactions. | +| [serviceWorker.js](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/open-offsets-directory/react/src/serviceWorker.js) | This script ensures service worker registration for progressive web applications (PWAs). On localhost, it checks if a valid service worker exists. If found, it handles updating the precached content and notifying upon successful update or offline caching. In production, it registers the service worker automatically. If the service worker cant be found, the page reloads, suggesting potential connection issues or different app. Upon user demand, unregistering the service worker is possible by triggering a function call. | +| [App.js](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/open-offsets-directory/react/src/App.js) | This React application is a navigation-driven interface for The Open Offsets Directory, an open-source project by Linux Foundations Hyperledger Climate Action and Accounting SIG. It uses routing to present various pages including Project List, Project View, About, and Terms of Use, and a footer section showcasing project details, source code link, and data source credit. | + +
+ +
open-offsets-directory.react.src.components + +| File | Summary | +| --- | --- | +| [projects-list.component.js](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/open-offsets-directory/react/src/components/projects-list.component.js) | In the blockchain-carbon-accounting repository, youll find a well-organized structure that encompasses various components such as frontend, API server, and smart contracts for a decentralized carbon accounting system. The given code file resides within the `app/scripts` directory, contributing significantly to the core functionalities of this comprehensive ecosystem.The specific scripts primary purpose is to automate the processing and analysis of utility data, including carbon emission intensities from electricity generation and conversion factors, which are crucial in assessing carbon footprints and establishing emissions trading rules within the blockchain-based system. By utilizing this script, developers can seamlessly incorporate updates to the vast array of provided utility data, thereby ensuring the integrity and reliability of the platform. The automation also allows for real-time calculations essential in tracking carbon transactions efficiently within the decentralized framework. | +| [project-view.component.js](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/open-offsets-directory/react/src/components/project-view.component.js) | App` folder: Contains the primary application components such as API server (`api-server`), frontend, Methane protocol (a specific implementation used in the blockchain network called Methane"), and various subsystems like supply chain management, reports, and scripts.-`data` folder: Holds essential data files required for operation, including historical power proxies, emission intensity data, and conversion factors for various purposes like calculations and data normalization.The current focus of the highlighted code file is likely to be found within one of the subfolders under `app`. However, without the specific file location, I can't provide a precise description. But generally, this piece of code would contribute to achieving some functionality related to API endpoints, Methane protocol operations, or frontend presentation.With this open-source project architecture, developers and contributors aim to streamline carbon accounting processes across supply chains and ensure greater transparency through the integration of blockchain technology, empowering organizations to take proactive measures toward reducing their carbon footprint. | + +
+ +
open-offsets-directory.react.src.services + +| File | Summary | +| --- | --- | +| [project.service.js](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/open-offsets-directory/react/src/services/project.service.js) | This JavaScript service defines various fields for managing data associated with carbon offset projects. It includes project details, ratings, issuance, and retirement. The service utilizes separate functions to define these fields, ensuring clarity and organization. These fields are used to structure data in an easy-to-understand manner, enhancing efficiency in the carbon offset project management process. | + +
+ +
hardhat + +| File | Summary | +| --- | --- | +| [runSlither.sh](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/runSlither.sh) | In this Linux script, you automate Solidity contract analysis. Located in hardhat directory within blockchain-carbon-accounting repository, the script ensures proper environment setup and dependencies for running Slither analyzer. By doing so, it guarantees secure smart contract coding practices throughout your decentralized application development process. | +| [.env.TEST](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/.env.TEST) | In the hardhat directory of the blockchain-carbon-accounting repository, this.env.TEST file serves as a configuration for integrating Hardhat and the API server during testing. It defines crucial endpoints (such as the LEDGER_ETH_JSON_RPC_URL) and contract addresses (e.g., LEDGER_EMISSION_TOKEN_CONTRACT_ADDRESS), streamlining interactions for seamless test runs in the specified Hardhat network (LEDGER_ETH_NETWORK). | +| [.ethereum-config.js.template](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/.ethereum-config.js.template) | Configures Ethereum-specific settings for Hardhat, a development tool used in this blockchain carbon accounting project. This file stores private configuration details such as deployer keys and Infura project ID, essential for connecting to custom networks, deploying contracts, and verifying on Etherscan (if required). | +| [rebuildContracts.sh](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/rebuildContracts.sh) | Rebuilds Solidity contract artifacts for the hardhat blockchain deployment, ensuring consistent ABI versions across both the frontend application and backend Fabric blockchain integration. Streamlines the process of keeping contracts in sync between platforms. | +| [slither.config.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/slither.config.json) | This hardhat/slither.config.json configures the Slither static analysis tool to scan all contracts and generate a human-readable summary of detected issues. The findings can help in identifying potential security flaws, ensuring the safety and integrity of smart contracts within this Ethereum blockchain project. | +| [package.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/package.json) | The project consists of a Hardhat configuration for a decentralized application with focus on oil & gas sector benchmarking. Uses Solidity for smart contracts and Etherscan, Waffle, Upgrades, and ethers library for development. Integrated with OpenZeppelin and Eth-Optimism for increased functionality. Prettier handles code formatting, linting, and testing via Hardhat Test, while Chai and Mocha support test coverage and assertion functionalities. Supertest facilitates API testing, and additional libraries include Uuid, IPFS, and Axios for miscellaneous operations. | +| [.eslintrc.js](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/.eslintrc.js) | This code file, located at `hardhat/.eslintrc.js`, configures ESLint rules for the TypeScript code within the repository. The settings ensure compliance with recommended standards while accommodating specific needs, such as Mocha testing and Node.js environment. This configuration streamlines development by providing consistent coding practices across all TypeScript projects within the Hardhat framework. | +| [tsconfig.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/tsconfig.json) | The `hardhat/tsconfig.json` configures the TypeScript compiler for Solidity smart contract development within our blockchain-carbon-accounting repository. It optimizes target output, enables decorators, and sets commonjs module system. Key settings like emitDecoratorMetadata ensure metadata persistence for improved readability in our smart contracts. | +| [runSlither.py](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/runSlither.py) | This script navigates through directory structures and invokes `slither` on selected Solidity files located within `backupContractDir` and `Governance` subdirectories. It generates JSON reports with human-readable summaries for each analyzed contract, providing insight into their structure, security vulnerabilities, and other important properties in the blockchain application. | +| [hardhat.config.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/hardhat.config.ts) | In the blockchain-carbon-accounting repository, this codebase resides under `app/api-server` and serves as a crucial component of the overall system architecture by handling the backend API operations. This API is instrumental in enabling interactions with the various modules within the application such as the frontend, supply chain, methane, reports, and api-oracle.The API server ensures seamless data communication across the different functionalities, acting as the backbone for users to access the services provided by this platform. The critical feature of this code lies in its ability to process requests from various clients and manage responses efficiently, ensuring smooth transactions within the blockchain-carbon-accounting ecosystem.The focus of the code is on facilitating API endpoints that can be easily consumed by the frontend application, supply chain components, or other external systems if needed. By working in conjunction with other modules such as the data layer for storage and retrieval purposes, this backend server contributes significantly to the functionality, usability, and scalability of the blockchain-carbon-accounting platform. | + +
+ +
hardhat..openzeppelin + +| File | Summary | +| --- | --- | +| [goerli.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/.openzeppelin/goerli.json) | In the blockchain-carbon-accounting repository, you will find a structure consisting of various key directories including an API server, frontend, and supply chain applications, along with data files for carbon emissions. The primary goal of this codebase is to create a comprehensive system for tracking and accounting for carbon emissions across energy industries using blockchain technology.The `api-server` directory contains the main backend services that provide interfaces for various modules in the application, such as connecting to an external API oracle, handling requests from the frontend, and managing data related to methane emission records, reports, and supply chain.Meanwhile, the `frontend` directory focuses on providing a user-friendly interface where users can interact with the system easily, accessing data on emissions and other related information.The `supply-chain` directory manages the complex supply chains associated with energy industries, tracking emissions at various stages and providing valuable insights for reduction strategies.Lastly, the `data` directory stores a vast collection of data files, including historical carbon emission proxies, utility data, and emission intensity data. These are essential to power the applications core functionalities and generate meaningful reports. The structure ensures a robust and maintainable architecture that effectively addresses critical aspects of carbon accounting and emission tracking within energy industries using blockchain technology. | +| [unknown-1337.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/.openzeppelin/unknown-1337.json) | App`: Contains core functional components of the application, including APIs, frontend, Methane (presumably a specific feature), reports, scripts, and supply-chain modules.2. `data`: Stores essential datasets required for the operation, such as utility data from various years in CSV or Excel format, emission intensity factors, and proxy data for Europe's Emissions Trading System (ETS).In relation to its parent repository, the `co2-emission-intensity-6.csv` file inside the `data` directory provides COโ‚‚ emission intensity data needed by the carbon accounting system to calculate the carbon footprint associated with certain activities or resources within the applications scope. This critical data is vital for tracking and reducing emissions in a blockchain-based environment. | +| [kovan.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/.openzeppelin/kovan.json) | Gathering and verifying data on carbon emissions from different stages of the supply chain.2. Storing or transmitting this data to the blockchain for accountability and transparency.3. Facilitating the generation of reports that enable users to monitor, analyze, and make informed decisions based on the collected data.These features help drive the core goal of the blockchain-carbon-accounting" repository: to empower organizations in assessing their carbon footprints across their supply chains using blockchain technology, enabling more sustainable practices in an effort towards carbon neutrality. | + +
+ +
hardhat.bevel + +| File | Summary | +| --- | --- | +| [network.yaml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/bevel/network.yaml) | Set up validator with customized ports (8546-8547, 30303-30304, 15016-15021).2. Establish Carrier organization with specific Azure Kubernetes context and GitOps settings.3. Set up peers for Carrier with defined node subjects, passphrases, locking options, customized ports, and ambassador configurations.4. Include MySQL port (3306) for Tessera and Orion transaction manager configurations (port 443 and ambassador 15022). | + +
+ +
hardhat.bevel.local + +| File | Summary | +| --- | --- | +| [kind.yaml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/bevel/local/kind.yaml) | Deploys a Kubernetes cluster consisting of a control plane node and three worker nodes, defined by `hardhat/bevel/kind.yaml`. This architecture setup serves as the basis for executing decentralized applications in the blockchain-carbon-accounting system. | +| [network.yaml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/bevel/local/network.yaml) | Initializing GitOps workflow on Bevel project using HTTPS protocol for repository at with develop' branch and specified release and chart directories.Setting up cloud services on Minikube using Kind context kind-kind and defined config file path.Configuring Vault authentication with specified URL, root token, secret path, and private key for secure secrets management.Deploying services: Defining Validators with custom names and ports, Peer carrier' service with subject, passphrase, lock option, ports, databases, and ambassador settings in a multi-node Hyperledger Besu network. | + +
+ +
hardhat.test + +| File | Summary | +| --- | --- | +| [token-network-integration-tests.js](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/test/token-network-integration-tests.js) | This code file is part of the blockchain-carbon-accounting" repository, a solution that aims to establish a transparent, decentralized platform for carbon accounting within energy supply chains. The specific code is located under the app/api-server folder and it serves as a crucial component in the application's server-side API.The main purpose of this piece of code is to handle requests from the frontend and other components of the application, acting as an intermediary between different parts of the system. It plays a vital role in ensuring smooth data flow within the platform, by enabling communication between the application's various modules, such as the supply chain, reports, methane tracking, and frontend components.By implementing this functionality, users can efficiently interact with the application and make use of its features for managing, monitoring, and reporting on carbon emissions in real-time, all while contributing to a more sustainable future. Keeping open-source principles at heart, the repository is well-documented with guides on setting up and using the project, as well as a detailed user guide, ensuring that developers and enthusiasts worldwide can contribute and benefit from the platforms innovations. | +| [DAO-integration-tests.js](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/test/DAO-integration-tests.js) | One with a simple majority vote for quorum failure and another where the same weight of votes are cast for and against (quadratic voting). Each scenario utilizes Ethereum contracts and advances blocks to simulate the passage of time, and expects specific proposal states as outcomes. | +| [emissions-factor-unit-tests.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/test/emissions-factor-unit-tests.ts) | Validates and calculates emissions factors for electricity and natural gas usage in different states of the United States using a PostgresDBService. The test suite ensures that calculations are accurate and consistent with the specified emissions factors, returning results with correct units (kgCO2e) for electricity and natural gas activities. | +| [bigint-tests.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/test/bigint-tests.ts) | Test suite verifies that token issuance is properly recorded in the database and API, ensuring correct data handling for issued tokens. Additionally, it checks TRPC tokens.lookup APIs ability to retrieve token information with expected results. | +| [DAO-multi-attribute-tests.js](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/test/DAO-multi-attribute-tests.js) | This code file resides in the `blockchain-carbon-accounting` repository, a project dedicated to blockchain-based carbon accounting. The specific file youre referring to is located within the `app/methane` directory, indicating its relationship to the application portion of the repository.The primary purpose of this code is to facilitate data processing related to methane emissions. While details about the technical implementation are beyond the scope of this summary, we can say that the file contributes to the overall goal of the project by reading and manipulating relevant emission data to enable effective carbon accounting using blockchain technology. This includes handling files such as.csv and.xlsx data sources for emissions information and conversion factors. The processed data is expected to be used in the context of the entire application, including the frontend and other services like API servers and supply chain management modules.In essence, this code is an integral part of the data pipeline that ultimately contributes to accurate carbon accounting on a blockchain platform in support of environmental initiatives. | +| [ethers-provider.js](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/test/ethers-provider.js) | In the provided repository structure for blockchain-carbon-accounting, this `hardhat/test/ethers-provider.js` file exports an Ethers provider instance for Hyperledger Besus Optimistic Rollup network (OVM) or the main Ethereum network. This facilitates seamless testing across different blockchain environments within the hardhat test framework. | +| [tracker-integration-tests.js](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/test/tracker-integration-tests.js) | App` and `data`.The `app` directory contains essential components such as the frontend, API server, API oracle, supply chain, and methane modules. These modules work together to provide a seamless user experience, manage API requests, maintain the blockchain-powered supply chain, and analyze data related to natural gas systems for detecting and preventing methane leaks.The `data` directory stores various data files required for the project. These files include historical electricity consumption, carbon emission intensity data, utility data, and conversion factors needed for proper analysis of carbon emissions. The data here serves as a foundation for accurate calculation and visualization of carbon accounting on the platform.By using this codebase, developers and environmental enthusiasts can work together to create a more sustainable future by providing transparency, accountability, and efficient data management in the realm of carbon emissions tracking and analysis within the energy sector. | +| [DAO-unit-tests.js](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/test/DAO-unit-tests.js) | In the `blockchain-carbon-accounting` repository, theres a structure consisting of various components such as an API server, frontend, supply chain, methane, reports, and an api-oracle. This open-source project focuses on creating a blockchain-based carbon accounting system.The specific code file you are referring to is located under the `app/scripts` folder. Although details about the technical implementation are omitted here, this script plays a vital role in executing critical functions related to the overall architecture of the application. This script facilitates the processing of various datasets like 2016-RES_proxies_EEA.csv, 2017-RES_proxies_EEA.csv, and so forth, contained within the `data` directory. It may also manage data manipulation, aggregation, or transformation tasks required for a carbon accounting system to function accurately and efficiently. By processing these datasets and other functionalities it enables, this script supports the overall goal of creating a transparent, tamper-proof, and scalable solution for tracking and managing carbon emissions within various sectors. | +| [token-request-integration-tests.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/test/token-request-integration-tests.ts) | The provided codebase, titled `blockchain-carbon-accounting`, is a comprehensive blockchain solution aimed at carbon accounting. Its structure is thoughtfully organized with a primary focus on an API server (`api-server`), frontend (`frontend`), and various application modules like `api-oracle`, `methane`, `supply-chain`, and more, each handling specific tasks within the blockchain environment.The `data` directory houses essential csv and excel files required for the functioning of this system, such as energy proxies data from 2016 to 2020, utility data, co2 emission intensities, and conversion factors.In essence, this codebase is designed to facilitate a scalable blockchain infrastructure that processes carbon accounting data (utilizing the provided data files) and enables seamless interactions with various components through an API server and frontend interface, empowering users to track carbon emissions across their supply chains more effectively. | +| [common.js](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/test/common.js) | Implement a function that creates and proposes multiple smart contracts changes (parent and child) based on provided parameters. This function accepts parameters like proposer, Governor contract address, fromDate, thruDate, metadata, manifest, description for parent proposal, targets, values, signatures, calldatas, and description for child proposals. It formats the proposals, creates them, waits for one block to be mined, verifies the state of the new proposals, and returns the ID of the proposed parent contract change. After this function, a separate function called executeProposalAndConfirmSuccess is provided to execute a given proposal ID, checks the number of unique tokens after execution, and confirms successful token increase by one. | +| [token-network-unit-tests.js](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/test/token-network-unit-tests.js) | This code file is part of the blockchain-carbon-accounting" repository, a comprehensive solution designed for carbon accounting in a blockchain environment. Specifically, it resides within the `app/methane` directory, suggesting a role related to calculating and managing methane emissions.The critical features of this code file are its ability to process and analyze data related to greenhouse gas emissions, particularly focusing on methane. The data is sourced from CSV files such as co2-emission-intensity-6.csv and others within the `data` directory, while ensuring compatibility with the ESLint configurations in both directories (`.eslintrc.json`) for maintainable code quality.This functionality is a crucial part of the overall architecture of the project as it helps users to understand the carbon footprint of their supply chain, aiding them in making informed decisions towards sustainable operations and practices. By integrating with the blockchain, this tool provides transparency, traceability, and security for the environmental data managed. | + +
+ +
hardhat.deploy + +| File | Summary | +| --- | --- | +| [net-emissions-token-network.js](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deploy/net-emissions-token-network.js) | This script deploys a NetEmissionsTokenNetwork smart contract using Hardhat, granting permissions to the Timelock contract for token issuance. Part of the broader CLM8 deployment dependencies in the Ethereum-focused architecture, this action establishes essential components within the DAO's emissions token network. | +| [z-carbon-tracker.js](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deploy/z-carbon-tracker.js) | Deploys CarbonTracker contract onto the Ethereum network using Hardhat framework, utilizing deployers account. Interacts with NetEmissionsTokenNetwork to register the new carbon tracker as an industry. The deployed CarbonTracker smart contract enables tracking and management of greenhouse gas emissions in the blockchain-carbon-accounting system. | +| [daoToken.js](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deploy/daoToken.js) | In this JavaScript file located within the `hardhat/deploy` directory of the blockchain-carbon-accounting repository, a function is defined to deploy a DAOToken contract onto a specified Ethereum network. The contract is instantiated with an initial token holder, and if deployed on a non-live network, it grants the deployer temporary voting power for self-governance. | +| [dao.js](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deploy/dao.js) | Deploys Governor contract and sets it on DAOToken as governing authority if possible. If on local network without timelock admin set, advances time by 51 hours to enable timelock administration transfer or outputs command to execute it later. | + +
+ +
hardhat.solidity + +| File | Summary | +| --- | --- | +| [CarbonTracker.sol](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/solidity/CarbonTracker.sol) | App`: Contains various functional modules, including `api-oracle`, `api-server`, `frontend`, `methane`, `reports`, `scripts`, and `supply-chain`. These components form the core application handling data management, user interface, API calls, supply chain operations, etc.* `data`: Contains all data files necessary for the repository's operation, including carbon emission intensities from various sources and conversion factors required to calculate emissions accurately.The highlighted file, presumably located within one of these directories, would be part of a specific feature or functionality being developed in this broader context, such as an algorithm for calculating carbon footprint within the `methane` module, or an API endpoint handling user authentication in the `api-oracle`.While the technical details may differ between files, their unifying purpose remains focused on delivering a robust, open-source platform for carbon accounting that leverages blockchain technology to promote transparency and sustainability within EEA supply chains. | +| [NetEmissionsTokenNetwork.sol](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/solidity/NetEmissionsTokenNetwork.sol) | FrontendThe user interface for interacting with the application and its functionalities, likely providing dashboards, charts, and forms to facilitate easy access and use.2. **API ServerResponsible for managing requests, handling data from different sources (e.g., supply chain or external APIs), and returning structured responses. This layer serves as the intermediary between frontend applications and the core application logic.3. **api-oracle** and **supply-chain** folders contain modules for integrating with various data sources to fetch carbon emission, utility consumption, and conversion factor data from external APIs or local storage.4. **reportsThis folder holds various reports on carbon emissions and energy utilization, which could include summaries, detailed analysis, and trends over time, potentially used for regulatory compliance purposes.5. **dataContains essential datasets required for the proper functioning of the blockchain-carbon accounting system, including conversion factors, utility data, and emission intensity data for different years and regions. These files may have undergone some preprocessing steps, such as data validation, formatting, or merging with other sources to create a unified dataset for the application to utilize effectively.By integrating all of these components | + +
+ +
hardhat.solidity.Libraries + +| File | Summary | +| --- | --- | +| [TrackerStructs.sol](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/solidity/Libraries/TrackerStructs.sol) | Manage carbon emission tracking** within this hardhat Solidity library (TrackerStructs.sol). Defines data structures for **CarbonTrackerDetails**, **ProductDetails**, and **CarbonTrackerMappings**. These structures are used to organize and store the necessary data to accurately track, measure, and distribute carbon emissions in the NetEmissionsTokenNetwork system. | +| [ArrayModifier.sol](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/solidity/Libraries/ArrayModifier.sol) | This code library, located within the hardhat/solidity/Libraries/ArrayModifier.sol file, implements functions for updating and managing an arrays indices and associated data. It streamlines operations for maintaining dynamic arrays in Solidity smart contracts, thereby enhancing their efficiency in the blockchain-carbon-accounting system. | +| [TxVerifier.sol](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/solidity/Libraries/TxVerifier.sol) | Validates Ethereum transaction signatures and metadata signatures for contract interactions, ensuring their integrity within the blockchain-carbon-accounting system. Leverages open-source libraries to reconstruct hashes and check for correct signer verification. Ensures data privacy and integrity in a decentralized environment. | + +
+ +
hardhat.solidity.Governance + +| File | Summary | +| --- | --- | +| [Governor.sol](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/solidity/Governance/Governor.sol) | In the Blockchain Carbon Accounting repository, the file structure is divided into key directories such as `app`, `data`, and root-level markdown files containing usage guidelines. The critical code file under discussion resides within the `app` directory, specifically in the `api-server` folder.The primary purpose of this specific code file (not explicitly mentioned here) within the API server is to facilitate communication between the Blockchain Carbon Accounting application and external services (API oracles), acting as an intermediary layer in data retrieval and exchange processes. By abstracting this complexity, the system allows for seamless interaction with diverse data sources while maintaining a uniform API structure that adheres to best practices.Additionally, its essential to highlight the repository's primary objective, which is to create a blockchain-based carbon accounting platform tailored for the European Energy market by combining various data sources such as electricity generation, industry emissions, and energy usage statistics. This platform enables users to monitor, analyze, and track their carbon footprint in real-time. The code file you've asked about plays a vital role in this endeavor by providing the connectivity necessary to aggregate and exchange critical data for carbon accounting purposes. | +| [Timelock.sol](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/solidity/Governance/Timelock.sol) | Manages contract administration with timelock and pending admin system. Admin can queue, cancel, or execute transactions. Transactions must come from the admin or pendingAdmin, but only if its within the specified time limits. The system has a grace period to account for network congestion. | +| [DAOToken.sol](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/solidity/Governance/DAOToken.sol) | In the `blockchain-carbon-accounting` repository, you will find a comprehensive architecture for a decentralized blockchain system aimed at carbon accounting. The codebase is divided into several sections, one of which is the `app` directory, which houses multiple components.The specific file we are focusing on is located in the `supply-chain` subdirectory of the `app` section. This file is a critical component within the repository architecture as it facilitates interactions within the carbon accounting supply chain.The purpose of this code file is to establish secure and efficient communication between various entities participating in the carbon accounting system, such as suppliers, consumers, regulatory bodies, etc., ensuring accurate and transparent data exchange for effective carbon account management.By interacting with this piece of code, users can take part in a network where trustworthy data can be shared, tracked, and audited in real-time using blockchain technology. The underlying architecture ensures the integrity and immutability of data stored within the system. | + +
+ +
hardhat.hedera + +| File | Summary | +| --- | --- | +| [.env.SAMPLE](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/hedera/.env.SAMPLE) | In the hardhat/hedera directory of the blockchain-carbon-accounting repository, the `.env.SAMPLE` file stores sample settings for a Hedera account, including its unique ID and private key. This enables easy setup and management of a secure account within the Hedera blockchain ecosystem for carbon accounting transactions. | +| [deploy.js](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/hedera/deploy.js) | Breaks down bytecode into manageable chunks.2. Creates and appends bytecode to a file on Hedera with specified keys.3. Uses the bytecode file ID to create a new contract instance.4. Sets contract constructor parameters.5. Submits transaction to deploy smart contract instance on the network.6. Logs new contract ID and Solidity address for future use. | +| [package-lock.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/hedera/package-lock.json) | API EndpointsThe server exposes multiple API endpoints for various purposes such as user authentication, data retrieval, transaction management, and more โ€“ enabling smooth interaction between the blockchain, frontend application, and external systems.2. **Security MeasuresTo safeguard sensitive data and maintain integrity, the API server employs appropriate security measures such as encryption, access controls, and input validation techniques to minimize potential risks.3. **Scalability & PerformanceThe architecture of this backend server is designed for optimal performance and scalability. By implementing best practices in server-side development, the API server aims to support growing user traffic efficiently, ensuring a seamless experience across the decentralized carbon accounting platform.4. **InteroperabilityAs part of the larger `blockchain-carbon-accounting` ecosystem, this API server enables seamless interoperability between components, making it possible for diverse services like the frontend, oracle, and blockchain to communicate effectively and harmoniously. | +| [package.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/hedera/package.json) | In this open-source project, the `hardhat/package.json` configuration sets up a Hedera network for the net-emissions-token-network, enabling efficient deployment and maintenance of blockchain applications focused on carbon accounting in supply chains. This file links vital dependencies, such as the Hedgera SDK and dotenv, ensuring seamless network integration and environment variable management. | + +
+ +
hardhat.deployments.hedera-testnet + +| File | Summary | +| --- | --- | +| [DAOToken.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deployments/hedera-testnet/DAOToken.json) | The `app` folder houses several important modules such as `api-server`, `frontend`, `api-oracle`, `supply-chain`, `methane`, and `reports`. These modules are responsible for different functionalities in the application, including creating APIs, managing user interfaces, processing data from API oracles, overseeing supply chains, dealing with methane emissions, generating reports, and more.2. The `data` folder contains data related to the greenhouse gas emission proxies across various years (2016-RES_proxies_EEA, 2017-RES_proxies_EEA, 2018-RES_proxies_EEA). These datasets can be utilized by other modules to analyze and track the progress of carbon emissions in the European Economic Area.The goal is to provide an efficient and scalable system that empowers users to monitor and mitigate their greenhouse gas footprint by leveraging a blockchain-based solution, backed by credible data sets. | +| [Timelock.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deployments/hedera-testnet/Timelock.json) | These parts work together to provide an API for the system, facilitating data exchange with other systems and services within the supply chain.2. **frontendThis component is responsible for building a user-friendly interface, making it easier for users (energy producers, regulators, etc.) to interact with the blockchain and carbon accounting system.3. **methane** and **reportsThe `methane` module appears to deal with methane emission tracking and reporting, a crucial aspect of carbon accounting, especially in energy sectors. The `reports` module might handle generating and managing various types of reports required for auditing, analysis, or regulatory compliance purposes.4. **supply-chainThis part may involve managing and tracking the movement of goods and associated emissions within the energy sector's supply chain.5. Data is stored and managed in the `data` folder. The repository contains historical carbon accounting data and proxies for EU countries, dating back to 2016, which are presumably used for modeling, analysis, or comparison purposes.The `blockchain-carbon-accounting` project aims to create a transparent, secure, and scalable solution for carbon accounting in energy sectors using blockchain technology while | +| [.chainId](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deployments/hedera-testnet/.chainId) | The file at `hardhat/deployments/hedera-testnet/.chainId` defines the test network chain ID for Hedera transactions within the blockchain carbon accounting systems Hardhat environment. This assignment enables efficient communication between contract deployments and Hedera Testnet, streamlining the development process. | + +
+ +
hardhat.deployments.hedera-testnet.solcInputs + +| File | Summary | +| --- | --- | +| [303f0d0861904a4ebaa538b95b45b55f.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deployments/hedera-testnet/solcInputs/303f0d0861904a4ebaa538b95b45b55f.json) | This code file resides within the `blockchain-carbon-accounting` repository, specifically in the `app/methane` directory. The main purpose of this code is to establish a blockchain-based accounting system for carbon accounting, with a focus on methane emissions.In the broader context of the project's architecture, the `app/methane` directory contains different components like `api-oracle`, `api-server`, `frontend`, `supply-chain`, and others, each contributing to various functional aspects such as API management, user interface, and supply chain integration.More specifically, the referenced code file seems to be associated with the `methane` component. Although the exact purpose remains unspecified in the provided information, we can infer that this file contributes to the methane-specific carbon accounting operations, such as data processing or calculations for tracking and verifying methane emissions in the supply chain. This interpretation is derived from its placement within the `methane` directory.Additionally, it is important to note that the project leverages several external data files stored in the `data` directory, including carbon emission intensity data and utility data for different years. The use of these files demonstrates the data-driven nature of the project, allowing for accurate calculations related to carbon emissions accounting. | +| [9cae68ccb2da1ec502699fbdf8934a04.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deployments/hedera-testnet/solcInputs/9cae68ccb2da1ec502699fbdf8934a04.json) | The code file you are referencing is a part of the blockchain-carbon-accounting" repository, which is designed to facilitate a blockchain-based carbon accounting system. The main purpose of this codefile, located within the `app/methane` directory, is to manage the methane component in this architecture.The Methane module focuses on the tracking and calculation of methane emissions, an essential aspect for carbon accounting. This module interacts closely with other components such as the API server, frontend, and supply chain within the application structure, enabling real-time data flow. It leverages external data files for reference such as utility data from 2019 and 2020, and emission intensity data (co2-emission-intensity-6.csv) to accurately calculate emissions related to methane production.This module does not deal with the technical implementation details of the blockchain or smart contracts but integrates with these functionalities for efficient tracking, recording, and auditing carbon emissions associated with methane production. Overall, it strengthens the transparency and trustworthiness of the carbon accounting system, supporting more informed decision-making regarding greenhouse gas emissions. | + +
+ +
hardhat.deployments.xdai + +| File | Summary | +| --- | --- | +| [DAOToken.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deployments/xdai/DAOToken.json) | This code file, found in the app/api-server" directory of the blockchain-carbon-accounting repository, is a crucial part of the overall system architecture. It contains the server-side application responsible for handling requests related to the blockchain and carbon accounting functionalities.The key purpose of this file is to act as an API endpoint for interactions between the frontend, other modules (e.g., supply chain, methane), and external systems (oracle APIs). This API server facilitates seamless data exchange, ensuring accurate and efficient tracking of carbon emissions within the defined blockchain-based ecosystem.Notably, this code enables users to submit emissions data, query existing data, verify transactions, and participate in the carbon trading process within the decentralized system. Furthermore, the API server works in harmony with other components such as the oracle APIs for real-time market data and the supply chain module for tracking carbon emission sources along each product's lifecycle.Lastly, this file is written using a programming language (not specified in the provided information) that adheres to ES6 syntax and follows specific coding guidelines defined by ESLint for maintaining code quality and consistency across the project. | +| [NetEmissionsTokenNetwork_Implementation.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deployments/xdai/NetEmissionsTokenNetwork_Implementation.json) | Api-oracle, api-server, frontend, methane, reports, scripts, and supply-chain.Here's a brief overview of what these modules achieve in the context of the entire system:1. `api-oracle`: The data source for API endpoints that supply essential information required by the system, ensuring smooth functionality and operation within the blockchain ecosystem.2. `api-server`: The main server responsible for handling requests to and from the application's API endpoints, allowing users and other systems to interact with our blockchain carbon accounting solution.3. `frontend`: User-facing interface for interacting with the system, providing an accessible and intuitive way for users to engage with the carbon accounting services offered by our platform.4. `methane`: A module responsible for executing transactions and performing computations on the blockchain in accordance with its purpose as a carbon-accounting tool.5. `reports`: The generator of comprehensive reports detailing carbon footprints, emissions data, and other critical insights relevant to the carbon accounting function of the system.6. `scripts`: A directory containing scripts that handle various tasks, such as initializing the system, performing periodic maintenance or updates, and addressing specific functional issues or improvements in a code | +| [.pendingTransactions](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deployments/xdai/.pendingTransactions) | Transactions initiated from address 0xDf341ee5E3218CaF278b87CB9e8670f37F116513, targeting address 0xd162152cb566858D81630264e71854d2633A52ff. Nonce 4. Sends data 0x.... Gas Price of 20000000000 and a gas limit of 53441. Executed on Ethereum's Rinkeby network (chainId 100). | +| [NetEmissionsTokenNetwork_Proxy.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deployments/xdai/NetEmissionsTokenNetwork_Proxy.json) | In the provided codebase named `blockchain-carbon-accounting`, the focus lies on creating a decentralized blockchain for carbon accounting, leveraging transparency and immutability to trace greenhouse gas emissions throughout the supply chain. This project aims to help combat climate change by providing an efficient system to account and reduce carbon footprint in industries.The `app` directory houses essential components of the project's architecture. The code file of interest, located within `app/api-oracle`, seems critical as it is responsible for orchestrating data sourced from external APIs related to greenhouse gas emissions data. This information feeds into the blockchain, ensuring a complete and up-to-date picture of emissions within the supply chain.By aggregating emission data, the project aims to enable better decision-making for industry stakeholders to minimize their environmental impact while maintaining the competitive edge. The data is stored in the `data` directory in CSV format, with separate files for each year ranging from 2016 to the most recent one available. | +| [DefaultProxyAdmin.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deployments/xdai/DefaultProxyAdmin.json) | The provided code resides in the blockchain-carbon-accounting" repository, a project focused on creating a blockchain-based carbon accounting system for energy consumption data. In this structure, the specific file is located within the app/scripts directory, indicating it relates to the scripts used within the application.The primary function of this script appears to involve processing and analyzing the historical energy consumption data contained in CSV files located in the data folder (e.g., 2016-RES_proxies_EEA.csv). The data seems to pertain to renewable energy resources across Europe for multiple years, as evidenced by the files' naming pattern.Although the technical details are not fully disclosed, it is implied that this script plays a crucial role in feeding analyzed and structured consumption data into the blockchain-based accounting system, supporting efficient tracking and auditing of carbon emissions across various energy sources. Additionally, the scripts organization suggests collaboration between the frontend, api-server, methane, supply-chain, and reports components within the overall project architecture, as indicated by the repository structure provided. | +| [Governor.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deployments/xdai/Governor.json) | The code file in question is part of the blockchain-carbon-accounting" repository, a solution designed for carbon accounting using blockchain technology. In this project, the critical component of interest lies within the `app` directory, specifically inside `supply-chain`.The supply-chain folder of this repository contains code that manages the data flow and tracking of carbon emissions across various stages in a product's lifecycle, enabling companies to gain insights into their carbon footprint. This functionality is vital for organizations seeking transparency, accountability, and improved sustainability practices.While delving deeper into technical specifics is beyond the scope of this summary, it's worth noting that the supply-chain module communicates with other components such as the frontend, API server, oracle, methane, reports, and scripts within the broader application architecture. These connections ensure accurate carbon accounting across various layers of the system.By utilizing this solution, users can effectively manage and analyze their carbon emissions data, facilitating informed decision-making that promotes more sustainable business practices and overall environmental stewardship. | +| [Timelock.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deployments/xdai/Timelock.json) | The codebase youre referring to is the Blockchain Carbon Accounting project, designed for tracking and verifying carbon emissions across supply chains using blockchain technology.Within this project, the primary focus lies in the `app` directory. The subdirectories `api-server`, `frontend`, `supply-chain`, and `methane` represent the key components of the application's architecture.1. The `api-server` component serves as the central hub for processing, storing, and managing data related to carbon accounting.2. The `frontend` directory holds the user interface responsible for interacting with users and visualizing the data in an intuitive manner.3. The `supply-chain` subdirectory contains the logic and functionality dedicated to tracking the carbon emissions throughout supply chains, facilitating transparency, and enabling informed decision-making.4. The `methane` component focuses specifically on calculating, managing, and reporting methane emissions for specific sources within these supply chains, contributing significantly to understanding their carbon footprint.Apart from the app, the `data` directory is where all relevant datasets for analysis are stored and managed, including historical proxy data. | +| [NetEmissionsTokenNetwork.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deployments/xdai/NetEmissionsTokenNetwork.json) | The provided code file belongs to the blockchain-carbon-accounting" repository, which is designed for carbon accounting using a blockchain-based system. Specifically, the referenced code resides in the app/scripts directory of this project, suggesting that it contains scripts for various functionalities within the application.One can infer that the script is part of an overall architecture where multiple components such as API servers, frontend, methane module, supply-chain module, and reports are coordinated to achieve efficient carbon accounting on a blockchain platform. The data folder contains essential files related to energy resource proxies for EEA from 2016 to 2019.Without delving into technical details, the primary purpose of this script in the grand scheme is likely to automate, analyze or process data from the specified files, potentially helping to improve the accuracy and timeliness of carbon accounting within the system. Furthermore, its use could optimize workflows related to the overall operation of the blockchain-carbon-accounting platform. | +| [.chainId](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deployments/xdai/.chainId) | In the given hardhat repository, this deployment configuration file sets the xdai chain ID (100) for Ethereum transactions on the XDai network. This facilitates seamless integration of blockchain applications within the overall ecosystem by establishing connection points to the specific XDai blockchain instance. | + +
+ +
hardhat.deployments.xdai.solcInputs + +| File | Summary | +| --- | --- | +| [974bc146561ff721e27b69dac0abf973.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deployments/xdai/solcInputs/974bc146561ff721e27b69dac0abf973.json) | Blockchain Carbon Accounting Repository-API Server ComponentThe given code file is part of the Blockchain Carbon Accounting repository, specifically located in the `app/api-server` directory within the project's main folder. This code contributes to the backend component of the overall system architecture, serving as the API server.In simpler terms, this code manages and facilitates data exchanges between frontend applications, third-party services (API oracles), the blockchain, and other components like supply chain and reporting systems. Its main purpose is to handle API requests, process data, and generate responses, providing essential functionality for seamless interactions with external entities while maintaining an efficient carbon accounting system on the blockchain. | +| [6c5d52a316045a433321003aa253ba4a.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deployments/xdai/solcInputs/6c5d52a316045a433321003aa253ba4a.json) | The code file is part of the `blockchain-carbon-accounting` repository, a software solution for tracking carbon emissions within supply chains using blockchain technology. This particular code file is located under the `app/api-server` directory, suggesting it is instrumental in setting up and managing the server side API for this application.In relation to the parent projects architecture, this file likely plays a crucial role in facilitating interactions between frontend, other microservices, and external data sources, helping to achieve the overarching goal of accurately monitoring carbon emissions across various stages of the supply chain. Although specific technical aspects are omitted from the summary for brevity, it is essential to understand that this code is integral to enabling seamless data exchange, ensuring the accuracy and reliability of emission calculations. | +| [5560af258f208c025d3456f27c7ae503.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deployments/xdai/solcInputs/5560af258f208c025d3456f27c7ae503.json) | API Server (api-server):** Manages data communication with frontend and other components, enabling seamless interaction between them.2. **Frontend:** Provides the user interface for interacting with the system, visualizing carbon accounting data, and exploring supply chain emissions insights.3. **Supply Chain (supply-chain):** Handles management of data related to the supply chain, helping track the carbon footprint associated with different products or materials.4. **Reports (reports):** Generates reports based on collected data, providing actionable insights for reducing carbon emissions across the system.5. **Data Directory:** Stores various datasets needed for calculation and analysis purposes, including utility data, conversion factors, and CO2 emission intensity data from multiple years. These datasets help establish a solid foundation for the system's accuracy and reliability.By orchestrating these components within this architecture, the `blockchain-carbon-accounting` project aims to create a powerful tool for businesses to better understand their carbon footprint, optimize supply chains, and make data-driven decisions toward achieving environmental sustainability goals. | +| [51afe9d9d880d6e752e116f7e0b2453b.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deployments/xdai/solcInputs/51afe9d9d880d6e752e116f7e0b2453b.json) | Blockchain Carbon Accounting System-API Server Code FileThe given code file is a crucial component of the Blockchain Carbon Accounting System (blockchain-carbon-accounting), specifically the api-server module within the app directory. This software piece serves as a central interface for various system functionalities, bridging interactions between frontend applications and other components like the methane, supply-chain, and reports modules.The primary purpose of this code is to manage, process, and transmit requests and responses that facilitate data exchange, user authentication, and system integration among different parts of the application. By doing so, it contributes significantly to the system's efficiency and overall performance.This file, with other associated pieces, ensures smooth functioning, scalability, and adaptability for the expanding needs of carbon accounting in diverse industries and geographies. Keeping an eye on open-source initiatives and collaborations within the repository will further enhance its capabilities, promoting sustainable solutions for the future. | +| [da392488b6f757641034a3bc392b0b87.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deployments/xdai/solcInputs/da392488b6f757641034a3bc392b0b87.json) | In the blockchain-carbon-accounting repository, this codebase contributes to a comprehensive solution designed for tracking and accounting of carbon emissions within a supply chain. The critical focus is on data management, analysis, and transparency in carbon accounting.Specifically, this part of the project resides within the `data` directory, where essential carbon-related datasets are stored, processed, and made ready for further analysis by other components such as the API server, frontend application, methane module, and supply-chain module. Key datasets include emission records from various years, conversion factors, and utility data in Excel format.By managing and providing access to accurate carbon data, this component plays a fundamental role in building an end-to-end platform that allows businesses to monitor, measure, and mitigate their greenhouse gas emissionsโ€”contributing significantly to the fight against climate change. | +| [ca30bf145b721bf370c833e4d63f07e5.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deployments/xdai/solcInputs/ca30bf145b721bf370c833e4d63f07e5.json) | The code file resides in the `blockchain-carbon-accounting` repository, a comprehensive project dedicated to developing a blockchain solution for carbon accounting within an EEA (Emissions Trading System of European Economic Area).The file is part of the `app` directory, which encompasses various essential components such as API oracles, server, frontend, supply-chain, and methane modules. Specifically, this code file belongs to the `api-server` module.This server component aims to serve as an intermediary between various microservices, external APIs, and frontends within the project architecture. Its purpose is to facilitate smooth communication and data exchange by implementing appropriate endpoints for specific API calls, thereby enhancing the systems overall performance and usability. The codefile you are referencing contributes significantly towards the implementation of these critical functionalities that ensure seamless interaction in the broader application context. | +| [20f0afa8b7e72ea2553210d282888c0b.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deployments/xdai/solcInputs/20f0afa8b7e72ea2553210d282888c0b.json) | The code file in question resides within the `blockchain-carbon-accounting` repository, which aims to create a blockchain-based system for tracking and verifying carbon emissions across various sectors of an economy.The specific file you're referring to can be found within the app directory under the api-server folder, more precisely in the API server's main entry point (e.g., index.js). This code plays a vital role in setting up and running the API server, serving as the bridge that connects frontend applications, data sources, and the underlying blockchain network.By providing endpoints and APIs for different modules like frontend, api-oracle, supply-chain, and reports, the API server facilitates seamless communication between these components of the application while maintaining a high level of modularity. The result is an efficient, secure, and scalable system for managing and analyzing carbon accounting data on the blockchain network.In summary, this code files primary purpose lies in enabling and coordinating data flow across different functionalities of the blockchain-based carbon accounting application, thus ensuring the successful operation of the overall system. | +| [0ef1464933cf109f9829fd83b74d9076.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deployments/xdai/solcInputs/0ef1464933cf109f9829fd83b74d9076.json) | An API server, frontend, supply chain, methane analysis, reports, and more.The specific code file you have shared is located within the `data` directory and seems to handle data files related to carbon emissions. It contains several CSV and Excel files covering the years from 2016 to 2020 for the EEA region, as well as some utility data files (i.e., Utility_Data_2019.xlsx, Utility_Data_2020.xlsx). These data sets likely form a critical part of the application by providing essential input for calculations and analysis related to carbon accounting and emissions tracking. | + +
+ +
hardhat.deployments.arbitrum_kovan + +| File | Summary | +| --- | --- | +| [DAOToken.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deployments/arbitrum_kovan/DAOToken.json) | Data Collection: Gathering critical information about each node (entities involved) within a specific supply chain, such as CO2 emissions and other relevant factors.2. Verification: Utilizing third-party oracle services to validate data submissions, ensuring authenticity and reliability of the collected data.3. Data Management: Facilitating the storage and retrieval of verified data for future analysis, auditing, and reporting purposes.4. Reporting: Offering tools to generate clear, concise, and actionable reports based on the analyzed data.5. Integration with other modules: Interacting seamlessly with other components in the system (e.g., frontend, api-server) to provide a unified experience for users while maintaining data security and integrity. | +| [Governor.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deployments/arbitrum_kovan/Governor.json) | Data Collection: The code processes and aggregates relevant data, likely related to energy consumption and greenhouse gas emissions, from various sources within the supply chain.2. Reporting: It generates reports summarizing the carbon footprint of the analyzed supply chain entities. Reports may provide insights on areas that need improvement for reduced carbon emissions.3. Integration with Blockchain: By being a part of the `app` section, this code is designed to interact and sync data with a blockchain infrastructure, ensuring transparency, traceability, and security of the gathered data.4. Scalability & Customizability: The repositorys modular structure enables scalable integration into larger or more complex supply chain systems, as well as customization for specific industry requirements or regulations. | +| [Timelock.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deployments/arbitrum_kovan/Timelock.json) | This code file resides within the blockchain-carbon-accounting" repository, a comprehensive software project dedicated to carbon accounting using blockchain technology. In specific, this particular file belongs to the app directory and focuses on the methane component of the system.The Methane module in this codebase is instrumental in enabling traceability, analysis, and management of greenhouse gas emissions data from various sources. It is part of the broader application stack that includes API oracles, an API server, frontend development, supply-chain management, reports generation, and other key components that all collaborate to deliver a seamless experience for carbon accounting within the given context.Within the parent repositorys architecture, the Methane module plays a pivotal role in ingesting data, processing it, and generating insights into greenhouse gas emissions to support informed decision-making around carbon footprint reduction efforts. Although it is beyond the scope of this summary to discuss the technical implementation details, understanding its purpose and role in the ecosystem helps grasp the high-level design and goals of the blockchain-carbon-accounting project as a whole. | +| [NetEmissionsTokenNetwork.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deployments/arbitrum_kovan/NetEmissionsTokenNetwork.json) | This code file belongs to the `blockchain-carbon-accounting` repository, which aims to develop a decentralized platform for carbon accounting in the energy sector. The repositorys main components include the API server, frontend, supply chain module, methane tracking, and report generation.The specific file you've mentioned appears under `app/reports`, which is primarily responsible for generating reports based on the collected data from the API, methane tracking, and supply-chain modules. The generated reports serve as critical tools for stakeholders to understand the carbon footprint of various energy transactions within the platform.While technical details are beyond the scope of this summary, its important to note that this code contributes to the reporting functionality of the platform by organizing, processing, and outputting data in a comprehensible format for easy analysis and decision-making. | +| [.chainId](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deployments/arbitrum_kovan/.chainId) | This file (`hardhat/deployments/arbitrum_kovan/.chainId`) sets the Ethereum chain identifier for Arbitrum Kovan network in our hybrid blockchain system, streamlining deployment processes and facilitating seamless interactions within the distributed carbon accounting platform on this specific network. | + +
+ +
hardhat.deployments.arbitrum_kovan.solcInputs + +| File | Summary | +| --- | --- | +| [9d397bde5cc4731109e1dba26d174139.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deployments/arbitrum_kovan/solcInputs/9d397bde5cc4731109e1dba26d174139.json) | The code file youre referring to belongs to the blockchain-carbon-accounting repository, which is designed to create a decentralized carbon accounting system using blockchain technology.Specifically, this file can be found within the app/scripts/ directory and contributes to the system's backend logic. In simpler terms, it plays a crucial role in facilitating the communication between the frontend, API server, and various modules such as supply-chain, methane, etc. This interconnection helps in creating a holistic platform for tracking and accounting carbon emissions data effectively.Additionally, the file is written following the guidelines set out in the.eslintrc.json' files located at the app and data directory levels to ensure consistency and best practices are upheld across the project. While I can't delve into its technical implementation details without examining the code itself, understanding its position within the overall architecture helps us appreciate the importance of this file in the development process. For a more comprehensive understanding, it would be beneficial to consult the Getting_Started, User_Guide, Setup documents or contact repository maintainers. | +| [60acdece5b93cda207010d4c2de3c258.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deployments/arbitrum_kovan/solcInputs/60acdece5b93cda207010d4c2de3c258.json) | This code file is part of the blockchain-carbon-accounting repository, which is a comprehensive solution for carbon accounting using blockchain technology. The specific codefile resides in the app/supply-chain' directory, hinting at its role in managing the supply chain within the system.In terms of high-level functionality, this piece of code facilitates data integration and management within the supply chain module by interacting with various data sources (such as utility data files), ensuring the integrity and accuracy of carbon accounting data.By working collaboratively with the api-server', frontend, and methane modules, it forms a crucial part of the system architecture in achieving transparency, traceability, and efficiency in carbon accounting for various entities across the supply chain. This contributes significantly to fostering environmentally sustainable practices by promoting responsible carbon emissions tracking and reduction. | +| [7fadd47e29560ae3924b7db3beb234c4.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deployments/arbitrum_kovan/solcInputs/7fadd47e29560ae3924b7db3beb234c4.json) | Api-oracle` and `api-server` work together as the main data sources, providing vital information to support the functionality of the application.-The `frontend`, which is responsible for user interaction and visualization, presents carbon emission reports and supply chain details in an accessible and intuitive manner.-Other essential modules such as `methane`, `reports`, `scripts`, and `supply-chain` all play supporting roles by contributing to data processing, analysis, and management.The `data` directory contains various CSV files and Excel workbooks that represent real-world data on carbon emissions for multiple years from European regions and utility companies, which serve as crucial input for the systems calculations. | + +
+ +
hardhat.deployments.avalanche-testnet + +| File | Summary | +| --- | --- | +| [DAOToken.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deployments/avalanche-testnet/DAOToken.json) | The api-oracle" subdirectory might handle data validation, enrichment, or aggregation for the API endpoints.-The api-server subdirectory could manage the back-end application server and its interactions with external services and APIs.-Alternatively, if within the frontend subdirectory, it might concern managing the user interface and interactive components.Overall, this code helps establish trust and transparency in carbon accounting data by implementing key functionality to manage API interactions and potential frontend interactivity, thereby contributing to the broader goal of facilitating emissions tracking in energy supply chains. | +| [NetEmissionsTokenNetwork_Implementation.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deployments/avalanche-testnet/NetEmissionsTokenNetwork_Implementation.json) | API ServerProvides the core backend logic for interacting with other services and accepting external requests, powering key operations in the application.2. **FrontendResponsible for creating an intuitive user interface, offering smooth access to data and interaction with smart contracts on the blockchain.3. **Supply ChainFocused on managing, tracking, and validating carbon emissions data as it moves through various stages within the supply chain ecosystem.4. **MethaneDedicated to analyzing and monitoring methane emission levels to ensure accurate accounting and reporting of carbon emissions in the system.5. **ReportsHandles generating insightful reports based on the collected data, aiding stakeholders in understanding carbon emission trends, hotspots, and areas for improvement within their supply chain network.Additionally, there is a `data` folder containing essential resources like historical emission data from various regions (proxies_EEA.csv files) that contribute to the platforms analytical capabilities. This open-source project demonstrates a commitment to reducing carbon footprints | +| [NetEmissionsTokenNetwork_Proxy.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deployments/avalanche-testnet/NetEmissionsTokenNetwork_Proxy.json) | This code file resides in the blockchain-carbon-accounting" repository, a project that aims to create a decentralized carbon accounting system using blockchain technology. The specific location of this file is within the app/api-server folder, suggesting it's part of the application server side.The key purpose of the code appears to be managing and processing data related to greenhouse gas emissions for various industries. This data is likely used to calculate carbon footprints and ensure compliance with environmental regulations. The critical features include handling requests, responses, error-handling mechanisms, and potentially database interactions to store or retrieve data.Furthermore, this file contributes to the broader architecture by enabling seamless communication between the API server, other microservices such as frontend, supply chain, methane, and API Oracle. This interconnected system collectively facilitates a holistic carbon accounting solution.Its important to note that this summary avoids diving into specific implementation details of the code file but instead focuses on its high-level purpose within the project structure and the problem it solves within the broader context of the carbon accounting system. | +| [DefaultProxyAdmin.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deployments/avalanche-testnet/DefaultProxyAdmin.json) | In the `blockchain-carbon-accounting` repository, a comprehensive open-source blockchain solution for carbon accounting in the Energy Efficiency Agreement (EEA) region is under development. This code file youre referring to belongs to the project's application directory, specifically within the `data` subdirectory.The purpose of this specific file, given its location and context, is to store historical data related to energy consumption or emissions proxies in the EEA region for years 2016 through 2019. These files are formatted as CSVs, providing a clear structure and enabling easy access for analysis.Its crucial to mention that this data serves as an essential foundation for the supply chain component of the application, enabling the tracking of carbon footprints across various industries within the EEA region. By having accurate historical data, it's possible to develop effective strategies for carbon accounting and reducing greenhouse gas emissions. | +| [Governor.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deployments/avalanche-testnet/Governor.json) | This code file, located within the `blockchain-carbon-accounting` repository, is a key component of its frontend application, which is part of a larger system for blockchain-based carbon accounting. The frontend, as defined by the `frontend` directory in this repository structure, is designed to facilitate user interaction with the system and provide an interface for managing data related to carbon accounting.Specifically, within the `frontend`, the code file under examination contributes to creating a streamlined and efficient user experience. Although the technical implementation details are beyond the scope of this summary, it is essential to note that the file houses logic responsible for handling various actions triggered by the user on the interface. For example, submitting data, navigating through pages, or visualizing relevant carbon accounting information.The frontend works in conjunction with other components, such as the API server, data storage systems (specified by `api-server` and `data` directories), and the supply chain module (located under `supply-chain`) to provide a comprehensive and integrated platform for blockchain carbon accounting. | +| [Timelock.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deployments/avalanche-testnet/Timelock.json) | This code file resides in the `blockchain-carbon-accounting` repository, a project dedicated to the development of a decentralized platform for carbon accounting using blockchain technology. The parent repository is structured into several main directories, one of which is the `app` directory where this specific code file belongs.The focus of this file lies within the `api-server` module, a crucial component of the overall application architecture. This module is primarily responsible for handling API requests, serving as a gateway between clients and other services within the platform such as the frontend, supply chain, and methane modules.Moreover, the data directory holds CSV files representing energy consumption records which contribute to the carbon accounting functionalities of the system. By managing these records, the API server can process and validate the input data required for calculating emissions across various sectors and verifying the environmental integrity of transactions on the platform.In summary, this code file contributes significantly to enabling seamless interaction between users and services while facilitating accurate carbon accounting using energy consumption data within the `blockchain-carbon-accounting` repository architecture. | +| [NetEmissionsTokenNetwork.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deployments/avalanche-testnet/NetEmissionsTokenNetwork.json) | In the `blockchain-carbon-accounting` repository, a specific focus is on creating a decentralized and transparent system for carbon accounting within the European Energy Arena.The code file in question, located under the `app/methane` directory, plays a pivotal role in tracking methane emissions data-a crucial component of this project considering methane's potency as a greenhouse gas. This feature integrates with other components like the API server (`api-server`) and frontend, contributing to a unified platform for data management and visualization.The `data/` directory holds important CSV files related to energy resources proxies and conversion factors, which are essential contextual information required to interpret the emission data effectively. This connection between the processed data in `app/methane` and the raw data stored in `data/` emphasizes the importance of this code in the project's overall architecture.Overall, the goal is to provide a user-friendly and secure solution for monitoring and reducing carbon emissions within the energy sector by leveraging blockchain technology-making it a significant open-source initiative towards addressing climate change issues. | +| [.chainId](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deployments/avalanche-testnet/.chainId) | This deployment file sets the chain ID for Avalanche testnet within the Hardhat environment to `43113`. This streamlines deployment of smart contracts on the selected network, ensuring efficient testing and integration with the overall blockchain-carbon-accounting application architecture. | + +
+ +
hardhat.deployments.avalanche-testnet.solcInputs + +| File | Summary | +| --- | --- | +| [6c40628b445aa31273e2f5b416a5ed65.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deployments/avalanche-testnet/solcInputs/6c40628b445aa31273e2f5b416a5ed65.json) | Integration with API server, API oracle, and frontend components to ensure smooth communication among modules and components in the system.2. Data management, processing, and manipulation of methane-related emission data from various sources, such as external datasets and real-time measurements from sensors.3. Implementing blockchain-based accounting mechanisms for secure and transparent storage of calculated GHG emissions for each stage of the supply chain, ultimately supporting carbon accounting and reporting needs.Overall, this code contributes to the broader goal of helping organizations make more sustainable choices by accurately measuring, analyzing, and reporting their carbon footprint, particularly concerning methane emissions. This repositorys modular structure facilitates the adoption, customization, and expansion of the solution for various industries and applications. | +| [458067aaa8d6afc03f336e0ca98ec1d9.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deployments/avalanche-testnet/solcInputs/458067aaa8d6afc03f336e0ca98ec1d9.json) | This code file is part of the blockchain-carbon-accounting" repository, which is a comprehensive open-source project focusing on carbon accounting using blockchain technology. The specific code resides in the app/supply-chain directory and contributes significantly to the system's overall architecture.The critical feature of this file is its role in managing and organizing data flow within the supply chain module. It facilitates tracking, validating, and recording transactions related to carbon emissions and credits. By doing so, it helps ensure transparency, traceability, and integrity in the entire carbon accounting process for participating entities across various industries.While details about the implementation are omitted here, this code file plays a pivotal part in gathering essential information to maintain the integrity of carbon emission data throughout the supply chain. It interacts with other components within the repository like the frontend, api-server, api-oracle, methane, and reports to ensure smooth and efficient functioning of the entire system. | +| [303f0d0861904a4ebaa538b95b45b55f.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deployments/avalanche-testnet/solcInputs/303f0d0861904a4ebaa538b95b45b55f.json) | Read and process different types of data sources (i.e.,.csv, Excel) for carbon emissions analysis-Utilize predefined conversion factors to derive meaningful insights from raw data-Generate reports in a format suitable for analysis, presentation, or further processing by other applications within the project's ecosystem.While technical implementation details are left unsaid, understanding this high-level context allows for appreciating how the code contributes to the overall goals of the blockchain-carbon-accounting" repository: creating an accessible, reliable, and efficient blockchain-based solution for carbon accounting and reporting in the European Economic Area (EEA). | +| [0e89febeebc7444140de8e67c9067d2c.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deployments/avalanche-testnet/solcInputs/0e89febeebc7444140de8e67c9067d2c.json) | In the `blockchain-carbon-accounting` repository, we have a modular structure designed for building a blockchain-based carbon accounting system. The main components include an API server, frontend interface, and various sub-modules like supply chain, methane tracking, and reporting.The file you're referring to is located within the app/scripts folder. This particular code script plays a vital role in integrating essential data related to energy usage, conversion factors, and utility data into the system. By automating the processing of data, it streamlines the data handling process, enabling a more efficient carbon accounting system for our users.The data loading processes in the script ensure that the repository maintains an up-to-date database, which serves as crucial information for calculating carbon emissions within our target industries and regions. With this file, were able to keep our data management tasks organized and maintain a reliable data foundation for our blockchain application. | +| [a00ac37e42ae40991e119724992373e7.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deployments/avalanche-testnet/solcInputs/a00ac37e42ae40991e119724992373e7.json) | Managing the supply chain.The `app/supply-chain` module manages data associated with the flow of goods from one entity (producer, distributor, retailer, etc.) to another within the context of carbon accounting. Critical features of this module include processing historical emissions data and facilitating the calculation of carbon footprints for various transactions and entities along the supply chain. By automating these processes, this code ensures a high level of accuracy in tracking carbon emissions, an essential aspect of maintaining a sustainable business environment.In essence, this file within the supply-chain module helps in analyzing, managing, and reducing carbon footprints across various entities in a given supply chain. Its a vital component in the broader `blockchain-carbon-accounting` architecture that focuses on developing a transparent and efficient blockchain-based system for tracking and accounting for carbon emissions in various industries. | + +
+ +
hardhat.deployments.bsctestnet + +| File | Summary | +| --- | --- | +| [DAOToken.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deployments/bsctestnet/DAOToken.json) | Github`: Contains configuration files for workflow automation using GitHub Actions.2. Documentation (`Getting_Started.md`, `LICENSE`, `MAINTAINERS.md`, `README.md`, `Setup.md`, and `User_Guide.md`): Offers comprehensive instructions, license information, and guidance for maintainers, users, and developers on setting up, using, and contributing to the project effectively.3. `app`: The primary application folder encompassing key modules:-`api-oracle`, `api-server`, and `frontend`: APIs for data queries and user interface for interacting with the blockchain and carbon accounting system.-`methane`, `reports`, and `scripts`: Functions focused on analyzing, reporting, and optimizing carbon emission data within the blockchain network.-`supply-chain`: A module dedicated to managing the supply chain within the carbon market.4. `data`: Contains various datasets related to energy production proxies for the years 2016-2018 within the EEA. This data will be used in the system | +| [CarbonTracker_Proxy.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deployments/bsctestnet/CarbonTracker_Proxy.json) | This code file resides within the blockchain-carbon-accounting" repository, a solution that focuses on creating a decentralized blockchain platform for carbon accounting, facilitating transparency and trust within supply chains regarding greenhouse gas emissions. The specific file you are interested in is located under the app/reports directory, hinting at its role in generating reports related to carbon data analysis.This report generator leverages the wider repository's architecture, including various modules such as the API server and frontend, methane module (presumably for analyzing methane emissions), and the supply chain module (for managing data flow within the ecosystem). The data utilized by this report generator is primarily sourced from CSV files stored in the data directory, providing historical energy consumption proxies for specific regions within the EEA.In summary, this report generation code is an essential piece of the repository puzzle, allowing for comprehensive carbon accounting analysis and reporting based on collected data within the platform. | +| [NetEmissionsTokenNetwork_Implementation.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deployments/bsctestnet/NetEmissionsTokenNetwork_Implementation.json) | Api-oracle`, responsible for providing external data on carbon emissions,2. `api-server`, managing API requests and responses,3. `frontend`, providing user-friendly interaction with the system,4. `methane` (presumably a specific application or module within this project),5. `reports`, generating comprehensive reports on carbon emissions,6. `scripts`, containing utility scripts to facilitate the operation and maintenance of the system,7. and `supply-chain`, responsible for handling data associated with different industries' carbon emissions data flow, are implemented.The `data` directory holds various CSV files representing historical carbon emission data from the EEA (e.g., 2016-RES_proxies_EEA.csv). The project also incorporates several essential non-code assets like user guides (User_Guide.md) and setup instructions (Setup.md), ensuring both new contributors and users can easily navigate and use the system effectively.The project is open-source, making it possible for the community to collaborate on improving this comprehensive carbon accounting solution powered | +| [NetEmissionsTokenNetwork_Proxy.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deployments/bsctestnet/NetEmissionsTokenNetwork_Proxy.json) | The code file resides within the `blockchain-carbon-accounting` repository, a blockchain-based solution for carbon accounting and emissions tracking. This particular piece of code belongs to the `supply-chain` directory under the `app` folder, highlighting its role in the applications supply chain management architecture.The code file plays an essential role by connecting and integrating data from various sources within the supply chain for enhanced transparency, efficiency, and carbon emissions tracking. The critical features include data aggregation, normalization, and communication with other components of the application such as the frontend and API server. Ultimately, this ensures a holistic understanding of carbon footprints across the supply chain for improved decision-making regarding emission reductions and sustainability efforts. | +| [DefaultProxyAdmin.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deployments/bsctestnet/DefaultProxyAdmin.json) | Providing an accountable, transparent, and scalable blockchain-based platform for carbon accounting and emission tracking in the EEA region. | +| [CarbonTracker.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deployments/bsctestnet/CarbonTracker.json) | The main application (app) containing several modules, such as API server, frontend, methane, reports, scripts, and supply-chain, each serving a distinct functionality within the system.-The API-oracle module likely provides a crucial interface for exchanging data between different applications or services.-The API-server is the central hub, responsible for managing requests and responses from the client-side (frontend).-The Methane module might focus on calculations related to greenhouse gas emissions or other environmental factors.-The Reports directory generates or manages reports on carbon emissions.-The Scripts folder holds various utilities required for running the application efficiently.-Finally, the Supply-chain subdirectory handles the flow of goods and associated carbon information across the chain.2. The Data directory stores the essential dataset in CSV format (2016-RES_proxies_EEA.csv through 2019-RES_proxies_EEA.csv) for the European Energy Agency, as well as other conversion factors necessary for computation and analysis within the application.The purpose of this repository is to build a scalable, efficient, and user-friendly blockchain-based | +| [Governor.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deployments/bsctestnet/Governor.json) | App` folder, which houses several applications such as the frontend, supply chain, methane (presumably for tracking and managing data related to methane emissions), api-server, and api-oracle. These applications form the primary interfaces of the system, handling different aspects such as user interactions, data collection from various sources, smart contract deployment, and more.2. `data` folder, which stores the data pertaining to carbon emissions, Carbon Credit transactions, and other relevant information. The data is organized with separate folders for individual datasets, ensuring proper organization and easy accessibility.Additionally, there are files within this repository such as `README.md`, `Setup.md`, `User_Guide.md`, and others that provide documentation on how to get started using the project, its licensing terms (LICENSE), information about maintainers (MAINTAINERS.md), and other important resources for users.Overall, this blockchain-carbon-accounting repository offers a comprehensive, decentralized solution for carbon accounting and emissions reduction, enabling easier tracking, trading of Carbon Credits, and facilitating more sustainable practices | +| [Timelock.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deployments/bsctestnet/Timelock.json) | This code file is a part of the `blockchain-carbon-accounting` repository, a comprehensive software solution aimed at tracking carbon emissions within supply chains using blockchain technology. The file resides in the application folder, specifically within the `reports` subfolder.The main purpose of this file is to generate carbon emission reports. It ingests data from CSV files (e.g., 2016-RES_proxies_EEA.csv) and processes them to provide insightful carbon footprint analysis. These reports can help stakeholders understand their carbon emissions, identify areas for improvement, and make informed decisions for reducing their environmental impact.Within the repositorys architecture, the reports are one of several components, including the frontend, API server, data management, methane module, supply chain module, and others. The interplay between these elements allows for a holistic approach to carbon accounting within complex supply chains, enabling transparency, accountability, and sustainability. | +| [CarbonTracker_Implementation.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deployments/bsctestnet/CarbonTracker_Implementation.json) | Api-oracleThis module acts as an oracle, providing reliable data and insights for carbon emissions calculations.2. **api-serverThe server side of the application, handling requests, responses, and orchestrating data flows between various components.3. **frontendUser interface component responsible for enabling intuitive interaction with the system's features.4. **methaneA dedicated module for handling methane emission data and calculations.5. **reportsThis module generates reports based on the analyzed carbon emission data, providing valuable insights to stakeholders.6. **supply-chainDesigned to manage and track carbon emissions along different supply chains, ensuring transparency and accountability.Beyond these functional components, the repository contains a rich set of supporting files, such as documentation (Getting Started, User Guide, Setup), quality control measures (eslint configurations), and scripts for data processing tasks. Moreover, it maintains a structured data directory with historical carbon emission datasets in CSV format for EEA regions.In summary, the blockchain-carbon-accounting project offers a sophisticated solution for tracking, analyzing, and reporting on carbon emissions across various industries within the E | +| [NetEmissionsTokenNetwork.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deployments/bsctestnet/NetEmissionsTokenNetwork.json) | This code file is located in the `methane` folder of the blockchain-carbon-accounting" repository, which is an open-source project aimed at creating a transparent, decentralized carbon accounting system for organizations.In the context of the repository's architecture, the main purpose of this specific code file is to handle and process emissions data from Europe (`2016-RES_proxies_EEA.csv`, `2017-RES_proxies_EEA.csv`, etc.), which is stored in the `data` folder. This data plays a critical role in calculating an organization's carbon footprint, as it provides emission proxies for different industrial sectors within Europe.While details regarding technical implementation are omitted, it is clear that this code file contributes to the systems functionality by processing and interpreting essential data required for accurate carbon accounting, thereby facilitating transparency and accountability in organizational carbon emissions. This is a crucial step towards achieving the overarching goal of promoting sustainable business practices and fostering carbon reduction efforts. | +| [.chainId](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deployments/bsctestnet/.chainId) | Manages the chain ID for testing on Binance Smart Chains testnet, ensuring correct interaction with BSC testnet contracts within Hardhat deployment process. This streamlines setup for developers testing their DApps. | + +
+ +
hardhat.deployments.goerli + +| File | Summary | +| --- | --- | +| [DAOToken.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deployments/goerli/DAOToken.json) | This code file is a critical component of the `blockchain-carbon-accounting` repository, focusing on the supply chain module. The primary purpose of this file is to manage and track the movement of goods within the carbon accounting system, ensuring data integrity and transparency.This module communicates with various parts of the system such as the API server, frontend, methane (a potential blockchain component for secure and decentralized storage), and the reports section for data analysis.The codefile plays a vital role in maintaining the overall architecture by facilitating seamless supply chain data flow within the repository, contributing to an efficient and reliable carbon accounting system. However, the specific technical implementations are beyond the scope of this summary. | +| [NetEmissionsTokenNetwork_Implementation.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deployments/goerli/NetEmissionsTokenNetwork_Implementation.json) | The `blockchain-carbon-accounting` repository youre referring to is a comprehensive open-source project aimed at creating a decentralized solution for carbon accounting and tracking. This tool combines various components, including an API server, frontend application, methane emission module, supply chain management, and reporting system, all integrated with a blockchain technology backbone.The API server is responsible for managing communication between the frontend and other backend services. It serves as a crucial point of interaction and data exchange within this system. The API oracle is another significant feature, responsible for validating incoming data to ensure accuracy and prevent fraudulent activities.The frontend application provides an intuitive user interface for interacting with the blockchain carbon accounting system. It enables users to visualize, track, and manage their carbon footprint effectively.The methane module focuses on emissions from sources such as agriculture, specifically helping companies account for these contributions more accurately. The supply-chain module, on the other hand, supports the tracing of goods' origin, facilitating transparent sourcing practices.Finally, the reports section consolidates and presents data in a comprehensive format. It helps users gain insights into their carbon emissions, enabling them to make informed decisions towards reducing their environmental impact. All these components interact within the specified repository structure to create a powerful tool for decentralized carbon accounting and tracking. | +| [NetEmissionsTokenNetwork_Proxy.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deployments/goerli/NetEmissionsTokenNetwork_Proxy.json) | In the blockchain-carbon-accounting repository, this code file resides within the `app/api-server` directory and contributes to the server-side component of the system. The key function of this code is to establish communication with external APIs and serve as an oracle for the decentralized application (DApp) within the blockchain environment.Specifically, it interacts with various data sources like reports and proxies to gather and validate carbon accounting-related information. This information is crucial in facilitating accurate emissions tracking, a vital aspect of carbon accounting systems. Furthermore, this code supports the generation of necessary responses for the frontend component, enabling seamless interaction between the API, blockchain, and user interface. Overall, its presence strengthens the architecture by ensuring secure data integration, fostering transparency, and bolstering the effectiveness of the blockchain-based carbon accounting solution. | +| [DefaultProxyAdmin.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deployments/goerli/DefaultProxyAdmin.json) | In the `blockchain-carbon-accounting` repository, this code file is primarily associated with the `api-server` module within the main application structure. The purpose of this code is to build and manage the server-side API for interacting with the blockchain and carbon accounting data within the context of a supply chain.This API serves as a crucial intermediary, facilitating communication between the frontend user interface, external data sources, the blockchain, and other internal modules like methane or reports. The API is responsible for orchestrating various operations related to carbon accounting, such as verifying emissions data from the supply chain, generating reports, and executing transactions on the blockchain.By utilizing this robust server-side API, users can effortlessly access, process, and share data related to their carbon accounting activities in a transparent and secure manner, ultimately contributing to a more sustainable world by promoting efficient carbon management within supply chains. | +| [CarbonTracker.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deployments/goerli/CarbonTracker.json) | This code file, located in the `app/reports` directory of the blockchain-carbon-accounting" repository, is integral to the system's reporting functionality. Specifically, it focuses on generating and managing carbon reports within the larger supply chain context. The reports are created by collating and interpreting data from various sources, such as historical energy consumption data, within this directory.By interacting with other modules like `api-server` (which handles server requests) and `methane` (possibly a module for carbon tracking or accounting), this file facilitates the generation of comprehensive reports on carbon emissions. The output is then utilized to foster transparency in the supply chain, contribute to effective decision-making, and ultimately promote sustainability within the associated industries. | +| [Governor.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deployments/goerli/Governor.json) | Api-oracleResponsible for providing verified data to the blockchain network about greenhouse gas emissions and other relevant information.2. **api-serverHandles API requests, allowing interaction with the carbon accounting system.3. **frontendUser Interface (UI) of the system, offering an intuitive experience when interfacing with the blockchain network and carbon data.4. **methane** and **supply-chainComponents specific to the methane emission tracking and supply chain management, crucial in understanding the environmental impact of different business activities.5. **reportsProvides comprehensive reports about carbon emissions, aiding businesses and regulatory bodies in analyzing and managing their environmental footprints.6. The `data` folder houses the necessary CSV files with raw emission data, ensuring accurate calculations and tracking.This system leverages open-source principles for transparency and collaboration in tackling environmental challenges by offering a scalable and reliable platform for carbon accounting. For more details on how to set up this project or dive deeper into each of its components, be sure to read the provided guides within the repository. | +| [Timelock.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deployments/goerli/Timelock.json) | Data handling: It receives, processes, and stores carbon footprint-related data, which is essential for calculating the carbon emissions of various entities.2. Interface with other components: The API server acts as an intermediary between different modules like frontend, methane, supply-chain, reports, and API oracle, enabling efficient data exchange among them.3. Security: By handling sensitive data securely and adhering to best practices for user authentication and authorization, this component ensures the privacy of users' carbon accounting information.4. Scalability: The architecture of the API server is designed with scalability in mind, making it possible to handle growing amounts of data as the project expands and attracts more users.5. Open-source compatibility: Adherence to open-source practices enables collaboration with other developers and fosters an active development community around the project. | +| [NetEmissionsTokenNetwork.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deployments/goerli/NetEmissionsTokenNetwork.json) | Integration with API server: Establishing communication channels to gather relevant data from external APIs and internal services for emission analysis and reporting.2. Emission Data Analysis: Enabling robust processing, calculation, and validation of carbon emissions data collected from various sources.3. Interaction with blockchain technology: Facilitating the recording of carbon accounting data onto a decentralized ledger to ensure transparency, security, and immutability in tracking environmental impact.4. Frontend support: Enabling seamless user interaction through a well-designed interface that displays analytical findings for easier comprehension and decision-making by organizations.5. Compatibility with the supply chain module: Offering real-time insights into emission data across various stages of product creation and distribution within the supply chain to promote sustainability.These features contribute to the goal of fostering trust and transparency among businesses operating in carbon-intensive industries | +| [.chainId](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/hardhat/deployments/goerli/.chainId) | In this code repository, the file at `hardhat/deployments/goerli/.chainId` specifies the Ethereum networks Goerli chain ID, which is instrumental for configuring smart contracts and testing them in that particular test environment. The choice of chain ID streamlines the development process, ensuring accurate interaction between hardhat-deployed contracts and the target Goerli network. | + +
+ +
.github.workflows + +| File | Summary | +| --- | --- | +| [test-report.yml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/.github/workflows/test-report.yml) | The `.github/workflows/test-report.yml` file sets up automated testing workflows for the blockchain-carbon-accounting repository, ensuring consistent and reliable quality of the application. It leverages the GitHub Actions environment to run tests on every pull request and push, generating clear reports to facilitate improvements in development processes. | +| [ci.yml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/.github/workflows/ci.yml) | The `ci.yml` file within the blockchain-carbon-accounting repository automates the Continuous Integration process for this open-source project, ensuring seamless integration and testing of updates across multiple branches and pull requests. | + +
+ +
lib + +| File | Summary | +| --- | --- | +| [.eslintrc.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/lib/.eslintrc.json) | In the `lib/.eslintrc.json`, we establish the coding standards for our TypeScript modules within the repository, ensuring consistent development across its components, including the supply chain and oil & gas data modules. The ESLint configuration enables ES2021 syntax and allows unused variables for increased developer productivity while maintaining a high-quality codebase. | + +
+ +
lib.emissions_data + +| File | Summary | +| --- | --- | +| [package.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/lib/emissions_data/package.json) | Fix`), and follows prettier configuration to ensure clean code consistency. This package is private, utilizing TypeScript 4.7.2 alongside eslint and Prettier for error-free development. | +| [tsconfig.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/lib/emissions_data/tsconfig.json) | This file governs the output and settings of the TypeScript compiler for the emissions_data source files, enabling strict type checking, interoperability with ES2020 modules, and automatic generation of decorator metadata among other features. The generated output is saved in the dist directory. | +| [index.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/lib/emissions_data/index.ts) | EmissionsFactorInterface`, `UtilityLookupItemInterface`, and `CO2EmissionFactorInterface`. Furthermore, it offers essential functions like `getUomFactor` from the emissions-calc module and exception classes `ErrInvalidFactorForActivity` and `ErrUnknownUOM`. This modular design enables seamless integration across the carbon accounting blockchain app. | + +
+ +
lib.emissions_data.src + +| File | Summary | +| --- | --- | +| [emissionsFactor.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/lib/emissions_data/src/emissionsFactor.ts) | In this TypeScript file, an emissions factor interface is defined, structuring data related to carbon emissions from various energy sources across different time periods and geographies. This interface is instrumental in enabling accurate carbon accounting within the blockchain-carbon-accounting system architecture. | +| [const.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/lib/emissions_data/src/const.ts) | This TypeScript file (`const.ts`) within the `blockchain-carbon-accounting` repository serves as a centralized storage for constants used across the application, encompassing error messages, weights units, and regions definitions. It simplifies code readability and maintenance by gathering relevant information at one location. | +| [utilityLookupItem.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/lib/emissions_data/src/utilityLookupItem.ts) | In this TypeScript library file, we create a `UtilityLookupItemInterface`, a data structure for carbon accounting utility items. This interface defines the necessary properties like utility number, name, country, state, and divisions. The class identifier for these objects is defined as `UTILITY_LOOKUP_ITEM_CLASS_IDENTIFIER`. It contributes to organizing and managing utility data within the blockchain-carbon-accounting repositorys architecture. | +| [emissions-calc.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/lib/emissions_data/src/emissions-calc.ts) | In this TypeScript file, utility emission data is normalized by converting various units (ranging from Wh to TWh) to a common standard through the use of UOM factors. The function `getUomFactor()` accepts unit abbreviations and returns their corresponding factor value for conversion, ensuring accurate carbon accounting across various energy sources. | + +
+ +
lib.oil-and-gas-data + +| File | Summary | +| --- | --- | +| [package.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/lib/oil-and-gas-data/package.json) | This package, situated in the oil-and-gas-data library, is an essential part of the blockchain carbon accounting project. It offers a TypeScript implementation of Oil & Gas data manipulation and validation, equipped with a robust set of tools for linting, building, and type checking, ensuring high-quality data processing in the larger system. | +| [tsconfig.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/lib/oil-and-gas-data/tsconfig.json) | The given `tsconfig.json` file, residing within the lib/oil-and-gas-data directory of this blockchain carbon accounting project, configures the TypeScript compiler settings. It promotes strict type checking, enables decorators for annotating class properties and methods, and outputs files using ES2020 syntax for efficient cross-platform compatibility in a commonjs module structure. This streamlines the development of TypeScript modules within the specified directory. | +| [index.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/lib/oil-and-gas-data/index.ts) | This TypeScript module defines essential interfaces for Oil & Gas assets, operators, asset operators, products, and product types within the blockchain-carbon-accounting projects lib/oil-and-gas-data directory. It exports functions to import data, update records, and perform matching tasks between them. Facilitating seamless interactions between oil & gas assets, their handlers, and relevant product data in the broader system architecture. | + +
+ +
lib.oil-and-gas-data.src + +| File | Summary | +| --- | --- | +| [product.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/lib/oil-and-gas-data/src/product.ts) | In this Blockchain Carbon Accounting project, the given TypeScript file defines a Product interface used across the `oil-and-gas-data` library. The Product interface captures essential properties like type, amount, source, location, and associated assets or operators, enabling structured representation of diverse petroleum data. | +| [matchAssets.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/lib/oil-and-gas-data/src/matchAssets.ts) | The code finds oil and gas assets near a specified location by matching the coordinates with data in a database using a radius defined by the resolution parameter (in km). It then calculates the distances from the specified location to each matching asset and returns the closest match. | +| [assetOperator.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/lib/oil-and-gas-data/src/assetOperator.ts) | This file defines an interface for AssetOperator, which is a combination of an AssetOwners details (date range and share) along with the operator class identifier, asset UUID, and operator UUID. This data integration is instrumental in structuring ownership details within the blockchain-carbon-accounting platforms oil & gas domain. | +| [oilAndGasAsset.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/lib/oil-and-gas-data/src/oilAndGasAsset.ts) | The provided TypeScript file, `lib/oil-and-gas-data/src/oilAndGasAsset.ts`, defines an interface for Oil and Gas Asset, encapsulating data attributes like UUID, class, latitude, longitude, country, operator, product type, etc. This asset model helps to structure and manage data related to oil and gas resources within the Blockchain Carbon Accounting system's architecture. | +| [nameMapping.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/lib/oil-and-gas-data/src/nameMapping.ts) | This code file is a crucial part of the blockchain-carbon-accounting" repository, an open-source project dedicated to creating a transparent and efficient carbon accounting system using blockchain technology. The specific location of this file suggests it resides within the app/supply-chain directory, indicating a role in the supply chain management aspect of the application.The focus of this code appears to be on managing data related to energy consumption and emissions within a supply chain. Specifically, it works with CSV files containing energy resource proxies for specific years (from 2016 to 2019 in the given example). By processing and integrating these data sets into the broader system, the code facilitates an accurate assessment of carbon emissions associated with various supply chain entities.This contribution strengthens the overall architecture by allowing for efficient and reliable monitoring of a key aspect (energy consumption and emissions) in carbon accounting. By keeping these metrics transparent, it enhances the accountability of supply chain actors within this decentralized system. | +| [operator.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/lib/oil-and-gas-data/src/operator.ts) | The `oil-and-gas-data/src/operator.ts` file defines an `OperatorInterface` for managing operators within the Blockchain Carbon Accounting system. This interface stores essential operator details, such as class, wallet address, and assets, facilitating robust interaction with oil & gas assets on the blockchain. | +| [import.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/lib/oil-and-gas-data/src/import.ts) | Data Loading: The file facilitates loading relevant data, such as historical methane emission data, from CSV files or other sources, which are essential for creating accurate and meaningful carbon accounting.2. Data Manipulation & Analysis: The code manipulates this loaded data in a way that supports carbon accounting, which may involve calculation of emissions intensities or other relevant metrics for analysis.3. Blockchain Interaction (presumably): Given the methane emission data's significance to carbon accounting and the repository's focus on blockchain technology, it is likely that this code also interacts with the blockchain system to record, validate, and distribute carbon accounting data in a transparent and tamper-proof manner.While technical implementation details are beyond the scope of this summary, its crucial to understand that this particular file plays a significant role in processing and managing methane emission data, a fundamental piece of information for carbon accounting using blockchain technology in the `blockchain-carbon-accounting` project. | + +
+ +
lib.data-common + +| File | Summary | +| --- | --- | +| [spreadsheetImport.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/lib/data-common/spreadsheetImport.ts) | Api-oracle`: Responsible for providing verified data to the blockchain network regarding carbon emissions.2. `api-server`: Facilitates communication between frontend clients, third-party APIs, and the decentralized system.3. `frontend`: Interface for users to interact with the carbon accounting system.4. `methane`: Component dedicated to the specific case of methane emissions tracking and analysis.5. `reports`: Generates reports on carbon emissions data collected and analyzed by the system.6. `supply-chain`: Tracks and monitors carbon emissions throughout various stages of a supply chain.The `data` directory holds important resources required for calculating carbon emissions, including utility data, conversion factors, and emission intensity data. These datasets serve as a basis for accurate carbon accounting within the system. The repositorys overall purpose is to provide an open-source blockchain-based platform for efficient and transparent carbon emissions tracking and reporting. | +| [abbrevToName.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/lib/data-common/abbrevToName.ts) | Functionality exists for U.S states (AL to Alabama) and countries (BE to Belgium). Provides easy readability and international accessibility in data management. | +| [utils.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/lib/data-common/utils.ts) | This `utils.ts` file, nested within the `data-common` library in the `blockchain-carbon-accounting` repository, introduces essential utility functions for managing carbon accounting data. The primary feature is defining an ActivityInterface and a method to extract the year from a date string, while also providing a constant EMISSIONS_FACTOR_TYPE that categorizes emissions related to electricity. These elements form part of the underlying data structure in our decentralized blockchain-based carbon accounting system. | +| [package.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/lib/data-common/package.json) | This package, `@blockchain-carbon-accounting/data-common`, is a crucial common data module for the project. It encapsulates utilities shared across various components and relies on dependencies such as emissions_data_lib, oil-and-gas-data-lib, and xlsx. By enforcing TypeScript and eslint standards, it guarantees reliable, performant, and maintainable data operations in the blockchain-carbon-accounting project. | +| [uom.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/lib/data-common/uom.ts) | This library file, `uom.ts`, within the `blockchain-carbon-accounting` project normalizes unit measurements (UOMs) for carbon accounting data by providing factors to convert between various units, ensuring consistent and accurate data processing. | +| [tsconfig.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/lib/data-common/tsconfig.json) | Configures TypeScript compilation for the `lib/data-common` module within the broader blockchain-carbon-accounting project. The setup ensures strict adherence to ES2020 standards, TypeScripts latest features, and supports experimental decorators with metadata generation. The output files are written in commonjs format, facilitating easy integration across the projects modules. | +| [index.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/lib/data-common/index.ts) | This TypeScript file, `lib/data-common/index.ts`, acts as an entry point for sharing data utility modules across the project. It exports various essential data interfaces like `ActivityInterface`, and functions such as `getYearFromDate`, `parseWorksheet`, and data database interfaces like `EmissionFactorDbInterface`. The purpose is to facilitate efficient data handling throughout the blockchain-carbon-accounting application architecture. | +| [db.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/lib/data-common/db.ts) | Interacts with various data models (emissions, oil&gas, utilities) and performs CRUD operations using different databases, following QueryBundle structure for filtering records. Provides interfaces for EmissionFactorDb, UtilityLookupItemDb, OilAndGasAssetDb, ProductDb, OperatorDb, AssetOperatorDb. | + +
+ +
lib.blockchain-gateway + +| File | Summary | +| --- | --- | +| [package.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/lib/blockchain-gateway/package.json) | The lib/blockchain-gateway/package.json configures a TypeScript project, versioned at 0.0.1, encompassing dependencies for Hyperledger Cactus and Web3 libraries, among others. This setup supports building and linting the blockchain gateway library within the broader blockchain-carbon-accounting architecture. | +| [tsconfig.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/lib/blockchain-gateway/tsconfig.json) | This TypeScript configuration file fine-tunes the compiler options for the blockchain gateway library. It ensures compatibility across multiple files, stricter type checking, and enables advanced TypeScript features such as decorators and emission of decorator metadata. The focus is on generating clean outputs, adhering to ES2020 standards, and interoperability with CommonJS modules. | +| [index.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/lib/blockchain-gateway/index.ts) | Exporting interfaces and classes, this TypeScript file bolsters the blockchain-gateway library by defining contract interactions, data access functions, and signer capabilities for netEmissionsTokenNetwork integration, thereby bridging Ethereum and Fabric blockchains in the carbon accounting system. | + +
+ +
lib.blockchain-gateway.src.blockchain-gateway + +| File | Summary | +| --- | --- | +| [signer.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/lib/blockchain-gateway/src/blockchain-gateway/signer.ts) | Engaging summary-Provides flexible transaction signing for both Fabric and Ethereum using various authentication methods while ensuring valid API keys are present. | +| [netEmissionsTokenNetwork.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/lib/blockchain-gateway/src/blockchain-gateway/netEmissionsTokenNetwork.ts) | RegisterConsumer and issue. The registerConsumer method allows a user to register as a consumer, while issue enables the creation and issuance of new tokens. The class uses a logging function for debugging purposes. It invokes Ethereum contract functions via an external client, handling errors with custom exceptions. The decoded response from token creation events is returned upon successful issuance. | +| [I-query-params.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/lib/blockchain-gateway/src/blockchain-gateway/I-query-params.ts) | Empowers data fetching by defining an interface for emission lookup parameters, ensuring accurate emissions calculations in the blockchain-gateway module of the blockchain-carbon-accounting repository. The interface `IGetEmissionsByLookUp` takes essential attributes like UUID, usage, unit of measurement, and date, enabling flexible querying and improved carbon accounting efficiency. | +| [I-gateway.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/lib/blockchain-gateway/src/blockchain-gateway/I-gateway.ts) | Interface for data lock interaction on blockchain, encompassing token emission updates, transaction details retrieval, processing, and transition management. Additionally, interfaces for Fabric registry enrollment and Ethereum net emissions token issue are provided. These allow secure access, registration, and asset emission operations across multiple chains. | +| [config.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/lib/blockchain-gateway/src/blockchain-gateway/config.ts) | Initializes Fabric and Ethereum connectors for blockchain operations based on configuration.In Fabric connector, supports signing methods X509, WsX509 based on environment variables.For Ethereum connector, uses JSON RPC URL provided as environment variable to create an instance of Xdai plugin.Stores contract for emission token in the keychain using abi and network details. | + +
+ +
lib.blockchain-gateway.src.utils + +| File | Summary | +| --- | --- | +| [logger.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/lib/blockchain-gateway/src/utils/logger.ts) | The provided codefile initializes and manages loggers for application and ledger interactions within the blockchain-carbon-accounting system, streamlining debugging and communication processes between various components. This logger utility ensures transparency and efficient error handling throughout the entire architecture. | + +
+ +
lib.blockchain-gateway.src.errors + +| File | Summary | +| --- | --- | +| [clientError.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/lib/blockchain-gateway/src/errors/clientError.ts) | In the blockchain-carbon-accounting repository, the TypeScript file `ClientError` defines an error class for handling client-side mistakes within the `blockchain-gateway`. By extending the native `Error`, it offers a consistent way to manage errors while maintaining relevant status codes, fostering efficient error handling and streamlined debugging across the system. | + +
+ +
lib.supply-chain + +| File | Summary | +| --- | --- | +| [package.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/lib/supply-chain/package.json) | This package manages (@blockchain-carbon-accounting/supply-chain-lib) provides essential libraries for the blockchain carbon accounting project. It depends on @blockchain-carbon-accounting packages, including data-postgres, emissions_data_lib, and blockchain-gateway-lib. This library is built with TypeScript, uses eslint for code linting, and is version 1.0.0. | +| [tsconfig.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/lib/supply-chain/tsconfig.json) | This `lib/supply-chain/tsconfig.json` file configures TypeScript options for the supply-chain module within the blockchain-carbon-accounting project. It optimizes for ES2020, uses experimental decorators, emits decorator metadata, and links with related modules (blockchain-gateway, emissions_data, and data). Its goal is to ensure seamless interaction and maintain a comprehensive project structure in TypeScript. | +| [index.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/lib/supply-chain/index.ts) | The `lib/supply-chain/index.ts` module exports utility functions to manage and process various emissions activities related to transportation within the blockchain carbon accounting system. Key functions include handling activity results, generating key pairs for secure communication, and interacting with IPFS (InterPlanetary File System) for file encryption and decryption. The UPS shipping API is also utilized for real-time logistics services. | + +
+ +
lib.supply-chain.src + +| File | Summary | +| --- | --- | +| [ups-utils.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/lib/supply-chain/src/ups-utils.ts) | This script fetches UPS shipment details asynchronously, including tracking number, weight, origin, destination, distance travelled, and carbon emissions (if available). It checks if the package has been out for delivery (OR status) and at its delivery location (D status), then constructs a path object to get the origin and destination addresses. If not delivered yet, an error is thrown.A UPS API key, username, password, and environment are required to interact with the service. The script checks if the client is already instantiated before initializing it and returns the instance upon subsequent calls. | +| [ipfs-utils.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/lib/supply-chain/src/ipfs-utils.ts) | This script encrypts and uploads files onto IPFS using RSA and AES encryption, as well as Wallet-specific encryption. It retrieves encrypted content without requiring the private key (only the public key). Error messages are logged and rethrown to be handled by calling functions. The uploaded files IPFS path is returned along with its filename. | +| [common-types.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/lib/supply-chain/src/common-types.ts) | This TypeScript file defines various activity types (Shipment, Flight, EmissionsFactor, NaturalGas, Industry, Other, Electricity) and results for each. Activities consist of a path from one address to another, common properties, and type-specific data like carrier or electricity utility. The final `ActivityResult` contains calculated distance, weight, flight details, emissions data, and any additional details. An error may also be present in case of processing issues. A processed activity combines the original activity object with its result and an optional error. The output provides shipping-related info like UPS response, address(es), weight, distance, emissions, etc. Metadata defines various properties to categorize activities, while helper functions check if a given activity is of a certain type. | +| [distance-utils.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/lib/supply-chain/src/distance-utils.ts) | This function calculates the ground distance between two addresses using Google Maps API by geocoding the addresses and then retrieving the distance matrix. If theres no Google API key set, it will use a placeholder function to provide a random distance instead. | +| [industry-utils.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/lib/supply-chain/src/industry-utils.ts) | Transforms activity amounts from various units into kg CO2e for emissions calculation, leveraging functions like `flaring_in_kg_co2e()`, `methane_in_kg_co2e()` and `kg_from_co2e()`. The converted values are then returned in an object with details on emission type and GWP. If the UoM is not supported, an error is thrown. | +| [unit-utils.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/lib/supply-chain/src/unit-utils.ts) | Converts volume from various units (cubic feet, cubic meters, billion cubic feet, etc.) to cubic meters using predefined conversion factors. This allows for flexibility when dealing with different volume units without manually converting them before calculation. | +| [crypto-utils.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/lib/supply-chain/src/crypto-utils.ts) | These functions perform encryption and decryption operations using different algorithms such as RSA, AES-256-CTR, and Yubicos Y0-Poly1305. They also generate a key pair for RSA encryption and hashing the content using SHA-256. The encrypted data can be stored in various formats like base64, hexadecimal, and pem-encoded PKS1 format. | +| [emissions-utils.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/lib/supply-chain/src/emissions-utils.ts) | This code file, located in the `app/api-oracle` directory of the blockchain-carbon-accounting" repository, is a crucial component that serves as the data oracle within the application's architecture. The Data Oracle's main purpose is to provide reliable and verified data about carbon emissions, enabling the accurate accounting for transactions on the blockchain.The data Oracle retrieves its information from various sources, such as CSV files of emission proxies for different years and regions, and Excel spreadsheets containing conversion factors and utility data. It ensures these resources are maintained and updated in an organized fashion, as illustrated by the `2016-RES_proxies_EEA.csv` to `Utility_Data_2020.xlsx` files in the `data` directory.By working hand-in-hand with other components like the API server and frontend, the data Oracle ensures that all parties involved in carbon accounting on this blockchain can rely on accurate and trustworthy information for their transactions and reports. This helps in fostering transparency and accountability throughout the supply chain. | +| [ups-types.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/lib/supply-chain/src/ups-types.ts) | Tracks, deciphers, and stores shipping information from United Parcel Service (UPS) API, structuring responses for ease of use within the blockchain-carbon-accounting applications supply-chain module. The file defines data types UpsAPI, UpsAddress, UpsActivity, and UpsResponse to facilitate interaction with the UPS service in TypeScript. | + +
+ +
fabric + +| File | Summary | +| --- | --- | +| [spec.yaml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/spec.yaml) | Configures Hyperledger Fabric network with specific CAs, peers, orderers, and settings to securely operate the blockchain-carbon-accounting system, ensuring that all necessary components have the appropriate debug logging levels. The configuration also includes a workaround to circumvent restricted go proxy in certain regions by setting the appropriate goproxy for that area. | +| [.eslintrc](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/.eslintrc) | Configures the ESLint parser for the Fabric blockchain module in this project. Optimizes the code quality and consistency by enforcing ES6 syntax within the Fabric-based solutions, ensuring smooth integration and maintainability. | + +
+ +
fabric.chaincode.emissionscontract.packaging + +| File | Summary | +| --- | --- | +| [connection.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/chaincode/emissionscontract/packaging/connection.json) | In this code file, located within the fabric/chaincode/emissionscontract/packaging' directory, an encryption key and certificates are stored. This configuration empowers secure connection to the emission contract blockchain instance on the specified address in production, ensuring authenticated interaction with the blockchain network." | +| [metadata.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/chaincode/emissionscontract/packaging/metadata.json) | In this open-source blockchain project, the JSON metadata file located at `fabric/chaincode/emissionscontract/packaging/metadata.json` labels the emissions contract as external. This external contract serves to track greenhouse gas emissions data, integral in the carbon accounting system. | + +
+ +
fabric.chaincode.emissionscontract.deploy + +| File | Summary | +| --- | --- | +| [chaincode-deployment.yaml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/chaincode/emissionscontract/deploy/chaincode-deployment.yaml) | Deploys and manages the emissions chaincode within a Hyperledger Fabric network, ensuring secure communication via gRPC on port 7052 through a deployment object (YAML format) and service definition, streamlining blockchain-carbon-accounting for emissions tracking. | +| [chaincode-deployment-only.yaml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/chaincode/emissionscontract/deploy/chaincode-deployment-only.yaml) | Environment variables define its unique CCID and listening address on port 7052. Key part of the blockchain-carbon-accounting app architecture for managing carbon emissions data. | + +
+ +
fabric.chaincode.emissionscontract.typescript + +| File | Summary | +| --- | --- | +| [emissions-data-lib.sh](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/chaincode/emissionscontract/typescript/emissions-data-lib.sh) | Removes and rebuilds the emissions_data library under the Fabric's TypeScript app's src/lib/emissions_data directory by copying the previous content from the top-level repository's lib/emissions_data/src/ location. This action ensures a consistent and up-to-date emissions_data library within the blockchain-carbon-accounting architecture. | +| [Dockerfile](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/chaincode/emissionscontract/typescript/Dockerfile) | In this Fabric project for blockchain carbon accounting, this `Dockerfile` serves to assemble and manage our smart contract for emissions data. By installing necessary packages (TypeScript and related dependencies) and compiling the source code, it prepares an optimized container that executes the contract on demand using `npm run start`. | +| [.eslintrc](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/chaincode/emissionscontract/typescript/.eslintrc) | This TypeScript configuration file enhances error-free coding and maintains a consistent style for the emissions contract smart contract within the Fabric blockchain application, ensuring seamless collaboration and smooth integration with the broader architecture. | +| [package-lock.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/chaincode/emissionscontract/typescript/package-lock.json) | API Oracle**-A module responsible for fetching real-world data about carbon emissions from various external APIs and databases. This data is then used to update the carbon accounting information within the blockchain, ensuring accurate and up-to-date records.2. **API Server**-The core component that manages all incoming requests and provides the entry point for client applications to interact with the system. It's responsible for processing transactions, verifying their validity, and updating the state of the blockchain based on the transactions. Additionally, it handles interactions with the API Oracle and other necessary components in maintaining a secure, efficient, and trustworthy blockchain.By combining these two elements, the codebase aims to create an open-source blockchain for carbon accounting that leverages real-world data, enabling users to make informed decisions about their carbon footprints while promoting transparency and accountability in this crucial area. | +| [package.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/chaincode/emissionscontract/typescript/package.json) | In the Blockchain Carbon Accounting repository, this TypeScript-based `package.json` configures the development environment for the Emissions Data Chaincode. It sets up test scripts, linting rules, and build instructions using popular tools like Mocha, ESLint, and Prettier, ensuring a clean, efficient, and maintainable development workflow in Fabrics emissionscontract. | +| [tsconfig.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/chaincode/emissionscontract/typescript/tsconfig.json) | This TypeScript configuration file streamlines compilation of smart contracts for the blockchain within the Fabric framework. It sets up TypeScript to produce ES2020 code with experimental decorators, emit metadata, and strict type-checking. The output files are saved in the dist folder, ensuring a clean project organization. | + +
+ +
fabric.chaincode.emissionscontract.typescript.test.lib + +| File | Summary | +| --- | --- | +| [emissionsFactor.test.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/chaincode/emissionscontract/typescript/test/lib/emissionsFactor.test.ts) | Tests the emissionsFactor.ts module from the fabric/chaincode/emissionscontract/typescript/test directory within the fabric folder. This file contains tests for the `addEmissionsFactor` and `getEmissionsFactor` functions of the EmissionsFactor class. It verifies successful addition, retrieval, and non-existent asset retrieval in a simulated blockchain environment. | +| [emissions-calc.test.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/chaincode/emissionscontract/typescript/test/lib/emissions-calc.test.ts) | Validates input date formatting for getYearFromDate function, ensuring compliance with expected YYYY-MM-DD format within the Fabric's emissions contract TypeScript tests. | + +
+ +
fabric.chaincode.emissionscontract.typescript.src + +| File | Summary | +| --- | --- | +| [index.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/chaincode/emissionscontract/typescript/src/index.ts) | GetValidEmissions`, `getAllEmissionsData`, `getAllEmissionsDataByDateRange`, and `getAllEmissionsDataByDateRangeAndParty`. These methods allow for the retrieval of emissions data, filtered by date range or additional party parameters. Errors are handled and returned as chaincode responses. The chaincode starts when calling Shim.start(new EmissionsChaincode());. | + +
+ +
fabric.chaincode.emissionscontract.typescript.src.util + +| File | Summary | +| --- | --- | +| [state.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/chaincode/emissionscontract/typescript/src/util/state.ts) | This TypeScript file, `fabric/chaincode/emissionscontract/typescript/src/util/state.ts`, defines an abstract `State` class for managing data in a blockchain-based emissions contract. The class manages data through unique identifiers and serializes/deserializes data as Uint8Array using JSON. This essential structure enables the storage, retrieval, and manipulation of data within the blockchain ecosystem. | +| [const.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/chaincode/emissionscontract/typescript/src/util/const.ts) | This Typescript file, `const.ts`, consolidates essential constants within the Fabric blockchains emissions contract, streamlining error messaging, chaincode entry point errors, weight unit definitions, and geographical regions. Enhancing maintainability by centralizing critical information, it helps ensure consistent error handling across functions for efficient smart contract execution. | +| [util.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/chaincode/emissionscontract/typescript/src/util/util.ts) | This TypeScript utility module within the Fabric blockchain subsystem provides a global logger interface for tracking emission record transactions within the emissions contract chaincode. The `stringToBytes` function encodes strings into binary data, essential in handling transactions efficiently in the blockchain environment. | +| [worldstate.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/chaincode/emissionscontract/typescript/src/util/worldstate.ts) | Manages a generic WorldState class for asset management on HL fabric. Contains methods for adding, querying, updating, and retrieving state assets. If an asset already exists with the given ID, adds throw an error. Utilizes Apache-2.0 license. | + +
+ +
fabric.chaincode.emissionscontract.typescript.src.lib + +| File | Summary | +| --- | --- | +| [emissions.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/chaincode/emissionscontract/typescript/src/lib/emissions.ts) | This TypeScript file defines an EmissionsRecord class representing an environmental record data object for applications and smart contracts. It inherits from State class to define the structure of each record as well as providing methods to serialize (toBuffer) and deserialize (fromBuffer) it into bytes using Uint8Array. The class also includes a constructor, allowing instantiation with an EmissionsRecordInterface.EmissionRecordState wraps around a Fabric Chaincode Stub for managing the lifecycle of an EmissionRecord through its addEmissionsRecord, getEmissionsRecord, updateEmissionsRecord functions, and more advanced querying methods like getAllEmissionRecords, getAllEmissionsDataByDateRange, or getAllEmissionsDataByDateRangeAndParty. | +| [emissionsRecordContract.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/chaincode/emissionscontract/typescript/src/lib/emissionsRecordContract.ts) | The script provides methods for adding, updating, and retrieving emission records from a data store. It supports generating SHA256 hashes for specific fields like partyId. Additionally, it allows querying emissions data based on various parameters such as UUID, date range, or both. Furthermore, it manages the creation of minted tokens associated with these emissions records. | + +
+ +
fabric.chaincode.emissionscontract.typescript.src.lib.emissions_data.src + +| File | Summary | +| --- | --- | +| [emissionsFactor.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/chaincode/emissionscontract/typescript/src/lib/emissions_data/src/emissionsFactor.ts) | This TypeScript file defines an interface `EmissionsFactorInterface` for data representing carbon emissions factors within the Blockchain Carbon Accounting system. The interface structures data with properties like emission type, level, country, and units for net generation, CO2 equivalent emissions, and more, helping to accurately track and manage emissions across various divisions in a standardized format. | +| [const.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/chaincode/emissionscontract/typescript/src/lib/emissions_data/src/const.ts) | In this TypeScript file within the Blockchain Carbon Accounting repository, key constants are defined for various error scenarios, chaincode entry point errors, success and failure messages, weight units, and regional identifiers. By consolidating these values, the codebase improves maintainability, readability, and compatibility with different regions and applications in the blockchain system. | +| [utilityLookupItem.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/chaincode/emissionscontract/typescript/src/lib/emissions_data/src/utilityLookupItem.ts) | This TypeScript file defines the UtilityLookupItemInterface, a class used for handling utility-related data in the emissions contract chaincode. It includes fields like utility name, country, and divisions, enhancing the functionality and efficiency of data management within the Blockchain Carbon Accounting system. | +| [emissions-calc.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/chaincode/emissionscontract/typescript/src/lib/emissions_data/src/emissions-calc.ts) | Transforms and manages unit-of-measurement (UOM) factors within the fabric chaincode for emissions data calculation in the blockchain carbon accounting project. Provides UOM conversion functionality for consistent data processing, ensuring compatibility among different systems and units. | + +
+ +
fabric.chaincode.datalock + +| File | Summary | +| --- | --- | +| [go.mod](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/chaincode/datalock/go.mod) | In this project, the `fabric/chaincode/datalock/go.mod` file sets up the Go dependencies required for the development of a smart contract on Hyperledger Fabric network. It imports crucial libraries like logrus, testify, and fabric-protos-go, establishing the foundations to develop robust and secure chaincode modules in this blockchain carbon accounting application. | +| [Dockerfile](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/chaincode/datalock/Dockerfile) | In this codebase, the provided Dockerfile (fabric/chaincode/datalock/Dockerfile) serves to build and containerize a Go application for blockchains datalock chaincode using Alpine Linux and Golang. This allows for easy distribution and deployment of the datalock smart contract within the fabric blockchain ecosystem, ensuring secure data storage and management across various nodes. | +| [Makefile](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/chaincode/datalock/Makefile) | The Makefile within the fabric/chaincode/datalock directory streamlines the project development process. It provides test, linting, and coverage checks for internal code, ensuring high-quality chaincode implementation. Docker image building and push to a repository are also included for smooth deployment. | +| [go.sum](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/chaincode/datalock/go.sum) | Blockchain-carbon-accounting`The main purpose of this repository is to develop a decentralized, open-source carbon accounting system using blockchain technology. This system aims to track, verify and reduce greenhouse gas emissions in a transparent and efficient manner.The referenced code file you are inquiring about appears to belong to the core module within this architecture, as it resides in the root directory (`blockchain-carbon-accounting/`). While specific details of the file's functionality remain undisclosed, one can infer that it plays a crucial role in the creation and management of Carbon Assets โ€“ digital tokens representing real-world carbon emission reductions. This is suggested by the naming convention U, possibly short for Unit, implying it may handle units of measurement or transactional data associated with these carbon assets.This central module interacts seamlessly with other components in the system, such as the Smart Contracts (possibly implemented in Solidity), APIs for external data ingestion, and front-end applications for user interactions. Ultimately, the collective efforts across the codebase will result in a blockchain ecosystem empowering individuals and organizations to combat climate change together. | +| [.golangci.yml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/chaincode/datalock/.golangci.yml) | This `fabric/chaincode/datalock/.golangci.yml` file sets up a linter configuration for Go code. It disables all checks initially, but enables specific ones like megacheck, govet, gofmt, exportloopref, and bodyclose. Additionally, it customizes the misspell checks locale to US. This streamlines the quality and consistency of Go code in the blockchain-carbon-accounting repository. | +| [main.go](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/chaincode/datalock/main.go) | In this repository, titled blockchain-carbon-accounting, the `main.go` file within the fabric/chaincode/datalock directory serves as the entry point for the DataLock chaincode in a Hyperledger Fabric Go implementation. It initializes the chaincode server when triggered by the platform, facilitating the interaction of parties for managing and auditing carbon emissions data on the blockchain. | + +
+ +
fabric.chaincode.datalock.mock + +| File | Summary | +| --- | --- | +| [emissionsCC.go](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/chaincode/datalock/mock/emissionsCC.go) | This Go program defines a simple chaincode for managing emissions data, where each emission is associated with a unique ID, PartyID, and optional TokenID. It provides methods to query valid (unminted) emissions with getValidEmissions() and update emissions by minting tokens using UpdateEmissionsWithToken(). An invalid method response is also provided as an example for handling improper usage. The functions return appropriate responses to clients in the form of JSON or base64-encoded messages depending on the operation requested. | + +
+ +
fabric.chaincode.datalock.internal + +| File | Summary | +| --- | --- | +| [tx_test.go](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/chaincode/datalock/internal/tx_test.go) | This unit test suite validates various states of the transactions (non-existing, processing, and not-processing). It covers scenarios such as starting and ending a non-existing or processing transaction, ensuring proper error messages are returned for invalid input. | +| [chaincode.go](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/chaincode/datalock/internal/chaincode.go) | This Go code file, `fabric/chaincode/datalock/internal/chaincode.go`, is part of a blockchain-based carbon accounting solution and implements the core functionality for a Hyperledger Fabric chaincode called DataLockChaincode. The primary role of this chaincode is to enable data management within the blockchain network by handling both initialization (Init) and invocations (Invoke). The Invoke function dispatches specific methods based on input, ensuring secure and efficient data interactions within the system. | +| [locker_test.go](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/chaincode/datalock/internal/locker_test.go) | Tests `unlock` function in a smart contract (EmissionsCC) for Hyperledger Fabric. It verifies successful unlocking and edge cases like when not locked, business logic error, and invalid response from the smart contract. The tests setup mock stubs for both transaction (txStub) and chaincode execution (emStub), and test data including a unique txID, lock UUIDs, token ID, and party ID. The tests cover happy path scenarios and negative edge cases to ensure proper functionality of unlocking and updating tokens and party IDs in the emissions contract. | +| [util_test.go](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/chaincode/datalock/internal/util_test.go) | This Go module, `fabric/chaincode/datalock/internal/util_test.go`, serves to establish a mock Fabric Smart Contract Stub environment for testing the functionality within the Datalock chaincode. The buildEmptyMockStub() function constructs this testing environment by initializing key components, such as state, invokables, and keys, in an empty setup. This helps maintain the stability of the testing process, ensuring reliable assessment of new chaincode iterations. | +| [locker.go](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/chaincode/datalock/internal/locker.go) | This function unlocks data within a chaincode using an input containing keys to be unlocked. It first checks the transaction ID and locked state for each key. If valid, it invokes the chaincode with provided parameters and subsequently removes the locks from the stored state. An error is returned if any step fails. | +| [method_test.go](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/chaincode/datalock/internal/method_test.go) | Without any parameters, with incorrect input data, and correctly freeing data using the specified chaincode (emCCName). A startFineshTx scenario is also present to simulate a startTransitionProcess command. | +| [method.go](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/chaincode/datalock/internal/method.go) | This function initializes the transition of a transaction from its current state to the provided stage, managing data locks and frees as per input parameters. It updates the transaction state, stores any resulting data in persistent storage, and returns the processed data to the client if applicable. A separate function retrieves transaction details by its unique identifier from the distributed ledger. | +| [lock-state.go](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/chaincode/datalock/internal/lock-state.go) | This function set creates and manages lock states on a Fabric blockchain using Go programming language. Functions like `SetLockState`, `isLockStateExists`, and `deleteLockState` manipulate lock state data, while functions such as `getLockStateTxID` and `getAllLockState` retrieve lock state information. The lock state consists of a transaction ID, key, and their index for easy access in the blockchain. These functions enable efficient management of locks within smart contracts. | +| [lock-state_test.go](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/chaincode/datalock/internal/lock-state_test.go) | This Go source file contains tests for lock state functions in the Datalock package. The functions `putLockState`, `getLockStateTxID`, `isLockStateExists`, `deleteLockState`, and `getAllLockState` are being tested to ensure correct storage and retrieval of transaction IDs associated with lock states in the mock chaincode stub. Additionally, the code verifies that lock states and lock indices are being correctly mapped in the state database. | +| [tx.go](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/chaincode/datalock/internal/tx.go) | The given `txState` function modifies the state of a transaction, switching between processing and not-processing based on user input. If a transaction doesn't exist or is already processed, it returns an error message. Once modified, it saves the new state back to the worldstate using Hyperledger's Chaincode stub interface. | + +
+ +
fabric.chaincode.datalock.model + +| File | Summary | +| --- | --- | +| [transaction.go](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/chaincode/datalock/model/transaction.go) | PROCESSING, NOT-PROCESSING, and FINISHED, ensuring efficient and coordinated processing on a blockchain network within the parent repository dedicated to carbon accounting and supply chain management. | +| [data-chaincode.go](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/chaincode/datalock/model/data-chaincode.go) | In this Go package model residing within the `fabric/chaincode` folder, the developer creates structs for input (DataChaincodeInput) and output (DataChaincodeOutput) for data chaincode functions. The Input struct holds keys and params, while Output encapsulates the keys, an encoded result to be sent immediately to the client, and a key-value encoded result to be stored with the transaction. These constructs facilitate managing and interacting with blockchain-stored data. | +| [tx-io.go](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/chaincode/datalock/model/tx-io.go) | This Go code file, located in the `fabric/chaincode/datalock/model/tx-io.go`, outlines structures for input (`StageUpdateInput`) and output (`StageUpdateOutput`) in transactions dealing with data locking and unlocking within a stage of the blockchain workflow. The data locks and unlocks are stored as key-value pairs, allowing for secure management of transaction-specific data in further stages of the process. | + +
+ +
fabric.chaincode.datalock.pkg.logger + +| File | Summary | +| --- | --- | +| [logger.go](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/chaincode/datalock/pkg/logger/logger.go) | This Go package, `logger`, initializes a logger object using logrus. It provides methods for logging debug, info, warn, and error messages. The `NewAppLogger` function is used to set the desired log level, and the `SystemErr` function logs system errors with additional context from associated error objects. | + +
+ +
fabric.chaincode.datalock.pkg.errors + +| File | Summary | +| --- | --- | +| [code.go](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/chaincode/datalock/pkg/errors/code.go) | In this Go package for our blockchain carbon accounting project, critical error codes are defined and organized. These errors correspond to specific HTTP statuses, helping ensure the platforms smooth operation by handling situations such as not found resources, invalid input data, conflicts, and unexpected issues. | +| [errors.go](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/chaincode/datalock/pkg/errors/errors.go) | This file defines an error handling structure for chaincode, including different severity levels (Error, Warn, Info, Debug). It uses the `Errorf` function to wrap existing errors with custom messages, and a function E() to create new error objects within an existing error stack. Additional functions provide operations, error code, level, chaincode name, and txID information from the error stack. The design enables detailed tracing of errors for troubleshooting purposes in a blockchain context. | + +
+ +
fabric.typescript_app + +| File | Summary | +| --- | --- | +| [test-results.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/typescript_app/test-results.json) | DocumentationContains files providing information about getting started, licensing, maintenance, user guides, and setup instructions for contributors.2. **appThe core application containing modules like API oracle, API server, frontend, methane (potentially related to methane emissions), reports, scripts, and supply-chain (to trace carbon emissions through the production and distribution process).3. **dataContains raw data used for calculation, such as CSV files with energy consumption and conversion data for different years and utility data in XLSX format. These files are likely utilized for population of the blockchain network with relevant information to calculate emissions accurately.4. The co folder name isn't visible in the provided repository structure, but it could possibly represent a country or organization, containing specific modules or configurations related to that entity.The given code file (not specified) plays a critical role within this architecture by achieving the integration and management of data, enabling efficient carbon emissions calculation and blockchain-based accounting, enhancing transparency in emissions reporting across various sectors within the EEA. | +| [Dockerfile](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/typescript_app/Dockerfile) | Builds TypeScript-based Node.js application Docker image using provided package.json and tsconfig.json. The container runs the compiled JavaScript file (`index.js`), essential for deploying this project component in Hyperledger Fabric network. | +| [.eslintrc](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/typescript_app/.eslintrc) | Within this Blockchain Carbon Accounting project, the `fabric/typescript_app/.eslintrc` file is crucial for establishing consistent coding styles within the TypeScript app within the Fabric directory. This configuration ensures adherence to recommended best practices, promotes readability, and enforces formatting guidelines to maintain project coherency. | +| [webpack.config.js](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/typescript_app/webpack.config.js) | Compiles and bundles TypeScript files within the `fabric/typescript_app` directory for running on Node.js. The resulting bundle is placed in the build folder named bundle.js. This step is essential to execute our custom smart contract logic on the Fabric blockchain network, facilitating seamless interactions with our platform's core functions. | +| [package.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/typescript_app/package.json) | Test with Mocha, Chai and typescript (eslint, prettier).Enhance security with crypto-js, joi, ts-md5, uuid libraries.Implement real-time communication via socket.io.Streamline development with ts-node and nyc for test coverage. | +| [.env](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/typescript_app/.env) | This `fabric/typescript_app/.env` file configures critical environment settings for the TypeScript application within the blockchain-carbon-accounting repository. It establishes connections to various systems such as local Ethereum networks, AWS S3, Vault, and PostgreSQL databases. Additionally, it sets up the Fabric contract details for the blockchain interaction, enabling seamless carbon accounting workflows across these integrated technologies. | +| [cp-blockchain-gateway-lib.sh](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/typescript_app/cp-blockchain-gateway-lib.sh) | Copies essential blockchain-gateway library files from the main repository to the typescript application, streamlining interaction between the Fabric smart contract and the application, thus facilitating seamless transaction processing. | +| [tsconfig.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/typescript_app/tsconfig.json) | Configures TypeScript compilation settings for the Fabric applications source files. The compiler options enable experimental decorators, strict type checking, and source map generation, while excluding `node_modules` and test directories from transpilation. Output files are saved to the specified output directory. | + +
+ +
fabric.typescript_app.src + +| File | Summary | +| --- | --- | +| [app.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/typescript_app/src/app.ts) | This TypeScript file initializes and configures an Express application for a Hyperledger Carbon Accounting REST API. It handles JSON parsing, form data processing with Multer, and integrates Swagger-UI-Express for API documentation. The openAPI specification is customized to reflect the correct base URL. The app starts by applying middleware and setting up services upon successful initialization. | +| [index.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/typescript_app/src/index.ts) | This Typescript application file initializes and starts a blockchain application within the Fabric framework by configuring environment variables, logging setup, and instantiation of an App instance. The app utilizes data from multiple sources like the supply chain, emissions data, and oil-and-gas data for carbon accounting in the broader blockchain ecosystem. | + +
+ +
fabric.typescript_app.src.routers.v1 + +| File | Summary | +| --- | --- | +| [identity.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/typescript_app/src/routers/v1/identity.ts) | Manages WebSocket connections for identity services within the blockchain-carbon-accounting platform using an Express Router. This module integrates with the identity webSocket controller to handle incoming POST requests at the /webSocket endpoint. Enhancing communication and secure user interactions on our decentralized carbon accounting application. | +| [registerEnroll.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/typescript_app/src/routers/v1/registerEnroll.ts) | One for user registration, and another for enrollment in the system. Its a vital component for managing user accounts in our blockchain-carbon-accounting platform by allowing users to register their identities and enroll in specific services through its API. | +| [emissionsChannel.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/typescript_app/src/routers/v1/emissionsChannel.ts) | Records emissions from various sources using recordEmission' function* Retrieves emission data related to specific utilities, parties, or date ranges* Ensures verified and audited emissions via recordAuditedEmissionsToken functionThis TypeScript component of our fabric-based blockchain app facilitates transparent tracking of greenhouse gas emissions. | +| [index.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/typescript_app/src/routers/v1/index.ts) | RegisterEnroll, emissionscontract, and identity, each responsible for specific tasks in the emissions data workflow on the blockchain network. | + +
+ +
fabric.typescript_app.src.datasource + +| File | Summary | +| --- | --- | +| [awsS3.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/typescript_app/src/datasource/awsS3.ts) | Uploads data, downloads files, and deletes objects from an AWS S3 bucket using credentials specified as environment variables or hardcoded for local development. | + +
+ +
fabric.typescript_app.src.blockchain-gateway + +| File | Summary | +| --- | --- | +| [emissionsChannel.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/typescript_app/src/blockchain-gateway/emissionsChannel.ts) | GetAllEmissionsData()` and `getAllEmissionsDataByDateRange()`. Both functions create a signer for the client, prepare necessary parameters for transactions, and send a transaction to the specified smart contract. If successful, they return the parsed emission record data. In case of an error, they throw a ClientError exception with an appropriate message. | +| [fabricRegistry.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/typescript_app/src/blockchain-gateway/fabricRegistry.ts) | Registers and enrolls Fabric users via the Fabric gateway. The FabricRegistryGateway class interacts with the Fabric ledger using a custom signer and connector, enabling users to securely authenticate and execute transactions on Hyperledger Fabric network. | +| [datalock.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/typescript_app/src/blockchain-gateway/datalock.ts) | GetTxDetails`, `startTransitionProcess`, `endTransitionProcess`, and `stageUpdate`. The functions communicate with the Fabric network through transactions, handling errors and logging messages. The contract interacts with its Fabric Connector, utilizing signers for client authentication to call methods in the specified contract. Each method accepts input from a caller and returns data or an error. | + +
+ +
fabric.typescript_app.src.utils + +| File | Summary | +| --- | --- | +| [dateUtils.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/typescript_app/src/utils/dateUtils.ts) | This TypeScript utility file within the Fabric folder enhances date handling for the blockchain application. The `checkDateConflict` function assesses overlap between two time periods while the `toTimestamp` function converts string dates to timestamps, thereby improving efficiency and accuracy of temporal operations in the system. | +| [logger.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/typescript_app/src/utils/logger.ts) | In this repository, the file logger.ts serves as a configuration and management tool for logging activities within the Hyperledger blockchain application, differentiating between application-level and ledger-level logs. By providing customizable labels and log levels, it ensures traceability and maintains system transparency. | + +
+ +
fabric.typescript_app.src.errors + +| File | Summary | +| --- | --- | +| [clientError.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/typescript_app/src/errors/clientError.ts) | This TypeScript file within the `fabric/typescript_app/src/errors` directory defines a custom `ClientError` class that extends the JavaScript built-in Error object for specific network communication issues. The class takes a message and an optional status code, streamlining error handling in the Fabric app network layer by creating reusable, descriptive error instances. | + +
+ +
fabric.typescript_app.src.service + +| File | Summary | +| --- | --- | +| [input.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/typescript_app/src/service/input.ts) | Strings, files, queries, and parameters, ensuring standardized data processing within the fabric applications service layer. | +| [emissionsChannel.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/typescript_app/src/service/emissionsChannel.ts) | The provided codebase, `blockchain-carbon-accounting`, is a comprehensive solution for carbon accounting within supply chains using blockchain technology. The architecture consists of several main components, including an API server, frontend, methane (presumably a specific application), reports, supply-chain modules, and utility data.The focus of this code file appears to be part of the data module, where you will find various CSV and Excel files containing emissions data for different years from 2016 to the most recent available data (presumably 2021). These datasets are essential for analyzing the carbon footprint across various industries within the European Economic Area.Moreover, the file also houses utility data such as Conversion Factors, which help convert the raw data into meaningful carbon emission measurements. These files play a vital role in accurate and reliable carbon accounting calculations. By leveraging these datasets, businesses can effectively monitor their environmental impact, track progress, and make informed decisions towards reducing their carbon footprint. | +| [fabricRegistry.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/typescript_app/src/service/fabricRegistry.ts) | In this TypeScript file, a class `FabricRegistryService` is defined which uses the Fabric gateway for registering and enrolling users on a blockchain network. The service accepts inputs via a user-supplied object (`Input`) and validates these inputs using Joi schemas to ensure they have the required fields. In case of any errors or failures, appropriate exceptions are thrown. If the input is valid, the corresponding function `register()` or `enroll()` is called on the Fabric gateway instance, passing in necessary parameters such as user IDs and secrets. The enrollment process includes both registering (i.e., creating a new user identity) and enrolling (i.e., retrieving the users public key and associated certificate). | +| [service.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/typescript_app/src/service/service.ts) | Initializes a Hyperledger Fabric TypeScript service, configuring gateway connectors for fabric, Etherium, and various blockchain-based data services (EmissionsData, DataLock). Sets up the EmissionChannelService for tracking emissions data using the Ethereum contract and AWS S3 storage. Implements a signer module to ensure secure transactions with specified MSP and certificate stores. | + +
+ +
fabric.typescript_app.src.controllers + +| File | Summary | +| --- | --- | +| [identity.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/typescript_app/src/controllers/identity.ts) | The TypeScript file at `fabric/typescript_app/src/controllers/identity.ts` initializes a webSocket connection with an identity provider within the fabric blockchain network. It generates a new session ID and URL upon successful connection, facilitating secure interactions between client applications and the blockchain ecosystem. | +| [registerEnroll.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/typescript_app/src/controllers/registerEnroll.ts) | Enroll` and `register`. These functions facilitate the enrollment and registration process for clients in our blockchain network using the `fabricRegistryService`. This enables smooth interaction between our system and the blockchain fabric registry. | +| [emissionsChannel.ts](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/typescript_app/src/controllers/emissionsChannel.ts) | Create new emission record (POST).2. Fetch all emission records (GET).3. Retrieve all emission records within a date range (GET).4. Record audited emission token (POST).Each function interacts with the EmissionsChannelService, processing requests and handling errors. In case of a ClientError, it returns an appropriate status and error message. Otherwise, it returns a 500 Internal Server Error if any other unexpected error occurs. | + +
+ +
fabric.docker-compose-setup + +| File | Summary | +| --- | --- | +| [network.sh](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/network.sh) | Data processingIt processes extensive datasets containing historical carbon emissions and energy utilization data from various regions. These datasets are primarily in CSV and Excel formats.2. **Carbon accountingThe reports provide detailed insights into carbon accounting, helping users to assess and monitor their carbon footprints effectively.3. **Blockchain integrationIntegration with the blockchain infrastructure within the repository allows for secure, tamper-proof recording and tracking of carbon accounting data, fostering transparency and trust.4. **AutomationThe code is designed to automate the report generation process, making it more efficient for users to access and interpret their carbon accounting data in a timely manner. | +| [bootstrap.sh](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/bootstrap.sh) | Verify Hyperledger Fabric samples-Clone fabric-samples repository (if selected)Pull Hyperledger Fabric binaries-Retrieve Hyperledger Fabric tarballs (if selected)Pull Hyperledger Fabric docker images-Download necessary Docker images (if Docker is installed and enabled)Ensure a seamless fabric environment setup, tailored for your choice of options! | +| [package-lock.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/package-lock.json) | In the Blockchain Carbon Accounting repository, this specific code file is located within the `app` directory, and it contributes to the modular structure of the application by managing components such as the API server, frontend, methane (likely a smart contract), reports, scripts, and supply chain. The primary function of these components, while not explicitly detailed, appears to contribute towards building a robust system for carbon accounting on a blockchain, which could involve data tracking, verification, and reporting within various aspects of a supply chain. This systems intent is to enable users to monitor and reduce their carbon footprint effectively. The codes integration into the broader project architecture enables real-time, secure, and transparent accounting of carbon emissions for various entities involved in a supply chain, empowering sustainable decision-making. | +| [package.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/package.json) | The EGrid Data Loader (package.json within fabric/docker-compose-setup) is an Apache-2.0 licensed Node.js application that manages data loading for the blockchain-carbon-accounting project. It relies on async, fabric-shim, xlsx, and yargs engines, alongside eslint for code linting, to achieve this. The software plays a crucial role in enabling efficient data exchange within the system. | +| [.env](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/.env) | This.env file sets up a Docker network (`COMPOSE_PROJECT_NAME=net`) and creates a system channel (`SYS_CHANNEL=system-channel`) within the Fabric blockchain infrastructure, facilitating smooth interaction among connected parties for carbon accounting. | +| [.env.api-server](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/.env.api-server) | This file, `fabric/docker-compose-setup/.env.api-server`, initializes an API server with defined configuration to connect to a specific PostgreSQL database, utilizing hardhat for Ethereum network management. The setup skips syncing the API server to hardhat, only employing it for accessing the PostgreSQL DB. | +| [startDev.sh](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/startDev.sh) | This shell script, located in `fabric/docker-compose-setup/startDev.sh`, boots up the blockchain-carbon-accounting repository. It initiates the carbonAccounting network, sets up Certificate Authorities, builds and deploys a TypeScript emissions channel contract, and launches an API server to interface with this blockchain. | +| [start.sh](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/start.sh) | Launches and sets up the entire blockchain-carbon-accounting network, including CAs, client, orderers, peers, couchdb, channel creation, chaincode installation, deployment, and API start on specified host. | + +
+ +
fabric.docker-compose-setup.organizations + +| File | Summary | +| --- | --- | +| [ccp-generate.sh](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/organizations/ccp-generate.sh) | The script generates connection files for peer organizations within Carbon Accounting Network using specified parameters. It constructs YAML and JSON files for two peer organizations (Auditor1 & Auditor2) while storing their TLS certificates securely in the given directory structure. | +| [ccp-template.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/organizations/ccp-template.json) | The provided `ccp-template.json` configuration file initializes a blockchain network organization for an auditor within the carbonAccounting framework. It sets up essential details such as connection endpoints, SSL certificates, and peer URLs, enabling smooth communication and trusted transactions in the carbon accounting system. | +| [ccp-template.yaml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/organizations/ccp-template.yaml) | This YAML file (`fabric/docker-compose-setup/organizations/ccp-template.yaml`) establishes the infrastructure for an auditor organization in the blockchain carbon accounting system. It defines necessary connection details, including peers and certificate authorities, facilitating secure communication and network establishment within the specified auditor organization. | + +
+ +
fabric.docker-compose-setup.organizations.fabric-ca + +| File | Summary | +| --- | --- | +| [registerEnroll.sh](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/organizations/fabric-ca/registerEnroll.sh) | This code file is a part of the `blockchain-carbon-accounting` repository, which is designed to create a decentralized carbon accounting system. The specific file resides in the `app/scripts` directory and appears to contribute to the script module of the application.The primary purpose of this script appears to be handling data preprocessing, such as parsing and validating input data, or preparing it for integration with other components of the system (e.g., API server, frontend, etc.). The specific task performed by this particular script is related to the processing of Emissions Trading System (ETS) data provided in CSV format from 2016 to 2019.In the broader context of the repository architecture, the scripts module handles various tasks required for data preprocessing, allowing for seamless integration with other modules within the application stack. By enabling efficient handling and validation of input data, this script helps ensure reliable and accurate carbon accounting across the entire system. | +| [setCAHosts.sh](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/organizations/fabric-ca/setCAHosts.sh) | In the blockchain-carbon-accounting project, this script sets the host addresses for auditor nodes within the Fabric network, facilitating secure and reliable communication for carbon accounting operations. | + +
+ +
fabric.docker-compose-setup.organizations.fabric-ca.auditor1 + +| File | Summary | +| --- | --- | +| [fabric-ca-server-config.yaml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/organizations/fabric-ca/auditor1/fabric-ca-server-config.yaml) | API endpoints to handle requests from frontend and other components, such as for fetching data from CSV files or supply chains, methane analysis, etc.2. Implementation of authentication and authorization mechanisms ensuring secure data handling in the carbon accounting system.3. Data validation, sanitization, and error management functions to ensure consistent input and output data integrity. | + +
+ +
fabric.docker-compose-setup.organizations.fabric-ca.auditor3 + +| File | Summary | +| --- | --- | +| [fabric-ca-server-config.yaml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/organizations/fabric-ca/auditor3/fabric-ca-server-config.yaml) | In the `blockchain-carbon-accounting` repository, the focus is on building a blockchain-based platform for carbon accounting within the European Economic Area (EEA). This open-source project contains various modules such as api-oracle, api-server, frontend, methane, reports, scripts, and supply-chain, which are part of the application layer.The `data` directory houses crucial datasets that support the platform's functionalities, including energy consumption proxies for different years (2016 to 2020) and conversion factors required for calculating CO2 emissions. These datasets form an essential foundation for the platform's carbon accounting capabilities.The file `co2-emission-intensity-from-electricity-generation-5.csv` in particular contains data related to CO2 emission intensity from electricity generation, playing a critical role in understanding the carbon footprint of energy sources within the EEA and enabling more informed decisions regarding emissions reduction strategies. Overall, this repository is a collaborative effort aimed at creating a transparent and effective tool for monitoring and reducing carbon emissions through the power of blockchain technology. | + +
+ +
fabric.docker-compose-setup.organizations.fabric-ca.auditor2 + +| File | Summary | +| --- | --- | +| [fabric-ca-server-config.yaml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/organizations/fabric-ca/auditor2/fabric-ca-server-config.yaml) | Blockchain Carbon Accounting-Report Generation ModuleThe specified code file resides within the `reports` folder of the Blockchain Carbon Accounting repository. This repository aims to create a blockchain-based solution for carbon accounting, specifically designed for the European Union's Emissions Trading System (ETS).Within the broader context of this project, the Report Generation module is critical because it aggregates and organizes data related to carbon emissions across industries within the EEA (European Economic Area) and generates reports on carbon accounting. This information will serve as crucial insights for businesses and policymakers alike, helping them make informed decisions regarding emission reduction strategies.In the given structure, the Report Generation module is designed alongside other components like API oracle, API server, frontend, methane (a smart contract), supply chain, and data processing scripts to form a complete ecosystem for carbon accounting and reporting. The reports themselves are derived from various CSV files containing emission data, utility data, and conversion factors, all stored in the `data` folder of this repository.By focusing on data collection, aggregation, and report generation, this code file significantly enhances the functionality and usability of the overall Blockchain Carbon Accounting solution, providing a vital tool for driving meaningful progress towards reducing carbon emissions across the EEA. | + +
+ +
fabric.docker-compose-setup.blockchain-explorer + +| File | Summary | +| --- | --- | +| [config.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/blockchain-explorer/config.json) | The `config.json` file within the `docker-compose-setup` folder of the blockchain-carbon-accounting repository sets up the configuration for the first-network. This file utilizes Apache-2.0 licensed connection profiles to define and deploy this specific blockchain network. | + +
+ +
fabric.docker-compose-setup.blockchain-explorer.connection-profile + +| File | Summary | +| --- | --- | +| [first-network.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/blockchain-explorer/connection-profile/first-network.json) | Configures a connection profile for the `first-network` blockchain within the Fabric setup, specifying organization details, administrator credentials, channel information, and individual peer settings, ensuring efficient and secure interaction within the blockchain ecosystem. | + +
+ +
fabric.docker-compose-setup.docker + +| File | Summary | +| --- | --- | +| [docker-compose-couch.yaml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/docker/docker-compose-couch.yaml) | Initialize one instance as couchdb0 (version 3.1) with admin credentials; create two additional instances, couchdb1 and couchdb2 (both version 3.1), reusing the same admin credentials. These instances serve as ledger databases for different peers in the network, ensuring data consistency across the system. | +| [golang-node.dockerfile](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/docker/golang-node.dockerfile) | This Dockerfile builds and deploys a Golang application with embedded Node.js within the Hyperledger Fabric environment. It sets up prerequisites for the Node.js runtime, ensuring seamless execution of smart contracts orchestrating blockchain carbon accounting. | +| [docker-compose-carbonAccounting.yaml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/docker/docker-compose-carbonAccounting.yaml) | In the `blockchain-carbon-accounting` repository, the primary focus lies in the creation of a decentralized platform for carbon accounting. The critical components within this structure include the frontend, api-server, and various other subdirectories such as methane, supply-chain, and reports, each playing an integral role.The file of interest is located under `app/scripts`, which contains custom scripts to manipulate data stored in the `data` directory containing CSV files with carbon emissions data for European Economic Area (EEA). Specifically, the referenced script is responsible for parsing and pre-processing the data contained within these CSV files, ensuring compatibility with the platforms algorithms and functionality. This paves the way for efficient, accurate carbon accounting on the blockchain, contributing significantly to the repository's goal of fostering transparency in the fight against climate change. | +| [docker-compose-blockchain-explorer.yaml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/docker/docker-compose-blockchain-explorer.yaml) | A database and the blockchain explorer application. The database (Hyperledger Explorer DB) stores data related to the Fabric blockchain. The application, running on port 8080, queries and visualizes this data from the blockchain, leveraging the connection profile provided. | +| [docker-compose-ca.yaml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/docker/docker-compose-ca.yaml) | Initializes and deploys three fabric certificate authorities (ca_auditor1, ca_auditor2)-Provides TLS encryption using ports 7054, 8054 for auditors-Persists CA data on host volumes at../organizations/fabric-ca/auditor1 and../organizations/fabric-ca/auditor2-Defines carbonAccounting network for container connections-Optional: Include third certificate authority instance ca_auditor3' with similar configurations as others | + +
+ +
fabric.docker-compose-setup.docker.nodes.node-one + +| File | Summary | +| --- | --- | +| [docker-compose-couch.yaml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/docker/nodes/node-one/docker-compose-couch.yaml) | Configures a Docker Compose setup for CouchDB in the fabric directory of the blockchain-carbon-accounting repository. This setup includes an admin user and password, and optionally allows mapping the port to expose the CouchDB service, facilitating data storage and management within this decentralized application infrastructure. | +| [docker-compose-chaincode.yaml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/docker/nodes/node-one/docker-compose-chaincode.yaml) | This docker compose configuration sets up two chaincode containers (emissions1 and datalock1) for the blockchain-carbon-accounting system within the fabric repository. These containers utilize images provided by `zzocker20`, with their respective ports open for access to perform carbon accounting on a private Hyperledger Fabric network called carbonAccounting. The datalock container includes debug logging, providing traceability and accountability for recorded emissions data in the system. | +| [docker-compose-carbonAccounting.yaml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/docker/nodes/node-one/docker-compose-carbonAccounting.yaml) | Start peer1.auditor1.carbonAccounting.com with Hyperledger Fabric v2.4.3 on network carbonAccounting, exposing ports 7051 & 7052 for gossip and chaincode communication. Docker volumes for MSP, TLS certs, core config, state DB data, and production code are mapped accordingly. | +| [docker-compose-ca.yaml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/docker/nodes/node-one/docker-compose-ca.yaml) | The `docker-compose-ca.yaml` file within the fabric/docker-compose-setup directory initializes and sets up an auditor1 node on a Hyperledger Fabric network in the carbonAccounting network, using a securely configured CA server image with TLS enabled for certificate management. This is a key step towards establishing identity trust and managing digital assets for carbon accounting purposes in the overall blockchain application. | + +
+ +
fabric.docker-compose-setup.docker.nodes.node-two + +| File | Summary | +| --- | --- | +| [docker-compose-couch.yaml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/docker/nodes/node-two/docker-compose-couch.yaml) | The provided Docker Compose configuration for CouchDB in this file establishes an instance of CouchDB v3.1, offering scalable, high-performance NoSQL document storage and database management, pivotal to the data handling infrastructure within the blockchain carbon accounting project. | +| [docker-compose-chaincode.yaml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/docker/nodes/node-two/docker-compose-chaincode.yaml) | In the `docker-compose-chaincode.yaml` file within the fabric directory of this open-source blockchain-carbon-accounting project, we set up two containers (`chaincode-emissions2` and `chaincode-datalock2`) with associated images for executing chaincode components essential to data processing and storage for carbon emissions calculations. This architecture enables efficient data exchange between parties involved in carbon accounting. | +| [docker-compose-carbonAccounting.yaml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/docker/nodes/node-two/docker-compose-carbonAccounting.yaml) | It listens on 0.0.0.0:8051 and offers chaincode services on port 8052 (0.0.0.0:8052). Network communications are handled using TLS, with the associated CouchDB utilizing admin username/password for storage. | +| [docker-compose-ca.yaml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/docker/nodes/node-two/docker-compose-ca.yaml) | This docker compose file, situated in the Fabric directory, initializes and deploys an auditor node on the carbonAccounting network. The deployed node (`ca_auditor2`) utilizes Hyperledger Fabric CA version 1.4.9 for managing and securing identities, thereby enhancing the networks trustworthiness within this blockchain-based carbon accounting system. | + +
+ +
fabric.docker-compose-setup.docker.application + +| File | Summary | +| --- | --- | +| [docker-compose.yaml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/docker/application/docker-compose.yaml) | Configure a multi-container network containing an Oracle API, an API Server, Vault, WS-Identity, and an application (utilityemissions-api) for Carbon Accounting blockchain services. The environment utilizes docker sockets, S3 local storage, Ethereum JSON RPC, and HL Fabric connection. Set up vault secrets and enable IPC locks for secure data handling. | + +
+ +
fabric.docker-compose-setup.builders.external.bin + +| File | Summary | +| --- | --- | +| [detect](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/builders/external/bin/detect) | This script, located at `fabric/docker-compose-setup/builders/external/bin/detect`, is a utility determining whether a buildpack should be applied to a Hyperledger Fabric chaincode package. By parsing the `metadata.json` file within the supplied directories, it returns an exit code of 0 if the detected chaincode type is golang, triggering the application of the buildpack. If not, it returns an alternative exit code to bypass the buildpack application. This contributes to the efficient setup and deployment of custom chaincode within the project architecture. | +| [release](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/builders/external/bin/release) | In the Blockchain Carbon Accounting repository, this `fabric/docker-compose-setup/builders/external/bin/release` script serves to supply chaincode metadata to a peer for usage. This metadata is generated by a build process, placed in the designated BUILD_OUTPUT_DIR, and moved into RELEASE_OUTPUT_DIR for consumption by the peer. If TLS encryption is required, corresponding files are copied alongside the metadata files. The script exits gracefully with a success or failure status based on the presence of input artifacts. | +| [build](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/builders/external/bin/build) | This script automates the transformation of chaincode packages for a blockchain-carbon-accounting system into usable artifacts, placing the resulting files in an output directory for deployment and execution. It ensures required files such as `connection.json` are included and retained during build processes, while keeping source directories read-only. | + +
+ +
fabric.docker-compose-setup.fabric-config + +| File | Summary | +| --- | --- | +| [configtx-sample.yaml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/fabric-config/configtx-sample.yaml) | In the Blockchain Carbon Accounting repository, a crucial component is located under `app/api-oracle`. This code serves as an API oracle within the applications architecture, providing critical data required for the smooth operation of the platform. Specifically, the API Oracle interacts with various external services and databases to fetch essential carbon emission intensity data, utility usage statistics, and other relevant information for accurate carbon accounting.This data is vital in calculating the environmental footprint of various economic activities on the blockchain network. By leveraging the API Oracle, the overall application ensures transparency, accuracy, and traceability in tracking carbon emissions across industries within the European Economic Area (EEA) and beyond. The code in the `app/api-oracle` directory is a central piece of this open-source project that aims to contribute to mitigating climate change by fostering sustainable business practices on the blockchain. | +| [configtx-test-network.yaml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/fabric-config/configtx-test-network.yaml) | This configuration sets up a Hyperledger Fabric network with an orderer and two organizations. The orderer uses the server certificate from `example.com/orderer.example.com`. Batch size is configurable, with limits on message count, bytes allowed per batch, and preferred max bytes. Channel policies allow for reader, writer, admin roles, and block validation. Profiles are defined for a two-org orderer genesis and channel configuration, belonging to a consortium named `SampleConsortium`. This network requires appropriate organization setups for Org1 and Org2. | +| [configtx.yaml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/fabric-config/configtx.yaml) | Define the multi-organization channel and etcdRaft orderer settings. The consortium is named CarbonAccountingConsortium, utilizing orderers from auditor1 and auditor2 within the Channels read/write/admin policies. Capabilities follow ApplicationDefaults while organizing three profiles for multiple organizations: one for the channel, one for etcdRaft, and another for application defaults, incorporating auditor1 and auditor2. The consortium consists of three participating organizations, two currently enabled and one commented out. | +| [core.yaml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/fabric-config/core.yaml) | External API InteractionThe code interacts with external APIs to collect updated carbon emission data from various sectors, enabling accurate and timely accounting within the supply chain.2. **Data Management and ProcessingThe code manages and processes collected data from different sources to ensure consistency and correctness in calculating the total carbon footprint associated with each supply chain.3. **Integration with BlockchainBy collaborating seamlessly with the blockchain infrastructure within the application, it enables secure, transparent, and tamper-proof tracking of carbon accounting information across different supply chains.This architecture helps facilitate more environmentally responsible decision-making by businesses, allowing them to identify areas where they can reduce their carbon footprint and make more sustainable choices in their supply chain operations. | +| [orderer.yaml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/fabric-config/orderer.yaml) | The provided codebase, `blockchain-carbon-accounting`, is a sophisticated blockchain application aimed at carbon accounting within the Energy Efficiency Area (EEA). The repository consists of several folders including `app` and `data`, each housing various subfolders that support different functionalities.The primary focus of the code is to handle both the frontend and backend operations through modules such as `api-server`, `frontend`, and `api-oracle`. The `api-server` manages the API requests and responses, while `api-oracle` acts as a data source oracle for these requests.The `data` folder stores a range of files representing carbon emissions data, conversion factors, utility data, and other relevant information essential for calculating carbon emissions within the EEA from 2016 to the present (up to 2021). The data is sourced primarily from CSVs and Excel sheets.Overall, this project harnesses the power of blockchain technology in building an efficient and reliable system for calculating carbon emissions within the EEA, contributing positively towards addressing climate change on a global scale. While the technical implementation details are omitted here, this summary offers insight into the purpose and critical features of this codebase within its broader architecture. | + +
+ +
fabric.docker-compose-setup.chaincode.one + +| File | Summary | +| --- | --- | +| [connection.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/chaincode/one/connection.json) | The `fabric/docker-compose-setup/chaincode/one/connection.json` establishes the connection details for the chaincode instance running on carbonAccounting.com. This file includes vital certificate information, enabling seamless communication with the emissions-focused blockchain network within the overall system architecture. | +| [metadata.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/chaincode/one/metadata.json) | This file configures an external chaincode labeled emissions within the Fabric docker setup, playing a crucial role in managing emissions data as part of the overall blockchain carbon accounting system architecture. | + +
+ +
fabric.docker-compose-setup.chaincode.two + +| File | Summary | +| --- | --- | +| [connection.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/chaincode/two/connection.json) | This `chaincode connection configuration file` sets up a secure link between a client and the chaincode emissions2 running on the carbonAccounting.com network. It includes essential certificates for client authentication, enabling trusted data exchange within the blockchain-powered carbon accounting system. | +| [metadata.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/chaincode/two/metadata.json) | This JSON metadata file sets up an external chaincode named emissions within the Fabric network docker composition, essential for implementing carbon accounting functionalities within the blockchain application. | + +
+ +
fabric.docker-compose-setup.chaincode.datalockTwo + +| File | Summary | +| --- | --- | +| [connection.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/chaincode/datalockTwo/connection.json) | Establishes secure network connection for DatalockTwo chaincode on carbonAccounting.com with provided EC private key, client certificate, and root certificate within the docker-compose setup for Hyperledger Fabric deployment. | +| [metadata.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/chaincode/datalockTwo/metadata.json) | In this repository, the provided file `fabric/docker-compose-setup/chaincode/datalockTwo/metadata.json` configures data lock chaincode as an external type for Hyperledger Fabric deployment. This metadata definition aids in seamlessly integrating and managing data storage on the blockchain platform, enabling secure and tamper-proof carbon accounting. | + +
+ +
fabric.docker-compose-setup.chaincode.datalockOne + +| File | Summary | +| --- | --- | +| [connection.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/chaincode/datalockOne/connection.json) | It includes essential SSL certificates, enabling secure, authenticated communication with the network. This file ensures trust and reliable access in our blockchain-based carbon accounting system. | +| [metadata.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/chaincode/datalockOne/metadata.json) | In this Hyperledger Fabric repository, the `metadata.json` file within the `docker-compose-setup/chaincode/datalockOne/` directory is a configuration for an external data lock. It provides a label to reference the external data lock in the chaincode implementation. | + +
+ +
fabric.docker-compose-setup.scripts + +| File | Summary | +| --- | --- | +| [startExtChaincode.sh](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/scripts/startExtChaincode.sh) | Initializes Hyperledger Fabric network for Carbon Accounting application, connecting essential chaincode components such as `chaincode-emissions1`, `chaincode-emissions2`, `chaincode-datalock1` and `chaincode-datalock2`. Ensuring seamless interaction among them, the script readies the Fabric network for data exchange in the blockchain. | +| [envVar.sh](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/scripts/envVar.sh) | This script sets up connection parameters for a Fabric blockchain peer based on provided organization (auditor1, auditor2, or auditor3). It also offers verbose output for environment variables related to the CORE peers when called with the VERBOSE flag set to true. The provided code can be employed to quickly configure chaincode operations with ease. | +| [deployCC.sh](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/scripts/deployCC.sh) | The provided code file belongs to the `blockchain-carbon-accounting` repository, which is a software system designed for carbon accounting in blockchain networks with an emphasis on European Economic Area (EEA) regions.The specific file we're interested in is located under the app/methane/ directory and appears to be named after a function or feature-I can't tell exactly due to missing information about naming conventions.This piece of code contributes significantly to the Methane module within the application layer. The Methane module seems to be concerned with data related to methane emissions, which is one of several gases tracked for carbon accounting purposes. This particular implementation could handle operations such as processing input data, analyzing trends, or even calculating emissions footprints based on provided factors โ€“ all contributing towards a transparent and accurate blockchain-based carbon accounting system.Bear in mind that this is an overly simplified interpretation without the specific details of what exactly methane' stands for within this project. For a complete understanding, you're encouraged to explore the entire repository's architecture and documentation as well as participating in its active open-source community! | +| [startCA.sh](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/scripts/startCA.sh) | Initialize and configure Fabrics Certificate Authority (CA) network in carbonAccounting'. The script connects and sets up auditor1.carbonAccounting.com and auditor2.carbonAccounting.com. It is used during the initial setup of the blockchain-carbon-accounting network, ensuring secure communication and identity management. | +| [startNetwork.sh](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/scripts/startNetwork.sh) | Launches docker network for carbon accounting blockchain application. If a network with the same name already exists, script skips creation, ensuring only one instance per run. Crucial for a smooth functioning of multi-node networks. | +| [commitCCExt.sh](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/scripts/commitCCExt.sh) | Commit and query the Emissions Data and DataLock chaincodes on the specified channels using specified peer connections. This script initializes necessary environment variables, commits the chaincode on all participating peers, queries the committed chaincode results, and displays the output. This process ensures data integrity and verification within a Hyperledger Fabric network. | +| [deployCCExt.sh](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/scripts/deployCCExt.sh) | This script deploys a chaincode named emissions-data" and another named datalock to a Fabric network consisting of multiple peers belonging to two different organizations (auditor1 and auditor2). The deploy process involves several steps, including approval of the chaincode for the local organization, checking commit readiness, and eventual invocation.Additionally, the script takes input from command-line arguments, configures required environment variables, and manages orderer interaction. The deploy process is automated for both organizations in the specified network (auditor1 and auditor2) through a single executable file. | +| [invokeChaincode.sh](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/scripts/invokeChaincode.sh) | This Bash script sets up the invocation of a smart contract (emissions) on a Fabric channel (emissions-data). The function call, along with peer and organizational parameters, is passed as arguments to initiate a transaction on the selected peers. This script simplifies the process of executing chaincode functions across a blockchain network for recording and querying emissions data. | +| [fabricNetwork.sh](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/scripts/fabricNetwork.sh) | Initialize, stop, resume or reset Hyperledger Fabric network within Docker containers. This script provides control over development environments for a distributed application using fabric-ca, couchdb, carbon accounting chaincode, and additional components. | +| [startAndConnectNetwork.sh](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/scripts/startAndConnectNetwork.sh) | The script `fabric/docker-compose-setup/scripts/startAndConnectNetwork.sh` establishes and interconnects a Hyperledger Fabric network for the blockchain-carbon-accounting project, ensuring smooth communication among participating nodes in the carbon accounting system. | +| [startDynamo.sh](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/scripts/startDynamo.sh) | Launchs and maintains the local DynamoDB instance for the Carbon Accounting blockchain network, ensuring data persistence and compatibility with the deployed applications. | +| [startCli.sh](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/scripts/startCli.sh) | Launch and configure CLI container on defined network with given environment variables for peer connections, volume mounts for contract code and go tools, and set working directory for execution. The container will run continuously allowing interaction with the network using standard golang commands. | +| [startApi.sh](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/scripts/startApi.sh) | This script, `fabric/docker-compose-setup/scripts/startApi.sh`, initiates the Carbon Accounting application within different environments. In local mode, it sets up Vault, WS-Identity, Oracle Server, API Server, and builds TypeScript components before starting them. The docker mode configures all components using a Docker container network. The usage is flexible for both local development/testing and production deployment scenarios. | +| [installChaincode.sh](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/scripts/installChaincode.sh) | This script sets up a Hyperledger Fabric network for an emissions data chaincode named emissionscontract. The network is initialized with two peers and organizations using the provided configuration files. After installation, the script deploys the specified emissions contract along with its associated datalock contract to all participating nodes. | +| [queryChaincode.sh](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/scripts/queryChaincode.sh) | This script automates the query process for the designated emissions-data channel on Hyperledger Fabric peer networks, allowing the application to gather essential data from the blockchain. | +| [reset.sh](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/scripts/reset.sh) | This script initiates the reset process for the Hyperledger Fabric network setup. It shuts down running containers, erases data stored in volumes, purges unused Docker volumes, and removes built artifacts within the typescript_app directory. This enables a fresh network environment for development and testing. | +| [createChannel.sh](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/scripts/createChannel.sh) | The script creates a Hyperledger Fabric channel, named $CHANNEL_NAME. It first creates a channel artifact ($CHANNEL_NAME.tx), then joins all peers to the channel using their corresponding orderer and CA files. Next, it updates anchor peers for each organization (1 and 2). Finally, it verifies successful execution of commands and outputs relevant messages. If the script fails after retry attempts, an error message will be displayed and the program terminates with exit code 1. The channel creation process ensures secure and orderly data exchange within this Fabric network. | + +
+ +
fabric.docker-compose-setup.scripts.deploy + +| File | Summary | +| --- | --- | +| [install-docker.sh](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/scripts/deploy/install-docker.sh) | The provided script file (fabric/docker-compose-setup/scripts/deploy/install-docker.sh) automates the installation of Docker and Docker Compose on an Ubuntu system. This crucial toolchain setup allows for the easy deployment and management of the blockchain and carbon accounting applications in the parent repository. | + +
+ +
fabric.docker-compose-setup.scripts.deploy.node-one + +| File | Summary | +| --- | --- | +| [deployCC.sh](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/scripts/deploy/node-one/deployCC.sh) | This script deploys a Hyperledger Fabric chaincode (smart contract) within the network, expediting its implementation for an efficient blockchain-based carbon accounting system. | +| [startCA.sh](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/scripts/deploy/node-one/startCA.sh) | Launches the Certification Authority node within a Hyperledger Fabric network, named carbonAccounting. The script connects the CA node with another identified as auditor1.carbonAccounting.com, thus initializing the network's trust foundation for carbon accounting transactions. | +| [generateCryptoCreateOrgs.sh](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/scripts/deploy/node-one/generateCryptoCreateOrgs.sh) | The script located at `fabric/docker-compose-setup/scripts/deploy/node-one/generateCryptoCreateOrgs.sh` serves to set up Hyperledger Fabrics network by deploying and generating cryptographic identities and organization definitions. This process is essential for the proper functioning of a secure, blockchain-based carbon accounting system within this project architecture. | +| [startAndConnectNetwork.sh](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/scripts/deploy/node-one/startAndConnectNetwork.sh) | In this script located under fabric/docker-compose-setup/scripts/deploy/node-one, the setup is initialized to launch orderers, peers, and CouchDB nodes, ensuring a functioning blockchain carbon accounting network. | +| [startApi.sh](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/scripts/deploy/node-one/startApi.sh) | The script located at `fabric/docker-compose-setup/scripts/deploy/node-one/startApi.sh` initiates the starting of the API within the node-one environment in our Hyperledger Fabric setup, contributing to the seamless execution of our blockchain carbon accounting system. | +| [start.sh](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/scripts/deploy/node-one/start.sh) | Initializes the carbonAccounting blockchain network by deploying and starting CAs (Certification Authorities) and client nodes within the given fabric repository, thereby enabling carbon accounting applications to function on the network. | +| [createChannel.sh](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/scripts/deploy/node-one/createChannel.sh) | In this Hyperledger Fabric-powered project, `createChannel.sh` script initiates channel establishment between peer nodes by executing the createChannel function using `docker exec`. This script is essential for creating and managing shared channels within the supply chain network. | + +
+ +
fabric.docker-compose-setup.scripts.deploy.node-two + +| File | Summary | +| --- | --- | +| [startCA.sh](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/scripts/deploy/node-two/startCA.sh) | Initializes a Fabric Certificate Authority (CA) node within the carbonAccounting network, allowing for secure identity management in our blockchain-based carbon accounting solution. It ensures robust, tamper-resistant interactions by establishing a trusted environment for all participants. | +| [startAndConnectNetwork.sh](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/scripts/deploy/node-two/startAndConnectNetwork.sh) | Deploys and connects essential network components within the `carbonAccounting` blockchain for a specific node, namely `node-two`. Includes orderers, peers, and CouchDB, linking them to the respective orderer1, peer1, and couchdb1 networks. This script orchestrates the initialization of a key blockchain node within our broader architecture. | +| [start.sh](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/scripts/deploy/node-two/start.sh) | This script initializes and deploys Certificate Authorities (CAs) within the blockchain-carbon-accounting repository for secure identity management and decentralized applications deployment on the Hyperledger Fabric network. | + +
+ +
fabric.docker-compose-setup.scripts.ansible.vagrant + +| File | Summary | +| --- | --- | +| [reset-playbook.yml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/scripts/ansible/vagrant/reset-playbook.yml) | Resets docker network setup for emissions data using Ansible playbook, located in `fabric/docker-compose-setup/scripts/ansible/vagrant/reset-playbook.yml`. It initiates the fabricNetwork script from the specified directory to recreate the docker configuration and apply required changes for emissions data. | +| [Vagrantfile](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/scripts/ansible/vagrant/Vagrantfile) | This Vagrantfile within the blockchain-carbon-accounting repository sets up and configures virtual machines using Vagrant, with a specified Ansible playbook for provisioning. It ensures two servers named ServerA and ServerB are set up, each with different memory configurations, and provisioned using Ansible upon startup of the last server. This setup is instrumental in automating and simplifying the deployment process of related resources within the blockchain-carbon-accounting system. | +| [provision-playbook.yml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/scripts/ansible/vagrant/provision-playbook.yml) | Install Docker, Git, AWS config & network, and pull openTAPSs blockchain-carbon-accounting project on Ubuntu with Docker Compose using Ansible. Configures Docker network to advertise IP via eth1 for swarm init. AWS config values replaced with actual keys stored in env vars (AWS_ACCESS_KEY_ID & AWS_SECRET_ACCESS_KEY). | +| [setup-playbook.yml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/docker-compose-setup/scripts/ansible/vagrant/setup-playbook.yml) | Copies Genesis block and necessary folders from Server A to Server B (`server2`). Starts and connects the network on Server B, then transfers CA certificates to Server A (`server1`). Simultaneously, runs startup scripts for networks on both servers, setting up organizations directories. Finally, initiates channel creation and custom contract deployment processes on Server A, preparing a functional blockchain setup on both machines. | + +
+ +
fabric.minikube-setup.configs + +| File | Summary | +| --- | --- | +| [persistent-volume.yaml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/minikube-setup/configs/persistent-volume.yaml) | Configures a Persistent Volume named utility-emissions-persistent-volume for 5 GiB storage on the Minikube environment, utilizing `/tmp/data` as the host path for accessible read and write operations in the Blockchain Carbon Accounting project's Fabric setup. | + +
+ +
fabric.minikube-setup.configs.auditor1 + +| File | Summary | +| --- | --- | +| [vault.yaml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/minikube-setup/configs/auditor1/vault.yaml) | This YAML file configures essential components within the Kubernetes cluster of the blockchain-carbon-accounting repository. It establishes a headless service (vault) for internal API and RPC connections, as well as an external service (vault-ui) for accessing the Vault UI, facilitating interaction with the auditor1 namespace in the platform. | +| [namespace.yaml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/minikube-setup/configs/auditor1/namespace.yaml) | In the Blockchain Carbon Accounting project, this YAML configuration (`fabric/minikube-setup/configs/auditor1/namespace.yaml`) creates a Kubernetes namespace named auditor1. This namespace serves as an organizational boundary in the auditor's environment, isolating its resources and facilitating efficient resource management within the larger cluster. | + +
+ +
fabric.minikube-setup.configs.auditor2 + +| File | Summary | +| --- | --- | +| [vault.yaml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/minikube-setup/configs/auditor2/vault.yaml) | Deploys and configures Kubernetes services for the Vault UI (port 8200) and the Vault server (API endpoint on port 8200, RPC endpoint on port 8201). PersistentVolumeClaim ensures storage for the Vault data with a 500Mi limit. StatefulSet deploys two replicas of the Vault server. | +| [namespace.yaml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/minikube-setup/configs/auditor2/namespace.yaml) | Configures namespace auditor2 for Minikube setup within Kubernetes environment. This allows smooth deployment and management of auditor applications related to the blockchain carbon accounting system. | + +
+ +
fabric.aws-kubernetes + +| File | Summary | +| --- | --- | +| [emissions-api-deployment.yaml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/aws-kubernetes/emissions-api-deployment.yaml) | In this Kubernetes deployment file (`emissions-api-deployment.yaml`), the emissions API is set up as a PersistentVolume and PersistentVolumeClaim, allocating 5 GiB of storage as a gp2 volume in AWS EBS. This deployment configuration also sets up a container, specifying environment variables, port, and volume mounts for accessing the required data and settings in an AWS environment. | +| [emissions-api-service.yaml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/aws-kubernetes/emissions-api-service.yaml) | Deploys an Amazon Web Services Network Load Balancer service for the emissions-api application within the `fabric-production` namespace, securing traffic through SSL and directing HTTP/HTTPS requests to port 9000 in the application. The service is accessible via the IP address x.x.x.x/32. | +| [Dockerfile](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/aws-kubernetes/Dockerfile) | The `Dockerfile` in this blockchain-carbon-accounting repository builds a container using NodeJS version 14. It prepares the environment for Python3, Make, and G++ and installs essential packages such as npm, nodemon, serverless, typescript, mocha, and additional dependencies required by the projects TypeScript application, running its build process and setting the container to start on port 9000 upon deployment. | + +
+ +
fabric.aws-kubernetes.ccp-generate + +| File | Summary | +| --- | --- | +| [ccp-generate.sh](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/aws-kubernetes/ccp-generate/ccp-generate.sh) | Prepare necessary peer, ca, and orderer PEM files.2. Update the templates ccp-template.json or ccp-template.yaml with provided details.3. Run script to produce JSON or YAML connection profile.4. Store produced connection file as connection-opentaps.json'. | +| [ccp-template.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/aws-kubernetes/ccp-generate/ccp-template.json) | This `ccp-template.json` configures the architecture for a specific organization (e.g., emissions${ORG}) within a Hyperledger Fabric network. It establishes connection settings, organization details, peers, certificate authorities, and orderers across multiple nodes, promoting secure and efficient interactions in the blockchain carbon accounting system. | + +
+ +
fabric.multi-cloud-deployment + +| File | Summary | +| --- | --- | +| [deployCC.sh](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/multi-cloud-deployment/deployCC.sh) | Deploys chaincode (marbles) onto the emissions-data channel in a multi-cloud fabric network, adhering to the lifecycle process including approval, readiness check, commitment, and query of committed state. | +| [setEnv.sh](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/multi-cloud-deployment/setEnv.sh) | In this `fabric/multi-cloud-deployment/setEnv.sh` file, environment variables are being configured for operation with a blockchain network using the binary tools of the peer and orderer. These variables set paths to SSL certificates, MSP config files, and addresses of peer and orderer nodes for easy deployment on the emissions accounting network. | +| [registerEnroll.sh](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/multi-cloud-deployment/registerEnroll.sh) | Fabric-ca client enrolls the orderer node with fabric-ca* The generated TLS certificate is saved as server.crt, ca.crt, and server.key in designated directory* Orderer admin is registered with fabric-ca* Admin msp files are generated and organized accordingly | + +
+ +
fabric.multi-cloud-deployment.deploy-aws + +| File | Summary | +| --- | --- | +| [deployCC.sh](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/multi-cloud-deployment/deploy-aws/deployCC.sh) | Approve, check readiness, commit, and query committed state. This script is instrumental in implementing the emissions tracking smart contract for the blockchain carbon accounting system. | +| [setEnv.sh](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/multi-cloud-deployment/deploy-aws/setEnv.sh) | The provided `setEnv.sh` script prepares environment variables for a multi-cloud Fabric deployment on AWS by defining crucial network configurations and certificates to successfully operate peer and orderer binaries within the Blockchain Carbon Accounting system. | +| [namespace-fabric-production.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/multi-cloud-deployment/deploy-aws/namespace-fabric-production.json) | In this repository, the `fabric/multi-cloud-deployment/deploy-aws/namespace-fabric-production.json` file creates and manages a Kubernetes namespace (fabric-production) for Amazon Web Services (AWS), vital for multi-cloud deployment of our blockchain carbon accounting platform. This allows us to efficiently scale our operations on the AWS cloud. | +| [external-chaincode-builder-config.yaml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/multi-cloud-deployment/deploy-aws/external-chaincode-builder-config.yaml) | AppThis directory houses the core functionalities of the application. It includes the API server (api-server), frontend, methane (for data processing), supply-chain management, and reports. Each component plays a critical role in delivering carbon accounting services in a blockchain context.2. **DataThis directory contains all the necessary data files required for carbon accounting. These include emission intensity data, utility data, and proxies data for different years (from 2016 to current year) in various file formats (csv, xls, xlsx). Additionally, there is conversion factors data needed for calculating carbon emissions.In simple terms, this codebase aims to create a decentralized and transparent system for managing carbon accounting, providing essential insights into greenhouse gas emission intensities and contributing towards reducing carbon footprints in an effective manner within a blockchain environment. By utilizing various APIs, frontend, data processing modules, and supply-chain management tools, it enables stakeholders to accurately track and account for their carbon emissions. | +| [registerEnroll.sh](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/multi-cloud-deployment/deploy-aws/registerEnroll.sh) | Enroll with Fabric CA Client using specified domain details.-Copy enrolled files to their respective directories.-Register org admin credentials and generate admin's MSP (Membership Services Provider).-Move admin's private key to a specific name for better organization.Create crypto materials:-Ready to create the necessary cryptographic materials for orderer and admin. | +| [fabric-ca-deployment.yaml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/multi-cloud-deployment/deploy-aws/fabric-ca-deployment.yaml) | In this repository, a Kubernetes service definition (fabric/multi-cloud-deployment/deploy-aws/fabric-ca-deployment.yaml) is provided to deploy Fabric CA on AWS fabric-production namespace. This setup includes a ClusterIP Service for accessing the Fabric CA server at port 7054 and an additional port 9443 for secure communication, along with persistent storage using PersistentVolume (1GB) and PersistentVolumeClaim resources. | +| [remove_all.sh](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/multi-cloud-deployment/deploy-aws/remove_all.sh) | This script actively purges deployments across various AWS Kubernetes namespaces for the Hyperledger Fabric blockchain application in the multi-cloud-deployment directory. By executing this, it clears existing Kubernetes objects such as deployment files, configuration maps, secrets and more, making way for fresh setups within the fabric-production namespace. | +| [kubernetes-ingress-controller-deploy.yaml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/multi-cloud-deployment/deploy-aws/kubernetes-ingress-controller-deploy.yaml) | Data management: Handling large sets of emission data, including historical emissions from 2016-2019 and utility data from 2019, for processing and analysis.2. APIs for interaction: Offering endpoints that allow for the querying, submission, and manipulation of carbon emissions data. This supports interactions with both internal components (frontend, supply chain) and potential external applications or services.3. Compliance with coding standards: Following best practices by using ESLint for adhering to a consistent code style.This blockchain-carbon-accounting project seeks to provide an accessible and transparent platform for tracking and reporting carbon emissions, helping stakeholders make more informed decisions about reducing their environmental impact in the EETS marketplace. | +| [ingress-fabric-services-deploy.yaml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/multi-cloud-deployment/deploy-aws/ingress-fabric-services-deploy.yaml) | Deploys an Nginx-managed Ingress for the Fabric blockchain network services. It directs incoming traffic to the Fabric CA (7054), peer nodes (7051), and orderer nodes (7050) in the `fabric-production` Kubernetes namespace, ensuring secure and efficient service communication in the multi-cloud deployment environment. | +| [fabric-peer-deployment.yaml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/multi-cloud-deployment/deploy-aws/fabric-peer-deployment.yaml) | Mount OpenSolarxAnchors artifact: /etc/hyperledger/fabric/channel-artifacts/opensolarxanchors.tx 2. Install emissions-data artifact: /etc/hyperledger/fabric/channel-artifacts/emissions-data.tx 3. Set production data for the peer: /var/hyperledger/production 4. Import peer and related fabric codebase: /opt/gopath/src/github.com/hyperledger/fabric/peer 5. Mount crypto-material: /etc/hyperledger/fabric/crypto-material 6. Set up the external chaincode builder with core, build, and release tools. 7. Initiate CouchDB on ports 5984, 4369, 9100, secured by admin/ahtei0loox3O. 8. Extract and mount crypto-config from /etc/peer-secret-tgz to /etc/hyperledger/fabric/crypto-material | +| [fabric-orderer-deployment.yaml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/multi-cloud-deployment/deploy-aws/fabric-orderer-deployment.yaml) | Sets IP (0.0.0.0), Port (7050), Genesis File Location, Local MSPID (opensolarx), Local MSPDir, TLS options (enabled with private key/certificate paths and root CA). Listens on 8443 for operations and uses Prometheus metrics provider. Mounts genesis block, crypto-material and production volumes, plus an init container to extract/mount crypto files from a secret volume. | + +
+ +
fabric.multi-cloud-deployment.deploy-aws.fabric-config + +| File | Summary | +| --- | --- | +| [fabric-ca-server-config.yaml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/multi-cloud-deployment/deploy-aws/fabric-config/fabric-ca-server-config.yaml) | Set version to 1.4.9 2. Enable TLS 3. Specify CA name, DB type (sqlite3) and datasource location 4. Define admin identity with permissions as Registrar and IntermediateCA roles 5. Configure CSR details and BCCSP settings 6. Set signing profiles for digital signature and TLS 7. Store keys in file keystore located at msp/keystore 8. Additional requirements: avoid using words like This file" and keep the response concise, impactful, and 50 words or fewer. | +| [configtx.yaml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/multi-cloud-deployment/deploy-aws/fabric-config/configtx.yaml) | Configures an EtcdRaft-based orderer node (fabric-orderer.opensolarx.com) for the CarbonAccountingConsortium consortium with specific policies, capabilities, and profiles defined for multiple organizations. This setup supports multi-node communication using etcdraft consensus mechanism. | +| [core.yaml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/multi-cloud-deployment/deploy-aws/fabric-config/core.yaml) | Api-server`, `frontend`, `methane`, `reports`, `scripts`, and `supply-chain`. These modules work together to facilitate data processing, user interface, data analysis, automation of tasks, and managing the supply chain, respectively.The `data` directory contains various data files that include carbon emissions intensity data, utility usage data, and conversion factors, all essential for the system's accurate calculations and analysis.In summary, this codebase leverages a blockchain to build a comprehensive, user-friendly platform for carbon accounting within the EEA, enabling effective tracking, verification, and reduction of carbon emissions across various supply chain entities. | +| [orderer.yaml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/multi-cloud-deployment/deploy-aws/fabric-config/orderer.yaml) | The code file under review, located within the `blockchain-carbon-accounting/app/scripts/generate_reports.js`, is a core component in the larger `blockchain-carbon-accounting` repository. This script primarily serves the purpose of generating comprehensive reports by processing and analyzing data related to carbon emissions and energy utilization.In the broader context, the codefile integrates seamlessly with other modules within the app directory such as the api-server, frontend, and supply-chain. Together, they form a dynamic system designed for carbon accounting within various industrial sectors.The reports generated by this script are crucial for understanding carbon emissions and their impact across different areas within the supply chain. By analyzing data from utility companies, conversion factors, and other sources (found in directories like data'), it contributes to accurate carbon accounting and enhances transparency throughout the ecosystem. | + +
+ +
fabric.multi-cloud-deployment.deploy-aws.chaincode + +| File | Summary | +| --- | --- | +| [go.mod](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/multi-cloud-deployment/deploy-aws/chaincode/go.mod) | This Go module file (`fabric/multi-cloud-deployment/chaincode/go.mod`) in the blockchain-carbon-accounting repository specifies and manages dependencies for a multi-cloud deployment of smart contracts on Hyperledger Fabrics Go language environment, contributing to a secure and efficient carbon accounting system across diverse cloud platforms. | +| [Dockerfile](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/multi-cloud-deployment/deploy-aws/chaincode/Dockerfile) | This Dockerfile within the fabric/multi-cloud-deployment directory orchestrates the deployment of a Golang microservice for the Degree blockchain chaincode. It facilitates the construction and production-readiness of this service, enabling it to run smoothly on AWS environments by adhering to a defined workflow. | +| [go.sum](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/multi-cloud-deployment/deploy-aws/chaincode/go.sum) | Data integrity-ensures accurate and reliable data through cryptographic algorithms for securing transactions, maintaining immutability, and protecting against unauthorized modifications or double-spending.2. Decentralization-leverages blockchain technology to enable a distributed and transparent network that allows for trustless peer-to-peer interactions without intermediaries.3. Scalability-designed with scalable algorithms in mind to handle increasing volumes of transactions efficiently while maintaining the speed and reliability required by users of the global carbon market.4. Compliance-adheres to international standards and regulations for carbon markets, allowing organizations using the system to meet their sustainability commitments and regulatory obligations. | +| [marbles02.go](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/multi-cloud-deployment/deploy-aws/chaincode/marbles02.go) | This code file resides in the `blockchain-carbon-accounting` repository, specifically within the `app/methane` folder. Its position suggests a role related to the application logic layer of this blockchain-based carbon accounting system.The main purpose of this code file is to handle and process data related to methane emissions. It is instrumental in ensuring the accuracy and completeness of emission reports, which is essential for the transparent accounting of carbon footprints within the supply chain managed by the system. By working with various CSV and Excel files containing emission intensity and utility data, this file facilitates the necessary computations to provide actionable insights about carbon emissions arising from methane sources. | + +
+ +
fabric.multi-cloud-deployment.deploy-aws.chaincode.packaging + +| File | Summary | +| --- | --- | +| [connection.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/multi-cloud-deployment/deploy-aws/chaincode/packaging/connection.json) | In this blockchain-carbon-accounting repository, the `fabric/multi-cloud-deployment/deploy-aws/chaincode/packaging/connection.json` file stores the configuration for securely connecting to a fabric network. It provides essential details like address, dial timeout, and client certificates, ensuring seamless communication between peer nodes and chaincode instances. | +| [metadata.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/multi-cloud-deployment/deploy-aws/chaincode/packaging/metadata.json) | In this Fabric blockchain repository, a JSON metadata file named `metadata.json` resides under the `multi-cloud-deployment/deploy-aws/chaincode/packaging` folder. This file defines crucial information for an external type of chaincode artifact, labeled as marbles. By specifying such metadata, this project prepares the groundwork to deploy its blockchain solutions across various cloud environments efficiently. | + +
+ +
fabric.multi-cloud-deployment.deploy-aws.chaincode.deploy + +| File | Summary | +| --- | --- | +| [chaincode-deployment.yaml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/multi-cloud-deployment/deploy-aws/chaincode/deploy/chaincode-deployment.yaml) | | + +
+ +
fabric.multi-cloud-deployment.deploy-aws.scripts + +| File | Summary | +| --- | --- | +| [invokeChaincode.sh](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/multi-cloud-deployment/deploy-aws/scripts/invokeChaincode.sh) | Deploys Fabric chaincode emissions onto channel emissions-data across two peer nodes, invoking specific functions as required using set env variables. Facilitates execution and communication in this multi-cloud blockchain deployment. | + +
+ +
fabric.multi-cloud-deployment.fabric-config + +| File | Summary | +| --- | --- | +| [fabric-ca-server-config.yaml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/multi-cloud-deployment/fabric-config/fabric-ca-server-config.yaml) | Version 1.4.9; SSL/TLS enabled; SQLite database, no LDAP integration; Customizable admin credentials (ca-admin-password); Support for CA, client, intermediates identities, and delegated roles; Variety of digital signatures and certificates expiry times. | +| [configtx.yaml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/multi-cloud-deployment/fabric-config/configtx.yaml) | Configures an EtcdRaft orderer within the EmissionsAccounting sample organization with specified certificate and tick intervals. Multiple organizations (e.g., auditor2, auditor3) are not included as orderers but can potentially connect as clients in the future. The Channel settings apply implicit meta-based policy rules for Readers, Writers, Admins, BlockValidation, Capabilities, and Consortium association with CarbonAccountingConsortium. | +| [core.yaml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/multi-cloud-deployment/fabric-config/core.yaml) | In the `blockchain-carbon-accounting` repository, we find a well-structured architecture with several key components designed for carbon accounting using blockchain technology. The focus of this specific code file is on the scripts" folder under the app directory.This script functions as the core data processing and automation module. It reads and processes large datasets related to energy consumption, conversion factors, and CO2 emission intensities. By utilizing these inputs, the scripts compute carbon emissions for different entities based on their energy use and the associated carbon intensity of each energy source.Additionally, this script interacts with other components like the `api-server`, `api-oracle`, and `supply-chain`. The interaction with the API server enables communication between our system and external APIs for obtaining necessary data, while the connection to the supply chain ensures the emission records are securely recorded in a distributed ledger using blockchain technology.The overall goal of this architecture is to create a comprehensive, transparent, and tamper-proof carbon accounting system that helps stakeholders manage and reduce their carbon footprint effectively by providing detailed insights into energy usage and associated carbon emissions. | +| [orderer.yaml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/multi-cloud-deployment/fabric-config/orderer.yaml) | The code file in question resides within the blockchain-carbon-accounting' repository, focusing on tracking and reducing carbon emissions by integrating a blockchain-based system for accounting purposes. It is located in the app/api-server directory which houses the main server application.In this particular code file, you will find the implementation of an essential module that facilitates the communication between the API server and external data sources referred to as oracles. By connecting the server to these data sources, it gathers critical information required for calculating carbon emissions, such as electricity consumption data, emission intensities from electricity generation, and other relevant conversion factors.This module plays a vital role in ensuring accurate and timely calculations that form the backbone of the entire blockchain-carbon-accounting application. Additionally, it aligns with the overall goal of promoting transparency, efficiency, and sustainability in the process of carbon accounting. | + +
+ +
fabric.multi-cloud-deployment.chaincode + +| File | Summary | +| --- | --- | +| [go.mod](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/multi-cloud-deployment/chaincode/go.mod) | Deploys Go-based chaincode for multi-cloud Fabric networks, leveraging third-party packages including those by Hyperledger and Google Protocol Buffers for protocol implementations and interoperability across various systems. | +| [Dockerfile](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/multi-cloud-deployment/chaincode/Dockerfile) | The Dockerfile in this repository facilitates building and deploying a production-ready container image with ease. By leveraging Alpine Linux as base and packing the Go application, it ensures an efficient deployment of the chaincode. | +| [go.sum](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/multi-cloud-deployment/chaincode/go.sum) | TransactionsThe primary focus is handling carbon-related transaction data, which can include emission offsets, verification records, or other relevant carbon accounting information.2. **Blockchain InteractionEnabling seamless integration with a chosen blockchain platform allows for secure, distributed storage of transactions and traceability of carbon-emission records.3. **Smart Contract IntegrationUtilizing smart contracts within the blockchain network to automate the execution of specific tasks, such as transferring emission rights or enforcing compliance rules based on predefined criteria.4. **API ConnectivityBuilding an API layer for seamless interaction between carbon accounting systems and third-party applications, allowing developers to create new services or leverage existing ones within this ecosystem.5. **Data VisualizationEmpowering users to visualize carbon transaction data in meaningful and actionable ways, providing insights into overall carbon emission levels and the impact of individual transactions.6. **Decentralized TrustLeveraging the decentralized nature of blockchain technology to build a secure and trustworthy system, reducing reliance on centralized authorities and fostering greater transparency in carbon accounting processes.7. **Open-sourceMaking the codebase openly available | +| [marbles02.go](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/multi-cloud-deployment/chaincode/marbles02.go) | In the Blockchain Carbon Accounting repository, a significant portion of the codebase is organized in an app directory with various subdirectories for different components such as api-oracle, api-server, frontend, methane, reports, scripts, and supply-chain. This architecture suggests that the application has several distinct services for different functionalities including oracle, server, user interface, carbon accounting tools (e.g., methane), data reporting, scripts, and blockchain-related operations in the supply chain component.The data directory appears to hold CSV files and Excel spreadsheets that likely represent emissions data, conversion factors, utility data, or other critical information required for carbon accounting purposes. This highlights the data-driven nature of the application, where precise data management is crucial for its functioning.Among these folders, we will be focusing on `app/reports/generate_emission_report.js`. This JavaScript file seems to serve a vital role within the Blockchain Carbon Accounting system, as it presumably generates an emissions report by compiling and processing data from different sources. The critical features of this code include handling data extraction, calculations based on conversion factors or other input parameters, and generating output in the appropriate format, which could be an HTML report, PDF, or even CSV files. The emissions report likely serves as a critical artifact for carbon accounting purposes, helping organizations track their greenhouse gas (GHG) emissions and contribute to environmental sustainability initiatives. | + +
+ +
fabric.multi-cloud-deployment.chaincode.packaging + +| File | Summary | +| --- | --- | +| [connection.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/multi-cloud-deployment/chaincode/packaging/connection.json) | This JSON file configures connection parameters for a Hyperledger Fabric chaincode, named marbles. The configuration includes the connection address, dial timeout, TLS requirement status, and certificates for client and root authentication. This setup streamlines secure communication and interaction with the blockchain network. | +| [metadata.json](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/multi-cloud-deployment/chaincode/packaging/metadata.json) | Deploys and manages chaincode packages, marked as external and labeled marbles, across multiple cloud platforms within the blockchain-carbon-accounting project's Hyperledger Fabric architecture. | + +
+ +
fabric.multi-cloud-deployment.chaincode.deploy + +| File | Summary | +| --- | --- | +| [chaincode-deployment.yaml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/multi-cloud-deployment/chaincode/deploy/chaincode-deployment.yaml) | This YAML configuration file deploys a chaincode (marbles) on a blockchain network via Kubernetes, ensuring its seamless integration within the multi-cloud infrastructure of the repositorys blockchain-carbon-accounting system. | + +
+ +
fabric.multi-cloud-deployment.network-artifacts + +| File | Summary | +| --- | --- | +| [configtx.yaml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/multi-cloud-deployment/network-artifacts/configtx.yaml) | The configuration establishes an orderer with etcdraft consensus mechanism for multiple organizations (Emitras, OpenTaps, OpenSolarx). It defines a channel CarbonAccountingConsortium, where each organization has read, write, and admin access, following majority endorsement rule. The channel capabilities enable the application to function as per defined. This setup enables collaboration between the organizations for efficient carbon accounting operations. | + +
+ +
fabric.multi-cloud-deployment.network-artifacts.organizations.opensolarx.orderers.fabric-orderer.opensolarx.com.tls + +| File | Summary | +| --- | --- | +| [server.crt](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/multi-cloud-deployment/network-artifacts/organizations/opensolarx/orderers/fabric-orderer.opensolarx.com/tls/server.crt) | Verify the provided X.509 certificate is correct and trustworthy by comparing its issuer, serial number, and expiration date against known trusted CAs or the expected configuration of your network. This step is crucial to maintain security and ensure proper communication between peers. | + +
+ +
fabric.multi-cloud-deployment.network-artifacts.organizations.opensolarx.msp + +| File | Summary | +| --- | --- | +| [config.yaml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/multi-cloud-deployment/network-artifacts/organizations/opensolarx/msp/config.yaml) | The configuration file in `fabric/multi-cloud-deployment/network-artifacts/organizations/opensolarx/msp/config.yaml` sets up the organizational units within the OpenSolarx network, defining client, peer, admin, orderer roles, and their associated certificates for secure communication and access management. This fosters a structured identity system in the multi-cloud deployment of our blockchain carbon accounting platform. | + +
+ +
fabric.multi-cloud-deployment.network-artifacts.organizations.opensolarx.msp.tlscacerts + +| File | Summary | +| --- | --- | +| [ca.crt](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/multi-cloud-deployment/network-artifacts/organizations/opensolarx/msp/tlscacerts/ca.crt) | In this Fabric projects architecture, the `ca.crt` certificate file plays a crucial role as a trusted root for communication within the openSolarX organizations blockchain network. It verifies and encrypts sensitive data exchanged among members, ensuring secure transactions in our multi-cloud blockchain deployment. | + +
+ +
fabric.multi-cloud-deployment.network-artifacts.organizations.opentaps.orderers.fabric-orderer.opentaps.net.tls + +| File | Summary | +| --- | --- | +| [server.crt](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/multi-cloud-deployment/network-artifacts/organizations/opentaps/orderers/fabric-orderer.opentaps.net/tls/server.crt) | Verify public key for fabric-orderer.opentaps.net using provided SSL/TLS server certificate. This encryption is necessary to ensure secure communication on the network. | + +
+ +
fabric.multi-cloud-deployment.network-artifacts.organizations.opentaps.msp + +| File | Summary | +| --- | --- | +| [config.yaml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/multi-cloud-deployment/network-artifacts/organizations/opentaps/msp/config.yaml) | Configures the organization structure for OpenTaps network in Fabric multi-cloud deployment, defining separate Client, Peer, Admin, Orderer Organizational Units with certificate from fabric-ca-opentaps-net. The setting enables the configuration of these distinct roles within the distributed ledger system. | + +
+ +
fabric.multi-cloud-deployment.network-artifacts.organizations.opentaps.msp.tlscacerts + +| File | Summary | +| --- | --- | +| [ca.crt](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/multi-cloud-deployment/network-artifacts/organizations/opentaps/msp/tlscacerts/ca.crt) | This file contains the root Certificate Authority (CA) certificate for the OpenTAPS organization in a multi-cloud Hyperledger Fabric network deployment, serving as the foundation for secure identity management within the blockchain ecosystem. | + +
+ +
fabric.multi-cloud-deployment.network-artifacts.organizations.emitras.orderers.fabric-orderer1.emissionsaccounting.emitras.de.tls + +| File | Summary | +| --- | --- | +| [server.crt](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/multi-cloud-deployment/network-artifacts/organizations/emitras/orderers/fabric-orderer1.emissionsaccounting.emitras.de/tls/server.crt) | Verify the provided SSL Certificate authenticity by examining its digital signature and certificate chain. This encryption ensures secure connection between client and server. | + +
+ +
fabric.multi-cloud-deployment.network-artifacts.organizations.emitras.msp + +| File | Summary | +| --- | --- | +| [config.yaml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/multi-cloud-deployment/network-artifacts/organizations/emitras/msp/config.yaml) | Client, peer, admin, or orderer. This configuration is used to organize and control access in the Emissions Accounting Fabric network. | + +
+ +
fabric.multi-cloud-deployment.network-artifacts.organizations.emitras.msp.tlscacerts + +| File | Summary | +| --- | --- | +| [ca.crt](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/multi-cloud-deployment/network-artifacts/organizations/emitras/msp/tlscacerts/ca.crt) | In this blockchain-carbon-accounting repository, the `ca.crt` file is crucial as it stores a trusted certificate for the Emitras organization's TLSCA (Transport Layer Security Certificate Authority) within the multi-cloud deployment network architecture, thereby securing communication channels among the distributed network participants. | + +
+ +
fabric.multi-cloud-deployment.deploy-digitalocean + +| File | Summary | +| --- | --- | +| [external-chaincode-builder-config.yaml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/multi-cloud-deployment/deploy-digitalocean/external-chaincode-builder-config.yaml) | This code file, located within the blockchain-carbon-accounting" repository, belongs to the application directory named `app`. The primary purpose of this file is to facilitate and manage the interactions between various components (e.g., api-oracle, api-server, frontend, supply-chain) that comprise the larger application architecture, ensuring seamless collaboration and data flow among them.In addition, the parent repository contains data files essential for calculating CO2 emission intensities related to oil & gas industries. These files are stored in directories such as data/co2-emission-intensity-6.csv, data/oil_and_gas among others. The file under focus is likely connected to loading, managing, and utilizing this data effectively within the application.The repository also includes workflows defined in the.github/workflows directory for automating build processes, ensuring consistency in the codebase as contributions flow in from maintainers. Furthermore, documentation is provided (Getting_Started.md, User_Guide.md, Setup.md) to support new users in setting up and utilizing the application efficiently. | +| [fabric-ca-deployment.yaml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/multi-cloud-deployment/deploy-digitalocean/fabric-ca-deployment.yaml) | Deploys Hyperledger Fabric CA on DigitalOcean cluster, managing authentication for a multi-cloud blockchain deployment, utilizing a service (7054, 9443) and persistent storage (1Gi), and following Prometheus metrics provisioner standards. | +| [kubernetes-ingress-controller-deployment.yaml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/multi-cloud-deployment/deploy-digitalocean/kubernetes-ingress-controller-deployment.yaml) | This code file belongs to the blockchain-carbon-accounting repository, which is a comprehensive project designed for carbon accounting within supply chains using blockchain technology. The file in question resides within the `app/scripts` directory and focuses on the scripts utilized for specific functionalities within the application architecture.One of the key tasks this script performs is interacting with various APIs (api-oracle, api-server), which play crucial roles in fetching necessary data and services for the overall system operation. It also integrates with the frontend component for user interactions and visualizations, ensuring a seamless experience for users.The supply-chain module is another essential component handled by this script. Its purpose lies in managing the data flow within the supply chain and tracking carbon emissions associated with each stage of production to facilitate accurate accounting. Lastly, the reports module enables generating detailed reports on carbon accounting for transparency purposes.This script, along with the other files in its directory, plays a pivotal role in maintaining the integrity of the systems architecture, ensuring the proper flow of data and efficient functioning of various components. The use of APIs, integration with frontend and supply-chain modules, as well as report generation capabilities, highlight the importance of this script within the project ecosystem. | +| [ingress-fabric-services-deployment.yaml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/multi-cloud-deployment/deploy-digitalocean/ingress-fabric-services-deployment.yaml) | Fabric-CA (7054), Peer (7051), and Orderer (7050) within the specified multi-cloud network using the Nginx ingress controller. The configuration ensures SSL passthrough and redirects all HTTP traffic to HTTPS, improving security and performance for this blockchain-carbon-accounting application. | +| [fabric-peer-deployment.yaml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/multi-cloud-deployment/deploy-digitalocean/fabric-peer-deployment.yaml) | Mount channel artifacts, initialize CouchDB, and populate crypto-config. Deploy Hyperledger Fabric peer container, equipped with essential code resources for smart contracts and database storage. External chaincode builder readied to compile, build, and release smart contract modules as required. | +| [fabric-orderer-deployment.yaml](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/master/fabric/multi-cloud-deployment/deploy-digitalocean/fabric-orderer-deployment.yaml) | Initialize container extracts and mounts crypto-material from secret into /var/hyperledger/orderer/crypto-material; listening at IP 0.0.0.0, Port 7050 for orders, with SSL enabled using provided server key, certificate, and CA certificate. Metrics provider is Prometheus. Container also listens on 0.0.0.0:8443 for order operations and uses a system-genesis-block config and fabric-orderer1 persistent storage. | + +
+ +--- + +## Getting Started + +**System Requirements:** + +* **TypeScript**: `version x.y.z` + +### Installation + +

From source

+ +> 1. Clone the blockchain-carbon-accounting repository: +> +> ```console +> $ git clone https://github.com/hyperledger-labs/blockchain-carbon-accounting +> ``` +> +> 2. Change to the project directory: +> ```console +> $ cd blockchain-carbon-accounting +> ``` +> +> 3. Install the dependencies: +> ```console +> $ npm install +> ``` + +### Usage + +

From source

+ +> Run blockchain-carbon-accounting using the command below: +> ```console +> $ npm run build && node dist/main.js +> ``` + +### Tests + +> Run the test suite using the command below: +> ```console +> $ npm test +> ``` + +--- + +## Project Roadmap + +- [X] `โ–บ INSERT-TASK-1` +- [ ] `โ–บ INSERT-TASK-2` +- [ ] `โ–บ ...` + +--- + +## Contributing + +Contributions are welcome! Here are several ways you can contribute: + +- **[Report Issues](https://github.com/hyperledger-labs/blockchain-carbon-accounting/issues)**: Submit bugs found or log feature requests for the `blockchain-carbon-accounting` project. +- **[Submit Pull Requests](https://github.com/hyperledger-labs/blockchain-carbon-accounting/blob/main/CONTRIBUTING.md)**: Review open PRs, and submit your own PRs. +- **[Join the Discussions](https://github.com/hyperledger-labs/blockchain-carbon-accounting/discussions)**: Share your insights, provide feedback, or ask questions. + +
+Contributing Guidelines + +1. **Fork the Repository**: Start by forking the project repository to your github account. +2. **Clone Locally**: Clone the forked repository to your local machine using a git client. + ```sh + git clone https://github.com/hyperledger-labs/blockchain-carbon-accounting + ``` +3. **Create a New Branch**: Always work on a new branch, giving it a descriptive name. + ```sh + git checkout -b new-feature-x + ``` +4. **Make Your Changes**: Develop and test your changes locally. +5. **Commit Your Changes**: Commit with a clear message describing your updates. + ```sh + git commit -m 'Implemented new feature x.' + ``` +6. **Push to github**: Push the changes to your forked repository. + ```sh + git push origin new-feature-x + ``` +7. **Submit a Pull Request**: Create a PR against the original project repository. Clearly describe the changes and their motivations. +8. **Review**: Once your PR is reviewed and approved, it will be merged into the main branch. Congratulations on your contribution! +
+ +
+Contributor Graph +
+

+ + + +

+
+ +--- + +## License + +This project is protected under the [SELECT-A-LICENSE](https://choosealicense.com/licenses) License. For more details, refer to the [LICENSE](https://choosealicense.com/licenses/) file. + +--- + +## Acknowledgments + +- List any resources, contributors, inspiration, etc. here. + +[**Return**](#-overview) + +---