Working and Set Up : video
This is the main file that runs the server. It is responsible for setting up the server and the routes.
This is the port that the server will be listening on for requests coming from the outside world.
- POST
/Indexer: This will be controlling all the requests coming regarding the indexer. Responsibilities :
- Creating new indexer
- Updating existing indexer
- Deleting existing indexer
This is the port that the server will be listening on for requests coming from the containers.
- POST
/Error: This will be controlling all the requests coming in from containers whenever they have an error. Responsibilities :
- Updating the error info in the database
- POST
/Update: This will be controlling all the requests coming in from containers whenever they have an update. Responsibilities :
- Updating the latest block processed info in the database
Entry point for the package , handles commands and calls the appropriate functions.
This file contains the code for the generator function which is responsible for generating :
interfaces.ts- This file contains the interfaces for the events and entities and enables hard type checking.
This file contains the code for the init function which is responsible for initializing the indexer folder and generating :
indexer.yaml- This file contains the configuration for the indexer. The events are read from IDL and entities are sample entities.mapping.ts- This file contains the code for each event handler. It is responsible for processing the event and storing it in the database.- npm and ts configs
This file connects to the RPC and listens for events.
This file contains the code for the generator function which is responsible for generating :
interfaces.ts- This file contains the interfaces for the events and entities and enables hard type checking. (This is different from the previous one as it is generated with fully working functions for entities which point tosavingFunction.tsandloadingFunction.tsinstead of shell functions)eventRouter.ts- This file contains the code for the event router function which is responsible for routing the events to the appropriate event handler.IDL_ts.ts- exports the IDL as an interface and a json object.
This file contains the code for the loading function which is responsible for loading and saving the entities from/to the database.