Giter Site home page Giter Site logo

mably / lncli-web Goto Github PK

View Code? Open in Web Editor NEW
184.0 12.0 58.0 2.09 MB

Light-weight web client for the lnd daemon written in NodeJS / Angular.

Home Page: https://github.com/lightningnetwork/lnd

License: GNU Affero General Public License v3.0

JavaScript 64.23% HTML 28.19% CSS 0.61% Shell 5.74% Dockerfile 1.24%
bitcoin lightning-network web-client cryptocurrency lightning

lncli-web's Introduction

Lnd Web Client

Installation

Requirements

Procedure

Fetch sources from the Lnd Web Client git repository:

git clone https://github.com/mably/lncli-web.git

Move into the newly created directory:

cd lncli-web

Fetch the dependencies and build the application by running:

npm install

If not started automatically, run the following command to build the application:

"./node_modules/.bin/gulp" bundles

Execution

Requirements

lncli-web is now fully compatible with macaroons and encrypted wallets.

But if you want to start lnd with wallet encryption and macaroons disabled, just add those two parameters to the command line:

lnd [...] --no-macaroons --noencryptwallet

If you want to use macaroons, you need to copy the lnd admin.macaroon file to the lncli-web root directory (by default). The default path to the admin.macaroon file can be modified in the <lncliweb>/config/defaults.js file.

Generate lnd certificates compatible with NodeJS gRPC

Beware that lnd autogenerated certificates are not compatible with current NodeJS gRPC module implementation.

Lnd uses the P-521 curve for its certificates but NodeJS gRPC module is only compatible with certificates using the P-256 curve (link).

You need to generate your own lnd certificates using the following commands (thanks to Alex Akselrod for helping me on this):

# Enter the Lnd home directory, located by default at ~/.lnd on Linux or
# /Users/[username]/Library/Application Support/Lnd/ on Mac OSX
# $APPDATA/Local/Lnd on Windows. Also change '/CN=localhost/O=lnd' to '//CN=localhost\O=lnd' if you are using Git Bash.
cd ~/.lnd
openssl ecparam -genkey -name prime256v1 -out tls.key
openssl req -new -sha256 -key tls.key -out csr.csr -subj '/CN=localhost/O=lnd'
openssl req -x509 -sha256 -days 36500 -key tls.key -in csr.csr -out tls.cert
rm csr.csr

Copy generated certificate file into lncli-web directory

cp tls.cert [lncli-web_directory]/lnd.cert

Start the Webserver

node server

Available command-line arguments:

node server --help

  Usage: server [options]

  Options:

    -h, --help                    output usage information
    -V, --version                 output the version number
    -s, --serverport [port]       web server listening port (defaults to 8280)
    -h, --serverhost [host]       web server listening host (defaults to localhost)
    -l, --lndhost [host:port]     RPC lnd host (defaults to localhost:10009)
    -t, --usetls [path]           path to a directory containing key.pem and cert.pem files
    -u, --user [login]            basic authentication login
    -p, --pwd [password]          basic authentication password
    -r, --limituser [login]       basic authentication login for readonly account
    -w, --limitpwd [password]     basic authentication password for readonly account
    -d, --disable-macaroon        set this flag if you do not want to use macaroon files for auth
    -f, --logfile [file path]     path to file where to store the application logs
    -e, --loglevel [level]        level of logs to display (debug, info, warn, error)
    -n, --lndlogfile <file path>  path to lnd log file to send to browser
    -k, --le-email [email]        lets encrypt required contact email

Open your browser at the following address: http://localhost:8280

If you want to access lncli-web using a domain, add the --serverhost flag like so:

node server --serverhost <yourdomain>

Open your browser at the following addres: http://yourdomain:8280

Enjoy!

Docker

Build the container

(from inside the lncli-web folder)

docker build . -t lncli-web

Run in a Docker container

Mount your .lnd directory to the container:

docker run -v /path/to/.lnd/:/config lncli-web

The container will generate certs if necessary.

Any commandline option (see below) can be overridden by setting an appropriate environment variable.

Example: set SET_LNDHOST for --lndhost, or set SET_LE_EMAIL for --le-email

Running in a Docker container connecting to a remote LND instance

Copy the admin.macaroon, tls.key and tls.cert to your machine, for example in /tmp/config.

Then, use docker run accordingly:

docker run -it -e SET_LNDHOST=[IP of lightning host]:10009 -v /tmp/config:/config --net=host lncli-web

Then just browse to http://127.0.0.1:8280. Note: this still requires you to re-generate your certificates as per above.

Screenshots

Check here for the mandatory screenshots: http://imgur.com/a/LgWcs

Enabling https for remote access

You need to have a key.pem (private key) file and a cert.pem (certificate) file available in your path (check the --usetls command-line option).

On Linux you can create the above files using a self-signed certificate by executing the following command:

openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 36500

You might need to run this extra command to remove the password protection:

openssl rsa -in key.pem -out newkey.pem && mv newkey.pem key.pem

And the you need to add the --usetls command-line option to point to the directory containing your two pem files.

