guardian

The Guardian is an innovative open-source platform that streamlines the creation, management, and verification of digital environmental assets. It leverages a customizable Policy Workflow Engine and Web3 technology to ensure transparent and fraud-proof operations, making it a key tool for transforming sustainability practices and carbon markets.

https://github.com/hashgraph/guardian

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (15.3%) to scientific vocabulary

Keywords

hacktoberfest

Keywords from Contributors

transformers projects embedded optimism interactive hacking packaging diffusion multi-modality autonomous-agents
Last synced: 10 months ago · JSON representation

Repository

The Guardian is an innovative open-source platform that streamlines the creation, management, and verification of digital environmental assets. It leverages a customizable Policy Workflow Engine and Web3 technology to ensure transparent and fraud-proof operations, making it a key tool for transforming sustainability practices and carbon markets.

Basic Info
  • Host: GitHub
  • Owner: hashgraph
  • License: apache-2.0
  • Language: TypeScript
  • Default Branch: main
  • Homepage:
  • Size: 644 MB
Statistics
  • Stars: 126
  • Watchers: 17
  • Forks: 149
  • Open Issues: 291
  • Releases: 94
Topics
hacktoberfest
Created over 4 years ago · Last pushed 10 months ago
Metadata Files
Readme Contributing License Codeowners Security

README.md

Guardian

Apache 2.0 License Build results GitHub package.json version (branch) Discord chat OpenSSF Best Practices

Overview

Guardian is a modular open-source solution that includes best-in-class identity management and decentralized ledger technology (DLT) libraries. At the heart of Guardian solution is a sophisticated Policy Workflow Engine (PWE) that enables applications to offer a digital (or digitized) Measurement, Reporting, and Verification requirements-based tokenization implementation.

HIP-19 HIP-28 HIP-29 Report a Bug Request a Policy or a Feature

Discovering Digital Environmental Assets assets on Hedera

As identified in Hedera Improvement Proposal 19 (HIP-19), each entity on the Hedera network may contain a specific identifier in the memo field for discoverability. Guardian demonstrates this when every Hedera Consensus Service transaction is logged to a Hedera Consensus Service (HCS) Topic. Observing the Hedera Consensus Service Topic, you can discover newly minted tokens.

In the memo field of each token mint transaction you will find a unique Hedera message timestamp. This message contains the url of the Verifiable Presentation (VP) associated with the token. The VP can serve as a starting point from which you can traverse the entire sequence of documents produced by Guardian policy workflow, which led to the creation of the token. This includes a digital Methodology (Policy) HCS Topic, an associated Registry HCS Topic for that Policy, and a Project HCS Topic.

Please see p.17 in the FAQ for more information. This is further defined in Hedera Improvement Proposal 28 (HIP-28).

(back to top)

Quickstart

This procedure is useful for demos, quick testing, and hackathons. It will only start the minimum required services for using the main Guardian features. It will not start features like the AI or MRV sender services, Prometheus integration, Grafana integration, etc.

  1. Ensure to have Git and Docker installed on your machine.
  2. Clone this repository

bash git clone https://github.com/hashgraph/guardian.git cd guardian

  1. Login or register on the Hedera Developer Portal.
  2. Generate an ED25519 key pair and account.
  3. Copy your AccountID (i.e, 0.0.123456...) and the associated DER Encoded Private Key (i.e., 302e020100300506032b657004220420....).
  4. Create a local .env file in the root directory of your project and update it with your AccountID and private key.

dotenv OPERATOR_ID=0.0.123456... OPERATOR_KEY=302e020100300506032b657004220420....

  1. Start the environment with:

bash docker compose -f docker-compose-quickstart.yml up --pull=always -d

  1. Navigate to http://localhost:3000 in your web browser.

  2. If you want to stop the environment, preserving all the local data, use:

bash docker compose -f docker-compose-quickstart.yml stop

  1. If you want to destroy the environment, loosing all the local data, use:

bash docker compose -f docker-compose-quickstart.yml down

Getting started

To get a local copy up and running quickly, follow the steps below. Please refer to https://docs.hedera.com/guardian for complete documentation.

Note. If you have already installed another version of Guardian, remember to perform a backup operation before upgrading.

Prerequisites

2.1 Universal software

  1. Git source-control tooling
  2. Docker one-command build & run (recommended)
  3. MongoDB v6, Node.js v16, and NATS 1.12.2 auto-installed when using Docker-Compose
  4. Web3.Storage account IPFS pinning service
  5. Filebase account S3-compatible IPFS pinning (optional but recommended)
  6. Redis 7.3.0 in-memory cache & message broker (auto-provisioned by the Docker stack)

When building the reference implementation, you can manually build every component or run a single command with Docker.

2.2 Hedera network

| | Testnet (default) | Mainnet (production) | | -------------- | -------------------------------------- | -------------------------------------------------------------------------------------------------- | | Account | Create via Hedera Developer Portal | Create via Hedera-enabled wallet (e.g.HashPack) | | Key type | ED25519 | ED25519 | | Network | testnet | mainnet |

Fees: Mainnet operations incur HBAR costsfund your account before running Guardian.

2.3. Preparing a Mainnet Account & Keys

  1. Install a Hedera-enabled wallet (e.g., HashPack).
  2. Create a Mainnet account and note the Account ID (0.0.x).
  3. Export the ED25519 key pair
    • HashPack path: Settings Manage Accounts Export Private Key (DER format).
  4. Update your .env

dotenv HEDERA_NET=mainnet OPERATOR_ID=0.0.123456... OPERATOR_KEY=302e020100300506032b657004220420....

