broker Dockerfile

This commit is contained in:
Evan Feenstra
2022-09-14 15:01:29 -07:00
parent dc2afb0547
commit fad091c413
5 changed files with 53 additions and 2 deletions

View File

@@ -2,7 +2,6 @@
members = [
"signer",
"broker",
"parser",
"tester",
]
@@ -10,4 +9,5 @@ members = [
exclude = [
"sphinx-key",
"persister",
"broker",
]

View File

@@ -6,6 +6,7 @@ default-run = "sphinx-key-broker"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
sphinx-key-parser = { path = "../parser" }
vls-protocol = { git = "https://gitlab.com/lightning-signer/validating-lightning-signer.git" }
vls-proxy = { git = "https://gitlab.com/lightning-signer/validating-lightning-signer.git" }
vls-frontend = { git = "https://gitlab.com/lightning-signer/validating-lightning-signer.git" }
@@ -13,7 +14,6 @@ vls-protocol-client = { git = "https://gitlab.com/lightning-signer/validating-li
rumqttd = { git = "https://github.com/Evanfeenstra/rumqtt", branch = "metrics" }
pretty_env_logger = "0.4.0"
confy = "0.4.0"
sphinx-key-parser = { path = "../parser" }
secp256k1 = { version = "0.24.0", features = ["rand-std", "bitcoin_hashes"] }
anyhow = {version = "1", features = ["backtrace"]}
log = "0.4"

42
broker/Dockerfile Normal file
View File

@@ -0,0 +1,42 @@
# Rust as the base image
FROM rust:latest as build
RUN rustup toolchain install nightly
RUN rustup component add rustfmt --toolchain nightly-x86_64-unknown-linux-gnu
# Create a new empty shell project
RUN USER=root cargo new --bin sphinx-key-broker
WORKDIR /sphinx-key-broker
# Copy parser dep
COPY ../parser ../parser
# Copy our manifests
COPY ./broker/Cargo.lock ./Cargo.lock
COPY ./broker/Cargo.toml ./Cargo.toml
# Build only the dependencies to cache them
RUN cargo +nightly build --release
RUN rm src/*.rs
# Copy the source code
COPY ./broker/src ./src
# Build for release.
RUN rm ./target/release/deps/sphinx_key_broker*
RUN cargo +nightly build --release
# The final base image
FROM debian:bullseye-slim
# get root CA certs
# RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates
# Copy from the previous build
COPY --from=build /sphinx-key-broker/target/release/sphinx-key-broker /usr/src/sphinx-key-broker
# COPY --from=build /sphinx-key-broker/target/release/sphinx-key-broker/target/x86_64-unknown-linux-musl/release/sphinx-key-broker .
# rocket
ENV ROCKET_ADDRESS=0.0.0.0
EXPOSE 8000

View File

@@ -1,3 +1,11 @@
### build w docker
navigate to top level (sphinx-key)
`docker build -f broker/Dockerfile -t sphinx-key-broker .`
### test test locally
To run the broker test against the esp32-c3:
`cargo run -- --test`

View File

@@ -52,6 +52,7 @@ pub async fn run_test() -> rocket::Rocket<rocket::Build> {
launch_rocket(tx)
}
#[allow(dead_code)]
pub async fn iteration(
id: u16,
sequence: u16,