This repository now owns the local DB pipeline through Nix and a local raindex submodule instead of downloading a prebuilt CLI artifact. It also contains the Terraform, NixOS, and GitHub workflow pieces needed to deploy the remote sync host.
lib/raindex: git submodule containing the upstream Rust CLI and pipeline sourceflake.nix: flake entrypoints for building the local CLI, syncing, and uploadinginfra/: Terraform configuration and helper tasks for the deployment hostos.nix: NixOS definition for the deployed sync machine.github/workflows/deploy.yaml: manual deployment workflow.github/workflows/provision-host.yaml: manual provisioning workflow
Bootstrap the repo and run the upstream raindex prep flow:
./prep.shBuild the local CLI artifact explicitly. This writes ./rain-orderbook-cli in the repository root:
nix run .#build-raindex-cliCopy .env.example to .env, then fill in the values you need.
Run the sync step:
nix run .#local-db-syncUpload an existing local-db directory without re-running sync:
nix run .#local-db-uploadCreate and upload an empty remote manifest:
nix run .#local-db-create-empty-manifestCreate and upload an empty remote manifest through GitHub Actions:
- Run
.github/workflows/create-empty-local-db-manifest.yaml - The workflow uploads
local-db-manifests/<epoch-ms>/manifest.yaml - It calls
nix run .#local-db-create-empty-manifest - It returns the public manifest URL in the workflow summary
The source still lives in the local submodule, and you can run it directly from there with:
nix develop -c cargo run --locked --manifest-path lib/raindex/Cargo.toml -p rain_orderbook_cli -- --helpProvision infrastructure:
nix run .#tf-edit-vars
nix run .#tf-init
nix run .#tf-plan
nix run .#tf-applyBootstrap the fresh host to NixOS:
nix run .#bootstrap-nixosOr do the same from GitHub Actions:
- Run
.github/workflows/provision-host.yaml - Run it from
main - Set
bootstrap_nixos=trueonly when you want to install or reinstall NixOS on the droplet - Re-running the workflow without
bootstrap_nixosis safe for normal Terraform reconciliation - Re-running with
bootstrap_nixos=trueis not a no-op; it will re-bootstrap the machine
Resolve the currently provisioned host:
nix run .#resolve-ipDeploy the latest code and runtime config through GitHub Actions:
- Run
.github/workflows/deploy.yaml - Provide the
settings_urlinput - The workflow runs
./prep.sh, builds./rain-orderbook-cli, deploys the host config, uploads the binary and runtime env file, and startslocal-db-sync.service - The deployed machine runs
local-db-sync.timerevery five minutes with no overlapping runs