Skip to content

Latest commit

 

History

History

notifications

README.md

Akash Console Notifications Service

Description

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.

Features

  • 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

Project Structure

  • 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

Project Setup

$ npm install

Docs and OpenAPI

More details here

Postgresql and Indexes

More details here

Environment Variables

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.

Compile and Run the Project

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

Run Tests

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

Testing Patterns

The 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-extended and MockProvider
  • 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 };
  }
});

License

This project is part of Akash Console and is licensed under the terms of its license agreement.

CosmosSDK

Target version: 53