2.4. Preparing a Testnet Account & Keys

  1. Create a Testnet account via the Hedera Developer Portal.
  2. Record your Account ID (0.0.x).
  3. Download the ED25519 private key (ignore ECDSA)
    • Select the DER Encoded Private Key do not choose HEX Encoded.
  4. Update your .env

dotenv HEDERA_NET=testnet OPERATOR_ID=0.0.123456... OPERATOR_KEY=302e020100300506032b657004220420....

2.5. Automatic installation

Prerequisites for automatic installation

If you build with docker MongoDB V6, NodeJS V20, Yarn and Nats 1.12.2 will be installed and configured automatically.

Installation

The following steps need to be executed in order to start Guardian using docker:

  1. Clone the repo
  2. Configure project level .env file
  3. Update BC access variables
  4. Setup IPFS
  5. Build and launch with Docker
  6. Browse to http://localhost:3000
  7. For increased security remove credentials from .env file

Here the steps description follows:

1. Clone the repo

shell git clone https://github.com/hashgraph/guardian.git

2. Configure project level .env file.

The main configuration file that needs to be provided to the Guardian system is the .env file. Note that these files contain sensitive configuration such as keys and access credentials which are only used at the initial start of Guardian. For increased security it is recommended to disable inbound network access until after the first run of Guardian, when the credentials configuration has been removed from .env file (see p8 below).

For this example purpose let's name the Guardian platform as "develop"

shell GUARDIAN_ENV="develop"

NOTE: Every single service is provided in its folder with a .env.template file, this set of files are only needed for the case of Manual installation.

3. Update BC access variables.

Update the following files with your Hedera Mainnet or Testnet account info (see prerequisites). Please check complete steps to generate OperatorID and OperatorKey by looking at the link: How to Create OperatorID and OperatorKey. The OperatorID and OperatorKey and HEDERA_NET are all that Guardian needs to access the Hedera Blockchain assuming a role on it. This parameters needs to be configured in a file at the path ./configs, the file should use the following naming convention:

./configs/.env.\<GUARDIAN_ENV\>.guardian.system

There will be other steps in the Demo Usage Guide that will be required for the generation of Operator_ID and Operator_Key. It is important to mention that the OperatorID and OperatorKey in the ./configs/.env.<GUARDIAN_ENV>.guardian.system will be used to generate demo accounts.

The parameter HEDERA_NET may assume the following values: mainnet, testnet, previewnet, localnode. choose the right value depending on your target Hedera network on which the OPERATOR_ID has been defined.

As examples:

following the previous example, the file to configure should be named: ./configs/.env.develop.guardian.system, this file is already provided in the folder as an example, only update the variables OPERATORID, OPERATORKEY and HEDERA_NET.

plaintext OPERATOR_ID="..." OPERATOR_KEY="..." HEDERA_NET="..."

Starting from Multi-environment release (2.13.0) it has been introduced a new parameter PREUSED_HEDERA_NET. Multienvironemnt is a breaking change and the configuration of this parameter intend to smooth the upgrading. PREUSED_HEDERA_NET configuration depends on the installation context.

  • If the installation is a completely new one just remove the parameter and feel free to jump to the next paragraph.
  • if you are upgrading from a release after the Multi-environment (>= to 2.13.0) do not change the state of this parameter (so if you removed the parameter in some previous installation do not introduce it).
  • if the installation is an upgrading from a release previous of the Multi-environment (<= to 2.13.0) to a following one you need to configure the PREUSED_HEDERA_NET. After that the parameter will last in the configuration unchanged.
3.1. PREUSEDHEDERANET configuration

The PREUSED_HEDERA_NET parameter is intended to hold the target Hedera network that the system already started to notarize data to. PREUSED_HEDERA_NET is the reference to the HEDERANET that was in use before the upgrade. To let the Multi-environment transition happen in a transparent way the `GUARDIANENVparameter in the.envfile has to be configured as empty while thePREUSEDHEDERANEThas to be set with the same value configured in theHEDERA_NET` parameter in the previous configuration file.

PREUSED_HEDERA_NET never needs to be changed after the first initialization. On the contrary it will be possible to change HEDERA_NET to dials with all the Hedera different networks.

  • as first Example:

in case of the upgrading from a release minor then 2.13.0 to a bigger one and keep using the same HEDERA_NET="Mainnet"(as example)

configure the name the Guardian platform as empty in the .env file

shell GUARDIAN_ENV=""

In this case the configuration is stored in the file named: ./configs/.env..guardian.system, and is already provided in the folder as an example, updating the variables OPERATORID and OPERATORKEY.

plaintext OPERATOR_ID="..." OPERATOR_KEY="..." PREUSEDHEDERANET is the reference to your previous HEDERANET configuration then you should set its value to match your previous HEDERANET configuration.

plaintext HEDERA_NET="mainnet" PREUSED_HEDERA_NET="mainnet"

because you are keeping on using HEDERA_NET as it was pointing to the "mainnet" in the previous installation too.

  • As a second example: to test the new release change the HEDERA_NET to "testnet". This is the complete configuration:

Set the name of the Guardian platform to whatever description name in the .env file

shell GUARDIAN_ENV="testupgrading"

In this case the configuration is stored in the file named: ./configs/.env.testupgrading.guardian.system again update the variables OPERATORID and OPERATORKEY using your testnet account.

plaintext OPERATOR_ID="..." OPERATOR_KEY="..."

set the HEDERANET="testnet" and set the PREUSEDHEDERA_NET to refer to the mainnet as you wish that Mainet data remains unchanged.

plaintext HEDERA_NET="testnet" PREUSED_HEDERA_NET="mainnet"

This configuration allows you to leave untouched all the data referring to Mainnet in the Database while testing on Testnet. Refer to Guardian documentation for more details.

