This repository contains the Proxy Node source code written in C++. There are two internal libraries: libmicrohttpd2 and libmhsupport used in this code.
Pre-built binary for ubuntu 14/16/18 available here: releases.
cmake > 3.8
gcc > 8.0
libevent 2.1.8
Please follow these steps to build and run Proxy on Ubuntu 14.04 x64:
- Preparation
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
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
- Get and compile latest cmake
cd /tmp
wget https://github.com/Kitware/CMake/releases/download/v3.13.0/cmake-3.13.0.tar.gz
tar zxfv cmake-3.13.0.tar.gz
cd cmake-3.13.0
./bootstrap
./configure
make
sudo make install
- Get and compile libevent
cd /tmp
wget https://github.com/libevent/libevent/releases/download/release-2.1.8-stable/libevent-2.1.8-stable.tar.gz
tar zxfv libevent-2.1.8-stable.tar.gz
cd libevent-2.1.8-stable
./configure
make
sudo make install
- 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 Proxy.
cd /tmp
git clone https://github.com/metahashorg/libmicrohttpd2
cd libmicrohttpd2
./bootstrap
./configure
make
sudo make install
- Get and compile libmhsupport
cd /tmp
git clone https://github.com/metahashorg/libmhsupport
cd libmhsupport/build
./build.sh
sudo make install
- Build Proxy Node
cd /tmp
git clone https://github.com/metahashorg/node_proxy
cd node_proxy/build
./build.sh
- Stop running proxy:
kill `ps axuwf|grep proxy_config|grep -v grep|awk '{print $2}'`
- Go to directory where you've cloned node_proxy, for example
cd /tmp/node_proxy
git pull
cd build
rm -rf
cmake ..
make -j
- Start proxy:
./proxy proxy_key proxy_config 9999 1000000
Script proxy.sh for the following operations with Metahash proxy application:
- starting,
- stopping,
- restarting,
- getting status.
Note: default workdir is /opt/proxy
. If you’ve install proxy to another location please change workdir in script.
RUN script as follows:
./proxy.sh status