This page documents our development process.
- 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
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
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:
- Install Docker.
- Open VSCode in the respective directory (e.g.,
cd solarkraft/ && code .
). - Install the
Dev Containers
extension by Microsoft (VSCode may also prompt you to do this). - Build and open the container by selecting Dev Containers: Reopen in Container in the VSCode command palette (
Ctrl-Shift-P
, orCmd-Shift-P
on macOS).
-
On the first run, install the required npm packages:
npm i
-
Compile the project:
npm run compile
-
Run the unit tests:
npm run test
-
Install a local version (once):
npm link
-
Run the command-line interface:
solarkraft
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.