Overview of MAYANodes
MAYANodes service the MAYAChain network. Each MAYANode is comprised of several independent servers in a cluster. All MAYANodes communicate and operate in cooperation to create a cross-chain swapping network.
Running a node is a serious undertaking. While Node Operators are well compensated for running a node, there are also risks, skills required and costs.
See the Node Operator 101 Video to learn more before running a node.
To set up a node, you have three choices:
Set up manually (not recommended unless you are an expert)
Set up via Kubernetes (recommended)
Set up via Provider (coming soon).
Each MAYANode is comprised of 5 major components.
mayanode
- this is a daemon that runs the MAYAChain chain itself and a HTTP server, that gives a RESTful API to the chain.
bifrost
- this daemon creates connections to remote chains (like Bitcoin, Ethereum, Binance, etc) to both observe activity on those chains (incoming/outgoing transactions), and also sign/broadcast outgoing transactions (moving funds on remote chains).
gateway
: MAYANode gateway proxy to get a single IP address for multiple deployments
midgard
- this daemotn is a layer 2 REST API that provides front-end consumers with semi real-time rolled up data and analytics of the MAYAChain network. Most requests to the network will come through Midgard. This daemon is here to keep the chain itself from fielding large quantities of requests. You can think of it as a “read-only slave” to the chain. This keeps the resources of the network focused on processing transactions.
Full nodes - for every chain that is supported by the network, each MAYANode operator will run their own full node of each chain (Bitcoin, Ethereum, Binance, etc).
As new nodes join/leave the network, this triggers a “churning event”. Which means the list of validators that can commit blocks to the chain changes, and also creates a new Asgard vault, while retiring an old one. All funds in this retiring vault are moved to the new Asgard vault.
Normally, a churning event happens every 3 days (50,000 blocks), although it is possible for it to happen more frequently (such as when a node optionally requests to leave the network using the LEAVE
memo).
On every churn, the network selects one or more nodes to be churned out of the network (which can be typically churned back in later). In a given churning event, multiple nodes may be selected to be churned out, but never more than 1/3rd of the current validator set. The criterion the network will take into account is the following:
Requests to leave the network (self-removal)
Banned by other nodes (network-removal)
How long an active nodes has been committing blocks (oldest gets removed)
Bad behavior (accrued slash points for poor node operation)
On every churn, the network may select one or more nodes to be churned into the network but never adds more than one to the total. Which nodes that are selected are purely by validator bond size. Larger bond nodes are selected over lower bond nodes.
There is an endpoint on Midgard that has deep analytics in mean and median active & standby bond sizes to drive efficient discovery of the best "bond" size. Maya's minimum bond is currently: 100K Cacao (MIMIR Override).
The network is safe when it is over-bonded, but shrewd Node Operators will probably actively manage their bond and pool part of it instead to maximize yield.
Deciding to run a node should be carefully considered and thought through. While the payoffs/rewards can be significant, there can also be an equally significant cost.
To run a node, you must obtain a significant amount of LP, and minimums apply. This CACAO is sent into the network as a “bond” and held as leverage on each node to ensure they behave in the best interest of the network.
Running a malicious node or stealing from the network results in a slashing of this bond. Here are the ways in which a validator’s bond can get slashed.
Double Sign (5% of minimum bond) - if it is observed that a single validator node is committing blocks on multiple chains. To avoid this, never run two nodes with the same node account at the same time.
Unauthorized transaction (1.5x transaction value) - if a node sends funds without authorization, the bond is slashed 1.5x the value of the stolen funds. The slashed bond is dumped into the pool(s) where the funds were stolen and added to the reserve.
Bond slashing takes directly from the bond and does not affect rewards.
When a node is active, it earns rewards from the network in CACAO. Sufficient rewards are required to be earned for a Validator to be profitable. Running an unreliable node results in rewards being slashed. Here are the ways in which a validator’s rewards can be slashed.
Not Observing (2 slash pts) - if a node does not observe transactions for all chains while other nodes do, they get slash points added.
Not signing a transaction (600 slash pts) - if a node does not sign an outbound transaction, as requested by the network, they will get slash points added.
Fail to keygen (1 hr of revenue) - When the network attempts to churn and attempts to create a new Asgard pubkey for the network and fails to do so due to a specific node(s), they will lose 1 hr of revenue from their bond.
Slash points undo profits made on the network. For every 1 slash point a node receives, they lose 1 block of rewards. Rewards slashing reduces earned rewards and does not affect a validator’s bond.
Node Operators receive rewards if they are bonded and active on the network and are paid out in Cacao. While revenue is generated every block (every 5 seconds) to each operator, those funds are not available to the operator until they churn out of the network. Over time, this incentive increases the median bonded amount, increases the network's security, and allows the network to grow. They're claimed whenever a node leaves the network. See Keeping Track of Rewards below for more details.
Rewards are affected by Incentive Curve. The Incentive Pendulum increases and decreases the amount of CACAO allocated to nodes according to the security and capital leverage of the network.
Dynamic Inflation adds up to rewards. When the system is healthy, there is no inflation; should LPs withdraw CACAO considerably, inflation starts to kick in to incentivize pooled liquidity.
When a node joins the network, the current block height is recorded. The system creates one block unit for every active node for every active block and has a running total of the block units created. When a node leaves, it cashes in its block units for a portion of the bond rewards. The spent block units are destroyed.
For example, there are 10000 CACAO in bond rewards outstanding. Node A has been active for 30 blocks and has 33 block units but accrued 3 slash points. There are 1000 block units in total. Node A leaves the network and cash in its 30 block units (33 - 3). It receives 300 CACAO ((30/1000) * 10000), leaving 9700 CACAO in node rewards. Its 33 block units are destroyed, leaving 967 block units left.
Depending on how the node was set up, it will likely cost between $1000 and $2000 per month, potentially more as the blockchain scales. The main driver of costs is resource allocation to hosting each MAYANode service.
Running a MAYANode is no simple task. As an operator, you must run/maintain multiple Linux servers with extremely high uptime. It is encouraged that only professional systems engineers run nodes to maintain the highest quality, reliability, and security of the network. The simple question to know if you have the skillsets to run a MAYANode is:
Have you used pagerduty before?
If the answer is no, it’s probably best not to run a node and participate in the network in other ways. The following skill sets are required to be an effective node operator.
Advanced knowledge of Linux server administration and security
Advanced knowledge of Kubernetes
Advanced experience running a host of nodes on a hosted platform such as AWS, Google Cloud, Digital Ocean, etc
Knowledge of running full nodes for other chains such as Bitcoin, Ethereum, and Binance.
Willingness to be “on call” at all times to respond to issues when/if your node becomes unavailable
When you run a MAYANode, each MAYANode will have its own node account. An example node account looks like this:
Most importantly, this will tell you how many slash points the node account has accrued, their status, and the size of their bond (which is in 1e8 notation, 1 Cacao == 100000000).
Types of node status:
Unknown - this should never be possible for a valid node account
Whitelisted - node has been bonded, but hasn’t set their keys yet
Standby - waiting to have minimum requirements verified to become “ready” status. This check happens on each churn event (3 days on average).
Ready - node has met minimum requirements to be churned and is ready to do so. Could be selected to churn into the network. Cannot unbond while in this status.
Active - node is an active participant of the network, by securing funds and committing new blocks to the MAYAChain blockchain. Cannot unbond while in this status.
Disabled - node has been disabled by use of LEAVE, and cannot re-join.
To get node account information, make an HTTP call to your maya-api
port which will look like the following:
MAYANodes have the ability to vote on Mimir settings.
Mimir settings have specific abilities. The process for voting from a Node is:
Mimir keys and values are listed in the Mimir endpoint.
A node can vote at any time on any key value.
A node's vote is valid as long as they are active (and removed if they are not).
2/3rds of active nodes need to agree for the change to happen
If 2/3rds consensus is not reached, Mimir admin takes priority, or a constant if present.
A node can change its vote anytime.
A node can delete its vote by using -1 value
Voting costs one native transaction fee, which is deducted from their bond.
Deploying a MAYANode with Kubernetes
In order to deploy all the different services and provide a high availability environment to operate your node, Kubernetes is the preferred scheduling platform. Any production-grade Kubernetes cluster can be used to run and deploy a MAYANode. You need your Kubernetes provider to offer external load balancers services type features. Azure, Digital Ocean, GCE, OpenStack are compatible with external load balancers.
Terraform is a type of domain-specific language (DSL) used to describe code infrastructure. It is designed to make it easier to create/destroy infrastructure hosted locally or by a provider.
This Terraform deployment will deploy a Kubernetes cluster using your VPS provider credentials and EKS service. The cluster will have autoscaling capabilities, which means you don’t have to deal with how many nodes you need to deploy to run your MAYANode services.
All the default configurations used in these instructions are for a production environment with enough resources to run your MAYANode in good conditions.
LINUX/MAC is the preferred method of setup.
Windows should choose either:
Deploy a MAYANode from a Linux VPS.
Use Windows Subsystem for Linux - https://docs.microsoft.com/en-us/windows/wsl/about
There are three important steps to getting your node set up, deployed and churned in.
Your repository should be organised as follows:
All of your set up commands are run in cluster-launcher
and all of your deploying/joining/managing/leaving commands are run from node-launcher
To prevent a catastrophic mistake in handling multiple nodes, checkout the daemons branch of the node-launcher and preferrably use different repos for each node configuration.
All of your commands can now be run separately.
It is heavily advised to not set up nodes on the same provider. Deploy 1 node on Azure, 1 node on Digital Ocean etc.
Setting up a Kubernetes Cluster with Linode (linode)
a Linode account
linode-cli
and linode credentials configured
kubectl
LINUX/MAC is the preferred method of setup.
Windows should choose either:
Deploy a MAYANode from a Linux VPS.
Use Windows Subsystem for Linux - https://docs.microsoft.com/en-us/windows/wsl/about****
To install the linode-cli (Linode CLI), follow these instructions.
You need to have pip (python) on your system.
Create a Linode API token for your account with read and write access from your profile page. The token string is only displayed once, so save it in a safe place.
Use the API token to grant linode-cli access to your Linode account. Pass in the token string when prompted by linode-cli.
To install the kubectl (Kubernetes CLI), follow these instructions or choose a package manager based on your operating system.
MacOS:
Use the package manager homebrew to install kubectl.
Windows:
Use the package manager Chocolatey to install kubectl.
To install the wget, follow these instructions or choose a package manager based on your operating system.
MacOS:
Use the package manager homebrew to install wget.
Windows:
Use the package manager Chocolatey to install wget.
Use the commands below to deploy a Kubernetes cluster.
You can run the make command that automates those command for you like this:
Or manually run each commands:
Now that you've provisioned your Kubernetes cluster, you need to configure kubectl.
To configure authentication from the command line, use the following command, substituting the ID of your cluster.
Note: If the above
linode-cli
command is broken you can download the file from the web dashboar for the respective cluster.
This replaces the existing configuration at ~/.kube/config.
Once done, you can check your cluster is responding correctly by running the command:
To destroy and remove previously created resources, you can run the command below.
Or run the commands manually:
Setting up a Kubernetes Cluster with Azure (AKS)
Azure account
az
and Azure credentials configured
kubectl
LINUX/MAC is the preferred method of setup.
Windows should choose either:
Deploy a MAYANode from a Linux VPS.
Use Windows Subsystem for Linux - https://docs.microsoft.com/en-us/windows/wsl/about****
Firstly, clone and enter the cluster-launcher repository. All commands in this section are to be run inside this repo.
Then install the terraform CLI:
Install Terraform:
The Azure CLI allows you to manage your Azure services.
Use the package manager homebrew to install the Azure CLI.
You will be asked for you Personal Access Token with read/write priveleges (retrieve from API Panel from the Azure web console.)
API -> Tokens/Keys -> Create Token.
Make sure you handle your secrets securely!
You must install and configure the Kubernetes CLI tool (kubectl). **To install kubectl** , follow these instructions, or choose a package manager based on your operating system.
Use the package manager homebrew to install kubectl.
You also need wget and jq, follow these instructions, or choose a package manager based on your operating system.
Use the package manager homebrew to install wget and jq Note: You most likely have these installed already.
Use the commands below to deploy an AKS cluster:
During the deploy, you will be asked to enter information about your cluster:
Location -- az account list-locations -o table
Name
Confirm yes
Deploying a cluster takes ~15 minutes
Now that you've provisioned your AKS cluster, you need to configure kubectl. Customize the following command with your cluster name and resource group. It will get the access credentials for your cluster and automatically configure kubectl.
This replaces the existing configuration at ~/.kube/config.
Once done, you can check if your cluster is responding correctly by running the following commands.
You are now ready to deploy a MAYANode.
Setting up a Kubernetes Cluster with Hetzner Dedicated Servers
This guide for Hetzner Bare Metal is WIP and not currently recommended. Proceed with caution until an update is released and this warning removed.
Checkout the repository source to manage a cluster of dedicated servers on Hetzner.
The scripts in this repository will set up and maintain one or more kubernetes clusters consisting of dedicated Hetzner servers. Each cluster will also be provisioned to operate as a node in the MAYACHain network.
Executing the scripts in combination with some manual procedures will get you highly available, secure clusters with the following features on bare metal.
Acquire a couple of servers as the basis for a cluster (AX41-NVME
's are working well, for instance). Visit the admin panel and name the servers appropriately.
Refer to the reset procedure to initialize them properly.
Create a vSwitch and order an appropriate subnet (it may take a while to show up after the order). Give the vSwitch a name (i.e. ma-k8s-net
) and assign this vSwitch to the servers.
Check out the docs for help.
Clone this repository cd
into it and download kubespray.
Create a Python virtual environment or similar.
Install dependencies required by Python and Ansible Glaxy.
Note: Mitogen does not work with ansible collections and the strategy must be changed (i.e.
strategy: linear
).
Create a deployment environment inventory file for each cluster you want to manage.
Edit the inventory file with your server ip's and network information and customize everything to your needs.
Check this out for more playbooks on cluster management.
For the cluster to operate as a node in the MAYACHain network, deploy as instructed here. You can also refer to the node-launcher repository, if necessary, or the MAYAChain documentation as a whole.
This will install and use Ubuntu 20.04 on only one of the two internal NVMe drives. The unused ones will be used for persistent storage with ceph/rook. You can check the internal drive setup with lsblk
. Change it accordingly in the command shown above when necessary.
Visit the console and put each server of the cluster into rescue mode. Then execute the following script.
Create a pristine state by running the playbooks in sequence.
Instantiate the servers.
Setting up a Kubernetes Cluster with GCP (GKE)
GCP account
gcloud
and GCP credentials configured
kubectl
LINUX/MAC is the preferred method of setup.
Windows should choose either:
Deploy a MAYANode from a Linux VPS.
Use Windows Subsystem for Linux - https://docs.microsoft.com/en-us/windows/wsl/about****
Firstly, clone and enter the cluster-launcher repository. All commands in this section are to be run inside this repo.
Then install the terraform CLI:
Install Terraform:
The gcloud CLI allows you to manage your GCP services.
Use the package manager homebrew to install the GCP CLI.
After the installation, perform the steps outlined below. This will authorize the SDK to access GCP using your user account credentials and add the SDK to your PATH. It requires you to log in and select the project you want to work in. Then add your account to the Application Default Credentials (ADC). This will allow Terraform to access these credentials to provision resources on GCP. Finally, you need to enable the Compute Engine and Kubernetes Engine API services for your GCP project.
You will be asked for your Personal Access Token with read/write privileges (retrieved from API Panel from the GCP web console.)
API -> Tokens/Keys -> Create Token.
Make sure you handle your secrets securely!
You must install and configure the Kubernetes CLI tool (kubectl). **To install kubectl** , follow these instructions, or choose a package manager based on your operating system.
Use the package manager homebrew to install kubectl.
You also need wget and jq, follow these instructions, or choose a package manager based on your operating system.
Use the package manager homebrew to install wget and jq Note: You most likely have these installed already.
Use the commands below to deploy an GKE cluster:
During the deployment, you will be asked to enter information about your cluster:
Project ID
Zone -- gcloud compute zones list
Confirm yes
Deploying a cluster takes ~15 minutes
Now that you've provisioned your GKE cluster, you need to configure kubectl. The following command will get the access credentials for your cluster and automatically configure kubectl.
This replaces the existing configuration at ~/.kube/config.
Once done, you can check if your cluster is responding correctly by running the following commands.
You are now ready to deploy a MAYANode.
Setting up a Kubernetes Cluster with Hetzner Cloud (hcloud)
This approach is only recommended for experienced operators because the kubernetes control plane among other things needs to be managed manually.
hcloud account
hcloud
and hcloud credentials configured
kubectl
ansible
LINUX/MAC is the preferred method of setup.
Windows should choose either:
Deploy a MAYANode from a Linux VPS.
Use Windows Subsystem for Linux - https://docs.microsoft.com/en-us/windows/wsl/about****
Firstly, clone and enter the cluster-launcher repository. All commands in this section are to be run inside this repo.
Then install the terraform CLI:
Install Terraform:
The hcloud CLI allows you to manage your hcloud services.
Use the package manager homebrew to install the hcloud CLI.
You will be asked for you Personal Access Token with read/write priveleges (retrieve from API Panel from the hcloud web console.)
API -> Tokens/Keys -> Create Token.
Make sure you handle your secrets securely!
You must install and configure the Kubernetes CLI tool (kubectl). **To install kubectl** , follow these instructions, or choose a package manager based on your operating system.
Use the package manager homebrew to install kubectl.
You also need wget and jq, follow these instructions, or choose a package manager based on your operating system.
Use the package manager homebrew to install wget and jq Note: You most likely have these installed already.
Initialize the git submodule.
Use direnv
, venv
or whatever you prefer to manage a python environment inside the hcloud folder.
Install dependencies required by Python and Ansible Galaxy.
Use the commands below to deploy an hcloud cluster:
During the deploy, you will be asked to enter information about your cluster:
Name
Token
Confirm yes
Deploying a cluster takes ~15 minutes
If necessary, request a quota increase here.
Now that you've provisioned your hcloud cluster, you need to configure kubectl. Customize the following command with your cluster name and resource group. It will get the access credentials for your cluster and automatically configure kubectl.
You are now ready to deploy a MAYANode.
Setting up a Kubernetes Cluster with Digital Ocean (DO)
DO account
doctl
and DO credentials configured
kubectl
LINUX/MAC is the preferred method of setup.
Windows should choose either:
Deploy a MAYANode from a Linux VPS.
Use Windows Subsystem for Linux - https://docs.microsoft.com/en-us/windows/wsl/about****
Firstly, clone and enter the cluster-launcher repository. All commands in this section are to be run inside this repo.
Then install the terraform CLI:
Install Terraform:
The Digital Ocean Control tool allows you to manage your DO services.
Use the package manager homebrew to install the DO CTL.
You will be asked for you Personal Access Token with read/write priveleges (retrieve from API Panel from the Digital Ocean web console.)
API -> Tokens/Keys -> Create Token.
Make sure you handle your secrets securely!
You must install and configure the Kubernetes CLI tool (kubectl). **To install kubectl** , follow these instructions, or choose a package manager based on your operating system.
Use the package manager homebrew to install kubectl.
You also need wget and jq, follow these instructions, or choose a package manager based on your operating system.
Use the package manager homebrew to install wget and jq Note: You most likely have these installed already.
Use the commands below to deploy a DOKS cluster:
During the deploy, you will be asked to enter information about your cluster:
Name
DO Region -- see valid List of Regions (use lower-case)
Confirm yes
Final success message: Apply complete! Resources: 2 added, 0 changed, 0 destroyed.
Deploying a cluster takes ~10 minutes
Now that you've provisioned your DOKS cluster, you need to configure kubectl. Customize the following command with your cluster name and region.
If successful, you will see:
Test this configuration,
To verify, run this, and check the status is "Ready":
You are now ready to deploy a MAYANode.
Setting up a Kubernetes Cluster with AWS
AWS account
CLI and AWS credentials configured
AWS IAM Authenticator
kubectl
wget
(required for EKS module)
LINUX/MAC is the preferred method of setup.
Windows should choose either:
Deploy a MAYANode from a Linux VPS.
Use Windows Subsystem for Linux - https://docs.microsoft.com/en-us/windows/wsl/about****
Firstly, clone and enter the cluster-launcher repository. All commands in this section are to be run inside this repo.
Then install the terraform CLI:
Install Terraform:
In order for Terraform to run operations on your behalf, you must install and configure the AWS CLI tool. ****To install the AWS CLI, follow these instructions, or choose a package manager based on your operating system.
Use the package manager homebrew to install the AWS CLI.
You will be asked for you AWS access credentials (retrieve from AWS IAM from the AWS web console.)
IAM -> User -> Security Credentials -> Create Access Key.
Make sure you handle your secrets securely!
You also must install and configure the AWS IAM Authenticator tool. ****To install, follow these instructions, or choose a package manager based on your operating system.
Use the package manager homebrew to install the AWS IAM Authenticator.
You must install and configure the Kubernetes CLI tool (kubectl). ****To install kubectl , follow these instructions, or choose a package manager based on your operating system.
Use the package manager homebrew to install kubectl.
You also need wget and jq, follow these instructions, or choose a package manager based on your operating system.
Use the package manager homebrew to install wget and jq Note: You most likely have these installed already.
Use the commands below to deploy an AWS EKS cluster. You can run the make command that automates those command for you like this:
During the deploy, you will be asked to enter information about your cluster:
Name
AWS Region -- see valid List of Regions
Confirm yes
Or manually:
Final success message: Apply complete! Resources: 30 added, 0 changed, 0 destroyed.
If you are a returning node operator and you wish to use the same node name, the Cloudwatch log files from your previous session will block this step. You need to manually delete the logs from your console:
Cloudwatch / Cloudwatch Logs / Log Groups -> "delete"
Deploying a cluster takes ~10 minutes
This is done automatically during provisioning. To configure authentication from the command line, use the following command. It will get the access credentials for your cluster and automatically configure kubectl in case you need to to manually reconfigure kubectl.
Or get your kubeconfig file manually:
To verify, run this, and check the status is "Ready":
You are now ready to deploy a MAYANode.
Once your node is running, use the following command to automatically backup the Persistent Volumes for your Kubernetes cluster. This may help in recovering your node in the event of a disaster.
Enable backups:
Disable backups:
Deploying a MAYANode and its associated services.
Now you have a Kubernetes cluster ready to use, you can install the MAYANode services.
Helm charts are the defacto and currently easiest and simple way to package and deploy Kubernetes application. The team created different Helm charts to help to deploy all the necessary services. Please retrieve the source files from the Git repository here to follow the instructions below:
Running Kubernetes cluster
Kubectl configured, ready and connected to running cluster
If you came here from the Setup page, you are already good to go.
Clone the node-launcher
repo. All commands in this section are to be run inside of this repo.
Install Helm 3 if not already available on your current machine:
To deploy all tools, metrics, logs management, Kubernetes Dashboard, run the command below.
To destroy all those resources run the command below.
If you are successful, you will see the following message:
If there are any errors, they are typically fixed by running the command again.
It is important to deploy the tools first before deploying the MAYANode services as some services will have metrics configuration that would fail and stop the MAYANode deployment.
Currently MAYAChain supports ARB, BTC, ETH, DASH, KUJI & THOR. For all of the chains that we support a fullnode is used in order to read transactions from them. Sync time varies from chain to chain, but there's a couple of things you can do to speed up some of them:
By default the fullnode of ETH will connect checkpoint node provided by Maya Protocol. If you want to customize the checkpoint node to use you can edit the checkpoint_url
in ethereum-daemon/values.yaml
attribute.
In order to sync THOR from a ninerealms snapshot you need to explicitly enable it by setting recover: true
in thornode-daemon/values.yaml
.
You have multiple commands available to deploy different configurations of MAYANode. You can deploy mainnet or stagenet (currently not churning in third-party nodes). The commands deploy the umbrella chart mayanode-stack
in the background in the Kubernetes namespace mayanode
(or mayanode-stagenet
for stagenet) by default.
If you are intending to run all chain clients, bond in & earn rewards, you want to choose "validator".
Once it's all deployed you'll need to sync from a snapshot.
We recommend choosing the defaults, but in case you have a specific need you can choose otherwise.
You are now ready to join the network:
JoiningSet mayanode
to be your default namespace so you don't need to type -n mayanode
each time:
kubectl config set-context --current --namespace=mayanode
Use the following useful commands to view and debug accordingly. You should see everything running and active. Logs can be retrieved to find errors:
Kubernetes should automatically restart any service, but you can force a restart by running:
Note, to expedite syncing external chains, it is feasible to continually delete the pod that has the slow-syncing chain daemon (eg, binance-daemon-xxx).
Killing it will automatically restart it with free resources and syncing is notably faster. You can check sync status by viewing logs for the client to find the synced chain tip and comparing it with the real-world blockheight, ("xxx" is your unique ID):
Get real-world blockheights on the external blockchain explorers, eg: BTC Explorer
mayanode: Umbrella chart packaging all services needed to run a fullnode or validator MAYANode.
This should be the only chart used to run MAYANode stack unless you know what you are doing and want to run each chart separately (not recommended).
mayanode: MAYANode daemon
gateway: MAYANode gateway proxy to get a single IP address for multiple deployments
bifrost: Bifrost service
midgard: Midgard API service
mayachain-daemon: Mayachain fullnode daemon
arbitrum-daemon: Arbitrum fullnode daemon
bitcoin-daemon: Bitcoin fullnode daemon
dash-daemon: Dash fullnode daemon
ethereum-daemon: Ethereum fullnode daemon
kuji-daemon: Kujira fullnode daemon
thornode-daemon: Thorchain fullnode daemon
chain-daemon: as required for supported chains
prometheus: Prometheus stack for metrics
loki: Loki stack for logs
kubernetes-dashboard: Kubernetes dashboard
How to join MAYAChain as an Node.
Now that you have a MAYANode deployed in your Kubernetes cluster, you need to start operating your node to join the network.
There are a couple of steps to follow to do so.
The first wallet to bond their liquidity to a node will be the operator address (i.e. the address that controls the node).
MAYAChain nodes are backed up by added liquidity, just as a normal liquidity provider to one of the supported bonding pools: ARB, BTC, DASH, ETH, KUJI or THOR at the moment.
For now, the only ways to send custom deposit memos are using custom memo deposit on El Dorado or with your node-launcher
setup:
The amount specified in the bond transaction will be sent to your node, which will then be used to set your ip address, version and node keys.
Next, verify your node is running correctly. _**_To check the current status of your node, you can run the command status from the node-launcher
repository on your terminal:
You will get an output along those lines, the example below is for a mainnet node:
Your node is running but as you can see in the `Preflight` section, your node is not yet ready to be churned in and currently is in standby status, since your node has no IP address setup yet.
But to be able to set up the node IP address, you first need to get it registered in the chain by sending your BOND.
Before sending the BOND, verify that your MAYANode is fully synced with connected chains. Connected chains such as Ethereum & Bitcoin may take a day to sync. If your node is fully bonded and is selected to churn into MAYAChain as ACTIVE without fully syncing all connected chains, you will immediately get slashed for missing observations and lose money. It is normal to see Ethereum sit on 99.999% for many hours - be patient.
If you get an error of not having enough balance. Send some cacao to your node
You must tell MAYAChain your IP-Address for its address book and seed-service to run properly:
If you run the status command again, you should now see a different message for the Preflight section saying you need to set your node keys.
Once your IP address has been registered for discovery, you can use your own host for queries.
If you get an error of not having enough balance. Send some cacao to your node
Tell MAYAChain about your public keys for signing sessions:
If you run the make status
command again, you should now see that your node is in status “ready” and is now ready to be churned in the next rotation.
If you get an error of not having enough balance. Send some cacao to your node
Make sure your node broadcasts its latest version, else you won't churn in since MAYAChain enforces a version requirement. This version will appear in your make status
. If you are on 0.0.0
then you haven't set your version:
Although your node is ready to be churned in, it doesn’t mean it will be the next one to be selected, since someone else could have posted a higher bond than you. To maximize chances of a quick entry, monitor Midgard to see what everyone else is bonding and try to outbid them. Keep an eye on maximumStandbyBond
and make sure you are bonding higher than that amount.
The endpoint will show data on average, median, total, minimum and maximum bond amounts. For fastest entry, bond higher than the current maximum.
CACAO is always displayed in 1e8 format, 100000000 = 1 CACAO
At any time during standby or active, you can bond more by adding more liquidity to any LP position of the whitelisted bond providers (including the bond_address
)
Accessing Logs, Metrics and more
The Makefile provide different commands to help you operate your MAYANode.
There are two types of make commands, READ and WRITE.
Run make help
at any stage to get an exhaustive list of help options and how to interact with the system.
Read commands simply read your node state and doesn't commit any transactions.
To get information about your node on how to connect to services or its IP, run the command below. You will also get your node address and the vault address where you will need to send your bond.
Opens a shell into your thor-daemon
deployment: From within that shell you have access to the thorcli
command.
Display stream of logs of MAYANode deployment:
This will print your node mnemonic (phrase). Use this to ever rescue your node funds if something goes wrong.
Note: This phrase should only be used "in anger". This is your node "hot vault", also referred to as its yggdrasil vault, which allows the network to delegate swaps for faster execution. You will be slashed significantly if any funds are moved from this vault, since it is monitored by the MAYAChain network. Your bond is held at ransom in order to prevent you from stealing funds from this vault. Your bond will always be more valuable than funds on this vault, so you have no economic reason to touch these funds.
A keystore file that secures your private keys is also stored on the MAYANode. The password that is used to decrypt it can be printed by the following command
Restart a MAYANode deployment service selected:
Reset a MAYANode deployment service selected, including deleting the persistent volume. This command is destructive and will reset the chain back to 0%. You would use this for unrecoverable issues that make restart
did not solve.
Write commands actually build and write transactions into the underlying statechain. They cost CACAO from your bond, currently 0.02, but you can check this on the /constants
endpoint "CLICOSTINCACAO". This will post state in the chain which will be now updated globally. The CACAO fee is to prevent DDoS attacks.
Send a set-node-keys
to your node, which will set your node keys automatically for you by retrieving them directly from the maya-daemon
deployment.
Send a set-ip-address
to your node, which will set your node ip address automatically for you by retrieving the load balancer deployed directly.
In order to update your MAYANode to a new version, you will need to update the docker tag image used in your deployments. Depending on your choice of deployment this can be done differently.
For Kubernetes deployments, you can edit the deployments of the different services you want to update using the commands below.
To update your thor-daemon
, thor-api
and bifrost
deployment images to version 0.2.0:
To update your `midgard` deployment image to version 0.2.0
You can then follow the deployments restarting status either by checking your Kubernetes dashboard or using the CLI command below:
Once the deployments are all in the ready state again, you need to broadcast to the network that you are running a new version using the command below:
Note, all of these should already be installed from make tools
. However you can install them separately useing the DEPLOY tabs below.
To access the tools, navigate to the ACCESS tabs below.
All of these commands are to be run from node-launcher
It is recommended to deploy a logs management ingestor stack within Kubernetes to redirect all logs within a database to keep history over time as Kubernetes automatically rotates logs after a while to avoid filling the disks. The default stack used within this repository is Loki, created by Grafana and open source. To access the logs you can then use the Grafana admin interface that was deployed through the Prometheus command.
You can deploy the log management automatically using the command below:
This command will deploy the Loki chart. It can take a while to deploy all the services, usually up to 5 minutes depending on resources running your kubernetes cluster.
You can check the services being deployed in your kubernetes namespace loki-system
.
Access Grafana
See previous section to access the Grafana admin interface through the command make grafana
.
Browse Logs
Within the Grafana admin interface, to access the logs, find the Explore
view from the left menu sidebar. Once in the Explore
view, select Loki as the source, then select the service you want to show the logs by creating a query. The easiest way is to open the "Log browser" menu, then select the "job" label and then as value, select the service you want. For example you can select mayanode/bifrost
to show the logs of the Bifrost service within the default mayanode
namespace when deploying a mainnet validator MAYANode.
Destroy Loki logs management stack
It is also recommended to deploy a Prometheus stack to monitor your cluster and your running services.
You can deploy the metrics management automatically using the command below:
This command will deploy the prometheus chart. It can take a while to deploy all the services, usually up to 5 minutes depending on resources running your kubernetes cluster.
You can check the services being deployed in your kubernetes namespace prometheus-system
.
We have created a make command to automate this task to access Grafana from your local workstation:
Open http://localhost:3000 in your browser.
Login as the admin
user. The default password should have been displayed in the previous command (make grafana
).
Access Prometheus admin UI
We have created a make command to automate this task to access Prometheus from your local workstation:
Open http://localhost:9090 in your browser.
As part of the tools command deployment, you also have deployed a Prometheus stack in addition to the Elasticsearch in your Kubernetes cluster. All CPU, memory, disk space, and MAYANode / MAYAChain custom metrics are automatically being sent to the Prometheus database backend deployed in your cluster.
You should have available different dashboards to see the metrics across your cluster by nodes, deployments, etc, and also a specific MAYANode / MAYAChain
dashboard to see the MAYAChain status, with current block height, how many validators are currently active and other chain related information.
Click the 🔍 SEARCH ICON to find the list of dashboards
For a more in-depth introduction of Grafana, please follow the documentation here.
You can also deploy the Kubernetes dashboard to monitor your cluster resources.
This command will deploy the Kubernetes dashboard chart. It can take a while to deploy all the services, usually up to 5 minutes depending on resources running your kubernetes cluster.
We have created a make command to automate this task to access the Dashboard from your local workstation:
Open http://localhost:8000 in your browser.
View your kubernetes dashboard by running the following:
You should backup your MAYANode in case of failures. By default, if you are using the Kubernetes deployments solution, all the the deployments are automatically backed up by persistent volume disks. Depending on your provider, the volumes are usually available in the provider administration UI, for example in AWS, you can find those volumes in your regular console, in the region you chose to deploy your Kubernetes cluster.
Again by default, with Kubernetes, by using persistent volumes used in the default configuration, you are already protected again restart failures at container level, or node failures. As long as you don’t specifically use the destroy commands from the Makefile or manually delete your Kubernetes deployments, your volumes will NOT be deleted at any time.
It is still recommended, as any project, to have different backups on top of those volumes to make sure you can recover in admin error deleting those volumes or other Kubernetes resources that would imply deleting those volumes.
For AWS, you can easily setup in your console to have snapshots of your cluster volumes be taken every day. For other provider there can be different ways to achieve this as well either manually or automatically.
It is up to the node operator to setup those extra backups of the core volumes to be able to recover in any kind of failures or human errors.
Some volumes would be more critical than others, for example Midgard deployment are also by default backed up by persistent volumes, so it can recover in case of container restarts, failures or node failures and the deployment being automatically scheduled to a different node, but if you were to delete the Midgard volume, it would reconstruct its data from your MAYANode API and events from scratch. For that specific service having extra backups might not be critical, at the time of the writing of that document, Midgard implementation might change in the future.
At minimum you should also securely backup your node keys: node_key.json
and priv_validator_key.json
. Do this as follows:
Copy the mayanode pod name, e.g. mayanode-abcdefg-hijkl
and replace with {mayanode pod name}
below:
For full disaster recovery (complete loss of cluster), it is possible to issue LEAVE command from the original BOND wallet and manual return of funds from your Yggdrasil. In this case you need a secure backup of make mnemonic
(Yggdrasil mnemonic) and a working wallet that did the original BOND. See Leaving.
The following are attack vectors:
If anyone accesses your cloud credentials, they can log in and steal your funds
If anyone accesses the device you used to log into kubernetes, they can log in and steal your funds
If anyone accesses your hardware device used to bond, they can sign a LEAVE transaction and steal your bond once it is returned
If anyone has your Yggdrasil make mnemonic
phrase, including in logs, they can steal your funds
If any GitLab repo is compromised and you git pull
any nefarius code into your node and run make <any command>
, you can lose all your funds.
Prior to git pull
or make pull
updates, review node-launcher repo diffs:
Regularly review patches in GitLab: https://gitlab.com/mayachain/devops/node-launcher/-/commits/multichain
When chain clients have updated tags (version number or sha256), inspect the GitLab diffs for the relevant image in https://gitlab.com/mayachain/devops and ensure the CI build checksum matches the expected. This ensures you are executing code on your node that you are satisfied is free from exploits. Some images such as Ethereum use the 'official' docker image, e.g. https://hub.docker.com/r/ethereum/client-go/tags.
RUNNING A NODE IS SERIOUS BUSINESS
DO SO AT YOUR OWN RISK, YOU CAN LOSE A SIGNIFICANT QUANTITY OF FUNDS IF AN ERROR IS MADE
MAYANODE SOFTWARE IS PROVIDED AS IS - YOU ARE SOLELY RESPONSIBLE FOR USING IT
YOU ARE RESPONSIBLE FOR THE CODE RUNNING ON YOUR NODE. YOU ARE THE NETWORK. INSPECT ALL CODE YOU EXECUTE.
At the moment , there are five external chain get connected to MAYAChain, there are
Binance Chain
Bitcoin
Bitcoin cash
Litecoin
Ethereum
Each node has a unique address on each supported chain. This is their Yggdrasil vault. The network will fund all nodes Yggdrasil vaults and instruct them to perform small transactions in order to lower the number of computationally expensive TSS signatures.
To find your Yggdrasil addresses, firstly navigate to https://viewblock.io/mayachain/vaults
Find your node address and click on the link.
Alternatively, visit any mayachain endpoint using your node address from make status
:
Copy your secp256k1
public key and put it here:
And look for addresses
array at the bottom.
Run make mnemonic
and securely store this.
Visit https://iancoleman.io/bip39/ - or for more safety, clone the GitHub repo and open src/index.html
offline.
Paste in your mnemonic and choose CACAO - MAYAChain from the drop-down list.
Your private key string is the first one: m/44'/931'/0'/0/0
When running a node, it is quite common to get slashed. The network relies on slash points to rate node quality. When your node is slashed, the first thing you need to do is run make status
, and make sure all your chains are 100% in sync. If any of the external chains are not 100% in sync, then it will cause node to be slashed due to missing observations.
The best prevention is to have a cluster with lots of fast resources (cpu, memory, IO, network) and good backups/redundancy to prevent downtime.
Unfortunately even when your node is fully in-sync, it is still possible to be slashed due to external chain events. Here are some of the scenarios:
When a node is slashed 600 points, it is typically because the yggdrasil vault failed to send an outbound transaction (more accurately: the transaction it was tasked to perform wasn't mined within a specified time limit). This most likely to happen on ETH chain. Here is what you need to check:
Find your Yggdrasil ETH address. Use the previous instructions.
Visit https://etherscan.io/ and paste in your Yggdrasil ETH address.
Potential problem 1: Transaction ran out of Gas (wrong estimate):
Cause: The network uses geth
inbuilt eth_estimateGas
function to estimate how much gas to set as limit for a transaction. On rare occasions this can return a number too low causing the transaction to fail. In this case there is nothing you can do - just wait it out. Note: your Yggdrasil ETH vault is now insolvent by a small amount of gas burned in the failed transaction that you will need to personally top-up prior to LEAVE. See section on LEAVE for more details.
Potential problem 2: Transaction didn't mine after 15mins
Cause: External unexpected Gas price hike. The network uses a 1.5x the previous N blocks as the gas rate to use. If there is a sudden increase in Gas price required due to unforseen external events, the transaction may not be mined. In order to make sure customer is paid in a reasonable time, there is a auto cancel transaction process build in bifrost. The network will keep monitoring the outbound transactions and if any of the outbound transaction signed out by yggdrasil vault didn't commit after 15 minutes, it will automatically cancel it and assign to another node to send.
You should be able to see a transaction like the following, which is sending 0
ETH back to itself which cancels anything pending:
If your node is slashed 600 points continuously, it is likely your ETH vault is stuck or transactions sent to your local geth aren't propagated fully into mempools used by miners. This might happen if your local ethereum-daemon doesn't sync well with the network, even though it reports 100% in sync.
Run make logs
and choose bifrost
Search your logs for cancel
and look for transactions such as:
Find the last cancel tx in the logs (with the highest nonce).
Search etherscan for the new tx hash
transaction ID.
Your geth is stuck and out of sync if etherscan does NOT find the new tx hash
cancelled transaction. If you do not find your tx in etherscan - proceed as follows:
Find the lowest nonce from Etherscan:
Go to https://etherscan.io and paste your yggdrasil ETH address in the search box
Find the last successful transaction send out from your yggdrasil ETH address. It is the top transaction in the list:
Click the transaction. Note the nonce used in the last good transaction (e.g. 39
), and then plus 1 (e.g. 40
). This is the lowest stuck tx nonce.
Find the highest stuck nonce from your local geth:
make shell
then choose ethereum-daemon
geth attach
eth.getTransactionCount('{YOUR YGGDRASIL ETH ADDRESS}','pending')
-- this is the highest stuck tx nonce
exit
and exit
again.
If the highest nonce is larger than your lowest nonce, it means there are a few transactions sent and stuck in the mempool of your local ETH daemon. You need to unstuck these from highest to lowest.
Make a fork of https://replit.com/@mayachain/YggCancelETH
Update index.js
lastPendingNonce
and firstStuckNonce
. Also put in your hex encoded private key to KEY variable. Remember to add the 0x
prefix which bip39 calculator above will not have.
Update gasPrice
to a very high gas price. The price should be higher than all the transactions stuck in the mempool. Recommend to spend more than 200 Gwei or double the highest from https://mayanode.mayachain.info/mayachain/inbound_addresses (which ever is higher).
Run the script using node index.js
. Note: you may need to install some dependecies first with npm install ethers
. The output should look like:
make restart
and choose ethereum-daemon
Problem: Sometimes bifrost fails to forward observations to mayanode, due to an account number / sequence number mismatch. Here is what you need to check:
run make logs
, and choose bifrost
Search your bifrost logs for {"level":"error","service":"bifrost","module":"observer","error":"fail to send the tx to mayachain: fail to broadcast to MAYAChain,code:32, log:account sequence mismatch, expected 26806, got 26807: incorrect account sequence","time":"2021-05-30T07:28:18Z","message":"fail to send to MAYAChain"}
3. Solution: make restart
and choose bifrost
Skilled Node Operators who don't individually have enough Liquidity Units (Asset + CACAO) to run a node themselves can use the Bond Provider feature to collect bond from other Liquidity Providers.
Node Operators can define up to 8 Maya addresses as Bond Providers. These addresses will be able to bond and unbond to the node, earning rewards proportional to the amount of bond they contribute. Node Operators define an operator fee in basis points, which defaults to zero and must be set explicitly when bond providers are added. The Node Operator fee is taken from rewards and paid directly to the Node Operator address after each churn.
The minimum Value of Liquidity Units needed to churn in as a MAYANode can be pricy (currently above $100k).
Not many people in the world have both the technical skills to run a validator AND at least $100k, which limits the supply of Node Operators who secure MAYAChain.
Pooled MAYANodes provide a way for a skilled Operator to enter a trusted agreement with Bond Providers to bootstrap enough capital for running a MAYANode. The Network's security increases, and Liquidity Providers can earn more yield.
At first glance it might seem Pooled Validators contradict the economic security model of MAYAChain (i.e. that Node Operators put up more in value in slash-able bond than the assets they secure). With Pooled Validators it is possible for the Node Operator to individually put up less bond than the value of the assets that the node secures. However this nuance only exists within the relationship between the Node Operator and the Bond Providers. The Network only considers the MAYANode as single entity thus the economic model is intact.
It would be disastrous to MAYAChain if operators could collect unlimited bond quantities from anon/retail providers. Malicious Operators could start marketing campaigns collecting liquidity and then rug-pull their users, or worse, access economies of scale and take over the network.
This is why Pooled MAYANodes are invite-only and limited to 8 per node. It is difficult to access economies of scale in these small quantities.
All CACAO Amount
values are in 1e10 decimals, e.g. 1 CACAO = 10000000000.
Add a bond provider using a BOND transaction with a modified memo from a wallet you control (APP or mayacli):
BOND:<NodeAddress>:<BondProviderAddress>:<NodeOperatorFee>
Example: BOND:maya7djftrgu98z84hef6dt6ykhe7cmjf3f8dcpkfun:maya9diy4q8u50qzsznpvh02s8j483aga63cl02k6jt:2000
NodeAddress - MAYANode address (prefixed by maya
)
BondProviderAddress - Bond Provider address to whitelist (prefixed by maya
)
NodeOperatorFee - fee in basis points to be taken from rewards and paid directly to Node Operator's address after each churn.
CACAO TX Value - 2 minimum (anything over 1 is added to the Operator's Bond).
A Node Operator is the first on-chain bonding transaction to a new node. You cannot change the operator address after the fact.
The Operator is also added as a Bond Provider.
Removing a Bond Provider
While the node is churned out, A Node Operator can remove a Bond Provider using an UNBOND transaction with a modified memo:
UNBOND:<NodeAddress>:<Amount>:<BondProviderAddress>
NodeAddress - MAYANode address (prefixed by maya
)
Amount - amount of Bond Provider's bond to refund
BondProviderAddress - Bond Provider address to refund/remove (prefixed by maya
)
RUNE Tx Value - 1 minimum
This command will refund the Bond Provider their bond and remove them from the Bond Provider list only if Amount
constitutes all of the bond the Bond Provider is owed.
Node operators can set a fee that is paid to them from the earnings each churn.
To set a Node Operator fee, send a deposit transaction with the following memo:
BOND:<node address>:<bond wallet address>:<operator fee in basis pts>
Example: BOND:maya1agftrgu74z84hef6dt6ykhe7cmjf3f8dcpkfun:maya1tfm4q8u57qzsznpvh02s8j483aga63cl02k6jt:2000
To adjust the Fee, The no operators can send:
BOND:<node address>::<operator fee in basis pts>
Example: BOND:maya3guru5gu74z79hef6dt6ykhe7cmjf3f8dcfudge::4000
to see the fee to 40%.
Fees can range from 100 to 9900 basis pts. Setting 10000 causes all rewards to be to the node operator each churn. Setting it to 0 causes rewards to accrue to the bond.
Once whitelisted, a Bond Provider can Bond and Unbond from the node as normal.
Adding Bond:
BOND:<NodeAddress>
NodeAddress - MAYANode address (prefixed by maya
)
CACAO Tx Value - Amount of LP to bond
Removing Bond:
UNBOND:<NodeAddress>:<Amount>
NodeAddress - MAYANode address (prefixed by maya
)
Amount - Amount of LP to unbond
CACAO Tx Value - 1
When can you add Bond?
When the node is standby, active or not churning, bond amounts can be increased/decreased.
Operators and Providers all have a bond amount registered to the node. Operators can start at 0.00 bonded. This on-chain bond amount is summed to the total bond, and thus everyone has a fair share in the MAYANode's principle + Liquidity Pool & transaction fees.
The Operator Fee is distributed to the Node Operator address from all CACAO rewards earned by a node after each churn.
If an Operator LEAVES, all the bond is fairly distributed.
Telegram Notification Service
To listen for update announcements, join the following channels:
Telegram MAYANode Announcements Join here
Discord MAYAChain Community Devs Join here especially #mayanode-mccn
Be sure to use a pseudonym in order to prevent doxxing yourself. Node operators should remain anonymous for the health of the network and your personal/node security.
How to leave MAYAChain
Every 3 days the system will churn its nodes. The exact churn interval in blocks is ChurnInterval in the MAYAChain Constants.
Outgoing:
Nodes wishing to leave, and/or
The most unreliable node(s), and/or
The oldest node
But a maximum of 1/3rd the network
Incoming:
The node(s) with the highest bond (typically 4).
Churned out nodes will be put in standby, but their bond will not automatically be returned. They will be credited any earned rewards in their last session. If they do nothing but keep their cluster online, they will be eventually churned back in.
Alternatively, an "Active" node can leave the system voluntarily, in which case they are marked to churn out first. Leaving is considered permanent, and the node-address is permanently jailed. This prevents abuse of the LEAVE system since leaving at short notice is disruptive and expensive.
It is assumed nodes that wish to LEAVE will be away for a significant period of time, so by permanently jailing their address it forces them to completely destroy and re-build before re-entering. This also ensures they are running the latest software.
Yggdrasil vaults have been deprecated, see ADR-002. They may be used again in the future. Nodes that were active before ADR-002 need to leave as described below.
You cannot unbond if you are "Ready" or "Active" or have any amount of funds in your Yggdrasil address
If a Node Operator wants to retrieve part of their bond & rewards (such as deciding to take profits), they can simply Unbond. This keeps their Node on standby, ready to be churned back in.
To unbond from the system, simply send an UNBOND transaction.
Example, this will draw out 10k in CACAO from the bond, as long as the remaining amount is higher than the minimum bond.
UNBOND:maya1ryr5eancepklax5am8mdpkx6mr0rg4xjnjx6zz:1000000000000
MAYAChain always treats assets in 1e8 'base format' ie, 1.0 CACAO = 100,000,000 units (tor). To get from one to the other, simply multiply by 100m.
If using ASGARDEX to BOND or UNBOND, simply put the CACAO amount, e.g. "100" for 100 CACAO. It does the memo in 1e8 for you.
You can get your node address by running make status
Only the address that originally bonded the funds can UNBOND or LEAVE. This ensures you can safely leave this system if you no longer have access to your node (but it is still running).
If you can't UNBOND, it means your ygg-vault still has funds on it. This means your node spent more gas than it was supposed to during the cycle (various reasons) and is partially insolvent. To fix this you need to rectify your node's insolvency first (send it the missing funds directly) before doing anything.
Leaving is considered permanent. There are two steps.
If you are Active, send a LEAVE transaction to be ear-marked to churn out. This will take several hours even after changing your status to 'Standby'.
If you are Standby, send a LEAVE transaction to get your bond back and be permanently jailed.
Prior to running a mainnet validator, you should practice a full sequence of deploy, BOND in and LEAVE on a testnet cluster to ensure you know what you are doing and what to expect.
To leave the system, send the following transaction from your original bond address to the Vault Address: LEAVE:<ADDRESS>
with at least 1 tor in funds. Or use ASGARDEX.
Example:
LEAVE:maya1ryr5eancepklax5am8mdpkx6mr0rg4xjnjx6zz
⏱_Wait a few hours, verify on the /nodeaccount endpoint that you are now **Disabled
**👀_ Then send another LEAVE:
LEAVE:maya1ryr5eancepklax5am8mdpkx6mr0rg4xjnjx6zz
⏱_Wait a few minutes, verify you have received your bond back 👀_ - make status
should show BOND 0.00
and your wallet should get the full Bond back.
Sometimes your Yggdrasil ETH vault may be slightly insolvent due to out-of-gas transactions consuming gas whilst Active. If the network will not let you LEAVE, you may need to manually send your Yggdrasil ETH vault 0.01 - 0.05 ETH from your own personal funds as a top-up, then try LEAVE again. Note: any funds you send to top-up ETH vault you cannot send back to yourself until AFTER your node has left and you have received your bond back, otherwise it will be fined 1.5x what you transfer out.
View your node's vault to find insolvencies: https://viewblock.io/mayachain/address/<nodeAddress> https://mayanode.mayachain.info/mayachain/vault/<vaultPubKey>
🔥 Commence destroying your node 🔥
If your node is both offline and inaccessible, then it will be unable to automatically return any assets in its yggdrasil vaults and it will be slashed 1.5x the value of those assets.
Example: If your node has a $5m bond (in CACAO), but has $1m in assets in its vaults it can't return, it will lose $1.5m in CACAO from its bond. The Node will only get back $3.5m of its bond.
If your node is completely offline or destroyed, you will have to perform a manual return of Yggdrasil funds in order to prevent 1.5x bond fine. Ensure you have reviewed this procedure and have all tools ready to go in case you need to do it in anger. This is a time-critical event - you have a few hours to return all funds before the network assumes you have stolen them.
If you do not perform all of these steps in time, your bond will be fined 1.5x stolen funds. The remaining funds belonging to Yggdrasil make mnemonic
are now yours; but you just paid a 50% premium for them, losing a lot of money. You can use the following procedure in a similar way to recover these funds.
Requirement: You have your make mnemonic
Yggdrasil mnemonic available. If you do not have this, you cannot manually return funds.
Options: 1. Coming Soon: Use ASGARDEX for Manual Return. 2. Coming Soon: Check Discord Dev channels for manual return cli tool. 3. Extract Private Key + Manual return each asset using wallets:
Your Yggdrasil make mnemonic
phrase is used to generate the m/44'/931'/0'/0/0
private key which is used for all chains. Pasting the mnemonic into common wallets will not work as they will be looking under a different "standard" HD Path. Instead, go to https://iancoleman.io/bip39/ and paste in your mnemonic, select CACAO from the Dropdown list and in the bottom table, copy the m/44'/931'/0'/0/0
private key string. Use this to import into wallets.
The next step is to find the latest inbound addresses. Use https://mayanode.mayachain.info/mayachain/inbound_addresses
Do not cache inbound_addresses. These are only valid for a short period of time. Always refresh to get the latest before sending funds.
Use the address field. Chains with a router present such as ETH need to send funds via the router smart-contract. Paste the router address into etherscan, click "Contract" and "Write Contract" and use a Web3 wallet to connect.
The memo required is YGGDRASIL-:<BlockHeight>
. For example YGGDRASIL-:782412
. The block height can be found from the status_since
field here:
If your node is standby
or disabled
status, any integer block height will work for return. e.g. YGGDRASIL-:1
. The most important thing is to ensure you send to the correct active vault address or router.
For BTC wallets (BTC, Litecoin) use importprivkey
in cli.
For ETH router manual returns, use the deposit()
function for individual assets. For ETH use contract 0x0
. Use the returnVaultAssets()
for multiple assets.
You should complete this checklist before you do the next step:
Have you sent a final LEAVE transaction and have you received your BOND back - ie 1,000,000 CACAO, and can your account for any slash points or rewards?
If yes, then proceed:
To destroy and remove previously created resources, you can run the command below.
Destroying your cluster will completely destroy your node, including purging all keys on it.
DO NOT DO THIS UNTIL YOUR NODE HAS CHURNED OUT AND YOU HAVE VERIFIED YOUR BOND IS COMPLETELY RETURNED
IF YOU DESTROY A NODE PREMATURELY, YOU MAY LOSE A SIGNIFICANT AMOUNT OF FUNDS
First, destroy the node and tools, this will delete your node then your tooling 1-by-1. Do this from the node-launcher
repo:
Then destroy the cluster from the cluster-launcher
repo:
You will be asked to enter your cluster name and region (the same as what you put in when you first deployed).
You will be asked to enter your cluster name and region, as well as your Personal Token (the same as what you put in when you first deployed).
You will be asked to confirm:
DO NOT DESTROY YOUR NODE UNTIL YOU HAVE CHURNED OUT AND HAVE RECEIVED YOUR FULL BOND BACK IN YOUR CUSTODY
IF YOU DESTROY YOUR NODE WITH FUNDS LOCKED UP - YOU WILL LOSE A SIGNIFICANT QUANTITY OF FUNDS
This page describes how to react in a network-wide emergency (funds-at-risk).
MAYAChain is a distributed network. When the network is under attack or a funds-at-risk bug is discovered, Node Operators should react quickly to secure and defend.
Even during emergencies, Node Operators should refrain from doxxing themselves. Staying pseudo-anonymous is critical to ensuring the network is impartial, neutral and resistant to capture.
There is a formal Bounty Program in place for reporting bugs. If you have discovered a bug, you should immediately DM the team or any other admins and/or report via the bounty program. If the bug is deemed to be serious/criticial, you will be paid a bounty commensurate to the severity of the issue. Reports need to include:
Description of the bug
Steps to reproduce
If funds are at risk
Once the bug has been verified, admin should make a decision on the level of response, including any mimir over-rides and announcements:
The network cannot upgrade until 100% of active nodes are on the updated version. This can be accelerated:
Naturally, by allowing the network to churn out old nodes
Assertive, by waiting until a super-majority has upgraded (demonstrating acceptance of the upgrade) than banning old nodes
Forced by hard-forking out old nodes.
During a natural upgrade cycle, it may take several days to churn out old nodes. If the upgrade is time-critical, the network may elect to ban old nodes. Banning a node will cycle them to be churned, kick them from TSS and eject them from the consensus set. That node will never be able to churn in again, they will need to fully leave, destroy their node, and set up a new one. Hard-forking out old nodes is also possible but comes with a significant risk of consensus failures.
The network will not be able to recover until the upgrade is complete, any mimir over-rides are removed, and TSS is re-synced. Additionally, there may be a backlog of transactions that will need to be processed. This may take some time. If external chain daemons were stopped, re-syncing times may also be a factor.
All wallets and frontends should monitor for any of the halts and automatically go into maintenance mode when invoked.
/root/.mayanode/MAYAChain-ED25519 /root/.mayanode/keyring-file/ (directory) /root/.mayanode/config/node_key.json /root/.mayanode/config/priv_validator_key.json
bifrost-recovery.yaml:
If you're maling live migration, then after stopping temporary pods on the NEW node stop mayanode and bifrost daemons on the OLD node
Checklist of items for Node Operators
Some node operators may desire to run multiple validators within the same cluster, while sharing a single set of daemons among them to save resource cost. This can be performed via the following method. These instructions are relevant for mainnet at the time of writing, but please ensure that correct network and current set of daemons are used.
https://gitlab.com/mayachain/devops/node-launcher/-/blob/master/docs/Multi-Validator-Cluster.md
Chain ID: mayachain-mainnet-v1 | Current Node Version: v1.111.0
Install Go
We will use Go v1.22.0
as an example here. The code below also cleanly removes any previous Go installation.
Configure Go
Unless you want to configure in a non-standard way, then set these in the ~/.bash_profile
for bash and ~/.zshrc
for zsh.
Install dependencies protobuf-compiler
Install docker and docker compose plugin
https://docs.docker.com/engine/install/
Install Node
Install the current version of node binary.
*You can see tags in mayanode's repo tags
Install binary
Run Node
Create Service File
Create a mayanode.service
file in the /etc/systemd/system
folder with the following code snippet. Make sure to replace USER
with your Linux username. You need sudo privilege to do this step.
Download Snapshot
Please use a snapshot in order to avoid syncing from start. You will need to install aws-cli
Start Node Service
Other Considerations
This installation guide is the bare minimum to get a node started. You should consider the following as you become a more experienced node operator.
Configure firewall to close most ports while only leaving the p2p port (typically 27146) open
Use custom ports for each node so you can run multiple nodes on the same server
If you find a bug in this installation guide, please reach out to our Discord Server and let us know.