Skip to content

inpay/lnd-client

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

85 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A LND Client for PHP

TODO:

How to use:

composer require inpay/lnd-client

<?php

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

require './vendor/autoload.php';


$rpcUsername = 'rpcusername';
$rpcPassword = 'rpcpassword';
$rpcHost     = '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());

Example Symfony configuration:

# services.yml
LightningSale\LndClient\Client: '@LightningSale\LndClient\RestClient'
LightningSale\LndClient\RestClient:
    class: LightningSale\LndClient\RestClient
    factory: ['LightningSale\LndClient\ClientFactory','createRestClient']
    arguments: ['127.0.0.1', '8080', '/root/.lnd/tls.cert', '/root/.lnd/admin.macaroon', '@logger']

About

A LND Client for PHP

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%