Introduction

Lisk Service is a web application that allows interaction with various blockchain networks based on Lisk and Bitcoin protocols.

The main focus of Lisk Service is to provide data to the UI clients such as Lisk Desktop and Lisk Mobile. Lisk Service makes it possible to access all blockchain live data in a similar way to the regular Lisk SDK API, and in addition provides users with much more details and endpoints, such as geolocation and various statistics about network usage.

The project implementation is based on Microservices. The technical stack is designed to deliver several microservices, and each of them provides one particular functionality. The data is served in JSON format and exposed by a public RESTful API.

Architecture

Architecture

Microservices

Table 1. The Lisk Service microservices
Microservice Description

Gateway

The Gateway component provides a RESTful HTTP API, which all users of Lisk Service can access and use. Its main purpose is to proxy API requests from users to other components provided by Lisk Service. It also maintains backwards compatibility when its public API is changed or replaced by a new version. This provides users with a central point of data access that never breaks existing application compatibility.

Lisk

The REST client component acts as a bridge between the Lisk SDK and the Lisk Service Gateway. Its main purpose is to provide enriched data from the Lisk SDK API. This component is designed to provide high availability, efficient and reliable access to the Lisk SDK API.

Template

The Template service is an abstract service whereby all of the services from Lisk Service are inherited from. It allows all services to share a similar interface and design pattern. The purpose here is to reduce code duplication and increase consistency between each service, hence simplifying code maintenance and testing.

Usage

Quick Installation

To install Lisk Service with all its dependencies, clone the Lisk Service repository:

git clone https://github.com/LiskHQ/lisk-service.git
A more detailed description of the setup and the prerequisites of Lisk Service is described in the Lisk Service setup guides.

Start Lisk Service

cd lisk-service
make up

Stop Lisk Service

make down

Retrieve data

Once Lisk Service is set up, configured and started, it is possible to retrieve data from the blockchain network, that it is connected to.

The HTTP API

The HTTP API offers a RESTful API with various additional endpoints as compared to the HTTP API of a normal Lisk node.

This API can be utilized to build powerful wallets and user interfaces for blockchain applications which are built with the Lisk SDK.

A complete overview of all available API endpoints is described in the API reference.

The API reference also offers the possibility to send interactive requests to Lisk Service, in order to retrieve live data from the Lisk Mainnet.

Example request: Obtain a list of all 101 currently forging delegates
curl -X GET "http://localhost:9901/api/v1/delegates/active?limit=101&offset=0" -H  "accept: application/json"
Example response
{
  "data": [
    {
      "address": "4935562234363081651L",
      "approval": "35.77",
      "missedBlocks": 157,
      "producedBlocks": 55222,
      "productivity": "99.72",
      "publicKey": "6122ac1fd71b437014ddbc4ec01e07879f5af1853536efaa0233bc12907c684b",
      "secondPublicKey": "6122ac1fd71b437014ddbc4ec01e07879f5af1853536efaa0233bc12907c684b",
      "rank": 93,
      "rewards": "109000000000",
      "username": "genesis_84",
      "vote": "4630668157412954"
    }
  ],
  "meta": {
    "count": 100,
    "offset": 25,
    "total": 43749
  },
  "links": {}
}