Giter VIP home page Giter VIP logo

libbtctools's Introduction

A core library of BTCTools

libbtctools is a library of BTCTools, it provides the basic ability of scanning, configuration and rebooting some miners.

It can build on Windows, Linux and macOS, as dynamic or static library.

Dependency

There are 4 dependencies:

  • Boost 1.59 or later (1.65 or later is validated and recommended)
  • OpenSSL (both 1.0 or 1.1 are OK)
  • Lua-5.1 or LuaJIT-2.0 (LuaJIT is recommended but incompatibly with macOS)
  • Crypto++ (5.6.5 or later) And libpthread is required on Linux and macOS.

Build on Linux

Example on Ubuntu 18.04 x64:

# build tools
apt-get install -y build-essential autotools-dev libtool autoconf automake pkg-config cmake gcc g++

# install boost via apt
apt install libboost-all-dev

# or build boost 1.65 if you want (optional)
wget https://dl.bintray.com/boostorg/release/1.65.1/source/boost_1_65_1.tar.gz
tar zxf boost_1_65_1.tar.gz
cd boost_1_65_1
./bootstrap.sh
./b2
./b2 install

# install other dependencies
apt update
apt install libssl-dev libluajit-5.1-dev libcrypto++-dev

# clone and build
git clone https://github.com/btccom/libbtctools.git
cd libbtctools
mkdir build
cd build

# build as static library
cmake -DCMAKE_INSTALL_PREFIX=/opt/btctools -DBTCTOOLS__LIB_TYPE=STATIC ..
make
make install

# or build as dynamic library
cmake -DCMAKE_INSTALL_PREFIX=/opt/btctools -DBTCTOOLS__LIB_TYPE=SHARED ..
make
make install

# running demos
cd /opt/btctools/bin/btctools
./ipGeneratorDemo
./scanMinerDemo
./configMinerDemo
./rebootMinerDemo

Build on macOS

It seems like build on Linux. Search and install dependencies with brew first.

Tips: install lua-5.1 instead of luajit-2.0. The demo will segmentation fault with luajit-2.0 and I don't know the reason.

The command will be:

brew install boost openssl [email protected] cryptopp

# static library
cmake -DCMAKE_INSTALL_PREFIX=/opt/btctools -DBTCTOOLS__LIB_TYPE=STATIC -DBTCTOOLS__LUA_TYPE=NORMAL ..

# or dynamic library
cmake -DCMAKE_INSTALL_PREFIX=/opt/btctools -DBTCTOOLS__LIB_TYPE=SHARED -DBTCTOOLS__LUA_TYPE=NORMAL ..

# build & install
make
make install

Build on Windows

install vcpkg

See https://github.com/Microsoft/vcpkg/ for more details.

Quick Steps:

git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
.\bootstrap-vcpkg.bat
.\vcpkg integrate install

Example output for .\vcpkg integrate install:

PS G:\work\vcpkg> .\vcpkg integrate install Applied user-wide integration for this vcpkg root.

All MSBuild C++ projects can now #include any installed libraries. Linking will be handled automatically. Installing new libraries will make them instantly available.

CMake projects should use: "-DCMAKE_TOOLCHAIN_FILE=G:/work/vcpkg/scripts/buildsystems/vcpkg.cmake"

install packages via vcpkg

32bit

.\vcpkg install boost:x86-windows-static openssl:x86-windows-static cryptopp:x86-windows-static luajit:x86-windows-static

64bit

.\vcpkg install boost:x64-windows-static openssl:x64-windows-static cryptopp:x64-windows-static luajit:x64-windows-static

cmake & build

32bit

cmake -DCMAKE_BUILD_TYPE=Release -A win32 -DCMAKE_TOOLCHAIN_FILE=G:/work/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x86-windows-static -DBTCTOOLS__STATIC_LINKING_VC_LIB=ON -DBTCTOOLS__LIB_TYPE=STATIC -DCMAKE_INSTALL_PREFIX=%appdata%\lib32\btctools ..
start libbtctools.sln

64bit

cmake -DCMAKE_BUILD_TYPE=Release -A x64 -DCMAKE_TOOLCHAIN_FILE=G:/work/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static -DBTCTOOLS__STATIC_LINKING_VC_LIB=ON -DBTCTOOLS__LIB_TYPE=STATIC -DCMAKE_INSTALL_PREFIX=%appdata%\lib\btctools ..
start libbtctools.sln

Replace G:/work/vcpkg/scripts/buildsystems/vcpkg.cmake to your vcpkg.cmake path.

Build the INSTALL project to install.

libbtctools's People

Contributors

swimmingtiger avatar jacobhot avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.