NOTE: You can use the Schema Topic ID (INITIALIZATION_TOPIC_ID) already present in the configuration files, or you can specify your own.

NOTE: for any other GUARDIAN_ENV name of your choice just copy and paste the file ./configs/.env.template.guardian.system and rename as ./configs/.env.<choosen name>.guardian.system

3.2. Setting up JWT keys in /.env file

To start of auth-service it is necessary to fill in JWT_PRIVATE_KEY and JWT_PUBLIC_KEY, which are RSA key pair. You can generate it in any convenient way, for example, using this service https://travistidwell.com/jsencrypt/demo/.

3.3. Setting up JWT keys for each service in the .env file

To start all services, you need to create a 2048-bit RSA key pair for each service. You can generate a key pair in any convenient wayfor example, using the online tool at https://mkjwk.org/ with the following settings: - key size: 2048 - key use: signature - algorithm: RS256: RSA - key ID: sha256 - show: yes

For each service, you must add its secret key SERVICE_JWT_SECRET_KEY and a list of all public keys from every service: - SERVICE_JWT_PUBLIC_KEY_WORKER_SERVICE - SERVICE_JWT_PUBLIC_KEY_TOPIC_LISTENER_SERVICE - SERVICE_JWT_PUBLIC_KEY_QUEUE_SERVICE - SERVICE_JWT_PUBLIC_KEY_POLICY_SERVICE - SERVICE_JWT_PUBLIC_KEY_NOTIFICATION_SERVICE - SERVICE_JWT_PUBLIC_KEY_LOGGER_SERVICE - SERVICE_JWT_PUBLIC_KEY_GUARDIAN_SERVICE - SERVICE_JWT_PUBLIC_KEY_AUTH_SERVICE - SERVICE_JWT_PUBLIC_KEY_API_GATEWAY_SERVICE - SERVICE_JWT_PUBLIC_KEY_AI_SERVICE - SERVICE_JWT_PUBLIC_KEY_ANALYTICS_SERVICE

Alternatively, you can create a single key pair and, instead of adding the public keys for each individual service, you can add SERVICE_JWT_SECRET_KEY_ALL and SERVICE_JWT_PUBLIC_KEY_ALL to use the same keys for all services. However, it is recommended to generate a separate key pair for each service.

4. Now, we have two options to setup IPFS node : 1. Local node 2. IPFS Web3Storage node 3. Filebase Bucket.

4.1 Setting up IPFS Local node:
  • 4.1.1 We need to install and configure any IPFS node. example

  • 4.1.2 For setup IPFS local node you need to set variables in the same file ./configs/.env.develop.guardian.system

IPFS_NODE_ADDRESS="..." # Default IPFS_NODE_ADDRESS="http://localhost:5001" IPFS_PUBLIC_GATEWAY='...' # Default IPFS_PUBLIC_GATEWAY='https://localhost:8080/ipfs/${cid}' IPFS_PROVIDER="local"

4.2 Setting up IPFS Web3Storage node:

To select this option ensure that IPFS_PROVIDER="web3storage" setting exists in your ./configs/.env.<environment>.guardian.system file.

To configure access to the w3up IPFS upload API from web3.storage for your Guardian instance you need to set correct values to the following variables in the ./configs/.env.<environment>.guardian.system file:

IPFS_STORAGE_KEY="..." IPFS_STORAGE_PROOF="..."

NOTE: When Windows OS is used for creating the IPFS values, please use bash shell to prevent issues with base64 encoding.

To obtain the values for these variables please follow the steps below: - Create an account on https://web3.storage, please specify the email you have access to as the account authentication is based on the email validation. Make sure to follow through the registration process to the end, choose an appropriate billing plan for your needs (e.g. 'starter') and enter your payment details. - Install w3cli as described in the corresponding section of the web3.storage documentation. - Create your 'space' as described in the 'Create your first space' section of the documentation. - Execute the following to set the Space you intend on delegating access to: w3 space use. - Execute the following command to retrieve your Agent private key and DID: npx ucan-key ed. The private key (starting with Mg...) is the value to be used in the environment variable IPFS_STORAGE_KEY. - Retrieve the PROOF by executing the following: w3 delegation create <did_from_ucan-key_command_above> | base64. The output of this command is the value to be used in the environment variable IPFS_STORAGE_PROOF.

To summarise, the process of configuring delegated access to the w3up API consists of execution the following command sequence: 1. w3 login 2. w3 space create 3. w3 space use 4. npx ucan-key ed 5. w3 delegation

The complete guide to using the new w3up web3.storage API is available at https://web3.storage/docs/w3up-client.

4.3 Setting up IPFS Filebase Bucket:

To configure the Filebase IPFS provider, set the following variables in the file ./configs/.env.<environment>.guardian.system

IPFS_STORAGE_API_KEY="Generated Firebase Bucket Token" IPFS_PROVIDER="filebase"

Create a new "bucket" on Filebase since we utilize the IPFS Pinning Service API Endpoint service. The token generated for a bucket corresponds to the IPFSSTORAGEAPI_KEY environment variable within the guardian's configuration.

For detailed setup instructions, refer to the official https://docs.filebase.com/api-documentation/ipfs-pinning-service-api.

5. Setting up Chat GPT API KEY to enable AI Search and Guided Search:

For setting up AI and Guided Search, we need to set OPENAIAPIKEY variable in ./configs/.env* files.

shell OPENAI_API_KEY="..."

6. Build and launch with Docker.

The following list outlines various Docker Compose configurations for different purposes. Choose the one that best suits your needs.

| Configuration | Description | Command to Run | |---------------|-------------|----------------| | Guardian (Demo Mode) | Guardian using pre-built images | docker-compose up -d --build --pull always | | Guardian Build (Demo Mode) | Builds Guardian from source code | docker-compose -f docker-compose-build.yml up -d --build | | Production Guardian | Guardian using pre-built images, no demo mode | docker-compose -f docker-compose-production.yml up -d --build --pull always | | Production Guardian Build | Builds Guardian from source code, no demo mode | docker-compose -f docker-compose-production-build.yml up -d --build | | Indexer | Indexer using pre-built images | docker-compose -f docker-compose-indexer.yml up -d --build --pull always | | Indexer Build | Builds Indexer from source code | docker-compose -f docker-compose-indexer-build.yml up -d --build | | Analytics Service | Analytics Service using pre-built images | docker-compose -f docker-compose-analytics.yml up -d --build --pull always | | Analytics Service Build | Builds Analytics Service from source code | docker-compose -f docker-compose-analytics-build.yml up -d --build |

To proceed:

  1. Choose the configuration that matches your requirements.
  2. Open a terminal in the project root folder.
  3. Run the corresponding command from the "Command to Run" column.

For example, to run the standard Guardian in demo mode:

shell docker-compose up -d --build --pull always

This will start the containers in detached mode (-d) and build them if necessary.

NOTE: Configurations with "Build" in their name compile the application from source code, which may take longer but allows for customization.

NOTE: Production configurations do not include demo features and will not contain any debug information.

NOTE: From the end of June 2023 Compose V1 wont be supported anymore and will be removed from all Docker Desktop versions. Make sure you use Docker Compose V2 (comes with Docker Desktop > 3.6.0) as at https://docs.docker.com/compose/install/

7. Browse to http://localhost:3000 and complete the setup.

for other examples go to: * Deploying Guardian using a specific environment( DEVELOP) * Steps to deploy Guardian using a specific Environment ( QA) * Steps to deploy Guardian using default Environment

8. For increased security remove credentials from .env file and enable network access

On first state the credentials from .env file are copied into the secure storage as configured (e.g. Vault). After that Guardian does not use any credentials stored in the .env file, thus they should be removed for security reasons.

Manual installation

If you want to manually build every component with debug information, then build and run the services and packages in the following sequence: Interfaces, Logger Helper, Message Broker, Logger Service, Auth Service, IPFS, Guardian Service, UI Service, and lastly, the MRV Sender Service. See below for commands.

Prerequisites for manual installation

Build and start each component

Install, configure and start all the prerequisites, then build and start each component.

Services Configuration:

  • for each of the services create the file ./<service_name>/.env to do this copy, paste and rename the file ./<service_name>/.env.template

For example:

in ./guardian-service/.env: plaintext GUARDIAN_ENV="develop"

If need to configure OVERRIDE uncomment the variable in file ./guardian-service/.env: plaintext OVERRIDE="false"

  • configure the file ./<service_name>/configs/.env.<service>.<GUARDIAN_ENV> file: to do this copy, paste and rename the file ./<service_name>/.env.<service>.template

following previous example:

in ./guardian-service/configs/.env.guardian.develop: plaintext OPERATOR_ID="..." OPERATOR_KEY="..." - Setting up Chat GPT API KEY to enable AI Search and Guided Search: For setting up AI and Guided Search, we need to set OPENAIAPIKEY variable in ./ai-service/configs/.env* files.

plaintext OPENAI_KEY="..."

NOTE: Once you start each service, please wait for the initialization process to be completed.**

1. Clone the repo

shell git clone https://github.com/hashgraph/guardian.git

2. Install dependencies

Yarn: yarn

Npm: npm install

3. From the interfaces folder

Yarn: yarn workspace @guardian/interfaces run build

Npm: npm --workspace=@guardian/interfaces run build

4. From the common folder

Yarn: yarn workspace @guardian/common run build

Npm: npm --workspace=@guardian/common run build

5. From the logger-service folder

To build the service:

Yarn: shell yarn workspace logger-service run build

Npm: npm --workspace=logger-service run build

Configure the service as previously described. Do not need special configuration variables.

To start the service:

Yarn: shell yarn workspace logger-service start

Npm: npm --workspace=logger-service start

6. From the auth-service folder

To build the service:

Yarn: shell yarn workspace auth-service run build

Npm: npm --workspace=auth-service run build

Configure the service as previously described. Do not need special configuration variables.

To start the service:

Yarn: shell yarn workspace auth-service start

Npm: npm --workspace=auth-service start

7. From the policy-service folder

To build the service:

Yarn: shell yarn workspace policy-service run build

Npm: npm --workspace=policy-service run build Configure the service as previously described. Do not need special configuration variables.

To start the service:

Yarn: shell yarn workspace policy-service start

Npm: npm --workspace=policy-service start

8. Build and start worker-service service

Yarn: To build the service: yarn workspace worker-service run build

Npm: npm --workspace=worker-service run build Configure the service as previously described. Update IPFSSTORAGEAPI_KEY value in ./worker-service/configs/.env.worker file.

Yarn: To start the service: yarn workspace worker-service start

Npm: npm --workspace=worker-service start

9. Build and start notification-service service

To build the service:

Yarn: shell yarn workspace notification-service run build

Npm: npm --workspace=notification-service run build Configure the service as previously described. Update OPERATOR_ID and OPERATOR_KEY values in ./guardian-service/configs/.env.worker file as in the example above.

