lightningsale / lnd-client
一个LND REST客户端
v0.4.1
2018-03-05 07:05 UTC
Requires
- php: ^7.1
- guzzlehttp/guzzle: ^6.3
- psr/log: ^1.0
This package is not auto-updated.
Last update: 2024-09-15 03:34:28 UTC
README
待办事项
- 创建一个gRPC客户端
- 使用代理对象(http://ocramius.github.io/ProxyManager/)的异步REST客户端
- 使用代理对象异步gRPC客户端?(或者默认情况下?)
如何使用
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());
示例Symfony配置
# 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']