Skip to content

Commit 65cb1db

Browse files
Update docker guide, grpc guides and tutorial to include network flag for lncli.
1 parent 5ebd9a1 commit 65cb1db

File tree

4 files changed

+31
-28
lines changed

4 files changed

+31
-28
lines changed

guides/docker.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ $ docker-compose run -d --name alice lnd_btc
7474
$ docker exec -i -t alice bash
7575

7676
# Generate a new backward compatible nested p2sh address for Alice:
77-
alice$ lncli newaddress np2wkh
77+
alice$ lncli --network=simnet newaddress np2wkh
7878

7979
# Recreate "btcd" node and set Alice's address as mining address:
8080
$ MINING_ADDRESS=<alice_address> docker-compose up -d btcd
@@ -89,7 +89,7 @@ $ docker-compose run btcctl getblockchaininfo | grep -A 1 segwit
8989

9090
Check `Alice` balance:
9191
```
92-
alice$ lncli walletbalance
92+
alice$ lncli --network=simnet walletbalance
9393
```
9494

9595
Connect `Bob` node to `Alice` node.
@@ -100,7 +100,7 @@ $ docker-compose run -d --name bob lnd_btc
100100
$ docker exec -i -t bob bash
101101

102102
# Get the identity pubkey of "Bob" node:
103-
bob$ lncli getinfo
103+
bob$ lncli --network=simnet getinfo
104104

