libbitcoin / libbitcoin-build

Libbitcoin Build System
Other
16 stars 25 forks source link

Failure to make latest master of version4? #298

Closed magikRUKKOLA closed 1 year ago

magikRUKKOLA commented 1 year ago

I had been trying to build a version of bx command line tool that supports witness payment addresses (that is, commands ec-to-witness and witness-to-key).

So the problem was that the install.sh pull the latest master of each required project:

create_from_github libbitcoin libbitcoin-system master "yes"
build_from_github libbitcoin-system "$PARALLEL" false "yes" "${BITCOIN_SYSTEM_OPTIONS[@]}" "$@"
create_from_github libbitcoin libbitcoin-protocol master "yes"
build_from_github libbitcoin-protocol "$PARALLEL" false "yes" "${BITCOIN_PROTOCOL_OPTIONS[@]}" "$@"
create_from_github libbitcoin libbitcoin-client master "yes"
build_from_github libbitcoin-client "$PARALLEL" false "yes" "${BITCOIN_CLIENT_OPTIONS[@]}" "$@"
create_from_github libbitcoin libbitcoin-network master "yes"
build_from_github libbitcoin-network "$PARALLEL" false "yes" "${BITCOIN_NETWORK_OPTIONS[@]}" "$@"
if [[ ! ($CI == true) ]]; then
    create_from_github libbitcoin libbitcoin-explorer master
    build_from_github libbitcoin-explorer "$PARALLEL" true "yes" "${BITCOIN_EXPLORER_OPTIONS[@]}" "$@"
else

But the problem is that libbitcoin-client is not compatible with the latest code so there are going to be errors like so: https://github.com/libbitcoin/libbitcoin-client/issues/288 . Moreover the readme of libbitcoin-client:

This branch is not usable in its current state. Please see version3 for the latest functional branch.

So the solution in my case was the following. To install boost 1.62 dev and pull the commits of each required project somewhere from Feb 20, 2021:

$ ./install.sh CXXFLAGS="-Os -s -Wno-error=address" --without-tests --disable-shared --prefix=/opt/bx --with-icu --with-png --with-qrencode --build-zlib --build-png --build-qrencode --build-boost --build-zmq --verbose`

cd build-libbitcoin-explorer/
# https://github.com/libbitcoin/libbitcoin-explorer/commit/5848f0a761c1e5359b7828e350dad34d1e33c2a8
# https://github.com/libbitcoin/libbitcoin-client/commit/1dcb3d8bc51d18c026bee008fcedf7cb0ec9a72e
# https://github.com/libbitcoin/libbitcoin-network/commit/04e4b50de2f3a03c7e6cdab2a386f553d46d04fd
# https://github.com/libbitcoin/libbitcoin-protocol/commit/b8da139539c29fb904a42f42ffb1bb1dde89e85d
# https://github.com/libbitcoin/libbitcoin-system/commit/701707d064e304ad658cefc895134c053e06780c
rm -rf libbitcoin-*
git clone https://github.com/libbitcoin/libbitcoin-explorer
cd libbitcoin-explorer
git switch 5848f0a761c1e5359b7828e350dad34d1e33c2a8 --detach
cd ..
git clone https://github.com/libbitcoin/libbitcoin-client
cd libbitcoin-client
git switch 1dcb3d8bc51d18c026bee008fcedf7cb0ec9a72e --detach
cd ..
git clone https://github.com/libbitcoin/libbitcoin-network
cd libbitcoin-network
git switch 04e4b50de2f3a03c7e6cdab2a386f553d46d04fd --detach
cd ..
git clone https://github.com/libbitcoin/libbitcoin-protocol
cd libbitcoin-protocol
git switch b8da139539c29fb904a42f42ffb1bb1dde89e85d --detach
cd ..
git clone https://github.com/libbitcoin/libbitcoin-system
cd libbitcoin-system
git switch 701707d064e304ad658cefc895134c053e06780c --detach
cd ..

So now I have the following binary of fourth version:

$ bx help

Usage: bx COMMAND [--help]

Version: 4.0.0

Info: The bx commands are:

address-decode
address-embed
address-encode
address-to-key
base16-decode
base16-encode
base58-decode
base58-encode
base58check-decode
base58check-encode
base64-decode
base64-encode
bitcoin160
bitcoin256
broadcast-tx
btc-to-satoshi
cert-new
cert-public
ec-add
ec-add-secrets
ec-decompress
ec-multiply
ec-multiply-secrets
ec-new
ec-to-address
ec-to-ek
ec-to-public
ec-to-wif
ec-to-witness
ek-address
ek-new
ek-public
ek-public-to-address
ek-public-to-ec
ek-to-address
ek-to-ec
electrum-new
electrum-to-seed
fetch-balance
fetch-block
fetch-block-hashes
fetch-block-height
fetch-filter
fetch-filter-checkpoint
fetch-filter-headers
fetch-header
fetch-height
fetch-history
fetch-public-key
fetch-tx
fetch-tx-index
fetch-utxo
get-filter-checkpoint
get-filter-headers
get-filters
hd-new
hd-private
hd-public
hd-to-ec
hd-to-public
help
input-set
input-sign
input-validate
match-neutrino-address
match-neutrino-script
message-sign
message-validate
mnemonic-new
mnemonic-to-seed
put-tx
qrcode
ripemd160
satoshi-to-btc
script-decode
script-encode
script-to-address
script-to-key
seed
send-tx
settings
sha160
sha256
sha512
stealth-decode
stealth-encode
stealth-public
stealth-secret
stealth-shared
subscribe-block
subscribe-tx
token-new
tx-decode
tx-encode
tx-sign
uri-decode
uri-encode
validate-tx
version
watch-key
watch-tx
wif-to-ec
wif-to-public
witness-to-key
wrap-decode
wrap-encode

Bitcoin Explorer home page:

https://github.com/libbitcoin/libbitcoin-explorer

I suggest to fix the installation of version4 by using the old snapshots of the five required projects as illustrated above.

evoskuil commented 1 year ago

Hello, the solution is to build from the version3 branch, which is release quality code. master is not a consistent set of builds yet.