Skip to content

Commit

Permalink
doc: Modify README.md code sections
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Sarenik authored and cdecker committed Mar 4, 2018
1 parent fd338c0 commit 424ca8c
Showing 1 changed file with 20 additions and 30 deletions.
50 changes: 20 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,32 +55,28 @@ Please refer to the [installation documentation](doc/INSTALL.md) for
detailed instructions.
For the impatient here's the gist of it for Ubuntu and Debian:

```
sudo apt-get update
sudo apt-get install -y autoconf automake build-essential git libtool libgmp-dev libsqlite3-dev python python3 net-tools libsodium-dev
git clone https://github.com/ElementsProject/lightning.git
cd lightning
make
```
sudo apt-get update
sudo apt-get install -y \
autoconf automake build-essential git libtool libgmp-dev \
libsqlite3-dev python python3 net-tools libsodium-dev
git clone https://github.com/ElementsProject/lightning.git
cd lightning
make

Or if you like to throw `docker` into the mix:

```
sudo docker run \
-v $HOME/.lightning:/root/.lightning \
-v $HOME/.bitcoin:/root/.bitcoin \
-p 9735:9735 \
cdecker/lightningd:latest
```
sudo docker run \
-v $HOME/.lightning:/root/.lightning \
-v $HOME/.bitcoin:/root/.bitcoin \
-p 9735:9735 \
cdecker/lightningd:latest

### Starting `lightningd`

In order to start `lightningd` you will need to have a local `bitcoind`
node running in either testnet or regtest mode:

```
bitcoind -daemon -testnet
```
bitcoind -daemon -testnet

Wait until `bitcoind` has synchronized with the testnet network.

Expand All @@ -91,9 +87,7 @@ Notice that currently pruned nodes are not supported and may result in

You can start `lightningd` with the following command:

```
lightningd/lightningd --network=testnet --log-level=debug
```
lightningd/lightningd --network=testnet --log-level=debug

### Listing all commands:
`cli/lightning-cli help` will print a table of the API and lists the
Expand All @@ -104,13 +98,11 @@ following commands
First you need to transfer some funds to `lightningd` so that it can
open a channel:

```
# Returns an address <address>
cli/lightning-cli newaddr
# Returns an address <address>
cli/lightning-cli newaddr

# Returns a transaction id <txid>
bitcoin-cli -testnet sendtoaddress <address> <amount_in_bitcoins>
```
# Returns a transaction id <txid>
bitcoin-cli -testnet sendtoaddress <address> <amount_in_bitcoins>

`lightningd` will register the funds once the transaction is confirmed.

Expand All @@ -123,10 +115,8 @@ You can send it directly to the `lightningd` address.

Confirm `lightningd` got funds by:

```
# Returns an array of on-chain funds.
cli/lightning-cli listfunds
```
# Returns an array of on-chain funds.
cli/lightning-cli listfunds

Once `lightningd` has funds, we can connect to a node and open a channel.
Let's assume the **remote** node is accepting connections at `<ip>`
Expand Down

0 comments on commit 424ca8c

Please sign in to comment.