chainlink icon indicating copy to clipboard operation
chainlink copied to clipboard

[DEVEL] Notation for json data parameters in V2 toml jobs

Open orzdk opened this issue 3 years ago • 7 comments

Hey, regarding toml specs:

In vrf-spec.toml and keeper-spec.toml the data parameter for ethabiencode is using the escaped body notation, whereas in direct-request-spec-cbor.toml and multiword-response-spec.toml, the much more readable angled-bracket-curly-bracket notation is used. Is is correct to assume that the angled bracket notation will be used going forward?

In vrf-spec.toml a txMeta parameter is provided to the ethtx task, but it is also using escaped body notation. Will ethtx.txMeta parameter also use angled bracket notation going forward?

Same questions apply to http.requestData parameter.

Another question not related to json. Re. tasks usd_multiply, eur_multiply and jpy_multiply in multiword-response-spec.toml: is that comma supposed to be there?

Thank you : )

orzdk avatar Sep 05 '21 14:09 orzdk

Hi @orzdk , thanks for raising this, can you please put these questions in a post on stackoverflow? Seems like there would be a better place to answer, giving visibility to other developers. 1, 2 and 3 are related so can be put in one SO post, then 4 is separate so probably deserves its own. thanks! https://stackoverflow.com/tags/chainlink

pappas999 avatar Sep 10 '21 03:09 pappas999

I think I may have been unclear. I am not posting a technical question, I am reporting that the templates that Chainlink provides as examples for migration to TOML jobs, are not consistent in their syntax.

orzdk avatar Sep 10 '21 05:09 orzdk

@orzdk I think I'm following. Do you have examples of where we show the differences?

PatrickAlphaC avatar Sep 20 '21 11:09 PatrickAlphaC

Thank you for looking at this. 100% consistent, working sample files in sync with the documentation are essential for successful migration to V2. Also, the inconsistencies seem to have some relation to the ethabiencode UI bug, so from that perspective maybe even more interesting.

This should cover it, except the comma-thing, all is related to sending json data as a parameter to a v2 "ethabiencode", "http" or "ethTx" task:

  • direct-request-spec-cbor.toml, line 15, line 18-23, angle bracket notation (ethabiencode, "data" parameter)
  • keeper-spec.toml, line 12, line 24, line 30, escaped body notation (ethabiencode, "data" parameter)
  • multiword-response-spec.toml, line 40-44, line 47-52, angle bracket notation (ethabiencode, "data" parameter)
  • multiword-response-spec.toml, line 21, line 26, line 31 (stray comma between keys?)
  • oracle-spec-invalid-key.toml, line 25, escaped body notation (http, "requestData" parameter)
  • oracle-spec.toml, line 26, escaped body notation (http, "requestData" parameter)
  • vrf-spec.toml, line 20, line 25, escaped body notation (ethabiencode, "data" parameter & ethTx, "txMeta" parameter)
  • vrf-v2-spec.toml, line 25, angle bracket notation (ethTx, "txMeta" parameter)

Also, an example for webhook job with external initiators, as described in release 0.10.11 is missing.

orzdk avatar Sep 20 '21 13:09 orzdk

Gotcha. Thank you for making this!

We'd added to our todo list

PatrickAlphaC avatar Sep 20 '21 17:09 PatrickAlphaC

https://docs.chain.link/docs/jobs/#example-v2-job-spec

Why it does not have type "vrf" in the documentation?

jjhesk avatar Oct 11 '21 10:10 jjhesk

Please Please add vrf V2 toml job spec the working example in the documentation. Because we have no idea how to setup up the VRF machine using V2 spec. Thanks. @PatrickAlphaC

jjhesk avatar Aug 31 '22 08:08 jjhesk