Complete implementation of the Synor Storage Layer (L2) for decentralized content storage. This enables permanent, censorship-resistant storage of any file type including Next.js apps, Flutter apps, and arbitrary data. Core modules: - cid.rs: Content addressing with Blake3/SHA256 hashing (synor1... format) - chunker.rs: File chunking for parallel upload/download (1MB chunks) - erasure.rs: Reed-Solomon erasure coding (10+4 shards) for fault tolerance - proof.rs: Storage proofs with Merkle trees for verification - deal.rs: Storage deals and market economics (3 pricing tiers) Infrastructure: - node/: Storage node service with P2P networking and local storage - gateway/: HTTP gateway for browser access with LRU caching - Docker deployment with nginx load balancer Architecture: - Operates as L2 alongside Synor L1 blockchain - Storage proofs verified on-chain for reward distribution - Can lose 4 shards per chunk and still recover data - Gateway URLs: /synor1<cid> for content access All 28 unit tests passing.
88 lines
1.6 KiB
TOML
88 lines
1.6 KiB
TOML
# Synor Storage Node Configuration
|
|
|
|
[node]
|
|
# Node identity (leave empty to auto-generate)
|
|
node_id = ""
|
|
|
|
# Storage capacity in bytes (default: 100 GB)
|
|
capacity = 107374182400
|
|
|
|
# Pricing (atomic SYNOR units per byte per epoch)
|
|
min_price = 1
|
|
max_price = 10
|
|
|
|
# Data directory
|
|
data_dir = "/data/storage"
|
|
|
|
# Regions served (for geographic routing)
|
|
regions = ["global"]
|
|
|
|
# Stake amount on L1 (for slashing)
|
|
stake = 0
|
|
|
|
[network]
|
|
# P2P listen addresses
|
|
listen_addrs = [
|
|
"/ip4/0.0.0.0/tcp/4001",
|
|
"/ip4/0.0.0.0/udp/4001/quic-v1"
|
|
]
|
|
|
|
# Bootstrap nodes for peer discovery
|
|
bootstrap_nodes = [
|
|
# Add mainnet bootstrap nodes here
|
|
# "/ip4/1.2.3.4/tcp/4001/p2p/12D3KooW..."
|
|
]
|
|
|
|
# Maximum connections
|
|
max_connections = 100
|
|
|
|
[l1]
|
|
# L1 RPC endpoint for proof submission
|
|
rpc = "http://synor-node:8545"
|
|
|
|
# Proof submission settings
|
|
proof_gas_limit = 500000
|
|
max_gas_price = 100000000000 # 100 gwei
|
|
|
|
[gateway]
|
|
# Enable HTTP gateway
|
|
enabled = true
|
|
|
|
# Gateway listen address
|
|
listen_addr = "0.0.0.0:8080"
|
|
|
|
# Maximum content size to serve (100 MB)
|
|
max_content_size = 104857600
|
|
|
|
# Cache size (1 GB)
|
|
cache_size = 1073741824
|
|
|
|
# Request timeout (seconds)
|
|
timeout_secs = 60
|
|
|
|
# Enable upload endpoint (false for public gateways)
|
|
enable_upload = false
|
|
|
|
# CORS origins
|
|
cors_origins = ["*"]
|
|
|
|
# Rate limit (requests per minute per IP)
|
|
rate_limit = 100
|
|
|
|
[storage]
|
|
# Chunk size (1 MB)
|
|
chunk_size = 1048576
|
|
|
|
# Erasure coding
|
|
data_shards = 10
|
|
parity_shards = 4
|
|
|
|
# Replication factor
|
|
replication_factor = 3
|
|
|
|
[logging]
|
|
# Log level: trace, debug, info, warn, error
|
|
level = "info"
|
|
|
|
# Log format: json, pretty
|
|
format = "json"
|