cacti icon indicating copy to clipboard operation
cacti copied to clipboard

developer experience: test ledgers

Open RafaelAPB opened this issue 3 years ago • 9 comments

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 avatar Mar 14 '22 11:03 RafaelAPB

@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:

  1. Random port assignments
  2. The dynamic key retrievals for Besu for example
  3. 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)

petermetz avatar Oct 06 '23 18:10 petermetz

That's an excellent suggestion. I would like to help with this, but I can't commit in the short term.

RafaelAPB avatar Oct 07 '23 13:10 RafaelAPB

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. :-)

petermetz avatar Oct 09 '23 18:10 petermetz

Working on this

ashnashahgrover avatar Jun 14 '24 07:06 ashnashahgrover

"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 avatar Jun 20 '24 06:06 ashnashahgrover

@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!

RafaelAPB avatar Jul 04 '24 10:07 RafaelAPB

@ashnashahgrover Sorry for the slow response! Here's a list:

  1. packages/cactus-test-plugin-ledger-connector-besu/src/test/typescript/integration/grpc-services/connector-besu-grpc-services.test.ts
  2. packages/cactus-cmd-api-server/src/test/typescript/integration/jwt-endpoint-authz-scope-enforcement.test.ts

petermetz avatar Jul 10 '24 04:07 petermetz

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?

TheJagpreet avatar Jul 17 '24 08:07 TheJagpreet

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!

petermetz avatar Jul 18 '24 02:07 petermetz