The Notifications Service is a key component of the Akash Console application, responsible for handling and routing notifications to users. It's built using the Nest framework with TypeScript.
- Chain Event Processing: Listens to blockchain events and processes them for notifications
- Notification Routing: Routes notifications to appropriate channels (email, etc.)
- Email Notifications: Sends email notifications via Novu
- Broker Service: Manages message queuing and delivery
- modules: Contains domain specific modules, core business logic
- interfaces: Contains various outer interfaces, these can be treated as independent entry points
- infrastructure: Contains implementations like dbs, message brokers, etc.
- common: Shared utilities and services
$ npm install| Name | Default | Description |
|---|---|---|
START_FROM_LATEST_BLOCK |
false |
When true, the block cursor is overwritten with the current chain height on startup, so the poller skips any backlog and begins from the latest block. Useful locally after the app has been off for a while, and occasionally in production when we need to skip blocks after failures or falling behind. |
# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prod# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:covThe service uses a consistent testing pattern with setup functions:
- Each test case calls a
setup()function to get dependencies - Mocks are created using
jest-mock-extendedandMockProvider - Tests are isolated and don't share state
Example:
describe('SomeService', () => {
it('should do something', async () => {
const { service, dependency } = await setup();
// Test implementation
});
async function setup() {
// Setup dependencies and return them
return { service, dependency };
}
});This project is part of Akash Console and is licensed under the terms of its license agreement.
Target version: 53