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
.env
and copy env variables form.env.example
to.env
and update the env variables.
DATABASE_URL
: PostgreSQL database URL for dbsync_sanchonet. Forpreprod
andpreview
update 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-api
service:yarn dev
Now goto http://localhost:8080/api/docs
to see list of api in swaggerDocs
.