Connector

The Connector is the part of the infrastructure that is responsible for routing the requests it receives to each of the APIs and sending them to the corresponding nodes.

Connector schema

External architecture

The Connector is composed of two different services, an Nginx reverse proxy, a router server coded in Python, and one API for every supported blockchain.

Nginx adds a layer of abstraction and security to the requests that reach the Connector. This allows to centralize all requests in a single access point, hide the IP address and allow HTTPS connections, among other things.

This is the only endpoint (URL) consumed by applications using NodeChain, thus making all requests made go through this component.

On the other side, the connector service is in charge of receiving, handling and routing all requests through three protocols:

  • JSON-RPC

  • REST API

  • Real-Time Websockets

In addition, it is responsible for sending and receiving requests from the nodes through JSON-RPC protocol.

Internal architecture

The connector service is divided into three parts:

  • A Python server (Router)

  • An Administration API

  • API packages for every supported blockchain

The Python server is responsible for handling and routing the requests it receives. It is also in charge of managing the APIs by enabling or disabling them.

In order to keep track of which nodes are up and ready to receive requests, the Python server implements the administration API. It receives requests when the startup script starts a node, processes them and enables the Wrapper API that belongs to the blockchain of the started node.

Communication between these components is done using the JSON-RPC protocol.

Each Wrapper API has its own endpoints due to the differences between each of the blockchains. However, the endpoints are intended to have as much uniformity as possible.

Wrapper APIs

The Connector maintains a file called availableCurrencies.json where each of the Wrapper APIs is defined.

The availableCurrencies.json file is purely for definition and will need to be modified when developing and adding a new API.

Last updated