Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Insert JSON payload examples in the methodology library #4068

Open
Neurone opened this issue Aug 21, 2024 · 0 comments
Open

Insert JSON payload examples in the methodology library #4068

Neurone opened this issue Aug 21, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@Neurone
Copy link
Contributor

Neurone commented Aug 21, 2024

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 Neurone added the enhancement New feature or request label Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant