|
| 1 | +# LNC Example HTML Page |
| 2 | + |
| 3 | +This folder contains an example HTML page with JS code used to demonstrate how |
| 4 | +to connect to a `litd` node using LNC on the web. |
| 5 | + |
| 6 | +## Setup |
| 7 | + |
| 8 | +Follow these steps to be able to view the example page in a browser on your |
| 9 | +machine. |
| 10 | + |
| 11 | +1. Clone this repository |
| 12 | + ``` |
| 13 | + $ git clone git@github.com:lightninglabs/lightning-node-connect.git |
| 14 | + $ cd lightning-node-connect |
| 15 | + ``` |
| 16 | +1. Build the WASM binary |
| 17 | + ``` |
| 18 | + $ make wasm |
| 19 | + ``` |
| 20 | +1. Run the HTTP server which will make the HTML page and WASM binary accessible |
| 21 | + to your web browser |
| 22 | + ``` |
| 23 | + $ make example-server |
| 24 | + ``` |
| 25 | +1. Open [http://localhost:8080](http://localhost:8080) in a web browser to view |
| 26 | + the page |
| 27 | + |
| 28 | +## Using the Example Page |
| 29 | + |
| 30 | +Here's how to use the HTML page to connect to your `litd` node |
| 31 | + |
| 32 | +1. Enter a namespace or use the default value. This value is used to group the |
| 33 | + data that is stored in your browser's `localStorage`. By using different |
| 34 | + namespaces, you can maintain connection information for multiple nodes in |
| 35 | + one browser. However, you can only connect to one node at a time. |
| 36 | +1. Click on the "Initiate the client" button. |
| 37 | + 1. If you had previously connected using the specified namespace, it will |
| 38 | + attempt to automatically reconnect to your existing session. |
| 39 | + 1. If you have not connected using the specified namespace, you will be |
| 40 | + prompted to enter your Pairing Phrase. |
| 41 | +1. Enter the Pairing Phrase that can be copied from your `litd` node's web UI. |
| 42 | +1. Keep the default mailbox server unless you used a custom server when |
| 43 | + creating the session in `litd`. |
| 44 | +1. Click on the "Connect to server" button to establish the LNC connection. |
| 45 | +1. A section of labels and buttons will be displayed allowing you to call |
| 46 | + many of the RPCs exposed by LND, Loop, Pool, and Faraday. |
| 47 | +1. Click on the first "GetInfo" button. The RPC response will be displayed |
| 48 | + above the LND label. |
0 commit comments