How to stake Mina from own Mina node (using command line)
How to install Linux?
To stake Mina from your command line without any intermediary entity, we recommend to install Ubuntu as one of the most user-friendly Linux distributions. You can find guides how to install Ubuntu here:
If you prefer some another Linux distribution to use for Mina staking, the steps below are similar.
How to stake Mina?
Launch terminal
Click Ctrl+Alt+T.
Linux terminal is opened. You can find a short guide of terminal commands for beginners here.
Create private key
At first, enter the following commands to install necessary packages:
Then install the key generator with the command:
Generate the key:
When creating keys, you will be asked to create a password.
Option 1 with a package:
Option 2 using docker:
Set necessary permissions:
Check private key
When checking the key, you will be asked to enter the password from it.
Option 1 with a package:
Option 2 using docker:
In both cases, if everything is ok with your keys, you will receive a message:
It means your keys have been verified.
Now let's write your public key to the server in the .bashrc
file so that we don't export them again next time.
Launch a node with Docker
Install Docker
Install and activate Docker:
Firewall configuration
If your VPS server has a built-in Firewall, then you should open ports 8302 and 8303 there.
If not, then follow the commands below:
Open ports 8302 and 8303:
Run a node
Variables description:
--name mina
- you can use any name for the container, or leave it as it is;
-block-producer-password "YOUR PASS"
- instead YOUR PASS
enter the password for your key.
$KEYPATH
- path to the file with the private key my-wallet
.
Optional:
--coinbase-receiver B62qp...
- flag to redirect block reward to another address.
Viewing logs with docker
View running containers:
Node container logs:
Node status:
Wait for the node to synchronize. The Sync status: field should say Synced (see the screenshot below). If the status says Catched, then you need to wait a little longer. After this you can start importing your keys.
Launch a node with Service
Firewall configuration
Open ports 22, 8302 and 8303 and activate the Firewall:
We check the status of open ports with the command:
If you do not have UFW installed on your server, install it using the command sudo apt install ufw
Node configuring
Downloading package Mina
:
Download the file with peers:
Setting up the mina-env
file:
We copy and paste the variables into the file after entering your password from the key instead of YOUR PASS FOR KEYS
:
Save ans exit: CTRL+S and CTRL+X
Start the service
Viewing logs:
Importing keys
We import an account with a key with the following command:
With Service:
With Docker:
The list of your accounts can be viewed with the command below:
Unlock the account
First, let's export the Public Key:
Let's unlock the account so that you can move tokens:
With Service:
With Docker:
In the password input field, write your password from the key and press ENTER.
Stake tokens
Use the following command template:
Example of the command above:
With Service:
With Docker:
Specify the following Mina fee amount depending on transaction speed you want:
Moderate speed is 0.01
Fast speed is 0.05
Very fast speed is 0.1
Tokens are on the journey to stake and will be used by the staking provider soon. Just wait for your Mina rewards from now. Don't be scared that your tokens are still visible on your balance. Physically Mina tokens are not moved to the staking provider from your wallet.
The whole balance of your address will be delegated into stake to a Mina validator.
The command above sends your Mina funds to StakeTab staking provider. If you want to stake Mina with another provider, you can select one on the Mina block explorer.
After delegation, you can stop your node running. There is no need for that after successful delegation.
Resources
There are much more options to stake Mina from your own node. For example, you can use Docker, set up TMUX and Snark stopper or update your node. For details, please see the How to stake Mina using own delegating node detailed guide.
Last updated