LayerTwo-Labs / sidesail

A work-in-progress sidechain UI.
MIT License
6 stars 4 forks source link

drivechain-server: pull bdk-cli into build process, bundle with binary #223

Closed torkelrogstad closed 1 week ago

torkelrogstad commented 1 week ago

Currently we rely on the user having bdk-cli installed on their system. When we shell out we just use whatever is on the PATH: https://github.com/LayerTwo-Labs/sidesail/blob/1d67065b466a86c85540c2b7cfd594f7177039d6/drivechain-server/bdk/bdk.go#L65-L67

Instead, we should be doing the following:

  1. Create a script that builds bdk-cli with the correct tags. It is fine for this script to assume that Rust is already installed.
  2. As part of the build process for our server, build bdk-cli if it does not exist.
  3. Place bdk-cli into some sort of binary assets folder that's ignored by Git
  4. Bundle this binary assets folder using embed in the Go standard library
  5. When shelling out to bdk-cli, do this through this embedded binary