diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 00000000..ba493827 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,3 @@ +# These are supported funding model platforms + +github: [shocknet,] diff --git a/README.md b/README.md index 0fdaaf88..953b5984 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,80 @@ # Awesome Project Build with TypeORM -Steps to run this project: +![GitHub last commit](https://img.shields.io/github/last-commit/shocknet/Lightning.Pub?style=flat-square) +[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com) +[![Chat](https://img.shields.io/badge/chat-on%20Telegram-blue?style=flat-square)](https://t.me/ShockBTC) +[![Twitter Follow](https://img.shields.io/twitter/follow/ShockBTC?style=flat-square)](https://twitter.com/ShockBTC) -1. Run `npm i` command -2. Setup database settings inside `data-source.ts` file -3. Run `npm start` command +

+ +`Pub` enables your Lightning node with public Web API's, providing a framework for permissionless applications that depend on Lightning. +- As a wrapper for [`LND`](https://github.com/lightningnetwork/lnd/releases), `Pub` also offers node operators Enterprise-class management capabilities. +- ~~An optional SSL proxy service is included for ease of use through zero-configuration networking.~~ Moving this to NOSTR relay
+ +#### This repository is under rapid iteration and should only be used in development. + + + +--- + +- [Manual Installation](#manual-installation) +- [Docker Usage](#docker-usage) +- [Node Security](#node-security) + +--- + + + +### Manual Installation +#### Notes: +* The service defaults to port `9835` +* Looks for local LND in its default path +* Change defaults in `defaults.js` +* Requires [Node.js](https://nodejs.org) 16 + +#### Steps: +1) Run [LND](https://github.com/lightningnetwork/lnd/releases) - *Example mainnet startup*: + + ``` + ./lnd --bitcoin.active --bitcoin.mainnet --bitcoin.node=neutrino --neutrino.connect=neutrino.shock.network --routing.assumechanvalid --accept-keysend --allow-circular-route --feeurl=https://nodes.lightning.computer/fees/v1/btc-fee-estimates.json + ``` + + +2) Download and Install Lightning.Pub + +``` +git clone https://github.com/shocknet/Lightning.Pub +cd Lightning.Pub +npm install +``` + +3) Run with `yarn start -t` *(`-t` is recommended but [not required](#node-security))* +4) Connect with Dashboard + + +### Docker Usage +To run `Pub` in a fully isolated environment you can use the Docker image +provided on the Docker Hub and easily interact with API's CLI interface and flags. + +#### Prerequisites +To use `Pub` Docker images you will need an instance of LND running, and +also if your LND related files are located in a container file system, you'll need to mount **Docker Volumes** pointed to them while starting the container. + +Example of listing available configuration flags: +``` +docker run --rm shockwallet/Lightning.Pub:latest --help +``` +Example of running an local instance with mounted volumes: +``` +docker run -v /home/$USER/.lnd:/root/.lnd --network host shockwallet/Lightning.Pub:latest +``` + +### Node Security + +`Pub` administration API's use E2E encryption bootstrapped with PAKE to prevent interception by the proxy. There are advanced or testing scenarios where you may wish to bypass this security, to do so pass the env `TRUSTED_KEYS=false` + +Communication between the administrator Dashboard and Lightning.Pub is otherwise encrypted, regardless of whether or not SSL is used, though an SSL equipped reverse proxy is recommended for better usability with web browsers. + +Running with `-t` enables the built-in SSL proxy provider for ease of use via zero-configuration networking. diff --git a/package.json b/package.json index f2279693..b985d217 100644 --- a/package.json +++ b/package.json @@ -1,64 +1,64 @@ { - "name": "lightning.pub", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "test": "tsc && testyts", - "start": "ts-node src/index.ts", - "build_autogenerated": "cd proto && rimraf autogenerated && protoc -I ./service --pub_out=. service/*", - "build_lnd_client_1": "cd proto && protoc -I ./others --plugin=.\\node_modules\\.bin\\protoc-gen-ts_proto.cmd --ts_proto_out=./lnd --ts_proto_opt=esModuleInterop=true others/* ", - "build_lnd_client": "cd proto && rimraf lnd/* && npx protoc --ts_out ./lnd --ts_opt long_type_string --proto_path others others/* ", - "typeorm": "typeorm-ts-node-commonjs" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/shocknet/Lightning.Pub.git" - }, - "author": "", - "license": "ISC", - "bugs": { - "url": "https://github.com/shocknet/Lightning.Pub/issues" - }, - "homepage": "https://github.com/shocknet/Lightning.Pub#readme", - "dependencies": { - "@grpc/grpc-js": "^1.6.7", - "@protobuf-ts/grpc-transport": "^2.5.0", - "@protobuf-ts/plugin": "^2.5.0", - "@protobuf-ts/runtime": "^2.5.0", - "@types/express": "^4.17.13", - "@types/node": "^17.0.31", - "@types/secp256k1": "^4.0.3", - "axios": "^0.27.2", - "copyfiles": "^2.4.1", - "cors": "^2.8.5", - "dotenv": "^16.0.0", - "eccrypto": "^1.1.6", - "express": "^4.18.1", - "grpc-tools": "^1.11.2", - "jsonwebtoken": "^8.5.1", - "lodash": "^4.17.21", - "pg": "^8.4.0", - "reflect-metadata": "^0.1.13", - "rimraf": "^3.0.2", - "rxjs": "^7.5.5", - "secp256k1": "^4.0.3", - "sqlite3": "^5.1.2", - "ts-node": "^10.7.0", - "ts-proto": "^1.112.1", - "typeorm": "0.3.10", - "typescript": "^4.6.4", - "uuid": "^8.3.2" - }, - "devDependencies": { - "@types/cors": "^2.8.12", - "@types/eccrypto": "^1.1.3", - "@types/jsonwebtoken": "^8.5.9", - "@types/lodash": "^4.14.182", - "@types/node": "^16.11.10", - "@types/uuid": "^8.3.4", - "testyts": "^1.5.0", - "ts-node": "10.7.0", - "typescript": "4.5.2" - } -} + "name": "lightning.pub", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "tsc && testyts", + "start": "ts-node src/index.ts", + "build_autogenerated": "cd proto && rimraf autogenerated && protoc -I ./service --pub_out=. service/*", + "build_lnd_client_1": "cd proto && protoc -I ./others --plugin=.\\node_modules\\.bin\\protoc-gen-ts_proto.cmd --ts_proto_out=./lnd --ts_proto_opt=esModuleInterop=true others/* ", + "build_lnd_client": "cd proto && rimraf lnd/* && npx protoc --ts_out ./lnd --ts_opt long_type_string --proto_path others others/* ", + "typeorm": "typeorm-ts-node-commonjs" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/shocknet/Lightning.Pub.git" + }, + "author": "", + "license": "ISC", + "bugs": { + "url": "https://github.com/shocknet/Lightning.Pub/issues" + }, + "homepage": "https://github.com/shocknet/Lightning.Pub#readme", + "dependencies": { + "@grpc/grpc-js": "^1.6.7", + "@protobuf-ts/grpc-transport": "^2.5.0", + "@protobuf-ts/plugin": "^2.5.0", + "@protobuf-ts/runtime": "^2.5.0", + "@types/express": "^4.17.13", + "@types/node": "^17.0.31", + "@types/secp256k1": "^4.0.3", + "axios": "^0.27.2", + "copyfiles": "^2.4.1", + "cors": "^2.8.5", + "dotenv": "^16.0.0", + "eccrypto": "^1.1.6", + "express": "^4.18.1", + "grpc-tools": "^1.11.2", + "jsonwebtoken": "^8.5.1", + "lodash": "^4.17.21", + "pg": "^8.4.0", + "reflect-metadata": "^0.1.13", + "rimraf": "^3.0.2", + "rxjs": "^7.5.5", + "secp256k1": "^4.0.3", + "sqlite3": "^5.1.2", + "ts-node": "^10.7.0", + "ts-proto": "^1.112.1", + "typeorm": "0.3.10", + "typescript": "^4.6.4", + "uuid": "^8.3.2" + }, + "devDependencies": { + "@types/cors": "^2.8.12", + "@types/eccrypto": "^1.1.3", + "@types/jsonwebtoken": "^8.5.9", + "@types/lodash": "^4.14.182", + "@types/node": "^16.11.10", + "@types/uuid": "^8.3.4", + "testyts": "^1.5.0", + "ts-node": "10.7.0", + "typescript": "4.5.2" + } +} \ No newline at end of file