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 lightning-config.php
at the root of the project.
cp lightning-config.dist.php lightning-config.php
What can you do?
Start your server:
php -S localhost:8080 vendor/php-lightning/lnaddress/public/index.php
- Get a callback url and lightning server configuration. Request without any GET params:
http://localhost:8080/
- Request an invoice from your server (in milli-sats). Request using amount as GET param:
http://localhost:8080/user_1?amount=100000