Service Torrent node setup

Instruction on the GitHub LINK


Be sure to read the instructions on setting up the #MetaGate node here


Please pay attention that this package can be installed on devices running UBUNTU 18 (20 is also suitable).

Please check if you have required libraries:

cmake > 3.8
gcc > 8.0
libevent 2.1.8

Please follow these steps to build and run Torrent:

1. Preparation

sudo apt install software-properties-common
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update

sudo apt install gcc-8 g++-8 liburiparser-dev libssl-dev libevent-dev git automake libtool texinfo make libgmp-dev libcurl4-openssl-dev libgcrypt20-dev libgnutls28-dev libboost-dev libre2-dev libgoogle-perftools-dev

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 60 --slave /usr/bin/g++ g++ /usr/bin/g++-8
sudo update-alternatives --config gcc

2. Get and compile latest cmake

cd /tmp
tar zxfv cmake-3.13.0.tar.gz
cd cmake-3.13.0
make -j$(nproc)
sudo make install

3. Get and compile libevent

cd /tmp
tar zxfv libevent-2.1.8-stable.tar.gz
cd libevent-2.1.8-stable
make -j$(nproc)
sudo make install

4. Get and compile libmicrohttpd2
Please note: you must use this libmicrohttpd2 library, because the original libmicrohttpd library has no all functions available which are necessary for running Torrent.

cd /tmp
git clone
cd libmicrohttpd2
make -j$(nproc)
sudo make install

5. Get and compile libmhsupport

cd /tmp
git clone
cd libmhsupport/build
sudo make install

6. Build Torrent Node

cd /tmp
git clone torrent_node
cd torrent_node/build
git checkout master
git submodule update --init
cmake .. && make

To run torrent, you have to add the file containing your private key to the folder containing torrent (/opt/mh-torrent). The file’s name must be as follows: wallet address.raw.prv. Create the file with this name and put private key in HEX format inside. Сlick here for information about where to get the private key in HEX format.

Name of the file - 0x007ff2d508be12392be5a381ca07b55c8fd02d09192a9b5cf4.raw.prv
Content of the file (in HEX format) -


Besides, you have to configure your config file (/opt/mh-torrent/config.conf). To do it, add the row with the name of your file containing private key or, if the row sign_key = ... already exists, replace the private key with your key in it.

Example: sign_key = "0x007ff2d508be12392be5a381ca07b55c8fd02d09192a9b5cf4".

Script for starting, stopping, restarting

Script for the following operations with Metahash torrent application:

  • starting,
  • stopping,
  • restarting,
  • getting status.

Note: default workdir is /opt/torrent. If you’ve install torrent to another location please change workdir in script.

RUN script as follows:

./ status

Update torrent to recent version

  1. Stop running torrent:

kill ps axuwf|grep torrent_node|grep -v grep|awk '{print $2}'

  1. Go to directory where you've cloned torrent_node, for example:

*cd /tmp/torrent_node

git pull
cd build
rm -rf
cmake ..
make -j$(nproc)*

  1. Start torrent:

./torrent_node torrent_config