Skip to content

Latest commit

 

History

History
54 lines (37 loc) · 1.34 KB

README.md

File metadata and controls

54 lines (37 loc) · 1.34 KB

Demo lightning-address

Use the lnaddress to be able to get a callback url and request an invoice from your server.

This demo shows that the entire library works by using the library code + with custom configuration in your own lightning-config.php.

Setup

From scratch

composer init
composer require php-lightning/lnaddress

Using this template

https://github.com/php-lightning/demo-lnaddress/generate
composer install

Configuration

The configuration is set up in nostr.json at the root of the project.

cp nostr.dist.json nostr.json

What can you do?

  1. Set up the API-KEY:

For example, create your own wallet https://demo.lnbits.com/ and set up your own api_key.

set up the api_ky

  1. Start your server:
php -S localhost:8080 vendor/php-lightning/lnaddress/public/index.php
  1. Get a callback url and lightning server configuration. Request without any GET params:
http://localhost:8080/

Get a callback url command example

  1. Request an invoice from your server (in milli-sats). Request using amount as GET param:
http://localhost:8080/alice?amount=100000  

Request an invoice from your server example