alexbosworth / balanceofsatoshis

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

unable to connect a docker container running bos to a docker container running btcpayserver #138

Open anycolo opened 2 years ago

anycolo commented 2 years ago

I've tried following the instructions, but i think they are incomplete, out of date or self-contradicting, because nothing worked. Can anyone revise the instructions and make sure they are clear and that they work? It shouldn't be too hard.

alexbosworth commented 2 years ago

I think things work differently with btcpayserver, not sure how that works but there may be something special that needs to be done for that

nemanja-z commented 2 years ago

I hope this will help you. Take a look at your BTCPay Server version before you try to connect it. BOS won't work with the latest BTCPayServer version, because it is running on the LND version which BOS doesn't support at the moment.

Create directory ~/.bos/, and add node credentials in a format of:

~/.bos/YOUR_NODE_NAME/credentials.json Use any shorthand you'd like when choosing this profile node name

credentials.json should have the following format:

{ "cert": "base64 tls.cert value", "macaroon": "base64 .macaroon value", "socket": "lnd_bitcoin:10009" }

Use "lnd_bitcoin:10009" for socket

To get the strings for cert and macaroon in appropriate format you can run these commands in a terminal and copy-paste values into credentials.json, ex:

For cert base64 /var/lib/docker/volumes/generated_lnd_bitcoin_datadir/_data/tls.cert | tr -d '\n' For macaroon base64 /var/lib/docker/volumes/generated_lnd_bitcoin_datadir/_data/admin.macaroon | tr -d '\n'

You can then use BOS this way:

docker run -it --rm --network="generated_default" -v $HOME/.bos:/home/node/.bos alexbosworth/balanceofsatoshis COMMAND --node SAVEDNODENAME

jaonoctus commented 2 years ago

Worked for me.

You could also create a file under /usr/local/bin/bos with this content:

#!/bin/bash

docker run -it --rm \
        --network="generated_default" \
        -v $HOME/.bos:/home/node/.bos \
        -e BOS_DEFAULT_SAVED_NODE=SAVEDNODENAME \
        alexbosworth/balanceofsatoshis "$@"

make sure to make it executable with $ chmod +x /usr/local/bin/bos

and then you'll be able to do just $ bos report or $ bos price usd for example


I created a summary/short tutorial here