developer experience: test ledgers
Is your feature request related to a problem? Please describe. A major advantage of Cactus is that It provides reliable, automated infrastructure for testing smart contracts, business logic plugins, and others. For example, although a company might already have its own connector and thus not necessarily need to use Cactus one's, probably they do not have test ledgers.
Describe the solution you'd like Write a few tutorials on how to use the test ledgers.
Additional context This can also be used in the Hyperledger Summer Internship project on putting together a Cactus workshop, in case it is accepted.
@RafaelAPB Trying to cut some corners here: How about a curated set of test cases that demonstrate in a (relatively) easy/digestible manner how to use the test ledgers? My reasoning: The tutorial itself would most likely consist of just the copy pasted code of some test case that uses the test ledgers anyway, but some of the test cases are complicated so it does make a difference if we have a section/page in the docs called "Using the Test Ledgers" and in there we link to some of my "favorite" test cases where the code is relatively clean/easier to read. To make it a little more visual, we could record videos of step-through debugging and show people how it works in practice for things like:
- Random port assignments
- The dynamic key retrievals for Besu for example
- The SSH config for Corda, etc.
This might help demystifying it a little bit because in my experience what people struggle with the most at first is that the test ledgers have most things dynamically retrieved at runtime instead of what people are used to (which is hardcoded credentials for everything)
That's an excellent suggestion. I would like to help with this, but I can't commit in the short term.
That's an excellent suggestion. I would like to help with this, but I can't commit in the short term.
@RafaelAPB Thank you! No worries, we can keep this open a while longer and track it. :-)
Working on this
"Using the Test Ledgers" and in there we link to some of my "favorite" test cases where the code is relatively clean/easier to read.
Can you list the test cases which you think are good for this task? @petermetz
@ashnashahgrover Any test in major connectors uses test ledgers; we can show how to deploy smart contracts; read blocks; and also see Peter's suggestions. I suppose these code tutorials can be placed under the test-tooling package as examples. If you work on this, please also update the main README.md with references to these resources. Thanks for working on this!
@ashnashahgrover Sorry for the slow response! Here's a list:
- packages/cactus-test-plugin-ledger-connector-besu/src/test/typescript/integration/grpc-services/connector-besu-grpc-services.test.ts
- packages/cactus-cmd-api-server/src/test/typescript/integration/jwt-endpoint-authz-scope-enforcement.test.ts
Hi @petermetz , if we want to showcase what features our test ledgers, how can we dynamically retrive the cypto and other configs from the test ledgers and port assignments, then can we work with this test case instead?
Hi @petermetz , if we want to showcase what features our test ledgers, how can we dynamically retrive the cypto and other configs from the test ledgers and port assignments, then can we work with this test case instead?
@jagpreetsinghsasan Yup, works for me!