-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IPC #572
IPC #572
Conversation
Again, I don't feel yet like I have anything meaningful to add. |
Codecov Report
@@ Coverage Diff @@
## develop #572 +/- ##
===========================================
+ Coverage 83.69% 84.62% +0.92%
===========================================
Files 87 87
Lines 1460 1450 -10
Branches 67 67
===========================================
+ Hits 1222 1227 +5
+ Misses 226 211 -15
Partials 12 12
|
@@ -2,17 +2,17 @@ | |||
const RestClient = require('./lcdClient.js') | |||
const mockedRestClient = require('./lcdClientMock.js') | |||
const RpcWrapper = require('./rpcWrapper.js') | |||
const mockedRpcWrapper = require('./rpcWrapperMock.js') | |||
const MockedRpcWrapper = require('./rpcWrapperMock.js') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is our standard for capital vs camel casing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used capital here, as it is a constructor-like function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general only classes and constants should have capital letters
app/src/renderer/connectors/node.js
Outdated
module.exports = function (nodeIP, relayPort, mocked = false) { | ||
const RELAY_SERVER = 'http://localhost:' + relayPort | ||
module.exports = function (nodeIP, lcdPort, mocked = false) { | ||
const LCD_SERVER = 'http://localhost:' + lcdPort |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@@ -24,7 +24,6 @@ module.exports = function (nodeIP, relayPort, mocked = false) { | |||
} | |||
// TODO: eventually, get all data from light-client connection instead of RPC | |||
|
|||
connector.setMocked(mocked) | |||
connector.initRPC(nodeIP) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why don't we need to call initRPC anymore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
init is called only after the main process signals, that it has connected to a node
app/src/renderer/main.js
Outdated
}) | ||
let lcdPort = getQueryParameter('lcd_port') | ||
console.log('Expecting lcd-server on port:', lcdPort) | ||
const node = Node('localhost', lcdPort) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't this defaulting to a localhost now instead of the actual node we want to connect to?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is confusing I will change this.
app/src/renderer/node.js
Outdated
const RestClient = require('./lcdClient.js') | ||
|
||
module.exports = function (nodeIP, relayPort, lcdPort) { | ||
const RELAY_SERVER = 'http://localhost:' + relayPort |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is RELAY_SERVER what we call the mock server?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was dead code. I deleted the file.
app/src/renderer/node.js
Outdated
let newRpc = new RpcClient(`ws://${nodeIP}`) | ||
node.rpcOpen = true | ||
node.rpcConnecting = false | ||
// we need to check immediately if he connection fails. later we will not be able to check this error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"if the connection"
app/src/renderer/node.js
Outdated
}) | ||
// TODO: eventually, get all data from light-client connection instead of RPC | ||
|
||
// node.rpcConnect(nodeIP) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this commented out?
Issue
closes: #375
Missing:
❤️ Thank you!