Skip to content
This repository has been archived by the owner on Sep 21, 2022. It is now read-only.

Launching the Miner Non Technical

themandalore edited this page Sep 26, 2019 · 7 revisions

The following is documentation on launching the miner from a new AWS Linux box. It was written for the non-technical audience

Table of Contents

How to launch the miner

This instructions describe how to install the miner to a clean AWS Ubuntu/Linux box that is at minimum a t2.small (or you will run into data limitations).

You will be creating 7 files using the nano command and copying and pasting the code included below for each file.

  • Open a terminal connected to your AWS instance and run the following commands:
sudo apt-get update

wget https://github.com/tellor-io/TellorMiner/releases/latest/download/TellorMiner 

nano config.json
  • Update the following three variables within the config.json file below:

node_url: (enter your own infura / node address) publicAddress: (note no “0x” prefix) privateKey: (note no “0x” prefix)

config.json

{
    "contractAddress": "0x0Ba45A8b5d5575935B8158a88C631E9F9C95a2e5",
    "nodeURL": "https://mainnet.infura.io/v3/7bbbbbbbbbbbbbbb",
    "privateKey": "4bdc16637633fa4b4854670fbb83fa254756798009f5bbbbbbbbbbbbbbbbbbbbbb",
    "databaseURL":"http://localhost7545",
    "publicAddress": "e037ec8ec9ec4238bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
    "serverHost": "localhost",
    "serverPort": 5000,
    "ethClientTimeout": 3000,
    "trackerCycle": 10,
    "requestData":0,
 "trackers": [
        "balance",
        "currentVariables",
        "disputeStatus",
        "gas",
        "top50",
        "tributeBalance",
        "fetchData",
        "psr"
    ],
    "dbFile": "/tmp/tellor/tellor_db"
}
  • Copy and paste the code into the terminal and use the hot keys below to save config.json
Ctrl + o
Enter
Ctrl + x
  • Now go and get the loggingConfig file and psr.json files

wget https://raw.githubusercontent.com/tellor-io/TellorMiner/master/loggingConfig.json

wget https://raw.githubusercontent.com/tellor-io/TellorMiner/master/psr.json

  • Run the following commands from the terminal:
sudo apt install nodejs 

sudo apt install npm 

sudo npm i -g pm2

chmod +x TellorMiner

chmod +x runMiner.sh


./TellorMiner -deposit -psrPath=./psr.json -config=./config.json -logConfig=./loggingConfig.json

nano ecosystem.config.js
  • Copy and paste the code below on the terminal to ecosystem.config.js:

Note: be sure to check that the path to the runMiner.sh file is correct (e.g. are you home/ubuntu)

module.exports = { apps : [ { name: "tellor-miner1", script: "/home/ubuntu/runMiner.sh", exec_mode: "fork", exec_interpreter: "bash"} ] }
  • Use the hot keys below to save the ecosystem.config.js and create runMiner.sh:
Ctrl + o
Enter
Ctrl + x

nano runMiner.sh

runMiner.sh

#!/bin/sh
$HOME/TellorMiner -config=$HOME/config.json -miner -dataServer -psrPath=$HOME/psr.json -logConfig=$HOME/loggingConfig.json
  • Use the hot keys below to save the ecosystem.config.js and create ecosystem.config.js:
Ctrl + o
Enter
Ctrl + x

pm2 start ./ecosystem.config.js

How to update the miner

  • Open a terminal

  • Stop the process by running:

pm2 stop all
  • To update PSR run:
nano PSR.json

[paste the new PSR file]

  • Use the hot keys below to save psr.json:
Ctrl + o
Enter
Ctrl + x
  • To update Tellor miner run:
wget https://github.com/tellor-io/TellorMiner/releases/latest/download/TellorMiner 
  • Once you have made the updates either to the psr.json or the miner run:
pm2 restart all

**To clear logs:

rm -rf ~/.pm2/logs/* To empty database:
find /tmp -ctime +1 -exec rm -rf {} +