Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added Verifier and Semver #8

Merged
merged 75 commits into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from 53 commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
cd77a29
wip
wasabrot Dec 19, 2023
430e34a
wip
wasabrot Dec 19, 2023
3eac4d8
wipo
wasabrot Dec 19, 2023
49912db
wip
wasabrot Dec 19, 2023
716244b
wip
wasabrot Dec 19, 2023
94f86de
wip
wasabrot Dec 19, 2023
6af0454
wip
wasabrot Dec 19, 2023
9852308
wip
wasabrot Dec 19, 2023
0f12f20
wip
wasabrot Dec 19, 2023
1db59b0
wip
wasabrot Dec 19, 2023
b28e2ce
wip
wasabrot Dec 19, 2023
6cc3cab
wip
wasabrot Dec 19, 2023
90df8ae
wip
wasabrot Dec 19, 2023
619423f
wip
wasabrot Dec 19, 2023
65e38c1
wip
wasabrot Dec 19, 2023
9e823be
Merge branch 'main' into buildfile
wstrametz Jan 3, 2024
c01e206
fix build
wasabrot Jan 4, 2024
f2ff397
added verifier
wasabrot Jan 4, 2024
39747c2
clippy and fmt
wasabrot Jan 4, 2024
f52d2df
Merge branch 'main' into verifier
wasabrot Jan 4, 2024
c4bfd04
test rel-build
wasabrot Jan 5, 2024
cdb6eac
add build-release
wasabrot Jan 5, 2024
ee4c923
build release
wasabrot Jan 5, 2024
c9f6216
release build
wasabrot Jan 5, 2024
039b4ea
build release
wasabrot Jan 5, 2024
7fcacb8
self-host
wasabrot Jan 5, 2024
ddcb05d
build fix
wasabrot Jan 5, 2024
260f77d
build fix
wasabrot Jan 5, 2024
ed6b82a
build fix
wasabrot Jan 5, 2024
cb06700
buildfile
wasabrot Jan 5, 2024
527bbe0
bigfix github
wasabrot Jan 5, 2024
c3f084a
fix build
wasabrot Jan 5, 2024
5910f84
build bugfix
wasabrot Jan 5, 2024
31ee9d5
add versioning
wasabrot Jan 5, 2024
112a2dc
versioning
wasabrot Jan 5, 2024
45874d1
package tests
wasabrot Jan 5, 2024
bc62bcc
semver fix
wasabrot Jan 5, 2024
87654e2
docu and build test
wasabrot Jan 5, 2024
72f0e72
docu and verioning
wasabrot Jan 5, 2024
37266e4
semver
wasabrot Jan 5, 2024
cee98a0
semver
wasabrot Jan 5, 2024
ba30a50
semver
wasabrot Jan 5, 2024
7523cdc
semver
wasabrot Jan 5, 2024
ed066a6
semver
wasabrot Jan 5, 2024
8a1a9da
bugfix; test semver
wasabrot Jan 5, 2024
011a176
bugfix
wasabrot Jan 5, 2024
82a7aa1
buildfile
wasabrot Jan 5, 2024
3987953
Merge branch 'verifier' of github.com:element36-io/hyperfridge-r0 int…
wasabrot Jan 5, 2024
b7de2d3
autorelease build
wasabrot Jan 6, 2024
fb0f065
Merge branch 'verifier' of github.com:element36-io/hyperfridge-r0 int…
wasabrot Jan 6, 2024
84774b5
test build
wasabrot Jan 6, 2024
ac3de60
trigger 0.1.0 version
wasabrot Jan 6, 2024
ffb1eee
fix format; add docu
wasabrot Jan 6, 2024
13c3a23
Update .github/workflows/docker-build.yml
wasabrot Jan 7, 2024
7a5dbb2
Update docs/guest-hyperfridge.md
wasabrot Jan 7, 2024
8e48e63
Update docs/guest-hyperfridge.md
wasabrot Jan 7, 2024
5307aaf
removed method dep from verifier
wasabrot Jan 7, 2024
e25bd9a
Merge branch 'verifier' of github.com:element36-io/hyperfridge-r0 int…
wasabrot Jan 7, 2024
65ba8a5
cli for verifier
wasabrot Jan 8, 2024
7e384a7
added iban and multi-doc support
wasabrot Jan 8, 2024
0798281
added new camt file for testing
wasabrot Jan 8, 2024
21a822f
verifier - add info to receipt and multi-docs
wasabrot Jan 9, 2024
1efaca9
cli support
wasabrot Jan 9, 2024
d61bb0d
testing ci
wasabrot Jan 10, 2024
81c574d
testing ci
wasabrot Jan 10, 2024
f8101e2
test markdown links in gh
wasabrot Jan 11, 2024
7e835b2
adding cli support to host
wasabrot Jan 11, 2024
e37dca9
added cli to host
wasabrot Jan 11, 2024
1f478b3
delete tmp
wasabrot Jan 11, 2024
075dc61
add tmp to .gitignore
wasabrot Jan 11, 2024
c2e7f1f
update .gitignore
wasabrot Jan 11, 2024
05df210
clippy and fmt
wasabrot Jan 11, 2024
ba1273e
fmt
wasabrot Jan 11, 2024
5d299a0
clippy
wasabrot Jan 11, 2024
8a7b605
fmt
wasabrot Jan 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 40 additions & 21 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,33 @@ name: Docker Build

