• 比特币编译(Ubuntu 16.04)


    • 安装比特币需要的所有库
    sudo apt-get install build-essential libtool autotools-dev automake pkg-config libssl-dev libevent-dev bsdmainutils python3
    
    sudo apt-get install libboost-all-dev
    
    • GUI:关于QT的各种库
    sudo apt-get install libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev protobuf-compiler
    

      出现了错误,有些包无法下载:

      解决方法:参考 https://blog.csdn.net/tiny_lxf/article/details/75027865

    sudo vim /etc/resolv.conf 
    修改 nameserver 8.8.8.8
    

      再次运行上面的GUI安装,成功

    • git源码
    sudo apt-get install git
    git clone https://github.com/bitcoin/bitcoin.git
    • 安装Berkeley DB:推荐使用Berkeley DB 4.8
    cd bitcoin
    ./contrib/install_db4.sh `pwd`
    
    • 配置
    ./autogen.sh
    ./configure
    

      出现报错:原因是找不到berkeleyDB的相关头文件导致的(参考 https://blog.csdn.net/xocoder/article/details/78914576

    报错:libdb_cxx headers missing, Bitcoin Core requires this library for wallet functionality (–disable-wallet to disable wallet functionality)

       上面安装db的脚本执行后其实会提示:

    When compiling bitcoind, run `./configure` in the following way:

    export BDB_PREFIX='/home/zhang/bitcoin/db4'
    ./configure BDB_LIBS="-L${BDB_PREFIX}/lib -ldb_cxx-4.8" BDB_CFLAGS="-I${BDB_PREFIX}/include" ...

    所以,应当设置bash环境变量BDB_PREFIX为刚才指定的安装目录,并在configure时,提供这个环境变量

    解决步骤:

    vim ~/.bashrc
    export BDB_PREFIX='/home/zhang/bitcoin/db4'
    
    source ~/.bashrc
    ./configure BDB_LIBS="-L${BDB_PREFIX}/lib -ldb_cxx-4.8" BDB_CFLAGS="-I${BDB_PREFIX}/include"
    • 编译
    make
    make install 

    出现错误:

    [install-libLTLIBRARIES] Error 1

    [install-recursive] Error 1

    解决方法:

    sudo make install
    • 测试
    $ which bitcoind
    /usr/local/bin/bitcoind
    $ which bitcoin-cli
    /usr/local/bin/bitcoin-cli

      

    bitcoind
    bitcoin-qt
    bitcoin-cli

    or
    ./src/bitcoind
    ./src/qt/bitcoin-qt
    ./src/bitcoin-cli

      

    安装过程参考:

    https://blog.csdn.net/u011609555/article/details/79660086

    https://github.com/bitcoin/bitcoin/blob/master/doc/build-unix.md

    https://blog.csdn.net/aaadssdffff/article/details/52992688

  • 相关阅读:
    BOI 2002 双调路径
    BOI'98 DAY 2 TASK 1 CONFERENCE CALL Dijkstra/Dijkstra+priority_queue/SPFA
    USACO 2013 November Contest, Silver Problem 2. Crowded Cows 单调队列
    BOI 2003 Problem. Spaceship
    USACO 2006 November Contest Problem. Road Blocks SPFA
    CEOI 2004 Trial session Problem. Journey DFS
    USACO 2015 January Contest, Silver Problem 2. Cow Routing Dijkstra
    LG P1233 木棍加工 动态规划,Dilworth
    LG P1020 导弹拦截 Dilworth
    USACO 2007 February Contest, Silver Problem 3. Silver Cow Party SPFA
  • 原文地址:https://www.cnblogs.com/zhang-qc/p/8677417.html
Copyright © 2020-2023  润新知