Skip to content

Instantly share code, notes, and snippets.

@jaonoctus
Last active January 29, 2022 19:38
Show Gist options
  • Save jaonoctus/c120fe10d16c203960317edc34441027 to your computer and use it in GitHub Desktop.
Save jaonoctus/c120fe10d16c203960317edc34441027 to your computer and use it in GitHub Desktop.
BOS command for Docker/BTCPayServer
#!/bin/bash
docker run -it --rm \
--network="generated_default" \
-v $HOME/.bos:/home/node/.bos \
-e BOS_DEFAULT_SAVED_NODE=YOUR_NODE_NAME \
alexbosworth/balanceofsatoshis "$@"
@jaonoctus
Copy link
Author

jaonoctus commented Jan 29, 2022

BOS Installation

  1. Create a directory under ~/.bos/
  2. Create a file under ~/.bos/YOUR_NODE_NAME/credentials.json with the following content:
{
  "cert": "base64 tls.cert value",
  "macaroon": "base64 .macaroon value",
  "socket": "lnd_bitcoin:10009"
}

To get the strings for cert and macaroon,

  • Cert: $ base64 /var/lib/docker/volumes/generated_lnd_bitcoin_datadir/_data/tls.cert | tr -d '\n'
  • Macaroon: $ base64 /var/lib/docker/volumes/generated_lnd_bitcoin_datadir/_data/admin.macaroon | tr -d '\n'

Command

  1. Create the file under /usr/local/bin/bos
  2. Make it executable with $ chmod +x /usr/local/bin/bos

Usage

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment