# Fullnode Installation Guide

#### Install Go and other requirements

**Install Go**

We will use Go `v1.23.4` which is the required version for the latest MAYANode. The code below installs Go in your home directory to avoid requiring sudo privileges.

```
# Remove any existing Go installation
rm -rf ~/.go
# Download and extract Go
wget https://golang.org/dl/go1.23.4.linux-amd64.tar.gz
tar -C ~/ -xzf go1.23.4.linux-amd64.tar.gz
mv ~/go ~/.go
rm go1.23.4.linux-amd64.tar.gz
```

**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.

```
export GOROOT=$HOME/.go
export GOPATH=$HOME/go
export GO111MODULE=on
export PATH=$PATH:$HOME/.go/bin:$HOME/go/bin
```

After adding these lines, reload your shell configuration:

```
# For bash
source ~/.bash_profile
# For zsh
source ~/.zshrc
```

**Install dependencies protobuf-compiler**

```
sudo apt-get update
sudo apt-get install -y git \
     make \
     protobuf-compiler \
     curl \
     wget \
     jq \
     build-essential \
     musl-tools \
     linux-headers-generic
```

**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](https://gitlab.com/mayachain/mayanode/-/tags)

```
git clone https://gitlab.com/mayachain/mayanode
cd mayanode
curl -s https://mayanode.mayachain.info/mayachain/version
git checkout <latest version> # e.g. v1.123.1
make protob
```

**Install binary**

```
TAG=mainnet NET=mainnet make install
```

**Install library dependencies**

MAYANode requires the libzec.so and libradix\_engine\_toolkit\_uniffi.so libraries. Copy them to the system library path:

```
sudo cp lib/libzec.so /usr/local/lib/
sudo cp lib/libradix_engine_toolkit_uniffi.so /usr/local/lib/
sudo ldconfig
```

**Initialize Node**

First, initialize the node and download the genesis file:

```
mayanode init local --chain-id mayachain-mainnet-v1
wget -O ~/.mayanode/config/genesis.json https://raw.githubusercontent.com/mayachain/mayanode/mainnet/genesis/mayachain-mainnet-v1-genesis.json
```

**Configure Ports (if running alongside other nodes)**

If you're running MAYANode alongside other blockchain nodes (like THORChain), you'll need to change the default ports to avoid conflicts:

```
# Change RPC port from 27147 to 28147
sed -i 's|laddr = "tcp://0.0.0.0:27147"|laddr = "tcp://0.0.0.0:28147"|g' ~/.mayanode/config/config.toml

# Change P2P port from 27146 to 28146
sed -i 's|laddr = "tcp://0.0.0.0:27146"|laddr = "tcp://0.0.0.0:28146"|g' ~/.mayanode/config/config.toml

# Change Prometheus port from 26660 to 28660
sed -i 's|prometheus_listen_addr = ":26660"|prometheus_listen_addr = ":28660"|g' ~/.mayanode/config/config.toml

# Change pprof port from 6060 to 7060
sed -i 's|pprof_laddr = "localhost:6060"|pprof_laddr = "localhost:7060"|g' ~/.mayanode/config/config.toml

# Change API port from 1317 to 2317
sed -i 's|address = "tcp://0.0.0.0:1317"|address = "tcp://0.0.0.0:2317"|g' ~/.mayanode/config/app.toml

# Change gRPC port from 9090 to 9190
sed -i 's|address = "0.0.0.0:9090"|address = "0.0.0.0:9190"|g' ~/.mayanode/config/app.toml

# Change gRPC-web port from 9091 to 9191
sed -i 's|address = "0.0.0.0:9091"|address = "0.0.0.0:9191"|g' ~/.mayanode/config/app.toml
```

**Add Seed Nodes**

```
# Update this with current active seed nodes
sed -i 's|seeds = ""|seeds = "2c96aa89f5c1e256b3e3e906e3a42fc26db80ab0@15.156.45.237:27146,c4e8e07f5f1f01d75c98f4f2b0c5e67bb4e973f5@18.217.85.10:27146"|g' ~/.mayanode/config/config.toml
```

**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.

```
[Unit]
Description="Mayanode"
After=network-online.target

[Service]
User=USER
WorkingDirectory=/home/USER
ExecStart=/home/USER/go/bin/mayanode start
Restart=always
RestartSec=3
LimitNOFILE=4096
Environment="MAYA_COSMOS_TELEMETRY_ENABLED=true"
Environment="CHAIN_ID=mayachain-mainnet-v1"
Environment="NET=mainnet"
Environment="SIGNER_NAME=mayachain"
Environment="SIGNER_PASSWD=password"

[Install]
WantedBy=multi-user.target
```

**Download Snapshot**

Please use a [snapshot](https://public-snapshots-mayanode.s3.amazonaws.com/) in order to avoid syncing from start. You can choose between full snapshots or pruned snapshots (recommended for fullnodes to save disk space).

**Using aria2c (recommended for faster downloads):**

```
# Install aria2c if not already installed
sudo apt-get install -y aria2

# For pruned snapshot (recommended):
mkdir -p ~/.mayanode/data
aria2c -x 16 -s 16 -k 1M https://public-snapshots-mayanode.s3.amazonaws.com/pruned/mayachain-mainnet-v1-pruned-<HEIGHT>.tar.gz
tar -xzf mayachain-mainnet-v1-pruned-<HEIGHT>.tar.gz -C ~/.mayanode/
rm mayachain-mainnet-v1-pruned-<HEIGHT>.tar.gz

# For full snapshot:
mkdir -p ~/.mayanode/data
aria2c -x 16 -s 16 -k 1M https://public-snapshots-mayanode.s3.amazonaws.com/full/mayachain-mainnet-v1-full-<HEIGHT>.tar.gz
tar -xzf mayachain-mainnet-v1-full-<HEIGHT>.tar.gz -C ~/.mayanode/
rm mayachain-mainnet-v1-full-<HEIGHT>.tar.gz
```

**Using AWS CLI:**

```
# Install aws-cli if not already installed
sudo apt-get install -y awscli

# Download snapshot
mkdir -p ~/.mayanode/data
aws s3 cp --recursive s3://public-snapshots-mayanode/pruned/<snapshot height> ~/.mayanode/data
```

Note: Check the [snapshot page](https://public-snapshots-mayanode.s3.amazonaws.com/) for the latest available snapshot height.

**Start Node Service**

```
# Enable service
sudo systemctl enable mayanode.service

# Start service
sudo systemctl start mayanode

# Check logs
sudo journalctl -feu mayanode

# Check sync status
curl -s localhost:28147/status | jq '.result.sync_info'

# Check connected peers
curl -s localhost:28147/net_info | jq '.result.n_peers'
```

#### 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.

* **Firewall Configuration**: Configure firewall to close most ports while only leaving the p2p port (28146 if using custom ports, or 27146 for default) open for incoming connections
* **Multiple Nodes**: When running multiple blockchain nodes on the same server, ensure each uses different ports as shown in the port configuration section
* **Disk Space**: Pruned snapshots use significantly less disk space (\~15GB vs \~50GB for full snapshots) and are recommended for fullnodes
* **Monitoring**: Set up monitoring for the node using the Prometheus metrics endpoint (port 28660 if using custom ports)
* **Seed Nodes**: The seed nodes may change over time. Check with the MAYAChain community for current active seed nodes if connection issues persist

#### Troubleshooting

**Port Conflicts**: If you see "bind: address already in use" errors, check if another service is using the port:

```
sudo lsof -i :<PORT_NUMBER>
```

**Library Errors**: If you see "error while loading shared libraries: libzec.so" or "libradix\_engine\_toolkit\_uniffi.so", ensure the libraries are properly installed:

```
sudo cp /path/to/mayanode/lib/libzec.so /usr/local/lib/
sudo cp /path/to/mayanode/lib/libradix_engine_toolkit_uniffi.so /usr/local/lib/
sudo ldconfig
```

**No Peers**: If the node shows 0 peers after starting, check:

1. Firewall rules allow outbound connections
2. Seed nodes are correctly configured in config.toml
3. P2P port is accessible

If you find a bug in this installation guide, please reach out to our Discord Server and let us know.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mayaprotocol.com/node-docs/mayanodes/fullnode-installation-guide.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
