CLI. Key import, sending tokens

Using CLI

1. To access Mina CLI commands :

sudo docker exec -it mina bash

The CLI is exited with the command:

exit

2. Checking status, node status:

mina client status

It looks like this:

Wait for the node to sync. The Sync status: field should say Synced. If the status says Catched, then you need to wait a little longer. After that you can start importing your keys.

3. Importing keys

Exporting the private key:

We import an account with a key with the following command:

The list of your accounts can be viewed with the command below:

4. Account unlocking:

First, let's export the Public Key:

Let's unlock the account so that you can move tokens:

In the password input field, write your password from the key and press ENTER.

5. Transactions

Now you can send tokens.

You need to add:

  • sender -sender

  • recipient -receiver

  • transaction fee -fee

  • the number of tokens sent -amount

Done. Tokens have been sent.

5.1. Transaction with -memo (with signature)

You need to add:

  • signature -memo

Your text for the transaction.

Done. Tokens have been sent.

6. Check the balance of tokens

The token balance is checked by the command below with your token ID:

We will see the balance of mina tokens.

7. Delegation transaction

You need to add:

  • sender -sender

  • recipient -receiver

  • transaction fee -fee

Flag -amount not specified, because the entire balance of the address is delegated.

Other Commands (NOT USED CURRENTLY)

1. Token creation

Now let's create tokens:

In response, we get the following:

2. Get the ID of the tokens

To carry out the following operations, we need to know the ID of the tokens. We get it with the following command:

In response, we get the following:

3. Mint tokens

To mince new tokens, you need to run the mint-tokens command. 1,000 tokens will be created in the account of the sender of the transaction under token ID 2.

Let's check the balance with the command (the balance will not appear immediately, you need to wait about 5 minutes):

After a while, we should see 1,000 coda tokens on our balance.

4. Sending tokens

Now you can send tokens. To do this, we first need to add a recipient with the command below:

For example, let's send 50 tokens. In the -memo "My First TX" field, instead of My First TX, you can enter anything you want. Or leave it as it is.

Done. Tokens have been sent.

Last updated

Was this helpful?