examples
examples copied to clipboard
Spring Boot Web3jSampleController
What does this PR do?
Creates a Web3jSampleRestController
, which injects the already existing Web3jSampleService
, to be able to retrieve the client version by doing:
GET /client/version
Further, it refactors some field-based DI to constructor-based DI, to adhere to Spring best practices. And it adds a dependency on spring-boot-starter-web
to be able to run the web service.
Where should the reviewer start?
Start at Web3jSampleRestControllerTest
as it covers the expected behavior. To test the changes manually, run an Ethereum client (e.g. Ganache) and go to http://localhost:8080/client/version
Why is it needed?
Because it allows the user to start the Spring Boot application with an example REST endpoint, without having to write code; while keeping the example minimal