Example command starting a password protected Lnd Web Client with readonly account enabled, running on port 443, and using https with corresponding pem files located in the app directory:

node server -s 443 --usetls . --user manager --pwd 33H966wG --limituser lnd --limitpwd rocks

Hoping that helps.

Network graph

The lightning network graph rendering functionality requires to have graphviz installed on the server.

Contributing to the project

As of September 27th, all new code that is created or refactored should abide by the Airbnb JS Style guide. You can use automated tooling to maintain the style guide using eslint. For simplicity, I have outlined a suggested workflow:

Suggested Workflow

  1. write your code changes. For example, you are fixing a bug in app/lightning.js
  2. once you are finished your patch, run eslint app/lightning.js. This will show you the errors in the source code
  3. optionally, you can also run eslint --fix app/lightning.js to let eslint fix errors that it can fix without human intervention
  4. fix the remainig style issues. You are only required to change and commit style for the code you changed (although the more, the merrier!)
  5. commit your clean code

lncli-web's People

Contributors

couillardcharles avatar dependabot[bot] avatar enorrmann avatar juscamarena avatar k9ert avatar mably avatar melvincarvalho avatar michielbdejong avatar mrsimsek avatar perlover avatar tyzbit avatar vinhyenvodoi98 avatar xelawafs avatar zdebra avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lncli-web's Issues

Wallet encryption & macaroons

The requirements section states:

lnd should be started with wallet encryption and macaroons disabled.

However, wallet encryption is an essential part of node security and macaroons are also not a bad idea for bearer tokens. May I ask what the plans for this in combination with lncli-web are?

Buffer.from(...).swap64 is not a function

Thanks for putting this together!

After adding the newly-generated lnd.cert file per instructions, I get the following error:

lncli-web sahill59$ node server --lndhost=localhost:10001
{ pubKeyHex: '0315976de23b04f363f6b3a23cb7263c1fe98b5de18e4210fb67c52c810df1b04b',
  paymentHashHex: '4e67764598fca6b07f96e706b9e3c3561fbd2f38cc019f97e4c503123b5bfe77',
  value: 3 }
/Users/sahill59/Documents/opensource/lncli-web/app/zpay32.js:86
	return Buffer.from(byteArray).swap64();
	                              ^

TypeError: Buffer.from(...).swap64 is not a function
    at convertLongToBigEndianBuffer (/Users/sahill59/Documents/opensource/lncli-web/app/zpay32.js:86:32)
    at Object.module.encode (/Users/sahill59/Documents/opensource/lncli-web/app/zpay32.js:20:24)
    at Object.<anonymous> (/Users/sahill59/Documents/opensource/lncli-web/app/zpay32.js:110:28)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Function.Module._load (module.js:409:3)
    at Module.require (module.js:468:17)
    at require (internal/module.js:20:19)

How can I fix this? Thanks in advance.

Unable to connect to port 8280

On running node server I get:

info: App listening on localhost port 8280

Then after a while

warn: tail data timeout, killing process 27175

However, on navigating to mydonamin:8280 the site can't be reached. My lnd is up and running

CERTIFICATE_VERIFY_FAILED on startup

I'm following the lnd tutorial, I'm now at stage 2, using lncweb.

I'm using Windows 10 and latest lnd/btcd.

I setup a cert file according to the tutorial. Getting CERTIFICATE_VERIFY_FAILED errors.

node server -l localhost:10001
{ pubKeyHex: '0315976de23b04f363f6b3a23cb7263c1fe98b5de18e4210fb67c52c810df1b04b',
paymentHashHex: '4e67764598fca6b07f96e706b9e3c3561fbd2f38cc019f97e4c503123b5bfe77',
value: 3 }
yck3q5xn8cnxga9ssqtd3p3g8ox6un47hg8rrr85c9n13yep6garsuu8q3n3t9fgsb93p3agz8thgio9zwzutuybu6m6jtedne7iz9uzyyyyyyyyyyyy8n6fbmso
{ pubKeyHex: '0315976de23b04f363f6b3a23cb7263c1fe98b5de18e4210fb67c52c810df1b04b',
paymentHashHex: '4e67764598fca6b07f96e706b9e3c3561fbd2f38cc019f97e4c503123b5bfe77',
value: 3 }
info: App listening on localhost port 8280
E0506 16:38:29.877000000 9388 ssl_transport_security.cc:989] Handshake failed with fatal error SSL_ERROR_SSL: error:1000007d:SSL routines:OPENSSL_internal:CERTIFICATE_VERIFY_FAILED.
E0506 16:38:30.884000000 9388 ssl_transport_security.cc:989] Handshake failed with fatal error SSL_ERROR_SSL: error:1000007d:SSL routines:OPENSSL_internal:CERTIFICATE_VERIFY_FAILED.

How should I proceed to debug this?

no data in the webpage

after update lnd to latest commit node server start whit no errors but i can see only static text in the webpage, no data... I already tried to update lncli-web and nodejs, and regenerate lnd.cert

Error: TLS certificate "signed by unknown authority"

I am trying to the lncli-web running for my RaspiBolt guide. The application is not running yet, I'm stuck at creating the necessary tls certificates.

