Browse Source

fix(lnd-proto-dup): Fix that we had redundant lnd rpc.proto files

Only one of these files was being used, and they were going out of step
relative to one another.

Put rpc.proto in the resources directory for consistency with other
vendored resources, i.e. the lnd binary

Updated the def from:
https://github.com/lightningnetwork/lnd/blob/master/lnrpc/rpc.proto
renovate/lint-staged-8.x
Ben Woosley 7 years ago
committed by Tom Kirkpatrick
parent
commit
6d5ca1ab90
No known key found for this signature in database GPG Key ID: 72203A8EC5967EA8
  1. 2
      app/lnd/config/index.js
  2. 1
      app/lnd/config/rpc.proto
  3. 2
      app/lnd/lib/lightning.js
  4. 1676
      app/lnd/lib/rpc.proto
  5. 2
      app/lnd/lib/walletUnlocker.js
  6. 1676
      app/rpc.proto
  7. 4
      package.json

2
app/lnd/config/index.js

@ -43,7 +43,7 @@ if (process.env.NODE_ENV === 'development') {
export default { export default {
lnd: () => ({ lnd: () => ({
lndPath, lndPath,
lightningRpc: `${__dirname}/rpc.proto`, lightningRpc: join(__dirname, 'rpc.proto'),
lightningHost: store.get('host') || 'localhost:10009', lightningHost: store.get('host') || 'localhost:10009',
cert: store.get('cert') || join(userInfo().homedir, loc), cert: store.get('cert') || join(userInfo().homedir, loc),
macaroon: store.get('macaroon') || join(userInfo().homedir, macaroonPath) macaroon: store.get('macaroon') || join(userInfo().homedir, macaroonPath)

1
app/lnd/config/rpc.proto

@ -1674,3 +1674,4 @@ message ForwardingHistoryResponse {
/// The index of the last time in the set of returned forwarding events. Can be used to seek further, pagination style. /// The index of the last time in the set of returned forwarding events. Can be used to seek further, pagination style.
uint32 last_offset_index = 2 [json_name = "last_offset_index"]; uint32 last_offset_index = 2 [json_name = "last_offset_index"];
} }

2
app/lnd/lib/lightning.js

@ -22,7 +22,7 @@ const lightning = (rpcpath, host) => {
const lndConfig = config.lnd() const lndConfig = config.lnd()
const lndCert = fs.readFileSync(lndConfig.cert) const lndCert = fs.readFileSync(lndConfig.cert)
const sslCreds = grpc.credentials.createSsl(lndCert) const sslCreds = grpc.credentials.createSsl(lndCert)
const rpc = grpc.load(path.join(__dirname, 'rpc.proto')) const rpc = grpc.load(path.join(__dirname, '..', 'rpc.proto'))
const metadata = new grpc.Metadata() const metadata = new grpc.Metadata()
const macaroonHex = fs.readFileSync(lndConfig.macaroon).toString('hex') const macaroonHex = fs.readFileSync(lndConfig.macaroon).toString('hex')

1676
app/lnd/lib/rpc.proto

File diff suppressed because it is too large

2
app/lnd/lib/walletUnlocker.js

@ -22,7 +22,7 @@ const walletUnlocker = (rpcpath, host) => {
const lndConfig = config.lnd() const lndConfig = config.lnd()
const lndCert = fs.readFileSync(lndConfig.cert) const lndCert = fs.readFileSync(lndConfig.cert)
const credentials = grpc.credentials.createSsl(lndCert) const credentials = grpc.credentials.createSsl(lndCert)
const rpc = grpc.load(path.join(__dirname, 'rpc.proto')) const rpc = grpc.load(path.join(__dirname, '..', 'rpc.proto'))
return new rpc.lnrpc.WalletUnlocker(host, credentials) return new rpc.lnrpc.WalletUnlocker(host, credentials)
} }

1676
app/rpc.proto

File diff suppressed because it is too large

4
package.json

@ -51,8 +51,7 @@
"app.html", "app.html",
"main.prod.js", "main.prod.js",
"main.prod.js.map", "main.prod.js.map",
"package.json", "package.json"
"rpc.proto"
], ],
"dmg": { "dmg": {
"icon": "./resources/icon.icns", "icon": "./resources/icon.icns",
@ -86,6 +85,7 @@
"output": "release" "output": "release"
}, },
"extraResources": [ "extraResources": [
"./rpc.proto",
{ {
"from": "./resources/bin/win32/lnd.exe", "from": "./resources/bin/win32/lnd.exe",
"to": "./bin/lnd.exe" "to": "./bin/lnd.exe"

Loading…
Cancel
Save