# Lightning Network

![https://explorer.acinq.co/](https://852358698-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MQKJKgcTd2_-nxzyaak%2F-MXxYvr5UudTHY1nt_Np%2F-MXxZVgfPYDjt5HVg21q%2Fimage.png?alt=media\&token=eb9fdefb-7dc1-495b-a218-755e6bb366e7)

### Containers out of the box del playground

#### LND / lnd (Go)

* linguaggio Golang
* repo ufficiale <https://github.com/lightningnetwork/lnd>
* playground [docker-compose config](https://github.com/bitcoin-dalla-teoria-alla-pratica/bitcoin-in-action-playground/blob/master/docker-compose.yml#L105-L128)
* playground [README.md](https://github.com/bitcoin-dalla-teoria-alla-pratica/bitcoin-in-action-playground/blob/master/lnd/README.md)

Nel [README.md](https://github.com/bitcoin-dalla-teoria-alla-pratica/bitcoin-in-action-playground/tree/master/lnd) si trovano le istruzioni per aprire un canale fra questo nodo LN e lightningd e per collegare Electrum a questo nodo LN.

#### c-lightning / lightningd (C)

* repo ufficiale <https://github.com/ElementsProject/lightning>
* playground [docker-compose config](https://github.com/bitcoin-dalla-teoria-alla-pratica/bitcoin-in-action-playground/blob/master/docker-compose.yml#L90-L104)
* playground [README.md](https://github.com/bitcoin-dalla-teoria-alla-pratica/bitcoin-in-action-playground/blob/master/lightningd/README.md)

Assieme al nodo LN abbiamo attivato anche Spark wallet disponibile tramite il link qui di fianco sulla sx "Lightning Network Spark wallet".

#### ACINQ / eclair (Scala)

* repo ufficiale <https://github.com/ACINQ/eclair>
* playground docker-compose config #TODO
* playground README.md #TODO

### Aprire un canale fra Electrum e c-lightning

> Si ringrazia [@massmux](https://twitter.com/massmux) per aver suggerito questo use case

Aprire un browser sulla macchina locale:

* aprire <http://localhost:9737/#/node>\
  user: fulmine, password: fulmine;
* copiare il "Node address";

da [Electrum](https://playground.bitcoininaction.com/minare-il-primo-blocco-bitcoin/electrum-desktop) lanciato come [precedentemente descritto](https://playground.bitcoininaction.com/minare-il-primo-blocco-bitcoin/electrum-desktop) (fare attenzione al pallino verde che dimostri che il sistema è collegato alla regtest), fare i seguenti passi:

* in electrum dalla tab "Channels" fare "Open Channel";
* come Remote Node ID inserire {node address copiato precedentemente}@127.0.0.1:9735

il risultato è il seguente (dopo l'apertura di un canale).

![](https://852358698-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MQKJKgcTd2_-nxzyaak%2F-MXxVb7Tw0ceYwN4Gmks%2F-MXxWZ9MoTnZEjFk6oxe%2Fimage.png?alt=media\&token=d4f02f63-4d8a-492c-aaba-9dd7f68498d3)

{% hint style="info" %}
**NB**: ricordarsi di minare almeno 6 blocchi per ottenere le necessarie conferme alla apertura del canale.
{% endhint %}
