diff options
| author | Kevin Malakoff <[email protected]> | 2019-06-14 14:07:48 -0700 |
|---|---|---|
| committer | Kevin Malakoff <[email protected]> | 2019-06-14 14:07:48 -0700 |
| commit | 4625aca583acb444cf2e08ccc4c6d834312d3080 (patch) | |
| tree | 19f3c678d455828c535a583d9531860f8468e9bc /index.js | |
| parent | 66145a336bcccee51775e9830fb67e4034949d52 (diff) | |
| download | coinos-server-4625aca583acb444cf2e08ccc4c6d834312d3080.tar.gz coinos-server-4625aca583acb444cf2e08ccc4c6d834312d3080.zip | |
Removed dependency on forked module
Diffstat (limited to 'index.js')
| -rw-r--r-- | index.js | 17 |
1 files changed, 4 insertions, 13 deletions
@@ -9,9 +9,7 @@ import BitcoinCore from 'bitcoin-core' import cors from 'cors' import express from 'express' import fb from 'fb' -import fs from 'fs' import graphqlHTTP from 'express-graphql' -import grpc from 'grpc' import io from 'socket.io' import jwt from 'jsonwebtoken' import morgan from 'morgan' @@ -24,6 +22,7 @@ import zmq from 'zeromq' import authyVerify from './authy' import config from './config' import whitelist from './whitelist' +import createLnrpc from './lib/createLnrpc' const bitcoin = require('bitcoinjs-lib') const l = console.log @@ -33,17 +32,9 @@ const pick = (O, ...K) => K.reduce((o, k) => ((o[k] = O[k]), o), {}); const authy = new Client({ key: config.authy.key }); (async () => { - const ln = async ({ server, tls, macaroon, channelpeers }) => { - const ln = await require('lnrpc')({ server, tls }) - ln.meta = new grpc.Metadata() - ln.meta.add('macaroon', fs.readFileSync(macaroon).toString('hex')) - ln.channelpeers = channelpeers - return ln - } - - const lna = await ln(config.lna) - const lnb = await ln(config.lnb) - + debugger; + const lna = await createLnrpc(config.lna) + const lnb = await createLnrpc(config.lnb) const bc = new BitcoinCore(config.bitcoin) const app = express() |
