It might be a stupid question, but I am trying to learn how to work with Near Protocol in Near academy.
In chapter 6, you have a task to login to NEAR using CLI, register yourself as a meme museum contributor and register your meme.
Link to the Chapter 6: https://near.academy/near101/chapter-6
I have an issue when I try to register the meme. I am getting an error:
Unknown argument: {meme : bingoo, title : telephonememe, data : https://9gag.com/gag/a718nWb, category : 4}
I am not sure why those arguments are percevied as unknown.
Here’s the code:
near call museum.testnet add_meme ‘{“meme” : “bingoo”, “title” : “telephonememe”, “data” : “https://9gag.com/gag/a718nWb”, “category” : 4}’ –accountId bingoo.testnet –amount 4
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
I’m using a windows machine, and I was getting the same error.
I tried a bunch of things and I saw this AWS post on host to use quotes in the aws cli: https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-parameters-quoting-strings.html
I think for windows you can’t use the single quotes around the json object, and you can’t do the for the newline. I would just one long string and the ” inside the json. like this:
near call museum.testnet add_meme "{"meme" : "bingoo", "title" : "telephonememe", "data" : "https://9gag.com/gag/a718nWb", "category" : 4}" --accountId bingoo.testnet --amount 4
I think this is why they recommend using wsl for windows in their github repo:
Windows
For Windows users, we recommend using Windows Subsystem for Linux (WSL).
Install WSL Install npm Install Node.js Change npm default directory This is to avoid any permission issues with WSL Open WSL and install near-cli globally by running: npm install -g near-cli
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0