zkt24/z2/README.md
2024-04-25 13:53:48 +02:00

130 lines
4.2 KiB
Markdown

# Veritas Revelata
The aim is to establish a robust framwork to combat
misinfomation, disinformation, and fake news, thereby providing a more re-
liable information system. This paper outlines the key components of the
proposal, including source evaluation, fact-checking, technological require-
ments, while also addressing the challenges and the ethical consideration
associated with such system.
the app contains of 2 main components a golang p2p node that runs the consesnsus algorithm for the blockchain
A decentralized frontend served over the internet or locally
# Containers used
- golang build: compliation container for compilling the app
- golang runner: runs the p2p node and the rpc server
- fe builder: compile and build the nodejs app for serving
- fe runner: serves the static files through SSR techonology for
# DEVOPS
The app requires a local registry running for develpoment use cases
The minikube local registry can be ran with:
```sh
minikube addons enable registry
```
running the applications requires
```sh
./start-app.sh
```
stopping it requires
```sh
./stop-app.sh
```
for checking the cluster with minikube you can run:
```sh
minikube dashboard
```
## Kubernetes
first we have the deployments:
### p2p-node Deployment:
- **Metadata**: The name of the deployment is p2p-node and it resides in the veritas namespace.
- **Replicas**: The desired number of replicas for this deployment is 1, meaning there should be one Pod running at any given time.
- **Pod Template**: This is the specification for creating Pods. It includes a single container.
- **Container**: The container is named p2pnode and uses the image localhost:5000/veritasnode. The image pull policy is IfNotPresent, meaning the image will be pulled only if it's not already present on the node.
- **Environment Variable**: There's an environment variable PORT set to 6000.
- **Ports**: The container exposes port 6000 for TCP traffic, and this port is also mapped to the host's port 6000.
- **Volume** Mounts: There's a volume mounted at /app using the volume named node-data.
- **Volumes**: The volume node-data is a PersistentVolumeClaim using the claim node-data.
### veritasfe Deployment:
- **Metadata**: The name of the deployment is veritasfe and it also resides in the veritas namespace.
- **Replicas**: The desired number of replicas for this deployment is also 1.
- **Selector**: The selector is looking for Pods with the label app: veritasfe.
- **Pod Template**:
- **Labels**: The Pod labels are app: veritasfe.
- **Container**: The container is named frontend and uses the image localhost:5000/veritasfe.
- **Ports**: The container exposes port 3000 for TCP traffic, and this port is also mapped to the host's port 3000.
- **Restart Policy**: The restart policy for the Pod is Always, meaning the containers in the Pod will always be restarted if they terminate.
### p2p-node Service
The `p2p-node` service is a service resource that exposes the `p2p-node`
- **Metadata:**
- Labels: `app: p2p-node`
- Name: `p2p-node`
- Namespace: `veritas`
- **Spec:**
- The service listens on port `6000` and forwards traffic to the target port `6000` on the `p2p-node` Pod.
- **Ports:**
- Name: `6000`
Port: `6000`
Target Port: `6000`
### frontend Service
The `frontend` service is a ervice resource that exposes the `frontend` deployment
- **Metadata:**
- Labels: `app: frontend`
- Name: `frontend`
- Namespace: `veritas`
- **Spec:**
- The service listens on port `3000` and forwards traffic to the target port `3000` on the `frontend` Pod.
- **Ports:**
- Name: `3000`
Port: `3000`
Target Port: `3000`
### PersistentVolumeClaim
The `PersistentVolumeClaim` (is a resource that requests storage for a Pod. In this case, the PVC is used to request storage for the `p2p-node` Pod.
- **Metadata:**
- Name: `node-data`
- Namespace: `veritas`
- **Spec:**
- **Access Modes:** `ReadWriteOnce`
The PVC requests a volume with read-write access for a single node.
- **Resources:**
- **Requests:**
- Storage: `300Mi`
The PVC requests 300Mi of storage.
# Accessibility
the frontend can be accessed through localhost:3000 on any web browser
and the rpc server runs on localhost:6000