gvko / transaction-syncing-service

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Task Design, Considerations & Assumptions

See NOTES.md

Prerequisites to run the app

  1. Create a file named .env in the root of the project dir
  2. Copy-paste the contents of the .env.example file into the .env file
  3. Replace the <KEY> value with the Alchemy secret URL key for your node instance.
  4. If you want to use a testnet instead of a mainnet (eg. Goerli, Sepolia, Mumbai), make sure to actually change the whole URL for WS and HTTP URLs. There is no need to create new env vars for the testnets - you just have to update the URL values.

Quick start

For production-like env run:

npm run start:prod

And that's it.

This command will prepare docker containers and run everything needed:

  • compile the typescript files
  • build the API server image
  • start its container
  • start the DB container
  • run the DB migrations to create the needed tables

The transactions sync will start the moment the server is up and running.

Manual start (local dev env)

Install

$ npm install

Build

$ npm run build

DB Docker container

$ docker-compose up -d db

Running the app

$ npm start

This will start the app locally in watch mode (changes to the code will automatically trigger recompilation and restart of the app).

About


Languages

Language:TypeScript 93.1%Language:JavaScript 3.7%Language:Dockerfile 3.2%