Skip to content
This repository was archived by the owner on Aug 1, 2023. It is now read-only.

Commit 5715f04

Browse files
author
Hiroto Shioi
authored
Update document (#148)
* Update document * Fix * Fix grammar * Update spec.lhs
1 parent 44fa212 commit 5715f04

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

specs/CardanoShellSpec.lhs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ Currently, the \textit{Daedalus} and the \textit{Node} (this is what I'm calling
210210
\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}.\\
211211

212212
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}.\\
214214

215215
Currently, the \textit{Deadalus} starts the \textit{Node} (we will ignore the \textit{Launcher} for now, since it complicates the story a bit).\\
216216

@@ -220,6 +220,9 @@ When the \textit{Daedalus} calls and starts the \textit{Node}, it also opens up
220220
First, the \textit{Node} sends the message \textbf{Started} back to the \textit{Daedalus} to inform him that the communication can begin.
221221
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.\\
222222

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+
223226
The communication is bi-directional, on Windows it is using \textbf{named pipes}.\\
224227

225228
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.

specs/CardanoShellSpec.pdf

616 Bytes
Binary file not shown.

specs/shell.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
let
22
# adding the haskell environment for running lhs2tex
3-
pkgs = import (import ./../nixpkgs.nix) { config = import ./../config.nix; };
3+
pkgs = import (import ./../nixpkgs.nix) { config = import ./../default.nix; };
44
in
55
pkgs.stdenv.mkDerivation {
66
name = "docsEnv";

0 commit comments

Comments
 (0)