Note: This repo is still in early development and is not ready for production use.
Ths repository builds off the developer experience within https://github.com/stacks-network/sbtc-developer-release.
All decisions are made and tracked via GitHub issues where they and their rationale can be verified publicly. Due to sBTC's critical nature extensive research and planning has been done to ensure all funds remain secure on launch.
Before going any further please review our code of conduct
This repository is under development and this section may become outdated. Please open a GitHub issue if you believe some tools are missing.
The following are the developer tools that you should install on your local machine in order to build and run the sources in this repository.
- Cargo - Installation Guide - Builds rust packages.
- Cargo-lambda - Installation Guide - Compile the package for AWS Lambda.
- pnpm - Installation guide - Manages node packages
- Make - Development task runner; natively present on nearly every system.
- Docker - Installation Guide. This is used for running integration tests.
- protoc - Installation Guide. Compiles protobuf files.
If you have nix
and flakes
installed (e.g. through the DeterminateSystems
installer), running the
following command will enter a shell with all dependencies installed:
$ nix develop
This command should check the version of the dependencies required for the sBTC resources to be built and tested.
echo "\n--- sBTC tool versions ---" \
&& cargo --version \
&& cargo lambda --version \
&& echo "pnpm $(pnpm --version)" \
&& make --version | head -n 1
Below is the output on a machine that is able to build and run all the sources and tests.
--- sBTC tool versions ---
cargo 1.77.2 (e52e36006 2024-03-26)
cargo-lambda 1.2.1 (12f9b61 2024-04-05Z)
pnpm 8.15.4
GNU Make 3.81
To build the sources we recommend you use the Makefile
commands; they'll build the dependencies in the right order.
make install
- Installs node dependenciesmake build
- Builds packagesmake lint
- Lints packagesmake clean
- Cleans workspacemake test
- Run non-integration testsmake integration-test
- Run integration tests.- Before running integration tests you must run
make integration-env-up
- After running integration tests you must run
make integration-env-down
- Before running integration tests you must run
For other commands read the Makefile
at repository root.
A local development network is managed through a Docker Compose file in ./devenv/local/docker-compose
. make
commands for starting and stopping it are:
make devenv-up
: Start the networkmake devenv-down
: Stop the network and remove containers and networks
Once running, the following services are available:
- Stacks node at localhost:20443
- Stacks API at localhost:3999
- Bitcoin node at devnet:devnet@localhost:18443
- 3 Nakamoto signers at localhost:30000, localhost:30001, and localhost:30002
- Stacks explorer at localhost:3020
- Mempool.space Bitcoin explorer at localhost:8083
./devenv/hooks
contains Git hooks you can install to run
pre-commit
checks. You can (optionally) run make install-git-hooks
to
install them. Be advised: under the hood, the hooks will run make lint
, which
relies on clippy
and rust fmt
and might need to download and compile
dependencies.
This project currently supports development on UNIX-based operating systems but does not support development on Windows or z/OS.