# Installation

### Automated Installation

This installer provides an easy way to automate the installation process of an Ethernity Node as much as possible.

Features:

* Automates the system update, and runs the ansible-playbook installation process
* Asks the user to generate (using the “ethkey” tool) or to input wallet details from console (node and result)
* Checks wallet balance for Bergs (continues only if Bergs > 0)
* Validates wallet for wrong input
* Prevents the user to continue if the node wallet is the same as the result wallet
* Restarts the system automatically after the system and kernel is updated

#### 1. Clone the repository to the home folder and run it

```
$ cd && git clone https://github.com/ethernity-cloud/mvp-pox-node.git
$ cd mvp-pox-node
$ ./etny-node-installer.sh
```

#### 2. Run the script again after system restart

```
$ cd mvp-pox-node
$ ./etny-node-installer.sh
```

### Maual Installation

#### 1. Install ansible

```
$ sudo apt update
$ sudo apt -y install software-properties-common
$ sudo apt-add-repository --yes --update ppa:ansible/ansible
$ sudo apt -y install ansible
```

#### 2. Clone the repository

```
$ git clone https://github.com/ethernity-cloud/mvp-pox-node.git
```

#### 3. Install the kernel with SGX support

```
$ cd mvp-pox-node
$ sudo ansible-playbook -i localhost, playbook.yml \
  -e "ansible_python_interpreter=/usr/bin/python3"
```

After the first run of the script, the new kernel(with SGX support) is installed and the following message will be displayed:

```
ok: [localhost] => {
    "msg": "The kernel has been updated, a reboot is required"
}
```

Reboot the system as requested.

#### 4. Create config file (please use your own wallets):

```
$ cd mvp-pox-node
$ cat << EOF > config
PRIVATE_KEY=AE6AE8E5CCBFB04590405997EE2D52D2B330726137B875053C36D94E974D162F
EOF
$
```

#### 5. Start the node

```
$ cd mvp-pox-node
$ sudo ansible-playbook -i localhost, playbook.yml \
  -e "ansible_python_interpreter=/usr/bin/python3"
```

After the second run of the script the node should be successfully installed and the following message will be seen on the screen:

```
ok: [localhost] => {
    "msg": "Ethernity NODE installation successful"
}
```

#### 6. Check if the service is running correctly.

Service status can be seen by running the below command.

```
systemctl status etny-vagrant.service
```