105105
{
106106
----->"identity_pubkey": "0343bc80b914aebf8e50eb0b8e445fc79b9e6e8e5e018fa8c5f85c7d429c117b38",
@@ -121,10 +121,10 @@ bob$ lncli getinfo
121121
$ docker inspect bob | grep IPAddress
122122

123123
# Connect "Alice" to the "Bob" node:
124-
alice$ lncli connect <bob_pubkey>@<bob_host>
124+
alice$ lncli --network=simnet connect <bob_pubkey>@<bob_host>
125125

126126
# Check list of peers on "Alice" side:
127-
alice$ lncli listpeers
127+
alice$ lncli --network=simnet listpeers
128128
{
129129
"peers": [
130130
{
@@ -141,7 +141,7 @@ alice$ lncli listpeers
141141
}
142142

143143
# Check list of peers on "Bob" side:
144-
bob$ lncli listpeers
144+
bob$ lncli --network=simnet listpeers
145145
{
146146
"peers": [
147147
{
@@ -161,13 +161,13 @@ bob$ lncli listpeers
161161
Create the `Alice<->Bob` channel.
162162
```bash
163163
# Open the channel with "Bob":
164-
alice$ lncli openchannel --node_key=<bob_identity_pubkey> --local_amt=1000000
164+
alice$ lncli --network=simnet openchannel --node_key=<bob_identity_pubkey> --local_amt=1000000
165165

166166
# Include funding transaction in block thereby opening the channel:
167167
$ docker-compose run btcctl generate 3
168168

169169
# Check that channel with "Bob" was opened:
170-
alice$ lncli listchannels
170+
alice$ lncli --network=simnet listchannels
171171
{
172172
"channels": [
173173
{
@@ -196,20 +196,20 @@ alice$ lncli listchannels
196196
Send the payment from `Alice` to `Bob`.
197197
```bash
198198
# Add invoice on "Bob" side:
199-
bob$ lncli addinvoice --amt=10000
199+
bob$ lncli --network=simnet addinvoice --amt=10000
200200
{
201201
"r_hash": "<your_random_rhash_here>",
202202
"pay_req": "<encoded_invoice>",
203203
}
204204

205205
# Send payment from "Alice" to "Bob":
206-
alice$ lncli sendpayment --pay_req=<encoded_invoice>
206+
alice$ lncli --network=simnet sendpayment --pay_req=<encoded_invoice>
207207

208208
# Check "Alice"'s channel balance
209-
alice$ lncli channelbalance
209+
alice$ lncli --network=simnet channelbalance
210210

211211
# Check "Bob"'s channel balance
212-
bob$ lncli channelbalance
212+
bob$ lncli --network=simnet channelbalance
213213
```
214214

215215
Now we have open channel in which we sent only one payment, let's imagine
@@ -218,7 +218,7 @@ it!
218218
```bash
219219
# List the "Alice" channel and retrieve "channel_point" which represents
220220
# the opened channel:
221-
alice$ lncli listchannels
221+
alice$ lncli --network=simnet listchannels
222222
{
223223
"channels": [
224224
{
@@ -245,17 +245,17 @@ alice$ lncli listchannels
245245

246246
# Channel point consists of two numbers separated by a colon. The first one
247247
# is "funding_txid" and the second one is "output_index":
248-
alice$ lncli closechannel --funding_txid=<funding_txid> --output_index=<output_index>
248+
alice$ lncli --network=simnet closechannel --funding_txid=<funding_txid> --output_index=<output_index>
249249

250250
# Include close transaction in a block thereby closing the channel:
251251
$ docker-compose run btcctl generate 3
252252

253253
# Check "Alice" on-chain balance was credited by her settled amount in the channel:
254-
alice$ lncli walletbalance
254+
alice$ lncli --network=simnet walletbalance
255255

256256
# Check "Bob" on-chain balance was credited with the funds he received in the
257257
# channel:
258-
bob$ lncli walletbalance
258+
bob$ lncli --network=simnet walletbalance
259259
{
260260
"total_balance": "10000",
261261
"confirmed_balance": "10000",
@@ -315,7 +315,7 @@ The `Faucet` node address can be found at the [Faucet Lightning Community webpag
315315
$ docker-compose up -d "alice"; docker exec -i -t "alice" bash
316316

317317
# Connect "Alice" to the "Faucet" node:
318-
alice$ lncli connect <faucet_identity_address>@<faucet_host>
318+
alice$ lncli --network=simnet connect <faucet_identity_address>@<faucet_host>
319319
```
320320

321321
After a connection is achieved, the `Faucet` node should create the channel

guides/javascript-grpc.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,12 @@ call.on('data', function(invoice) {
9595
Now, create an invoice for your node at `localhost:10009`and send a payment to
9696
it from another node.
9797
```bash
98-
$ lncli addinvoice --amt=100
98+
$ lncli --network=NETWORK addinvoice --amt=100
9999
{
100100
"r_hash": <RHASH>,
101101
"pay_req": <PAYMENT_REQUEST>
102102
}
103-
$ lncli sendpayment --pay_req=<PAYMENT_REQUEST>
103+
$ lncli --network=NETWORK sendpayment --pay_req=<PAYMENT_REQUEST>
104104
```
105105
Your Javascript console should now display the details of the recently satisfied
106106
invoice.

guides/python-grpc.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,12 @@ for invoice in stub.SubscribeInvoices(request):
9595
Now, create an invoice for your node at `localhost:10009`and send a payment to
9696
it from another node.
9797
```bash
98-
$ lncli addinvoice --amt=100
98+
$ lncli --network=NETWORK addinvoice --amt=100
9999
{
100100
"r_hash": <R_HASH>,
101101
"pay_req": <PAY_REQ>
102102
}
103-
$ lncli sendpayment --pay_req=<PAY_REQ>
103+
$ lncli --network=NETWORK sendpayment --pay_req=<PAY_REQ>
104104
```
105105

106106
Your Python console should now display the details of the recently satisfied

tutorial/01-lncli.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,9 @@ location of our application data, we have to set `--macaroonpath` in the
239239
following command. To disable macaroons, pass the `--no-macaroons` flag into
240240
both `lncli` and `lnd`.
241241

242+
For usage of networks other than mainnet, an additional `--network` flag must
243+
be passed into `lncli` specifying the network, in this case simnet.
244+
242245
`lnd` allows you to encrypt your wallet with a passphrase and optionally encrypt
243246
your cipher seed passphrase as well. This can be turned off by passing
244247
`--noencryptwallet` into `lnd` or `lnd.conf`. We recommend going through this
@@ -253,7 +256,7 @@ Open up a new terminal window, set `$GOPATH` and include `$GOPATH/bin` in your
253256
`PATH` as usual. Let's create Alice's wallet and set her passphrase:
254257
```bash
255258
cd $GOPATH/dev/alice
256-
alice$ lncli --rpcserver=localhost:10001 --macaroonpath=data/admin.macaroon create
259+
alice$ lncli --network=simnet --rpcserver=localhost:10001 --macaroonpath=data/admin.macaroon create
257260
```
258261
You'll be asked to input and confirm a wallet password for Alice, which must be
259262
longer than 8 characters. You also have the option to add a passphrase to your
@@ -263,7 +266,7 @@ passphrase.
263266

264267
You can now request some basic information as follows:
265268
```bash
266-
alice$ lncli --rpcserver=localhost:10001 --macaroonpath=data/admin.macaroon getinfo
269+
alice$ lncli --network=simnet --rpcserver=localhost:10001 --macaroonpath=data/admin.macaroon getinfo
267270
```
268271
`lncli` just made an RPC call to the Alice `lnd` node. This is a good way to
269272
test if your nodes are up and running and `lncli` is functioning properly. Note
@@ -276,21 +279,21 @@ respectively.
276279
```bash
277280
# In a new terminal window, setting $GOPATH, etc.
278281
cd $GOPATH/dev/bob
279-
bob$ lncli --rpcserver=localhost:10002 --macaroonpath=data/admin.macaroon create
282+
bob$ lncli --network=simnet --rpcserver=localhost:10002 --macaroonpath=data/admin.macaroon create
280283
# Note that you'll have to enter an 8+ character password and "n" for the mnemonic.
281284
282285
# In a new terminal window:
283286
cd $GOPATH/dev/charlie
284-
charlie$ lncli --rpcserver=localhost:10003 --macaroonpath=data/admin.macaroon create
287+
charlie$ lncli --network=simnet --rpcserver=localhost:10003 --macaroonpath=data/admin.macaroon create
285288
# Note that you'll have to enter an 8+ character password and "n" for the mnemonic.
286289
```
287290

288291
To avoid typing the `--rpcserver=localhost:1000X` and `--macaroonpath` flag
289292
every time, we can set some aliases. Add the following to your `.bashrc`:
290293
```bash
291-
alias lncli-alice="lncli --rpcserver=localhost:10001 --macaroonpath=data/admin.macaroon"
292-
alias lncli-bob="lncli --rpcserver=localhost:10002 --macaroonpath=data/admin.macaroon"
293-
alias lncli-charlie="lncli --rpcserver=localhost:10003 --macaroonpath=data/admin.macaroon"
294+
alias lncli-alice="lncli --network=simnet --rpcserver=localhost:10001 --macaroonpath=data/admin.macaroon"
295+
alias lncli-bob="lncli --network=simnet --rpcserver=localhost:10002 --macaroonpath=data/admin.macaroon"
296+
alias lncli-charlie="lncli --network=simnet --rpcserver=localhost:10003 --macaroonpath=data/admin.macaroon"
294297
```
295298

296299
To make sure this was applied to all of your current terminal windows, rerun

0 commit comments

Comments
 (0)