Starting, LND runs fine. Then, creating the new certificates according to instructions, I can no longer use lncli due to this error: transport: authentication handshake failed: x509: certificate signed by unknown authority

bitcoin@RaspiBolt:~/.lnd $ lncli getinfo
{
    "identity_pubkey": "03ad7fe66e7b95e9db50696488a029315cd0e22b7cd36d344eb53e52742abfced6",
    "alias": "Stadicus RaspiBolt",
    "testnet": false,
    "chains": [
        "bitcoin"
    ],
    "version": "0.4.2-beta commit=fc658dbf6043951f6ba8b8e86f4e67bc903cf6b7"
}
bitcoin@RaspiBolt:~/.lnd $ rm tls.*
bitcoin@RaspiBolt:~/.lnd $ openssl ecparam -genkey -name prime256v1 -out tls.key
bitcoin@RaspiBolt:~/.lnd $ openssl req -new -sha256 -key tls.key -out csr.csr -subj '/CN=localhost/O=lnd'
bitcoin@RaspiBolt:~/.lnd $ openssl req -x509 -sha256 -days 36500 -key tls.key -in csr.csr -out tls.cert
bitcoin@RaspiBolt:~/.lnd $ rm csr.csr
bitcoin@RaspiBolt:~/.lnd $ lncli getinfo
[lncli] rpc error: code = Internal desc = connection error: desc = "transport: authentication handshake failed: x509: certificate signed by unknown authority"

Is this maybe due to my tlsextraip / tlsextradomain in "lnd.conf"? At the moment I try to get it to work within my own network, but in the end it needs to be accessible via FQDN.

tlsextraip=91.190.22.151
tlsextradomain=lightning.stadicus.com

Some version info:

Linux RaspiBolt 4.14.30-v7+ #1102 SMP Mon Mar 26 16:45:49 BST 2018 armv7l GNU/Linux
Raspbian GNU/Linux 9 (stretch)
OpenSSL 1.1.0f  25 May 2017
LND 0.4.2-beta

Cannot open admin.macaroon

I'm running lnd with --no-macaroons and launching this project with node server results in a crash on boot:

Error: ENOENT: no such file or directory, open '/Users/rwilson/workspace/lncli-web/config/../admin.macaroon'
    at Object.fs.openSync (fs.js:663:18)
    at Object.fs.readFileSync (fs.js:568:33)
    at /Users/rwilson/workspace/lncli-web/app/lightning.js:19:29
    at /Users/rwilson/workspace/lncli-web/node_modules/grpc/src/credentials.js:121:5

So I created an empty file there, and it all launches fine =)

Open Channel - "bad parameters" error not displayed in lncli-web

I was just experimenting with opening a channel, and noticed that lncli-web seemed to hang for quite a while, so I ran the equivalent command for lncli, and it came back with this:

[lncli] rpc error: code = Code(189) desc = You gave bad parameters:Our channel reserve 546 would be below their dust 573

I know normally lncli-web is supposed to forward the errors it gets from lncli, for whatever reason it didn't seem to do it for this one.

Cheers

SSL issue when running application with PM2

I have ubuntu server and i have configured bitcoind and lnd with mainnet on it. Now i am running this application using pm2. So that i can access it through public ip.

I am running following command:

pm2 start server.js -- -l localhost:8332 -h 0.0.0.0

But now i am getting following error. I don't know. why. Can you please help me to make it work
0|server | E0421 19:06:17.434960868 21463 ssl_transport_security.cc:989] Handshake failed with fatal error SSL_ERROR_SSL: error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number.

Add a style guide

It would be great to define a specific style guide to enforce. This would make sure we all have the same expectation when writing code, and we can also take advantage of automated tooling for lint. It looks like Airbnb, GitHub, & Google all have some open source style guide that we can take advantage of, but I don't have experience with any of them.

Would you be interested in enforcing a style guide for the next contributions? if so, do you have a preference?

lncli-web_directory

The instructions say "Copy generated certificate file into lncli-web directory, cp tls.cert [lncli-web_directory]/lnd.cert"

But does not say where the lncli-web_directory is located.
I have copied the cert to lncli-web/public and it did not work.

I get the following output:

Macaroon support is enabled. Macaroon path is /home/gdb/lncli-web/config/../admin.macaroon
error: Required lnd certificate path missing from application configuration.

Error code 12: unknown service lnrpc.Lightning

I've set it up as described in the README with LND and btcd. However on every request the frontend makes I get the following HTTP error:

{
   "code":12,
   "metadata": {
      "_internal_repr":{}
    },
   "error":"unknown service lnrpc.Lightning"
}

SSL Hansdhake error on running on localhost

I am getting handshake error on running project & my LND node that is on localhost:10001 as mentioned in earlier stage 1 from alice node.

E0224 12:28:38.555136000 140736490542016 ssl_transport_security.cc:979] Handshake failed with fatal error SSL_ERROR_SSL: error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure.
E0224 12:28:39.472572000 140736490542016 ssl_transport_security.cc:190] ssl_info_callback: error occured.

please provide solution to that,
Thanks in advance.

