@@ -48,60 +48,102 @@ problems. Community support is also available in the
4848LND and the loop client are using Go modules. Make sure that the ` GO111MODULE `
4949env variable is set to ` on ` .
5050
51- In order to execute a swap, LND will need to be rebuilt with sub servers
52- enabled.
51+ In order to execute a swap, LND will need to be rebuilt on master with sub
52+ servers enabled.
5353
5454### LND
5555
56- * Checkout branch ` master `
56+ Make sure that you are using the ` master ` branch of lnd. You can get this by
57+ git cloning the repository
5758
58- - ` make install tags="signrpc walletrpc chainrpc" ` to build and install lnd
59- with required sub-servers enabled.
59+ ```
60+ git clone https://github.com/lightningnetwork/lnd.git
61+ ```
6062
61- - Make sure there are no macaroons in the lnd dir
62- ` ~/.lnd/data/chain/bitcoin/mainnet ` . If there are, lnd has been started
63- before and in that case, it could be that ` admin.macaroon ` doesn't contain
64- signer permission. Stop lnd, delete ` *.macaroon ` files, restart lnd to
65- regenerate them with the signer permission.
63+ Once the lnd repository is cloned, it will need to be built with special build
64+ tags that enable the swap. This enables the required lnd rpc services.
6665
67- DO NOT DELETE ` wallet.db ` !
66+ ```
67+ cd lnd
68+ make install tags="signrpc walletrpc chainrpc"
69+ ```
6870
69- - Start lnd
71+ Check to see if you have already installed lnd. If you have, you will need to
72+ delete the ` .macaroon ` files from your lnd directory.
73+
74+ ** Do not delete any other files other than the ` .macaroon ` files**
75+
76+ ```
77+ // Example on Linux to see macaroons in the default directory:
78+ ls ~/.lnd/data/chain/bitcoin/mainnet
79+ ```
80+
81+ This should show no ` .macaroon ` files. If it does? Stop lnd, delete macaroons,
82+ restart lnd.
83+
84+ ```
85+ lncli stop
86+ ```
87+
88+ Now delete the .macaroon files and restart lnd. (don't delete any other files)
7089
7190### Loopd
72- - ` git clone https://github.com/lightninglabs/loop.git `
73- - ` cd loop/cmd `
74- - ` go install ./... `
7591
76- ## Execute a swap
92+ After lnd is installed, you will need to clone the Lightning Loop repo and
93+ install the command line interface and swap client service.
94+
95+ ```
96+ git clone https://github.com/lightninglabs/loop.git
97+ cd loop/cmd
98+ go install ./...
99+ ```
77100
78- * Swaps are executed by a client daemon process. Run:
101+ ## Execute a Swap
79102
80- ` loopd `
103+ After you have lnd and the Loop client installed, you can execute a Loop swap.
81104
82- By default ` loopd ` attempts to connect to an lnd instance running on
83- ` localhost:10009 ` and reads the macaroon and tls certificate from ` ~/.lnd ` .
84- This can be altered using command line flags. See ` loopd --help ` .
105+ The Loop client needs its own short-lived daemon which will deal with the swaps
106+ in progress.
85107
86- ` loopd ` only listens on localhost and uses an unencrypted and unauthenticated
87- connection.
108+ To run this:
88109
89- * To initiate a swap, run:
110+ ```
111+ `loopd`
90112
91- ` loop out <amt_sat> `
92-
93- When the swap is initiated successfully, ` loopd ` will see the process through.
113+ // Or if you want to do everything in the same terminal and background loopd
114+ `loopd &`
115+ ```
94116
95- * To query and track the swap status, run ` loop ` without arguments.
117+ By default ` loopd ` attempts to connect to the lnd instance running on
118+ ` localhost:10009 ` and reads the macaroon and tls certificate from ` ~/.lnd ` .
119+ This can be altered using command line flags. See ` loopd --help ` .
120+
121+ ` loopd ` only listens on localhost and uses an unencrypted and unauthenticated
122+ connection.
123+
124+ Now that loopd is running, you can initiate a simple Loop Out. This will pay
125+ out Lightning off-chain funds and you will receive Bitcoin on-chain funds in
126+ return. There will be some chain and routing fees associated with this swap.
127+
128+ ```
129+ loop out <amt_in_satoshis>
130+ ```
131+
132+ This will take some time, as it requires an on-chain confirmation. When the
133+ swap is initiated successfully, ` loopd ` will see the process through.
134+
135+ To query in-flight swap statuses, run ` loop monitor ` .
96136
97137## Resume
138+
98139When ` loopd ` is terminated (or killed) for whatever reason, it will pickup
99140pending swaps after a restart.
100141
101142Information about pending swaps is stored persistently in the swap database.
102143Its location is ` ~/.loopd/<network>/loop.db ` .
103144
104- ## Multiple simultaneous swaps
145+ ## Multiple Simultaneous Swaps
105146
106- It is possible to execute multiple swaps simultaneously.
147+ It is possible to execute multiple swaps simultaneously. Just keep loopd
148+ running.
107149
0 commit comments