# How to Set Up a Node

MEVerse is open source on Github(<https://github.com/meverselabs/meverse>). Anybody can download codes from github.

## Environment

{% hint style="info" %}
Linux

Golang 1.18.2

C compiler(gcc 4.9.0 or later, mingw etc.)
{% endhint %}

If you sync from the Genesis block, you can start node with following commands

<pre><code><strong>$ git clone https://github.com/meverselabs/meverse
</strong>$ cd ./meverse/cmd/node
$ go build
$ ./node
</code></pre>

MEVerse saves context snapshots once a day. You can also download latest data to start node from recent block height.

1. Download context file in <https://rpc.meversemainnet.io/zipcontext>&#x20;
2. Unzip the **zipcontext** file, you will find **data** folder and `_config.toml`&#x20;
3. Create **./meverse/cmd/node/ndata** folder and place **data/context** file&#x20;
4. Overwrite **\_config.toml** file's InitGenesisHash, InitHeight, InitHash, InitTimestamp in  **./meverse/cmd/node/config.toml** file
5. Run after build

{% code title="zipcontext.sh" lineNumbers="true" %}

```shell
git clone https://github.com/meverselabs/meverse
cd ./meverse/cmd/node
wget https://rpc.meversemainnet.io/zipcontext
unzip zipcontext
mv ./data ./ndata
sed -e "s/InitGenesisHash = \"\"/$(sed '1!d' _config.toml)/" config.toml > config.toml_ && mv config.toml_ config.toml
sed -e "s/InitHeight = 0/$(sed '2!d' _config.toml)/" config.toml > config.toml_ && mv config.toml_ config.toml
sed -e "s/InitHash = \"\"/$(sed '3!d' _config.toml)/" config.toml > config.toml_ && mv config.toml_ config.toml
sed -e "s/InitTimestamp = 0/$(sed '4!d' _config.toml)/" config.toml > config.toml_ && mv config.toml_ config.toml
# sed -e "s/RPCPort = 8541/RPCPort = 8541/" config.toml > config.toml_ && mv config.toml_ config.toml
rm -r _config.toml
rm -r zipcontext
go build
./node
```

{% endcode %}

You can exchange data with mainnet through RPC. 8541 port is set as a basic port, and it can be edited in RPCPort field in **/cmd/node/config.toml**`.`


---

# 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://meversedex.gitbook.io/meverse-dev-docs/get-started/how-to-set-up-a-node.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.