LND Out of Memory with last version

Hi,

I updated the lncli-web to last version yesterday, but as soon as I open the webpage, lnd get killed because out of memory.

I'm running without docker on the following configuration:

  • Ubuntu 16.04
  • 2VCPU 4GB RAM
  • Bitcoin Core 0.16.0
  • LND last version (Master - update yesterday)
  • Node 6.10.0

I upgraded the VM with 4vCPU and 8GB Ram after the error and it still persists.

It was working as a charme with the gitlab code of 3 months ago, until yesterday (with last version of lnd). Now since there's no tags or branches to checkout, I'm not able to get it back working...

As soon as I open the webpage of lncli-web, it successfully retrieve the nodeinfo data tab, but it fails to retrieve Netwok Info tab.

This is the log of lnd:

fatal error: runtime: out of memory

runtime stack:
runtime.throw(0xf73577, 0x16)
/usr/lib/go-1.10/src/runtime/panic.go:619 +0x81
runtime.sysMap(0xc430600000, 0x124c590000, 0x0, 0x1766ed8)
/usr/lib/go-1.10/src/runtime/mem_linux.go:216 +0x20a
runtime.(*mheap).sysAlloc(0x174d400, 0x124c590000, 0x7f37e9b7d890)
/usr/lib/go-1.10/src/runtime/malloc.go:470 +0xd4
runtime.(*mheap).grow(0x174d400, 0x9262c7, 0x0)
/usr/lib/go-1.10/src/runtime/mheap.go:907 +0x60
runtime.(*mheap).allocSpanLocked(0x174d400, 0x9262c7, 0x1766ee8, 0x7ffd7ac599d0)
/usr/lib/go-1.10/src/runtime/mheap.go:820 +0x301
runtime.(*mheap).alloc_m(0x174d400, 0x9262c7, 0xffffffffffff0101, 0x7ffd7ac59a00)
/usr/lib/go-1.10/src/runtime/mheap.go:686 +0x118
runtime.(*mheap).alloc.func1()
/usr/lib/go-1.10/src/runtime/mheap.go:753 +0x4d
runtime.(*mheap).alloc(0x174d400, 0x9262c7, 0x7ffd7a010101, 0x4161bc)
/usr/lib/go-1.10/src/runtime/mheap.go:752 +0x8a
runtime.largeAlloc(0x124c58c22c, 0x450101, 0x7f37e9bbf6c8)
/usr/lib/go-1.10/src/runtime/malloc.go:826 +0x94
runtime.mallocgc.func1()
/usr/lib/go-1.10/src/runtime/malloc.go:721 +0x46
runtime.systemstack(0x0)
/usr/lib/go-1.10/src/runtime/asm_amd64.s:409 +0x79
runtime.mstart()
/usr/lib/go-1.10/src/runtime/proc.go:1170

goroutine 71931 [running]:
runtime.systemstack_switch()

Add support for locked wallet

Currently lncli-web does not work with locked lnd wallets. While this is expected, the Web UI does not provide any visual/textual feedback to the user that they should unlock their wallet. Furthermore, if lncli-web starts with a wallet in a locked state that is later unlocked, a server restart is required.

It would be nice to provide a landing page to prompt the user to unlock their LND wallet and restart the server if they are in the state described above. This could be as simple as adding an alert dialogue on the top of the page, giving the user suggested next steps.

@mably is this something you would like to have? I could work on it next week

Failed to read macaroon from Path

I edited config/defaults.js as below:

// config/defaults.js

module.exports = {
   :  
   :  
  macaroonPath: `~/.lnd/data/chain/bitcoin/mainnet/admin.macaroon`,
   :  
   :  
};

ls ~/.lnd/data/chain/bitcoin/mainnet/admin.macaroon works, so that file exists.

But I failed to run node server --lndhost=localhost:10009 with that error:

Macaroon support is enabled. Macaroon path is ~/.lnd/data/chain/bitcoin/mainnet/admin.macaroon
info:    Recreating active client
error:   The specified macaroon file ~/.lnd/data/chain/bitcoin/mainnet/admin.macaroon was not found.
Please add the missing lnd macaroon file or update/remove the path in the application configuration.

I succeed to run lncli getinfo, so lnd and lncli are working.

My lnd.conf is below:

[Application Options]
externalip=35.211.30.191:9999
listen=0.0.0.0:9999
listen=[::1]:9998
rpclisten=0.0.0.0:10009

[Bitcoin]
bitcoin.active=1
bitcoin.mainnet=1
bitcoin.node=bitcoind

(I exactly opened port 9999, 9998 and 10009)

Any clue?

Unable to run on Ubuntu

Trying to get this to run on linux (Ububtu) and getting the following error:

TypeError: hex is not a function
at Function.from (native)
at Function.from (native)
at Object.module.encode (/home/jrogers/lncli-web/app/zpay32.js:17:29)
at Object. (/home/jrogers/lncli-web/app/zpay32.js:110:28)
at Module._compile (module.js:410:26)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)

When I compile, I get the following warnings:

npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: [email protected]

