alexbosworth / balanceofsatoshis

Tool for working with the balance of your satoshis on LND
MIT License
556 stars 78 forks source link

Can't get BoS container to connect to Umbrel LND container #105

Closed DownRangeDevOps closed 3 years ago

DownRangeDevOps commented 3 years ago

Has anyone been able to get BoS to work in a docker container with Umbrel? I can’t seem to get it to connect to the LND container.

I tried using their saved node instructions.

~/.bos/umbrel/credentials.json

{
  "cert_path": "/home/node/.lnd/tls.cert",
  "macaroon_path": "/home/node/.lnd/data/chain/bitcoin/mainnet/admin.macaroon",
  "socket": "umbrel.local:10009"
}

Start cmd:

sudo docker run -it --rm --network="umbrel_main_network" --add-host=umbrel.local:10.21.21.9 -v ${PWD}/umbrel/lnd:/home/node/.lnd:ro -v ${PWD}/.bos:/home/node/.bos:ro alexbosworth/balanceofsatoshis report --node umbrel

Error:

- 503
- UnexpectedErrorWhenGettingChainBalance
-
  err:
    message: 14 UNAVAILABLE: No connection established
    stack:
      - Error: 14 UNAVAILABLE: No connection established
      -     at Object.callErrorFromStatus (/app/node_modules/ln-service/node_modules/@grpc/grpc-js/build/src/call.js:31:26)
      -     at Object.onReceiveStatus (/app/node_modules/ln-service/node_modules/@grpc/grpc-js/build/src/client.js:179:52)
      -     at Object.onReceiveStatus (/app/node_modules/ln-service/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:336:141
)
      -     at Object.onReceiveStatus (/app/node_modules/ln-service/node_modules/@grpc/grpc-js/build/src/client-interceptors.js:299:181
)
      -     at /app/node_modules/ln-service/node_modules/@grpc/grpc-js/build/src/call-stream.js:145:78
      -     at processTicksAndRejections (node:internal/process/task_queues:78:11)

If I start the BoS container with --entrypoint bash I can ping umbrel.local just fine. Any ideas?

alexbosworth commented 3 years ago

Have you tried replacing umbrel.local with the IP of the node? Find this in umbrel dir .env file LND_IP

DownRangeDevOps commented 3 years ago

Like this? Doesn't seem to change anything and it looks like the BoS node app is trying to connect specifically to umbrel.local.

ubuntu@52:~$ sudo docker run -it --rm --network="umbrel_main_network" --add-host=10.21.21.9:10.21.21.9 -v ${PWD}/umbrel/lnd:/home/node/.lnd:ro -v ${PWD}/.bos:/home/node/.bos:ro alexbosworth/balanceofsatoshis report --node umbrel

- 503
- UnexpectedErrorWhenGettingChainBalance
-
  err:
    message: 14 UNAVAILABLE: Name resolution failed for target dns:umbrel.local:10009
alexbosworth commented 3 years ago

I mean in the credentials.json

In the docker setup I think you'd have to tell the docker container what the umbrel.local dns means

DownRangeDevOps commented 3 years ago

@alexbosworth that worked! Thank you so much for the help and the awesome utility!

DownRangeDevOps commented 3 years ago

FYI @alexbosworth node gives this deprecation error so I'm assuming the root issue will need to be resolved at some point. Let me know if I can help.

(node:1) [DEP0123] DeprecationWarning: Setting the TLS ServerName to an IP address is not permitted by RFC 6066. This will be ignored in a future version.
(Use `node --trace-deprecation ...` to show where the warning was created)
alexbosworth commented 3 years ago

Yeah technically you shouldn't do it this IP way because TLS isn't allowed to go against IPs

Instead you are supposed to add a hostname to the TLS cert (maybe it's already in the umbrel one) and then setup hostname mapping on your docker container so that it uses that matching name