Sending money

A simple tutorial on how to set up and interact with Mel wallets.

This is a basic guide to melwallet-cli, Mel's reference implementation CLI wallet. We will be funding two testnet wallets and sending money from one to the other.

Setup and installation

Make sure you have the wallet installed. If not, follow this short guide.

Create wallets for Alice and Bob

In a terminal, create two testnet wallets at your selected path:

melwallet-cli --wallet-path ./alice.json create --network testnet
melwallet-cli --wallet-path ./bob.json create --network testnet

The wallets with their secrets are stored as unencrypted json documents on disk. Users and applications should take care to encrypt as needed.

Fund Alice's wallet

Let's use the faucet to print testnet MEL to fund our new testnet wallets. This command sends 1000 MEL to wallet alice and waits until the transaction is confirmed:

melwallet-cli --wallet-path ./alice.json send-faucet --wait

Send some money to Bob

Now, we transfer some MEL from alice to bob. First, obtain bob's address using

melwallet-cli --wallet-path ./bob.json summary

You should get output similar to

Network:  testnet
Address:  t7v9tegt6bm6dv9t6e56ktdap3ych5htw83wa69z0shwa7nt3xbkn0
Balances:

Send the money to bob:

melwallet-cli --wallet-path ./alice.json send --to <BOB_ADDRESS>,500.0 --wait

This command sends 500.0 MEL from alice to bob and waits for the transaction to confirm. When it returns, you have successfully sent MEL to bob!

Further reading

Sending a transaction is just one of the many things you can do with melwallet-cli. For more information, check it out on GitHub.

Last updated