$ show mezonai/mmn
This is a Go-based blockchain node for the Mezon MainNet (MMN), implementing Proof-of-History (PoH) for transaction ordering, libp2p for peer-to-peer networking, gRPC and JSON-RPC for external APIs, and a leader-based consensus protocol with vote collection. The node supports three transaction types: Ed25519 key-based transfers, Groth16 ZK-proof transfers, and user content (social interactions). It uses either LevelDB or RocksDB as the persistent storage backend, with the latter bundled as vendored C headers. The codebase includes a CLI (init, bootnode, node, transfer), a client library, a stress-test tool with HTML reports, and a migration tool for importing user balances from CSV. The architecture is modular with clear interfaces for storage, mempool, events, and networking, making it a well-structured example of a modern blockchain validator node.
The LLM identified 5 files worth highlighting for reuse:
Standalone base58 encode/decode implementation with no external dependencies. It uses a standard Bitcoin-style alphabet and provides Encode and Decode functions. Can be extracted into any Go project needing base58 encoding.
Colored, level-aware logging package with support for DEBUG, INFO, WARN, ERROR levels and category tags. Uses standard Go log package internally and adds structured prefixes. Self-contained and easily reusable in any Go application.
Generic event bus implementation with UUID-based subscribers, concurrent publishing, heartbeat management, and subscription cleanup. Provides typed event channels and handles multiple subscribers per event type. Isolated from the rest of the codebase and can be reused as a pub/sub pattern in other Go projects.
Token bucket rate limiter with per-key or global limits. Thread-safe using atomic operations and time-based token refill. Includes a configurable capacity and refill rate. Can be extracted as a standalone rate-limiting library for Go services.
Defines a clean DatabaseProvider interface with Get, Put, Delete, Close, NewBatch, WriteBatch methods. Implementations exist for LevelDB, Redis, and RocksDB. The interface is minimal and generic, enabling swapping storage backends without changing higher layers. Could be extracted as a storage abstraction pattern for any Go application.