Now, the real "utility work" begins. Right-click Bob and select "Stop Node." Repeat the payment from Alice to Carol. The emulator utility will immediately return an error: Unable to find a path to destination . This allows you to test error handling logic without on-chain fees.
The utility works by tricking the software into believing the required physical hardware key is plugged into the machine. lnd emulator utility work
Using utilities to "fund" wallets and balance channels. Now, the real "utility work" begins
Even in an emulated environment, use a dashboard utility like Ride The Lightning (RTL) . Seeing the visual representation of your simulated channels helps catch logic errors that are invisible in logs. Conclusion This allows you to test error handling logic
The emulator is built to satisfy three primary use cases:
def LookupInvoice(self, request, context): # Emulate expiry: If the invoice was "created" more than 2 seconds ago, fail. # (In a real emulator, you'd store timestamps) if request.r_hash in self.invoices: return lnd_pb2.Invoice(settled=False, state=lnd_pb2.Invoice.UNPAID) else: context.set_code(grpc.StatusCode.NOT_FOUND) return lnd_pb2.Invoice()
Several utilities have emerged to handle LND emulation work. Here are the most impactful: