# 4-2-2. How to set up EMETH Node for Ubuntu users

This guide provides a comprehensive, step-by-step procedure for setting up an EMETH Node on a Ubuntu Linux OS.

## ◇ Set up flow

1. Initial Environment Preparation
2. Operation with Node.js
3. Operation with EMETH NODE
4. (Optional) Persistence by Process-Manager

Preparation of initial environment\
Install Ubuntu, MetaMask, and create an account (wallet address) for Emeth Node.

## 1. Initial Environment Preparation <a href="#id-0e4a" id="id-0e4a"></a>

Install Ubuntu, MetaMask, create account (wallet address) for Emeth Node

### **◇** Ubuntu Installation Reference

<https://www.youtube.com/watch?v=wjbbl0TTMeo>

### ◇Guide for how to prepare MATIC

Procure MATIC tokens and put them in MetaMask.

How to buy Polygon MATIC tokens easy way.

<https://www.youtube.com/watch?v=n8TwB79My-I>

## 2. operation with Node.js <a href="#id-2540" id="id-2540"></a>

### (1) Install nvm stable version of Node.js

> *$ curl* [*https://raw.githubusercontent.com/creationix/nvm/master/install.sh*](https://raw.githubusercontent.com/creationix/nvm/master/install.sh) *| bash $ source \~/.profile*\
> \&#xNAN;*$ nvm install v18.17.1*

Check installed node and npm versions

> *$ node -v*\
> \&#xNAN;*v18.17.1*\
> \&#xNAN;*$ npm -v*\
> \&#xNAN;*9.6.7*

### (2) Installing Docker

> *$ sudo apt update*\
> \&#xNAN;*$ sudo mkdir -p /etc/apt/keyrings*\
> \&#xNAN;*$ curl -fsSL* [*https://download.docker.com/linux/ubuntu/gpg*](https://download.docker.com/linux/ubuntu/gpg) *| sudo gpg — dearmor -o /etc/apt/keyrings/docker.gpg*\
> \&#xNAN;*$ echo “deb \[arch=$(dpkg — print-architecture) signed-by=/etc/apt/keyrings/docker.gpg]* [*https://download.docker.com/linux/ubuntu*](https://download.docker.com/linux/ubuntu) *$(lsb\_release -cs) stable” | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null*\
> \&#xNAN;*$ sudo apt update*\
> \&#xNAN;*$ sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin*

Check installed Docker version

> *$ docker -v*\
> \&#xNAN;*Docker version 24.0.6, build ed223bc*

### **(3) Setting Docker Execution Permissions**

> *$ sudo groupadd -f docker*\
> \&#xNAN;*$ sudo usermod -aG docker $USER $ newgrp docker*

## 3. operation with EMETH NODE <a href="#id-8140" id="id-8140"></a>

### **(1) Installation of EMETH Node**

> *$ mkdir emeth-node*\
> \&#xNAN;*$ cd emeth-node*\
> \&#xNAN;*$ wget* [*https://github.com/alt-emeth/emeth-node/releases/download/v0.8.1/emeth-node.zip*](https://github.com/alt-emeth/emeth-node/releases/download/v0.8.1/emeth-node.zip)\
> \&#xNAN;*$ unzip emeth-node*\
> \&#xNAN;*$ rm emeth-node.zip*

### **(2) Editing Configuration Files**

> *$ cp config/emeth-node.json.example config/emeth-node.json*\
> \&#xNAN;*$ vi config/emeth-node.json*

### **(3) Setting items**

config/emeth-code.json:

<figure><img src="https://miro.medium.com/v2/resize:fit:700/1*fCOKbxTvGPukiovPCNN4Bg.png" alt="" height="150" width="700"><figcaption></figcaption></figure>

**Here are the list of items you don’t need to change from “Sample Value”.**\
\&#xNAN;**\*You need to prepare and fill“endpoint” and “privateKey” by yourself.**

> *・cacheServerUrl*\
> [*https://cache.emeth.ai/api/v1/jobs*](https://cache.emeth.ai/api/v1/jobs)
>
> *・storageApiUrl*\
> [*https://storage.emeth.ai/api/v1/*](https://storage.emeth.ai/api/v1/)
>
> *・emethCoreContractAddress: 0x5aF9c255D6C965aAa8DB3e9C82276e59345186C8*
>
> *・emethTokenContractAddress: 0xCB746131b75f30942de7C59a5Be1393Fca5Be05D*

### (4) Starting EMETH Node

> *$ node bundle.js*

If you want to process only one job for testing, the following options are available

> *$ node bundle.js — iterations 1*

## 4.(Optional) Persistence by Process-Manager <a href="#id-9b3b" id="id-9b3b"></a>

### **(1) Install pm2** <a href="#id-2f63" id="id-2f63"></a>

> *$ npm install -g pm2*

### **(2) Run** EMETH **Node persistently**

> *$ pm2 start bundle.js — name emeth-node*

### **(3)** EMETH **Node Process checking**

> *$ pm2 list*

or

> *$ pm2 monit*

### **(4)** EMETH **Node log tracking**

> *$ pm2 logs emeth-node*

## ◇ Inquiries <a href="#aafd" id="aafd"></a>

If you encounter any errors or have any questions, please contact us in the Discord channel.\
Discord: <https://discord.gg/wRAS5PhWUb>


---

# 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://emeth-1.gitbook.io/emeth-white-paper-en/4.-node/4-2.-how-to-become-a-emeth-node/4-2-2.-how-to-set-up-emeth-node-for-ubuntu-users.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.
