Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

API Server Components

Simon Siegert edited this page May 31, 2018 · 10 revisions

Server Components

The Server is separated into various componets all handling different tasks. In some cases they communicate with each other or call methods in another component.

AuthenticationHandler

Holds the logic for user authentication, creation, login/logout and the user sessions.

UserHandler

Handles user logic. The UserHandler is responsible for creating users and validating users, and therefore handles the cryptographic procedures and the database access for the user table. It provides a route for creating new users.

LoginLogoutHandler

Handles all the user session state and login/logout functionality. The LoginLogoutHandler holds the user session cache and provides routes for login, logout, checking whether a user is logged in, as well as a middleware to ensure that certain requests can only be done by authenticated users.

DataStorageAccessor

HandleGetStatisticsFactory

Factory method for route function for statistics api. It provides different filters for accessing chain data, such as getting only a certain number of items or for a specified timespan.

DataRequests

Provides implementation of the different requests exposed by the HandleGetStatisticsFactory.

LoggerHandler

Provides a logger that loggs both to the console and the database, and then can be retrieved via a route and displayed in the browser for remote diagnostics.

DisplayLogsFactory

Provides a route to display logs in the browser. Both the number of items and the log level can be specified.

CreateLogger

Creates the logger that loggs both to the console and the database, with various log levels.

LogHTMLGenerator

Returns a html string containing the requested log.

Schema

The mongoose schema for storing logs in the database.

PrivateChainConfigurator

BlockchainController

Holds the state of all running private blockchain. Starts a websocket server to which backend controllers and monitors connect. It is also used to send messages to the blockchain controllers identifierd by their target system.

PrivateConfigurator

Provides routes for getting and setting the state of all running private chains and their parameters. When a scenario is started via the frontend, it looks up the scenario from the database and sends the scenario content to the cains.

FormatConverter

Formats a scenario defined by payloadSize, period, and number of nodes into a format similar to that of a parsed scylla log.

PrivateChainDataCollector

DataCollector

Class that instanciates a DoubleBuffer and exposes route for Blockchain nodes to POST their simulation data to.

ActiveChains

Holds the state of the simulation networks (which chain with number of hosts and miners), the running scenario (name, transaction period and payload size) and recordings (name, startTime and recording state). It also exposes methods to set and modify the state.

BufferAggregator

BufferAggregator contains the functions to aggregate and the buffered private data.

BufferAggregatorHelper

BufferAggregatorHelper contains the database queries to aggregate the received values and to create and initialize database storages.

CheckJsonContent

Checks whether a received object sent by a private chain node is valid in terms of containing right data fields and datatypes.

DoubleBuffer

Class of the double buffer to store incoming private chain data. Creates two buffers and switches the active (where incoming data gets stored) in a defined period. After the buffers are switched, the filled one gets aggregated and stored to the database.

EthereumSchema

The mongoose schema for storing temp private data in the database.

EthereumStorage

The mongoose schema for storing aggregated private in the database.

PublicChainDataCollector

ScyllaLogParser

UploadFactory

Is responsible for recieving, parsing, and storing Scylla logs and manually created scenarios. Also exposes a method to get a list of all scenarios and filter by their id.

ScyllaParser

Recieves a Scylla log and parses it into a format that the different blockchains in the backend can use.

ScyllaSchema

The mongoose database schema for storing parsed Scylla logs and scenarios in the database and read them at a later point.

FrontendRouting

DatabaseConnector