From e67ea2de859623c4f016f38492eeb361e0085a9c Mon Sep 17 00:00:00 2001 From: TEMI <97989873+ScapeXYZ@users.noreply.github.com> Date: Fri, 13 Dec 2024 03:18:04 +0100 Subject: [PATCH 1/2] Update README.md my contribution to volara --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index b8b4255..6892243 100644 --- a/README.md +++ b/README.md @@ -105,6 +105,8 @@ Feel free to modify any part of this template to fit your specific needs. The go ## Contributing If you have suggestions for improving this template, please open an issue or submit a pull request. +my suggestion and contribution + ## License From 3d86a3ada1ce74f44e8972f77247fb8449cecc31 Mon Sep 17 00:00:00 2001 From: TEMI <97989873+ScapeXYZ@users.noreply.github.com> Date: Fri, 13 Dec 2024 03:57:41 +0100 Subject: [PATCH 2/2] Update README.md The updated version of the README will build upon the existing one by adding clarity, filling in missing details, and incorporating user contributions or suggestions. Here's the updated README based on the improvements that could be made: --- README.md | 73 ++++++++++++++++++++++++++----------------------------- 1 file changed, 34 insertions(+), 39 deletions(-) diff --git a/README.md b/README.md index 6892243..5e3f5a8 100644 --- a/README.md +++ b/README.md @@ -12,22 +12,20 @@ This template provides a basic structure for building proof tasks that: ```json { - "dlp_id": 19, // DLP ID is found in the Root Network contract after the DLP is registered - "valid": false, // A single boolean to summarize if the file is considered valid in this DLP - "score": 0.7614457831325301, // A score between 0 and 1 for the file, used to determine how valuable the file is. This can be an aggregation of the individual scores below. - "authenticity": 1.0, // A score between 0 and 1 to rate if the file has been tampered with - "ownership": 1.0, // A score between 0 and 1 to verify the ownership of the file - "quality": 0.6024096385542169, // A score between 0 and 1 to show the quality of the file - "uniqueness": 0, // A score between 0 and 1 to show unique the file is, compared to others in the DLP + "dlp_id": 19, + "valid": true, + "score": 0.85, + "authenticity": 1.0, + "ownership": 1.0, + "quality": 0.9, + "uniqueness": 0.8, "attributes": { - // Custom attributes that can be added to the proof to provide extra context about the encrypted file - "total_score": 0.5, - "score_threshold": 0.83, - "email_verified": true + "email_verified": true, + "total_score": 0.75, + "score_threshold": 0.83 } } ``` - The project is designed to work with Intel TDX (Trust Domain Extensions), providing hardware-level isolation and security guarantees for confidential computing workloads. ## Project Structure @@ -40,15 +38,24 @@ The project is designed to work with Intel TDX (Trust Domain Extensions), provid - `Dockerfile`: Defines the container image for the proof task - `requirements.txt`: Python package dependencies -## Getting Started +##Getting Started +To begin using this project: +1. Fork the repository: +Make a copy of this repository in your GitHub account. +2. Clone the repository: -To use this template: +``git clone https://github.com/volaradlp/validator.git +cd validator`` +3. Build the Docker image: -1. Fork this repository -2. Modify the `my_proof/proof.py` file to implement your specific proof logic -3. Update the project dependencies in `requirements.txt` if needed -4. Commit your changes and push to your repository +``docker build -t volara-validator .`` +4. Run the proof task: +```docker run --rm \ + --volume $(pwd)/input:/input \ + --volume $(pwd)/output:/output \ + --env USER_EMAIL=user@example.com \ + volara-validator``` ## Customizing the Proof Logic The main proof logic is implemented in `my_proof/proof.py`. To customize it, update the `Proof.generate()` function to change how input files are processed. @@ -59,33 +66,17 @@ The proof can be configured using environment variables: If you want to use a language other than Python, you can modify the Dockerfile to install the necessary dependencies and build the proof task in the desired language. -## Local Development - -To run the proof locally for testing, you can use Docker: - -```bash -docker build -t my-proof . -docker run \ - --rm \ - --volume $(pwd)/input:/input \ - --volume $(pwd)/output:/output \ - --env USER_EMAIL=user123@gmail.com \ - my-proof -``` - ## Running with Intel TDX Intel TDX (Trust Domain Extensions) provides hardware-based memory encryption and integrity protection for virtual machines. To run this container in a TDX-enabled environment, follow your infrastructure provider's specific instructions for deploying confidential containers. Common volume mounts and environment variables: -```bash -docker run \ - --rm \ +```docker run --rm \ --volume /path/to/input:/input \ --volume /path/to/output:/output \ - --env USER_EMAIL=user123@gmail.com \ - my-proof + --env USER_EMAIL=user@example.com \ + volara-validator ``` Remember to populate the `/input` directory with the files you want to process. @@ -98,10 +89,14 @@ This template leverages several security features: 2. **Input/Output Isolation**: Input and output directories are mounted separately, ensuring clear data flow boundaries 3. **Minimal Container**: Uses a minimal Python base image to reduce attack surface -## Customization +## Development and testinng +Local Testing: Run proof logic locally for development: -Feel free to modify any part of this template to fit your specific needs. The goal is to provide a starting point that can be easily adapted to various proof tasks. +```python -m unittest discover``` +2. Linting and Code Style: Use tools like flake8 or black to ensure code consistency: +```pip install flake8 black +black my_proof/``` ## Contributing If you have suggestions for improving this template, please open an issue or submit a pull request.