Sender / Client Server
The client server is responsible for managing log files and calculating hashes.
Location
Logs are stored in /root/keralis/logs/
.
File Structure
/root/keralis/
├── sender/
│ ├── setup.sh # Installation script for the sender server
│ ├── senderV1.py # Program for sending .hash and .log.enc files via SFTP to the blockchain server
│ └── .env # Environment variables (defined via ./setup.sh)

SFTP transfer diagram
Code Operation
setup.sh
Script that generates the .env file and completes it with the provided information.
senderV1.py and PM2
The script executes an automated set of steps as soon as a new log file is detected:
- Detection of a new log file
- Generation of a file hash using SHA256
- Generation of an encrypted copy of the file (.log.enc)
- Sending of both files to the blockchain server via SFTP
- Storage in MongoDB on the blockchain server

PM2 logs for senderV1.py
Hash API Server
The client-hash-server.js
file implements a REST API server with the following features:
- SHA-256 hash calculation for files
- Hash caching for performance optimization
- API secured by key
- Management of test modifications

PM2 logs for API server
API Endpoints
The server exposes the following endpoints:
GET /api/logs
- List of available log filesGET /api/hash/:fileName
- Hash of a specific filePOST /api/modify/:fileName
- Test modification (for development)POST /api/restore/:fileName
- Restoration of a modified file
PM2 summary

pm2 list on client server
- id 1 => Sender: senderV1.py (SFTP sending)
- id 3 => Hash-server: client-hash-server.js (API server)