How the Lightning Provider architecture works
masterThunderHub uses a delegated provider pattern to support multiple Lightning implementations (like LND, Eclair, etc.).
- GraphQL Resolvers receive requests.
- NodeService receives the request and dispatches it based on the
account.type. - ProviderRegistryService maps the
NodeTypeto a specific implementation of theLightningProviderinterface. - The LightningProvider (e.g.,
LndService) executes the actual logic.
Resolvers never interact with providers directly; they always go through the NodeService and ProviderRegistryService abstraction layer.
GraphQL Resolvers
│
▼
NodeService ← dispatches by account.type
│
▼
ProviderRegistryService ← maps NodeType → LightningProvider
│
├── LndService (type: 'lnd')
├── YourService (type: 'your-type')
└── ...