Skip to content

kaijun123/SolidityEventListener

Repository files navigation

SolidityEventListener

About

This repo contains code that listens to Transfer events from the USDT contract on Ethereum chain and saves the events into a PosgreSQL database.

Technology

  • TypeScript: Provide typing support
  • Ether.js: Connects to websocket and listen for the Transfer event
  • PostgreSQL: Database used to save the event details
  • Sequelize: ORM used to connect and interact with the PostgreSQL database
  • Sequelize CLI: To run the migrate files
  • ts-node: Run TS scripts by compiing on the fly

Necessary Files

  • .env file in root directory; variables to include
    • ENVIRONMENT
    • WEBSOCKET

Quick Start:

# This generates the config json file which is required when you migrate the schemas to the database
npm run script ./scripts/genConfig

# Compile typescript code into javascript
npm run build

# Create the database
npm run db:create

# Migrate schema
npm run db:migrate

# Start the server
npm run start

Tutorials:

TODO:

  • Remove config/config.json. Change .sequelizerc to use config.js, then use .env file to specify environment when running migrate files
  • Test sequelize-cli for create and drop db, and get rid of create and drop scripts
  • Connect to AWS RDS and host DB on AWS
  • Deply ecpress server on AWS EC2 instance

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published