Skip to content

Commit 5ebd9a1

Browse files
RookeRoasbeef
authored andcommitted
tutorial: minor corrections to the tutorials
- A couple of typo corrections - Change the web client tutorial to use the git checkout pattern used in the first tutorial (also for brevity). - python's `open` does not resolve tilde ('~') by default. Call `os.path.expanduser` before using `open`.
1 parent 246ea8f commit 5ebd9a1

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

tutorial/01-lncli.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ btcctl --simnet --rpcuser=kek --rpcpass=kek generate 6
542542
```
543543

544544
Note that this time, we supplied the `--push_amt` argument, which specifies the
545-
amount of money we want to other party to have at the first channel state.
545+
amount of money we want the other party to have at the first channel state.
546546

547547
Let's make a payment from Alice to Charlie by routing through Bob:
548548
```bash

tutorial/02-web-client.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,8 @@ creator himself. Before beginning this step make sure you have `node` and `npm`
1313

1414
```bash
1515
# Clone the repo and move into it:
16-
cd $GOCODE/src/github.com
17-
mkdir mably
18-
cd mably
19-
git clone https://github.com/mably/lncli-web
20-
cd lncli-web
16+
git clone https://github.com/mably/lncli-web $GOPATH/src/github.com/mably/lncli-web
17+
cd $GOPATH/src/github.com/mably/lncli-web
2118

2219
# Install dependencies
2320
npm install
@@ -34,10 +31,10 @@ openssl ecparam -genkey -name prime256v1 -out tls.key
3431
openssl req -new -sha256 -key tls.key -out csr.csr -subj '/CN=localhost/O=lnd'
3532
openssl req -x509 -sha256 -days 36500 -key tls.key -in csr.csr -out tls.cert
3633
rm csr.csr
37-
cp tls.cert $GOCODE/src/github.com/mably/lncli-web/lnd.cert
34+
cp tls.cert $GOPATH/src/github.com/mably/lncli-web/lnd.cert
3835

3936
# Start the server to point to our Alice node:
40-
cd $GOCODE/src/github.com/mably/lncli-web
37+
cd $GOPATH/src/github.com/mably/lncli-web
4138
node server --lndhost=localhost:10001
4239

4340
# Check out the available command line arguments

tutorial/03-rpc-client.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ an email address and password, we created an authentication scheme based on the
6161
user's `lnd` identity pubkey and logging in by signing an arbitrary message. In
6262
particular, we are signing the CSRF token sent along with the login POST
6363
request. This scheme is secure against replay attacks because Django generates
64-
a unique CSRF token for every login attempt, and never uses CSRF tokens.
64+
a unique CSRF token for every login attempt, and never reuses CSRF tokens.
6565

6666
Let's create a new account for Alice by logging in and supplying a username.
6767
Copy down the generated message (in the screenshot, it is `VcccAuMC...`)
@@ -125,12 +125,12 @@ python manage.py shell
125125
```python
126126
# Import rpc files and grpc
127127
In [1]: from coindesk import rpc_pb2 as ln, rpc_pb2_grpc as lnrpc
128-
In [2]: import grpc
128+
In [2]: import grpc, os
129129

130130
# Establish a secure connection with our RPC server. We will first have to
131131
# gather our cert. Lnd cert is at ~/.lnd/tls.cert on Linux and
132132
# ~/Library/Application Support/Lnd/tls.cert on Mac
133-
In [3]: cert = open('~/.lnd/tls.cert').read()
133+
In [3]: cert = open(os.path.expanduser('~/.lnd/tls.cert')).read()
134134
In [4]: creds = grpc.ssl_channel_credentials(cert)
135135
In [5]: channel = grpc.secure_channel('localhost:10009', creds)
136136
# Create a new 'stub' object that will allow us to interact with our "Bob" lnd node.

0 commit comments

Comments
 (0)