The dbsync-api service is a Node.js application designed to provide API access to interact with the dbsync database. This service enables efficient data retrieval for Cardano-related operations.
Before running the service, ensure the following dependencies are installed:
- PostgreSQL server
- Run this command for package installation
yarn install
- Create new file
.envand copy env variables form.env.exampleto.envand update the env variables.
DATABASE_URL: PostgreSQL database URL for dbsync_sanchonet. Forpreprodandpreviewupdate database instance accordingly.PORT: Port for running the server. Default value is 8080CORS_ENABLE: CORS support for cross-origin requests.
Run the following command to generate the database client and creating the required table mentioned in schema
yarn prisma generate
Now finally run the below command to start the
dbsync-apiservice:yarn dev
Now goto http://localhost:8080/api/docs to see list of api in swaggerDocs.