hermeznetwork / hermez-node

Hermez node Go implementation
GNU Affero General Public License v3.0
58 stars 33 forks source link

Don't import StateDB on API package #1069

Open arnaubennassar opened 3 years ago

arnaubennassar commented 3 years ago

Rationale

The api package is designed to run standalone, separated from the coordinator. The reason behind this is to support horizontal scaling, and to isolate the coordinator workload from the api.

We included the StateDB in order to provide info on the GET /health endpoint, the problem is that this requires the api to be run on the same machine of the coordinator/synchronizer.

Implementation

In general we're using Postgres as a message channel for coordinator ==> api communication. This is not the most elegant solution, but it allows us to: