-
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
cmd/network: Extract absolute path of local endpoint in add-local #350
Conversation
✅ Deploy Preview for oasisprotocol-cli canceled.
|
598c7aa
to
5c33d25
Compare
cmd/network/add_local.go
Outdated
cobra.CheckErr(fmt.Errorf("malformed path in RPC endpoint: %w", err)) | ||
} | ||
net.RPC = parsedRPC.String() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While you're at it, can you also check whether parsedRPC.Opaque()
matches local file and print something like Warning: File ${parsedRPC.Opaque()} exists locally. Did you mean unix:${parsedRPC.Opaque()}?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, but parsedRPC.Opaque
comes from the original RPC endpoint, which has to start with unix:
anyway or the validation will fail. I'm not sure what this check is supposed to accomplish.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This bad UX existed before:
$ oasis net add test .oasis-node3/data_validator/internal.sock
Error: rpc error: code = Unavailable desc = name resolver error: produced zero addresses
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, but this is a totally different issue :) The original issue never mentioned adding this functionality to the add
command, just to add-local
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added the extra functionality, please retry :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also add the same behavior to add-local:
$ ./oasis net add-local test internal.sock
Error: rpc-endpoint 'internal.sock' is not local
afb1700
to
7e2165a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please append unix: for add-local as well. Otherwise looks good. Thanks!
7e2165a
to
9d951d5
Compare
Closes #273.