How to Use zcash-cli — Easy Mode
by: Michael Harms
Update 2/23/20 — This tutorial applies to the full-node zcash-cli. If you’re using the light wallet, you can send to multiple recipients using the zecwallet-light-cli. (Windows/Linux/MacOS)
The command line is scary. It’s not super friendly looking, it’s hyped up in movies as an interface for only the most elite hacker. Do away with these preconceptions! The command line is 100% Not That Bad and a good tool to know in general. This article assumes a reader with zero knowledge and experience. By the end, you should be able to harness the power of the cli (command line interface) to do some powerful things using zcash-cli.
Basic Navigation
First things first: Your command line interface, whether it’s the Terminal on Mac OSX/Linux or Windows Powershell (chosen for consistent syntax), navigate in much the same way. You’ll first be navigating directories, as you already do in your OS. There are only TWO commands you need to know, “ls” and “cd”. Imprint these commands on your soul, and you’re pretty much good to go, at least for basic use, or a role in a hacker movie.
ls
Typing “ls” on its own (or “dir” on windows), then pressing enter will list the contents your current directory. In the above example, I’ve listed the contents of ~/Documents/Lambda/titanic . “~” means “home” in shorthand, and it’s useful to know. Were it not for the ~, I’d have added complexity and redundancy, because I’d be working (in Windows) in C:/Users/BrunchTime/Documents/Lambda/titanic .
cd
cd stands for “Change Directory.” I know where I can go because I used ls, now I’m navigating to a new directory using cd. This is effectively the same as you double-clicking a folder in your normal OS. I’m now “in” the public folder, and I can work with the files in there.
Congratulations, You’re Already Elite
You now know the majority of what you need to know. There are some platform-specific quirks to actually running programs from here, but you should be able to navigate any terminal you come across with the two above commands. Let’s use our new knowledge and run z_sendmany.
Generating and sending a z_sendmany command
I made this online tool to generate these big ugly commands quickly. (here’s an alternative Python implementation). Use them with your address book to generate a z_sendmany command.
Use your new command line skills (cd and ls) to navigate to the folder containing your up-to-date zcash-cli, make sure zcashd is running, and run the command. On Linux/OSX you will run zcash-cli with ./zcash-cli instead of zcash-cli per Windows. Disclaimer: These are only tested by one man on two machines. I’m excited to hear about and learn from any difficulties you may have using my software.
Is this actually useful?
I originally made this at the request of an anonymous user via shielded memo. Big shout out to you, whoever you are. Zcash allows encrypted messaging, and several enthusiastic hobbyists run newsletters. Choosing dozens of recipients, pasting transaction amounts, pasting memos is a tedious, error-prone process in a GUI wallet. (I recommend Zec Full Node for GUI wallet for other purposes).
Windows Weirdness
Windows has a command line character limit of ~8000 characters. I can’t figure out a good reason WHY, but this is SUPER limiting on z_sendmany . With a long memo and over a dozen recipients, you’re looking at 10k+ characters, easy. I have not sussed out how to get around this. People have suggested using Perl to make an RPC call which is probably a great solution, but is beyond my ken and schedule as yet. I just use Linux when I want to send a doozy.
The Future
In future I’d like to make this able to pull from more data than just a mailing list. Some sort of payroll calculation that sends unique amounts to each recipient based on work data and showing the payroll math in each memo would be super cool. There’s tons of exception handling to be added to make it a bit easier to use, but don’t be afraid to try things out.
Please contact me with any questions, critiques, or feedback! We all have much left to learn and we are on the same team! ❤
Or send encrypted ZEC memos to: zs1q4jdaenhv5pdn4uqn86qekt7j2dch66uuszyp05ywne8z7yh56dhqjekpqle72skfl8ycd86ew4
WRITTEN BY
Michael Harms
Crypto Enthusiast, Lambda School WEB23, Carnivore, Everyone’s Pal
by: Michael Harms
Originally Published here