You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 1, 2023. It is now read-only.
Copy file name to clipboardExpand all lines: specs/CardanoShellSpec.lhs
+4-1Lines changed: 4 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -210,7 +210,7 @@ Currently, the \textit{Daedalus} and the \textit{Node} (this is what I'm calling
210
210
\textbf{IPC} (Inter Process Communication) is a set of methods which processes can use to communicate - \url{https://en.wikipedia.org/wiki/Inter-process_communication}.\\
211
211
212
212
The actual communication right now is being done by the \textit{spawn} function, pieces of which can be found \href{https://github.com/nodejs/node/blob/62942e9ad7a59b76e9255ea2560bad2245709efc/lib/internal/child_process.js#L306}{here}.
213
-
The part of the code which adds the handle id which they will use to communicate via environment variable "NODE\_CHANNEL\_FD"\href{https://github.com/nodejs/node/blob/master/lib/internal/child_process.js#L324-L335}{here}.\\
213
+
The part of the code which adds the handle id which they will use to communicate via environment variable \textit{NODE\_CHANNEL\_FD}\href{https://github.com/nodejs/node/blob/master/lib/internal/child_process.js#L324-L335}{here}.\\
214
214
215
215
Currently, the \textit{Deadalus} starts the \textit{Node} (we will ignore the \textit{Launcher} for now, since it complicates the story a bit).\\
216
216
@@ -220,6 +220,9 @@ When the \textit{Daedalus} calls and starts the \textit{Node}, it also opens up
220
220
First, the \textit{Node} sends the message \textbf{Started} back to the \textit{Daedalus} to inform him that the communication can begin.
221
221
After that, \textit{Daedalus} sends the message \textbf{QueryPort} to the \textit{Node}, and the \textit{Node} responds with the free port it found using \textbf{ReplyPort PORTNUM} that is going to be used for starting the HTTP "server" serving the \textit{JSON API} which they can then use to communicate further.\\
222
222
223
+
Not only does the \textit{Node} responds to the message, but it can also perform some IO actions depending on the message sent from the client.
224
+
For instance, you can have the client fetch the system information and return it to the server, or have it so that node will kill its thread/process when it responds with \textbf{ReplyPort PORTNUM}.\\
225
+
223
226
The communication is bi-directional, on Windows it is using \textbf{named pipes}.\\
224
227
225
228
We can easily generalize this concept. We can say that \textit{Daedalus} is the \textit{Server}, and that the \textit{Node} is the \textit{Client}. Since the communication is bi-directional, we can say that either way, but we can presume that the \textit{Server} is the process which is started first.
0 commit comments