From 3713cfb9b42df11799a22533cf4047d5f692bb4d Mon Sep 17 00:00:00 2001 From: Davidson Souza <40968167+Davidson-Souza@users.noreply.github.com> Date: Fri, 17 Nov 2023 22:23:15 -0300 Subject: [PATCH] Make dockerfile build florestad (#96) * Make dockerfile build florestad * push docker image on release --- .github/workflows/docker.yml | 28 +++++++++++++++++++ Dockerfile | 10 +++---- .../src/pruned_utreexo/chain_state.rs | 7 ----- 3 files changed, 33 insertions(+), 12 deletions(-) create mode 100644 .github/workflows/docker.yml diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 00000000..2458479e --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,28 @@ +name: Docker Publish + +on: + release: + types: [created] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v4 + with: + push: true + tags: dlsz/floresta:latest diff --git a/Dockerfile b/Dockerfile index ecc03059..44e80591 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,16 +3,16 @@ FROM rust:1.66.0@sha256:0067330b7e0eacacc5c32f21b720607c0cd61eda905c8d55e6a745f5 WORKDIR /opt/app COPY Cargo.* ./ -COPY src/ src/ - +COPY florestad/ florestad/ +COPY crates/ crates/ RUN --mount=type=cache,target=/usr/local/cargo/registry \ cargo build --release FROM debian:11.6-slim@sha256:171530d298096f0697da36b3324182e872db77c66452b85783ea893680cc1b62 -COPY --from=builder /opt/app/target/release/floresta /usr/local/bin/floresta -RUN chmod +x /usr/local/bin/floresta +COPY --from=builder /opt/app/target/release/florestad /usr/local/bin/florestad +RUN chmod +x /usr/local/bin/florestad EXPOSE 50001 -CMD [ "floresta", "run"] \ No newline at end of file +CMD [ "florestad", "run"] diff --git a/crates/floresta-chain/src/pruned_utreexo/chain_state.rs b/crates/floresta-chain/src/pruned_utreexo/chain_state.rs index 387f6efd..7050a698 100644 --- a/crates/floresta-chain/src/pruned_utreexo/chain_state.rs +++ b/crates/floresta-chain/src/pruned_utreexo/chain_state.rs @@ -40,13 +40,6 @@ impl BlockConsumer for Channel<(Block, u32)> { } } -#[cfg(not(feature = "no-std"))] -impl BlockConsumer for std::sync::mpsc::Sender<(Block, u32)> { - fn consume_block(&self, block: &Block, height: u32) { - let _ = self.send((block.to_owned(), height)); - } -} - pub struct ChainStateInner { /// The acc we use for validation. acc: Stump,