guardian icon indicating copy to clipboard operation
guardian copied to clipboard

Insert JSON payload examples in the methodology library

Open Neurone opened this issue 1 year ago • 0 comments

Problem description

While Excel is a great tool for enterprises and business users, developers testing policies should be able to use JSON files to send data to Guardian instead of manually filling in the project data via the WebUI.

Also, Excel always takes into account business-relevant information, which often results in thousands of tokens being mined.

Requirements

Add JSON payloads to the sample materials for methodologies in the library. The example should not cover all operations, just the most complex ones (i.e., the PDD).

I suggest creating at least two versions of the same file:

  • one following exactly one of the scenarios you can find in the Excel file
  • one is the copy of the previous file, but with reduced values, so that the minting process is always at max in hundreds, and not thousands

See the attached examples for the CDM AMS.III-F policy.

  • The first file follows the Excel version exactly, minting 30k+ tokens.
  • The light version mints less than 200 tokens, so it's faster and cheaper to play with the policy.

The light version does not need to maintain the business consistency and coherence we find in the Excel file.

Definition of done

When I download materials for a policy, I can also download some sample JSON payloads that I can send to Guardian via REST clients, CLI, etc. For example:

curl --request POST \
 --url http://localhost:3000/api/v1/policies/66bf9080bdbe5d24abe7897c/blocks/ac9da012-0afd-4091-9f2f-e1d9bcd2fabb \
 --header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5xxx' \
 --header 'Content-Type: application/json' \
 --header 'Origin: http://localhost:3000/' \
 --data "@./Methodology Library/CDM/CDM AMS-III.F/ams.iii.f-few-tokens.json"

cdm.ams.iii.f.json cdm.ams.iii.f-few-tokens.json

Neurone avatar Aug 21 '24 18:08 Neurone