Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into rich/receive-applicat…
Browse files Browse the repository at this point in the history
…ion-message
  • Loading branch information
richardhuaaa committed Nov 13, 2023
2 parents b02f5a8 + 56687a5 commit 97db939
Show file tree
Hide file tree
Showing 16 changed files with 628 additions and 206 deletions.
20 changes: 18 additions & 2 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{
"label": "fmt",
"type": "shell",
"command": "cargo +nightly fmt --check",
"command": "cargo fmt --check",
"options": {
"cwd": "${workspaceFolder}"
},
Expand All @@ -15,13 +15,27 @@
"isDefault": "false"
}
},
{
"label": "lint",
"type": "shell",
"command": "cargo clippy --all-features --no-deps",
"options": {
"cwd": "${workspaceFolder}"
},
"dependsOn": "fmt",
"group": {
"kind": "build",
"isDefault": "false"
}
},
{
"label": "build",
"type": "shell",
"command": "cargo build",
"options": {
"cwd": "${workspaceFolder}"
},
"dependsOn": "lint",
"group": {
"kind": "build",
"isDefault": "false"
Expand All @@ -34,6 +48,7 @@
"options": {
"cwd": "${workspaceFolder}"
},
"dependsOn": "lint",
"group": {
"kind": "build",
"isDefault": "true"
Expand All @@ -46,10 +61,11 @@
"options": {
"cwd": "${workspaceFolder}"
},
"dependsOn": "lint",
"group": {
"kind": "test",
"isDefault": "true"
}
}
]
}
}
117 changes: 97 additions & 20 deletions Cargo.lock

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

79 changes: 1 addition & 78 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,80 +1,4 @@
FROM debian:stable-slim as go-builder
# defined from build kit
# DOCKER_BUILDKIT=1 docker build . -t ...
ARG TARGETARCH

FROM debian:stable-slim as builder
# defined from build kit
# DOCKER_BUILDKIT=1 docker build . -t ...
ARG TARGETARCH

RUN export DEBIAN_FRONTEND=noninteractive && \
apt update && \
apt install -y -q --no-install-recommends \
git curl gnupg2 build-essential \
linux-headers-${TARGETARCH} libc6-dev \
openssl libssl-dev pkg-config \
ca-certificates apt-transport-https \
python3 && \
apt clean && \
rm -rf /var/lib/apt/lists/*

RUN useradd --create-home -s /bin/bash xmtp
RUN usermod -a -G sudo xmtp
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers

WORKDIR /rustup
## Rust
ADD https://sh.rustup.rs /rustup/rustup.sh
RUN chmod 755 /rustup/rustup.sh

ENV USER=xmtp
USER xmtp
RUN /rustup/rustup.sh -y --default-toolchain stable --profile minimal

ENV PATH=$PATH:~xmtp/.cargo/bin

FROM debian:stable-slim
ARG TARGETARCH

RUN export DEBIAN_FRONTEND=noninteractive && \
apt update && \
apt install -y -q --no-install-recommends \
ca-certificates apt-transport-https \
sudo ripgrep procps build-essential \
python3 python3-pip python3-dev \
git curl && \
apt clean && \
rm -rf /var/lib/apt/lists/*

RUN echo "building platform $(uname -m)"

RUN useradd --create-home -s /bin/bash xmtp
RUN usermod -a -G sudo xmtp
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers

## Node and NPM
RUN mkdir -p /usr/local/nvm
ENV NVM_DIR=/usr/local/nvm

ENV NODE_VERSION=v20.9.0

ADD https://raw.githubusercontent.com/creationix/nvm/master/install.sh /usr/local/etc/nvm/install.sh
RUN bash /usr/local/etc/nvm/install.sh && \
bash -c ". $NVM_DIR/nvm.sh && nvm install $NODE_VERSION && nvm alias default $NODE_VERSION && nvm use default"

ENV NVM_NODE_PATH ${NVM_DIR}/versions/node/${NODE_VERSION}
ENV NODE_PATH ${NVM_NODE_PATH}/lib/node_modules
ENV PATH ${NVM_NODE_PATH}/bin:$PATH

RUN npm install npm -g
RUN npm install yarn -g


## Rust from builder
COPY --chown=xmtp:xmtp --from=builder /home/xmtp/.cargo /home/xmtp/.cargo
COPY --chown=xmtp:xmtp --from=builder /home/xmtp/.rustup /home/xmtp/.rustup

FROM ghcr.io/xmtp/rust:latest
USER xmtp

RUN ~xmtp/.cargo/bin/rustup toolchain install stable
Expand All @@ -88,7 +12,6 @@ ENV PATH=~xmtp/.cargo/bin:$PATH
ENV USER=xmtp

RUN ~xmtp/.cargo/bin/cargo check
RUN ~xmtp/.cargo/bin/cargo --version
RUN ~xmtp/.cargo/bin/cargo fmt --check
RUN ~xmtp/.cargo/bin/cargo clippy --all-features --no-deps
RUN ~xmtp/.cargo/bin/cargo clippy --all-features --no-deps --manifest-path xmtp/Cargo.toml
Expand Down
Binary file added img/mls-state-machine.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 10 additions & 6 deletions mls_validation_service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,15 @@ path = "src/main.rs"
prost = { version = "0.11", features = ["prost-derive"] }
tokio = { version = "1.33.0", features = ["macros", "rt-multi-thread", "full"] }
tonic = "^0.9"
xmtp_proto = { path = "../xmtp_proto", features = ["proto_full", "grpc", "tonic"] }
openmls = { git= "https://github.com/xmtp/openmls", features = ["test-utils"] }
openmls_traits = { git= "https://github.com/xmtp/openmls" }
openmls_basic_credential = { git= "https://github.com/xmtp/openmls" }
openmls_rust_crypto = { git= "https://github.com/xmtp/openmls" }
xmtp_proto = { path = "../xmtp_proto", features = [
"proto_full",
"grpc",
"tonic",
] }
openmls = { git = "https://github.com/xmtp/openmls", features = ["test-utils"] }
openmls_traits = { git = "https://github.com/xmtp/openmls" }
openmls_basic_credential = { git = "https://github.com/xmtp/openmls" }
openmls_rust_crypto = { git = "https://github.com/xmtp/openmls" }
xmtp_mls = { path = "../xmtp_mls" }
serde = "1.0.189"
hex = "0.4.3"
Expand All @@ -25,4 +29,4 @@ env_logger = "0.10.0"

[dev-dependencies]
ethers = "2.0.10"
rand = "0.8.5"
rand = "0.8.5"
24 changes: 15 additions & 9 deletions xmtp_mls/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,33 @@ native = ["libsqlite3-sys/bundled-sqlcipher-vendored-openssl"]
[dependencies]
anyhow = "1.0.71"
async-trait = "0.1.68"
diesel = { version = "2.1.3", features = ["sqlite", "r2d2", "returning_clauses_for_sqlite_3_35"] }
diesel = { version = "2.1.3", features = [
"sqlite",
"r2d2",
"returning_clauses_for_sqlite_3_35",
] }
diesel_migrations = { version = "2.1.0", features = ["sqlite"] }
ethers = "2.0.4"
ethers-core = "2.0.4"
futures = "0.3.28"
hex = "0.4.3"
libsqlite3-sys = { version = "0.26.0", optional = true}
openmls = { git= "https://github.com/xmtp/openmls", features = ["test-utils"] }
openmls_traits = { git= "https://github.com/xmtp/openmls" }
openmls_basic_credential = { git= "https://github.com/xmtp/openmls" }
openmls_rust_crypto = { git= "https://github.com/xmtp/openmls" }
libsqlite3-sys = { version = "0.26.0", optional = true }
openmls = { git = "https://github.com/xmtp/openmls", branch = "main", features = [
"test-utils",
] }
openmls_traits = { git = "https://github.com/xmtp/openmls", branch = "main" }
openmls_basic_credential = { git = "https://github.com/xmtp/openmls", branch = "main" }
openmls_rust_crypto = { git = "https://github.com/xmtp/openmls", branch = "main" }
prost = { version = "0.11", features = ["prost-derive"] }
rand = "0.8.5"
serde = "1.0.160"
serde_json = "1.0.96"
thiserror = "1.0.40"
tokio = { version = "1.28.1", features = ["macros"] }
tokio = { version = "1.28.1", features = ["macros"] }
log = "0.4.17"
tracing = "0.1.37"
tracing = "0.1.37"
toml = "0.7.4"
xmtp_cryptography = { path = "../xmtp_cryptography"}
xmtp_cryptography = { path = "../xmtp_cryptography" }
xmtp_proto = { path = "../xmtp_proto", features = ["proto_full"] }
tls_codec = "0.3.0"

Expand Down
Loading

0 comments on commit 97db939

Please sign in to comment.