One-click Bitcoin Lightning Networks
Problems developing Dapps on the Lightning network
To install Lightning current network we need to install Golang> go1.11 then install Bitcoin node then install lnd, … more installed himself has mentioned in the article is that you can take examination. As far as I can see, that way of installation is very long, easy to follow, and really takes a lot of time for beginners. Recently, I have just found out and discovered a pretty good app to setup the quick and light test environment in a few clicks so we can set up the Lightning network environment. That is Polar
Polar was built to help coders develop the Lightning Network application quickly by creating one or more local networks on their computers.
With Polar you can:
- Create a Lightning Network regtest in just a few clicks
- Connect from your application to the Lightning buttons via RPC
- Launch terminal in each bitcoin / Lightning node
- Add more buttons using drag and drop
- Open and close channels
- Mine new blocks
- Deposit regtest into each Lightning node
Supported Network nodes:
- LND v0.8.0 & v0.7.1
- Bitcoin Core v0.18.1
- c-lightning
How to install
Dependencies
Polar requires you to install Docker to create local networks
On Mac & Windows, you just need to install Docker Desktop
On Linux, you need to install Docker Server and Docker Compose separately
Download
Currently Polar has released a few versions for Mac, Win and Ubuntu to install, you can go to the following link to select the installation.
https://github.com/jamaljsr/polar/releases
Or you can also clone github of Polar and run: https://github.com/jamaljsr/polar Note that you should install the releases because the current dev version is still dev, there are still many errors during use.
1 2 | yarn #install dependencies |
Later
1 2 | yarn dev #run the app with react hot reloading and electron live restarting |
Note that if the pull docker is in error, please correct the DNS server config to 8.8.8.8 instead of 127.0.1.1 with the command
1 2 | sudo vi /etc/resolv.conf |
Polar is an app developed on React code using TypeScript and Electron, and until now it has continued to fix some bugs and develop more functions.
Architecture behind polar
User manual
We will start by creating a Lightning network
Here we have a few parameters
- Network Name: Because you can create multiple networks, you can name your network to distinguish it from other networks
- How many LND nodes: You can configure the number of LND nodes at initialization (On the clone repo version, there are additional c-lightning nodes).
- How many bitcoind nodes: currently default to 1 bitcoind node for each network
Once created we will have a network as follows. To start, click Start
On the left side, you can drag and drop to add nodes
The info section of the LND node contains information about the LND node, including:
- Node type: includes the node type lighning or bitcoind
- Implementation: LND or c-lightning
- Version: v0.8.0-beta or v0.7.1-beta, …
- Status: Stopping or Running
The connect part is the best part:
- GRPC Host and REST Host
- P2P LN Url: the address of the node
- Docs API: open to LND’s document page
In addition, TLS Cert, Admin Macaroon and Read-only Macaroon provide in the form of a path to the file, values in HEX, Base64, … These values are extremely important during the dev process that you can connect from the code. Very simple without having to set up the environment.
Let’s try using these values to connect with any Joule wallet. Joule is an extension to the lightning network
After installation press Start select Local node
Part Node URL filled in according to the REST Host of NND LND in Polar provided here I choose the node Bob REST URL is localhost: 8083
Then fill in admin.macaroon and readonly.macaroon we just need to open the file according to the path provided by Polar and drag and drop those 2 files
This is the result after completing connecting Node bob vs Joule wallet extremely simple and does not take too much time.
In addition to the Actions section, you can open the terminal and operate with the lncli command
Can Deposit for LND node
The Quick Mine part of the navbar is to mine 1 block and you can also install 1 quickmine as the bn block
Open channel
You just need to drag and drop the LND nodes together and fill in the pre-initialized values for the channel
You can then send and receive money in the channel and see the values in the channel by clicking on the link between the notes (the icon for the Channel)
The values provided by the app are really helpful during the Lightning dev process.