⛓️

TrustChain reports

For a demo example of following steps, here is the policy timestamp: 1675176247.137536341

Task

Create a report to check a chain of documents.

Preparation

We will use example 4 to assemble multiple documents to build a realistic-looking Trustchain.
Let’s add several additional attributes into the documents to simplify the document search.
Adding Entity
Adding Status
Adding Entity
Adding Entity
Adding Type Attribute

Building the trustchain report:

  1. 1.
    Using the ‘reportBlock
1.1 Add new container
Adding new container
1.2 Add ‘reportBlock
Adding reportBlock
In Guardian policy ‘reportBlock’ finds VP documents based on their id or hash and displays document information, related policy and token information. To retrieve the linked information ‘reportItemBlock’ must be used.
1.3 We will build the following chain in this example: mint _VP – MRV Report – Project (approved and signed the the Approver) – Approver document – Project (created and signed by the user) – User document._
We will need 6 ‘reportItemBlock’ items correspondingly, 1 per each document.
Adding 6 reportItemBlocks
The ‘reportItemBlock’ items are executed sequentially, thus in the filter for each consecutive ‘reportItemBlock’ we can use values from the previous blocks/documents.
1.3.1 ‘mint_document’. To find this document which described the token mint operation we will use one of the Common Variables - actionId
Using actionId value
1.3.2 ’report_document. To find the MRV report (i.e. data document which was the basis of the decision to mint tokens) we will also use one of the Common VariablesdocumentId
Adding documentId value
To find further documents we will need to use values from the Ref variable which point to the previous document. Let’s save in a new variable:
Using Ref variable
1.3.3 ’project_document(approver) - Lets use the previously defined variable alongside the static filtration parameters.
Using previously defined variables
Save the author of the document signature so we can display the information about the user later
Saving document signature
Use the same approach to continue the chain until the end.
1.3.4 approver_document
defining approver_document block
1.3.5 ’project_document(user)
defining project_document(user) block
1.3.6 ’user_document
defining user_document block
  1. 2.
    To activate the ‘reportBlock’ an id or a hash of the VP document is needed, we will add the grid containing the list of the VP documents and links to the trustchain.
2.1 Add ‘interfaceContainerBlock’, ‘interfaceDocumentsSourceBlock’ and ‘documentsSourceAddon
Adding 3 Blocks
2.2 Add new column with the type BUTTON
Adding type Button
Setting the Action to LINK will cause the Policy Engine to attempt to switch the display to the target policy block upon the user clicking the link (if possible).

Demo

VPs:

Trustchain: