This coding challenge uses Cucumber to run tests which implement a hypothetical use-case for Hedera SDK.
Go to the GitHub repository and fork it into your own account.
Clone your forked repository to your local machine.
Navigate to the project directory and setup the environment by following the instructions in the section Installation.
Familiarize yourself with the structure of the project with the following key files and folders:
-
features/
: ContainsCucumber
feature files (*.feature
) that define test scenarios for consensus and token services. -
features/step_definitions/
: Contains TypeScript implementation files for the test scenarios. The implementation is incomplete causing the tests to fail. -
src/
: Contains utility functions and configurations.
Additional information can be found in the section Writing the tests.
Complete the code in the relevant files to ensure that all test cases can be executed successfully.
Utilize the Hedera SDK to create topics, publish messages, and manage tokens as required by the tests.
Refer to the Hedera documentation and learning resources provided in the section Learning resources for guidance on using the Hedera SDK.
You can run all tests using the commands provided in the section Running.
After ensuring that all tests pass, commit your changes and push your changes to your forked repository.
You should not edit the test files (*.features
). Your task is to complete the existing code to in the Typescript files (*.ts
) to ensure that the tests pass successfully. Focus solely on implementing the required functionality.
to install the dependencies, run pnpm install
after enabling the corepack: corepack enable
To run the tests you have multiple options:
- run
pnpm test
to run all steps - run
pnpm test:dev
to run all steps marked with the@dev
tag - run
pnpm test:wip
to run all steps marked with the@wip
tag - create your own tag and run the tests with
cucumber-js -p default --tags 'not @wip' --exit
The tests are implemented as steps
in the features
folder. You can use a plugin to your favourite IDE to write
the step definitions for you. An example has been left for reference
The config.ts
contains a list of private keys which can be used for testing. You can also replace those keys with
the ones from your own Hedera Console test accounts.
If you need more testnet accounts, you can:
- Register on the Hedera Portal - easiest way
- Create a testnet account in a Hedera Wallet like Hashpack or Blade and using the faucet - more work but allows to better understand what is going on
You can download a presentation providing an overview of Hedera Hashgraph and how to use its services
For the impatient, here are the main links for learning material: