How to send properly zec using cli-wallet?


#1

Hello,
What is the best method for sending zec?

zcash-cli sendtoaddress

Returns me “insufficient funds”. I need to select an account from which I want to send.

Will someone please give me a hint here?
Thanks!


#2

Use zcash-cli z_sendmany see https://zcash-rpc.github.io/z_sendmany.html and there is more detail in the usage section of the docs: https://zcash.readthedocs.io/en/latest/rtd_pages/user_guide.html#usage

This allows you to send both shielded and transparent funds using the same command.

You could also use zcash-cli sendmany for only transparent addresses as per Bitcoin. Though I have never used zcash-cli sendtoaddress I’m guessing you could set the default account address using zcash-cli setaccount https://zcash-rpc.github.io/setaccount.html but all these account based calls have been deprecated so just stick with z_sendmany.


Zcash-cli z_sendmany question
#3

I saw this command but I supposed it’s for more than 2 transactions.Anyway thank you for helping me out here. I guess that’s the right command. Somehow I have this error when trying to execute the command zcash-cli z_sendmany "$ZADDR" "[{\"amount\": 0.8, \"address\": \"$FRIEND\"}]"

"status": "failed",
"error": {
  "code": -4,
  "message": "Witness for note commitment is null"

I guess I should reindex (thats what i found in google, but i hope for better solution)


#4

You might need to do that but for starters try starting zcashd with -rescan option when the node is already fully synced. This shouldn’t be too time consuming, assuming you don’t have loads of z addresses. I’m basing that on this comment: https://github.com/zcash/zcash/issues/2524#issuecomment-315107833

If that fails, yes I’d then try a -reindex.


#5

Well, -rescan didn’t work. Now I’m waiting for -reindex
I’ve stopped it once -reindex and now just started -zcashd, is that a problem? Should I start again -reindex?
p.s I tried once again to send zec and It showed me the same error (it is at 70% synced)


#6

Patience… its not going to work until its synced.


#7

Well, I still can’t sync it.
I did -rescan, it went to 72% then it froze. I did restart and start it normally with zcashd, it was downloading a few blocks in hours. So i decided to -rescan it again. Now it is at 56% and stuck, downloading a few blocks in hours but the percentage doesn’t go up.
Any ideas?


#8

The only sticky-sync problems I’ve had are on nodes with not enough memory… maybe that? How much do you have?


#9

6gb of Ram. I was thinking the same, but 6gb should be enough


#10

several times-reindex`` -rescan, justn zcashd on two different computers, downloading the blockchain get stuck at 55%. They both have 8gb of RAM. Any ideas? I am running the cli wallet on ubuntu in vmware.The vwmare machine has 7.1gb of RAM


#11

@jumparo I would just let it run, it’s probably hitting very big/full blocks at the 3xx,xxx block heights when some exchange decided to “sweep” literally thousands of transactions.

The sync isn’t just a simple download, it scans every blocks transactions. Also be sure to remove the -reindex or -rescan from your configuration file, it will take even longer next time you start if you start over again.

Edit, for clarification:

If your node is 100% synced and your balance is not correct then you should run -rescan to recheck your copy of the Blockchain.

If your local copy of the Blockchain is bad/ corrupted then the -reindex will start a new Blockchain download from block 1.

If you think it’s “stuck” you can always shut it down with ./src/zcash-cli stop and then restart it to reboot the node. But don’t stop/start it with the reindex/rescan options else it will just add more time to redo work that has already been done.


#12

thank you for the well described reply! I learned something new :slight_smile:
cheers!