Interacting with Blockchain REST APIs in Cloud-Native Java

The Scenario

The servlet is deployed onto a cloud-native runtime and uses Web3api to interact with the Ethereum blockchain.

The API

The Application

An OpenAPI document is used to generate a Rest Client that is injected into the servlet for invocation.
git clone https://github.com/ericglau/restclient-web3api
cd restclient-web3api
mvn liberty:dev
An example of what the servlet returns.
The generated starter project.
The “api” and “models” directories were generated from the OpenAPI definition.
The generated REST client interface that you can call.
com.example.demo.api.Web3Api/mp-rest/uri=https://web3api.io
The actual servlet code which calls the REST client.

Next Steps

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store