Professional LNURL load balancing for your enterprise:
bech32 and QR code generation endpoints
Failure with a standard LNURL service configuration is highly-probable:

Single LNURL + Lightning Node deployments make Liquidity Bias impossible. Liquidity bias deprioritizes nodes for invoice requests that have low inbound capacity, which make payment success unlikely.

Load balancing multiple LNURL instances with a single fixed Lightning Node will exhaust resources:

By contrast, every instance of Switchgear in a region can share the Lightning Node fleet, making scale feasible:

The internal backoff can be entered under two conditions:

Optional Liquidity Bias will prioritize nodes with inbound capacity at the moment of selection. If no nodes are in range of the capacity bias, selection will fall back to standard weight selection.
lnurl-service:
selection-capacity-bias: -0.2Invoice request amount must be less than 20% of total inbound capacity of the node to be favored over other nodes that are not.
lnurl-service:
selection-capacity-bias: 0.1Invoice request amount may be over inbound capacity by up to 10% of the node and still be favored over other nodes that are not.
Capacity is measured in the same cycle as the Lightning Node health check. It is the sum of inbound capacity for all active channels on the node.
An organization may have a global Offer database. A Switchgear instance may be configured to serve a portion of that database, using partitions. Furthermore, every Lightning Node is configured in Discovery to be bound to one or more partitions, insuring payments only land on nodes they belong to.
Each Switchgear instance is configured for the partitions it will serve.
Example:
lnurl-service:
partitions: [ "us", "it", "cr" ]Only Offers created in "us", "it" or "cr" partitions will be available on the Switchgear instance, even if the Offer exists the database:
https://example.com/offers/us/{id} - 200 success
https://example.com/offers/it/{id} - 200 success
https://example.com/offers/cr/{id} - 200 success
https://example.com/offers/ca/{id} - 404 not foundEach partition must have Discovery Backends configured for the invoice request to succeed. A single backend can serve multiple partitions.
See the Manage Lightning Node Backends with Discovery Service and Manage LNURLs with Offer Service sections for creating Discovery Backends and Offers with partitions.
Switchgear itself can be balanced. Balancing multiple switchgear instances within a region:

For multi-region Global Load Balancer deployment, use the full health check to signal to the downstream balancer that a Switchgear instance has no healthy Lightning Nodes:
https://{host}/health/fullThe full health check will return 500 if no Lightning Nodes are available.
The regional balancer will forward the failing health status to the global balancer, which will send invoice requests to an alternate region:

Switchgear partitions have predictable URLs. Use partitions and a global Application Load Balancer to map invoice requests to alternate regions that have Switchgear instances configured for the requested partition.
The OpenAPI LNURL Service specification: doc/lnurl-service-openapi.yaml.
The LNURL Service is public facing, and implements the LNURL LUD-06 specification.
See the Manage LNURLs with Offer Service section for complete service manual.
All Switchgear LNURLs are formatted as:
https://{host}/offers/{partition}/{id}Where:
partition - the Offer partitionid - the Offer id (Uuid)The returned callback is always the LNURL, with the postfix /invoice :
https://{host}/offers/{partition}/{id}/invoiceThe bech32 and QR variants are available with:
https://{host}/offers/{partition}/{id}/bech32And:
https://{host}/offers/{partition}/{id}/bech32/qrThe QR image is in PNG format.
Consistent uses the optional LNURL comment query parameter as a hash key, which guarantees the same node will always receive invoice requests for that key. The balancer will move on to the next closest key match if the node becomes unavailable. This is a specific use-case that provides optimized HTLC settlement between cooperating peers for high-frequency transactions.
The OpenAPI Discovery Service specification: doc/discovery-service-openapi.yaml.
The Discovery Service is an administrative service used to manage connections to individual Lightning Nodes.
The service is isolated from the LNURL Service and can be configured to run on any port. The service supports TLS. Access is protected by a bearer token. Do not run this service without TLS enabled if it is exposed to the public internet.
See the Manage Lightning Node Backends with Discovery Service section for complete service manual.
The OpenAPI Offer Service specification: doc/offer-service-openapi.yaml.
The Offer Service is an administrative service used to manage Offers, which are used to generate LNURLs.
The service is isolated from the LNURL Service and can be configured to run on any port. The service supports TLS. Access is protected by a bearer token. Do not run this service without TLS enabled if it is exposed to the public internet.
See the Manage LNURLs with Offer Service section for complete service manual.