test(stellar-test-ledger): Stellar Test Ledger
Is your feature request related to a problem? Please describe. Implement a Test Ledger able to pull up a docker image with a stellar network core, validators, and necessary services(Horizon API, Soroban RPC, and Friendbot) to run Stellar-related Cacti tests against.
Describe the solution you'd like The Stellar Test Ledger should:
- Start, stop, and destroy a docker container with the test ledger.
- Contains all the necessary services to execute complete use cases in Stellar.
- Horizon API server for interacting with the Stellar network.
- Soroban RPC for interacting with smart contracts.
- Friendbot for starting and funding accounts in a test environment.
- Ensure all services are available before allowing the tests to be executed.
- Allow for an ephemeral pristine local ledger to be started with no history.
Additional context This is the first step of the initiative mention in the issue https://github.com/hyperledger/cacti/issues/3238 .
With @petermetz 's assistance, I begin by pulling up the code from this branch https://github.com/hyperledger/cacti/pull/3235 and implemented a working prototype version for this test ledger in my fork of Cacti. You can access and test in this branch:
- stellar-connector: https://github.com/fazzatti/cacti/tree/stellar-connector
There, it is possible to test the Test Ledger directly by triggering the following tests:
yarn jest packages/cactus-test-tooling/src/test/typescript/integration/stellar/stellar-test-ledger/constructor-validates-options.test.ts
These tests will validate that the StellarTestLedger class operates correctly and exposes the services properly for the tests to be conducted.
If one would like to further test this test ledger, there are temporary tests under the connector tests directory that can be executed with:
yarn jest packages/cacti-plugin-ledger-connector-stellar/src/test/typescript/integration/plugin-ledger-connector-stellar/validate-test-ledger.test.ts
I'm just using these temporarily to start working on the connector but they can triggered in this branch to execute a few simple stellar transactions such as creating accounts and performing payments to ensure all services are operating correctly.
Happy to help reviewing the PR when you have a first draft! Thanks for your contribution