Skip to main content

Network

Transformers uses a fully connected, decentralized, distributed P2P network structure.

image

Transformers is connected to the blockchain network via P2P where all full nodes are equal and act as both clients and servers.

Distributed Networks and Node Communication

All nodes in Transformers are equal and have all node characteristics.

  • Archiving---A node that saves the historical state of all blocks, the state of the world corresponding to any block in history is saved on the node
  • Validation---The validity of transaction data can be verified directly locally.
  • Broadcast---Full participation in the block information and transaction information of the whole network broadcasting
  • Heartbeat---Verify the connection state robustness of nodes in the network
  • Interface---Open query interface to provide basic and accurate current information
  • Synchronization of nodes---Discover new nodes when they join the block and connect to broadcast when other nodes

Network Communication Flow

Transformers uses the more stable TCP peer-to-peer communication. When using TCP communication, messages are first stored in a cache, then distributed via a transaction distributor, and finally processed by individual functions.

Communication Implementation

Peerlist: In other P2P networks, each node stores information about other nodes.

When requesting one of the nodes, it is necessary to loop through all the nodes until the requested node is found. The current problem co-existing in some blockchain projects is that when the number of nodes in the network is expanding, it is not possible to store the information of all other nodes on each node. As the number of nodes increases, so does the number of layers, and the more information is stored at higher levels. This will cause great difficulty in reading the subsequent data and will reduce the timeliness of the network data. In order to solve this problem, Transformers sacrifices the node order of magnitude at the application level to improve the propagation efficiency of the network nodes. And within the order of magnitude of the service, it can complete the communication of the whole network quickly. If the number exceeds the threshold, it will lead to slower transactions, and Transformers kicks out a part of the unqualified nodes to solve this problem.

When node A receives a request message, the node information of sender B is used to update the corresponding node list in the following steps:

  1. node A records the IP, block height and other information of sender node B.
  2. if sender B already exists in the node list, node A list information is updated.
  3. if node B is not in the node list, add node B information to the node A list.
  4. broadcast the B node information to other nodes.

The node list is the node information recorded by node A. It is mainly used to view the node information, judge whether the communication between nodes is directly sent or forwarded and (public network) exercise the routing function, and the node information has ip, name, logo and so on. The node will save the information of all connected nodes.

Network function module

TCP registration steps

  1. the registration sending node sends a registration request to the registered node, if there is no connection between the two nodes then it will connect first, if the connection fails then it will re-initiate the registration.
  2. The registered node processes the registration request and returns node-specific information.
  3. The registration sending node processes the registration response sent back by the registered node and records the corresponding node information.

Heartbeat mechanism
If a node does not reconnect within a specified period of time after a node is offline, the heartbeat count becomes 0 and the node is deleted.

  • Steps
    1. The node reduces the heartbeat count of all known nodes by 1 and sends a ping request.
    2. When the receiving node successfully receives the ping request, reset the heartbeat count of the sending node and send a pong request.
  1. When the sending node successfully receives the pong request, reset the heartbeat count of the receiving node and update the information of the receiving node.

Block height change notification

  • Steps
    Sends its own node height to the node it is connected to when the node height is changed, and the receiving node processes the block height change request and updates the block height of the corresponding node.

Public Network IP

The Global Test Network is currently the main public Transformers production block for signing and synchronizing data.

The ports of public node:
HTTP port: 20620
P2P network port: 20619