Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added .cargo/config.toml
Empty file.
68 changes: 66 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,7 @@ bech32 = "0.11.0"

[build-dependencies]
tonic-prost-build = "0.14.1"
protoc-bin-vendored = "3"

[patch.crates-io]
fedimint-tonic-lnd = { path = "vendor/fedimint-tonic-lnd" }
6 changes: 0 additions & 6 deletions Cross.toml

This file was deleted.

2 changes: 1 addition & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ cargo --version
### Install dependencies

```bash
apt-get install cmake build-essential libsqlite3-dev libssl-dev pkg-config git sqlite3 -y
apt-get install build-essential libsqlite3-dev pkg-config git sqlite3 -y
```

### Compile Mostro
Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -340,13 +340,13 @@ Mostro supports three deployment methods. For production deployments, see [INSTA
Ubuntu/Debian:
```bash
sudo apt update
sudo apt install -y cmake build-essential libsqlite3-dev pkg-config protobuf-compiler
sudo apt install -y build-essential libsqlite3-dev pkg-config
```

macOS:
```bash
brew update
brew install cmake pkg-config sqlite3 protobuf
brew install pkg-config sqlite3
```

---
Expand Down Expand Up @@ -825,8 +825,8 @@ rustup update stable
cargo install sqlx-cli --version 0.6.2

# Development dependencies
sudo apt install protobuf-compiler cmake build-essential # Ubuntu
brew install protobuf cmake # macOS
sudo apt install build-essential # Ubuntu
# macOS: Xcode Command Line Tools provide the C compiler (xcode-select --install)
Comment on lines +828 to +829
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Development dependency command is currently incomplete for Ubuntu.

Line 828 only installs build-essential, but this README also lists libsqlite3-dev and pkg-config as required for native builds. Please keep these sections consistent.

📄 Suggested doc fix
- sudo apt install build-essential  # Ubuntu
- # macOS: Xcode Command Line Tools provide the C compiler (xcode-select --install)
+ sudo apt install -y build-essential libsqlite3-dev pkg-config sqlite3  # Ubuntu/Debian
+ # macOS: xcode-select --install && brew install pkg-config sqlite3
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@README.md` around lines 828 - 829, Update the Ubuntu installation line that
currently only installs build-essential to include the other native-build
dependencies listed elsewhere in the README: add libsqlite3-dev and pkg-config
(so the apt install command installs build-essential, libsqlite3-dev, and
pkg-config) and ensure the comment about macOS remains unchanged; update the
same code block/snippet where the current sudo apt install build-essential line
appears so both sections are consistent.

```

3. **Setup local environment**:
Expand Down Expand Up @@ -854,6 +854,8 @@ cargo fmt --all -- --check
cargo clippy --all-targets --all-features -- -D warnings
```

**Note on Protobuf**: No system-wide `protoc` installation is required. Mostro ships a `.cargo/config.toml` that points all build scripts (including transitive dependencies like `fedimint-tonic-lnd`) at the `protoc-bin-vendored` binary via the `.cargo/protoc-wrapper` script. Everything is handled automatically by `cargo build`.

---

### Project Structure
Expand Down
10 changes: 8 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
use std::process::Command;

fn main() {
// Compile protobuf definitions
if std::env::var_os("PROTOC").is_none() {
let protoc = protoc_bin_vendored::protoc_bin_path()
.expect("protoc-bin-vendored: could not determine protoc path");
std::env::set_var("PROTOC", &protoc);
}

// Compile protobuf definitions for the admin RPC service.
tonic_prost_build::configure()
.protoc_arg("--experimental_allow_proto3_optional")
.compile_protos(&["proto/admin.proto"], &["proto"])
.unwrap_or_else(|e| panic!("Failed to compile protos {:?}", e));

// note: add error checking yourself.
println!("cargo:rerun-if-changed=.git/refs/head/main");
let output = Command::new("git")
.args(["rev-parse", "HEAD"])
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM rust:1.86 AS builder

# Install build dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends cmake build-essential libsqlite3-dev pkg-config libssl-dev protobuf-compiler && \
apt-get install -y --no-install-recommends build-essential libsqlite3-dev pkg-config && \
rm -rf /var/lib/apt/lists/*


Expand Down
2 changes: 1 addition & 1 deletion docker/dockerfile-startos
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM rust:1.86-alpine AS builder

# Install build dependencies
RUN apk update && \
apk add --no-cache cmake build-base sqlite-dev pkgconfig protoc perl git
apk add --no-cache build-base sqlite-dev pkgconfig git

# Set working directory
WORKDIR /mostro
Expand Down
1 change: 1 addition & 0 deletions vendor/fedimint-tonic-lnd/.cargo-ok
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"v":1}
6 changes: 6 additions & 0 deletions vendor/fedimint-tonic-lnd/.cargo_vcs_info.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"git": {
"sha1": "f0211b66553bcec973589fa88066eb11c6ebcfca"
},
"path_in_vcs": ""
}
31 changes: 31 additions & 0 deletions vendor/fedimint-tonic-lnd/.github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Rust

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

env:
CARGO_TERM_COLOR: always

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: download protoc
run: sudo apt-get install -y protobuf-compiler
- name: Show cargo version
run: cargo --version
- name: Fetch
run: |
cargo fetch --locked
- name: Build
run: |
cargo build --release --frozen
- name: Test
run: |
cargo test --release --frozen --workspace
1 change: 1 addition & 0 deletions vendor/fedimint-tonic-lnd/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target
Loading