Skip to content

Latest commit

 

History

History
77 lines (53 loc) · 1.53 KB

README.md

File metadata and controls

77 lines (53 loc) · 1.53 KB

CAT Tracker

The tracker reads CAT token transactions from the blockchain, stores them in a database (Postgres) in a structured way, which can be quickly retrieved via RESTful APIs. The Swagger documentation for all the APIs can be found at http://127.0.0.1:3000 after running.

Installation

yarn install

Build

yarn build

Before Run

The tracker needs a full node and Postgres. We use Fractal node as an example here.

Make sure you have docker installed, you can follow this guide to install it.

  1. Update .env file with your own configuration.
  2. Update directory permission
sudo chmod 777 docker/data
sudo chmod 777 docker/pgdata
  1. Run postgresql and bitcoind:
docker compose up -d

Run the tracker service

Use Docker (Recommended)

  1. Build docker image under the project root directory
cd ../../ && docker build -t tracker:latest .
  1. Run the container
docker run -d \
    --name tracker \
    --add-host="host.docker.internal:host-gateway" \
    -e DATABASE_HOST="host.docker.internal" \
    -e RPC_HOST="host.docker.internal" \
    -p 3000:3000 \
    tracker:latest
  1. Check tracker logs
docker logs -f tracker

Use yarn

  • development mode
yarn run start
  • production mode
yarn run start:prod

Note: Make sure the tracker syncs to the latest block before you run CLI over it. The sync-up progress can be found at http://127.0.0.1:3000/api after running.