on:
push:
branches: [ buildfile ]
branches: [ verifier ]
wasabrot marked this conversation as resolved.
Show resolved Hide resolved
pull_request:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest # , self-hosted
runs-on: ubuntu-latest # , l5, self-hosted
permissions:
contents: write
steps:
- name: Check out code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Bump version and push tag, Minor version for each merge
uses: anothrNick/[email protected]
id: taggerRun
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WITH_V: true

- name: echo tag
run: |
echo "The current tag is: ${{ steps.taggerRun.outputs.new_tag }}"

- name: echo part
run: |
echo "The version increment was: ${{ steps.taggerRun.outputs.part }}"

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
Expand All @@ -26,41 +43,43 @@ jobs:
- name: Build Docker image (manual)
run: |
docker build --no-cache -t e36io/hyperfridge-r0:${{ github.run_id }} .


# - name: Build Docker image
# uses: docker/build-push-action@v2
# with:
# no-cache: true
# context: .
# file: ./Dockerfile
# push: false
# load: true
# tags: e36io/hyperfridge-r0:${{ github.run_id }}

- name: Create and Run Temporary Container
run: |
docker create --name temp-container e36io/hyperfridge-r0:${{ github.run_id }}
docker cp temp-container:/host/out/IMAGE_ID.hex ./IMAGE_ID.hex
docker cp temp-container:/app/IMAGE_ID.hex ./IMAGE_ID.hex
docker cp temp-container:/app ./app
docker cp temp-container:/data ./data
docker rm temp-container

- name: Read the Image Tag
id: read_tag
run: echo "IMAGE_TAG=$(cat IMAGE_ID.hex)" >> $GITHUB_ENV

- name: Zip App and Data Directories to create a release
run: |
zip -r hyperfridge-${{ env.IMAGE_TAG }}-${{ steps.taggerRun.outputs.new_tag }}.zip ./app ./data

- name: Build and Push Docker image with custom tag
if: github.event_name != 'pull_request'
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
push: true
tags: e36io/hyperfridge-r0:${{ env.IMAGE_TAG }}
tags: e36io/hyperfridge-r0:${{ steps.taggerRun.outputs.new_tag }}-${{ env.IMAGE_TAG }}

# - name: Create GitHub Tag
# if: github.event_name != 'pull_request'
# run: |
# git config --local user.email "[email protected]"
# git config --local user.name "GitHub Action"
# git tag ${{ steps.taggerRun.outputs.new_tag }}-${{ env.IMAGE_TAG }}
# git push origin ${{ steps.taggerRun.outputs.new_tag }}-${{ env.IMAGE_TAG }}

