I have a canister that relies on arguments passed at initialization to pass values into the init function. I’m trying to Candid encode the values but running into the following:
This is what the Candid argument looks like
Basically the error is “Text must be in valid Base32 encoding”.
What am I doing wrong?
P.S. If I echo that command, I get a valid principal ID. Like this
Shells only do command interpolation (that’s what this is called) if you are in a
"..." string, but you’re in a
'...' string. If you use
" around your argument, it will work. But you’ll have to escape the
" in the string itself
So, like this?
"\"$(dfx identity get-principal)\""
\""$(dfx identity get-principal)"\"
Let me try both
I think I misunderstood what you explained.
Candid expects this:
'...' string (because the shell will interpret the above as two separate tokens):
"(principal \"$(dfx canister id user_index)\")"
So, after rereading what you said, I think I get it.
For anyone reading after, this is what the solution looks like: