passing the arg through stdin instead of as command line arg for dfx canister call
#2656
Replies: 10 comments
-
Just curious, which canister is not using Candid and why? |
Beta Was this translation helpful? Give feedback.
-
The registry is not using Candid, for instance. Why: I wasn't involved in the decision, I'm not sure. But I'm pretty sure that as long as it's allowed to use arbitrary bytes for their interfaces, some developers will do so. |
Beta Was this translation helpful? Give feedback.
-
A
|
Beta Was this translation helpful? Give feedback.
-
@nomeata I actually have the same FR for |
Beta Was this translation helpful? Give feedback.
-
Right, reading from a file or stdin is a useful feature, but it’s kinda orthogonal to Candid vs. Raw, isn’t it? |
Beta Was this translation helpful? Give feedback.
-
Oh, absolutely. It was just to give the motivation for this request. |
Beta Was this translation helpful? Give feedback.
-
Is this a “nice to have” or a “this would make my life better on a regular basis” for you? |
Beta Was this translation helpful? Give feedback.
-
I'm actually not sure. I like to do manual testing of code I write in addition to automated testing. With e.g. the registry canister, I have NEVER succeeded in calling it by hand (purely because of this issue, I believe). However:
So right now this PR is not a high priority for me. But I suspect the need will come again occasionally, maybe not during "pure coding" phases, but more in "let's make sure everything really works" or "debug stuff in prod" phases. |
Beta Was this translation helpful? Give feedback.
-
Well, let us know if the pain becomes bigger! |
Beta Was this translation helpful? Give feedback.
-
This is now available through the Example:
|
Beta Was this translation helpful? Give feedback.
-
Sometimes passing the argument as commend line flag is not so convenient.
Two cases are:
Canisters that take in raw binary data that is not Candid, and the caller wants to call some function to encode it. Using$(...) is not always easy. In the example of the registry canister, while I know I can encode in command line an argument, I never succeeded in wrapping it inside a $ (...), the shell is doing something that I don't want.
Reading from a file, when the argument is large. This applies to both raw binary and candid text representation.
I suggest that there is some flag to read the arg from stdin.
Beta Was this translation helpful? Give feedback.
All reactions