Skip to content

Commit

Permalink
Merge pull request #93 from blockfrost/feat/haskell-cbor-deserializer
Browse files Browse the repository at this point in the history
feat: use `testgen-hs` for deserializing `ApplyTxErr`ors
  • Loading branch information
vladimirvolek authored Nov 29, 2024
2 parents 702078e + df8f27d commit 7a37054
Show file tree
Hide file tree
Showing 18 changed files with 590 additions and 53 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,31 @@ jobs:
components: rustfmt, rust-src, clippy
- name: Build
run: cargo build --release --verbose
- name: Download `testgen-hs`
shell: bash
run: |
set -euo pipefail
version="10.1.2.1"
case "${{ matrix.os }}" in
macos-latest)
target=testgen-hs-"$version"-aarch64-darwin.tar.bz2
curl -fsSL -O https://github.com/input-output-hk/testgen-hs/releases/download/"$version"/"$target"
tar -xjf "$target"
./testgen-hs/testgen-hs --version
;;
ubuntu-latest)
target=testgen-hs-"$version"-x86_64-linux.tar.bz2
curl -fsSL -O https://github.com/input-output-hk/testgen-hs/releases/download/"$version"/"$target"
tar -xjf "$target"
./testgen-hs/testgen-hs --version
;;
windows-latest)
target=testgen-hs-"$version"-x86_64-windows.zip
curl -fsSL -O https://github.com/input-output-hk/testgen-hs/releases/download/"$version"/"$target"
unzip "$target"
./testgen-hs/testgen-hs.exe --version
;;
esac
- name: Test
run: cargo test --verbose
timeout-minutes: 10
Expand All @@ -41,6 +66,7 @@ jobs:
run: |
mkdir -p artifacts
cp target/release/blockfrost-platform* artifacts/
cp -r testgen-hs artifacts/
- name: Upload artifacts
if: github.event_name == 'workflow_dispatch' && github.event.inputs.upload_artifacts == 'true'
uses: actions/upload-artifact@v4
Expand Down
143 changes: 136 additions & 7 deletions Cargo.lock

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

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ metrics-exporter-prometheus = { version = "0.16", default-features = false }
chrono = "0.4"
deadpool = "0.12.1"
serde_with = "3.11.0"
tracing-test = "0.2.5"
sysinfo = "0.32.1"

[dev-dependencies]
rstest = "0.22.0"
Expand Down
8 changes: 6 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM lukemathwalker/cargo-chef:latest-rust-slim-bookworm AS base
RUN apt update ; apt install sccache pkg-config libssl-dev -y
RUN apt update ; apt install sccache pkg-config libssl-dev bzip2 -y
ENV RUSTC_WRAPPER=sccache SCCACHE_DIR=/sccache
WORKDIR /app

Expand All @@ -10,6 +10,10 @@ RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=$SCCACHE_DIR,sharing=locked \
ls -l ; cargo chef prepare --recipe-path recipe.json

FROM base AS downloader
ADD https://github.com/input-output-hk/testgen-hs/releases/download/10.1.2.1/testgen-hs-10.1.2.1-x86_64-linux.tar.bz2 /app/
RUN tar -xjf testgen-hs-*.tar.* && /app/testgen-hs/testgen-hs --version

FROM base AS builder
COPY --from=planner /app/recipe.json recipe.json
RUN --mount=type=cache,target=/usr/local/cargo/registry \
Expand All @@ -21,9 +25,9 @@ RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=$SCCACHE_DIR,sharing=locked \
cargo build --release


FROM gcr.io/distroless/cc-debian12 as runtime
COPY --from=builder /app/target/release/blockfrost-platform /app/
COPY --from=downloader /app/testgen-hs /app/testgen-hs
EXPOSE 3000/tcp
STOPSIGNAL SIGINT
ENTRYPOINT ["/app/blockfrost-platform"]
5 changes: 1 addition & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ services:
volumes:
- ./nix/mithril-entrypoint.sh:/app/bin/entrypoint.sh
- node-db:/data

cardano-node:
image: ghcr.io/intersectmbo/cardano-node:9.2.0
environment:
Expand All @@ -21,7 +20,6 @@ services:
depends_on:
init-node:
condition: service_completed_successfully

blockfrost-platform:
image: ghcr.io/blockfrost/blockfrost-platform:latest
build:
Expand All @@ -35,7 +33,7 @@ services:
restart: on-failure
ports:
- 3000:3000
profiles: ['']
profiles: [""]
volumes:
- node-ipc:/ipc
entrypoint:
Expand All @@ -48,7 +46,6 @@ services:
- $REWARD_ADDRESS
- --node-socket-path
- /ipc/node.socket

blockfrost-platform-solitary:
image: ghcr.io/blockfrost/blockfrost-platform:latest
build:
Expand Down
22 changes: 11 additions & 11 deletions docs/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import nextra from 'nextra'
import nextra from "nextra";

/**
* @type {import('next').NextConfig}
*/
const nextConfig = {
output: 'export',
output: "export",
images: {
unoptimized: true // mandatory, otherwise won't export
}
unoptimized: true, // mandatory, otherwise won't export
},
// Optional: Change the output directory `out` -> `dist`
// distDir: "build"
}
};
const withNextra = nextra({
theme: 'nextra-theme-docs',
themeConfig: './theme.config.tsx'
})
export default withNextra(nextConfig)
theme: "nextra-theme-docs",
themeConfig: "./theme.config.tsx",
});

export default withNextra(nextConfig);
Loading

0 comments on commit 7a37054

Please sign in to comment.