seems that fsevents if limited to osx, which may be causing this problem. Is the datatype "hex" not defined somewhere else where I can make this work on Ubuntu?

Error: 12 UNIMPLEMENTED: unknown service lnrpc.Lightning

I am setting up Lnd Web Client on my RaspiBolt and it runs very well. As a last step I'd like to automate startup with systemd, but here I encountered an issue.

The startup process is as follows:

  1. bitcoind
  2. lnd
  3. lncli-web

As lncli-web starts directly after lnd, the wallet is not unlocked yet. As expected, I get no details on the web client, as long as the wallet is locked. What I did not expect is that later on, after the wallet is unlocked, the web client is not able to connect to lnd and gives the error message "12 UNIMPLEMENTED: unknown service lnrpc.Lightning".

Screenshot: Chrome, after closing it comletely and re-authentication:

grafik

This issue seems seems to be known, I found it in other github repositories:

I can reproduce the error without problem.

This works

admin ~ ฿ sudo systemctl start lnd
admin ~ ฿ lncli unlock
Input wallet password:

lnd successfully unlocked!
admin ~ ฿ sudo systemctl start lncli-web
admin ~ ฿ sudo systemctl status lncli-web
* lncli-web.service - Lnd Web Client
   Loaded: loaded (/etc/systemd/system/lncli-web.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2018-07-13 17:40:29 CEST; 6s ago
 Main PID: 2051 (node)
   CGroup: /system.slice/lncli-web.service
           |-2051 /usr/bin/node /home/web/lncli-web/server.js --usetls /home/web/lncli-web --serverhost 0.0.0.0 --user manager --pwd xxxxxxxx--limituser lnd --limitpwd xxxxxxxx
           `-2068 tail -F --sleep-interval=2 /home/web/.lnd/logs/bitcoin/testnet/lnd.log

Jul 13 17:40:29 RaspiBolt systemd[1]: Started Lnd Web Client.
Jul 13 17:40:32 RaspiBolt node[2051]: { pubKeyHex: '0315976de23b04f363f6b3a23cb7263c1fe98b5de18e4210fb67c52c810df1b04b',
Jul 13 17:40:32 RaspiBolt node[2051]:   paymentHashHex: '4e67764598fca6b07f96e706b9e3c3561fbd2f38cc019f97e4c503123b5bfe77',
Jul 13 17:40:32 RaspiBolt node[2051]:   value: 3 }
Jul 13 17:40:32 RaspiBolt node[2051]: yck3q5xn8cnxga9ssqtd3p3g8ox6un47hg8rrr85c9n13yep6garsuu8q3n3t9fgsb93p3agz8thgio9zwzutuybu6m6jtedne7iz9uzyyyyyyyyyyyy8n6fbmso
Jul 13 17:40:32 RaspiBolt node[2051]: { pubKeyHex: '0315976de23b04f363f6b3a23cb7263c1fe98b5de18e4210fb67c52c810df1b04b',
Jul 13 17:40:32 RaspiBolt node[2051]:   paymentHashHex: '4e67764598fca6b07f96e706b9e3c3561fbd2f38cc019f97e4c503123b5bfe77',
Jul 13 17:40:32 RaspiBolt node[2051]:   value: 3 }
Jul 13 17:40:34 RaspiBolt node[2051]: info:    App listening on 0.0.0.0 port 8280
Jul 13 17:40:34 RaspiBolt node[2051]: (node:2051) DeprecationWarning: grpc.load: Use the @grpc/proto-loader module with grpc.loadPackageDefinition instead

Screenshot in Chrome:

grafik

This does not work

admin ~ ฿ sudo systemctl stop lncli-web
admin ~ ฿ sudo systemctl stop lncli-web
admin ~ ฿ sudo systemctl restart lnd
admin ~ ฿ sudo systemctl status lnd
* lnd.service - LND Lightning Daemon
   Loaded: loaded (/etc/systemd/system/lnd.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2018-07-13 17:44:47 CEST; 16s ago
 Main PID: 2107 (lnd)
   CGroup: /system.slice/lnd.service
           `-2107 /usr/local/bin/lnd --externalip=91.190.22.151 --tlsextraip=91.190.22.151

Jul 13 17:44:47 RaspiBolt systemd[1]: Started LND Lightning Daemon.
Jul 13 17:44:47 RaspiBolt lnd[2107]: Attempting automatic RPC configuration to bitcoind
Jul 13 17:44:47 RaspiBolt lnd[2107]: Automatically obtained bitcoind's RPC credentials
Jul 13 17:44:47 RaspiBolt lnd[2107]: 2018-07-13 17:44:47.547 [INF] LTND: Version 0.4.2-beta commit=fc658dbf6043951f6ba8b8e86f4e67bc903cf6b7
Jul 13 17:44:47 RaspiBolt lnd[2107]: 2018-07-13 17:44:47.547 [INF] LTND: Active chain: Bitcoin (network=mainnet)
Jul 13 17:44:47 RaspiBolt lnd[2107]: 2018-07-13 17:44:47.548 [INF] CHDB: Checking for schema update: latest_version=1, db_version=1
Jul 13 17:44:47 RaspiBolt lnd[2107]: 2018-07-13 17:44:47.553 [INF] RPCS: password RPC server listening on [::]:10009
Jul 13 17:44:47 RaspiBolt lnd[2107]: 2018-07-13 17:44:47.554 [INF] RPCS: password gRPC proxy started at 127.0.0.1:8080
Jul 13 17:44:47 RaspiBolt lnd[2107]: 2018-07-13 17:44:47.555 [INF] LTND: Waiting for wallet encryption password. Use `lncli create` to create a wallet, `lncli unlock` to unlock an existing wallet, or `lncli ch

admin ~ ฿ sudo systemctl start lncli-web
admin ~ ฿ sudo systemctl status lncli-web
* lncli-web.service - Lnd Web Client
   Loaded: loaded (/etc/systemd/system/lncli-web.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2018-07-13 17:45:19 CEST; 14s ago
 Main PID: 2134 (node)
   CGroup: /system.slice/lncli-web.service
           |-2134 /usr/bin/node /home/web/lncli-web/server.js --usetls /home/web/lncli-web --serverhost 0.0.0.0 --user manager --pwd 2ld27idr --limituser lnd --limitpwd rocks
           `-2150 tail -F --sleep-interval=2 /home/web/.lnd/logs/bitcoin/testnet/lnd.log

Jul 13 17:45:19 RaspiBolt systemd[1]: Started Lnd Web Client.
Jul 13 17:45:21 RaspiBolt node[2134]: { pubKeyHex: '0315976de23b04f363f6b3a23cb7263c1fe98b5de18e4210fb67c52c810df1b04b',
Jul 13 17:45:21 RaspiBolt node[2134]:   paymentHashHex: '4e67764598fca6b07f96e706b9e3c3561fbd2f38cc019f97e4c503123b5bfe77',
Jul 13 17:45:21 RaspiBolt node[2134]:   value: 3 }
Jul 13 17:45:21 RaspiBolt node[2134]: yck3q5xn8cnxga9ssqtd3p3g8ox6un47hg8rrr85c9n13yep6garsuu8q3n3t9fgsb93p3agz8thgio9zwzutuybu6m6jtedne7iz9uzyyyyyyyyyyyy8n6fbmso
Jul 13 17:45:21 RaspiBolt node[2134]: { pubKeyHex: '0315976de23b04f363f6b3a23cb7263c1fe98b5de18e4210fb67c52c810df1b04b',
Jul 13 17:45:21 RaspiBolt node[2134]:   paymentHashHex: '4e67764598fca6b07f96e706b9e3c3561fbd2f38cc019f97e4c503123b5bfe77',
Jul 13 17:45:21 RaspiBolt node[2134]:   value: 3 }
Jul 13 17:45:23 RaspiBolt node[2134]: info:    App listening on 0.0.0.0 port 8280
Jul 13 17:45:23 RaspiBolt node[2134]: (node:2134) DeprecationWarning: grpc.load: Use the @grpc/proto-loader module with grpc.loadPackageDefinition instead
admin ~ ฿ lncli unlock
Input wallet password:

lnd successfully unlocked!

See screenshot at the beginning: in Chrome, after closing it comletely, waiting about a minute and re-authentication as limituser.

Random thought: could this have something to do with the process that is reading the testnet log file?
2150 tail -F --sleep-interval=2 /home/web/.lnd/logs/bitcoin/testnet/lnd.log

Some system / version information:

Linux RaspiBolt 4.14.30-v7+ #1102 SMP Mon Mar 26 16:45:49 BST 2018 armv7l GNU/Linux
Raspbian GNU/Linux 9 (stretch)
OpenSSL 1.1.0f  25 May 2017
LND 0.4.2-beta

Can not install on Raspberry PI

Hello,

I get the following Errors and Warning when installing the App on my Raspberry Pi 3:

image
image
image
image

I'm not an expert so can anyone help me with this Problem pleas?

Thx

Tobias

Test Auth Page Mangling Invoice

ln-payreq-auth.html appears to be mangling the invoice:

$ curl -v https://lnd-testnet-1.mably.com/ln-payreq-auth.html
[snip]
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Authorization
< WWW-Authenticate: Basic realm=lnpayreq:ymdeeamm664q4wpo56hrdiq5fhf3ai1zfz768rhwf9effzsxty9z6apseqzqfoibbb7qgh1fedt3yt6oa3dd31eucedkob4azyzxwy8syyyyyyyyyyyyne6xgrjy

EDIT: I see now the setting comes from here https://github.com/mably/lncli-web/blob/master/config/config-example.js#L7 , I guess you just have to override it.

Pay using specific channel

I took me some time to find how to do this but its there.
lncli sendtoroute

Thing is this is very hard to do with cli. Would be nice to have option here in web UI.
First we need to decode invoice with decodepayreq to get payment hash and destination.

Then we need to query routes with destination and amount.
Based on result we can allow user to chose channel (each first hop of returns routes is our channel).

Wit all of this we can use sendtoroute - pay using out selected channel.

This would be cool feature becouse it allows to keep channels balanced (dunno if it can be used to move sat from one own channel to another). LND by default i think always chose first route we can see when query routes - cheapest and shortes. And its bad if you want keep all channels properly balances for routing.

Unable to show web notification: Notifications are not enabled

I get this error every time I reload the page:

image

But data gets loaded and looks correct, so it is more an "not so nice looking annoying message"...low priority. I tried to allow notifications for the website in chromium but that didn't do anything. Maybe u have an idea where this comes from.

Reproduceable in:
Chrome Version 66.0.3359.117 (Official Build) (64-bit)
Chromium Version 65.0.3325.181 (Official Build)

Not reproducable:
Firefox 59.0.2 does not show this notification as far as I can see. (maybe hidden somewhere, I don't use ffx in daily life)

Edit:
Maybe the output of chrome dev console helps:

image

chrome_1524738065953.log

Spammed with "Bad gateway" when disconnected from server

While messing with this, I noticed that if the server is stopped while you're browsing the page, that it will constantly outputs the "Bad gateway" error every few seconds. Is it possible to have it where it won't notify you again until you acknowledge it, and maybe have it not as frequent?

It's great to have that notification but annoying to have to click it 20+ times to get back to the page. For now I'm just refreshing as a workaround.

Cheers

found 152 vulnerabilities (144 low, 4 moderate, 4 high)

Hi
There seems to be many vulnerabilities.
Will this be addressed?

how to replicate:
$ node -v
v8.12.0
$ npm -v
6.4.1
$ git clone https://github.com/mably/lncli-web.git
$ cd lncli-web
$ npm audit
found 152 vulnerabilities (144 low, 4 moderate, 4 high) in 7405 scanned packages
run npm audit fix to fix 142 of them.
7 vulnerabilities require semver-major dependency updates.
3 vulnerabilities require manual review. See the full report for details.

After running 'npm audit fix'
found 10 vulnerabilities (6 low, 4 high) in 7603 scanned packages
7 vulnerabilities require semver-major dependency updates.
3 vulnerabilities require manual review. See the full report for details.

gulpfile.js has bug

Hi

I tried to install lncli-web, but I failed on "./node_modules/.bin/gulp" bundle.

[09:26:28] Using gulpfile ~/go/src/github.com/mably/lncli-web/gulpfile.js
[09:26:28] Task never defined: bundle
[09:26:28] To list available tasks, try running: gulp --tasks

I ran gulp --tasks, below returned:

[09:27:18] Using gulpfile ~/go/src/github.com/mably/lncli-web/gulpfile.js
/usr/local/lib/node_modules/gulp/lib/taskTree.js:4
  return Object.keys(tasks)
                ^

TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at module.exports (/usr/local/lib/node_modules/gulp/lib/taskTree.js:4:17)
    at logTasks (/usr/local/lib/node_modules/gulp/bin/gulp.js:134:14)
    at /usr/local/lib/node_modules/gulp/bin/gulp.js:127:14
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
    at process._tickCallback (internal/process/next_tick.js:180:9)
    at Function.Module.runMain (module.js:678:11)
    at startup (bootstrap_node.js:187:16)
    at bootstrap_node.js:608:3

Something is wrong with ~/go/src/github.com/mably/lncli-web/gulpfile.js.
Any idea?

Aliases missing

Peers, Channels and all lists that have "aliases" sometimes dont display them. They start if i click "show node", then they reload and add prope alias for that node.

Can't find lnd.cert

Hello,
Found this project via dev.lightning.community tutorial. I try to fire up the app and I get this error:

Error: ENOENT: no such file or directory, open '/Users/grant/gocode/src/lncli-web/config/../lnd.cert'
    at Object.fs.openSync (fs.js:652:18)
    at Object.fs.readFileSync (fs.js:553:33)
    at module.exports (/Users/grant/gocode/src/lncli-web/app/lightning.js:12:19)
    at module.exports (/Users/grant/gocode/src/lncli-web/app/server.js:38:42)
    at Object.<anonymous> (/Users/grant/gocode/src/lncli-web/server.js:27:25)
    at Module._compile (module.js:573:30)
    at Object.Module._extensions..js (module.js:584:10)
    at Module.load (module.js:507:32)
    at tryModuleLoad (module.js:470:12)
    at Function.Module._load (module.js:462:3)

My initial guess is this has to do with TLS or some of the certificates mentioned in the README, but none of them are named lnd.cert.

SSL Handshake Failure

I just installed lncli-web and followed the instructions to regenerate the certificates in README.md. When I go to start node server I get the following error:

E0120 18:49:12.754048113 6096 ssl_transport_security.cc:976] Handshake failed with fatal error SSL_ERROR_SSL: error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure.

lncli-web will start and load the page, but no data from lnd is able to be read.

warn: tail data timeout, killing process 15184

I installed the web interface on my RaspiBolt. I works fine for a couple of minutes. After that I get this message: "warn: tail data timeout, killing process 15184"

Not sure what is going on there. Anyone have an idea? Node is up and running fine.

Duplicate and invalid routes in master

In app/routes.js I've spotted 3 invalid routes:

  • listpeers is duplicated
  • listhannels is also duplicate, and one version is misspelled
  • disconnectpeer should be lowercase, but it's camelcase

The solution is to amend the route file correcting the errors discussed above

Missing babel-core dev dependency

Got an error after running "./node_modules/.bin/gulp" bundle

Error: Cannot find module 'babel-core'

Didn't see it listed in package.json file.

I was able to fix it by manually installing it using:
npm install babel-core babel-loader --save-dev

Adding it as an issue, because you may want to add it to the package.json file.

Install failed on Ubuntu 16.04 / ARM

Installing lncli-web on a Odroid HC2 ARM mini computer running Linux 16.04 LTS failed with the following output.

Anything there could be done or fixed, or is it just not compatible?

> [email protected] install /home/admin/download/lncli-web/node_modules/sse4_crc32
> node-gyp rebuild

/usr/bin/env: ‘node’: No such file or directory
npm WARN install:[email protected] [email protected] install: `node-gyp rebuild`
npm WARN install:[email protected] spawn ENOENT

> [email protected] install /home/admin/download/lncli-web/node_modules/ursa
> node-gyp rebuild

/usr/bin/env: ‘node’: No such file or directory
npm WARN install:[email protected] [email protected] install: `node-gyp rebuild`
npm WARN install:[email protected] spawn ENOENT

> [email protected] install /home/admin/download/lncli-web/node_modules/grpc
> node-pre-gyp install --fallback-to-build --library=static_library

/usr/bin/env: ‘node’: No such file or directory
npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: [email protected]
npm ERR! Linux 4.14.20-108
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! node v4.2.6
npm ERR! npm  v3.5.2
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn

npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build --library=static_library`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-pre-gyp install --fallback-to-build --library=static_library'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the grpc package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-pre-gyp install --fallback-to-build --library=static_library
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs grpc
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls grpc
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/admin/download/lncli-web/npm-debug.log

npm-debug.log

Having better docker-support

The current way the certificates need to be created are not very friendly for automation and a quick setup. So it would be cool to:

  • have docker-compose-file which is is compatible with the lnd-tutorial
  • be able to connect to a lnd running in a docker container as seamless as possible

undefined symbol: SSL_library_init

Followed the build instructions under ubuntu 18.04 but when I try to

node server

app wont start with error
node: symbol lookup error: /home/emilio/lncli-web/node_modules/grpc/src/node/extension_binary/node-v57-linux-x64-glibc/grpc_node.node: undefined symbol: SSL_library_init

Macaroon error creating new address - "cannot get macaroon: root key with id 0 doesn't exist"

I had some issues with getting lnd to properly generate macaroons, but now that I have them I'm having issues with getting lncli-web to use them properly.

If I understand right, once they're generated by lnd, you should just have to copy admin.macaroon into the root of lncli-web and make sure that config/defaults.js references it? I don't totally understand how macaroons work, but I think that error is tied to macaroons.db, since that's where the actual keys are stored? I also have that in my lncli-web root directory.

{ "code": 2, "metadata": { "_internal_repr": {} }, "details": "cannot retrieve macaroon: cannot get macaroon: root key with id 0 doesn't exist", "error": "2 UNKNOWN: cannot retrieve macaroon: cannot get macaroon: root key with id 0 doesn't exist" }

Add a testing framework

One thing I feel is definitely missing in this project, and would also speed up contributions and development, is a unit test suite. Would you be interested in adding a unit test suite to the project? I'm not too experience with Javascript but apparently Jasmine/Mocha seems good!

Suggested next steps

  • let's pick a testing framework!
  • pick a small component and refactor it while adding test coverage to that component
  • add a CI (probably Travis CI?)

Support for disabled macaroons does not work

Even though the README states

...But if you want to start lnd with wallet encryption and macaroons disabled, just add those two parameters to the command line..

I could never get lncli-web to work without macaroon support. This is because in the app/lightning.js, macaroon support is ignored (disabled) only when macaroonPath is falsy. This can never happen as of now, because if --macaroon-path CLI argument is not specified, macaroonPath variable will simply point to the default to macaroon path.

Steps to reproduce

  • Have a lnd server with disabled macaroon support
  • Start an instance of lncli-web

Expected behavour

Server will start correctly

Current behavour

Server will exit with error `The specified macaroon file..."

Cant run on Windows Using Vagrant

Lnd and Btc is running and port 8280 for service.js runs. But accessing host using private IP e.g 192.168.10.10:8280 does not(refused to connect). Any ideas for this?

app crash when selecting Tools --> Network Graph

When I select Network Graph from tools menu:
first it writes a lot lines like the first line in the code box and than crashes.

"0229edafa4127e98e5b023a1920524f702ac183834b17fa69a04714c8c4401f181" -- "03310b9622bcf69661d93eb05e4fe951620cdd4e0af06f008c901936ab68f71518" [ label = " 5711303199", fontsize = 12.0 ];
}

events.js:183
      throw er; // Unhandled 'error' event
      ^

Error: spawn dot ENOENT
    at _errnoException (util.js:1022:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
    at onErrorNT (internal/child_process.js:372:16)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.