Skip to main content

An rpc client for LL Pool (Rent Channels)

Project description


A python grpc client for Lightning Pool (Lightning Network Daemon) ⚡⚡⚡

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


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


pip install pool-grpc-client

Basic Usage

The api mirrors the underlying lnd grpc api ( but methods will be in pep8 style. ie. .GetInfo() becomes .get_info().

from pathlib import Path
import json
from poolgrpc.client import PoolClient

credential_path = Path("/home/skorn/.pool/mainnet/")

mac = str(credential_path.joinpath("pool.macaroon").absolute())
tls = str(credential_path.joinpath("tls.cert").absolute())

pool = PoolClient(



Specifying Macaroon/Cert files

By default the client will attempt to lookup the readonly.macaron and tls.cert files in the mainnet directory. However if you want to specify a different macaroon or different path you can pass in the filepath explicitly.

lnd = LNDClient(

Compiling Proto Files

mkvirtualenv gen_rpc_protos
# or 
workon gen_rpc_protos
# then

pip install grpcio grpcio-tools googleapis-common-protos sh

cd poolgrpc
git clone --depth 1
cd ..
from pathlib import Path
import shutil
import sh
import sys
import re
import os

pool_dir = Path.home().joinpath("Documents/lightning/pool")
grpc_client_dir = Path.home().joinpath("Documents/lightning/pool-grpc-client")


if not all([pool_dir.exists(), grpc_client_dir.exists()]):
    print("Error: Double check that the paths exist!")

for proto in list(pool_dir.rglob("**/*.proto")):
    shutil.copy(proto, grpc_client_dir.joinpath("poolgrpc/compiled/"))
    print(f"Copied: {}")

# Modify auctioneer.proto from auctioneerrpc/auctioneer.proto --> poolgrpc/compiled/auctioneer.proto
for proto in list(grpc_client_dir.joinpath("poolgrpc/compiled/").rglob("*.proto")):
    with open(proto, 'r+') as f:
        text =
        text = re.sub('auctioneerrpc/auctioneer.proto', 'poolgrpc/compiled/auctioneer.proto', text)

protos = list(Path(".").joinpath("poolgrpc/compiled/").glob("*.proto"))

args = [

for protofile in protos:
    args.append(str(protofile) )

# Generate the compiled protofiles

Deploy to Test-PyPi

poetry build
twine check dist/*
twine upload --repository-url dist/*

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pool-grpc-client, version 0.0.23
Filename, size File type Python version Upload date Hashes
Filename, size pool_grpc_client-0.0.23-py3-none-any.whl (71.6 kB) File type Wheel Python version py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page