> For the complete documentation index, see [llms.txt](https://docs.pandoproject.org/pando-network-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pandoproject.org/pando-network-docs/pando-nodes/mainnet-metatron-setup.md).

# Mainnet Metatron Setup

## Step 1

{% code overflow="wrap" %}

```shell
sudo apt-get update && sudo apt-get install wget git curl net-tools build-essential make -y
```

{% endcode %}

```shell
wget https://go.dev/dl/go1.17.4.linux-amd64.tar.gz
```

```shell
rm -rf /usr/local/go && tar -C /usr/local -xzf go1.17.4.linux-amd64.tar.gz
```

```shell
echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.profile
```

```shell
echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bashrc
```

```shell
echo 'export PANDO_HOME=/usr/local/go/src/github.com/pandoprojects/pando' >> ~/.bashrc
```

```shell
echo 'export PANDO_HOME=/usr/local/go/src/github.com/pandoprojects/pando' >> ~/.profile
```

```shell
source ~/.bashrc && source ~/.profile
```

## Step 2

{% code overflow="wrap" %}

```
mkdir -p /usr/local/go/src/github.com/pandoprojects/ && cd /usr/local/go/src/github.com/pandoprojects/
```

{% endcode %}

```
git clone https://github.com/pandoprojects/pando-network-protocol.git
mv pando-network-protocol pando
```

**Note:** Code is there on **main** branch so it can be clone directly without switching any branch using github

```
cd $PANDO_HOME
```

**Step 2 - \[Build and install]**

**(A)** This should build the binaries and copy them into your **$GOPATH/bin**. Two binaries **pando** and **pandocli** are generated. **pando** can be regarded as the launcher of the Pando Ledger node, and **pandocli** is a wallet with command line tools to interact with the ledger.

```
export GO111MODULE=on
```

```
make install
```

**\* Notes for Linux binary compilation**

The build and install process on Linux is similar, but note that Ubuntu 18.04.4 LTS / Centos 8 or higher version is required for the compilation.

**\* Notes for Windows binary compilation**

The Windows binary can be cross-compiled from macOS. To cross-compile a Windows binary, first make sure **mingw64** is installed **(brew install mingw-w64)** on your macOS. Then you can cross-compile the Windows binary with the following command:

```shell
make exe
```

You'll also need to place three .**dll** files **libgcc\_s\_seh-1.dll, libstdc++-6.dll**, **libwinpthread-1.dll** under the same folder as **pando.exe** and **pandocli.exe**.

## Step 3 - Run unit test

Run unit tests with the command below

```shell
make test_unit
```

## Step 4- Launch Mainnet

Open a terminal to launch the mainnet(**Chain Id: pandonet**). For the first time, follow the setup steps below.

```
cd $PANDO_HOME
```

```
cp -r ./integration/pandonet ../pandonet
```

```
mkdir ~/.pandocli
```

```
chmod 700 ~/.pandocli
```

```
export PATH=$PATH:/usr/local/go/bin && make install
```

**And then, use the following command to launch a pandonet . For this you can use tmux or any other tools to run your node service in the background.**

```
/usr/local/go/bin/pando start --config=../pandonet/node
```

**When the prompt asks for a password, enter your required password here.**

**Note – {** Your binary directory path **} denotes path where pando and pandocli binary exist or created while running after make install command.**

**And then after run the following command to launch rpc of the node in another session.**

```
/{ Your binary directory path }/pandocli daemon start --port=16889
```

**And to get the details of node for further process, run the below command -**

```
cd { Your binary directory path }
```

```
./pandocli query metatron
```

## Example

This command will give you following information about the metatron node life node summary which is needed for staking process to make node active

**Example:`{"Address": "0x8f3B...E819",`**

**`"BlsPubkey": "a1225b...16ebe",`**

**`"BlsPop": "b49fd2a...d025c",`**

**`"Signature": "14deb5e...52500",`**

**`"Summary": "0x8f3Bc...952500"}`**

Use Summary key data for the metatron staking from the web wallet.

## Re-installation and withdrawal of the Node

**Steps to stake and make Metatron node Active**

* Copy summary from here and go to web wallet
* Choose staking option and select metatron
* Add copied node summary and stake value more than 10000 PTX to make metatron active
* Once done switch back to cli on node now you can see node is active and working on finalizing and verifying the blockchain
* Use ./**pandocli query status** to check syncing status and staking and balance
* Same can be verify on explorer just copy address key and paste on explorer and now you can see staking value and in node tab also can see metatron listed there

**In case of Panic Error**

Run following command

```
rm -rf $homedir/pandonet/node/db
rm -rf $homedir/pandonet/node/snapshot
```

```
Download latest snapshot
wget https://blockchainupdate.s3.ap-southeast-1.amazonaws.com/snapshot
```

```
Restart the node again 
```

{% hint style="info" %}
`And rerun the chain with above give process with run node`` `**`command`**
{% endhint %}

```
/usr/local/go/bin/pando start --config=../pandonet/node
```

After this let your node sync with blockchain for sometime and put it in observation, once it reaches to current block it will work without any issue till then it needs to be observed.

### To change to MT Node Password

#### 1. Switch to the below directory.

```
cd/usr/local/go/src/github.com/pandoprojects/pandonet/node/key/encrypted
```

#### 2. Download the key which is in the above directory on your local.

#### 3. Then, login to the wallet application.

* `(https://wallet.pandoproject.org/unlock/keystore-file) with the same key and node password.`

#### 4. After logged in to the wallet application , switch to the setting tab and reset your password.

#### 5. Then, upload the new key generated from the wallet application to the same server directory and replace it with the new key and run the below-mentioned command.

```
mv {key}.keystore {key}
```

#### 6. Now, switch to the directory and run the following command.

```
cd /usr/local/go/src/github.com/pandotoken/pando
```

```
make install
```

#### 7. After the successful compilation of code, you need to go to the background process where the node is running. Terminate the process and run the command with a new password.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.pandoproject.org/pando-network-docs/pando-nodes/mainnet-metatron-setup.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
