How to send grin via v4 CLI wallet?

Could anyone give me a sample?


I tried v3 method send -m file -d my_grin_transaction.tx 10.1 got an error.

error: Found argument '10' which wasn't expected, or isn't valid in this context

USAGE:
    grin-wallet send --dest <dest> --manual

For more information try --help

m option is not method anymore but manually. Check grin-wallet help for more info.

Example below:

$ grin-wallet send -m 10

20200707 12:31:12.455 INFO grin_util::logger - log4rs is initialized, file level: Debug, stdout level: Debug, min. level: Debug
20200707 12:31:12.456 INFO grin_wallet - Using wallet configuration file at /Users/quentin/.grin/main/grin-wallet.toml
20200707 12:31:12.456 INFO grin_wallet - This is Grin Wallet version 4.0.0, built for x86_64-apple-darwin by rustc 1.44.0.
20200707 12:31:12.456 DEBUG grin_wallet - Built with profile "release", features "".
Password:
20200707 12:31:14.424 DEBUG grin_store::lmdb - DB Mapsize for /Users/quentin/.grin/main/wallet_data/db/lmdb is 134217728
20200707 12:31:14.426 DEBUG grin_wallet_impls::lifecycle::seed - Using wallet seed file at: /Users/quentin/.grin/main/wallet_data/wallet.seed


Transaction file was output to:

/Users/quentin/.grin/main/slatepack/28f77086-41a5-4854-bd93-bd72d81517bc.S1.slatepack
3 Likes

So, I’ve tried below.

Sender:

grin-wallet send -m 10 

This created 8c4d6408-e16c-4e5f-9bae-0319dfc8f36e.S1.slatepack.

Receiver:

grin.wallet receive -m -i 8c4d6408-e16c-4e5f-9bae-0319dfc8f36e.S1.slatepack
Password: 
Wallet command failed: LibWallet Error: I/O error

Not sure if this helps or anything, maybe I dont understand at all, but https://github.com/mimblewimble/grin-wallet/issues/456 indicates that v4 slatepacks wont be live until after the fork, if you want to use them now you have to pass through a flag. Maybe -m makes v4 slates automatically but without the flag you cant receive it, no idea, but it is probably something about v4 slates vs others.

1 Like

No issues on my side.

❯ grin-wallet send -m 10

20200708 10:24:12.408 INFO grin_util::logger - log4rs is initialized, file level: Debug, stdout level: Debug, min. level: Debug
20200708 10:24:12.409 INFO grin_wallet - Using wallet configuration file at /Users/quentin/.grin/main/grin-wallet.toml
20200708 10:24:12.409 INFO grin_wallet - This is Grin Wallet version 4.0.0, built for x86_64-apple-darwin by rustc 1.44.0.
20200708 10:24:14.605 INFO grin_wallet_controller::command - Tx created: 10.000000000 grin to default (strategy 'smallest')
20200708 10:24:15.010 DEBUG grin_wallet_libwallet::internal::selection - Change amount is: 4232971084

Transaction file was output to:

/Users/quentin/.grin/main/slatepack/ac409f06-fe90-4406-9b10-18dd996f6686.S1.slatepack

Please send this file to the other party manually
Command 'send' completed successfully

~
❯ grin-wallet receive -m -i /Users/quentin/.grin/main/slatepack/ac409f06-fe90-4406-9b10-18dd996f6686.S1.slatepack

20200708 10:24:26.261 INFO grin_util::logger - log4rs is initialized, file level: Debug, stdout level: Debug, min. level: Debug
20200708 10:24:26.262 INFO grin_wallet - Using wallet configuration file at /Users/quentin/.grin/main/grin-wallet.toml
20200708 10:24:26.262 INFO grin_wallet - This is Grin Wallet version 4.0.0, built for x86_64-apple-darwin by rustc 1.44.0.
20200708 10:24:26.262 DEBUG grin_wallet - Built with profile "release", features "".

Transaction file was output to:

/Users/quentin/.grin/main/slatepack/ac409f06-fe90-4406-9b10-18dd996f6686.S2.slatepack

Please send this file to the other party manually
Command 'receive' completed successfully

I notice that you are using the snap version on Ubuntu. Let me try this myself.

Are you sure you are inputing the full path of the slatepack? Doesn’t seems so in your example.

I tried on windows, it seems work.But this error persists on ubuntu, i installed by snap install grin.

grin.wallet finalize -i /home/oenenfe/14e457b7-2660-4103-9f54-cec131b23fad.S2.slatepack
Password: 
Wallet command failed: LibWallet Error: I/O error

I moved 14e457b7-2660-4103-9f54-cec131b23fad.S2.slatepack into /home/oenenfe/snap/grin/current/.grin/main/slatepack. then it workes. Thanks alot.

@quentinlesceller can I send grin by http/https on v4?

moreover, what does the S3.slatepack use for?

See here https://docs.rs/grin_wallet_libwallet/4.0.0/grin_wallet_libwallet/enum.SlateState.html for the slate state.