Skip to content

Service that subscribes to certain blockchain events and stores them in a database. On the other side, it exposes this data with a basic API.

License

Notifications You must be signed in to change notification settings

DSG-UPC/events-cache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

70 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CI/CD

events-cache

This repository contains three different things:

  • ereports-postgres: a postgres database. Files are in database folder.
  • ereports-events: a service that subscribes to eReuse-Blockchain events and saves them to ereports-postgres. Files are in events.
  • ereports-api: an HTTP API that serves database content and manages stamps. Files can be found in api.

Install

Ereports-api and ereports-events are npm projects, which means they can be installed and executed following the conventional steps:

Inside one of the projects folders, run npm install to install the dependencies. Also, cp .env.example .env and fill the fields.

Refer to database README for instructions on how to set up the postgres database.

Execution

Both ereports-api and ereports-events have development scripts in package.json. Run npm start to execute a single time or npm run dev to reload every time a file changes.

What does it do?

Event subscription

This service subscribes to certain events from the eReuse blockchain. Their data is extracted and immediately inserted into the postgres database.

API

A simple express API exposes some endpoints so an external application can easily get device and user data.

About

Service that subscribes to certain blockchain events and stores them in a database. On the other side, it exposes this data with a basic API.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published