Skip to main content

faraday-grpc-client

A python grpc client for LL Faraday (Node Stats)

This is a wrapper around the default grpc interface that handles setting up credentials (including macaroons.

Dependencies

  • Python 3.6+
  • Working LND lightning node, take note of its ip address.
  • Copy your pool.macaroon and tls.cert files from ~/.faraday/mainnet to a directoy on your machine.

Installation

pip install faraday-grpc-client

Generating LND Proto Files

virtualenv lnd
source lnd/bin/activate
pip install grpcio grpcio-tools googleapis-common-protos sh
git clone https://github.com/lightningnetwork/lnd.git
mkdir genprotos
git clone https://github.com/googleapis/googleapis.git

python3 -m grpc_tools.protoc --python_out=. --grpc_python_out=. frdgrpc/compiled/*.proto
from pathlib import Path
import shutil
import sh

for proto in list(Path("../lnd/lnrpc").rglob("*.proto")):
    shutil.copy(proto, Path.cwd())

protos = list(Path(".").glob("*.proto"))

for protofile in protos:
    try:
        sh.python("-m", "grpc_tools.protoc", "--proto_path=.", "--python_out=.", "--grpc_python_out=.", str(protofile))
        protos.remove(protofile)
    except Exception as e:
        print(f"Error in proto: {protofile}")

Last Step: In File: verrpc_pb2_grpc.py Change: import verrpc_pb2 as verrpc__pb2 To: from lndgrpc import verrpc_pb2 as verrpc__pb2

Deploy to Test-PyPi

poetry build
twine check dist/*
twine upload --repository-url https://test.pypi.org/legacy/ dist/*

Metadata

Release files for faraday-grpc-client 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for faraday-grpc-client 0.0.2
File Interpreter ABI Platform
faraday_grpc_client-0.0.2-py3-none-any.whl Python 3 none any Details

Release files / faraday_grpc_client-0.0.2-py3-none-any.whl

Download URL faraday_grpc_client-0.0.2-py3-none-any.whl
Size 18.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7889150775d86b1c7f2968aa7da9d84ec728d79aa0524775ac6abc8d7f192772
BLAKE2b-256 checksum
How to use checksums
3601121a75b2cb6914d6541e4c3696a6f642010178a545a793ed4ae912d19cec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.3.0 pkginfo/1.7.0 requests/2.25.0 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.8.10

Release history Release notifications | RSS feed

This release

0.0.2 This release

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page