How zenmuhamadx/nexchain-new works
Nexchain is a proof-of-work blockchain node with optional P2P synchronization, external mining, a browser wallet, and a blockchain explorer. The principal flow is a user or miner requesting node data or submitting a transaction/work solution through RPC; the node validates and records chain activity, then serves it to clients. README statements and the supplied excerpts support the high-level flow; unsampled internals are shown as capabilities without speculative call chains.
Main entry points: src/App.tsx Wallet Application · app.ts RPC Service · syncManager.ts Chain Synchronization · src/App.tsx Explorer Application
Components 26
Chain Runtime
- Node Server
apps/node/server.ts - RPC Service
src/rpc/app/app.ts - Transaction Processing
src/core/transaction/processTransaction.ts - Transaction Validation
src/core/validation/txValidator.v.ts - Chain Management
src/core/blockchain/blockchain.ts - Consensus Verification
src/core/consensus/verify/verifyIntegrity.ts - Fork Choice
src/core/consensus/reorg/forkChoice.ts - Persistent State
src/core/state/db/init.ts - Genesis Configuration
src/core/block/genesis.ts - RPC Client
src/client/rpc-client/lib/rpcClient.ts
P2P Network
- Peer Manager
src/p2p/peers/peerManager.ts - TCP Transport
src/p2p/transport/server.ts - P2P Messages
src/p2p/protocol/messages.ts - Chain Synchronization
src/p2p/sync/syncManager.ts
Mining
- Mining Work
src/core/consensus/work.ts - Miner Interface
miner-ui/src/hooks/useMiner.ts
Wallet
- Wallet Application
wallet/src/App.tsx - Wallet Vault
src/client/wallet/walletVault.ts - Send Flow
wallet/src/lib/sendFlow.ts - Wallet Cryptography
wallet/src/workers/crypto.worker.ts
Explorer
- Explorer Application
explorer/src/App.tsx - Explorer Pages
explorer/src/pages/DashboardPage.tsx - Explorer RPC Client
explorer/src/api/rpcClient.ts - Chain State Polling
explorer/src/hooks/useChainState.ts
Other components
- User
- External Miner
Connections 24
- User → Wallet Application: manages assets
README.md - User → Explorer Application: views chain
README.md - External Miner → RPC Service: submits work
README.md - Node Server → RPC Service: serves RPC
README.md - RPC Service → Mining Work: provides work
README.md - RPC Service → Transaction Processing: accepts transactions
- Transaction Processing → Transaction Validation: validates
- Chain Management → Consensus Verification: checks integrity
README.md - Chain Management → Fork Choice: selects branch
- Genesis Configuration → Node Server: initializes chain
README.md - Wallet Application → Wallet Vault: loads vault
wallet/src/App.tsx - Wallet Application → Send Flow: routes sending
- Wallet Application → Wallet Cryptography: uses worker
- Wallet Application → RPC Client: requests account data
- Explorer Application → Explorer Pages: routes pages
explorer/src/App.tsx - Explorer Application → Chain State Polling: shares chain state
explorer/src/App.tsx - Chain State Polling → Explorer RPC Client: fetches chain data
explorer/src/hooks/useChainState.ts - Explorer Pages → Explorer RPC Client: requests records
explorer/src/pages/DashboardPage.tsx - Explorer RPC Client → RPC Service: calls node
- Peer Manager → TCP Transport: opens connections
src/p2p/peers/peerManager.ts - Peer Manager → P2P Messages: handles handshake
src/p2p/peers/peerManager.ts - Chain Synchronization → P2P Messages: exchanges messages
src/p2p/sync/syncManager.ts - Chain Synchronization → Persistent State: loads mempool
src/p2p/sync/syncManager.ts - Chain Synchronization → Peer Manager: broadcasts inventory