Run a Mega node (NEW)
A Mega node is similar to an Archive node in that that it can recover any Minima user that has lost access to their node or requires a re-sync to the chain.
A Mega node does not also have to be an archive node although the two can be run together on the same node.
What does it do?
A Mega node stores all unspent coins with their proofs, this differs to a standard node which only stores the coins (and proofs) that are relevant to the user.
A Mega node can:
- Re-sync another Minima node to the correct top block
- Restore another Minima node from a seed phrase
- Restore another Minima node from a backup (.bak file) no matter how old the backup is
The Mega node is not able to spend the coins it stores as it does not have the owner's private keys.
The Mega node does not get access to the recovering user's seed phrase or backup file at any point.
Use cases
Mega nodes can be for personal use or public use.
Personal Mega Node
Purpose: Personal recovery without relying on any third party
For example, if you run a node on a mobile device, you can run a separate Mega node on your laptop/desktop at home in case you lose your phone. In this situation, you could restore your mobile node from your Mega MMR node by using the seed phrase or a backup taken from the mobile node. To recover a node from your personal Mega node, both nodes must be on the same WiFi and you will need the local IP address of the Mega node.
Public Mega Node (server based)
Purpose: To assist other users in recovering their node
By running a Mega node on a server with a static public IP address, other users can use the ip:port of your Mega node to recover their node remotely.
System requirements
The following requirements are separate to any specs required for non Minima related processes.
Processing: 2 CPU
Memory: 8GB RAM
Storage: 5GB
We do not recommend running a Mega node from an Android device as the RAM consumption is considerably higher than a standard node.
The Mega node must be online constantly to remain in sync with the chain. Downtime of less than 24 hours is acceptable.
Ports
If running a Mega node on a desktop for personal use, no port forwarding is required.
If running a Mega node on a server for public use, open inbound/outbound connections on port 9001 (or the main custom Minima port you have chosen).
How to start a Mega node
If you have an existing node that you wish to change to a Mega node, first take a backup of your existing node, then stop the node, add the -megammr
start up parameter and restart the node.
If you used the -data
parameter to specify a data folder when starting your existing node, make sure you start the Mega node using the same data folder you chose originally.
1. Start (or update) a node
Start (or update) a node in the same way as as a normal node, adding the -megammr
startup parameter. See examples below.
- Command Line
- JNLP (Windows/Mac)
- Docker
Start a node as per the Run a Node section for desktop command line or Linux VPS.
When providing the start up parameters, include -megammr
as shown below
java -jar [path to minima.jar] -mdsenable -mdspassword YOURSECUREPASSWORD -megammr
Start a node as per the Run a Node section for Docker desktop or Linux VPS (Docker). However, when starting the container, add the following environment variable to the start up command:
-e minima_megammr=true
If you already have other Minima containers running, you can start a separate Mega node by changing the port
e.g. -p 6001-6003:9001-9003
Docker - Linux VPS
docker run -d -e minima_mdspassword=INSERTPASSWORD -e minima_server=true -e minima_megammr=true -v ~/megaminimadocker:/home/minima/data -p 9001-9003:9001-9003 --restart unless-stopped --name megaminima minimaglobal/minima:latest
Docker desktop - Windows
docker run -d -e minima_mdspassword=INSERTPASSWORD -e minima_desktop=true -e minima_megammr=true -v C:\Users\INSERTUSERNAME\megaminimadocker:/home/minima/data -p 9001-9003:9001-9003 --restart unless-stopped --name megaminima minimaglobal/minima:latest
Docker desktop - Mac/Linux
docker run -d -e minima_mdspassword=INSERTPASSWORD -e minima_desktop=true -e minima_megammr=true -v ~/megaminimadocker:/home/minima/data -p 9001-9003:9001-9003 --restart unless-stopped --name megaminima minimaglobal/minima:latest
2. Join the network
Once the node is running, you will need to join the Peer-to-Peer network, enter the following command from the Minima terminal/RPC client:
peers action:addpeers peerslist:https://spartacusrex.com/minimapeers.txt
Alternatively use your own list of peers.
You should see the response below, wait a few moments to receive the initial blockchain download.
{
"command":"peers",
"params":{
"action":"addpeers",
"peerslist":"https://spartacusrex.com/minimapeers.txt"
},
"status":true,
"pending":false,
"response":{
"message":"Peers added to checking queue.."
}
}
3. Chain sync or import historical data
A Mega node should be backfilled with the chain history so that the node has a complete database of all the coins since the blockchain started.
You can either:
Chain resync the Mega node from an Archive node, or
Import a MegaMMR
.mmr
file shared from another Mega node runner by running the following command from the Minima Terminal, RPC Client or Terminal MiniDapp.
Daily .mmr exports can be found here.
The .mmr file must have been generated no longer than 1 week ago.
Mega MMR import
megammr action:import file:[PathToFile]/megammr.mmr
Additional help
For additional information, you can use the Minima commands:
help command:megammr
help command:megammrsync