From dc1932c2412702f9cd818beea3437cdd9bfde524 Mon Sep 17 00:00:00 2001 From: DanGould Date: Wed, 10 May 2023 15:04:49 -0400 Subject: [PATCH] Move payjoin-client payjoin-cli --- .github/workflows/release.yml | 2 +- .github/workflows/rust.yml | 6 +++--- Cargo.lock | 4 ++-- Cargo.toml | 2 +- payjoin-client.Dockerfile => payjoin-cli.Dockerfile | 12 ++++++------ {payjoin-client => payjoin-cli}/Cargo.toml | 8 ++++++-- {payjoin-client => payjoin-cli}/src/app.rs | 0 {payjoin-client => payjoin-cli}/src/main.rs | 4 +++- 8 files changed, 22 insertions(+), 16 deletions(-) rename payjoin-client.Dockerfile => payjoin-cli.Dockerfile (57%) rename {payjoin-client => payjoin-cli}/Cargo.toml (88%) rename {payjoin-client => payjoin-cli}/src/app.rs (100%) rename {payjoin-client => payjoin-cli}/src/main.rs (92%) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 09d03bee..00b056a1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,4 +25,4 @@ jobs: with: RUSTTARGET: ${{ matrix.target }} ARCHIVE_TYPES: ${{ matrix.archive }} - SRC_DIR: payjoin-client \ No newline at end of file + SRC_DIR: payjoin-cli \ No newline at end of file diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 94286a32..165dc591 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -24,7 +24,7 @@ jobs: command: test args: --verbose --all-features --lib --manifest-path payjoin/Cargo.toml - build-payjoin-client: + build-payjoin-cli: runs-on: ubuntu-latest strategy: fail-fast: false @@ -38,12 +38,12 @@ jobs: with: toolchain: ${{ matrix.rust }} override: true - - run: cd payjoin-client + - run: cd payjoin-cli - name: build payjoin example uses: actions-rs/cargo@v1 with: command: build - args: --manifest-path payjoin-client/Cargo.toml + args: --manifest-path payjoin-cli/Cargo.toml fmt: runs-on: ubuntu-latest diff --git a/Cargo.lock b/Cargo.lock index a908eab6..73df2382 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1246,8 +1246,8 @@ dependencies = [ ] [[package]] -name = "payjoin-client" -version = "0.1.15" +name = "payjoin-cli" +version = "0.0.1" dependencies = [ "anyhow", "base64", diff --git a/Cargo.toml b/Cargo.toml index e42c3f24..427cff3d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,2 +1,2 @@ [workspace] -members = ["payjoin", "payjoin-client"] +members = ["payjoin", "payjoin-cli"] diff --git a/payjoin-client.Dockerfile b/payjoin-cli.Dockerfile similarity index 57% rename from payjoin-client.Dockerfile rename to payjoin-cli.Dockerfile index 305672dc..d19de7d3 100644 --- a/payjoin-client.Dockerfile +++ b/payjoin-cli.Dockerfile @@ -3,21 +3,21 @@ ## Initial build Stage FROM rustlang/rust:nightly -WORKDIR /usr/src/payjoin-client +WORKDIR /usr/src/payjoin-cli COPY Cargo.toml Cargo.lock ./ COPY payjoin/Cargo.toml ./payjoin/ COPY payjoin/src ./payjoin/src/ -COPY payjoin-client/Cargo.toml ./payjoin-client/ -COPY payjoin-client/src ./payjoin-client/src/ +COPY payjoin-cli/Cargo.toml ./payjoin-cli/ +COPY payjoin-cli/src ./payjoin-cli/src/ # Install the required dependencies to build for `musl` static linking RUN apt-get update && apt-get install -y musl-tools musl-dev libssl-dev # Add our x86 target to rust, then compile and install RUN rustup target add x86_64-unknown-linux-musl -RUN cargo build --release --bin=payjoin-client --target x86_64-unknown-linux-musl --features=native-tls-vendored +RUN cargo build --release --bin=payjoin-cli --target x86_64-unknown-linux-musl --features=native-tls-vendored FROM alpine:latest RUN apk --no-cache add ca-certificates -COPY --from=0 /usr/src/payjoin-client/target/x86_64-unknown-linux-musl/release/payjoin-client ./ +COPY --from=0 /usr/src/payjoin-cli/target/x86_64-unknown-linux-musl/release/payjoin-cli ./ # Run -ENTRYPOINT ["./payjoin-client"] \ No newline at end of file +ENTRYPOINT ["./payjoin-cli"] \ No newline at end of file diff --git a/payjoin-client/Cargo.toml b/payjoin-cli/Cargo.toml similarity index 88% rename from payjoin-client/Cargo.toml rename to payjoin-cli/Cargo.toml index 3b66a3cc..03c6f6e5 100644 --- a/payjoin-client/Cargo.toml +++ b/payjoin-cli/Cargo.toml @@ -1,9 +1,13 @@ [package] -name = "payjoin-client" -version = "0.1.15" +name = "payjoin-cli" +version = "0.0.1" authors = ["Dan Gould ", "Martin Habovstiak "] edition = "2018" +[[bin]] +name = "payjoin" +path = "src/main.rs" + # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [features] native-tls-vendored = ["reqwest/native-tls-vendored"] diff --git a/payjoin-client/src/app.rs b/payjoin-cli/src/app.rs similarity index 100% rename from payjoin-client/src/app.rs rename to payjoin-cli/src/app.rs diff --git a/payjoin-client/src/main.rs b/payjoin-cli/src/main.rs similarity index 92% rename from payjoin-client/src/main.rs rename to payjoin-cli/src/main.rs index 28b0675a..d547235f 100644 --- a/payjoin-client/src/main.rs +++ b/payjoin-cli/src/main.rs @@ -49,7 +49,9 @@ fn cli() -> ArgMatches { Command::new("send") .arg_required_else_help(true) .arg(arg!( "The `bitcoin:...` payjoin uri to send to")) - .arg(Arg::new("DANGER_ACCEPT_INVALID_CERTS").hide(true).help("Wicked dangerous! Vulnerable to MITM attacks! Accept invalid certs for the payjoin endpoint")) + .arg(Arg::new("DANGER_ACCEPT_INVALID_CERTS") + .hide(true) + .help("Wicked dangerous! Vulnerable to MITM attacks! Accept invalid certs for the payjoin endpoint")) ) .subcommand( Command::new("receive")