subql
subql copied to clipboard
Move more code to node-core
Goals
The main goal is to further reduce code in nodes and move it to node-core. This should include:
- Restructuring the modules to separate common modules from specific modules
- Move subcommands code
- Improve NestJs dependency injection, this should include consistent naming and using interfaces.
Current Architecture
The current architecture has a lot of super classes to implement chain specific functions, this has lead to code dabbled throughout various classes, some of these functions even repeat themselves.
New Architecture
Node core would define some interfaces that implement the chain specific functions, these could be broken down into certain areas such as block fetching, block information (number, hash, parent), finalization, Safe API.
This would reduce the boiler plate of having super classes and speed up implementing new chains by having a clear set of interfaces to implement. It should also
There would still be places where super classes are needed for more customisability.