Skip to content

Latest commit

 

History

History
50 lines (34 loc) · 2.55 KB

CONTRIBUTING.md

File metadata and controls

50 lines (34 loc) · 2.55 KB

Contributing to this repository

This is a quick guide to help you contribute to this repository

Getting started

The root folder has a private package.json containing a few scripts and JavaScript dependencies that help generate IDLs; clients and start a local validator. First, ensure you have yarn installed and run the following command to install the dependencies.

yarn install

You will then have access to the following commands.

  • yarn programs:build - Build all programs and fetch all dependant programs.
  • yarn programs:test - Test all programs.
  • yarn programs:debug - Test all programs with logs enabled.
  • yarn programs:clean - Clean all built and fetched programs.
  • yarn clients:rust:test - Run the Rust client tests.
  • yarn clients:js:test - Run the JS client tests.
  • yarn generate - Shortcut for yarn generate:idls && pnpm generate:clients.
  • yarn generate:idls - Generate IDLs for all programs, as configured in the configs/shank.cjs file.
  • yarn generate:clients - Generate clients using Kinobi, as configured in the configs/kinobi.cjs file.
  • yarn validator - Start a local validator using Amman, as configured in the configs/validator.cjs file.
  • yarn validator:debug - Start a local validator using Amman with logs enabled, as configured in the configs/validator.cjs file.
  • pnpm validator:stop - Stop the local validator.
  • pnpm validator:logs - Show the logs of the local validator.

Managing clients

Each client has its own README with instructions on how to get started. You can find them in the clients folder.

In order to generate the clients, run the following command.

yarn generate

You will need to run yarn generate to re-generate the clients when something changes in the program(s).

Setting up CI/CD using GitHub actions

Most of the CI/CD should already be set up for you and the .github/.env file can be used to tweak the variables of the workflows.

However, the "Publish JS Client" workflow — configured in .github/workflows/publish-js-client.yml — requires a few more steps to work. See the CONTRIBUTING.md file of the JavaScript client for more information.

Similarly, the "Publish Rust Client" workflow — configured in .github/workflows/publish-rust-client.yml — requires a few more steps to work. See the CONTRIBUTING.md file of the Rust client for more information.