lightningsale/lnd-rest

This package is abandoned and no longer maintained. The author suggests using the lightningsale/lnd-client package instead.

A LND REST Client

v0.4.1 2018-03-05 07:05 UTC

This package is not auto-updated.

Last update: 2022-02-01 13:11:29 UTC


README

TODO:

How to use:

composer require lightningsale/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']