Connector
Last updated
Last updated
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.
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
Note that "the Connector" and the "connector service" are not the same. Both the "connector service" and Nginx service are part of "the Connector".
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.
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.
The Connector maintains a file called availableCurrencies.json
where each of the Wrapper APIs is defined.
In addition, it is responsible for sending and receiving requests from the through JSON-RPC protocol.
In order to keep track of which nodes are up and ready to receive requests, the Python server implements the . It receives requests when the starts a node, processes them and enables the Wrapper API that belongs to the blockchain of the started node.