prusnak/suez

connecting to remote node?

Closed this issue · 6 comments

My node is not local, but I think suez assumes it does.

I've tried passing arguments to the client and changing the config but no luck.

Any tips?

Can you post the exact error you see?

 % poetry run ./suez
[lncli] rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing dial tcp 127.0.0.1:10009: connect: connection refused"
Traceback (most recent call last):
  File "/Users/user/gits/suez/./suez", line 5, in <module>
    suez()
  File "/Users/user/Library/Caches/pypoetry/virtualenvs/suez-WAvlm9Lk-py3.9/lib/python3.9/site-packages/click/core.py", line 1137, in __call__
    return self.main(*args, **kwargs)
  File "/Users/user/Library/Caches/pypoetry/virtualenvs/suez-WAvlm9Lk-py3.9/lib/python3.9/site-packages/click/core.py", line 1062, in main
    rv = self.invoke(ctx)
  File "/Users/user/Library/Caches/pypoetry/virtualenvs/suez-WAvlm9Lk-py3.9/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/user/Library/Caches/pypoetry/virtualenvs/suez-WAvlm9Lk-py3.9/lib/python3.9/site-packages/click/core.py", line 763, in invoke
    return __callback(*args, **kwargs)
  File "/Users/user/gits/suez/suez.py", line 54, in suez
    ln = clients[client](client_args)
  File "/Users/user/gits/suez/lndclient.py", line 10, in __init__
    self.refresh()
  File "/Users/user/gits/suez/lndclient.py", line 13, in refresh
    gi = self._run("getinfo")
  File "/Users/user/gits/suez/lndclient.py", line 114, in _run
    return json.loads(j.stdout)
  File "/Users/user/.pyenv/versions/3.9.1/lib/python3.9/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/Users/user/.pyenv/versions/3.9.1/lib/python3.9/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/Users/user/.pyenv/versions/3.9.1/lib/python3.9/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

so you can see that lncli is trying to get the local instance of lnd

Use --client-args to pass arguments to lncli. Read lncli documentation to learn which arguments you need to pass.

Yup that's what I tried first, but it gave me so many problems I figured it could read the info from the lnd config file.

I access my remote node from lncli with no problems. I figured I could pass the same arguments to suez but no luck.

How would I input multiple rpc arguments?

poetry run ./suez --client-args='--rpcserver=mydomain:10009 --macaroonpath=~/.lnd/mynode/admin.macaroon --tlscertpath=~/.lnd/mynode/tls.cert'
[lncli] rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing address tcp/10009 --macaroonpath=~/.lnd/mynode/admin.macaroon --tlscertpath=~/.lnd/mynode/tls.cert: unknown port"
Traceback (most recent call last):
  File "/Users/user/gits/suez/./suez", line 5, in <module>
    suez()
  File "/Users/user/Library/Caches/pypoetry/virtualenvs/suez-WAvlm9Lk-py3.9/lib/python3.9/site-packages/click/core.py", line 1137, in __call__
    return self.main(*args, **kwargs)
  File "/Users/user/Library/Cahes/pypoetry/virtualenvs/suez-WAvlm9Lk-py3.9/lib/python3.9/site-packages/click/core.py", line 1062, in main
    rv = self.invoke(ctx)
  File "/Users/user/Library/Caches/pypoetry/virtualenvs/suez-WAvlm9Lk-py3.9/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/user/Library/Caches/pypoetry/virtualenvs/suez-WAvlm9Lk-py3.9/lib/python3.9/site-packages/click/core.py", line 763, in invoke
    return __callback(*args, **kwargs)
  File "/Users/user/gits/suez/suez.py", line 54, in suez
    ln = clients[client](client_args)
  File "/Users/user/gits/suez/lndclient.py", line 10, in __init__
    self.refresh()
  File "/Users/user/gits/suez/lndclient.py", line 13, in refresh
    gi = self._run("getinfo")
  File "/Users/user/gits/suez/lndclient.py", line 114, in _run
    return json.loads(j.stdout)
  File "/Users/user/.pyenv/versions/3.9.1/lib/python3.9/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/Users/user/.pyenv/versions/3.9.1/lib/python3.9/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/Users/user/.pyenv/versions/3.9.1/lib/python3.9/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)c

Try the following:

poetry run ./suez --client-args=--rpcserver=mydomain:10009 --client-args=--macaroonpath=~/.lnd/mynode/admin.macaroon --client-args=--tlscertpath=~/.lnd/mynode/tls.cert

Thanks!