-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2.9.2 documentation only - library of policy examples (#1758)
* fix Signed-off-by: Stepan Kiryakov <[email protected]> * GitBook: [#213] Added GroupByFields property in aggregateBlock * GitBook: [#214] Setting up local IPFS Node * Setting Local IPFS node updated in ReadMe * GitBook: [#215] Added Multi Policy APIs * update Dovu policy (fix schemas) * update validation errors Signed-off-by: Stepan Kiryakov <[email protected]> * update validation errors Signed-off-by: Stepan Kiryakov <[email protected]> * fix Signed-off-by: Stepan Kiryakov <[email protected]> * GitBook: [#213] Added GroupByFields property in aggregateBlock * GitBook: [#214] Setting up local IPFS Node * Setting Local IPFS node updated in ReadMe * GitBook: [#215] Added Multi Policy APIs * MBP projects * bump version Signed-off-by: simvalery <[email protected]> * change hedera explorer Signed-off-by: artembuslaev <[email protected]> * always display delete action on selected block Signed-off-by: artembuslaev <[email protected]> * update hedera-sdk Signed-off-by: simvalery <[email protected]> * GitBook: [#220] Multi Policy UI * GitBook: [#221] corrected local node files * added message chunk setting Signed-off-by: artembuslaev <[email protected]> * #1014 MBP projects * update schemas * rename * Updated Verra Timestamp * added settings to change body request size Signed-off-by: artembuslaev <[email protected]> * add demo policy * GitBook: [#224] Changed DragonGlass to Ledger Works in FAQs * GitBook: [#225] how to change Explorer URL * add additional events * update lint * GitBook: [#227] ImpactAddon block added * GitBook: [#228] UI Automation Tests * GitBook: [#229] added AddiitonalMintEvent * GitBook: [#230] Added Impacts section in ReportBlock * fix display token type * fix dependency Signed-off-by: simvalery <[email protected]> * added IREC 8.1,8.2 in ReadMe * GitBook: [#231] Added IREC and Verra Intro * policy comparison * GitBook: [#232] Remote GHG Policy added * GitBook: [#233] Remote GHG Policy Demo images * GitBook: [#234] Artifacts APIs added * update * http request block config Signed-off-by: simvalery <[email protected]> * update * update * http-request-block Signed-off-by: simvalery <[email protected]> * fix lint Signed-off-by: simvalery <[email protected]> * add validation Signed-off-by: simvalery <[email protected]> * fix Signed-off-by: simvalery <[email protected]> * update * custom logic worker Signed-off-by: simvalery <[email protected]> * tokens retirement Signed-off-by: artembuslaev <[email protected]> * fixed endpoints, changed labels Signed-off-by: artembuslaev <[email protected]> * tokens retirement fixes Signed-off-by: artembuslaev <[email protected]> * up version Signed-off-by: simvalery <[email protected]> * fix Signed-off-by: artembuslaev <[email protected]> * fixed issue with double publishing retire schema Signed-off-by: artembuslaev <[email protected]> * fix deps Signed-off-by: simvalery <[email protected]> * GitBook: [#235] Retirement UI and APIs added * The worker-service now operates on the network specified by guardian-service. Signed-off-by: Giuseppe Bertone <[email protected]> * fix updating token balance in retirement process Signed-off-by: artembuslaev <[email protected]> * GitBook: [#236] corrected typo in retirement * added max transaction fee setting to worker Signed-off-by: artembuslaev <[email protected]> * update default max fee Signed-off-by: artembuslaev <[email protected]> * GitBook: [#237] Updated env parameters in installation * up version Signed-off-by: simvalery <[email protected]> * GitBook: [#239] UI Properties of Interface step Block deprecated * updated retirement docs, added some checks Signed-off-by: artembuslaev <[email protected]> * GitBook: [#240] Updated Contract APIs * fix preset and readonly fields in condition section Signed-off-by: artembuslaev <[email protected]> * remove setImmidiate Signed-off-by: simvalery <[email protected]> * update string formats ui validation Signed-off-by: artembuslaev <[email protected]> * GitBook: [#241] HTTP Request Block added * GitBook: [#242] Added blocks to available blocks * remove redundant logs Signed-off-by: simvalery <[email protected]> * CVE-2022-25878 Signed-off-by: simvalery <[email protected]> * disable autocomplete on tokens count Signed-off-by: artembuslaev <[email protected]> * change placeholder for url type field Signed-off-by: artembuslaev <[email protected]> * added retirement contract code Signed-off-by: artembuslaev <[email protected]> * update * Changed the iREC User Guide URL in ReadMe * Updated Verra User Guide link * fix lint Signed-off-by: simvalery <[email protected]> * fix tests Signed-off-by: simvalery <[email protected]> * GitBook: [#243] Corrected Creation of Root API in API Demo Guide of iREC * compare tokens * compare conditions * update * update * update * export in csv * update tymlez policies Signed-off-by: artembuslaev <[email protected]> * update * update * fix * fix * update * fix Signed-off-by: Stepan Kiryakov <[email protected]> * fix Signed-off-by: Stepan Kiryakov <[email protected]> * fix Signed-off-by: Stepan Kiryakov <[email protected]> * fix Signed-off-by: Stepan Kiryakov <[email protected]> * GitBook: [#244] Corrected time tracking format in GHG * fix Signed-off-by: Stepan Kiryakov <[email protected]> * GitBook: [#245] No subject * GitBook: [#247] Policy Differentiation UI * GitBook: [#248] No subject * GitBook: [#250] No subject * GitBook: [#251] Policy Differentiation UI * GitBook: [#252] Policy Differentiation APIs * GitBook: [#253] Schema Differentiation UI * GitBook: [#254] Schema Diff APIs * added possibility to include incomplete pairs Signed-off-by: artembuslaev <[email protected]> * added contract code, fix Signed-off-by: artembuslaev <[email protected]> * fix incomplete retire request for nft opposite token Signed-off-by: artembuslaev <[email protected]> * fix custom logic block error handling Signed-off-by: artembuslaev <[email protected]> * fix Signed-off-by: Stepan Kiryakov <[email protected]> * fix Signed-off-by: Stepan Kiryakov <[email protected]> * fix Signed-off-by: Stepan Kiryakov <[email protected]> * policy service Signed-off-by: simvalery <[email protected]> * fixes Signed-off-by: simvalery <[email protected]> * fix build Signed-off-by: simvalery <[email protected]> * fix build Signed-off-by: simvalery <[email protected]> * fix tests Signed-off-by: simvalery <[email protected]> * add title * fix Signed-off-by: artembuslaev <[email protected]> * fix select user role fix block updates Signed-off-by: simvalery <[email protected]> * refactor runner Signed-off-by: simvalery <[email protected]> * fix docker build Signed-off-by: simvalery <[email protected]> * GitBook: [#255] Updated Retirement screens * add package lock Signed-off-by: simvalery <[email protected]> * updated contract file id Signed-off-by: artembuslaev <[email protected]> * update transmute Signed-off-by: simvalery <[email protected]> * update transmute Signed-off-by: simvalery <[email protected]> * Temp fix Signed-off-by: simvalery <[email protected]> * fix Signed-off-by: simvalery <[email protected]> * fixes Signed-off-by: simvalery <[email protected]> * fix available block for interfaceDocumentSourceBlock Signed-off-by: artembuslaev <[email protected]> * fix trustchain Signed-off-by: simvalery <[email protected]> * GitBook: [#257] Updated timestamps * Updated iREC Timestamps * Updated Verra Timestamps * Updated GHG timestamp * GitBook: [#258] Updated Topic ID and Contract ID * fix lint Signed-off-by: simvalery <[email protected]> * fix deps Signed-off-by: simvalery <[email protected]> * refactor Signed-off-by: simvalery <[email protected]> * fix lint Signed-off-by: simvalery <[email protected]> * fix receive external data Signed-off-by: simvalery <[email protected]> * refactor Signed-off-by: simvalery <[email protected]> Signed-off-by: simvalery <[email protected]> * add .env Signed-off-by: simvalery <[email protected]> * remove api key Signed-off-by: simvalery <[email protected]> * fix versions Signed-off-by: simvalery <[email protected]> * fix policy init Signed-off-by: simvalery <[email protected]> * fix lint Signed-off-by: simvalery <[email protected]> * initialization messages Signed-off-by: simvalery <[email protected]> * optiomize docker builds Signed-off-by: simvalery <[email protected]> * GitBook: [#259] Added Mongo-admin-panel, target deployment * fix builds Signed-off-by: simvalery <[email protected]> * fix name Signed-off-by: simvalery <[email protected]> * fix duplicate retire requests Signed-off-by: artembuslaev <[email protected]> * fix contract query transaction fee Signed-off-by: artembuslaev <[email protected]> * production builds Signed-off-by: simvalery <[email protected]> * up version Signed-off-by: simvalery <[email protected]> * GitBook: [#261] library of policy * fix draft policy requests Signed-off-by: simvalery <[email protected]> * up version Signed-off-by: simvalery <[email protected]> * fix task callback undefined Signed-off-by: simvalery <[email protected]> * update retire requests in swagger Signed-off-by: artembuslaev <[email protected]> * GitBook: [#262] Role Library Policy * GitBook: [#263] Creation of forms library example * fix update json; fix check aggregate block props Signed-off-by: Stepan Kiryakov <[email protected]> * fix validation Signed-off-by: simvalery <[email protected]> * fix validation Signed-off-by: simvalery <[email protected]> * fix validation Signed-off-by: simvalery <[email protected]> * up version Signed-off-by: simvalery <[email protected]> * fix transaction response callback Signed-off-by: artembuslaev <[email protected]> * GitBook: [#264] Data input via forms example * GitBook: [#265] Token Policy Example * fix worker events Signed-off-by: simvalery <[email protected]> * fix destroy model Signed-off-by: simvalery <[email protected]> * GitBook: [#266] MRV Document Operations Example * GitBook: [#267] TrustChain Report Library Example * fix Signed-off-by: simvalery <[email protected]> * up version Signed-off-by: simvalery <[email protected]> * kill destroyed policy instance Signed-off-by: simvalery <[email protected]> * fix timeout error Signed-off-by: simvalery <[email protected]> * GitBook: [#268] Updated Deep Dive Architecture * GitBook: [#269] Added Timestamps for policy examples library * GitBook: [#270] Aggregation and split example * GitBook: [#271] Added cleared images for policy examples --------- Signed-off-by: Stepan Kiryakov <[email protected]> Signed-off-by: simvalery <[email protected]> Signed-off-by: artembuslaev <[email protected]> Signed-off-by: Giuseppe Bertone <[email protected]> Co-authored-by: Stepan Kiryakov <[email protected]> Co-authored-by: prernaa.agarwal <[email protected]> Co-authored-by: prernaadev01 <[email protected]> Co-authored-by: artembuslaev <[email protected]> Co-authored-by: artembuslaev <[email protected]> Co-authored-by: Stepan Kirjakov <[email protected]> Co-authored-by: Giuseppe Bertone <[email protected]>
- Loading branch information
1 parent
20d16e3
commit 9c373d9
Showing
60 changed files
with
161 additions
and
81 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+619 KB
...(1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+619 KB
...(1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (2).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
...andard-registry/policies/library-of-policy-examples/creating-and-using-roles.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 69 additions & 0 deletions
69
.../library-of-policy-examples/mrv-aggregation-and-splitting-for-minting-tokens.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# ➗ MRV aggregation and splitting for minting tokens | ||
|
||
For a demo example of following steps, here is the policy timestamp: **1675266693.102366003** | ||
|
||
## Adding aggregateDocumentBlock in separate containerAdding aggregateDocumentBlock in separate container**Task** | ||
|
||
MRV documents feature a numerical measurement field. The values in this field are periodically aggregated, in this example we will use 1 minute period. | ||
|
||
The purpose of the aggregation is to mint tokens, in this example 1 token will be minted for each part which equal to 1000 of the aggregated value. | ||
|
||
## **Preparation** | ||
|
||
Create a token and 2 schemas (**User** and **Report**). For simplicity the token will not require a KYC. | ||
|
||
Build the first part of the document entry: | ||
|
||
![image1.png](<../../../../.gitbook/assets/0 (3).png>) | ||
|
||
_(Please see_ [_examples 2_](data-input-via-forms-using-roles-to-partition-user-activities..md) _and_ [_3_](token-operations.md) _for more detailed description of this)_ | ||
|
||
### **Aggregate:** | ||
|
||
1. Add ‘**aggregateDocumentBlock**' after saving the document in the database. This is the block which would accumulate documents/values until the condition is met (which in this case is the event from the timer). | ||
|
||
1.1 Put '**aggregateDocumentBlock**' in a separate container to avoid it from interfering with the working of '**interfaceStepBlock**' | ||
|
||
![Adding aggregateDocumentBlock](<../../../../.gitbook/assets/1 (4).png>) | ||
|
||
![Adding aggregateDocumentBlock in separate container](<../../../../.gitbook/assets/2 (4).png>) | ||
|
||
1.2 Pass the document to the ‘_**aggregateDocumentBlock**_' after it is saved. | ||
|
||
![Passing the saved document to the aggregateDocumentBlock](<../../../../.gitbook/assets/3 (5).png>) | ||
|
||
2. Timer is a separate block called '_**timerBlock**_' | ||
|
||
2.1 For each user there is a separate timer execution context (i.e., each user has an independent timer). For this it requires a document owned by the user to be passed into this. To ensure this, let’s add the timer immediately after user registration. | ||
|
||
![Adding timerBlock after user registration](<../../../../.gitbook/assets/4 (3).png>) | ||
|
||
2.2 Set the timer to trigger every minute | ||
|
||
![Setting the timer for every minute](<../../../../.gitbook/assets/5 (2).png>) | ||
|
||
2.3 Now after the timer is launched, it would create a ‘**TimerEvent**’ periodically every minute. And then connect it with ‘_**aggregateDocumentBlock**_': | ||
|
||
![Connecting TimerBlock with aggregateDocumentBlock](<../../../../.gitbook/assets/6 (3).png>) | ||
|
||
### **Split:** | ||
|
||
1. To split the document into equal parts, add '_**splitBlock**_' | ||
|
||
1.1 Add '_**splitBlock**_' immediately after the '_**aggregateDocumentBlock**_' | ||
|
||
![Adding splitBlock after aggregateDocumentBlock](<../../../../.gitbook/assets/7 (4).png>) | ||
|
||
1.2 Configure the document field which would be used for splitting/aggregation | ||
|
||
![Configuring Source Field](<../../../../.gitbook/assets/8 (4).png>) | ||
|
||
1.3 Set a ‘**Threshold**’ to configure the value for splitting the document. | ||
|
||
<figure><img src="../../../../.gitbook/assets/9 (3).png" alt=""><figcaption><p>Setting the Threshold for split</p></figcaption></figure> | ||
|
||
### **Mint:** | ||
|
||
Add '_**mintDocumentBlock**_' immediately after ‘_**splitBlock**_' to mint tokes and configure the minting rule | ||
|
||
![Adding mintDocumentBlock after splitBlock](<../../../../.gitbook/assets/10 (4).png>) |
Oops, something went wrong.