超级账本子项目 iroha 私链部署

安装

  ==尽量采用高版本的Ubuntu内核版本或GCC版本==

依赖包

  • 下载 iroha

    git clone -b https://github.com/hyperledger/iroha
  • 环境配置

    sudo apt-get install build-essential python-software-properties automake libtool \
    libssl-dev zlib1g-dev  libc6-dbg golang \
    ca-certificates lcov  cmake iputils-ping ccache gcovr vera++\
    cppcheck doxygen graphviz graphviz-dev libgtest-dev libgflags-dev
    
    • cmake

      
      # 下载 cmake 安装脚本wget https://cmake.org/files/v3.10/cmake-3.10.3-Linux-x86_64.sh# 安装sudo sh cmake-3.10.3-Linux-x86_64.sh# 根据提示选择安装路径# 配置环境变量 修改 .bashrcvim ~/.bashrc
      export PATH="/cmake/install/path/bin:$PATH"# 加载环境变量source ~/.bashrc
    • boost

      ==注: Boost v1.65运行正常, v1.66运行 coredump==

      
      # download boostwget https://dl.bintray.com/boostorg/release/1.65.0/source/boost_1_65_0.tar.gz# 编译./bootstrap.sh --with-libraries=system,filesystem 
      ./b2
    • libcares

      
      # 编译安装wget https://c-ares.haxx.se/download/c-ares-1.14.0.tar.gz
      ./configure
      make && sudo make install
    • protobuf

      
      # 编译添加fPIC 解决静态库依赖错误./configure CXXFLAGS=-fPIC
      make && sudo make install

    ==注: 编译Google全家桶时,修改gcc 版本对应的cplusplus c++config.h 文件中的宏 _GLIBCXX_USE_CXX11_ABI 为0 ; 例如: /usr/include/x86_64-linux-gnu/c++/6/bits/c++config.h
    ; 否则后续编译可能会出现 动态库引用 undefined==

    • grpc
      
      # 安装依赖包sudo apt-get install libgoogle-perftools-dev build-essential\
      autoconf libtool pkg-config# 下载最新代码包git clone https://github.com/grpc/grpc.git
      git submodule update --initmake && sudo make instal

    若GCC版本过低可能会遇见如下问题:

    
    # grpc_cpp_plugin 运行 coredumpterminate called after throwing an instance of 'std::system_error

    解决方案, 修改Makefile, 添加 -Wl,--no-as-needed 编译参数, 具体参考Stackoverflow: terminate called after throwing an instance of ‘std::system_error’

    379 ifeq ($(SYSTEM),Linux)
    380 LIBS = dl rt m pthread
    381 LDFLAGS += -pthread -Wl,--no-as-needed
    382 endif
    383 
    384 ifeq ($(SYSTEM),MINGW32)
    385 LIBS = m pthread ws2_32
    386 LDFLAGS += -pthread
    387 endif

编译

  • 编译

    
    # 运行 cmake 生成 build 文件; binaries package cmake 添加参数 -DPACKAGE_ZIP=ONborey-zhu@AWS-TEST-DT:~/blockchain/iroha$ cmake -H. -DCMAKE_BUILD_TYPE=Release -Bbuild
    -- The C compiler identification is GNU 6.3.0
    -- The CXX compiler identification is GNU 6.3.0
    -- Check for working C compiler: /usr/bin/cc
    -- Check for working C compiler: /usr/bin/cc -- works
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Check for working CXX compiler: /usr/bin/c++
    -- Check for working CXX compiler: /usr/bin/c++ -- works
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    -- -DCMAKE_BUILD_TYPE=Release
    -- -DTESTING=ON
    -- -DBENCHMARKING=OFF
    -- -DFUZZING=OFF
    -- -DCOVERAGE=OFF
    -- -DPACKAGE_ZIP=OFF
    -- -DPACKAGE_TGZ=OFF
    -- -DPACKAGE_RPM=OFF
    -- -DPACKAGE_DEB=OFF
    -- -DENABLE_LIBS_PACKAGING=ON
    -- -DSWIG_PYTHON=OFF
    -- -DSWIG_JAVA=OFF
    -- -DSUPPORT_PYTHON2=OFF
    -- -DSWIG_CSHARP=OFF
    -- -DSHARED_MODEL_DISABLE_COMPATIBILITY=OFF
    
    # 缺失包 https://github.com/google/googletest-- Could NOT find gtest (missing: gtest_LIBRARY gtest_MAIN_LIBRARY gmock_INCLUDE_DIR gmock_LIBRARY gmock_MAIN_LIBRARY) 
    
    # 缺失包 https://github.com/gabime/spdlog.git-- Could NOT find spdlog (missing: spdlog_INCLUDE_DIR) 
    -- Found protobuf: /usr/local/include  
    -- Found grpc: /usr/local/lib/libgrpc.so  
    
    # 缺失包 https://github.com/miloyip/rapidjson.git-- Could NOT find rapidjson (missing: rapidjson_INCLUDE_DIR) 
    
    # 缺失包 https://git.postgresql.org/git/postgresql.git-- Could NOT find pq (missing: pq_INCLUDE_DIR postgres_INCLUDE_DIR pq_LIBRARY pg_config_EXECUTABLE) 
    
    # 缺失包 https://github.com/jtv/libpqxx.git-- Could NOT find pqxx (missing: pqxx_INCLUDE_DIR pqxx_LIBRARY) 
    
    # 缺失包 https://github.com/Reactive-Extensions/rxcpp.git-- Could NOT find rxcpp (missing: rxcpp_INCLUDE_DIR) 
    
    # 缺失包 https://github.com/01org/tbb.git-- Could NOT find tbb (missing: tbb_INCLUDE_DIR tbb_LIBRARY) 
    -- Boost version: 1.65.0
    -- Found the following Boost libraries:
    --   filesystem
    --   system
    
    # 缺失包 https://github.com/hyperledger/iroha-ed25519-- Could NOT find ed25519 (missing: ed25519_INCLUDE_DIR ed2551


本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!

相关文章

立即
投稿

微信公众账号

微信扫一扫加关注

返回
顶部