From 6097d8e11a2f1004f3019f5d56a1ad45f205a744 Mon Sep 17 00:00:00 2001 From: Shannon Appelcline Date: Tue, 5 Jan 2021 09:17:30 -1000 Subject: [PATCH] Now grab the USER and PASS just before using them --- ...rlude_Accessing_a_Second_Lightning_Node.md | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/18_2__Interlude_Accessing_a_Second_Lightning_Node.md b/18_2__Interlude_Accessing_a_Second_Lightning_Node.md index 697a707..3388691 100644 --- a/18_2__Interlude_Accessing_a_Second_Lightning_Node.md +++ b/18_2__Interlude_Accessing_a_Second_Lightning_Node.md @@ -111,15 +111,7 @@ $ sudo cp $GOPATH/bin/lnd $GOPATH/bin/lncli /usr/bin Unlike with c-lightning, you will need to create a default config file for LND. -First, you need to retrieve your rpcuser and rpcpassword. Here's an automated way to do so: -``` -$ BITCOINRPC_USER=$(cat ~standup/.bitcoin/bitcoin.conf | grep rpcuser | awk -F = '{print $2}') -$ BITCOINRPC_PASS=$(cat ~standup/.bitcoin/bitcoin.conf | grep rpcpassword | awk -F = '{print $2}') -``` - -> :warning: **WARNING:** Obviously, never store your RPC password in a shell variable in a production environment. - -Second, you need to enable ZMQ on your Bitcoind, if you didn't already in [§15.3](15_3_Receiving_Bitcoind_Notifications_with_C.md). +However first, you need to enable ZMQ on your Bitcoind, if you didn't already in [§15.3](15_3_Receiving_Bitcoind_Notifications_with_C.md). This requires adding the following to your `~/.bitcoin/bitcoin.conf` file if it's not already there: ``` @@ -144,7 +136,17 @@ $ bitcoin-cli getzmqnotifications } ] ``` -Now you're ready to create a config file: +Now you're ready to create a config file. + +First, you need to retrieve your rpcuser and rpcpassword. Here's an automated way to do so: +``` +$ BITCOINRPC_USER=$(cat ~standup/.bitcoin/bitcoin.conf | grep rpcuser | awk -F = '{print $2}') +$ BITCOINRPC_PASS=$(cat ~standup/.bitcoin/bitcoin.conf | grep rpcpassword | awk -F = '{print $2}') +``` + +> :warning: **WARNING:** Obviously, never store your RPC password in a shell variable in a production environment. + +Then, you can write the file: ``` $ mkdir ~/.lnd $ cat > ~/.lnd/lnd.conf << EOF