Skip to content
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

RPC Timeout when sharing vaults with another user #166

Closed
3 tasks
asuarezop opened this issue Mar 29, 2024 · 18 comments
Closed
3 tasks

RPC Timeout when sharing vaults with another user #166

asuarezop opened this issue Mar 29, 2024 · 18 comments
Assignees
Labels
bug Something isn't working r&d:polykey:core activity 1 Secret Vault Sharing and Secret History Management

Comments

@asuarezop
Copy link

asuarezop commented Mar 29, 2024

Describe the bug

RPC Error Timeout when initiating vaults share secret command from CLI

To Reproduce

image

  1. I initially discovered suareze's Github Identity on Polykey and enabled notify permissions and then attempted to share a secret from my vault with him but we noticed it did not work because he had not enabled the notify/trust permissions for me yet.
  2. Suarez enabled notify/trust permission for me to share secrets with him.
  3. I run command show at the top of the screenshot and the result was RPC has timed out.
  4. We each restarted PK and got the same result.

Expected behavior

  • undefined- Early adopter user was expecting a confirmation message being sent to to verify that trust was established with another user. FEEDBACK ISSUE
  • undefined- On a separate note, there's also a feedback issue where upon discovery of another github username, its unclear if the discovery was sucesfull unless one were to run the identities list command. Feedback should be fixed here as well.
  • undefined- Furthermore, it was stated that sometimes, using cell towers (hotspot) will not work. We did not use hotspot. Anyway, when there is an RPC has timed out error, we should think of including additional feedback of what the possible reasons for that may be and ways to trouble shoot.

Platform (please complete the following information)

  • Device: MacBook Air M2 2023
  • OS: Sonoma 14.4.1
  • Version 1.2.2-alpha.2

Additional context

Notify maintainersbe

@asuarezop asuarezop added the bug Something isn't working label Mar 29, 2024
Copy link

linear bot commented Mar 29, 2024

@tegefaulkes
Copy link
Contributor

When a vault is shared it does two things.

  1. It adds a permission to the ACL for the vault and target NodeId the vault is being shared for.
  2. It sends a notification to the target node.

The first step is blocking but quick, it shouldn't be causing this issue. But the 2nd step where we send a notification requires establishing a connection to the target. If we fail to do that and wait for the connection to time out then it's very likely the RPC will timeout first, thus causing this issue.

To fix this, the notification step needs to be non-blocking. To this end we need to make the following changes.

  1. Sending a notification should use the TaskManager to handle it in the background. This should optionally enable blocking while doing so.
  2. If the send fails then we need to reattempt it again later
  3. Multiple failures should result in giving up any further attempts
  4. Failing to send when blocking should not re-attempt, We'd expect manual re-attempts if set to blocking.

Copy link
Contributor

While discussing this, there is also a feedback problem. All we're getting is the RPC timeout error. If it was a client side error then there is no context we can gleam from it. From the client's perspective the RPC just stopped responding.

From the server's perspective, timeout is a timeout, we'd have to manually include the context of what it was trying to do. A really basic way to address this is to expand the error with some context or include some metadata we can add context during each step of the handler. This metadata object can be included with the RPC error message. If we want some real-time feedback then we'd need to update the RPC system with out-of-band messaging which is something we've tried to avoid so far.

@CryptoTotalWar
Copy link

CryptoTotalWar commented Apr 3, 2024

So when we did this demo, I had 2 Cryptolinks with Polykey. We know that the system doesn't know how to handle multiple Cryptolinks (GH gists with Polykey). Sometimes the pk identities trust would still work in this case. However, in the case of sharing the vault, it did not.

My hunch is that now that i have deleted my cryptolinks and started a fresh PK node, if @asuarezop and myself were to go through the discovery, trust, and share vault process again, we should not run into anymore errors.

@CryptoTotalWar
Copy link

CryptoTotalWar commented Apr 3, 2024

@tegefaulkes Got the same RPC Error Issues with Nguyen which I got with @asuarezop but both users only had deleted all gestalts and had both created a fresh node and started the Polykey demo from scratch.

Steps to recreate Bug

you can view this demo recording here

Providing Terminal History from Wen Here

Terminal 1

  ~ ❯ polykey agent start -v                                                                                                                               ✘ INT  2.7.7  09:34:00 PM
✔ Please enter the password … **********
INFO:polykey.PolykeyAgent:Creating PolykeyAgent
INFO:polykey.PolykeyAgent:Setting umask to 077
INFO:polykey.PolykeyAgent:Setting node path to /Users/nguyen.nd/Library/Application Support/polykey
INFO:polykey.PolykeyAgent.Status:Starting Status
WARN:polykey.PolykeyAgent:Failed Creating PolykeyAgent
ErrorStatusLocked: Status is locked by another process

// Only after we ForceQuit Polykey program where we able to start fresh and start PK again

  ~ ❯ polykey agent start --fresh                                                                                                                            6s  2.7.7  09:34:08 PM
