我有ubuntu服务器。 ubuntu版本是16.04。
我已按照lnd guide
在主网上安装了bitcoind和LND现在我想安装他们在节点js中的Web客户端,并希望在公共IP上访问。 lnd web client github
为此,我安装了Node JS,NPM和PM2。要部署应用程序,我已按照此guide link进行操作。我已经运行了以下命令
git clone https://github.com/mably/lncli-web
cd lncli-web
# Install dependencies
npm install
# Setup default configuration files
"./node_modules/.bin/gulp" bundle
# Setup cert file
# 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
cp tls.cert $GOCODE/src/github.com/mably/lncli-web/lnd.cert
在此之后,我尝试使用PM2使用以下命令运行服务器。
pm2 start server.js -- -l localhost:8332 -h 0.0.0.0
但它在日志中给我这个错误:
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.
我不确定为什么会出现此错误。但我最好的猜测是,它是因为ssl是为本地创建的?任何人都可以帮我解决这个问题吗?
顺便说一句,我没有nodejs
的经验。
Server js文件如下:
// set up ========================
const debug = require("debug")("lncliweb:server");
const program = require("commander");
// parse command line parameters
program
.version("1.0.0")
.option("-s, --serverport [port]", "web server http listening port (defaults to 8280)")
.option("-x, --httpsport [port]", "web server https listening port (defaults to 8283)")
.option("-h, --serverhost [host]", "web server listening host (defaults to localhost)")
.option("-l, --lndhost [host:port]", "RPC lnd host (defaults to localhost:10009)")
.option("-t, --usetls [path]", "path to a directory containing key.pem and cert.pem files")
.option("-u, --user [login]", "basic authentication login")
.option("-p, --pwd [password]", "basic authentication password")
.option("-r, --limituser [login]", "basic authentication login for readonly account")
.option("-w, --limitpwd [password]", "basic authentication password for readonly account")
.option("-f, --logfile [file path]", "path to file where to store the application logs")
.option("-e, --loglevel [level]", "level of logs to display (debug, info, warn, error)")
.option("-n, --lndlogfile <file path>", "path to lnd log file to send to browser")
.option("-k, --le-email [email]", "lets encrypt required contact email")
.parse(process.argv);
// load server
if (program.serverhost && program.leEmail) {
require("./app/server-le")(program); // Let"s Encrypt server version
} else {
require("./app/server")(program); // Standard server version
}