From 5ff415deb8f031f6729c1829f4ce60b2cff19a5e Mon Sep 17 00:00:00 2001 From: Gulshan Yadav Date: Mon, 2 Feb 2026 01:26:44 +0530 Subject: [PATCH] docs: add README with installation instructions and fix Docker builds - Add comprehensive README with installation guides for: - Desktop wallet (macOS DMG, Windows MSI/EXE, Linux AppImage) - Node daemon (pre-built binaries and Docker) - Build from source instructions - CLI usage and RPC API examples - Configuration reference - Fix Dockerfiles: simplify build context, use -p package flag - Fix unstable Rust feature: replace is_multiple_of with modulo operator --- Dockerfile | 6 +- Dockerfile.faucet | 4 +- README.md | 221 ++++++++++++++++++++++++++++++ crates/synor-dag/src/dagknight.rs | 2 +- 4 files changed, 226 insertions(+), 7 deletions(-) create mode 100644 README.md diff --git a/Dockerfile b/Dockerfile index e11ebaf..f419020 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,11 +23,9 @@ COPY Cargo.toml Cargo.lock ./ COPY src/ src/ COPY crates/ crates/ COPY apps/ apps/ -COPY contracts/ contracts/ -COPY sdk/ sdk/ -# Build release binary -RUN cargo build --release --bin synord +# Build release binary (using -p for package, synord includes the bin) +RUN cargo build --release -p synord # ============================================================================= # Stage 2: Runtime Environment diff --git a/Dockerfile.faucet b/Dockerfile.faucet index b6c8e4c..aa2cc2a 100644 --- a/Dockerfile.faucet +++ b/Dockerfile.faucet @@ -24,8 +24,8 @@ COPY src/ src/ COPY crates/ crates/ COPY apps/ apps/ -# Build release binary -RUN cargo build --release --bin synor-faucet +# Build release binary (using -p for package, synor-faucet includes the bin) +RUN cargo build --release -p synor-faucet # ============================================================================= # Stage 2: Runtime Environment diff --git a/README.md b/README.md new file mode 100644 index 0000000..74089b0 --- /dev/null +++ b/README.md @@ -0,0 +1,221 @@ +# Synor Blockchain + +Quantum-secure decentralized cloud computing platform built on DAG-based consensus. + +## Features + +- **Quantum-Resistant Cryptography**: Hybrid Ed25519 + Dilithium3 signatures (NIST FIPS 204) +- **DAG Consensus**: GHOSTDAG-based ordering for high throughput +- **Smart Contracts**: WASM-based execution with Rust SDK +- **Post-Quantum Security**: Future-proof against quantum computing threats + +## Installation + +### Desktop Wallet + +Download the latest release for your platform: + +| Platform | Download | Notes | +|----------|----------|-------| +| **macOS (Apple Silicon)** | `Synor-Wallet_x.x.x_aarch64.dmg` | Drag to Applications | +| **macOS (Intel)** | `Synor-Wallet_x.x.x_x64.dmg` | Drag to Applications | +| **Windows** | `Synor-Wallet_x.x.x_x64_en-US.msi` | Run installer (recommended) | +| **Windows (portable)** | `Synor-Wallet_x.x.x_x64-setup.exe` | Alternative installer | +| **Linux** | `Synor-Wallet_x.x.x_amd64.AppImage` | `chmod +x && ./` | + +**First launch on macOS**: Right-click → Open (to bypass Gatekeeper if not code-signed) + +### Node Daemon (synord) + +Download pre-built binaries: + +| Platform | Download | +|----------|----------| +| **Linux x86_64** | `synor-linux-x86_64.tar.gz` | +| **Linux ARM64** | `synor-linux-aarch64.tar.gz` | +| **macOS x86_64** | `synor-macos-x86_64.tar.gz` | +| **macOS ARM64** | `synor-macos-aarch64.tar.gz` | +| **Windows x86_64** | `synor-windows-x86_64.zip` | + +```bash +# Extract and install (Linux/macOS) +tar -xzf synor-.tar.gz +sudo mv synord /usr/local/bin/ +sudo mv synor-cli /usr/local/bin/ + +# Initialize and run +synord init --network testnet +synord run --network testnet +``` + +### Docker (Recommended for Nodes) + +```bash +# Run a single node +docker run -d \ + --name synor-node \ + -p 17511:17511 \ + -p 17110:17110 \ + -p 17111:17111 \ + -v synor-data:/data/synor \ + synor/synord:latest \ + --network testnet + +# Run multi-node testnet +./scripts/testnet-deploy.sh start +``` + +**Ports:** +| Service | Port | Description | +|---------|------|-------------| +| P2P | 17511 | Peer-to-peer network | +| HTTP RPC | 17110 | JSON-RPC API | +| WebSocket RPC | 17111 | WebSocket API | + +## Build from Source + +### Prerequisites + +**All platforms:** +- Rust 1.75+ (`curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh`) + +**macOS:** +```bash +brew install rocksdb cmake llvm node pnpm +``` + +**Ubuntu/Debian:** +```bash +sudo apt-get install -y librocksdb-dev libclang-dev cmake pkg-config libssl-dev +``` + +**Windows:** +```powershell +winget install Rustlang.Rustup Microsoft.VisualStudio.2022.BuildTools OpenJS.NodeJS.LTS LLVM.LLVM +npm install -g pnpm +``` + +### Build Node + +```bash +# Clone repository +git clone https://github.com/g1-technologies/synor.git +cd synor + +# Build all binaries +cargo build --release --workspace + +# Binaries located at: +# ./target/release/synord (node daemon) +# ./target/release/synor-cli (CLI wallet) +``` + +### Build Desktop Wallet + +```bash +# Install Tauri CLI +cargo install tauri-cli + +# Build wallet +cd apps/desktop-wallet +pnpm install +pnpm tauri:build + +# Output: +# macOS: src-tauri/target/release/bundle/dmg/ +# Windows: src-tauri/target/release/bundle/msi/ +# Linux: src-tauri/target/release/bundle/appimage/ +``` + +## Usage + +### CLI Wallet + +```bash +# Create new wallet +synor-cli wallet create + +# Check balance +synor-cli balance + +# Send tokens +synor-cli send
+ +# View network info +synor-cli info +``` + +### RPC API + +```bash +# Get node info +curl -X POST http://localhost:17110 \ + -H "Content-Type: application/json" \ + -d '{"jsonrpc":"2.0","method":"synor_getInfo","params":[],"id":1}' + +# Get block count +curl -X POST http://localhost:17110 \ + -H "Content-Type: application/json" \ + -d '{"jsonrpc":"2.0","method":"synor_getBlockCount","params":[],"id":1}' +``` + +## Configuration + +Config file: `~/.synor/config.toml` (Linux/macOS) or `%APPDATA%\Synor\config.toml` (Windows) + +```toml +[network] +network = "testnet" # mainnet, testnet, or devnet + +[p2p] +listen_addr = "/ip4/0.0.0.0/tcp/17511" +max_peers = 50 + +[rpc] +http_enabled = true +http_addr = "127.0.0.1:17110" +ws_enabled = true +ws_addr = "127.0.0.1:17111" + +[mining] +enabled = false +coinbase_address = "synor:qz..." +threads = 4 +``` + +## Documentation + +- [Developer Guide](docs/DEVELOPER_GUIDE.md) - Full development documentation +- [Deployment Guide](docs/DEPLOYMENT.md) - Production deployment instructions +- [Code Signing](docs/CODE_SIGNING.md) - Certificate setup for releases +- [API Reference](docs/API.md) - RPC API documentation + +## Architecture + +``` +synor/ +├── apps/ +│ ├── synord/ # Node daemon +│ ├── cli/ # CLI wallet +│ ├── desktop-wallet/ # Tauri desktop wallet +│ ├── faucet/ # Testnet faucet +│ └── explorer/ # Block explorer +├── crates/ +│ ├── synor-crypto/ # Quantum-resistant cryptography +│ ├── synor-dag/ # GHOSTDAG consensus +│ ├── synor-consensus/ # Transaction validation +│ ├── synor-network/ # P2P networking (libp2p) +│ ├── synor-storage/ # RocksDB persistence +│ ├── synor-vm/ # WASM smart contracts +│ └── synor-rpc/ # JSON-RPC server +└── contracts/ # Example smart contracts +``` + +## Security + +- Report vulnerabilities to security@synor.cc +- See [SECURITY.md](SECURITY.md) for our security policy + +## License + +MIT OR Apache-2.0 diff --git a/crates/synor-dag/src/dagknight.rs b/crates/synor-dag/src/dagknight.rs index c644a41..d2e6d98 100644 --- a/crates/synor-dag/src/dagknight.rs +++ b/crates/synor-dag/src/dagknight.rs @@ -275,7 +275,7 @@ impl DagKnightManager { let data = self.ghostdag.add_block(block_id, parents)?; // Periodically update adaptive k - if self.latency_tracker.sample_count().is_multiple_of(50) { + if self.latency_tracker.sample_count() % 50 == 0 { self.update_adaptive_k(); }