Skip to content

Latest commit

 

History

History
45 lines (35 loc) · 1.5 KB

README.md

File metadata and controls

45 lines (35 loc) · 1.5 KB

logbook-app

Logbook App (REST API)

The REST API is made in Java with SpringBoot. It is used to communicate with the blockchain running either on the same or another system.

Prerequisites

Chaincode authorization

Even though there is already a running instance of the chaincode which can be accessed with the files in the wallet folder, if you want to use your own chaincode, remember to change the wallet/connection.yml and wallet/alice.id files to point to your own kubernetes cluster. More on this in the chaincode folder.

Discord Logger

The REST API can send logs to a Discord channel. To do this, you need to create a Discord Webhook and change the Discord webhook url webhookURL in the DiscordHook file.

Run and Build the REST API

Docker

Locate into the rest-api directory and (optionally) run the integration tests to check if a connection to the blockchain can be established:

cd rest-api
mvn package -Pintegration-tests

Build the docker image:

docker build -t logbook-app-rest-api .

Run the docker image:

docker run -p 8080:8080 logbook-app-rest-api

Local system

Locate into the rest-api directory and (optionally) run the tests to check if a connection to the blockchain can be established:

cd rest-api
mvn test

Run the application:

mvn spring-boot:run

Make sure that the wallet folder is in the root directory of the project.