SYNNQ System Documentation
Table of Contents
Getting Started
This section will guide you through the initial setup of the SYNNQ Node System, including installation, running the node, and basic interactions.
Prerequisites
Before you begin, ensure the following tools and libraries are installed:
- Rust: Install the latest stable version from rust-lang.org (opens in a new tab).
- Tokio: Used for asynchronous operations; included in the
Cargo.toml
. - RocksDB: Required for persistent storage.
Installation
-
Clone the repository:
git clone https://github.com/synnq/ ** NOT PUBLISHED YET ** cd synnq_dag
-
Build the project:
cargo build --release
-
Start the primary node:
cargo run --release -- primary db
System Requirements for Worker Node
Worker nodes process transactions and model updates. Below are the requirements:
Hardware Requirements
- CPU: 4+ cores
- Memory: Minimum 8GB RAM
- Storage: 100GB SSD
- Network: High-speed internet
Software Requirements
- Operating System: Ubuntu 18.04 or later
- Rust: Latest stable version
- RocksDB: Install using:
sudo apt-get install -y librocksdb-dev
Setup Instructions
-
Install Rust:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
-
Install RocksDB:
sudo apt-get install -y librocksdb-dev
-
Build and run the worker node:
cargo build --release cargo run --release -- worker worker-db
API Endpoints
The system provides a set of RESTful API endpoints for interacting with the blockchain and the neural network. Below are the primary endpoints.
Wallet Management
/create_wallet
: Creates a new wallet.
-
Method: POST
-
Payload:
{ "prefix": "wallet_prefix" }
-
Response:
{ "address": "wallet_address", "public_key": "public_key", "private_key": "private_key", "mnemonic": "mnemonic_phrase", "balances": [{ "SYQ": 0 }], "bearer_token": "token", "signature": "signature" }
/get_wallet
: Retrieves wallet information by address.
- Method: POST
- Payload:
{ "address": "wallet_address" }
- Response:
{ "address": "wallet_address", "public_key": "public_key", "balances": [{ "SYQ": 100 }] }
/retrieve_wallet_from_mnemonic
: Retrieves wallet using mnemonic phrase.
- Method: POST
- Payload:
{ "mnemonic": "mnemonic_phrase" }
- Response:
{ "address": "wallet_address", "public_key": "public_key", "private_key": "private_key" }
Transaction Management
/transaction
: Submits a transaction to the network.
- Method: POST
- Payload:
{ "sender": "wallet_address", "receiver": "receiver_address", "amount": 10, "denom": "SYQ", "metadata": { "key": "value" } }
- Response:
{ "status": "success", "transaction_hash": "hash_value" }
/get_transaction
: Retrieves a transaction by hash.
- Method: GET
- Query:
{ "hash": "transaction_hash" }
- Response:
{ "sender": "wallet_address", "receiver": "receiver_address", "amount": 10, "status": "confirmed" }
/get_all_transactions
: Retrieves all transactions.
- Method: GET
- Query:
{ "page": 0 }
- Response:
{ "transactions": [...], "page": 0, "total_pages": 10 }
Model and Prediction Management
/update_model
: Submits a model update to the primary node.
- Method: POST
- Payload:
{ "model_name": "model_name", "model_update": {...} }
- Response:
{ "status": "success" }
/predict
: Makes a prediction using the neural network.
- Method: POST
- Payload:
{ "model_type": "model_name", "data": {...} }
- Response:
{ "status": "success", "prediction": "predicted_value" }
/forecast
: Requests a forecast from the neural network.
- Method: POST
- Payload:
{ "model_type": "model_name", "data": {...} }
- Response:
{ "status": "success", "forecast": "forecast_value" }
Governance and Voting
/submit_proposal
: Submits a governance proposal.
- Method: POST
- Payload:
{ "proposer": "wallet_address", "parameters": {...}, "description": "Proposal description", "voting_deadline": 1234567890 }
- Response:
{ "status": "success", "proposal_id": 1 }
/vote_on_proposal
: Votes on a proposal.
- Method: POST
- Payload:
{ "proposal_id": 1, "vote": true }
- Response:
{ "status": "success" }
Description
The SYNNQ Node System is a decentralized blockchain platform that leverages a DAG (Directed Acyclic Graph) structure for efficient transaction processing. The system integrates a federated learning model, enabling nodes to collaboratively train neural networks while maintaining data privacy.
Key Features
- Federated Learning: Distributed model training across nodes with local data privacy.
- DAG for Transactions: A scalable, parallelized transaction processing mechanism.
- Token Management: Native and custom token creation, management, and distribution.
- Governance: Decentralized governance allowing stakeholders to submit and vote on proposals.
Architecture
The architecture of the SYNNQ Node System is modular and designed for scalability and security. Below is an overview of its key components.
Primary Node
The primary node is the core of the network, responsible for:
- Transaction Processing: Validates and adds transactions to the DAG.
- Model Aggregation: Aggregates model updates from worker nodes.
- Synchronization: Ensures data consistency across the network.
Worker Nodes
Worker nodes participate in the network by:
- Local Model Training: Train models locally and share updates with the primary node.
- Transaction Processing: Validate transactions and participate in consensus.
Synchronization Manager
The SyncManager
ensures that all nodes maintain a consistent view of the network state, including transactions, token balances, and neural network parameters.
Neural Network Module
Handles federated learning, including:
- Model Updates: Receives and applies updates to the global model.
- Parameter Aggregation: Aggregates parameters from multiple nodes.
Persistent Storage
Uses RocksDB for storing the state of the DAG, neural network parameters, token balances, and other critical data.
This documentation provides a complete overview of the SYNNQ Node System, offering developers a foundation to build, extend, and maintain the system. For further details or to contribute, please consult the codebase or contact the development team.