docker: change container golang version; fix readme

This commit is contained in:
Andrey Samokhvalov 2017-03-21 16:17:24 +03:00 committed by Olaoluwa Osuntokun
parent c2bdb5a4b0
commit 1efbaee4f5
2 changed files with 75 additions and 60 deletions

View File

@ -49,12 +49,13 @@ topology, and send a payment from `Alice` to `Bob`.
**General workflow is following:** **General workflow is following:**
* Create a `btcd` node running on a private `simnet`. * Create a `btcd` node running on a private `simnet`.
* Create `Alice`, one of the `lnd` nodes in our test network. * Create `Alice`, one of the `lnd` nodes in our simulation network.
* Create `Bob`, the other `lnd` node in our test network. * Create `Bob`, the other `lnd` node in our simulation network.
* Mine some blocks to send `Alice` some bitcoin. * Mine some blocks to send `Alice` some bitcoins.
* Open channel between `Alice` and `Bob`. * Open channel between `Alice` and `Bob`.
* Send payment from `Alice` to `Bob`. * Send payment from `Alice` to `Bob`.
* Finally, close the channel between `Alice` and Bob`. * Close the channel between `Alice` and Bob`.
* Check that on-chain Bob balance was changed.
Start `btcd`, and then create an address for `Alice` that we'll directly mine Start `btcd`, and then create an address for `Alice` that we'll directly mine
bitcoin into. bitcoin into.
@ -83,17 +84,6 @@ $ docker-compose run btcctl generate 400
$ docker-compose run btcctl getblockchaininfo | grep -A 1 segwit $ docker-compose run btcctl getblockchaininfo | grep -A 1 segwit
``` ```
Now we have `btcd` running and some amount of bitcoins mined to the `Alice`
address. We'll need to restart `Alice` just once so she properly syncs up with
`btcd`.
```bash
# Stop "Alice" container:
$ docker-compose stop "alice"
# Start "Alice" container and log into it:
$ docker-compose up --no-recreate -d "alice"
$ docker exec -i -t "alice" bash
# Check "Alice" balance: # Check "Alice" balance:
alice$ lncli walletbalance --witness_only=true alice$ lncli walletbalance --witness_only=true
``` ```
@ -108,11 +98,15 @@ $ docker exec -i -t "bob" bash
bob$ lncli getinfo bob$ lncli getinfo
{ {
----> "identity_pubkey": "0290bf454f4b95baf9227801301b331e35d477c6b6e7f36a599983ae58747b3828", ----->"identity_pubkey": "0343bc80b914aebf8e50eb0b8e445fc79b9e6e8e5e018fa8c5f85c7d429c117b38",
"block_height": 3949, "alias": "",
"block_hash": "00000000853c9dcccf8879abb0a91f0152aed16efe68015a924156f5845016ee", "num_pending_channels": 0,
"num_active_channels": 0,
"num_peers": 0,
"block_height": 1215,
"block_hash": "7d0bc86ea4151ed3b5be908ea883d2ac3073263537bcf8ca2dca4bec22e79d50",
"synced_to_chain": true, "synced_to_chain": true,
"testnet": false, "testnet": false
} }
# Get the IP address of "Bob" node: # Get the IP address of "Bob" node:
@ -126,11 +120,15 @@ alice$ lncli listpeers
{ {
"peers": [ "peers": [
{ {
"pub_key": "0290bf454f4b95baf9227801301b331e35d477c6b6e7f36a599983ae58747b3828", "pub_key": "0343bc80b914aebf8e50eb0b8e445fc79b9e6e8e5e018fa8c5f85c7d429c117b38",
"peer_id": 1, "peer_id": 1,
"address": "10.0.0.125:10011", "address": "172.19.0.4:10011",
"bytes_sent": 3278, "bytes_sent": "357",
"bytes_recv": 3278 "bytes_recv": "357",
"sat_sent": "0",
"sat_recv": "0",
"inbound": true,
"ping_time": "0"
} }
] ]
} }
@ -140,11 +138,15 @@ bob$ lncli listpeers
{ {
"peers": [ "peers": [
{ {
"pub_key": "036a0c5ea35df8a528b98edf6f290b28676d51d0fe202b073fe677612a39c0aa09", "pub_key": "03d0cd35b761f789983f3cfe82c68170cd1c3266b39220c24f7dd72ef4be0883eb",
"peer_id": 1, "peer_id": 1,
"address": "10.0.0.15:10011", "address": "172.19.0.3:51932",
"bytes_sent": 3278, "bytes_sent": "357",
"bytes_recv": 3278 "bytes_recv": "357",
"sat_sent": "0",
"sat_recv": "0",
"inbound": false,
"ping_time": "0"
} }
] ]
} }
@ -163,15 +165,20 @@ alice$ lncli listchannels
{ {
"channels": [ "channels": [
{ {
"remote_pubkey": "0290bf454f4b95baf9227801301b331e35d477c6b6e7f36a599983ae58747b3828", "active": true,
"channel_point": "7a632cde9e9e2ae4e9209591c0587bbb03254814c62e2a7fcef35ced743b0025:0", "remote_pubkey": "0343bc80b914aebf8e50eb0b8e445fc79b9e6e8e5e018fa8c5f85c7d429c117b38",
"chan_id": 1170330072213225472, "channel_point": "3511ae8a52c97d957eaf65f828504e68d0991f0276adff94c6ba91c7f6cd4275:0",
"capacity": 1005000, "chan_id": "1337006139441152",
"local_balance": 1000000, "capacity": "1005000",
"local_balance": "1000000",
"remote_balance": "0",
"unsettled_balance": "0",
"total_satoshis_sent": "0",
"total_satoshis_received": "0",
"num_updates": "0"
} }
] ]
} }
``` ```
Send the payment form `Alice` to `Bob`. Send the payment form `Alice` to `Bob`.
@ -204,12 +211,17 @@ alice$ lncli listchannels
{ {
"channels": [ "channels": [
{ {
"remote_pubkey": "0290bf454f4b95baf9227801301b331e35d477c6b6e7f36a599983ae58747b3828", "active": true,
"channel_point": "7a632cde9e9e2ae4e9209591c0587bbb03254814c62e2a7fcef35ced743b0025:0", "remote_pubkey": "0343bc80b914aebf8e50eb0b8e445fc79b9e6e8e5e018fa8c5f85c7d429c117b38",
"chan_id": 1170330072213225472, ---->"channel_point": "3511ae8a52c97d957eaf65f828504e68d0991f0276adff94c6ba91c7f6cd4275:0",
"capacity": 1005000, "chan_id": "1337006139441152",
"local_balance": 900000, "capacity": "1005000",
"remote_balance": 10000, "local_balance": "990000",
"remote_balance": "10000",
"unsettled_balance": "0",
"total_satoshis_sent": "10000",
"total_satoshis_received": "0",
"num_updates": "2"
} }
] ]
} }
@ -227,6 +239,9 @@ alice$ lncli walletbalance
# Check "Bob" on-chain balance was credited with the funds he received in the # Check "Bob" on-chain balance was credited with the funds he received in the
# channel: # channel:
bob$ lncli walletbalance bob$ lncli walletbalance
{
"balance": 0.0001
}
``` ```
### Connect to faucet lightning node ### Connect to faucet lightning node

View File

@ -1,4 +1,4 @@
FROM golang:1.7 FROM golang:1.8
MAINTAINER Olaoluwa Osuntokun <laolu@lightning.network> MAINTAINER Olaoluwa Osuntokun <laolu@lightning.network>