- name: Create GitHub Tag
- name: Create GitHub Release with zipped binaries
if: github.event_name != 'pull_request'
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git tag ${{ env.IMAGE_TAG }}
git push origin ${{ env.IMAGE_TAG }}
gh release create ${{ steps.taggerRun.outputs.new_tag }}-${{ env.IMAGE_TAG }} hyperfridge-${{ env.IMAGE_TAG }}-${{ steps.taggerRun.outputs.new_tag }}.zip --title "Release Version ${{ steps.taggerRun.outputs.new_tag }} Image ID:${{ env.IMAGE_TAG }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[workspace]
resolver = "2"
members = ["host", "methods"]
members = ["host", "methods", "verifier"]

# Always optimize; building and running the guest takes much longer without optimization.
[profile.dev]
Expand Down
27 changes: 21 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,34 @@ RUN cargo risczero install

COPY data data
COPY host host
COPY verifier verifier
COPY methods methods
COPY Cargo.toml /
COPY rust-toolchain.toml /

# create directory holding generated Id of Computation which will be proved.
WORKDIR /host
RUN mkdir out; touch out/test.touch
RUN RUST_BACKTRACE=1 RISC0_DEV_MODE=true cargo test -- --nocapture
RUN ls -la

WORKDIR /methods/guest
RUN RUST_BACKTRACE=1 RISC0_DEV_MODE=true cargo test --features debug_mode -- --nocapture
WORKDIR /
RUN RUST_BACKTRACE=1 RISC0_DEV_MODE=true cargo build --release
# creates fake proof for test data, so that calling "verifier" without parameters works
RUN RUST_BACKTRACE=1 RISC0_DEV_MODE=true cargo test --release -- --nocapture

RUN ls -la /host
# Final Stage - Alpine Image
FROM alpine:latest as run

#COPY host/out host/out
# add glibc
RUN apk --no-cache add ca-certificates libgcc gcompat

CMD ["RUST_BACKTRACE=1 RISC0_DEV_MODE=true cargo run -- --nocapture "]
# Copy the compiled binaries from the build stage
COPY --from=build /target/release/host /app/host
COPY --from=build /target/release/verifier /app/verifier
COPY --from=build /target/riscv-guest/riscv32im-risc0-zkvm-elf/release/hyperfridge /app/hyperfridge
COPY --from=build /host/out/IMAGE_ID.hex /app/IMAGE_ID.hex
COPY --from=build /data /data

WORKDIR /app

CMD ["./verifier"]
20 changes: 15 additions & 5 deletions README2.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
# Todos

- check for libs, eg. serde is double
- use risc0 sha --> check for more
- Paper: plug-in TradFi assets like Fiat accounts, and portfolios. Sepa, Indian, british

# How to run with test data

```bash
cd host
RUST_BACKTRACE=1 RISC0_DEV_MODE=true cargo build --
RUST_BACKTRACE=1 RISC0_DEV_MODE=true cargo build --release --
RUST_BACKTRACE=1 RISC0_DEV_MODE=true cargo test --
RUST_BACKTRACE=1 RISC0_DEV_MODE=true cargo test -- --nocapture
RUST_BACKTRACE=1 cargo run -- ../data/test/test.xml ../data/bank_public.pem ../data/client.pem

RUST_BACKTRACE=1 RISC0_DEV_MODE=true cargo run -- ../data/test/test.xml ../data/bank_public.pem ../data/client.pem
```

Run tests for verifier - need to enable main function with feature flag:
Run tests for verifier - need to enable main function with feature flag, use RUST_LOG="executor=info" as needed.

```bash
cd methods/guest
Expand All @@ -18,9 +24,13 @@ RUST_BACKTRACE=1 RISC0_DEV_MODE=true cargo test --features debug_mode
RUST_BACKTRACE=1 RISC0_DEV_MODE=true cargo test --features debug_mode -- --nocapture
```

RUST_LOG="executor=info"

When pushing run clippy and fmt:

```bash
cargo fmt --all
cargo fmt --all -- --check
RISC0_SKIP_BUILD=true cargo clippy
```

Generate coverage data

Expand Down
File renamed without changes.
Loading
Loading