Skip to content

Latest commit

 

History

History
53 lines (39 loc) · 1.42 KB

README.md

File metadata and controls

53 lines (39 loc) · 1.42 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.

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.

Run in mock mode

java -Ddummy.mode=true -jar target/logbookappApi-0.0.1-SNAPSHOT.jar

Get tours

```http://localhost:8080/tour-app/tours/allice/```