✔ Enter new password … **********
✔ Confirm new password … **********
pid         	74009
nodeId      	vat2qqn2ksouqomadff65v8pi4mfc45fqbna3pl494jikgck3hqb0
clientHost  	::1
clientPort  	59698
agentHost   	::
agentPort   	49192
recoveryCode	XXXXXXXXXXX ( I X'd this out) 
^C^C^C^C^C^C

// This PK Terminal stayed running the entire demo... we don't think control C was able to shut down PK at the end until we Force Quit it again. 

Opened up 2nd terminal (below) while Polykey was running on the 1st terminal (above).

Last login: Wed Apr  3 21:35:44 on ttys031
  ~ ❯ polykey agent status                                                                                                                                        2.7.7  09:35:48 PM
✔ Please enter the password … **********
status           	LIVE
pid              	74009
nodeId           	vat2qqn2ksouqomadff65v8pi4mfc45fqbna3pl494jikgck3hqb0
clientHost       	::1
clientPort       	59698
agentHost        	::
agentPort        	49192
upTime           	51
connectionsActive	2
nodesTotal       	2
version          	0.2.6
sourceVersion    	1.2.2-alpha.2
stateVersion     	1
networkVersion   	1
commitHash       	"e8cc798eca28562c5ebb99cc4cff06ef64fa596c\n"
libVersion       	1.2.2-alpha.2-1-1
libSourceVersion 	1.2.2-alpha.2
libStateVersion  	1
libNetworkVersion	1

  ~ ❯ polykey identities authenticate github.com                                                                                                             5s  2.7.7  09:36:19 PM
url     	https://github.com/login/device
userCode	3F34-1725
duynguyen1105

  ~ ❯ polykey identities claim github.com:duynguyen1105                                                                                                     19s  2.7.7  09:37:00 PM
Claim Id: 2ab82c794aed55be3a8d747dbed54cc3
Url: https://gist.github.com/duynguyen1105/2ab82c794aed55be3a8d747dbed54cc3

  ~ ❯ polykey identities discover github.com:CryptoTotalWar                                                                                                       2.7.7  09:37:15 PM

  ~ ❯ polykey identities list                                                                                                                                     2.7.7  09:39:15 PM
gestalt 1
permissions: None
v5qm086kgr44brpo4s6m64eeb4n30klp237u4mtg4tbreqr7jghog
github.com:CryptoTotalWar

gestalt 2
permissions: None
vat2qqn2ksouqomadff65v8pi4mfc45fqbna3pl494jikgck3hqb0
github.com:duynguyen1105


  ~ ❯ polykey identities trust github.com:CryptoTotalWar                                                                                                          2.7.7  09:43:07 PM

  ~ ❯ polykey identities list                                                                                                                                     2.7.7  09:43:48 PM
gestalt 1
permissions: notify
v5qm086kgr44brpo4s6m64eeb4n30klp237u4mtg4tbreqr7jghog
github.com:CryptoTotalWar

gestalt 2
permissions: None
vat2qqn2ksouqomadff65v8pi4mfc45fqbna3pl494jikgck3hqb0
github.com:duynguyen1105


  ~ ❯ polykey vaults list                                                                                                                                         2.7.7  09:43:54 PM

  ~ ❯ polykey vaults myvault                                                                                                                                      2.7.7  09:44:21 PM
error: unknown command 'myvault'

Usage: polykey vaults [options] [command]

Vaults Operations

Options:
  -np, --node-path <path>                        Path to Node State (default: "/Users/nguyen.nd/Library/Application Support/polykey", env: PK_NODE_PATH)
  -pf, --password-file <path>                    Path to Password
  -f, --format <format>                          Output Format (choices: "human", "json", default: "human")
  -v, --verbose                                  Log Verbose Messages (default: 0)
  -h, --help                                     display help for command

Commands:
  clone [options] <vaultNameOrId> <nodeId>       Clone a Vault from Another Node
  create|touch [options] <vaultName>             Create a new Vault
  delete [options] <vaultName>                   Delete an Existing Vault
  list [options]                                 List all Available Vaults
  log [options] <vaultName>                      Get the Version History of a Vault
  permissions|perms [options] <vaultName>        Sets the permissions of a vault for Node Ids
  pull [options] <vaultNameOrId> [targetNodeId]  Pull a Vault from Another Node
  rename [options] <vaultName> <newVaultName>    Rename an Existing Vault
  share [options] <vaultName> <nodeId>           Set the Permissions of a Vault for a Node
  unshare [options] <vaultName> <nodeId>         Unset the Permissions of a Vault for a Node
  version [options] <vaultName> <versionId>      Set a Vault to a Particular Version in its History
  scan [options] <nodeId>                        Scans a node to reveal their shared vaults
  help [command]                                 display help for command

  ~ ❯ polykey vaults create myvault                                                                                                                               2.7.7  09:44:28 PM
Vault zFhYHSQVmq9253GJ8sJbbfd created successfully

  ~ ❯ polykey vaults list                                                                                                                                         2.7.7  09:44:37 PM
myvault	zFhYHSQVmq9253GJ8sJbbfd

  ~ ❯ polykey secrets create ./Desktop/secretfile myvault:/secretfolder                                                                                           2.7.7  09:44:46 PM

  ~ ❯ polykey secrets get myvault:/secretfolder                                                                                                                   2.7.7  09:46:14 PM
this is my very first secret file

  ~ ❯ polykey vaults share myvault v5qm086kgr44brpo4s6m64eeb4n30klp237u4mtg4tbreqr7jghog                                                                          2.7.7  09:46:43 PM
ErrorPolykeyRemote: Remote error from RPC call
  localHost	::1
  localPort	60548
  remoteHost	::1
  remotePort	59698
  command	vaultsPermissionSet
  timestamp	Wed Apr 03 2024 21:48:10 GMT+0700 (Indochina Time)
  cause: ErrorNodeManagerConnectionFailed: Failed to find or establish a connection

  ~ ❯ polykey vaults scan v5qm086kgr44brpo4s6m64eeb4n30klp237u4mtg4tbreqr7jghog                                                                             16s  2.7.7  09:48:10 PM
ErrorPolykeyRemote: Remote error from RPC call
  localHost	::1
  localPort	60701
  remoteHost	::1
  remotePort	59698
  command	vaultsScan
  timestamp	Wed Apr 03 2024 21:51:02 GMT+0700 (Indochina Time)
  cause: ErrorNodeManagerConnectionFailed: Failed to find or establish a connection

  ~ ❯ polykey notes connections                                                                                                                             16s  2.7.7  09:51:02 PM
error: unknown command 'notes'
(Did you mean nodes?)

Usage: polykey [options] [command]

Polykey CLI

Options:
  -np, --node-path <path>      Path to Node State (default: "/Users/nguyen.nd/Library/Application Support/polykey", env: PK_NODE_PATH)
  -pf, --password-file <path>  Path to Password
  -f, --format <format>        Output Format (choices: "human", "json", default: "human")
  -v, --verbose                Log Verbose Messages (default: 0)
  -V, --version                output the version number
  -h, --help                   display help for command

Commands:
  bootstrap [options]          Bootstrap Keynode State
  agent [options]              Agent Operations
  nodes [options]              Nodes Operations
  secrets [options]            Secrets Operations
  keys [options]               Keys Operations
  vaults [options]             Vaults Operations
  identities [options]         Identities Operations
  notifications [options]      Notifications Operations
  help [command]               display help for command

  ~ ❯ polykey nodes connections -v                                                                                                                                2.7.7  09:51:57 PM
INFO:polykey.PolykeyClient:Creating PolykeyClient
INFO:polykey.PolykeyClient.Session:Creating Session
INFO:polykey.PolykeyClient.Session:Setting session token path to /Users/nguyen.nd/Library/Application Support/polykey/token
INFO:polykey.PolykeyClient.Session:Starting Session
INFO:polykey.PolykeyClient.Session:Started Session
INFO:polykey.PolykeyClient.Session:Created Session
INFO:polykey.PolykeyClient:Starting PolykeyClient
INFO:polykey.PolykeyClient.WebSocketClient:Create WebSocketClient to ::1:59698
INFO:polykey.PolykeyClient.WebSocketClient.WebSocketConnection 0:Start WebSocketConnection
INFO:polykey.PolykeyClient.WebSocketClient.WebSocketConnection 0:Started WebSocketConnection
INFO:polykey.PolykeyClient.WebSocketClient:Created WebSocketClient to wss://[::1]:59698
INFO:polykey.PolykeyClient:Started PolykeyClient
INFO:polykey.PolykeyClient:Created PolykeyClient
INFO:polykey.PolykeyClient.WebSocketClient.WebSocketConnection 0.WebSocketStream 0:Start WebSocketStream
INFO:polykey.PolykeyClient.WebSocketClient.WebSocketConnection 0.WebSocketStream 0:Started WebSocketStream
INFO:polykey.PolykeyClient.WebSocketClient.WebSocketConnection 0.WebSocketStream 0:Destroy WebSocketStream
INFO:polykey.PolykeyClient.WebSocketClient.WebSocketConnection 0.WebSocketStream 0:Destroyed WebSocketStream
host          	hostname	nodeIdEncoded                                        	port	timeout	usageCount
13.239.117.143	N/A     	vncm2mkk41vgp2fmplqiu1je7b2l3v6fhgltlqf5f3f85923ve0j0	1314	50718  	0
3.145.86.40   	N/A     	v6p14qcvvftnnscuavsehu37t22vfvnhse054pbkb3ehemmjsrdh0	1314	80813  	0
INFO:polykey.PolykeyClient:Stopping PolykeyClient
INFO:polykey.PolykeyClient.WebSocketClient:Destroy WebSocketClient on wss://[::1]:59698
INFO:polykey.PolykeyClient.WebSocketClient.WebSocketConnection 0:Stop WebSocketConnection
INFO:polykey.PolykeyClient.WebSocketClient:ErrorWebSocketConnectionLocal: WebSocket Connection local error - Locally closed with code 1000
INFO:polykey.PolykeyClient.WebSocketClient.WebSocketConnection 0:ErrorWebSocketConnectionLocal: WebSocket Connection local error - Locally closed with code 1000
INFO:polykey.PolykeyClient.WebSocketClient.WebSocketConnection 0:Stopped WebSocketConnection
INFO:polykey.PolykeyClient.Session:Stopping Session
INFO:polykey.PolykeyClient.Session:Stopped Session
INFO:polykey.PolykeyClient:Stopped PolykeyClient

  ~ ❯ polykey nodes ping                                                                                                                                          2.7.7  09:52:13 PM
error: missing required argument 'nodeId'

Usage: polykey nodes ping [options] <nodeId>

Ping a Node to check if it's Online

Arguments:
  nodeId                       Id of the node to ping

Options:
  -np, --node-path <path>      Path to Node State (default: "/Users/nguyen.nd/Library/Application Support/polykey", env: PK_NODE_PATH)
  -pf, --password-file <path>  Path to Password
  -f, --format <format>        Output Format (choices: "human", "json", default: "human")
  -v, --verbose                Log Verbose Messages (default: 0)
  -ni, --node-id <id>           (env: PK_NODE_ID)
  -ch, --client-host <host>    Client Host Address (env: PK_CLIENT_HOST)
  -cp, --client-port <port>    Client Port (env: PK_CLIENT_PORT)
  -h, --help                   display help for command

  ~ ❯ polykey nodes ping v5qm086kgr44brpo4s6m64eeb4n30klp237u4mtg4tbreqr7jghog                                                                                    2.7.7  09:52:56 PM
No response received
ErrorPolykeyCLINodePingFailed: No response received

  ~ ❯ polykey vaults list                                                                                                                                   16s  2.7.7  09:53:23 PM
myvault	zFhYHSQVmq9253GJ8sJbbfd

  ~ ❯ polykey identities list                                                                                                                                     2.7.7  09:56:10 PM
gestalt 1
permissions: notify
v5qm086kgr44brpo4s6m64eeb4n30klp237u4mtg4tbreqr7jghog
github.com:CryptoTotalWar

gestalt 2
permissions: None
vat2qqn2ksouqomadff65v8pi4mfc45fqbna3pl494jikgck3hqb0
github.com:duynguyen1105


  ~ ❯ polykey identities trust github.com:CryptoTotalWar                                                                                                          2.7.7  09:57:02 PM

  ~ ❯ polykey vaults scan v5qm086kgr44brpo4s6m64eeb4n30klp237u4mtg4tbreqr7jghog                                                                                   2.7.7  09:57:47 PM
ErrorPolykeyRemote: Remote error from RPC call
  localHost	::1
  localPort	61044
  remoteHost	::1
  remotePort	59698
  command	vaultsScan
  timestamp	Wed Apr 03 2024 21:58:39 GMT+0700 (Indochina Time)
  cause: ErrorNodeManagerConnectionFailed: Failed to find or establish a connection

  ~ ❯                                                                                                                                                       16s  2.7.7  09:58:39 PM

  ~ ❯                                                                                                                                                      ✘ INT  2.7.7  09:58:48 PM

  ~ ❯ polykey agent stop

Opened up 3rd terminal to continue gathering more data. Notice that we ran Polykey agent stop in the wrong terminal because technically its still running in the first terminal but was never properly shut down.

Last login: Wed Apr  3 22:03:01 on ttys031
  ~ ❯ polykey agent status                               2.7.7  10:03:22 PM
status	STOPPING
pid   	74009

  ~ ❯ polykey agent start --background                   2.7.7  10:03:54 PM
✔ Please enter the password … **********
pid       	48328
nodeId    	vat2qqn2ksouqomadff65v8pi4mfc45fqbna3pl494jikgck3hqb0
clientHost	::1
clientPort	61542
agentHost 	::
agentPort 	52216

  ~ ❯ polykey agent status                          8s  2.7.7  10:04:46 PM
status           	LIVE
pid              	48328
nodeId           	vat2qqn2ksouqomadff65v8pi4mfc45fqbna3pl494jikgck3hqb0
clientHost       	::1
clientPort       	61542
agentHost        	::
agentPort        	52216
upTime           	24
connectionsActive	4
nodesTotal       	2
version          	0.2.6
sourceVersion    	1.2.2-alpha.2
stateVersion     	1
networkVersion   	1
commitHash       	"e8cc798eca28562c5ebb99cc4cff06ef64fa596c\n"
libVersion       	1.2.2-alpha.2-1-1
libSourceVersion 	1.2.2-alpha.2
libStateVersion  	1
libNetworkVersion	1

  ~ ❯ polykey identities discover github.com:CryptoTotalWar

  ~ ❯ polykey identities list                            2.7.7  10:05:56 PM
gestalt 1
permissions: notify
v5qm086kgr44brpo4s6m64eeb4n30klp237u4mtg4tbreqr7jghog
github.com:CryptoTotalWar

gestalt 2
permissions: None
vat2qqn2ksouqomadff65v8pi4mfc45fqbna3pl494jikgck3hqb0
github.com:duynguyen1105


  ~ ❯ polykey vaults scan v5qm086kgr44brpo4s6m64eeb4n30klp237u4mtg4tbreqr7jghog
ErrorPolykeyRemote: Remote error from RPC call
  localHost	::1
  localPort	61638
  remoteHost	::1
  remotePort	61542
  command	vaultsScan
  timestamp	Wed Apr 03 2024 22:07:12 GMT+0700 (Indochina Time)
  cause: ErrorNodeManagerConnectionFailed: Failed to find or establish a connection

  ~ ❯ polykey vaults share myvault v5qm086kgr44brpo4s6m64eeb4n30klp237u4mtg4tbreqr7jghog
ErrorPolykeyRemote: Remote error from RPC call
  localHost	::1
  localPort	61663
  remoteHost	::1
  remotePort	61542
  command	vaultsPermissionSet
  timestamp	Wed Apr 03 2024 22:07:46 GMT+0700 (Indochina Time)
  cause: ErrorNodeManagerConnectionFailed: Failed to find or establish a connection

  ~ ❯ polykey vaults share myvault v5qm086kgr44brpo4s6m64eeb4n30klp237u4mtg4tbreqr7jghog
ErrorPolykeyRemote: Remote error from RPC call
  localHost	::1
  localPort	61749
  remoteHost	::1
  remotePort	61542
  command	vaultsPermissionSet
  timestamp	Wed Apr 03 2024 22:09:46 GMT+0700 (Indochina Time)
  cause: ErrorNodeManagerConnectionFailed: Failed to find or establish a connection

  ~ ❯ polykey identities discover github.com:CryptoTotalWar

  ~ ❯ polykey identities list                            2.7.7  10:09:50 PM
gestalt 1
permissions: notify
v5qm086kgr44brpo4s6m64eeb4n30klp237u4mtg4tbreqr7jghog
github.com:CryptoTotalWar

gestalt 2
permissions: None
vat2qqn2ksouqomadff65v8pi4mfc45fqbna3pl494jikgck3hqb0
github.com:duynguyen1105


  ~ ❯ polykey vaults share myvault v5qm086kgr44brpo4s6m64eeb4n30klp237u4mtg4tbreqr7jghog
ErrorPolykeyRemote: Remote error from RPC call
  localHost	::1
  localPort	61776
  remoteHost	::1
  remotePort	61542
  command	vaultsPermissionSet
  timestamp	Wed Apr 03 2024 22:10:14 GMT+0700 (Indochina Time)
  cause: ErrorNodeManagerConnectionFailed: Failed to find or establish a connection

Providing Terminal history from Pablo Here

This was the terminal history from when i created the fresh PK node from scratch with Brian

Terminal 1 window

rulerpablo@Pablos-MacBook-Air ~ % polykey agent start --fresh  
✔ Enter new password … ******
✔ Confirm new password … ******
pid         	19289
nodeId      	v5qm086kgr44brpo4s6m64eeb4n30klp237u4mtg4tbreqr7jghog
clientHost  	::1
clientPort  	64991
agentHost   	::
agentPort   	64446
recoveryCode	XXXX 

Terminal 2 Where Brian and I created a success case (benchmark)

Last login: Tue Apr  2 19:29:38 on ttys003
rulerpablo@Pablos-MacBook-Air ~ % polykey identities authenticate github.com
✔ Please enter the password … ******
url     	https://github.com/login/device
userCode	73AE-F6FE
CryptoTotalWar
rulerpablo@Pablos-MacBook-Air ~ % polykey identities claim github.com:CryptoTotalWar
Claim Id: 99d81e96a371aaa597ab95b7652b6e56
Url: https://gist.github.com/CryptoTotalWar/99d81e96a371aaa597ab95b7652b6e56
rulerpablo@Pablos-MacBook-Air ~ % polykey identities discover github.com:tegefaulkes
rulerpablo@Pablos-MacBook-Air ~ % polykey identities trust github.com:tegefaulkes
rulerpablo@Pablos-MacBook-Air ~ % polykey identities list
gestalt 1
permissions: None
v5qm086kgr44brpo4s6m64eeb4n30klp237u4mtg4tbreqr7jghog
github.com:CryptoTotalWar

gestalt 2
permissions: notify
vr7f1i0qi215gqibvv0mm2i0f9uatcpea1u6bhvtbavd833ueh1kg
github.com:tegefaulkes

rulerpablo@Pablos-MacBook-Air ~ % polykey vaults create myvault
Vault zNCaA3QC1ZJNedi9gMjFw3 created successfully
rulerpablo@Pablos-MacBook-Air ~ % cd Matrix_ai
rulerpablo@Pablos-MacBook-Air Matrix_ai % cd Demos
rulerpablo@Pablos-MacBook-Air Demos % polykey secrets create ./pablo_secret myvault:/secretfile
rulerpablo@Pablos-MacBook-Air Demos % polykey secrets get myvault:/secretfile
This is some secret api password
rulerpablo@Pablos-MacBook-Air Demos % polykey vaults scan vr7f1i0qi215gqibvv0mm2i0f9uatcpea1u6bhvtbavd833ueh1kg
ErrorPolykeyRemote: Remote error from RPC call
localHost	::1
localPort	65169
remoteHost	::1
remotePort	64991
command	vaultsScan
timestamp	Tue Apr 02 2024 19:39:30 GMT-0400 (Eastern Daylight Time)
cause: ErrorPolykeyRemote: Remote error from RPC call
  localHost	::
  localPort	64446
  remoteHost	::ffff:159.196.32.250
  remotePort	47873
  command	vaultsScan
  timestamp	Tue Apr 02 2024 19:39:30 GMT-0400 (Eastern Daylight Time)
  cause: ErrorVaultsPermissionDenied: Permission was denied - Scanning is not allowed for v5qm086kgr44brpo4s6m64eeb4n30klp237u4mtg4tbreqr7jghog
rulerpablo@Pablos-MacBook-Air Demos % polykey vaults share myvault v5qm086kgr44brpo4s6m64eeb4n30klp237u4mtg4tbreqr7jghog
ErrorPolykeyRemote: Remote error from RPC call
localHost	::1
localPort	65179
remoteHost	::1
remotePort	64991
command	vaultsPermissionSet
timestamp	Tue Apr 02 2024 19:40:08 GMT-0400 (Eastern Daylight Time)
cause: ErrorNodeManagerNodeIdOwn: NodeId is the same as the current node
rulerpablo@Pablos-MacBook-Air Demos % polykey vaults share myvault vr7f1i0qi215gqibvv0mm2i0f9uatcpea1u6bhvtbavd833ueh1kg
rulerpablo@Pablos-MacBook-Air Demos % polykey identities list
gestalt 1
permissions: None
v5qm086kgr44brpo4s6m64eeb4n30klp237u4mtg4tbreqr7jghog
github.com:CryptoTotalWar

gestalt 2
permissions: notify,scan
vr7f1i0qi215gqibvv0mm2i0f9uatcpea1u6bhvtbavd833ueh1kg
github.com:tegefaulkes

rulerpablo@Pablos-MacBook-Air Demos % polykey agent start --help
Usage: polykey agent start [options]

Start the Polykey Agent

Options:
-np, --node-path <path>                                      Path to Node State (default: "/Users/rulerpablo/Library/Application Support/polykey", env: PK_NODE_PATH)
-pf, --password-file <path>                                  Path to Password
-f, --format <format>                                        Output Format (choices: "human", "json", default: "human")
-v, --verbose                                                Log Verbose Messages (default: 0)
-rcf, --recovery-code-file <path>                            Path to Recovery Code
-ch, --client-host <host>                                    Client Host Address (env: PK_CLIENT_HOST)
-cp, --client-port <port>                                    Client Port (env: PK_CLIENT_PORT)
-ah, --agent-host <host>                                     Agent host (default: "::", env: PK_AGENT_HOST)
-ap, --agent-port <port>                                     Agent Port (default: 0, env: PK_AGENT_PORT)
--connection-timeout <ms>                                    Timeout value for connection establishment between nodes (default: 15000)
-sn, --seed-nodes [nodeId1@host:port;nodeId2@host:port;...]  Seed node address mappings (default: [{},true], env: PK_SEED_NODES)
-n --network <network>                                       Setting the desired default network. (default: "mainnet.polykey.com", env: PK_NETWORK)
-w --workers <count>                                         Number of workers to use, defaults to number of cores with `all`, 0 means all cores, `false`|`null`|`none`|`no` means no multi-threading (default: all)
-b, --background                                             Starts the agent as a background process
-bof, --background-out-file <path>                           Path to STDOUT for agent process
-bef, --background-err-file <path>                           Path to STDERR for agent process
--fresh                                                      Ignore existing state during construction (default: false)
--private-key-file <privateKeyFile>                          Override key creation with a private key JWE from a file
--password-ops-limit <passwordOpsLimit>                      Limit the password generation operations (choices: "min", "max", "interactive", "moderate", "sensitive", default: "moderate", env: PK_PASSWORD_OPS_LIMIT)
--password-mem-limit <passwordMemLimit>                      Limit the password generation memory (choices: "min", "max", "interactive", "moderate", "sensitive", default: "moderate", env: PK_PASSWORD_MEM_LIMIT)
-h, --help                                                   display help for command

Terminal 3 The Demo with Wen

Last login: Tue Apr  2 23:41:32 on ttys006
rulerpablo@Pablos-MacBook-Air ~ % polykey agent start --background     10:37:36
✔ Please enter the password … ******
pid       	46630
nodeId    	v5qm086kgr44brpo4s6m64eeb4n30klp237u4mtg4tbreqr7jghog
clientHost	::1
clientPort	64470
agentHost 	::
agentPort 	53874
rulerpablo@Pablos-MacBook-Air ~ % polykey identities discover github.com:duynguyen1105
rulerpablo@Pablos-MacBook-Air ~ % polykey identities trust github.com:duynguyen1105 
ErrorPolykeyRemote: Remote error from RPC call
localHost	::1
localPort	64476
remoteHost	::1
remotePort	64470
command	gestaltsGestaltTrustByIdentity
timestamp	Wed Apr 03 2024 10:38:47 GMT-0400 (Eastern Daylight Time)
cause: ErrorGestaltsGraphIdentityIdMissing: Could not find IdentityId
rulerpablo@Pablos-MacBook-Air ~ % polykey identities discover github.com:duynguyen1105
rulerpablo@Pablos-MacBook-Air ~ % polykey identities trust github.com:duynguyen1105 
rulerpablo@Pablos-MacBook-Air ~ % polykey identites list                                                      10:40:52
error: unknown command 'identites'
(Did you mean identities?)

Usage: polykey [options] [command]

Polykey CLI

Options:
-np, --node-path <path>      Path to Node State (default: "/Users/rulerpablo/Library/Application Support/polykey",
                             env: PK_NODE_PATH)
-pf, --password-file <path>  Path to Password
-f, --format <format>        Output Format (choices: "human", "json", default: "human")
-v, --verbose                Log Verbose Messages (default: 0)
-V, --version                output the version number
-h, --help                   display help for command

Commands:
bootstrap [options]          Bootstrap Keynode State
agent [options]              Agent Operations
nodes [options]              Nodes Operations
secrets [options]            Secrets Operations
keys [options]               Keys Operations
vaults [options]             Vaults Operations
identities [options]         Identities Operations
notifications [options]      Notifications Operations
help [command]               display help for command
rulerpablo@Pablos-MacBook-Air ~ % polykey identities list                                                     10:42:58
gestalt 1
permissions: None
v5qm086kgr44brpo4s6m64eeb4n30klp237u4mtg4tbreqr7jghog
github.com:CryptoTotalWar

gestalt 2
permissions: notify
vat2qqn2ksouqomadff65v8pi4mfc45fqbna3pl494jikgck3hqb0
github.com:duynguyen1105

gestalt 3
permissions: notify,scan
vr7f1i0qi215gqibvv0mm2i0f9uatcpea1u6bhvtbavd833ueh1kg
github.com:tegefaulkes

rulerpablo@Pablos-MacBook-Air ~ % polykey vaults list                                                         10:43:07
myvault	zNCaA3QC1ZJNedi9gMjFw3
rulerpablo@Pablos-MacBook-Air ~ % polykey secrets list myvault                                                10:44:16
secretfile
rulerpablo@Pablos-MacBook-Air ~ % polykey vaults share myvault vat2qqn2ksouqomadff65v8pi4mfc45fqbna3pl494jikgck3hqb0
ErrorRPCTimedOut: RPC has timed out
rulerpablo@Pablos-MacBook-Air ~ % polykey vaults scan vat2qqn2ksouqomadff65v8pi4mfc45fqbna3pl494jikgck3hqb0                                         10:49:33
ErrorRPCTimedOut: RPC has timed out
rulerpablo@Pablos-MacBook-Air ~ % polykey nodes connections -v                                                                                      10:50:52
INFO:polykey.PolykeyClient:Creating PolykeyClient
INFO:polykey.PolykeyClient.Session:Creating Session
INFO:polykey.PolykeyClient.Session:Setting session token path to /Users/rulerpablo/Library/Application Support/polykey/token
INFO:polykey.PolykeyClient.Session:Starting Session
INFO:polykey.PolykeyClient.Session:Started Session
INFO:polykey.PolykeyClient.Session:Created Session
INFO:polykey.PolykeyClient:Starting PolykeyClient
INFO:polykey.PolykeyClient.WebSocketClient:Create WebSocketClient to ::1:64470
INFO:polykey.PolykeyClient.WebSocketClient.WebSocketConnection 0:Start WebSocketConnection
INFO:polykey.PolykeyClient.WebSocketClient.WebSocketConnection 0:Started WebSocketConnection
INFO:polykey.PolykeyClient.WebSocketClient:Created WebSocketClient to wss://[::1]:64470
INFO:polykey.PolykeyClient:Started PolykeyClient
INFO:polykey.PolykeyClient:Created PolykeyClient
INFO:polykey.PolykeyClient.WebSocketClient.WebSocketConnection 0.WebSocketStream 0:Start WebSocketStream
INFO:polykey.PolykeyClient.WebSocketClient.WebSocketConnection 0.WebSocketStream 0:Started WebSocketStream
INFO:polykey.PolykeyClient.WebSocketClient.WebSocketConnection 0.WebSocketStream 0:Destroy WebSocketStream
INFO:polykey.PolykeyClient.WebSocketClient.WebSocketConnection 0.WebSocketStream 0:Destroyed WebSocketStream
host          	hostname	nodeIdEncoded                                        	port	timeout	usageCount
3.145.86.40   	N/A     	v6p14qcvvftnnscuavsehu37t22vfvnhse054pbkb3ehemmjsrdh0	1314	135414 	0
13.239.117.143	N/A     	vncm2mkk41vgp2fmplqiu1je7b2l3v6fhgltlqf5f3f85923ve0j0	1314	52815  	0
INFO:polykey.PolykeyClient:Stopping PolykeyClient
INFO:polykey.PolykeyClient.WebSocketClient:Destroy WebSocketClient on wss://[::1]:64470
INFO:polykey.PolykeyClient.WebSocketClient.WebSocketConnection 0:Stop WebSocketConnection
INFO:polykey.PolykeyClient.WebSocketClient:ErrorWebSocketConnectionLocal: WebSocket Connection local error - Locally closed with code 1000
INFO:polykey.PolykeyClient.WebSocketClient.WebSocketConnection 0:ErrorWebSocketConnectionLocal: WebSocket Connection local error - Locally closed with code 1000
INFO:polykey.PolykeyClient.WebSocketClient.WebSocketConnection 0:Stopped WebSocketConnection
INFO:polykey.PolykeyClient.Session:Stopping Session
INFO:polykey.PolykeyClient.Session:Stopped Session
INFO:polykey.PolykeyClient:Stopped PolykeyClient
rulerpablo@Pablos-MacBook-Air ~ % polykey nodes ping vat2qqn2ksouqomadff65v8pi4mfc45fqbna3pl494jikgck3hqb0 -v                                       10:51:15
INFO:polykey.PolykeyClient:Creating PolykeyClient
INFO:polykey.PolykeyClient.Session:Creating Session
INFO:polykey.PolykeyClient.Session:Setting session token path to /Users/rulerpablo/Library/Application Support/polykey/token
INFO:polykey.PolykeyClient.Session:Starting Session
INFO:polykey.PolykeyClient.Session:Started Session
INFO:polykey.PolykeyClient.Session:Created Session
INFO:polykey.PolykeyClient:Starting PolykeyClient
INFO:polykey.PolykeyClient.WebSocketClient:Create WebSocketClient to ::1:64470
INFO:polykey.PolykeyClient.WebSocketClient.WebSocketConnection 0:Start WebSocketConnection
INFO:polykey.PolykeyClient.WebSocketClient.WebSocketConnection 0:Started WebSocketConnection
INFO:polykey.PolykeyClient.WebSocketClient:Created WebSocketClient to wss://[::1]:64470
INFO:polykey.PolykeyClient:Started PolykeyClient
INFO:polykey.PolykeyClient:Created PolykeyClient
INFO:polykey.PolykeyClient.WebSocketClient.WebSocketConnection 0.WebSocketStream 0:Start WebSocketStream
INFO:polykey.PolykeyClient.WebSocketClient.WebSocketConnection 0.WebSocketStream 0:Started WebSocketStream
INFO:polykey.PolykeyClient.WebSocketClient.WebSocketConnection 0.WebSocketStream 0:Destroy WebSocketStream
INFO:polykey.PolykeyClient.WebSocketClient.WebSocketConnection 0.WebSocketStream 0:Destroyed WebSocketStream
No response received
INFO:polykey.PolykeyClient:Stopping PolykeyClient
INFO:polykey.PolykeyClient.WebSocketClient:Destroy WebSocketClient on wss://[::1]:64470
INFO:polykey.PolykeyClient.WebSocketClient.WebSocketConnection 0:Stop WebSocketConnection
INFO:polykey.PolykeyClient.WebSocketClient:ErrorWebSocketConnectionLocal: WebSocket Connection local error - Locally closed with code 1000
INFO:polykey.PolykeyClient.WebSocketClient.WebSocketConnection 0:ErrorWebSocketConnectionLocal: WebSocket Connection local error - Locally closed with code 1000
INFO:polykey.PolykeyClient.WebSocketClient.WebSocketConnection 0:Stopped WebSocketConnection
INFO:polykey.PolykeyClient.Session:Stopping Session
INFO:polykey.PolykeyClient.Session:Stopped Session
INFO:polykey.PolykeyClient:Stopped PolykeyClient
ErrorPolykeyCLINodePingFailed: No response received
rulerpablo@Pablos-MacBook-Air ~ % polykey idendities list                                                                                           10:53:19
error: unknown command 'idendities'
(Did you mean identities?)

Usage: polykey [options] [command]

Polykey CLI

Options:
-np, --node-path <path>      Path to Node State (default: "/Users/rulerpablo/Library/Application Support/polykey", env: PK_NODE_PATH)
-pf, --password-file <path>  Path to Password
-f, --format <format>        Output Format (choices: "human", "json", default: "human")
-v, --verbose                Log Verbose Messages (default: 0)
-V, --version                output the version number
-h, --help                   display help for command

Commands:
bootstrap [options]          Bootstrap Keynode State
agent [options]              Agent Operations
nodes [options]              Nodes Operations
secrets [options]            Secrets Operations
keys [options]               Keys Operations
vaults [options]             Vaults Operations
identities [options]         Identities Operations
notifications [options]      Notifications Operations
help [command]               display help for command
rulerpablo@Pablos-MacBook-Air ~ % polykey identities list                                                                                           10:54:47
gestalt 1
permissions: None
v5qm086kgr44brpo4s6m64eeb4n30klp237u4mtg4tbreqr7jghog
github.com:CryptoTotalWar

gestalt 2
permissions: notify
vat2qqn2ksouqomadff65v8pi4mfc45fqbna3pl494jikgck3hqb0
github.com:duynguyen1105

gestalt 3
permissions: notify,scan
vr7f1i0qi215gqibvv0mm2i0f9uatcpea1u6bhvtbavd833ueh1kg
github.com:tegefaulkes

rulerpablo@Pablos-MacBook-Air ~ % polykey identities scan vat2qqn2ksouqomadff65v8pi4mfc45fqbna3pl494jikgck3hqb0                                     10:54:58
error: unknown command 'scan'

Usage: polykey identities [options] [command]

Identities Operations

Options:
-np, --node-path <path>                       Path to Node State (default: "/Users/rulerpablo/Library/Application Support/polykey", env: PK_NODE_PATH)
-pf, --password-file <path>                   Path to Password
-f, --format <format>                         Output Format (choices: "human", "json", default: "human")
-v, --verbose                                 Log Verbose Messages (default: 0)
-h, --help                                    display help for command

Commands:
allow [options] <gestaltId> <permissions>     Allow Permission for Identity
authenticate [options] <providerId>           Authenticate a Digital Identity Provider
authenticated [options]                       Lists all authenticated identities across all providers
claim [options] <providerIdentityId>          Claim a Digital Identity for this Keynode
disallow [options] <gestaltId> <permissions>  Disallow Permission for Identity
discover [options] <gestaltId>                Adds a Node or Identity to the Discovery Queue
get [options] <gestaltId>                     Gets a Gestalt with a Node or Identity ID from the Gestalt Graph
list [options]                                List all the Gestalts in the Gestalt Graph
permissions [options] <gestaltId>             Gets the Permissions for a Node or Identity
search [options] [searchTerms...]             Searches a Provider for any Connected Identities
trust [options] <gestaltId>                   Trust a Keynode or Identity
untrust [options] <gestaltId>                 Untrust a Keynode or Identity
invite [options] <nodeId>                     invite another Keynode
help [command]                                display help for command
rulerpablo@Pablos-MacBook-Air ~ % polykey vaults list                                                                                               10:55:26
myvault	zNCaA3QC1ZJNedi9gMjFw3
rulerpablo@Pablos-MacBook-Air ~ % polykey vaults scan zFhYHSQVmq9253GJ8sJbbfd                                                                       10:56:04
ErrorPolykeyRemote: Remote error from RPC call
localHost	::1
localPort	64802
remoteHost	::1
remotePort	64470
command	vaultsScan
timestamp	Wed Apr 03 2024 10:56:27 GMT-0400 (Eastern Daylight Time)
cause: ErrorValidation: Input data failed validation - Node ID must be multibase base32hex encoded public-keys
rulerpablo@Pablos-MacBook-Air ~ % polykey vaults scan vat2qqn2ksouqomadff65v8pi4mfc45fqbna3pl494jikgck3hqb0                                         10:56:27
ErrorRPCTimedOut: RPC has timed out
rulerpablo@Pablos-MacBook-Air ~ % polykey identities trust github.com:duynguyen1105                                                                 10:57:11
rulerpablo@Pablos-MacBook-Air ~ % polykey vaults scan vat2qqn2ksouqomadff65v8pi4mfc45fqbna3pl494jikgck3hqb0                                         10:57:57
ErrorRPCTimedOut: RPC has timed out
rulerpablo@Pablos-MacBook-Air ~ %                                                                                                                   10:58:37
rulerpablo@Pablos-MacBook-Air ~ % polykey agent stop                                                                                                10:58:46
rulerpablo@Pablos-MacBook-Air ~ %                                                                                                                   10:58:52
rulerpablo@Pablos-MacBook-Air ~ % polykey agent status                                                                                              11:02:09
status	DEAD
rulerpablo@Pablos-MacBook-Air ~ % polykey agent start --background                                                                                  11:05:16
✔ Please enter the password … ******
pid       	52935
nodeId    	v5qm086kgr44brpo4s6m64eeb4n30klp237u4mtg4tbreqr7jghog
clientHost	::1
clientPort	64943
agentHost 	::
agentPort 	60974
rulerpablo@Pablos-MacBook-Air ~ % polykey agent status                                                                                              11:05:29
status           	LIVE
pid              	52935
nodeId           	v5qm086kgr44brpo4s6m64eeb4n30klp237u4mtg4tbreqr7jghog
clientHost       	::1
clientPort       	64943
agentHost        	::
agentPort        	60974
upTime           	4
connectionsActive	2
nodesTotal       	5
version          	0.2.6
sourceVersion    	1.2.2-alpha.2
stateVersion     	1
networkVersion   	1
commitHash       	"e8cc798eca28562c5ebb99cc4cff06ef64fa596c\n"
libVersion       	1.2.2-alpha.2-1-1
libSourceVersion 	1.2.2-alpha.2
libStateVersion  	1
libNetworkVersion	1
rulerpablo@Pablos-MacBook-Air ~ % polykey identities discover github.com:duynguyen1105                                                              11:05:33
rulerpablo@Pablos-MacBook-Air ~ % polykey identities list                                                                                           11:06:02
gestalt 1
permissions: None
v5qm086kgr44brpo4s6m64eeb4n30klp237u4mtg4tbreqr7jghog
github.com:CryptoTotalWar

gestalt 2
permissions: notify
vat2qqn2ksouqomadff65v8pi4mfc45fqbna3pl494jikgck3hqb0
github.com:duynguyen1105

gestalt 3
permissions: notify,scan
vr7f1i0qi215gqibvv0mm2i0f9uatcpea1u6bhvtbavd833ueh1kg
github.com:tegefaulkes

rulerpablo@Pablos-MacBook-Air ~ % polykey vaults share myvault vat2qqn2ksouqomadff65v8pi4mfc45fqbna3pl494jikgck3hqb0                                11:06:10
ErrorRPCTimedOut: RPC has timed out
rulerpablo@Pablos-MacBook-Air ~ % polykey identities discover github.com:duynguyen1105                                                              11:07:56
rulerpablo@Pablos-MacBook-Air ~ % polykey identities trust github.com:duynguyen1105                                                                 11:09:41
rulerpablo@Pablos-MacBook-Air ~ % polykey identities list                                                                                           11:09:57
gestalt 1
permissions: None
v5qm086kgr44brpo4s6m64eeb4n30klp237u4mtg4tbreqr7jghog
github.com:CryptoTotalWar

gestalt 2
permissions: notify
vat2qqn2ksouqomadff65v8pi4mfc45fqbna3pl494jikgck3hqb0
github.com:duynguyen1105

gestalt 3
permissions: notify,scan
vr7f1i0qi215gqibvv0mm2i0f9uatcpea1u6bhvtbavd833ueh1kg
github.com:tegefaulkes

rulerpablo@Pablos-MacBook-Air ~ % polykey vaults list                                                                                               11:10:05
myvault	zNCaA3QC1ZJNedi9gMjFw3
rulerpablo@Pablos-MacBook-Air ~ % polykey vaults share myvault vat2qqn2ksouqomadff65v8pi4mfc45fqbna3pl494jikgck3hqb0                                11:10:54
ErrorRPCTimedOut: RPC has timed out
rulerpablo@Pablos-MacBook-Air ~ %                                                                                                                   15:19:10

@tegefaulkes
Copy link
Contributor

tegefaulkes commented Apr 3, 2024

In both cases here it seems you're failing to connect to each other. Can you give me more details about the network each person is on?

If you could provide details about the following for each person.

  1. Type of network (wired, wifi, tethered to phone).
  2. Is it your internet or are you using a public accessible one?
  3. Type of NAT if you know how to find it. You may have to check your router/modem settings.
  4. If you have tailscale then provide the output of tailscale netcheck.

AS for more detail to why this is happening. If you can't connect to each other you can't really interact with each other. That means you can't clone vaults, send notification and by extension share a vault. We've done a lot of work to streamline making connections to each other without user input. But there are two main cases that we can't fully solve just by the nature of how networks work.

  1. We can't deal with symmetric NATs https://en.wikipedia.org/wiki/Network_address_translation#Methods_of_translation without user doing manual config. There are APIs where the program can negotiate ports with the NAT such as uPNP, PCP, PMP, but this is a planed feature and not always supported by the NAT. Right now if we're dealing with a symmetric NAT the user needs to open the port for Polykey manually.
  2. Can't automatically connect to nodes on the same local network if Multicast isn't enabled. Because of how routers work, we can't properly infer the information needed to automatically connect two nodes on the same network. It's a little confusing so I won't fully explain it, but we worked around this by using multicast to allow two nodes to discover each other. If multicast isn't enabled on the network then you need to manually configure the local address:port to connect to each other.

So unless we can rule out these two cases, I can't confidently claim that this is a bug except for the previously discussed poor feedback with the RPCTimedOutError.

@tegefaulkes
Copy link
Contributor

Oh and don't use -v when doing most CLI commands, they won't reveal anything useful here.

@CryptoTotalWar
Copy link

CryptoTotalWar commented Apr 3, 2024

Pablo's Environment

  1. Type of network (wired, wifi, tethered to phone). = WIFI
  2. Is it your internet or are you using a public accessible one? = My Home's Internet
  3. Type of NAT if you know how to find it. You may have to check your router/modem settings. = TBD
  4. If you have tailscale then provide the output of tailscale netcheck. = @tegefaulkes I have Tailscale installed. Show me and Wen later how to use it.

Wen's Environment @duynguyen1105

  1. Type of network (wired, wifi, tethered to phone). = TBD
  2. Is it your internet or are you using a public accessible one? = TBD
  3. Type of NAT if you know how to find it. You may have to check your router/modem settings. = TBD
  4. If you have tailscale then provide the output of tailscale netcheck. = @tegefaulkes I have Tailscale installed. Show me and Wen later how to use it.

@tegefaulkes
Copy link
Contributor

After today's meeting we pretty much confirmed that the problem was that @duynguyen1105 has a symmetric NAT. We currently have no way to automate a connection through one of these NATs so the problem is explicitly NOT a bug. We just don't support that kind of CAT.

In the future we'll add more features to work around these kinds of NATs such as automated port forwarding protocols such as uPNP, or relaying.

@CryptoTotalWar
Copy link

Going to Demo again with @asuarezop sometime on Wednesday:

  1. Since I have reset my cryptolinks and have a fresh node, we will re-do the demo.
  2. @tegefaulkes does Anthony also have to start a fresh node if his current node still lists my old node in the identities list?

@tegefaulkes
Copy link
Contributor

If you want to do everything from scratch then yeah, start the node fresh and delete the old cryptolinks gists. For the most part you want to retread the steps we took to determine if connections can be made between each other and if not, why not.

@CryptoTotalWar
Copy link

@tegefaulkes If user A using 1 node has already discovered user B via their github gestalt, but then user B creates a fresh node and a new cryptolink, I believe user A would still be viewing (In identities list) the old cryptolink (even if destroyed) along with the old node (even if abandoned). Is there a way that user A can delete a discovered identity in their identities list so that discovery can be re-run to show the new information associated with user B?

Copy link
Contributor

Right now we don't have the ability to do that. That said, there isn't any issue with having old nodes that don't exist anymore inside a gestalt. So you can re run discovery now and see the new links, but the old stale links will just persist within the gestalt.

I believe there's an issue handling revocation of cryptolinks. But that's not really a high priority at this moment.

@tegefaulkes
Copy link
Contributor

tegefaulkes commented May 29, 2024

This should be addressed by the bacgrounding notifications changes done by @amydevs in #168

We just need to verify this by testing with the CLI.

Copy link
Contributor

tegefaulkes commented May 29, 2024

This also has a duplicate in linear, I'm closing it.

@tegefaulkes tegefaulkes closed this as not planned Won't fix, can't repro, duplicate, stale May 29, 2024
@tegefaulkes tegefaulkes reopened this May 29, 2024
Copy link
Contributor

I did some manual testing and sharing with an offline node results in

Polykey-CLI on  feature-eng-152-secrets-edit-command-race-condtion [?] is 📦 v0.4.1 via  v20.5.1 via ❄  impure (nix-shell-env) took 3s 
❯ ts-node src/polykey.ts -np ./tmp/olo vaults share vault3 v5stggli819c1kibuegmajr9itftguhf9vam4bquc2obk9n6k34c0


So looks like this is done. If it was still a problem there would be a RPC timeout error.

@CMCDragonkai
Copy link
Member

What does it result in?

@tegefaulkes
Copy link
Contributor

The command completes with no issue.

@CMCDragonkai CMCDragonkai added the r&d:polykey:core activity 1 Secret Vault Sharing and Secret History Management label Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working r&d:polykey:core activity 1 Secret Vault Sharing and Secret History Management
Development

No branches or pull requests

4 participants