Conversation
5da4fd7 to
1218646
Compare
|
branch has been rebased onto master |
|
It seems like there is a lot of redundancy in defining the communication protocol between cli and agent. At first I tried to simply define the cli on the agent and then pass the arguments via the unix domain socket but I ran into some issues especially with controlling the UX on the cli so I went with defining a messaging protocol between the agent and any potential front end. I ended up having what seems to be a lot of redundancy so if you have any tips on how to reduce this, it would be greatly appreciated, unless this is the best way to do it? |
|
What do you mean by redundancy here? I suppose grpc has protoc files? Or do you mean you want to "generate" the marshalling code. There are libraries to do this. |
|
This MR is too big for me to review. I mean that literally, my browser doesn't load it properly. Won't be able to review from this interface. Are you able to either split it up into separate MRs, if not, we can instead perhaps do this by just merging and it and going through the pieces. |
Yes I just mean there is a lot of code to convert proto files into javascript and back again. I am going to take a look into |
I didn't realize it was this big! there are a few things I can do to make it smaller. |
bafea7f to
bd93958
Compare
|
There's a conflict in package.json. This commit will need to be rebased. |
| All `.proto` files are stored in the the `proto` directory. JavaScript and type definition files are build using the following command: | ||
|
|
||
| ``` | ||
| npm run build:proto |
There was a problem hiding this comment.
Should mention how this is integrated into the webpack build system?
There was a problem hiding this comment.
This is a work in progress since grpc_tools_node_protoc doesn't seem to work on nixos, might need your help on that one, it should install with grpc-tools but grpc_tools_node_protoc doesn't seem to be added to the path or installed properly
There was a problem hiding this comment.
Does it require native compilation? Is the failure occurring during npm install? If so, there are ways around it...
There was a problem hiding this comment.
Some npm installs require compilation. This can be done in a nix-shell if the nix-shell has all the tooling required. There's quite a bit of stuff like node-pre-gyp or whatever. And python2. I did this before when I was trying to put dat and other binary npm stuff into Nixpkgs: svanderburg/node2nix#71 and NixOS/nixpkgs#32940.
However that's for using the packages with CLI executables in Nixpkgs itself. That may be the right idea to do if we can use the protoc compilers from shell.nix and that means pushing those packages to upstream (but first in our overlay).
Of course bringing all the tools needed to do compilation for Node is a bit of a mess.
There was a problem hiding this comment.
BTW have you seen this: https://github.com/agreatfool/grpc_tools_node_protoc_ts? It builds on top of the grpc_tools_node_protoc to generate typescript code instead of just JS code.
There was a problem hiding this comment.
The node-pre-gyp would be best used as part of creating a new nodePackage in nixpkgs upstream. See the PR I created for dat. It's a similar process.
There was a problem hiding this comment.
ENOENT means something doesn't exist. Perhaps the tool is trying to execute something that doesn't exist. This can happen due to absolute paths or paths that don't expect a NixOS environment. I had a similar problem occur when trying to package dvc for Nixpkgs: treeverse/dvc#1509
You might want to chase down that error, and find out exaxtly what the path is failing.
Does this path exist? /home/robbie/Documents/github/js-polykey/node_modules/grpc-tools/bin/protoc.
There was a problem hiding this comment.
There was a problem hiding this comment.
There was a problem hiding this comment.
I suggest putting up an issue in the grpc-node repo. I did this before for the dvc repo regarding "Packaging for NixOS". And put down your woes there. Someone there might know something about it and help. The dvc guys were helpful before too.
|
I'm guessing there's only 1 thing blocking this merge atm:
This problem is really about understanding how to use nix. Once this is done, we merge and then start reviewing each part in detail... in preparation for the UI work and the demo integration into Ouroboros and/or Matrix Relay VPN. These 2 will require you to talk to @nzhang-zh and @DrFacepalm |
|
In the mean time, can we also get a demo of the If you can record that, with https://asciinema.org/ and show that to the team for the all the common use-cases: generating secrets, passing secrets around, renaming stuff, sharing stuff... etc etc. |
47099bf to
c98a48b
Compare
This PR will add the pk agent and IPC communications between the agent and any clients. It will also introduce lockfiles (not done) for preventing two pk agents from operating on the same keynode at once.
Fixes #50
Fixes #54
Fixes #59