This document provides a detailed guide on how to set up your environment for developing and running the Valence co-processor app.
To interact with the Neutron domain, you need to provide a mnemonic seed phrase for an account which holds untrn tokens.
This will be needed in order to cover the gas fees during both provisioning, and runtime coordination stages.
First, create your own environment file from the provided example by running:
cp .example.env .envAfter that, open the newly created .env file and replace the placeholder todo with your mnemonic seed phrase.
MNEMONIC="your mnemonic seed phrase here"This mnemonic will be used by the provisioner and the coordinator to sign transactions.
We use Nix to provide a reproducible development environment.
The flake.nix file at the root of the project defines all the dependencies and tools required to build and run the project.
Nix is recommended but not required for development. The build process can load nix within docker or podman if nix is not available. You can install nix using one of the following methods:
- Determinate Systems Installer: https://docs.determinate.systems/getting-started/
- Nix Package Manager: https://nixos.org/download/
Once Nix is installed, you can enter the development shell by running the following command at the root of the project:
nix developThis will download all of the required dependencies and drop you into a shell with those dependencies available.
Note: Explicitly entering the development shell is not a necessity for developing co-processor apps. It is meant to serve the situations where more fine-grained control is needed for debugging or other purposes.
To manually build all the circuits and controllers, run the following command:
./build-circuits.shThis command executes the build-circuits.sh script, which does the following:
- check if nix is installed or load nix within docker/podman
- reads the
valence.tomlfile in the project root - builds each circuit and controller
- places the resulting artifacts in the
artifacts/coprocessordirectory