Initial repo setup
To be able to build the code, there is some first-time setup required.
Set up nix + direnv (the developer environment)
We use nix to manage all of the dependencies during development. While most of the software can use convnetional rust tools like cargo, we do have a few additional dependencies. Instead of apt-installing them, we use nix as the package manager, and use direnv to handle automatically activating a developer shell. The process to install and configure these two tools is as follows:
- Install nix. This works for both mac and linux, if you are using a windows machine, you must first set up WSL2.
- Ensure that you have these lines in your
~/.config/nix/nix.conf
or/etc/nix/nix.conf
. This is done automatically by the above installer:
You can check that things work by runningexperimental-features = nix-command flakes max-jobs = auto
nix run nixpkgs#hello
- Install direnv:
nix profile install nixpkgs#direnv
- Hook direnv into your shell.
- Set up your personalized .envrc file by running
cp .envrc.example .envrc
. You can customize this file if you wish. We recommend filling in your cachix token if you have one. If prompted, dont rundirenv allow
yet, follow step 6 first. Otherwise you'll get a bunch of errors. - Follow the instructions on vendoring proprietary SDKs in the subsequent section.
- Run
direnv allow
in the repository's root directory. Direnv will then automatically use the .envrc file you set up any time youcd
into the directory. - If you are on macos, run the following:
brew install dbus brew services start dbus
- Install git lfs:
git lfs install git lfs pull
Vendoring proprietary SDKs
Although all of Worldcoin's code in the orb-software repo is open source, some of the sensors on the orb rely on proprietary SDKs provided by their hardware vendors. Luckily, these are accessible without any cost, they are just annoying to get and are not themselves open source.
To get started, you will need to download these SDKs. The process for this depends on if you are officially affiliated with Worldcoin.
If you have access to Worldcoin private repos
- Create a personal access token from github to allow you to use private git repos over HTTPS.
- Append the following to your
~/.config/nix/nix.conf
:access-tokens = github.com=github_pat_YOUR_ACCESS_TOKEN_HERE
- Test everything works so far by running
nix flake metadata github:worldcoin/priv-orb-core
. You should see a tree of info. If not, you probably don't have your personal access token set up right - post in slack for help.
If you don't have access to Worldcoin private repos
- Go to https://developer.thermal.com and create a developer account. Getting the SDK can take several days for Seek Thermal to approve access. In the meantime, you can skip steps 2 and 3.
- Download the 4.1.0.0 version of the SDK (its in the developer forums).
- Extract its contents, and note down the dir that contains the
Seek_Thermal_SDK_4.1.0.0
dir. - modify your
.envrc
like this:use flake --override-input seekSdk "PATH_FROM_STEP_3"
. If you don't yet have access to the SDK, just provide a path to an empty directory.