poa_backend v0.1.0 API Reference
Modules
POABackend
This module defines the API for the Authorisation
This module encapsulates the Token model. This is used in order to store banned tokens in Database
This module encapsulates the User model
Here we define the REST Endpoints for Authentication/Authorization features in poa_backend
.
There are two types of users who will use this Endpoints.
- One is the standard user which is associated to one Agent. This user will call only the /session endpoint in order to retrieve a JWT token needed for using the POA Protocol Endpoints. Those users are stored in a Database.
- The other kind of users are the POA administrators. This users can create normal users using the /user Endpoint, banning tokens, banning users…
Those Admins are defined in the Config (ie
prod.exs
) file and are loaded when the app starts. This is an example of how the Admins are defined
A Custom Handler is responsible of handling data sent from Agents (i.e. REST over HTTP, WebSockets…) “speaking” the POA Protocol
This module implements the REST Custom Handler over HTTP/1.1
The protocol messages Data type
The message received from the Agent (inspired in Plug.Conn
)
Regarding the POA Protocol only 2 types of message can be processed in the backend
Defines a Receiver Plugin
This is a Receiver Plugin which exposes a Websocket server and sends the metrics to the connected clients
This is a Receiver Plugin which stores the received Ethereum Blocks in DynamoDB
This is a Receiver Plugin which is in charge of storing the Ethereum Statistics received from the Agents in a Postgres
database. If we want to use it we have to declare it in the Config file, inside the :receivers
section, ie
This is a Receiver Plugin which is in charge of storing the System Metrics received from the Agents in a Postgres
database. If we want to use it we have to declare it in the Config file, inside the :receivers
section, ie
This module is needed when we create a release. We are using Mnesia locally so when we start create a release
we have to create the Mnesia files there. In order to do that we have to run this migrate/0
function