Api Handler
Clone this wiki locally
Introduction
The Api Handler is a subset of the DeFi Data Engine with the goal of retrieving data from external sources in an easy and code-less way. In this section we will cover how to set it up, how to write properties files, and how to extract the data it produces. Please note this page covers installation on Windows 10 so you may need to modify the instructions based on your OS.
System Requirements
To use the Api Handler you need the following:
- WSL
- Docker Desktop (with WSL 2.0 configured successfully)
- Git (Gitbash is highly recommended)
- Java SE17 or later
- Postman (Or any Api requesting application)
Quickstart
Step 1
Start Docker Desktop, such that Docker can be used via the command line.
Step 2
We will now build the Docker Volume that the Api Handler will write the data to. This can be done through the following command:
$ docker volume create defi-data
If you navigate to Docker Desktop and go to the Volumes tab, it should now look like this:
Step 3
Clone the repo to the desired directory. Note the repo is: https://github.rpi.edu/DataINCITE/IDEA-DeFi-CRAFT
.
Step 4
Navigate to the root directory of the cloned repository, such that your directory is .../IDEA-DeFi-CRAFT/
. From here, navigate to the Api-Handler
folder by doing:
$ cd DeFi-Data-Engine
$ cd Api-Handler
Step 5
Once in the root directory of the Api Handler, we can now build the Docker container. To do this we run the following command
$ docker build -t api-handler .
$ docker run -p 8080:8080 -it -v defi-data:/data api-handler
Step 6
The Docker container should now be running and should look similar to below:
Step 7
To terminate the application, you can go to Docker Desktop -> Containers and then stop the active container.