From 0e4362c09b6ace10641705c3b8cdf02c14d2df7e Mon Sep 17 00:00:00 2001
From: davorluc <d.lucic4@hotmail.com>
Date: Mon, 2 Dec 2024 22:04:41 +0100
Subject: [PATCH] project infrastructure doc as readme

---
 Readme.md | 104 +++++++++++++++++++++++++++++++++---------------------
 1 file changed, 64 insertions(+), 40 deletions(-)

diff --git a/Readme.md b/Readme.md
index 3ee1ca4..30351af 100644
--- a/Readme.md
+++ b/Readme.md
@@ -1,67 +1,91 @@
+# Roesticoin Infrastructure Documentation
 
+## 1. Introduction
 
-# Project Plan: Roesticoin - A Stablecoin on the Ethereum Blockchain
+### Project Name
+Roesticoin (ROC)
 
+### Project Purpose
+Roesticoin is a stablecoin implemented on the Ethereum blockchain. Its value is pegged to the price of potatoes in Swiss francs (CHF), aiming to provide a unique and innovative use case for blockchain-based currency. The project aspires to combine traditional agricultural economics with modern decentralized finance principles, making it both practical and educational.
 
-## Getting all running
-when switching between Devcontainer and production, rebuild the container, because the base image is different
-### For development in Devcontainer
-- open in VS Code
-- add and modify `.env` file based on `.env.sample`
-- reopen in container
-### As release in Production
-- add and modify `.env` file based on `.env.sample`
-- `docker-compose -f docker-compose.yml -f docker-compose.release.yml up --build -d`
+### Target Audience
+This documentation is intended for Thomas Bocek, the blockchain module professor at OST - University of Applied Sciences, as well as team members or developers who worked on the project.
 
+---
 
-## Project Title:  
-**Roesticoin: Swiss Franc-Pegged Stablecoin on Ethereum**
+## 2. Architecture Overview
 
+### Key Components
+- **Grafana Dashboard**: Provides a visual representation and monitoring of key metrics related to the Roesticoin project. It enables the team to track real-time data and ensure system reliability. It also double serves as our frontend.
+- **Roesticoin Service**: Manages core application functions such as minting, burning, liquidity, marketplace operations, and token interactions. This is the backbone of the project, ensuring the proper functionality.
+- **Prometheus**: Integrated with Grafana for data collection and metric aggregation. Prometheus ensures reliable and scalable data monitoring.
 
+### Key Technologies
+- **Programming Languages**: C# (backend and application logic), Solidity (smart contract implementation on Ethereum).
+- **Monitoring Tools**: Grafana (dashboard creation and visualization), Prometheus (data collection and alerting).
+- **Database**: Postgresql (database)
+- **Containerization**: Docker (standardizes development and deployment processes).
 
-## Team:  
-- Andri Joos
+---
 
-- David Hintermann
+## 3. Infrastructure Details
 
-- Davor Lucic
+### Environment Setup
+We use two environments to facilitate development and deployment:
+1. **Normal Environment**: A typical environment used for application deployment and testing in real-world scenarios.
+2. **Devcontainer**: A standardized development environment configured using:
+   - A JSON configuration file that defines the settings and dependencies.
+   - A Docker Compose file to automate container setup and ensure uniformity across team members. This setup simplifies onboarding and minimizes discrepancies in development environments.
 
+### Hosting
+The Coin itself is deployed on the Ethereum blockchain. However, the rebalancing service we have is centralized. 
 
+### Monitoring Metrics
+Metrics monitored through Grafana include:
+- **Total Supply of Roesticoin**: Tracks the overall circulating supply of the token.
+- **WETH/Roesticoin Price**: Monitors the token's exchange rate with Wrapped Ethereum (WETH).
+- **Marketplace Potato Price (CHF and ETH)**: Reflects the price of potatoes in Swiss francs and its equivalent in Ethereum.
+- **ETH Price in CHF**: Keeps track of the current Ethereum price in Swiss francs for accurate conversions.
+- **Total Weight of Potatoes in Storage**: Provides an aggregated value of all stored potatoes, essential for accurate backing of the stablecoin.
 
-## Objective:  
-The goal of this project is to design and implement **Roesticoin**, a stablecoin pegged to the Swiss Franc 
+---
 
-(CHF) on the Ethereum blockchain. The coin will be implemented using **.NET technologies** for smart contract development and integration. The stablecoin will ensure stability through 1:1 collateralization with CHF and aim to serve as a reliable means of exchange.
+## 4. Deployment Processes
 
+### Development Environment Setup
+1. **Prerequisites**: Ensure Docker and the VS Code Dev Containers plugin are installed on your machine.
+2. **Setup Process**: Open the project directory in VS Code. Use the Dev Containers feature to launch the development environment automatically.
+3. **Run the Application**: Execute `Program.cs` using your development tools. This initializes the entire Roesticoin service, including core functionalities like monitoring and token operations.
+4. **Standardization**: The devcontainer setup ensures that all developers work in a consistent environment, minimizing compatibility issues.
 
+---
 
-## Deliverables:  
-1. **Roesticoin Smart Contract**: An Ethereum-based ERC-20 token with functionality for minting, burning, and transferring tokens.  
-2. **Backend System**: A .NET-based system that integrates with the Ethereum blockchain to manage the issuance and redemption of Roesticoin, and interfaces with the Swiss Franc.
-3. **Frontend Application**: A user-friendly interface for interacting with Roesticoin, allowing users to manage their tokens via a web-based dashboard.
+## 5. Tokenomics
 
-<img src="overview.png">
+### Minting and Burning Process
+- **Minting**: Tokens are minted when the current supply of ROC is too low to push the current course.
+- **Burning**: Burning works as the opposite of minting: when the supply of ROC is too high so the current course can't be pushed down enough, we burn ROC.
+- These mechanisms follow established strategies used by other stablecoins, ensuring stability and reliability.
 
-## Technologies:  
-- Blockchain: **Ethereum**
-- Smart Contract Language: **Solidity** (with .NET interoperability)
-- Backend: **.NET**
-  - **Nethereum**
-- Frontend: **ASP.NET** for web development
-- Testing: **Remix IDE**, **Nethereum** for Ethereum blockchain testing
+---
 
+## 6. Monitoring and External Dependencies
 
+### Data Sources
+- Roesticoin relies on the official potato price published by the Swiss government. This data is manually fetched from reliable government reports, as no API is available.
 
-## Risk Management:
-- **Blockchain Gas Fees**: Ensure the contract is optimized for gas efficiency.
-- **Security Vulnerabilities**: Conduct smart contract audits and testing to prevent issues like reentrancy attacks.
-- **Currency Peg Stability**: Implement mechanisms to monitor CHF collateral and ensure accurate pegging.
+---
 
+## 7. Security
 
+### Secure Processes
+- The project adheres to standard blockchain security practices, ensuring the integrity and robustness of minting and burning operations.
+- Smart contracts are thoroughly reviewed and tested to avoid vulnerabilities or exploits to the best of our abilities.
+- Since the code base is on Andri Joos' own Gitlab server, access to the codebase is very restricted.
 
-## Evaluation Criteria:
-- Functionality of Roesticoin as a stablecoin pegged to CHF.
-- Successful deployment on Ethereum with full integration in .NET.
-- User interface and ease of interaction through the web dashboard.
-- Security and efficiency of smart contract code.
+---
 
+## 8. Maintenance
+
+### Documentation Maintenance
+- This will be the first and list time the documentation will be updated, since the projects is ending its lifecycle.
-- 
GitLab