Skip to content

Commit 6097d8e

Browse files
authored
Now grab the USER and PASS just before using them
1 parent d28c5a6 commit 6097d8e

1 file changed

Lines changed: 12 additions & 10 deletions

File tree

18_2__Interlude_Accessing_a_Second_Lightning_Node.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -111,15 +111,7 @@ $ sudo cp $GOPATH/bin/lnd $GOPATH/bin/lncli /usr/bin
111111

112112
Unlike with c-lightning, you will need to create a default config file for LND.
113113

114-
First, you need to retrieve your rpcuser and rpcpassword. Here's an automated way to do so:
115-
```
116-
$ BITCOINRPC_USER=$(cat ~standup/.bitcoin/bitcoin.conf | grep rpcuser | awk -F = '{print $2}')
117-
$ BITCOINRPC_PASS=$(cat ~standup/.bitcoin/bitcoin.conf | grep rpcpassword | awk -F = '{print $2}')
118-
```
119-
120-
> :warning: **WARNING:** Obviously, never store your RPC password in a shell variable in a production environment.
121-
122-
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).
114+
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).
123115

124116
This requires adding the following to your `~/.bitcoin/bitcoin.conf` file if it's not already there:
125117
```
@@ -144,7 +136,17 @@ $ bitcoin-cli getzmqnotifications
144136
}
145137
]
146138
```
147-
Now you're ready to create a config file:
139+
Now you're ready to create a config file.
140+
141+
First, you need to retrieve your rpcuser and rpcpassword. Here's an automated way to do so:
142+
```
143+
$ BITCOINRPC_USER=$(cat ~standup/.bitcoin/bitcoin.conf | grep rpcuser | awk -F = '{print $2}')
144+
$ BITCOINRPC_PASS=$(cat ~standup/.bitcoin/bitcoin.conf | grep rpcpassword | awk -F = '{print $2}')
145+
```
146+
147+
> :warning: **WARNING:** Obviously, never store your RPC password in a shell variable in a production environment.
148+
149+
Then, you can write the file:
148150
```
149151
$ mkdir ~/.lnd
150152
$ cat > ~/.lnd/lnd.conf << EOF

0 commit comments

Comments
 (0)