# wamcoin-core-dev/wam-coin architecture

> Architecture diagram of the GitHub repository wamcoin-core-dev/wam-coin, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/wamcoin-core-dev/wam-coin
- Repository: https://github.com/wamcoin-core-dev/wam-coin

## Overview

WAM Coin is a Bitcoin Core fork whose distinctive product is a CPU-mineable proof-of-work currency, surrounded by reference mining, pool, network-dashboard, and announcement tools. The main workflow is miners connecting to a Stratum pool or mining solo, producing RandomX work, and having the chain validate blocks under WAM’s consensus rules. The graph also preserves the pool’s share accounting and payouts, network monitoring, and announcements. Several consensus and pool internals are unsampled; those capabilities and relationships are included only where the README or source index supports them.

Main entry points: [`pool/server.js`](https://github.com/wamcoin-core-dev/wam-coin/blob/main/pool/server.js) (Pool orchestration), [`explorer/server.js`](https://github.com/wamcoin-core-dev/wam-coin/blob/main/explorer/server.js) (Dashboard server), [`miner/src/main.cpp`](https://github.com/wamcoin-core-dev/wam-coin/blob/main/miner/src/main.cpp) (CPU miner), [`pool/lib/shareProcessor.js`](https://github.com/wamcoin-core-dev/wam-coin/blob/main/pool/lib/shareProcessor.js) (Share accounting)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_consensus["Chain consensus"]
  node_chain_identity["Network identity<br/>[chainparams.cpp]"]
  node_monetary_rules["Monetary parameters<br/>[wam-params.h]"]
  node_subsidy["Subsidy schedule<br/>[subsidy.cpp]"]
  node_treasury_fee["Treasury rule<br/>[devfee.cpp]"]
  node_difficulty["Difficulty rules<br/>[pow.cpp]"]
  node_randomx_consensus["RandomX proof of work<br/>[randomx_hash.cpp]"]
  node_wam_rpc["WAM RPC methods<br/>[wam_rpc.cpp]"]
end

subgraph group_mining["Mining"]
  node_miner["CPU miner<br/>[main.cpp]"]
  node_randomx_engine["RandomX engine<br/>[randomx_engine.h]"]
  node_solo_mining["Solo mining<br/>[solo.h]"]
  node_stratum_mining["Stratum client<br/>[stratum.h]"]
end

subgraph group_pool["Pool operations"]
  node_pool_server["Pool orchestration<br/>[server.js]"]
  node_pool_stratum["Stratum server<br/>[stratumServer.js]"]
  node_job_manager["Job management<br/>[jobManager.js]"]
  node_block_template["Block templates<br/>[blockTemplate.js]"]
  node_native_randomx["RandomX addon<br/>[index.js]"]
  node_share_processor["Share accounting<br/>[shareProcessor.js]"]
  node_rewards["Payout calculation<br/>[rewards.js]"]
  node_pool_daemon["Node RPC client<br/>[daemon.js]"]
  node_pool_api["Pool API<br/>[api.js]"]
end

subgraph group_observability["Network visibility"]
  node_explorer_server["Dashboard server<br/>[server.js]"]
  node_collector["Chain collector<br/>[collector.js]"]
  node_explorer_rpc["Node RPC client<br/>[rpc.js]"]
  node_network_view["Peer network view<br/>[network.js]"]
  node_seed_monitor["Seed monitoring<br/>[seeds.js]"]
  node_concentration["Mining concentration<br/>[concentration.js]"]
  node_dashboard_ui["Dashboard UI<br/>[app.js]"]
end

subgraph group_communications["Communications"]
  node_announce_bot["Announcement bot<br/>[announce.js]"]
  node_bot_clients["Node and release clients<br/>[clients.js]"]
  node_bot_sinks["Channel sinks<br/>[sinks.js]"]
end

node_redis[("Redis")]
node_miner_actor(("Miner"))
node_dashboard_user(("Dashboard user"))
node_channel_audience(("Channel audience"))

node_miner_actor -->|"runs"| node_miner
node_miner -->|"uses Stratum"| node_stratum_mining
node_miner -->|"hashes with"| node_randomx_engine
node_miner -->|"mines solo"| node_solo_mining
node_pool_server -->|"starts"| node_pool_stratum
node_pool_server -->|"starts"| node_job_manager
node_pool_server -->|"starts"| node_share_processor
node_pool_server -->|"configures"| node_pool_daemon
node_pool_server -->|"starts"| node_pool_api
node_pool_server -->|"connects to"| node_redis
node_job_manager -->|"builds"| node_block_template
node_job_manager -->|"hashes shares"| node_native_randomx
node_share_processor -->|"calculates payouts"| node_rewards
node_share_processor -->|"checks wallet"| node_pool_daemon
node_share_processor -->|"reads and writes"| node_redis
node_miner -.->|"submits work"| node_pool_server
node_miner -.->|"selects network"| node_chain_identity
node_chain_identity -.->|"defines parameters"| node_monetary_rules
node_monetary_rules -.->|"sets emission"| node_subsidy
node_monetary_rules -.->|"sets fee rule"| node_treasury_fee
node_difficulty -.->|"sets proof rules"| node_randomx_consensus
node_explorer_server -->|"serves snapshot"| node_collector
node_explorer_server -->|"configures"| node_explorer_rpc
node_explorer_server -->|"builds network view"| node_network_view
node_explorer_server -->|"updates and reads"| node_seed_monitor
node_explorer_server -->|"uses"| node_concentration
node_collector -->|"queries node"| node_explorer_rpc
node_dashboard_user -->|"requests dashboard"| node_explorer_server
node_explorer_server -.->|"serves dashboard"| node_dashboard_ui
node_announce_bot -->|"reads chain data"| node_bot_clients
node_announce_bot -->|"publishes messages"| node_bot_sinks
node_channel_audience -.->|"receives updates"| node_bot_sinks

click node_miner "https://github.com/wamcoin-core-dev/wam-coin/blob/main/miner/src/main.cpp"
click node_randomx_engine "https://github.com/wamcoin-core-dev/wam-coin/blob/main/miner/src/randomx_engine.h"
click node_solo_mining "https://github.com/wamcoin-core-dev/wam-coin/blob/main/miner/src/solo.h"
click node_stratum_mining "https://github.com/wamcoin-core-dev/wam-coin/blob/main/miner/src/stratum.h"
click node_chain_identity "https://github.com/wamcoin-core-dev/wam-coin/blob/main/src/wam/chainparams.cpp"
click node_monetary_rules "https://github.com/wamcoin-core-dev/wam-coin/blob/main/src/wam/wam-params.h"
click node_subsidy "https://github.com/wamcoin-core-dev/wam-coin/blob/main/src/wam/consensus/subsidy.cpp"
click node_treasury_fee "https://github.com/wamcoin-core-dev/wam-coin/blob/main/src/wam/consensus/devfee.cpp"
click node_difficulty "https://github.com/wamcoin-core-dev/wam-coin/blob/main/src/wam/pow.cpp"
click node_randomx_consensus "https://github.com/wamcoin-core-dev/wam-coin/blob/main/src/wam/crypto/randomx_hash.cpp"
click node_wam_rpc "https://github.com/wamcoin-core-dev/wam-coin/blob/main/src/wam/rpc/wam_rpc.cpp"
click node_pool_server "https://github.com/wamcoin-core-dev/wam-coin/blob/main/pool/server.js"
click node_pool_stratum "https://github.com/wamcoin-core-dev/wam-coin/blob/main/pool/lib/stratumServer.js"
click node_job_manager "https://github.com/wamcoin-core-dev/wam-coin/blob/main/pool/lib/jobManager.js"
click node_block_template "https://github.com/wamcoin-core-dev/wam-coin/blob/main/pool/lib/blockTemplate.js"
click node_native_randomx "https://github.com/wamcoin-core-dev/wam-coin/blob/main/pool/native/index.js"
click node_share_processor "https://github.com/wamcoin-core-dev/wam-coin/blob/main/pool/lib/shareProcessor.js"
click node_rewards "https://github.com/wamcoin-core-dev/wam-coin/blob/main/pool/lib/rewards.js"
click node_pool_daemon "https://github.com/wamcoin-core-dev/wam-coin/blob/main/pool/lib/daemon.js"
click node_pool_api "https://github.com/wamcoin-core-dev/wam-coin/blob/main/pool/lib/api.js"
click node_explorer_server "https://github.com/wamcoin-core-dev/wam-coin/blob/main/explorer/server.js"
click node_collector "https://github.com/wamcoin-core-dev/wam-coin/blob/main/explorer/lib/collector.js"
click node_explorer_rpc "https://github.com/wamcoin-core-dev/wam-coin/blob/main/explorer/lib/rpc.js"
click node_network_view "https://github.com/wamcoin-core-dev/wam-coin/blob/main/explorer/lib/network.js"
click node_seed_monitor "https://github.com/wamcoin-core-dev/wam-coin/blob/main/explorer/lib/seeds.js"
click node_concentration "https://github.com/wamcoin-core-dev/wam-coin/blob/main/explorer/lib/concentration.js"
click node_dashboard_ui "https://github.com/wamcoin-core-dev/wam-coin/blob/main/explorer/web/app.js"
click node_announce_bot "https://github.com/wamcoin-core-dev/wam-coin/blob/main/bots/announce.js"
click node_bot_clients "https://github.com/wamcoin-core-dev/wam-coin/blob/main/bots/lib/clients.js"
click node_bot_sinks "https://github.com/wamcoin-core-dev/wam-coin/blob/main/bots/lib/sinks.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_chain_identity,node_monetary_rules,node_subsidy,node_treasury_fee,node_difficulty,node_randomx_consensus,node_wam_rpc,node_dashboard_user toneBlue
class node_miner,node_randomx_engine,node_solo_mining,node_stratum_mining,node_redis toneAmber
class node_pool_server,node_pool_stratum,node_job_manager,node_block_template,node_native_randomx,node_share_processor,node_rewards,node_pool_daemon,node_pool_api toneMint
class node_explorer_server,node_collector,node_explorer_rpc,node_network_view,node_seed_monitor,node_concentration,node_dashboard_ui toneRose
class node_announce_bot,node_bot_clients,node_bot_sinks,node_miner_actor,node_channel_audience toneIndigo
```

## Components

### Chain consensus

- [Network identity](https://github.com/wamcoin-core-dev/wam-coin/blob/main/src/wam/chainparams.cpp): `src/wam/chainparams.cpp`
- [Monetary parameters](https://github.com/wamcoin-core-dev/wam-coin/blob/main/src/wam/wam-params.h): `src/wam/wam-params.h`
- [Subsidy schedule](https://github.com/wamcoin-core-dev/wam-coin/blob/main/src/wam/consensus/subsidy.cpp): `src/wam/consensus/subsidy.cpp`
- [Treasury rule](https://github.com/wamcoin-core-dev/wam-coin/blob/main/src/wam/consensus/devfee.cpp): `src/wam/consensus/devfee.cpp`
- [Difficulty rules](https://github.com/wamcoin-core-dev/wam-coin/blob/main/src/wam/pow.cpp): `src/wam/pow.cpp`
- [RandomX proof of work](https://github.com/wamcoin-core-dev/wam-coin/blob/main/src/wam/crypto/randomx_hash.cpp): `src/wam/crypto/randomx_hash.cpp`
- [WAM RPC methods](https://github.com/wamcoin-core-dev/wam-coin/blob/main/src/wam/rpc/wam_rpc.cpp): `src/wam/rpc/wam_rpc.cpp`

### Mining

- [CPU miner](https://github.com/wamcoin-core-dev/wam-coin/blob/main/miner/src/main.cpp): `miner/src/main.cpp`
- [RandomX engine](https://github.com/wamcoin-core-dev/wam-coin/blob/main/miner/src/randomx_engine.h): `miner/src/randomx_engine.h`
- [Solo mining](https://github.com/wamcoin-core-dev/wam-coin/blob/main/miner/src/solo.h): `miner/src/solo.h`
- [Stratum client](https://github.com/wamcoin-core-dev/wam-coin/blob/main/miner/src/stratum.h): `miner/src/stratum.h`

### Pool operations

- [Pool orchestration](https://github.com/wamcoin-core-dev/wam-coin/blob/main/pool/server.js): `pool/server.js`
- [Stratum server](https://github.com/wamcoin-core-dev/wam-coin/blob/main/pool/lib/stratumServer.js): `pool/lib/stratumServer.js`
- [Job management](https://github.com/wamcoin-core-dev/wam-coin/blob/main/pool/lib/jobManager.js): `pool/lib/jobManager.js`
- [Block templates](https://github.com/wamcoin-core-dev/wam-coin/blob/main/pool/lib/blockTemplate.js): `pool/lib/blockTemplate.js`
- [RandomX addon](https://github.com/wamcoin-core-dev/wam-coin/blob/main/pool/native/index.js): `pool/native/index.js`
- [Share accounting](https://github.com/wamcoin-core-dev/wam-coin/blob/main/pool/lib/shareProcessor.js): `pool/lib/shareProcessor.js`
- [Payout calculation](https://github.com/wamcoin-core-dev/wam-coin/blob/main/pool/lib/rewards.js): `pool/lib/rewards.js`
- [Node RPC client](https://github.com/wamcoin-core-dev/wam-coin/blob/main/pool/lib/daemon.js): `pool/lib/daemon.js`
- [Pool API](https://github.com/wamcoin-core-dev/wam-coin/blob/main/pool/lib/api.js): `pool/lib/api.js`

### Network visibility

- [Dashboard server](https://github.com/wamcoin-core-dev/wam-coin/blob/main/explorer/server.js): `explorer/server.js`
- [Chain collector](https://github.com/wamcoin-core-dev/wam-coin/blob/main/explorer/lib/collector.js): `explorer/lib/collector.js`
- [Node RPC client](https://github.com/wamcoin-core-dev/wam-coin/blob/main/explorer/lib/rpc.js): `explorer/lib/rpc.js`
- [Peer network view](https://github.com/wamcoin-core-dev/wam-coin/blob/main/explorer/lib/network.js): `explorer/lib/network.js`
- [Seed monitoring](https://github.com/wamcoin-core-dev/wam-coin/blob/main/explorer/lib/seeds.js): `explorer/lib/seeds.js`
- [Mining concentration](https://github.com/wamcoin-core-dev/wam-coin/blob/main/explorer/lib/concentration.js): `explorer/lib/concentration.js`
- [Dashboard UI](https://github.com/wamcoin-core-dev/wam-coin/blob/main/explorer/web/app.js): `explorer/web/app.js`

### Communications

- [Announcement bot](https://github.com/wamcoin-core-dev/wam-coin/blob/main/bots/announce.js): `bots/announce.js`
- [Node and release clients](https://github.com/wamcoin-core-dev/wam-coin/blob/main/bots/lib/clients.js): `bots/lib/clients.js`
- [Channel sinks](https://github.com/wamcoin-core-dev/wam-coin/blob/main/bots/lib/sinks.js): `bots/lib/sinks.js`

### Other components

- **Redis**
- **Miner**
- **Dashboard user**
- **Channel audience**

## Connections

- Miner → CPU miner: runs (evidence: `miner/src/main.cpp`)
- CPU miner → Stratum client: uses Stratum (evidence: `miner/src/main.cpp`)
- CPU miner → RandomX engine: hashes with (evidence: `miner/src/main.cpp`)
- CPU miner → Solo mining: mines solo (evidence: `miner/src/main.cpp`)
- Pool orchestration → Stratum server: starts (evidence: `pool/server.js`)
- Pool orchestration → Job management: starts (evidence: `pool/server.js`)
- Pool orchestration → Share accounting: starts (evidence: `pool/server.js`)
- Pool orchestration → Node RPC client: configures (evidence: `pool/server.js`)
- Pool orchestration → Pool API: starts (evidence: `pool/server.js`)
- Pool orchestration → Redis: connects to (evidence: `pool/server.js`)
- Job management → Block templates: builds (evidence: `pool/lib/jobManager.js`)
- Job management → RandomX addon: hashes shares (evidence: `pool/lib/jobManager.js`)
- Share accounting → Payout calculation: calculates payouts (evidence: `pool/lib/shareProcessor.js`)
- Share accounting → Node RPC client: checks wallet (evidence: `pool/lib/shareProcessor.js`)
- Share accounting → Redis: reads and writes (evidence: `pool/lib/shareProcessor.js`)
- CPU miner → Pool orchestration: submits work
- CPU miner → Network identity: selects network
- Network identity → Monetary parameters: defines parameters
- Monetary parameters → Subsidy schedule: sets emission
- Monetary parameters → Treasury rule: sets fee rule
- Difficulty rules → RandomX proof of work: sets proof rules
- Dashboard server → Chain collector: serves snapshot (evidence: `explorer/server.js`)
- Dashboard server → Node RPC client: configures (evidence: `explorer/server.js`)
- Dashboard server → Peer network view: builds network view (evidence: `explorer/server.js`)
- Dashboard server → Seed monitoring: updates and reads (evidence: `explorer/server.js`)
- Dashboard server → Mining concentration: uses (evidence: `explorer/server.js`)
- Chain collector → Node RPC client: queries node (evidence: `explorer/lib/collector.js`)
- Dashboard user → Dashboard server: requests dashboard (evidence: `README.md`)
- Dashboard server → Dashboard UI: serves dashboard
- Announcement bot → Node and release clients: reads chain data (evidence: `bots/announce.js`)
- Announcement bot → Channel sinks: publishes messages (evidence: `bots/announce.js`)
- Channel audience → Channel sinks: receives updates
