The Guardian is a modular open-source solution that includes best-in-class identity management and decentralized ledger technology (DLT) libraries. At the heart of the Guardian solution is a sophisticated Policy Workflow Engine (PWE) that enables applications to offer a requirements-based tokenization implementation.
HIP-19 · HIP-28 · HIP-29 · Report a Bug · Request a Policy or a Feature
As identified in Hedera Improvement Proposal 19 (HIP-19), each transaction on the Hedera network must contain a specific identifier in the memo field for discoverability. The Guardian demonstrates this when every Hedera Consensus Service transaction is logged to a Hedera Consensus Service Topic. Observing the Hedera Consensus Service Topic, you can discover newly minted tokens. In the memo field of newly minted tokens, you will find a Verifiable Link which will allow users to discover the published standard the token is following and the entire history of the ESG asset and corresponding data to be publicly discoverable. This is further defined in Hedera Improvement Proposal 28 (HIP-28)
To get a local copy up and running, follow these simple example steps. When building the reference implementation, you can manually build every component or run one command with Docker.
- Docker (To build with one command)
- MongoDB, NodeJS and Nats (If you build with docker these components will be installed automatically)
- Hedera Testnet Account
- NFT.Storage Account
-
Clone the repo
git clone https://github.com/hashgraph/guardian.git
-
Update the following files with your Hedera Testnet account info (see prerequisites) as indicated. Please keep in mind that this Hedera Operator ID and Operator Key is used for this reference implementation as a placeholder until there is a wallet integration. There will be other steps in the Demo Usage Guide that will require the generation of Operator IDs and Operator Keys. It is important to mention that the Operator IDs and Operator Keys in the .env will be used to generate demo accounts.
For example:
in
guardian-service/.env
:OPERATOR_ID="0.0.29676495" OPERATOR_KEY="302e020100300506032b6570042204202119d6291aab20289f12cdb27a0ae446d6b319054e3de81b03564532b8e03cad"
in
guardian-service/.env.docker
:OPERATOR_ID="0.0.29676495" OPERATOR_KEY="302e020100300506032b6570042204202119d6291aab20289f12cdb27a0ae446d6b319054e3de81b03564532b8e03cad"
Note: You can use the Schema Topic ID listed above or you can enter your own if you have one.
-
Update the following files with your NFT.Storage API KEY. Please follow the steps from https://nft.storage/#getting-started to obtain it.
For example:
in
ipfs-client/.env
:NFT_API_KEY="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJkaWQ6ZXRocjoweGVhNzVBQzEwMmM2QTlCQjc4NDI5NDNlMmMzMUNEMzBmRUNmNUVmMTIiLCJpc3MiOiJuZnQtc3RvcmFnZSIsImlhdCI6MTY0MjQyODUxMDUzMywibmFtZSI6IklQRlMifQ.BjD1EJM1OBWmYClDbRoR1O9vrU3_5-Isb292w3PSSAI"
in
ipfs-client/.env.docker
:NFT_API_KEY="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJkaWQ6ZXRocjoweGVhNzVBQzEwMmM2QTlCQjc4NDI5NDNlMmMzMUNEMzBmRUNmNUVmMTIiLCJpc3MiOiJuZnQtc3RvcmFnZSIsImlhdCI6MTY0MjQyODUxMDUzMywibmFtZSI6IklQRlMifQ.BjD1EJM1OBWmYClDbRoR1O9vrU3_5-Isb292w3PSSAI"
-
If you want to build with Docker. Please note that the Docker build is meant to be used in production and will not contain any debug information. (Once this step you are finished)
docker-compose up -d --build
-
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.
From the interfaces folder
Build package
npm install npm run build
From the common folder
Build package
npm install
npm run build
**From the Logger service folder**
To build the service:
npm install npm run build
To start the service:
npm start
**From the Auth service folder**
To build the service:
npm install npm run build
To start the service:
npm start
**From the IPFS Client folder**
To build the service:
npm install npm run build
To start the service:
npm start
**From the Guardian Service folder**
To build the service:
npm install npm run build
To start the service (found on http://localhost:3004):
npm start
**From the API Gateway Service folder**
To build the service:
npm install npm run build
To start the service (found on http://localhost:3002):
npm start
**From the MRV Sender Service folder**
To build the service:
npm install npm run build
To start the service (found on http://localhost:3005):
npm start
**From the Frontend folder**
To build the service:
npm install npm run build
To start the service (found on http://localhost:4200):
npm start
### Note: Once you start the service, please wait for the Initialization Process to be completed.
### Local development using docker
1. create .env file at the root level and update all variable requires for docker
```sh
cp .env.example .env
- Start local development using docker compose
docker-compose -f docker-compose-dev.yml up --build
- Access local development using http://localhost:3000 or http://localhost:4200
To delete all the Containers
docker builder prune --all
To run by cleaning Docker Cache
docker-compose build --no-cache
To run guardian-service unit tests, following commands needs to be executed:
cd guardian-service
npm run test
It is also an ability to run Hedera network test only. To do that, the following command needs to be executed:
npm run test:network
To run stability tests (certain transactions will be executed 10 times each), the following command needs to be executed:
npm run test:stability
For complete documentation on following points. Please refer https://docs.hedera.com/guardian
- Swagger API
- Postman Collection
- Demo Usage guide
- Contribute a New Policy
- Reference Implementation
- Technologies Built on
- Roadmap
- Change Log
- Contributing
- License
- Security
For any questions, please reach out to the Envision Blockchain Solutions team at:
- Website: <www.envisionblockchain.com>
- Email: info@envisionblockchain.com