bitcoind – Failed to attach with gRPC to distant LND: failed to connect with all addresses unavailable

0
66


I need to connect with my LND operating on a raspberry pi linux from my macOS with gRPC. On the raspberry pi can be a bitcoin full node operating bitcoind regtest. I used this tutorial: https://github.com/lightningnetwork/lnd/blob/grasp/docs/grpc/python.md
There’s a good probability I do one thing apparent flawed.

lnd.conf on linux:

[Application Options]
tlsextraip=87.228.187.58 (that is the general public ip of the raspberry pi)

[Bitcoin]
bitcoin.lively=true
bitcoin.regtest=true
bitcoin.node=bitcoind

[Bitcoind]
bitcoind.rpchost=localhost
bitcoind.rpcuser=aUser
bitcoind.rpcpass=aPass
bitcoind.zmqpubrawblock=tcp://127.0.0.1:28332
bitcoind.zmqpubrawtx=tcp://127.0.0.1:28333

I deleted the tls.cert and tls.key and restarted lnd.

bitcoin.conf on linux:

rpcauth=...

zmqpubrawblock=tcp://127.0.0.1:28332
zmqpubrawtx=tcp://127.0.0.1:28333

txindex=1
regtest=1
daemon=1

Works completely.

On macOS i adopted the steps within the tutorial.
Created the virtualenv, put in dependencies, cloned the repo, copied the proto file and compiled it.

I created shopper.py file with this content material:

import lightning_pb2 as ln
import lightning_pb2_grpc as lnrpc
import grpc
import os

os.environ["GRPC_SSL_CIPHER_SUITES"] = 'HIGH+ECDSA'

cert = open(os.path.expanduser('~/Library/Utility Help/Lnd/tls.cert'), 'rb').learn()
creds = grpc.ssl_channel_credentials(cert)
channel = grpc.secure_channel('87.228.187.58:10009', creds)
stub = lnrpc.LightningStub(channel)

response = stub.WalletBalance(ln.WalletBalanceRequest())
print(response.total_balance)

Once I execute the shopper.py, first it mentioned it cannot discover the file tls.cert as a result of this file is (in my understanding) purported to be on the linux system. Anyway I put in the LND additionally on macOS with the identical lnd.conf file and run it.

Once I execute the shopper.py now, I get this error:

Traceback (most up-to-date name final):
  File "~/Paperwork/tasks/lnd/shopper.py", line 18, in <module>
    response = stub.WalletBalance(ln.WalletBalanceRequest())
  File "~/Paperwork/tasks/lnd/lib/python3.10/site-packages/grpc/_channel.py", line 1030, in __call__
    return _end_unary_response_blocking(state, name, False, None)
  File "~/Paperwork/tasks/lnd/lib/python3.10/site-packages/grpc/_channel.py", line 910, in _end_unary_response_blocking
    increase _InactiveRpcError(state)  # pytype: disable=not-instantiable
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
        standing = StatusCode.UNAVAILABLE
        particulars = "failed to connect with all addresses; final error: UNAVAILABLE: ipv4:87.228.187.58:10009: Failed to connect with distant host: FD shutdown"
        debug_error_string = "UNKNOWN:failed to connect with all addresses; final error: UNAVAILABLE: ipv4:87.228.187.58:10009: Failed to connect with distant host: FD shutdown {grpc_status:14, created_time:"2023-04-22T17:06:33.920693+03:00"}"

Bitcoind and LND is operating on Linux. LND says:

RPC server listening on 127.0.0.1:10009

I acquired the tlsextraip from an internet site saying that is my public ip handle.

Am I doing one thing apparent flawed, or till now’s the principle half right?
How can I repair the issue?

Thanks prematurely

LEAVE A REPLY

Please enter your comment!
Please enter your name here