Skip to content

Commit

Permalink
Merge pull request #8 from lncm/detault-username-patch
Browse files Browse the repository at this point in the history
Add RPCUSER as a default username
  • Loading branch information
nolim1t authored Sep 14, 2020
2 parents 60137eb + 65c2535 commit 79d327c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ You may map these anywhere in your filesystem. For best results works best with

Other than that everything should be in the default paths.

- RPCUSER (default: lncm)
- RPCPASS (default: whatever is set in /secrets/rpcpass.txt .) - If we set this, we do not need to link rpcpass.txt (this is generated by configure-box.sh by [the box configure script](https://github.com/lncm/thebox-compose-system/blob/master/configure-box.sh))
- JSONRPCURL (Default: http://10.254.2.2:8332) : Is the JSON-RPC interface for bitcoind
- LND_CONTAINER_NAME (Default: lnd) : is the container name to restart
Expand Down
3 changes: 2 additions & 1 deletion switch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

# Output: /statuses/node-status-bitcoind-ready (when ready, where a service can pick it up)

RPCUSER="${RPCUSER:-lncm}" # Default Username: lncm
RPCPASS="${RPCPASS:-$(cat /secrets/rpcpass.txt)}" # Default password location: /secrets/rpcpass.txt
SLEEPTIME="${SLEEPTIME:-3600}" # Default sleep: 3600
JSONRPCURL="${JSONRPCURL:-http://10.254.2.2:8332}" # Default RPC endpoint: http://10.254.2.2:8332
Expand All @@ -38,7 +39,7 @@ switch_on_sync_done() {

echo 'If set to neutrino then lets check bitcoind'

if ! INFO="$(curl --silent --user "lncm:$RPCPASS" --data-binary '{"jsonrpc": "1.0", "id":"switchme", "method": "getblockchaininfo", "params": [] }' "$JSONRPCURL")"; then
if ! INFO="$(curl --silent --user "$RPCUSER:$RPCPASS" --data-binary '{"jsonrpc": "1.0", "id":"switchme", "method": "getblockchaininfo", "params": [] }' "$JSONRPCURL")"; then
echo "Error: 'getblockchaininfo' request to bitcoind failed"
return
fi
Expand Down

0 comments on commit 79d327c

Please sign in to comment.