# 4-2-2. Ubuntu Linux版EMETHノード導入の方法

### ◇導入の流れ <a href="#a656" id="a656"></a>

1. **初期環境の準備**
2. **Node.jsによる動作**
3. **EMETHノードによる操作**
4. **(オプション)プロセス・マネージャによる永続化**

## **1.初期環境の準備** <a href="#id-6988" id="id-6988"></a>

・Ubuntuのインストール、MetaMask、EMETHノード用のアカウント(ウォレットアドレス)を作成

### **◇Ubuntuの導入参考**

<https://www.youtube.com/watch?v=wjbbl0TTMeo>\
<https://www.partitionwizard.jp/partitionmagic/install-linux-on-windows-10.html>

### ◇MATICの準備および送金方法参考リンク

・MATICを調達し、MetaMaskに入れておく

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

## 2. **Node.jsによる操作** <a href="#id-2224" id="id-2224"></a>

### **(1) nvm 安定版 Node.js のインストール**

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

**インストールされたnodeおよびnpmのバージョン確認**

> $ ノード -v\
> v18.17.1\
> $ npm -v\
> 9.6.7

### (2) 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*

**インストールされた Docker のバージョン確認**

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

### **(3) Dockerの実行権限の設定**

> $ sudo groupadd -f docker\
> $ sudo usermod -aG docker $USER $ newgrp docker

## **3. EMETH NODEによる操作** <a href="#id-6d98" id="id-6d98"></a>

### **(1) EMETH ノードのインストール**

> *$ 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) 設定ファイルの編集**

> $ cp config/emeth-node.json.example config/emeth-node.json\
> $ vi config/emeth-node.json

### **(3) 設定項目**

config/emeth-code.json:

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

\
\&#xNAN;**※endpointとprivateKeyはそれぞれの値を入力してください。**

> ・cacheServerUrl\
> <https://cache.emeth.ai/api/v1/jobs>
>
> ・storageApiUrl\
> <https://storage.emeth.ai/api/v1/>
>
> ・emethCoreContractAddress: 0x5aF9c255D6C965aAa8DB3e9C82276e59345186C8
>
> ・emethTokenContractAddress: 0xCB746131b75f30942de7C59a5Be1393Fca5Be05D

### **(4) EMETHノードの起動**

> *$ node bundle.js*

テストのためにジョブを１つだけ処理したい場合には以下のオプション

> *$ node bundle.js — iterations 1*

## ４.(オプション)プロセス・マネージャによる永続化 <a href="#ed52" id="ed52"></a>

### **(1) pm2のインストール**

> $ npm install -g pm2

### **(2)** EMETH**ノードを永続起動**

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

### **(3)** EMETH**ノードプロセス確認**

> *$ pm2 list*

または

> *$ pm2 monit*

### **(4)** EMETH**ノードのログ追跡**

> *$ pm2 logs emeth-node*

### ◇ Ubuntuの関連リンク <a href="#cc33" id="cc33"></a>

**Ubuntu 日本語ページ :** <https://www.ubuntulinux.jp/download>

### **◇お先問合せ** <a href="#id-9a6f" id="id-9a6f"></a>

エラーやご不明な点のある方は以下のDiscordよりお問い合わせください

公式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-v.1.0.-jp/4-ndo/4-2-emethndo/4-2-2-ubuntu-linuxemethndono.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.