To start the service (found on http://localhost:3002):

Yarn: shell yarn workspace notification-service start

Npm: npm --workspace=notification-service start

10. Build and start guardian-service service

To build the service:

Yarn: shell yarn workspace guardian-service run build

Npm: npm --workspace=guardian-service run build Configure the service as previously described. Update OPERATOR_ID and OPERATOR_KEY values in ./guardian-service/configs/.env.worker file as in the example above.

To start the service (found on http://localhost:3002):

Yarn: shell yarn workspace guardian-service start

Npm: npm --workspace=guardian-service start

11. From the api-gateway folder

To build the service:

Yarn: shell yarn workspace api-gateway run build

Npm: npm --workspace=api-gateway run build

Configure the service as previously described. Do not need special configuration variables.

To start the service (found on http://localhost:3002):

Yarn: shell yarn workspace api-gateway start

Npm: npm --workspace=api-gateway start

12. From the mrv-sender folder

To build the service:

```shell
npm install
npm run build
```

Configure the service as previously described. Do not need special configuration variables.

To start the service (found on http://localhost:3005):

```shell
npm start
```

13. From the ai-service folder

To build the service:

Yarn: shell yarn workspace ai-service run build

Npm: npm --workspace=ai-service run build

Configure the service as previously described. Do not need special configuration variables.

Yarn: yarn workspace ai-service start

Npm: npm --workspace=ai-service start

14. From the frontend folder

To build the service:

```shell
npm install
npm run build
```

To start the service (found on http://localhost:4200):

```shell
npm start
```

Configuring a Hedera local network

1. Install a Hedera Local Network following the official documentation

2. Configure Guardian's configuration files /.env/.env.docker accordingly:

shell OPERATOR_ID="" OPERATOR_KEY="" LOCALNODE_ADDRESS="11.11.11.11" LOCALNODE_PROTOCOL="http" HEDERA_NET="localnode"

Note: * Set LOCALNODE_ADDRESS to the IP address of your local node instance. The value above is given as an example. * Set HEDERA_NET to localnode. If not specified, the default value is testnet. * Configure OPERATOR_ID and OPERATOR_KEY accordingly with your local node configuration. * Remove INITIALIZATION_TOPIC_ID as the topic will be created automatically. * Set LOCALNODE_PROTOCOL to http or https accordingly with your local node configuration (it uses HTTP by default).

Configuring Hashicorp Vault

1. Configure .env/.env.docker files in the auth-service folder

VAULT_PROVIDER = "hashicorp"

Note: VAULT_PROVIDER can be set to "database" or "hashicorp" to select Database instance or a hashicorp vault instance correspondingly.

If the VAULT_PROVIDER value is set to "hashicorp" the following 3 parameters should be configured in the auth-service folder.

  1. HASHICORP_ADDRESS : http://localhost:8200 for using local vault. For remote vault, we need to use the value from the configuration settings of Hashicorp vault service.
  2. HASHICORP_TOKEN : the token from the Hashicorp vault.
  3. HASHICORP_WORKSPACE : this is only needed when we are using cloud vault for Hashicorp. Default value is "admin".

2. Hashicorp should be configured with the created Key-Value storage, named "secret" by default, with the settingKey= records for the following keys:

1. OPERATOR_ID
2. OPERATOR_KEY
3. IPFS_STORAGE_API_KEY

Note: These records in the vault will be created automatically if there are environment variables with the matching names.

How to import existing user keys from DB into the vault:

During Guardian services initialization, we need to set the following configuration settings in auth-service folder:

IMPORT_KEYS_FROM_DB = 1 VAULT_PROVIDER = "hashicorp"

Local development using Docker

1. create .env file at the root level and update all variable requires for docker

shell cp .env.example .env

2. Start local development using docker compose

shell docker compose -f docker-compose-dev.yml up --build

3. Access local development using http://localhost:3000 or http://localhost:4200

Troubleshoot

To delete all the containers:

shell docker builder prune --all

To run by cleaning Docker cache:

shell docker compose build --no-cache

(back to top)

Unit tests

To run guardian-service unit tests, following commands needs to be executed:

shell cd guardian-service npm run test

It is also an ability to run Hedera network tests only. To do that, the following command needs to be executed:

shell npm run test:network

To run stability tests (certain transactions will be executed 10 times each), the following command needs to be executed:

shell npm run test:stability

(back to top)

Please refer to https://docs.hedera.com/guardian for complete documentation about the following topics:

  • Swagger API
  • Postman Collection
  • Demo Usage guide
  • Contribute a New Policy
  • Reference Implementation
  • Technologies Built on
  • Roadmap
  • Change Log
  • Contributing
  • License
  • Security

Contact

For any questions, please reach out to the Envision Blockchain Solutions team at:

(back to top)

Owner

  • Name: Hedera
  • Login: hashgraph
  • Kind: organization
  • Email: da@hedera.com
  • Location: United States of America

GitHub Events

Total
  • Create event: 572
  • Commit comment event: 1
  • Issues event: 305
  • Watch event: 28
  • Delete event: 1,187
  • Issue comment event: 667
  • Push event: 1,958
  • Pull request review comment event: 19
  • Pull request event: 1,120
  • Pull request review event: 147
  • Fork event: 24
Last Year
  • Create event: 573
  • Commit comment event: 1
  • Issues event: 305
  • Watch event: 28
  • Delete event: 1,187
  • Issue comment event: 667
  • Push event: 1,958
  • Pull request review comment event: 19
  • Pull request event: 1,120
  • Pull request review event: 147
  • Fork event: 24

Committers

Last synced: 10 months ago

All Time
  • Total Commits: 1,659
  • Total Committers: 68
  • Avg Commits per committer: 24.397
  • Development Distribution Score (DDS): 0.73
Past Year
  • Commits: 93
  • Committers: 23
  • Avg Commits per committer: 4.043
  • Development Distribution Score (DDS): 0.688
Top Committers
Name Email Commits
Stepan Kiryakov s****v@e****m 448
simvalery v****v@e****m 435
prernaa.agarwal p****l@e****m 312
artembuslaev b****r@m****u 127
dependabot[bot] 4****] 43
danielnorkin 4****n 36
AnVaBr 3****r 32
Kephotho Solutions 3****X 20
Saharsh Khicha 7****8 12
Serg Metelin s****n@h****m 10
phahim1 1****1 10
Artem Buslaev a****v@e****m 9
Idowu Festus 4****1 9
Truong Nguyen s****g@h****m 9
StanYFed s****v@e****m 8
erikamoji e****n@g****m 8
Peter Kompasz k****e@g****m 8
盧露 l****y@g****m 7
ankurgupta007 9****7 7
Ilya Ozerov a****2@g****m 6
Alexander Pyatakov a****v@e****m 6
gitbook-bot g****t@g****m 5
Satyam Tripathi 9****m 5
Matt Smithies f****e@h****k 5
Gautam Prajapati g****6@g****m 5
Alex Pyatakov A****v@w****u 4
Abhijeet Singh 5****t 4
Serg Metelin s****n@g****m 4
dubgeis 6****s 4
rayenharhouri r****9@g****m 4
and 38 more...

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 582
  • Total pull requests: 3,599
  • Average time to close issues: 5 months
  • Average time to close pull requests: 6 days
  • Total issue authors: 60
  • Total pull request authors: 84
  • Average comments per issue: 0.46
  • Average comments per pull request: 0.7
  • Merged pull requests: 1,063
  • Bot issues: 6
  • Bot pull requests: 1,833
Past Year
  • Issues: 219
  • Pull requests: 1,533
  • Average time to close issues: 28 days
  • Average time to close pull requests: 10 days
  • Issue authors: 33
  • Pull request authors: 41
  • Average comments per issue: 0.2
  • Average comments per pull request: 0.76
  • Merged pull requests: 431
  • Bot issues: 3
  • Bot pull requests: 795
Top Authors
Issue Authors
  • prernaadev01 (157)
  • anvabr (104)
  • kirill-tolochko (72)
  • Neurone (39)
  • denischasovskikh (28)
  • Pyatakov (15)
  • mattsmithies (14)
  • saharshkhicha18 (14)
  • Celiant (13)
  • AlexIvanHoward (12)
  • rbarkerSL (10)
  • dubgeis (10)
  • CyndyMo (7)
  • dependabot[bot] (6)
  • gautamp8 (6)
Pull Request Authors
  • dependabot[bot] (1,831)
  • prernaadev01 (314)
  • simvalery (289)
  • ihar-tsykala (233)
  • artembuslaev (168)
  • Stepan-Kirjakov (94)
  • Pyatakov (79)
  • DariyEnvision (61)
  • Celiant (54)
  • CMiville42 (53)
  • Neurone (51)
  • popowycz (45)
  • nathanklick (30)
  • egorenvisionblockchain (21)
  • gautamp8 (19)
Top Labels
Issue Labels
Epic (116) bug (115) technical task (46) UI/UX (41) Next Phase (39) community (38) enhancement (37) documentation (36) policy addition (29) Priority P1 (16) Priority P2 (14) Priority P3 (12) github_actions (9) dependencies (8) research (8) Bounty Ready (7) policy enhancement (5) duplicate (4) Audit (3) 3.2.0-rc (3) javascript (3) IEU (1) help wanted (1) question (1)
Pull Request Labels
dependencies (1,830) javascript (954) github_actions (159) community (6) IEU (1) bug (1) documentation (1)

Packages

  • Total packages: 1
  • Total downloads: unknown
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 98
proxy.golang.org: github.com/hashgraph/guardian
  • Versions: 98
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 5.4%
Average: 5.6%
Dependent repos count: 5.8%
Last synced: 10 months ago

Dependencies

.github/workflows/main.yml actions
  • EnricoMi/publish-unit-test-result-action v1 composite
  • actions/checkout v1 composite
  • actions/setup-node v1 composite
.github/workflows/publish.yml actions
  • actions/checkout v2 composite
  • docker/build-push-action v2 composite
  • docker/login-action v1 composite
  • docker/setup-buildx-action v1 composite
  • google-github-actions/auth v0 composite
  • haya14busa/action-cond v1 composite
  • martinbeentjes/npm-get-version-action main composite
.github/workflows/add-documentation-to-repo.yaml actions
  • actions/checkout v1 composite
  • actions/setup-node v1 composite
  • onichandame/nats-action master composite
  • supercharge/mongodb-github-action 1.7.0 composite
.github/workflows/api-manual.yml actions
  • EnricoMi/publish-unit-test-result-action v1 composite
  • actions/checkout v1 composite
  • actions/setup-node v1 composite
  • onichandame/nats-action master composite
  • supercharge/mongodb-github-action 1.7.0 composite
  • ipfs/kubo latest docker
.github/workflows/api-after-commit.yml actions
  • Borales/actions-yarn 3766bb1335b98fb13c60eaf358fe20811b730a88 composite
  • EnricoMi/publish-unit-test-result-action 170bf24d20d201b842d7a52403b73ed297e6645b composite
  • actions/checkout 11bd71901bbe5b1630ceea73d27597364c9af683 composite
  • actions/setup-node 39370e3970a6d050c480ffad4ff0ed4d3fdee5af composite
  • step-security/harden-runner cb605e52c26070c328afc4562f0b4ada7618a84e composite
  • step-security/mongodb-github-action ff3d5a3dec0957be7ef99d3d1c9ca4499e8a4cb8 composite
  • step-security/nats-action 0306fc1c4e4f49dbe4db5865a3135ab1516a5aee composite
  • registry.redict.io/redict * docker
.github/workflows/api-schedule.yml actions
  • Borales/actions-yarn 3766bb1335b98fb13c60eaf358fe20811b730a88 composite
  • EnricoMi/publish-unit-test-result-action 170bf24d20d201b842d7a52403b73ed297e6645b composite
  • actions/checkout 11bd71901bbe5b1630ceea73d27597364c9af683 composite
  • actions/setup-node 39370e3970a6d050c480ffad4ff0ed4d3fdee5af composite
  • step-security/harden-runner 63c24ba6bd7ba022e95695ff85de572c04a18142 composite
  • step-security/mongodb-github-action ff3d5a3dec0957be7ef99d3d1c9ca4499e8a4cb8 composite
  • step-security/nats-action 0306fc1c4e4f49dbe4db5865a3135ab1516a5aee composite
  • registry.redict.io/redict * docker
.github/workflows/ui-manual.yml actions
  • Borales/actions-yarn 3766bb1335b98fb13c60eaf358fe20811b730a88 composite
  • EnricoMi/publish-unit-test-result-action 170bf24d20d201b842d7a52403b73ed297e6645b composite
  • actions/checkout 11bd71901bbe5b1630ceea73d27597364c9af683 composite
  • actions/setup-node 39370e3970a6d050c480ffad4ff0ed4d3fdee5af composite
  • step-security/harden-runner 0634a2670c59f64b4a01f0f96f84700a4088b9f0 composite
  • step-security/mongodb-github-action 0b5e704ee1061d729c20e0df4204e69ba6ac6cee composite
  • step-security/nats-action 0306fc1c4e4f49dbe4db5865a3135ab1516a5aee composite
  • registry.redict.io/redict * docker
.github/workflows/flow-pull-request-formatting.yaml actions
  • step-security/conventional-pr-title-action 8a8989588c2547f23167c4c42f0fb2356479e81b composite
  • step-security/harden-runner ec9f2d5744a09debf3a187a3f4f675c53b671911 composite
ai-service/Dockerfile docker
  • base latest build
  • node ${NODE_VERSION} build
analytics-service/Dockerfile docker
  • base latest build
  • node ${NODE_VERSION} build
api-gateway/Dockerfile docker
  • base latest build
  • node ${NODE_VERSION} build
application-events/Dockerfile docker
  • base latest build
  • node ${NODE_VERSION} build
auth-service/Dockerfile docker
  • base latest build
  • node ${NODE_VERSION} build
docker-compose-analytics-build.yml docker
docker-compose-analytics.yml docker
docker-compose-build.yml docker
docker-compose-indexer-build.yml docker
docker-compose-indexer.yml docker
docker-compose-production-build.yml docker
docker-compose-production.yml docker
docker-compose.yml docker
ai-service/package.json npm
  • nodemon ^3.0.1 development
  • @guardian/common ^3.3.0-rc
  • @guardian/interfaces ^3.3.0-rc
  • @langchain/community 0.3.45
  • @langchain/core 0.3.57
  • @mikro-orm/core 6.4.16
  • @mikro-orm/mongodb 6.4.16
  • @nestjs/common ^11.0.11
  • @nestjs/core ^11.0.11
  • @types/express ^5.0.1
  • @types/node ^22.15.19
  • dotenv ^16.3.1
  • express ^5.1.0
  • faiss-node ^0.3.0
  • langchain 0.3.27
  • module-alias ^2.2.2
  • prebuild ^12.1.0
  • rxjs ^7.8.1
  • typescript ^5.8.3
analytics-service/package.json npm
  • @types/express ^5.0.1 development
  • @types/jszip ^3.4.1 development
  • @types/node ^22.15.19 development
  • mocha ^9.2.0 development
  • mocha-junit-reporter ^2.0.2 development
  • nodemon ^2.0.12 development
  • tslint ^6.1.3 development
  • typescript ^5.8.3 development
  • @guardian/common ^3.3.0-rc
  • @guardian/interfaces ^3.3.0-rc
  • @nestjs/common ^11.0.11
  • @nestjs/core ^11.0.11
  • @nestjs/microservices ^11.0.11
  • @nestjs/platform-express ^11.0.11
  • @nestjs/swagger ^11.0.6
  • @types/express-fileupload ^1.4.1
  • class-transformer ^0.5.1
  • class-validator ^0.14.0
  • cron ^4.3.0
  • dotenv ^16.0.0
  • excel4node ^1.8.2
  • express ^5.1.0
  • express-fileupload ^1.4.0
  • hpp ^0.2.3
  • jszip ^3.7.1
  • prom-client ^14.1.1
  • reflect-metadata ^0.1.13
  • rxjs ^7.8.1
api-gateway/package.json npm
  • @types/express ^5.0.1 development
  • @types/node ^22.15.19 development
  • @types/ws ^8.2.2 development
  • mocha ^9.2.0 development
  • mocha-junit-reporter ^2.0.2 development
  • nodemon ^2.0.12 development
  • tslint ^6.1.3 development
  • typescript ^5.8.3 development
  • @fastify/formbody ^8.0.2
  • @fastify/multipart ^9.0.3
  • @fastify/static ^8.1.1
  • @guardian/common ^3.3.0-rc
  • @guardian/interfaces ^3.3.0-rc
  • @nestjs/common ^11.0.11
  • @nestjs/core ^11.0.11
  • @nestjs/microservices ^11.0.11
  • @nestjs/platform-express ^11.0.11
  • @nestjs/platform-fastify ^11.0.11
  • @nestjs/swagger ^11.0.6
  • async-mutex ^0.4.0
  • axios ^1.8.3
  • class-transformer ^0.5.1
  • class-validator ^0.14.0
  • dotenv ^16.0.0
  • express ^5.1.0
  • gulp ^5.0.0
  • gulp-rename ^2.0.0
  • gulp-sourcemaps ^3.0.0
  • gulp-typescript ^6.0.0-alpha.1
  • hpp ^0.2.3
  • ioredis ^5.3.2
  • jsonwebtoken ^8.5.1
  • prom-client ^14.1.1
  • reflect-metadata ^0.1.13
  • rxjs ^7.8.1
  • ws ^8.2.1
  • yup ^1.1.1
api-tests/package.json npm
  • mocha ^9.2.0 development
  • axios ^1.3.6
application-events/package.json npm
  • @types/chai ^4.3.4 development
  • @types/express ^4.17.17 development
  • @types/js-yaml ^4.0.5 development
  • @types/mocha ^10.0.1 development
  • @types/node ^22.15.19 development
  • @types/swagger-ui-express ^4.1.3 development
  • chai ^4.3.7 development
  • chai-http ^4.3.0 development
  • mocha ^10.2.0 development
  • nodemon ^2.0.20 development
  • ts-node ^10.9.1 development
  • tslint ^5.20.1 development
  • tslint-config-standard ^9.0.0 development
  • @guardian/common ^3.3.0-rc
  • @guardian/interfaces ^3.3.0-rc
  • @types/express ^4.17.17
  • @types/morgan ^1.9.4
  • axios ^1.8.3
  • dotenv ^16.0.0
  • express ^5.1.0
  • js-yaml ^4.1.0
  • morgan ^1.10.0
  • swagger-ui-express ^4.3.0
  • typescript ^5.8.3
  • yup ^1.0.2
auth-service/package.json npm
  • @types/jsonwebtoken ^8.5.4 development
  • @types/node ^22.15.19 development
  • @types/node-vault ^0 development
  • mocha ^9.2.0 development
  • mocha-junit-reporter ^2.0.2 development
  • nodemon ^2.0.12 development
  • tslint ^6.1.3 development
  • typescript ^5.8.3 development
  • @guardian/common ^3.3.0-rc
  • @guardian/interfaces ^3.3.0-rc
  • @meeco/cryppo ^2.0.2
  • @mikro-orm/core 6.4.16
  • @mikro-orm/mongodb 6.4.16
  • @nestjs/common ^11.0.11
  • @nestjs/core ^11.0.11
  • @nestjs/microservices ^11.0.11
  • axios ^1.8.3
  • base-x ^4.0.0
  • base64url ^3.0.1
  • dotenv ^16.0.0
  • express ^5.1.0
  • gulp ^5.0.0
  • gulp-rename ^2.0.0
  • gulp-sourcemaps ^3.0.0
  • gulp-typescript ^6.0.0-alpha.1
  • jsonwebtoken ^8.5.1
  • node-vault ^0.10.0
  • pako ^2.1.0
  • prom-client ^14.1.1
  • prometheus-api-metrics 4.0.0
  • reflect-metadata ^0.1.13
  • rxjs ^7.8.1
common/package.json npm
  • @types/express ^5.0.1 development
  • @types/jszip ^3.4.1 development
  • @types/node ^22.15.19 development
  • esmock ^2.6.7 development
  • mocha-junit-reporter ^2.0.2 development
  • sinon ^20.0.0 development
  • tslint ^6.1.3 development
  • typescript ^5.8.3 development
  • @aws-sdk/client-secrets-manager ^3.812.0
  • @azure/identity ^4.10.0
  • @azure/keyvault-secrets ^4.9.0
  • @formulajs/formulajs 4.5.1
  • @google-cloud/secret-manager ^4.2.2
  • @guardian/interfaces ^3.3.0-rc
  • @hashgraph/sdk 2.63.0
  • @mattrglobal/jsonld-signatures-bbs ^1.1.2
  • @meeco/cryppo ^2.0.2
  • @mikro-orm/core 6.4.16
  • @mikro-orm/migrations-mongodb 6.4.16
  • @mikro-orm/mongodb 6.4.16
  • @nestjs/common ^11.0.11
  • @nestjs/core ^11.0.11
  • @nestjs/microservices ^11.0.11
  • @noble/curves ^1.3.0
  • @transmute/credentials-context 0.7.0-unstable.80
  • @transmute/did-context 0.7.0-unstable.80
  • @transmute/ed25519-signature-2018 0.7.0-unstable.80
  • @transmute/jsonld-schema 0.7.0-unstable.80
  • @transmute/security-context 0.7.0-unstable.80
  • @transmute/vc.js 0.7.0-unstable.80
  • ajv ^8.10.0
  • ajv-formats ^2.1.1
  • axios ^1.8.3
  • bs58 ^6.0.0
  • bson ^6.5.0
  • dotenv ^16.0.0
  • exceljs ^4.4.0
  • express ^5.1.0
  • js-base64 ^3.6.1
  • jsonld-signatures 11.5.0
  • jszip ^3.7.1
  • lodash.get ^4.4.2
  • lodash.set ^4.3.2
  • mathjs ^14.4.0
  • moment ^2.29.2
  • mongodb 6.16.0
  • nats ^2.6.1
  • node-vault ^0.10.0
  • prom-client ^14.1.1
  • reflect-metadata ^0.1.13
  • seq-logging ^2.2.0
  • ws ^8.2.1
demia/demia_tester_scripts/package-lock.json npm
  • asynckit 0.4.0
  • axios 1.7.7
  • combined-stream 1.0.8
  • delayed-stream 1.0.0
  • follow-redirects 1.15.9
  • form-data 4.0.1
  • mime-db 1.52.0
  • mime-types 2.1.35
  • proxy-from-env 1.1.0
demia/demia_tester_scripts/package.json npm
  • axios ^1.7.7
docker-compose-quickstart.yml docker