Skip to content

Commit 79d327c

Browse files
authored
Merge pull request #8 from lncm/detault-username-patch
Add RPCUSER as a default username
2 parents 60137eb + 65c2535 commit 79d327c

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ You may map these anywhere in your filesystem. For best results works best with
3131

3232
Other than that everything should be in the default paths.
3333

34+
- RPCUSER (default: lncm)
3435
- 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))
3536
- JSONRPCURL (Default: http://10.254.2.2:8332) : Is the JSON-RPC interface for bitcoind
3637
- LND_CONTAINER_NAME (Default: lnd) : is the container name to restart

switch.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

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

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

3940
echo 'If set to neutrino then lets check bitcoind'
4041

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

0 commit comments

Comments
 (0)