This folder contains an example HTML page with JS code used to demonstrate how
to connect to a litd
node using LNC on the web.
Follow these steps to be able to view the example page in a browser on your machine.
- Clone this repository
$ git clone git@github.com:lightninglabs/lightning-node-connect.git $ cd lightning-node-connect
- Build the WASM binary
$ make wasm
- Run the HTTP server which will make the HTML page and WASM binary accessible
to your web browser
$ make example-server
- Open http://localhost:8080 in a web browser to view the page
Here's how to use the HTML page to connect to your litd
node
- Enter a namespace or use the default value. This value is used to group the
data that is stored in your browser's
localStorage
. By using different namespaces, you can maintain connection information for multiple nodes in one browser. However, you can only connect to one node at a time. - Click on the "Initiate the client" button.
- If you had previously connected using the specified namespace, it will attempt to automatically reconnect to your existing session.
- If you have not connected using the specified namespace, you will be prompted to enter your Pairing Phrase.
- Enter the Pairing Phrase that can be copied from your
litd
node's web UI. - Keep the default mailbox server unless you used a custom server when
creating the session in
litd
. - Click on the "Connect to server" button to establish the LNC connection.
- A section of labels and buttons will be displayed allowing you to call many of the RPCs exposed by LND, Loop, Pool, and Faraday.
- Click on the first "GetInfo" button. The RPC response will be displayed above the LND label.