Browse Source

fix(production): build is working

renovate/lint-staged-8.x
Jack Mallers 7 years ago
parent
commit
cb7f49d646
  1. 1
      app/components/LoadingBolt/LoadingBolt.js
  2. 11
      app/lnd/index.js
  3. 6
      app/lnd/lib/lightning.js
  4. 1303
      app/lnd/lib/rpc.proto
  5. 1
      app/lnd/methods/index.js
  6. 1
      app/lnd/methods/invoicesController.js
  7. 6
      app/main.dev.js
  8. 5
      app/reducers/invoice.js
  9. 5
      app/reducers/payment.js
  10. 2
      app/routes/activity/components/Activity.js
  11. 6
      app/routes/app/components/App.js
  12. 1303
      app/rpc.proto
  13. 1
      app/store/configureStore.dev.js
  14. 21
      app/store/configureStore.prod.js

1
app/components/LoadingBolt/LoadingBolt.js

@ -6,7 +6,6 @@ import styles from './LoadingBolt.scss'
const LoadingBolt = () => (
<div className={styles.container}>
<div className={styles.content}>
<Isvg className={styles.bolt} src={path.join(__dirname, '..', 'resources/cloudbolt.svg')} />
<h1>loading</h1>
</div>
</div>

11
app/lnd/index.js

@ -3,17 +3,6 @@ import lightning from './lib/lightning'
import subscribe from './subscribe'
import methods from './methods'
// const lnd = lightning(config.lightningRpc, config.lightningHost)
// const lndSubscribe = mainWindow => subscribe(mainWindow, lnd)
// const lndMethods = (event, msg, data) => methods(lnd, event, msg, data)
// export default {
// lndMethods,
// lndSubscribe
// }
export default (callback) => {
console.log('here')
const lnd = lightning(config.lightningRpc, config.lightningHost)

6
app/lnd/lib/lightning.js

@ -1,11 +1,13 @@
import fs from 'fs'
import path from 'path'
import grpc from 'grpc'
import config from '../config'
module.exports = (path, host) => {
module.exports = (rpcpath, host) => {
process.env.GRPC_SSL_CIPHER_SUITES = 'HIGH+ECDSA'
const rpc = grpc.load(path)
console.log('PATH: ', path.join(__dirname, 'rpc.proto'))
const rpc = grpc.load(path.join(__dirname, 'rpc.proto'))
const lndCert = fs.readFileSync(config.cert)
const credentials = grpc.credentials.createSsl(lndCert)

1303
app/lnd/lib/rpc.proto

File diff suppressed because it is too large

1
app/lnd/methods/index.js

@ -24,6 +24,7 @@ import * as networkController from './networkController'
export default function (lnd, event, msg, data) {
console.log('MSG: ', msg)
switch (msg) {
case 'info':
networkController.getInfo(lnd)

1
app/lnd/methods/invoicesController.js

@ -27,6 +27,7 @@ export function listInvoices(lnd) {
lnd.listInvoices({}, (err, data) => {
if (err) { reject(err) }
console.log('invoices data: ', data)
resolve(data)
})
})

6
app/main.dev.js

@ -147,10 +147,16 @@ app.on('ready', async () => {
// Call lnd
lnd((lndSubscribe, lndMethods) => {
// Subscribe to bi-directional streams
console.log('lndSubscribe: ', lndSubscribe)
console.log('lndMethods: ', lndMethods)
console.log('mainWindow: ', mainWindow)
lndSubscribe(mainWindow)
// Listen for all gRPC restful methods
ipcMain.on('lnd', (event, { msg, data }) => {
console.log('yoooooo!!!!!!')
console.log('msg: ', msg)
console.log('data: ', data)
lndMethods(event, msg, data)
})

5
app/reducers/invoice.js

@ -95,7 +95,10 @@ export const fetchInvoices = () => (dispatch) => {
}
// Receive IPC event for invoices
export const receiveInvoices = (event, { invoices }) => dispatch => dispatch({ type: RECEIVE_INVOICES, invoices })
export const receiveInvoices = (event, { invoices }) => dispatch => {
console.log('invoices: ', invoices)
dispatch({ type: RECEIVE_INVOICES, invoices })
}
// Send IPC event for creating an invoice
export const createInvoice = (amount, memo, currency, rate) => (dispatch) => {

5
app/reducers/payment.js

@ -58,7 +58,10 @@ export const fetchPayments = () => (dispatch) => {
}
// Receive IPC event for payments
export const receivePayments = (event, { payments }) => dispatch => dispatch({ type: RECEIVE_PAYMENTS, payments })
export const receivePayments = (event, { payments }) => dispatch => {
console.log('payments: ', payments)
dispatch({ type: RECEIVE_PAYMENTS, payments })
}
export const payInvoice = paymentRequest => (dispatch) => {
dispatch(sendPayment())

2
app/routes/activity/components/Activity.js

@ -54,6 +54,8 @@ class Activity extends Component {
nonActiveFilters
} = this.props
console.log('invoiceLoading: ', invoiceLoading)
console.log('paymentLoading: ', paymentLoading)
if (invoiceLoading || paymentLoading) { return <div>Loading...</div> }
return (

6
app/routes/app/components/App.js

@ -38,9 +38,13 @@ class App extends Component {
children
} = this.props
console.log('here with currentTicker: ', currentTicker)
if (lnd.syncing) { return <LndSyncing /> }
if (!currentTicker) { return <LoadingBolt /> }
if (!currentTicker) {
console.log('yooo!')
return <LoadingBolt />
}
return (
<div>

1303
app/rpc.proto

File diff suppressed because it is too large

1
app/store/configureStore.dev.js

@ -43,6 +43,7 @@ const configureStore = (initialState?: counterStateType) => {
// Apply Middleware & Compose Enhancers
enhancers.push(applyMiddleware(...middleware, ipc));
console.log('ENHANCERS: ', enhancers)
const enhancer = composeEnhancers(...enhancers);
// Create Store

21
app/store/configureStore.prod.js

@ -1,12 +1,25 @@
import { createStore, applyMiddleware } from 'redux'
import { createStore, applyMiddleware, compose } from 'redux'
import thunk from 'redux-thunk'
import { createBrowserHistory } from 'history'
import { routerMiddleware } from 'react-router-redux'
import rootReducer from '../reducers'
import ipc from '../reducers/ipc'
const history = createBrowserHistory();
const router = routerMiddleware(history);
const enhancer = applyMiddleware(thunk, router);
const middleware = []
const enhancers = []
middleware.push(thunk)
const history = createBrowserHistory()
const router = routerMiddleware(history)
middleware.push(router)
console.log('middleware: ', middleware)
enhancers.push(applyMiddleware(...middleware, ipc))
console.log('ENHANCERS: ', enhancers)
const enhancer = compose(...enhancers)
// const enhancer = applyMiddleware(thunk, router);
function configureStore(initialState) {
return createStore(rootReducer, initialState, enhancer);

Loading…
Cancel
Save