Skip to content

php-lightning/demo-lnaddress

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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