-
Notifications
You must be signed in to change notification settings - Fork 4
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
Create tutorial for agent-agent interactions #515
Comments
I was commenting about this on Issue #514. This is my mistake, i'll move the comments here. |
I'd expect a feature where you can specify the
|
There seems to be a bug with the
|
I've written a first blush of the guide. I'll comment it here in parts. |
Setting up nodesFor two agents to communicate with each other we need two agents to be running. For this example we're going to run two First we want to start the first node. Since we are going to run two nodes on the same machine, we need to keep them separate. For this we need to override the Run the following command
If this is the first time creating the node you should be prompted for the password twice. After that some information about the node should be printed.
Note the Now create a 2nd node using the same method, this time with the |
Connecting and trusting nodesNormally when a First we need to tell
Using this we give
This will add the To verify if this information is correct and a connection can be made, we can ping
If a connection can be made then you should get When a connection is made between two nodes then they learn about each other. So when
Now if
We should also have
|
Sharing vaultsCreating a VaultA core feature of
Vaults and generally be referenced by it's name, here it's
We should be able to see the secret in the vault now.
Sharing a VaultThe next step is allowing
If this completed with no errors, we should be able to see the vault in
We can access the secret as well.
Pulling vault changesVaults can be updated. If we wanted these changes then we can pull the vault. If a vault was cloned from another node then it keeps track of where it came from. So pulling a vault is pretty simple. First we need to add a new secret to
Now we can tell
And see the changes
|
This is all on the RPC migration branch right? So we just have to finish review and get that merged. |
Yep. I'll get client migration done today. |
There may be a bug with cloning a vault and then immediately accessing it.
Otherwise, just restarting the agent and trying the command again works. I'll look into the problem. |
Is this a regression? |
Regression caused by RPC migration? |
I don't think so, The error is coming from inside the handler. I won't know for sure until I dive into it. |
The error is coming from the
It's pretty odd. Even weirder that it only happens after cloning the vault and not after restarting the agent. It's likely due to the different methods of constructing the Cloning a vault constructs the I'll compare the two to see if any differences in creation could be causing it. |
Yeah, I don't know about this one. Reviewing how a vault is created when accessed vs cloned, even looking at how the I checked and there is a test where we clone and immediately access a vault. and it runs fine. So it's not something that was missed in testing. Given the fact that the error is related to life-cycle decorators. It seems possible It could be another problem relating to SWC and decorators. |
The bug does not happen when using the |
When using ts-node it uses swc. Can you run check the compiled code difference between tsc and swc for the file in question?
24 Mar 2023 00:27:55 Brian Botha ***@***.***>:
…
The bug does not happen when using the *node dist/bin/polykey.js* to run the agent. So it's a problem with using *npm run polykey*.
—
Reply to this email directly, view it on GitHub[#515 (comment)], or unsubscribe[https://github.com/notifications/unsubscribe-auth/AAE4OHOZUPIGGRMCXXCMORLW5UWFRANCNFSM6AAAAAAWAOX5PI].
You are receiving this because you commented.[Tracking image][https://github.com/notifications/beacon/AAE4OHM4F25PIFXQ4DE2M7TW5UWFRA5CNFSM6AAAAAAWAOX5PKWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTSYLGWJO.gif]
|
I'll have to investigate the differences between code compiled with SWC and TSC and possibly post an upstream issue. For now the tutorial works fine if you use |
Hey @tegefaulkes you said that it's not a problem when using Can you compile your guide in the above 3 comments into a single one that can be used on the staging branch without using I just want this to be ready to send to Mercury. In the previous demo, we created some diagrams @amydevs, where did we post these? I forgot and cannot find them, as well as the commands to be executed. I know that we eventually turn that into the demo CLI gif on the README.md, but I want something like that for this part of the interaction. |
I can combine the guide in to a single comment and update it. Is there a better place to put it besides the comments here? It's pretty bulky already. For now I'll put it in a comment with a details block. |
It should go into the wiki. @amydevs where did you put all the demo materials last time? |
@CMCDragonkai previous demo material was in this pr: #504 |
nodes agent interaction tutorialThis tutorial assumes that you are working in the Setting up nodesFor two agents to communicate with each other we need two agents to be running. For this example we're going to run two First we want to start the first node. Since we are going to run two nodes on the same machine, we need to keep them separate. For this we need to override the Run the following command
If this is the first time creating the node you should be prompted for the password twice. After that some information about the node should be printed.
Note the Now create a 2nd node using the same method, this time with the Connecting and trusting nodesNormally when a First we need to tell
Using this we give
This will add the To verify if this information is correct and a connection can be made, we can ping
If a connection can be made then you should get When a connection is made between two nodes then they learn about each other. So when
Now if
We should also have
Sharing vaultsCreating a VaultA core feature of
Vaults and generally be referenced by it's name, here it's
We should be able to see the secret in the vault now.
Sharing a VaultThe next step is allowing
If this completed with no errors, we should be able to see the vault in
We can access the secret as well.
Pulling vault changesVaults can be updated. If we wanted these changes then we can pull the vault. If a vault was cloned from another node then it keeps track of where it came from. So pulling a vault is pretty simple. First we need to add a new secret to
Now we can tell
And see the changes
|
@amydevs can you run through this and test it? |
Created a PR for adding this to the docs at |
This is done. https://polykey.io/docs/tutorials/vault-sharing. Closing this. @tegefaulkes can you create a big issue for the problem of vault cloning in ts-node? |
Sure thing. |
Specification
With Mercury's interest in
Polykey
, we need to create a guide for how to usePolykey
to ultimately pull or clone a vault. During this process we should asses usability of the process. We can also test functionality of agent-agent interaction across networks.All testing of these features so far have been on the same loopback device. Ideally we can test this across machines on the same local network. As well as machines between networks. I don't foresee these cases not working but it's good to be sure.
But for the tutorial, we need to show the following examples.
nodeGraph
.Stretch goals
Additional context
Tasks
Polykey
in agent-agent interactions.The text was updated successfully, but these errors were encountered: