PHP code example of lightningsale / lnd-rest

1. Go to this page and download the library: Download lightningsale/lnd-rest library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

lightningsale / lnd-rest example snippets




use LightningSale\LndClient\ClientFactory;
use Psr\Log\NullLogger;

 = '127.0.0.1';
$rpcPort     = '8080';
$tlsCert     = '/root/.lnd/tls.cert';
$macaroon    = '/root/.lnd/admin.macaroon';


$client = ClientFactory::createRestClient($rpcHost, $rpcPort, $tlsCert, $macaroon, new NullLogger());
var_dump($client->getInfo());