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.
yarn install
yarn build
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.
- Update
.env
file with your own configuration. - Update directory permission
sudo chmod 777 docker/data
sudo chmod 777 docker/pgdata
- Run
postgresql
andbitcoind
:
docker compose up -d
- Build docker image under the project root directory
cd ../../ && docker build -t tracker:latest .
- 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
- Check tracker logs
docker logs -f tracker
- 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.