raspiblitz/home.admin/config.scripts/lndlibs
2020-06-23 15:04:14 +02:00
..
__init__.py Doccumentation on LND RPC libs 2019-04-12 11:48:51 +01:00
README.md adapt scripts to walletunlocker protobuffs 2020-06-23 15:04:14 +02:00
rpc.proto adapt scripts to walletunlocker protobuffs 2020-06-23 15:04:14 +02:00
rpc_pb2.py #1240 protobuff generated libs for lnd 0.10.1 2020-06-08 22:24:56 +02:00
rpc_pb2_grpc.py adapt scripts to walletunlocker protobuffs 2020-06-23 15:04:14 +02:00
walletunlocker.proto adapt scripts to walletunlocker protobuffs 2020-06-23 15:04:14 +02:00
walletunlocker_pb2.py adapt scripts to walletunlocker protobuffs 2020-06-23 15:04:14 +02:00
walletunlocker_pb2_grpc.py adapt scripts to walletunlocker protobuffs 2020-06-23 15:04:14 +02:00

For every new LND version the LND RPC libs need to be compiled from the matching protobuff files. Do this on a raspberrypi with the exact same python version the scripts will be are running on. See https://dev.lightning.community/guides/python-grpc/

To generate the lnd RPC libs - login as admin and run:

cd
python3 -m pip install grpcio grpcio-tools googleapis-common-protos pathlib2
git clone https://github.com/googleapis/googleapis.git
mkdir protobuffs
curl -o ./rpc.proto -s https://raw.githubusercontent.com/lightningnetwork/lnd/master/lnrpc/rpc.proto
curl -o ./walletunlocker.proto -s https://raw.githubusercontent.com/lightningnetwork/lnd/master/lnrpc/walletunlocker.proto
python3 -m grpc_tools.protoc --proto_path=googleapis:. --python_out=./protobuffs --grpc_python_out=./protobuffs ./rpc.proto ./walletunlocker.proto
cp ./*.proto ./protobuffs

NOTE: If LND master branch is already a version ahead .. use the rpc.proto from the version tagged branch.

Now copy the generated RPC libs per SCP over to your Laptop and add them to the /home/admin/config.scripts/lndlibs.

scp -r admin@192.168.X.X:/home/admin/protobuffs ./protobuffs

Make sure the first 3 lines of the rpc_pb2_grpc.py & walletunlocker_pb2_grpc.py look like the following for python3 compatibility:

from __future__ import absolute_import
import grpc

from . import rpc_pb2 as rpc__pb2