Skip to content

Latest commit

 

History

History
90 lines (62 loc) · 2.86 KB

CONTRIBUTING.md

File metadata and controls

90 lines (62 loc) · 2.86 KB

Contributing

This page documents our development process.

1. Project layout

  • solarkraft contains the source code of the Solarkraft package
  • ContractExamples contains Soroban smart contracts that we use for testing
  • doc contains general documentation
  • assets contains project assets such as the project logo

2. Solarkraft dev environment

Solarkraft is written in TypeScript. It uses the standard development tooling:

  • npm is the package manager
  • tsc is the TypeScript compiler
  • NodeJS is the runtime environment
  • MochaJS and ChaiJS are the testing framework
  • eslint is the code linter
  • prettier is the code formatter
  • husky is the hook manager that runs basic tests on git commits

2.1 Dev containers

To easily set up your dev environment, we provide VSCode dev containers.

There is one for Solarkraft development in ./solarkraft, and one for Soroban development in ./ContractExamples.

To use the dev containers:

  1. Install Docker.
  2. Open VSCode in the respective directory (e.g., cd solarkraft/ && code .).
  3. Install the Dev Containers extension by Microsoft (VSCode may also prompt you to do this).
  4. Build and open the container by selecting Dev Containers: Reopen in Container in the VSCode command palette (Ctrl-Shift-P, or Cmd-Shift-P on macOS).

3. Basic development commands

  1. On the first run, install the required npm packages:

    npm i
  2. Compile the project:

    npm run compile
  3. Run the unit tests:

    npm run test
  4. Install a local version (once):

    npm link
  5. Run the command-line interface:

    solarkraft

4. Deployment

We are still discovering an optimal setup. The Soroban instructions are given in #10. Further, Soroban does not seem to build well on MacOS, owing to this issue.

To work around these problems, you can use our dev containers (see above), to get a reproducible dev environment.