ipld-eth-beacon-indexer/application_component.md
Abdul Rabbani 6123fa40e8 Feature/22 test handling incoming events (#30)
* Checkpoint before the weekend

* Update location for SetupPostgresDB

* Include first functioning tests for processing head

* Fix gitignore

* Test CaptureHead | Add Metrics | Handle Test Race Conditions

This Commit allows us to:

* Test the `CaptureHead` function.
* Test parsing a single Head message.
* Test a Reorg condition.
* Add Metrics. This is primarily used for testing but can have future use cases.
* Rearrange the test due to race conditions introduced by reusing a variable. `BeforeEach` can't be used to update `BC`.

* Update and finalize testing at this stage

* Update code and CI/CD

* Fix lint errors

* Update CICD and fail when file not found.

* Update test to have failed as expected.
2022-05-17 16:45:40 -04:00

1.3 KiB

Table of contents generated with markdown-toc

Overview

This document will go through various application components

Components

internal/boot

The boot package in internal is utilized to start the application. Everything in the boot process must complete successfully for the application to start. If it does not, the application will not start.

pkg/database

The database package allows us to interact with a postgres DB. We utilize the interface to ensure we can interact with any sql database as well. I copied most of the code here from vulcanize/go-ethereum. Down the road, internal teams should be able to reference the package instead of copy pasting it and re-implementing it.

pkg/beaconclient

This package will contain code to interact with the beacon client.

pkg/version

A generic package which can be utilized to easily version our applications.

pkg/gracefulshutdown

A generic package that can be used to shutdown various services within an application.

pkg/loghelper

This package contains useful functions for logging.

internal/shutdown

This package is used to shutdown the ipld-ethcl-indexer. It calls the pkg/gracefulshutdown package.