Giter Site home page Giter Site logo

natpdeveloper / leap Goto Github PK

View Code? Open in Web Editor NEW

This project forked from antelopeio/leap

0.0 0.0 0.0 135.81 MB

C++ implementation of the Antelope protocol

License: Other

Shell 0.29% JavaScript 0.02% C++ 52.75% Python 4.91% C 0.14% Objective-C 0.01% Assembly 0.01% CMake 0.86% Dockerfile 0.03% WebAssembly 41.00%

leap's Introduction

Leap

Leap is blockchain node software and supporting tools that implements the Antelope protocol.

Repo Organization

main branch is the development branch: do not use this for production. Refer to the release page for current information on releases, pre-releases, and obsolete releases as well as the corresponding tags for those releases.

Software Installation

Visit the release page for Ubuntu binaries. This is the fastest way to get started with the software.

Building From Source

Recent Ubuntu LTS releases are the only Linux distributions that we fully support. Other Linux distros and other POSIX operating systems (such as macOS) are tended to on a best-effort basis and may not be full featured. Notable requirements to build are:

  • C++17 compiler and standard library
  • boost 1.67+
  • CMake 3.8+
  • (for Linux only) LLVM 7 - 11 (newer versions do not work)

A few other common libraries are tools also required such as openssl 1.1+, libcurl, curl, libusb, GMP, Python 3, and zlib.

A Warning On Parallel Compilation Jobs (-j flag): When building C/C++ software often the build is performed in parallel via a command such as make -j $(nproc) which uses the number of CPU cores as the number of compilation jobs to perform simultaneously. However, be aware that some compilation units (.cpp files) in Leap are extremely complex and will consume nearly 4GB of memory to compile. You may need to reduce the level of parallelization depending on the amount of memory on your build host. e.g. instead of make -j $(nproc) run make -j2. Failures due to memory exhaustion will typically but not always manifest as compiler crashes.

Generally we recommend performing what we refer to as a "pinned build" which ensures the compiler and boost version remain the same between builds of different Leap versions (Leap requires these versions remain the same otherwise its state needs to be repopulated from a portable snapshot).

Building Pinned Build Binary Packages

In the directory <leap src>/scripts you will find the two scripts install_deps.sh and pinned_build.sh. If you haven't installed build dependencies then run install_deps.sh. Then run pinned_build.sh <dependencies directory> <leap build directory> <number of jobs>.

The dependencies directory is where the script will pull the C++ dependencies that need to be built with the pinned compiler for building the pinned binaries for binary packaging.

The binary package will be produced in the Leap build directory that was supplied.

Manual (non "pinned") Build Instructions

Ubuntu 20.04 & 22.04 Build Instructions

Install required dependencies:

apt-get update && apt-get install   \
        build-essential             \
        cmake                       \
        curl                        \
        git                         \
        libboost-all-dev            \
        libcurl4-openssl-dev        \
        libgmp-dev                  \
        libssl-dev                  \
        libusb-1.0-0-dev            \
        llvm-11-dev                 \
        pkg-config

and perform the build:

git submodule update --init --recursive
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j $(nproc) package
Ubuntu 18.04 Build Instructions

Install required dependencies. You will need to build Boost from source on this distribution.

apt-get update && apt-get install   \
        build-essential             \
        cmake                       \
        curl                        \
        g++-8                       \
        git                         \
        libcurl4-openssl-dev        \
        libgmp-dev                  \
        libssl-dev                  \
        libusb-1.0-0-dev            \
        llvm-7-dev                  \
        pkg-config                  \
        python3                     \
        zlib1g-dev
        
curl -L https://boostorg.jfrog.io/artifactory/main/release/1.79.0/source/boost_1_79_0.tar.bz2 | tar jx && \
   cd boost_1_79_0 &&                                                                                     \
   ./bootstrap.sh --prefix=$HOME/boost1.79 &&                                                             \
   ./b2 --with-iostreams --with-date_time --with-filesystem --with-system                                 \
        --with-program_options --with-chrono --with-test -j$(nproc) install &&                            \
   cd ..

and perform the build:

git submodule update --init --recursive
mkdir build
cd build
cmake -DCMAKE_C_COMPILER=gcc-8 -DCMAKE_CXX_COMPILER=g++-8 \
      -DCMAKE_PREFIX_PATH="$HOME/boost1.79;/usr/lib/llvm-7/"  -DCMAKE_BUILD_TYPE=Release .. \
make -j $(nproc) package

After building you may remove the $HOME/boost1.79 directory, or you may keep it around until next time building the software.

Running Tests

When building from source it's recommended to run at least what we refer to as the "parallelizable tests". Not included by default in the "parallelizable tests" are the WASM spec tests which can add additional coverage and can also be run in parallel.

cd build

# "parallelizable tests": the minimum test set that should be run
ctest -j $(nproc) -LE _tests

# Also consider running the WASM spec tests for more coverage
ctest -j $(nproc) -L wasm_spec_tests

Some other tests are available and recommended but be aware they can be sensitive to other software running on the same host and they may SIGKILL other nodeos instances running on the host.

cd build

# These tests can't run in parallel but are recommended.
ctest -L "nonparallelizable_tests"

# These tests can't run in parallel. They also take a long time to run.
ctest -L "long_running_tests"

leap's People

Contributors

arhag avatar asiniscalchi avatar b1bart avatar brianjohnson5972 avatar bytemaster avatar cj-oci avatar claytoncalabrese avatar dskvr avatar elmato avatar heifner avatar jgiszczak avatar kj4ezj avatar larryk85 avatar linh2931 avatar lparisc avatar moskvanaft avatar nathanielhourt avatar ndcgundlach avatar norsegaud avatar oschwaldp-oci avatar paulcalabrese avatar pmesnier avatar scottarnette avatar sergmetelin avatar spoonincode avatar taokayan avatar tbfleming avatar vladtr avatar wanderingbort avatar zorba80 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.