Primary

Primary Node Documentation

Introduction

The Primary Node serves as the central coordinator within a decentralized Synnq Ecosystem. It is responsible for managing the Directed Acyclic Graph (DAG) structure, processing transactions, handling synchronization between nodes, aggregating model updates, and overseeing governance proposals. This documentation outlines the architecture, key functionalities, and usage guidelines for the Primary Node.


Architecture and Components

The Primary Node is composed of several critical components:

  • DAG (Directed Acyclic Graph): The DAG is the core data structure used by the Primary Node to track and manage transactions. It ensures that all transactions are processed in a consistent, conflict-free order.

  • Mempool: The Mempool temporarily holds transactions before they are processed. The Primary Node manages the flow of transactions from the Mempool into the DAG.

  • Neural Network: The Primary Node contains a neural network model that is updated based on contributions from Worker Nodes. This model is used to make decisions and predictions within the network.

  • Sync Manager: This component is responsible for synchronizing transaction data between the Primary Node and other nodes in the network. It ensures that all nodes maintain a consistent view of the transaction history.

  • Governance Module: The Governance Module manages proposals and voting within the network. Proposals can be submitted, voted on, and implemented based on the consensus of the nodes.

  • Token Manager: The Token Manager oversees the creation, distribution, and management of tokens within the network. It ensures that all token-related operations are securely executed and recorded.


Core Functionalities

1. Transaction Management

The Primary Node is responsible for processing transactions received from the Mempool. It validates each transaction, adds it to the DAG, and ensures that the DAG remains consistent. The node also handles the processing of transaction batches, which allows for efficient and parallelized transaction management.

2. Data Synchronization

Synchronization is crucial in a decentralized network to ensure that all nodes have an up-to-date and consistent view of the transaction history. The Primary Node manages synchronization requests, handles incoming synchronization data, and sends synchronization updates to other nodes. This process involves the exchange of transaction data and state information between nodes.

3. Model Update Aggregation

The neural network model within the Primary Node is periodically updated based on contributions from Worker Nodes. The Primary Node aggregates these model updates, applies them to the neural network, and ensures that the updated model is stored and shared across the network. This continuous learning process improves the accuracy and reliability of the network's predictions and decisions.

4. Governance

The Primary Node plays a central role in the network's governance by managing proposals and votes. Nodes can submit proposals for changes or actions within the network, which are then voted on by other nodes. The Primary Node tracks the progress of these proposals, counts votes, and implements proposals that have been accepted by the network.

5. Neural Network Management

The Primary Node's neural network is a crucial component for decision-making within the network. The node manages the storage and retrieval of neural network parameters, handles model updates, and applies these updates to the neural network. The Primary Node also facilitates the sharing of neural network parameters across the network to ensure consistency.


Using the Primary Node

To effectively use the Primary Node:

  • Initialization: Start by configuring the node with the necessary components, such as the DAG, Mempool, and neural network. Ensure that the sync manager, governance module, and token manager are also set up.

  • Continuous Operation: Once initialized, the Primary Node operates continuously, processing transactions, managing synchronization, and handling model updates. Allow the node to run uninterrupted to maintain network stability.

  • Synchronization: The Primary Node should be regularly synchronized with other nodes in the network to ensure data consistency. This is done automatically, but manual synchronization can be triggered if needed.

  • Governance Participation: Engage in the network's governance by submitting proposals, voting on existing proposals, and implementing accepted changes. The Primary Node facilitates these processes and ensures that they are executed correctly.

  • Monitor Performance: Regularly check the node's performance, including its transaction processing speed, synchronization status, and neural network updates. Address any issues promptly to maintain network efficiency.