From 42e9083539f42cc87e58ef46621c48727edb68d5 Mon Sep 17 00:00:00 2001 From: jtm91 Date: Wed, 23 Aug 2023 16:51:28 +0200 Subject: [PATCH 1/3] Make Readme more readable --- README.md | 122 +++++++++++++++++++++++++++--------------------------- 1 file changed, 60 insertions(+), 62 deletions(-) diff --git a/README.md b/README.md index 6839963..02efa88 100644 --- a/README.md +++ b/README.md @@ -5,21 +5,16 @@ Use `Pyo3` Lib to wrap the `integritee-cli` into a Python lib. ## Table of Contents - [Getting Started](#getting-started) -- [Prerequisites](#prerequisites) -- [Updating Git Submodules](#updating-git-submodules) -- [Creating and Activating venv](#creating-and-activating-venv) -- [Managing Environment Variables](#managing-environment-variables) -- [Installing Dependencies](#installing-dependencies) -- [Using maturin](#using-maturin) - [Run as Command Line Tool](#run-as-command-line-tool) -- [Available Commands](#available-commands) -- [Troubleshooting](#troubleshooting) + - [Managing Environment Variables for Command Line Execution](#managing-environment-variables-for-command-line-execution) + - [Get help](#get-help) + - [Available Commands and Examples](#available-commands-and-examples) ## Getting Started Get started with the project setup and initial configuration. -## Prerequisites +- **Prerequisites** In order to use the features, the nightly version of the compiler has to be setup beforehand: @@ -28,7 +23,13 @@ to be setup beforehand: $ rustup override set nightly ``` -## Updating Git Submodules +Common error: **wasmtime**: error[E0463]: can't find crate for `std` + +``` +rustup target add --toolchain nightly wasm32-unknown-unknown +``` + +**Installation** `Cargo.toml` states the relative dependencies at the `shared` folder. The submodules have to be initialized and updated before building: @@ -37,8 +38,6 @@ The submodules have to be initialized and updated before building: $ git submodule update --init --recursive ``` -## Creating and Activating venv - Install `integritee_cli_py` as lib into virtual environment: ``` @@ -48,34 +47,22 @@ $ source venv/bin/activate $ conda deactivate ``` -## Managing Environment Variables - -Please follow these steps to set up and use environment variables: - -1. Copy the `.env.example` file and rename it to `.env`: - -```bash -$ cp .env.example .env ``` - -2. Open the `.env` file and provide values for the environment variables. - -## Installing Dependencies - -Install the necessary dependencies using the provided `requirements.txt` file: - -```bash -$ pip install -r requirements.txt +pip install maturin ``` -## Using maturin - To install the lib to your current python environment use: ``` $ maturin develop ``` +**Usage** + +See `run_integritee_cli.py` how to import and use the module. This +script also includes a command line tool, to be used as explained +in the following section. + ## Run as Command Line Tool Test import and execution of `integritee_cli_py` in python: @@ -84,19 +71,36 @@ Test import and execution of `integritee_cli_py` in python: $ python run_integritee_cli.py --command --params ``` -## Available Commands +### Managing Environment Variables for Command Line Execution -The `integritee-cli-py` provides the following CLI commands: +Please follow these steps to set up and use environment variables: -### Get help: +1. Copy the `.env.example` file and rename it to `.env`: + +```bash +$ cp .env.example .env +``` + +2. Open the `.env` file and provide values for the environment variables. + +3. Installing Dependencies + +Install the necessary dependencies using the provided `requirements.txt` file: + +```bash +$ pip install -r requirements.txt +``` -**Syntax:** + +### Get help + +Syntax: ```bash $ python3 run_integritee_cli.py --help ``` -**Output:** +Output: ```bash @@ -112,82 +116,76 @@ options: Parameters for the command ``` -### Create a new account: +### Available Commands and Examples + +The `integritee-cli-py` provides the following CLI commands: -**Syntax:** +- **Create a new account:** + +Syntax: ```bash $ python3 run_integritee_cli.py --command new_account_cmd ``` -### Create a new trusted account: +- **Create a new trusted account:** -**Syntax:** +Syntax: ```bash $ python3 run_integritee_cli.py --command new_trusted_account_cmd --params ``` -### Pay As Bid: - -**Syntax:** +- **Pay As Bid:** +Syntax: ```bash $ python3 run_integritee_cli.py --command pay_as_bid_cmd --params ``` -**Example:** - +Example: ```bash $ python3 run_integritee_cli.py --command pay_as_bid_cmd --params 9PPeGELLdD9Uw1mVJbUGTeRpGzPBGb1bdEk6TCL4pPCE 5Dsni69ozXZZwpxyCGjLq8KQnBpGrtPnbykepgst2Tbh7NuY "[{\"id\":0,\"order_type\":\"ask\",\"time_slot\":\"2022-10-04T05:06:07+00:00\",\"actor_id\":\"actor_0\",\"cluster_index\":0,\"energy_kwh\":5,\"price_euro_per_kwh\":0.19},{\"id\":1,\"order_type\":\"bid\",\"time_slot\":\"2022-10-04T05:06:07+00:00\",\"actor_id\":\"actor_1\",\"cluster_index\":0,\"energy_kwh\":8.8,\"price_euro_per_kwh\":0.23}]" ``` -### Get Market Results: +- **Get Market Results:** -**Syntax:** +Syntax: ```bash $ python3 run_integritee_cli.py --command get_market_results_cmd --params ``` -**Example:** +Example: ```bash $ python3 run_integritee_cli.py --command get_market_results_cmd --params 9PPeGELLdD9Uw1mVJbUGTeRpGzPBGb1bdEk6TCL4pPCE 5Dsni69ozXZZwpxyCGjLq8KQnBpGrtPnbykepgst2Tbh7NuY 2022-10-04T05:06:07+00:00 ``` -### Get Bid Proof: +- **Get Bid Proof:** -**Syntax:** +Syntax: ```bash $ python3 run_integritee_cli.py --command pay_as_bid_proof_cmd --params ``` -**Example:** +Example: ```bash $ python3 run_integritee_cli.py --command pay_as_bid_proof_cmd --params 9PPeGELLdD9Uw1mVJbUGTeRpGzPBGb1bdEk6TCL4pPCE 5Dsni69ozXZZwpxyCGjLq8KQnBpGrtPnbykepgst2Tbh7NuY 2022-10-04T05:06:07+00:00 actor_0 ``` -### Verify Proof: +- **Verify Proof:** -**Syntax:** +Syntax: ```bash $ python3 run_integritee_cli.py --command verify_proof_cmd --params ``` -**Example:** +Example: ```bash python3 run_integritee_cli.py --command verify_proof_cmd --params 9PPeGELLdD9Uw1mVJbUGTeRpGzPBGb1bdEk6TCL4pPCE 5Dsni69ozXZZwpxyCGjLq8KQnBpGrtPnbykepgst2Tbh7NuY "{\"root\":\"0xeae9131721b25db95622605c99a62f56f2e3b47e7f54f9b0653055b11b8d37b8\",\"proof\":[\"0xf147000d21d56a303b688da5bf1294d865518a8fb889af48ca21d12af5a6d823\"],\"number_of_leaves\":2,\"leaf_index\":0,\"leaf\":[0,0,0,0,0,0,0,0,1,100,50,48,50,50,45,49,48,45,48,52,84,48,53,58,48,54,58,48,55,43,48,48,58,48,48,28,97,99,116,111,114,95,48,1,0,0,0,0,0,0,0,0,0,0,20,64,82,184,30,133,235,81,200,63]}" ``` - -## Troubleshooting - -- **wasmtime**: error[E0463]: can't find crate for `std` - -``` -rustup target add --toolchain nightly wasm32-unknown-unknown -``` From d44bf48b1a99fb5c80dce4ea4641205f859e72cd Mon Sep 17 00:00:00 2001 From: jtm91 Date: Wed, 23 Aug 2023 16:58:46 +0200 Subject: [PATCH 2/3] Small adaption in readme --- README.md | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 02efa88..fcd384b 100644 --- a/README.md +++ b/README.md @@ -12,9 +12,9 @@ Use `Pyo3` Lib to wrap the `integritee-cli` into a Python lib. ## Getting Started -Get started with the project setup and initial configuration. +Get started with the setup of the client module. -- **Prerequisites** +**Prerequisites** In order to use the features, the nightly version of the compiler has to be setup beforehand: @@ -94,13 +94,13 @@ $ pip install -r requirements.txt ### Get help -Syntax: +- Syntax: ```bash $ python3 run_integritee_cli.py --help ``` -Output: +- Output: ```bash @@ -120,71 +120,71 @@ options: The `integritee-cli-py` provides the following CLI commands: -- **Create a new account:** +**Create a new account:** -Syntax: +- Syntax: ```bash $ python3 run_integritee_cli.py --command new_account_cmd ``` -- **Create a new trusted account:** +**Create a new trusted account:** -Syntax: +- Syntax: ```bash $ python3 run_integritee_cli.py --command new_trusted_account_cmd --params ``` -- **Pay As Bid:** +**Pay As Bid:** -Syntax: +- Syntax: ```bash $ python3 run_integritee_cli.py --command pay_as_bid_cmd --params ``` -Example: +- Example: ```bash $ python3 run_integritee_cli.py --command pay_as_bid_cmd --params 9PPeGELLdD9Uw1mVJbUGTeRpGzPBGb1bdEk6TCL4pPCE 5Dsni69ozXZZwpxyCGjLq8KQnBpGrtPnbykepgst2Tbh7NuY "[{\"id\":0,\"order_type\":\"ask\",\"time_slot\":\"2022-10-04T05:06:07+00:00\",\"actor_id\":\"actor_0\",\"cluster_index\":0,\"energy_kwh\":5,\"price_euro_per_kwh\":0.19},{\"id\":1,\"order_type\":\"bid\",\"time_slot\":\"2022-10-04T05:06:07+00:00\",\"actor_id\":\"actor_1\",\"cluster_index\":0,\"energy_kwh\":8.8,\"price_euro_per_kwh\":0.23}]" ``` -- **Get Market Results:** +**Get Market Results:** -Syntax: +- Syntax: ```bash $ python3 run_integritee_cli.py --command get_market_results_cmd --params ``` -Example: +- Example: ```bash $ python3 run_integritee_cli.py --command get_market_results_cmd --params 9PPeGELLdD9Uw1mVJbUGTeRpGzPBGb1bdEk6TCL4pPCE 5Dsni69ozXZZwpxyCGjLq8KQnBpGrtPnbykepgst2Tbh7NuY 2022-10-04T05:06:07+00:00 ``` -- **Get Bid Proof:** +**Get Bid Proof:** -Syntax: +- Syntax: ```bash $ python3 run_integritee_cli.py --command pay_as_bid_proof_cmd --params ``` -Example: +- Example: ```bash $ python3 run_integritee_cli.py --command pay_as_bid_proof_cmd --params 9PPeGELLdD9Uw1mVJbUGTeRpGzPBGb1bdEk6TCL4pPCE 5Dsni69ozXZZwpxyCGjLq8KQnBpGrtPnbykepgst2Tbh7NuY 2022-10-04T05:06:07+00:00 actor_0 ``` -- **Verify Proof:** +**Verify Proof:** -Syntax: +- Syntax: ```bash $ python3 run_integritee_cli.py --command verify_proof_cmd --params ``` -Example: +- Example: ```bash python3 run_integritee_cli.py --command verify_proof_cmd --params 9PPeGELLdD9Uw1mVJbUGTeRpGzPBGb1bdEk6TCL4pPCE 5Dsni69ozXZZwpxyCGjLq8KQnBpGrtPnbykepgst2Tbh7NuY "{\"root\":\"0xeae9131721b25db95622605c99a62f56f2e3b47e7f54f9b0653055b11b8d37b8\",\"proof\":[\"0xf147000d21d56a303b688da5bf1294d865518a8fb889af48ca21d12af5a6d823\"],\"number_of_leaves\":2,\"leaf_index\":0,\"leaf\":[0,0,0,0,0,0,0,0,1,100,50,48,50,50,45,49,48,45,48,52,84,48,53,58,48,54,58,48,55,43,48,48,58,48,48,28,97,99,116,111,114,95,48,1,0,0,0,0,0,0,0,0,0,0,20,64,82,184,30,133,235,81,200,63]}" From 56b87b1f66d8e1c9e63b29b7dcb363547b31be26 Mon Sep 17 00:00:00 2001 From: jtm91 Date: Thu, 24 Aug 2023 10:59:56 +0200 Subject: [PATCH 3/3] Revert "update README" This reverts commit 5376d55cd6dd8eb951fe822aa1964ec0c523d726. --- README.md | 44 +++++++++++++++++++++++++++++--------------- 1 file changed, 29 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index dbb1ac1..6839963 100644 --- a/README.md +++ b/README.md @@ -2,11 +2,24 @@ Use `Pyo3` Lib to wrap the `integritee-cli` into a Python lib. -## Installation +## Table of Contents + +- [Getting Started](#getting-started) +- [Prerequisites](#prerequisites) +- [Updating Git Submodules](#updating-git-submodules) +- [Creating and Activating venv](#creating-and-activating-venv) +- [Managing Environment Variables](#managing-environment-variables) +- [Installing Dependencies](#installing-dependencies) +- [Using maturin](#using-maturin) +- [Run as Command Line Tool](#run-as-command-line-tool) +- [Available Commands](#available-commands) +- [Troubleshooting](#troubleshooting) + +## Getting Started Get started with the project setup and initial configuration. -- ### Prerequisites +## Prerequisites In order to use the features, the nightly version of the compiler has to be setup beforehand: @@ -15,7 +28,7 @@ to be setup beforehand: $ rustup override set nightly ``` -- ### Updating Git Submodules +## Updating Git Submodules `Cargo.toml` states the relative dependencies at the `shared` folder. The submodules have to be initialized and updated before building: @@ -24,7 +37,7 @@ The submodules have to be initialized and updated before building: $ git submodule update --init --recursive ``` -- ### Creating and Activating venv +## Creating and Activating venv Install `integritee_cli_py` as lib into virtual environment: @@ -35,7 +48,7 @@ $ source venv/bin/activate $ conda deactivate ``` -- ### Managing Environment Variables +## Managing Environment Variables Please follow these steps to set up and use environment variables: @@ -47,7 +60,7 @@ $ cp .env.example .env 2. Open the `.env` file and provide values for the environment variables. -- ### Installing Dependencies +## Installing Dependencies Install the necessary dependencies using the provided `requirements.txt` file: @@ -55,7 +68,7 @@ Install the necessary dependencies using the provided `requirements.txt` file: $ pip install -r requirements.txt ``` -- ### Using maturin +## Using maturin To install the lib to your current python environment use: @@ -71,10 +84,11 @@ Test import and execution of `integritee_cli_py` in python: $ python run_integritee_cli.py --command --params ``` -The `integritee-cli-py` provides the following CLI commands: +## Available Commands -- ### Get Help +The `integritee-cli-py` provides the following CLI commands: +### Get help: **Syntax:** @@ -98,7 +112,7 @@ options: Parameters for the command ``` -- ### Create a new account: +### Create a new account: **Syntax:** @@ -106,7 +120,7 @@ options: $ python3 run_integritee_cli.py --command new_account_cmd ``` -- ### Create a new trusted account: +### Create a new trusted account: **Syntax:** @@ -114,7 +128,7 @@ $ python3 run_integritee_cli.py --command new_account_cmd $ python3 run_integritee_cli.py --command new_trusted_account_cmd --params ``` -- ### Pay As Bid: +### Pay As Bid: **Syntax:** @@ -128,7 +142,7 @@ $ python3 run_integritee_cli.py --command pay_as_bid_cmd --params