From c6f2a871589f0840836310ad8603c5366144b068 Mon Sep 17 00:00:00 2001 From: Chris Kleeschulte Date: Mon, 3 Aug 2015 18:37:47 -0400 Subject: [PATCH 01/26] Bindings as one shared library - libbitcoind is now linked statically into the binding file versus being its own shared library - the build script now copies the .a file into libs --- bin/build-libbitcoind | 24 ++++++++++------------- binding.gyp | 12 ++++++++++-- platform/os.sh | 44 +++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 62 insertions(+), 18 deletions(-) diff --git a/bin/build-libbitcoind b/bin/build-libbitcoind index c6b739e6..517c2438 100755 --- a/bin/build-libbitcoind +++ b/bin/build-libbitcoind @@ -20,7 +20,12 @@ copy_header_files () { echo "Copying headers for caching purposes, this can take a while (but will only be done once), please wait..." find libbitcoind -type f \( -name "*.h" -or -name "*.hpp" -or -name "*.ipp" \) -print0 | xargs -0 -I{} rsync -R {} "${artifacts_dir}"/include mkdir -p "${artifacts_dir}/lib" > /dev/null 2>&1 - cp -r "${h_and_a_dir}"/lib/libboost_filesystem-mt.a "${h_and_a_dir}"/lib/libboost_thread-mt.a "${artifacts_dir}"/lib/ + cp -r "${h_and_a_dir}"/lib/libboost_filesystem-mt.a "${h_and_a_dir}"/lib/libboost_thread-mt.a "${h_and_a_dir}"/lib/libboost_chrono-mt.a \ + "${h_and_a_dir}"/lib/libboost_program_options-mt.a "${h_and_a_dir}"/lib/libboost_system-mt.a "${btc_dir}"/src/secp256k1/.libs/libsecp256k1.a \ + "${btc_dir}"/src/.libs/libbitcoind.a "${btc_dir}"/src/leveldb/libleveldb.a "${btc_dir}"/src/leveldb/libmemenv.a "${artifacts_dir}"/lib/ + if [ "${test}" = true ]; then + cp -r "${h_and_a_dir}"/lib/libdb* "${artifacts_dir}"/lib/ + fi popd fi } @@ -159,24 +164,15 @@ apply the current patch from "${root_dir}"/etc/bitcoin.patch? (y/N): " make V=1 echo 'Copying libbitcoind.{so|dylib} to its appropriate location.' - if test -e "${btc_dir}/src/.libs/libbitcoind.${ext}"; then - if [ "$ext" = "dylib" ]; then - if [ ! -d "${os_dir}/lib" ]; then - mkdir -p "${os_dir}/lib" - fi - cp -R "${btc_dir}"/src/.libs/libbitcoind.*dylib "${os_dir}/lib/" - else - if [ ! -d "${os_dir}" ]; then - mkdir -p "${os_dir}" - fi - cp -P "${btc_dir}"/src/.libs/libbitcoind.so* "${os_dir}/" - fi + if test -e "${btc_dir}/src/.libs/libbitcoind.a"; then + mkdir -p "${artifacts_dir}" + cp -R "${btc_dir}"/src/.libs/libbitcoind.a "${artifacts_dir}" echo "Creating the sha marker for the patching in libbitcoind..." echo -n `shasum -a 256 "${root_dir}"/etc/bitcoin.patch | awk '{print $1}'` > "${artifacts_dir}"/patch_sha.txt echo "Copying the header files in order to be cached..." copy_header_files else - echo "Could not find the shared libraries after they should have been built, please run make clean inside the libbitcoind dir and run npm install again." + echo "Could not find the libraries after they should have been built, please run make clean inside the libbitcoind dir and run npm install again." exit 1 fi echo 'Build finished successfully.' diff --git a/binding.gyp b/binding.gyp index 33a10df1..db85a5a3 100755 --- a/binding.gyp +++ b/binding.gyp @@ -27,12 +27,20 @@ ], 'link_settings': { 'libraries': [ + ' Date: Mon, 3 Aug 2015 18:41:15 -0400 Subject: [PATCH 02/26] Merge --- bin/build-bindings | 2 +- binding.gyp | 13 ++++++++++++- lib/daemon.js | 7 ++++--- package.json | 10 ++++++++++ 4 files changed, 27 insertions(+), 5 deletions(-) diff --git a/bin/build-bindings b/bin/build-bindings index e5bd406e..7b535542 100755 --- a/bin/build-bindings +++ b/bin/build-bindings @@ -9,6 +9,6 @@ if test x"$1" = x'debug'; then debug=--debug fi -node-gyp ${debug} rebuild +node-pre-gyp ${debug} rebuild --fallback-to-build diff --git a/binding.gyp b/binding.gyp index db85a5a3..d9f37e13 100755 --- a/binding.gyp +++ b/binding.gyp @@ -1,6 +1,6 @@ { 'targets': [{ - 'target_name': 'libbitcoind', + 'target_name': "<(module_name)", 'include_dirs' : [ ' Date: Tue, 4 Aug 2015 11:05:08 -0400 Subject: [PATCH 03/26] Fixed references in requires. --- .gitignore | 1 + lib/daemon.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index ebf36527..62a6633d 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,4 @@ libbitcoind **/*.creator libbitcoind.includes *.log +platform/* diff --git a/lib/daemon.js b/lib/daemon.js index b63380dd..c9cfd2ec 100644 --- a/lib/daemon.js +++ b/lib/daemon.js @@ -3,8 +3,8 @@ var EventEmitter = require('events').EventEmitter; var binary = require('node-pre-gyp'); var path = require('path'); -var binding_path = binary.find(path.resolve(path.join(__dirname,'./package.json'))); -var bitcoindjs = require(binding_path); +var binding_path = binary.find(path.resolve(path.join(__dirname,'../package.json'))); +var bitcoind = require(binding_path); var util = require('util'); var bitcore = require('bitcore'); var $ = bitcore.util.preconditions; From daa0f9ca5c8003755609b7fec24c7e5074d0533e Mon Sep 17 00:00:00 2001 From: Chris Kleeschulte Date: Tue, 4 Aug 2015 11:22:12 -0400 Subject: [PATCH 04/26] Added a clean script for convenience. --- bin/clean | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100755 bin/clean diff --git a/bin/clean b/bin/clean new file mode 100755 index 00000000..b4931f12 --- /dev/null +++ b/bin/clean @@ -0,0 +1,9 @@ +#!/bin/bash + +root_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/.." +os_dir=$(${root_dir}/platform/os.sh osdir) +cd "${root_dir}" + +rm -fr libbitcoind +rm -fr "${os_dir}"/* +node-pre-gyp clean From 866c78b701edc427e7819b5f6465d199751eec7c Mon Sep 17 00:00:00 2001 From: Chris Kleeschulte Date: Tue, 4 Aug 2015 11:26:16 -0400 Subject: [PATCH 05/26] Remove reference to getting the dylib or so from os.sh. --- platform/os.sh | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/platform/os.sh b/platform/os.sh index f57d9f7b..9e69cf07 100755 --- a/platform/os.sh +++ b/platform/os.sh @@ -170,16 +170,3 @@ fi if test -z "$1" -o x"$1" = x'bitcoind'; then echo -n "${BITCOIN_DIR}"/src/.libs/libbitcoind.a fi - -if test -z "$1" -o x"$1" = x'lib'; then - if test -e "${os_dir}/libbitcoind.${ext}" -o -e "${os_dir}/lib/libbitcoind.${ext}"; then - if test -e "${os_dir}/lib/libbitcoind.${ext}"; then - echo -n "$(pwd)/platform/${os}/lib/libbitcoind.${ext}" - else - echo -n "$(pwd)/platform/${os}/libbitcoind.${ext}" - fi - else - echo -n "${BITCOIN_DIR}/src/.libs/libbitcoind.${ext}" - fi - exit 0 -fi From 19b96754d74ce730c018edab38880031f5118404 Mon Sep 17 00:00:00 2001 From: Chris Kleeschulte Date: Tue, 4 Aug 2015 13:33:03 -0400 Subject: [PATCH 06/26] Fixed patch for anoint (we don't build dylib's anymore). --- bin/build-libbitcoind | 8 +++----- etc/bitcoin.patch | 8 ++++---- platform/os.sh | 6 +++--- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/bin/build-libbitcoind b/bin/build-libbitcoind index 517c2438..5e4abc64 100755 --- a/bin/build-libbitcoind +++ b/bin/build-libbitcoind @@ -13,7 +13,7 @@ echo "Using BTC directory: ${btc_dir}" cd "${root_dir}" -copy_header_files () { +copy_files () { if [[ -d "${artifacts_dir}" && -d "${h_and_a_dir}" && -d "${btc_dir}" ]]; then mkdir -p "${artifacts_dir}/include" > /dev/null 2>&1 pushd "${root_dir}" @@ -163,14 +163,12 @@ apply the current patch from "${root_dir}"/etc/bitcoin.patch? (y/N): " echo 'make V=1' make V=1 - echo 'Copying libbitcoind.{so|dylib} to its appropriate location.' + echo 'Copying files to their appropriate location.' if test -e "${btc_dir}/src/.libs/libbitcoind.a"; then mkdir -p "${artifacts_dir}" - cp -R "${btc_dir}"/src/.libs/libbitcoind.a "${artifacts_dir}" echo "Creating the sha marker for the patching in libbitcoind..." echo -n `shasum -a 256 "${root_dir}"/etc/bitcoin.patch | awk '{print $1}'` > "${artifacts_dir}"/patch_sha.txt - echo "Copying the header files in order to be cached..." - copy_header_files + copy_files else echo "Could not find the libraries after they should have been built, please run make clean inside the libbitcoind dir and run npm install again." exit 1 diff --git a/etc/bitcoin.patch b/etc/bitcoin.patch index be835ca3..dfce817d 100644 --- a/etc/bitcoin.patch +++ b/etc/bitcoin.patch @@ -139,14 +139,14 @@ index e7aa48d..df0f7ae 100644 endef diff --git a/src/Makefile.am b/src/Makefile.am -index 1c2f770..d2eca15 100644 +index 1c2f770..4c87b26 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,6 +1,12 @@ DIST_SUBDIRS = secp256k1 AM_LDFLAGS = $(PTHREAD_CFLAGS) $(LIBTOOL_LDFLAGS) -+lib_LTLIBRARIES = ++noinst_LTLIBRARIES = +libbitcoind_la_LIBADD = +libbitcoind_la_LDFLAGS = -no-undefined +STATIC_BOOST_LIBS = @@ -179,7 +179,7 @@ index 1c2f770..d2eca15 100644 TESTS = +if BUILD_BITCOIN_LIBS -+lib_LTLIBRARIES += libbitcoinconsensus.la ++noinst_LTLIBRARIES += libbitcoinconsensus.la +LIBBITCOIN_CONSENSUS += libbitcoinconsensus.la +endif + @@ -192,7 +192,7 @@ index 1c2f770..d2eca15 100644 bin_PROGRAMS += bitcoin-cli bitcoin-tx endif +else -+lib_LTLIBRARIES += libbitcoind.la ++noinst_LTLIBRARIES += libbitcoind.la +endif .PHONY: FORCE diff --git a/platform/os.sh b/platform/os.sh index 9e69cf07..986de31b 100755 --- a/platform/os.sh +++ b/platform/os.sh @@ -145,7 +145,7 @@ if test -z "$1" -o x"$1" = x'host'; then fi if test -z "$1" -o x"$1" = x'bdb'; then - if [ "${BITCOINDJS_ENV}" == "test" ]; then + if [ "${BITCORENODE_ENV}" == "test" ]; then echo -n "${artifacts_dir}/lib/libdb_cxx.a" fi fi @@ -154,7 +154,7 @@ if test -z "$1" -o x"$1" = x'load_archive'; then if [ "${os}" == "osx" ]; then echo -n "-Wl,-all_load -Wl,--no-undefined" else - echo -n "-Wl,--whole-archive ${filesystem} ${thread} "${BITCOIN_DIR}"/src/.libs/libbitcoind.a -Wl,--no-whole-archive" + echo -n "-Wl,--whole-archive ${filesystem} ${thread} "${artifacts_dir}"/lib/libbitcoind.a -Wl,--no-whole-archive" fi fi @@ -168,5 +168,5 @@ if test -z "$1" -o x"$1" = x'mac_dependencies'; then fi if test -z "$1" -o x"$1" = x'bitcoind'; then - echo -n "${BITCOIN_DIR}"/src/.libs/libbitcoind.a + echo -n "${artifacts_dir}"/lib/libbitcoind.a fi From 761243c724c6659fa08f5ea4c01be6105b628d9f Mon Sep 17 00:00:00 2001 From: Chris Kleeschulte Date: Tue, 4 Aug 2015 14:18:45 -0400 Subject: [PATCH 07/26] Removed the need for the platform directory. Now, the binding can be cached in the build dir because it is one file that includes bitcoin core. --- .travis.yml | 3 +-- bin/build-libbitcoind | 40 +++++----------------------------------- binding.gyp | 6 +++--- etc/patch_sha.txt | 1 + platform/os.sh | 26 ++++++++------------------ 5 files changed, 18 insertions(+), 58 deletions(-) create mode 100644 etc/patch_sha.txt diff --git a/.travis.yml b/.travis.yml index 16935783..4531b189 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,5 +12,4 @@ script: - _mocha -R spec --recursive cache: directories: - - platform/ubuntu - + - build diff --git a/bin/build-libbitcoind b/bin/build-libbitcoind index 5e4abc64..27a4b8b3 100755 --- a/bin/build-libbitcoind +++ b/bin/build-libbitcoind @@ -7,29 +7,11 @@ os_dir=$(${root_dir}/platform/os.sh osdir) host=$(${root_dir}/platform/os.sh host) btc_dir="${root_dir}/libbitcoind" ext=$($root_dir/platform/os.sh ext) -artifacts_dir=$($root_dir/platform/os.sh artifacts_dir) export CPPFLAGS="-I${h_and_a_dir}/include/boost -I${h_and_a_dir}/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include -L${h_and_a_dir}/lib" echo "Using BTC directory: ${btc_dir}" cd "${root_dir}" -copy_files () { - if [[ -d "${artifacts_dir}" && -d "${h_and_a_dir}" && -d "${btc_dir}" ]]; then - mkdir -p "${artifacts_dir}/include" > /dev/null 2>&1 - pushd "${root_dir}" - echo "Copying headers for caching purposes, this can take a while (but will only be done once), please wait..." - find libbitcoind -type f \( -name "*.h" -or -name "*.hpp" -or -name "*.ipp" \) -print0 | xargs -0 -I{} rsync -R {} "${artifacts_dir}"/include - mkdir -p "${artifacts_dir}/lib" > /dev/null 2>&1 - cp -r "${h_and_a_dir}"/lib/libboost_filesystem-mt.a "${h_and_a_dir}"/lib/libboost_thread-mt.a "${h_and_a_dir}"/lib/libboost_chrono-mt.a \ - "${h_and_a_dir}"/lib/libboost_program_options-mt.a "${h_and_a_dir}"/lib/libboost_system-mt.a "${btc_dir}"/src/secp256k1/.libs/libsecp256k1.a \ - "${btc_dir}"/src/.libs/libbitcoind.a "${btc_dir}"/src/leveldb/libleveldb.a "${btc_dir}"/src/leveldb/libmemenv.a "${artifacts_dir}"/lib/ - if [ "${test}" = true ]; then - cp -r "${h_and_a_dir}"/lib/libdb* "${artifacts_dir}"/lib/ - fi - popd - fi -} - build_dependencies () { if [ -d "${btc_dir}" ]; then pushd "${depends_dir}" @@ -82,17 +64,13 @@ if [ "${BITCORENODE_ENV}" == "test" ]; then fi patch_file_sha=$(shasum -a 256 "${root_dir}/etc/bitcoin.patch" | awk '{print $1}') -patch_sha=`find "${os_dir}" -iname patch_sha.txt` +patch_sha="${root_dir}"/etc/patch_sha.txt last_patch_file_sha= if [ -e "${patch_sha}" ]; then - if [ "${ext}" == "dylib" ]; then - last_patch_file_sha=$(cat "${os_dir}"/lib/patch_sha.txt) - else - last_patch_file_sha=$(cat "${os_dir}"/patch_sha.txt) - fi + last_patch_file_sha=$(cat "${patch_sha}") fi shared_file_built=false -if [[ "${last_patch_file_sha}" == "${patch_file_sha}" && -d "${artifacts_dir}/include" ]]; then +if [ "${last_patch_file_sha}" == "${patch_file_sha}" ]; then shared_file_built=true fi @@ -163,16 +141,8 @@ apply the current patch from "${root_dir}"/etc/bitcoin.patch? (y/N): " echo 'make V=1' make V=1 - echo 'Copying files to their appropriate location.' - if test -e "${btc_dir}/src/.libs/libbitcoind.a"; then - mkdir -p "${artifacts_dir}" - echo "Creating the sha marker for the patching in libbitcoind..." - echo -n `shasum -a 256 "${root_dir}"/etc/bitcoin.patch | awk '{print $1}'` > "${artifacts_dir}"/patch_sha.txt - copy_files - else - echo "Could not find the libraries after they should have been built, please run make clean inside the libbitcoind dir and run npm install again." - exit 1 - fi + echo "Creating the sha marker for the patching in libbitcoind..." + echo -n `shasum -a 256 "${root_dir}"/etc/bitcoin.patch | awk '{print $1}'` > "${root_dir}"/etc/patch_sha.txt echo 'Build finished successfully.' else echo 'Using existing shared library.' diff --git a/binding.gyp b/binding.gyp index d9f37e13..a76f9017 100755 --- a/binding.gyp +++ b/binding.gyp @@ -3,9 +3,9 @@ 'target_name': "<(module_name)", 'include_dirs' : [ ' Date: Tue, 4 Aug 2015 15:49:01 -0400 Subject: [PATCH 08/26] Clean up - Removed the platform directory - renamed the platform/os.sh script to varaibles.sh - realigned the calls to os.sh - changed where the patch_ha.txt was being written to - changed the name of the binary to bitcoind.node --- .gitignore | 2 +- .travis.yml | 1 + bin/build-bindings | 8 +++- bin/build-libbitcoind | 41 ++++++++------------ bin/clean | 2 - binding.gyp | 28 +++++++------- etc/bitcoin.patch | 4 +- etc/patch_sha.txt | 1 - package.json | 2 +- platform/arch/.gitignore | 0 platform/centos/.gitignore | 0 platform/debian/.gitignore | 0 platform/fedora/.gitignore | 0 platform/mandriva/.gitignore | 0 platform/mint/.gitignore | 0 platform/osx/.gitignore | 0 platform/rhel/.gitignore | 0 platform/solaris/.gitignore | 0 platform/suse/.gitignore | 0 platform/os.sh => variables.sh | 68 +++------------------------------- 20 files changed, 46 insertions(+), 111 deletions(-) delete mode 100644 etc/patch_sha.txt delete mode 100644 platform/arch/.gitignore delete mode 100644 platform/centos/.gitignore delete mode 100644 platform/debian/.gitignore delete mode 100644 platform/fedora/.gitignore delete mode 100644 platform/mandriva/.gitignore delete mode 100644 platform/mint/.gitignore delete mode 100644 platform/osx/.gitignore delete mode 100644 platform/rhel/.gitignore delete mode 100644 platform/solaris/.gitignore delete mode 100644 platform/suse/.gitignore rename platform/os.sh => variables.sh (62%) diff --git a/.gitignore b/.gitignore index 62a6633d..fa048b32 100644 --- a/.gitignore +++ b/.gitignore @@ -28,4 +28,4 @@ libbitcoind **/*.creator libbitcoind.includes *.log -platform/* +cache/patch_sha.txt diff --git a/.travis.yml b/.travis.yml index 4531b189..8cb338a2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,3 +13,4 @@ script: cache: directories: - build + - cache diff --git a/bin/build-bindings b/bin/build-bindings index 7b535542..941c526d 100755 --- a/bin/build-bindings +++ b/bin/build-bindings @@ -7,8 +7,14 @@ cd "${root_dir}" debug= if test x"$1" = x'debug'; then debug=--debug + cached_file="${root_dir}"/build/Debug/bitcoind.node +else + cached_file="${root_dir}"/build/Release/bitcoind.node fi -node-pre-gyp ${debug} rebuild --fallback-to-build + +if [ ! -f "${cached_file}" ]; then + node-pre-gyp ${debug} rebuild --fallback-to-build +fi diff --git a/bin/build-libbitcoind b/bin/build-libbitcoind index 27a4b8b3..ac72bbb3 100755 --- a/bin/build-libbitcoind +++ b/bin/build-libbitcoind @@ -1,13 +1,11 @@ #!/bin/bash root_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/.." options=`cat ${root_dir}/bin/config_options.sh` -h_and_a_dir=$($root_dir/platform/os.sh h_and_a_dir) -depends_dir=$($root_dir/platform/os.sh depends_dir) -os_dir=$(${root_dir}/platform/os.sh osdir) -host=$(${root_dir}/platform/os.sh host) +depends_dir=$($root_dir/variables.sh depends_dir) +host=$(${root_dir}/variables.sh host) btc_dir="${root_dir}/libbitcoind" -ext=$($root_dir/platform/os.sh ext) -export CPPFLAGS="-I${h_and_a_dir}/include/boost -I${h_and_a_dir}/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include -L${h_and_a_dir}/lib" +patch_sha=$($root_dir/variables.sh patch_sha) +export CPPFLAGS="-I${depends_dir}/${host}/include/boost -I${depends_dir}/${host}/include -L${depends_dir}/${host}/lib" echo "Using BTC directory: ${btc_dir}" cd "${root_dir}" @@ -16,20 +14,10 @@ build_dependencies () { if [ -d "${btc_dir}" ]; then pushd "${depends_dir}" echo "using host for dependencies: ${host}" - boost_files_count=`find "${h_and_a_dir}"/lib -iname "libboost_*-mt.a" | wc -l | xargs` - db_files_count=`find "${h_and_a_dir}"/lib -iname "libdb*.a" | wc -l | xargs` - should_rebuild=false - if [[ "${boost_files_count}" -lt 5 || ( "${db_files_count}" -lt 1 && "${test}" = true ) ]]; then - should_rebuild=true - fi - if [ "${should_rebuild}" = true ]; then - if [ "${test}" = true ]; then - make HOST=${host} NO_QT=1 NO_UPNP=1 - else - make HOST=${host} NO_QT=1 NO_WALLET=1 NO_UPNP=1 - fi + if [ "${test}" = true ]; then + make HOST=${host} NO_QT=1 NO_UPNP=1 else - echo "Looks like libs are already built, so we won't rebuild them. Incidentally, we found: ${boost_files_count} boost libraries and: ${db_files_count} Berkeley DB libraries and you have test mode set to: ${test}" + make HOST=${host} NO_QT=1 NO_WALLET=1 NO_UPNP=1 fi popd fi @@ -64,18 +52,20 @@ if [ "${BITCORENODE_ENV}" == "test" ]; then fi patch_file_sha=$(shasum -a 256 "${root_dir}/etc/bitcoin.patch" | awk '{print $1}') -patch_sha="${root_dir}"/etc/patch_sha.txt last_patch_file_sha= if [ -e "${patch_sha}" ]; then + echo "Patch file sha exists, let's see if the patch has changed since last build..." last_patch_file_sha=$(cat "${patch_sha}") fi shared_file_built=false if [ "${last_patch_file_sha}" == "${patch_file_sha}" ]; then + echo "Patch file contents matches the sha from the patch file itself, so no reason to rebuild the bindings unless there are no prebuilt bindings." shared_file_built=true fi if [ "${shared_file_built}" = false ]; then - mac_response=$($root_dir/platform/os.sh mac_dependencies) + echo "Looks like the patch to bitcoin changed since last build -or- this is the first build, so rebuilding libbitcoind itself..." + mac_response=$($root_dir/variables.sh mac_dependencies) if [ "${mac_response}" != "" ]; then echo "${mac_response}" exit -1 @@ -98,7 +88,6 @@ apply the current patch from "${root_dir}"/etc/bitcoin.patch? (y/N): " fi if [[ "${input}" =~ ^y|^Y ]]; then repatch=true - rm -f "${os_dir}/libbitcoind.*" echo "Removing directory: \"${btc_dir}\" and starting over!" rm -fr "${btc_dir}" fi @@ -132,9 +121,9 @@ apply the current patch from "${root_dir}"/etc/bitcoin.patch? (y/N): " echo './autogen.sh' ./autogen.sh - boost_libdir="--with-boost-libdir=${h_and_a_dir}/lib" + boost_libdir="--with-boost-libdir=${depends_dir}/${host}/lib" - full_options="${options} ${boost_libdir} --prefix=${os_dir}" + full_options="${options} ${boost_libdir}" echo "running the configure script with the following options:\n :::[\"${full_options}\"]:::" ${full_options} @@ -142,9 +131,9 @@ apply the current patch from "${root_dir}"/etc/bitcoin.patch? (y/N): " make V=1 echo "Creating the sha marker for the patching in libbitcoind..." - echo -n `shasum -a 256 "${root_dir}"/etc/bitcoin.patch | awk '{print $1}'` > "${root_dir}"/etc/patch_sha.txt + echo "Writing patch sha file to: \"${patch_sha}\"" + echo -n `shasum -a 256 "${root_dir}"/etc/bitcoin.patch | awk '{print $1}'` > "${patch_sha}" echo 'Build finished successfully.' else echo 'Using existing shared library.' fi - diff --git a/bin/clean b/bin/clean index b4931f12..be22e8e6 100755 --- a/bin/clean +++ b/bin/clean @@ -1,9 +1,7 @@ #!/bin/bash root_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/.." -os_dir=$(${root_dir}/platform/os.sh osdir) cd "${root_dir}" rm -fr libbitcoind -rm -fr "${os_dir}"/* node-pre-gyp clean diff --git a/binding.gyp b/binding.gyp index a76f9017..03b2d6b1 100755 --- a/binding.gyp +++ b/binding.gyp @@ -3,9 +3,9 @@ 'target_name': "<(module_name)", 'include_dirs' : [ ' /dev/null -root_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/.." +root_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" BITCOIN_DIR="${root_dir}/libbitcoind" -os= -ext=so host=`uname -m`-`uname -a | awk '{print tolower($1)}'` depends_dir="${BITCOIN_DIR}"/depends -h_and_a_dir="${depends_dir}"/"${host}" mac_response= check_mac_build_system () { @@ -24,44 +21,6 @@ check_mac_build_system () { fi } -if test -f /etc/centos-release \ - || grep -q 'CentOS' /etc/redhat-release \ - || rpm -q --queryformat '%{VERSION}' centos-release > /dev/null; then - os=centos -elif grep -q 'Fedora' /etc/system-release; then - os=fedora -elif test -f /etc/redhat_release \ - || test -f /etc/redhat-release; then - os=rhel -elif uname -a | grep -q '^Darwin'; then - os=osx - ext=dylib -elif test -f /etc/SuSE-release; then - os=suse -elif test -f /etc/mandrake-release \ - || test -f /etc/mandriva-release; then - os=mandriva -elif grep -q 'Linux Mint' /etc/issue; then - os=mint -elif grep -q 'Ubuntu' /etc/issue \ - || grep -q 'Ubuntu' /etc/lsb-release \ - || uname -v | grep -q 'Ubuntu'; then - os=ubuntu -elif test -f /etc/debian_version \ - || test -f /etc/debian-version; then - os=debian -elif grep -q 'Arch Linux' /etc/issue \ - || test -d /lib/systemd -a "$(readlink /usr/bin/vi)" = 'ex'; then - os=arch -elif test "$(uname -s)" = 'SunOS'; then - os=solaris -elif test "$(uname -s)" = 'AIX'; then - os=aix -elif test -d /system && test -d /data/data; then - os=android -fi - -os_dir=${root_dir}/platform/${os} thread="${BITCOIN_DIR}"/depends/"${host}"/lib/libboost_thread-mt.a filesystem="${BITCOIN_DIR}"/depends/"${host}"/lib/libboost_filesystem-mt.a @@ -72,28 +31,11 @@ leveldb="${BITCOIN_DIR}"/src/leveldb/libleveldb.a memenv="${BITCOIN_DIR}"/src/leveldb/libmemenv.a libsecp256k1="${BITCOIN_DIR}"/src/secp256k1/.libs/libsecp256k1.a -if test -z "$os" -o x"$os" = x'android' -o x"$os" = x'aix'; then - if test "$os" = 'android' -o "$os" = 'aix'; then - echo 'Android or AIX detected!' >& 2 - fi - echo 'OS not supported.' >& 2 - exit 1 -fi - -if test x"$1" = x'osdir'; then - echo -n "$(pwd)/platform/${os}" - exit 0 -fi - if test x"$1" = x'btcdir'; then echo -n "${BITCOIN_DIR}" exit 0 fi -if test -z "$1" -o x"$1" = x'ext'; then - echo -n "${ext}" -fi - if test -z "$1" -o x"$1" = x'thread'; then echo -n "${thread}" fi @@ -130,10 +72,6 @@ if test -z "$1" -o x"$1" = x'libsecp256k1'; then echo -n "${libsecp256k1}" fi -if test -z "$1" -o x"$1" = x'h_and_a_dir'; then - echo -n "${h_and_a_dir}" -fi - if test -z "$1" -o x"$1" = x'host'; then echo -n "${host}" fi @@ -144,6 +82,10 @@ if test -z "$1" -o x"$1" = x'bdb'; then fi fi +if test -z "$1" -o x"$1" = x'patch_sha'; then + echo -n "${root_dir}"/cache/patch_sha.txt +fi + if test -z "$1" -o x"$1" = x'load_archive'; then if [ "${os}" == "osx" ]; then echo -n "-Wl,-all_load -Wl,--no-undefined" From 0fe161c5f4401bae8b1624ea09660362c1de8c98 Mon Sep 17 00:00:00 2001 From: Chris Kleeschulte Date: Tue, 4 Aug 2015 16:40:50 -0400 Subject: [PATCH 09/26] Updated the README.md --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 7e93674a..81a28e6f 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ Bitcore Node ======= -A Node.js module that adds a native interface to Bitcoin Core for querying information about the Bitcoin blockchain. Bindings are linked to Bitcoin Core compiled as a shared library. +A Node.js module that adds a native interface to Bitcoin Core for querying information about the Bitcoin blockchain. Bindings are linked to Bitcore Core compiled as a static library. ## Install @@ -45,7 +45,7 @@ git clone https://github.com/bitpay/bitcore-node.git cd bitcore-node ``` -And finally run the build which will take several minutes. A script in the "bin" directory will download Bitcoin Core v0.11, apply a shared library patch (see more info below), and compile the shared library and Node.js bindings, and then copy build artifacts and header files into `platform/ubuntu`. You can start this by running: +And finally run the build which will take several minutes. A script in the "bin" directory will download Bitcoin Core v0.11, apply a patch (see more info below), and compile the static library and Node.js bindings. You can start this by running: ```bash npm install @@ -86,7 +86,7 @@ git clone https://github.com/bitpay/bitcore-node.git cd bitcore-node ``` -And finally run the build which will take several minutes. A script in the "bin" directory will download Bitcoin Core v0.11, apply a shared library patch (see more info below), and compile the shared library and Node.js bindings, and then copy build artifacts and header files into `platform/osx`. You can start this by running: +And finally run the build which will take several minutes. A script in the "bin" directory will download Bitcoin Core v0.11, apply a patch (see more info below), and compile the static library and Node.js bindings. You can start this by running: ```bash npm install @@ -111,7 +111,7 @@ To run tests against the bindings, as defined in `bindings.gyp` the regtest feat ```bash export BITCORENODE_ENV=test -rm -rf platform//* +node-pre-gyp clean npm install ``` @@ -130,7 +130,7 @@ mocha -R spec integration/regtest.js If any changes have been made to the bindings in the "src" directory, manually compile the Node.js bindings, as defined in `bindings.gyp`, you can run (-d for debug): ```bash -$ node-gyp -d rebuild +$ node-pre-gyp -d rebuild ``` To be able to debug you'll need to have `gdb` and `node` compiled for debugging with gdb using `--gdb` (sometimes called node_g), and you can then run: @@ -151,7 +151,7 @@ $ cd benchmarks $ node index.js ``` -## Shared Library Patch +## Static Library Patch To provide native bindings to JavaScript *(or any other language for that matter)*, Bitcoin code, itself, must be linkable. Currently, Bitcoin Core provides a JSON RPC interface to bitcoind as well as a shared library for script validation *(and hopefully more)* called libbitcoinconsensus. There is a node module, [node-libbitcoinconsensus](https://github.com/bitpay/node-libbitcoinconsensus), that exposes these methods. While these interfaces are useful for several use cases, there are additional use cases that are not fulfilled, and being able to implement customized interfaces is necessary. To be able to do this a few simple changes need to be made to Bitcoin Core to compile as a shared library. From 8d4708ef27aee30f9875b2e38f6b3cf3985affbb Mon Sep 17 00:00:00 2001 From: Chris Kleeschulte Date: Tue, 4 Aug 2015 17:00:16 -0400 Subject: [PATCH 10/26] Added a cache directory where the patch sha will go. --- .gitignore | 1 - cache/.gitignore | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 cache/.gitignore diff --git a/.gitignore b/.gitignore index fa048b32..ebf36527 100644 --- a/.gitignore +++ b/.gitignore @@ -28,4 +28,3 @@ libbitcoind **/*.creator libbitcoind.includes *.log -cache/patch_sha.txt diff --git a/cache/.gitignore b/cache/.gitignore new file mode 100644 index 00000000..83069a1d --- /dev/null +++ b/cache/.gitignore @@ -0,0 +1 @@ +patch_sha.txt From 9bff9ead78e485ccb191b49e345737b6cc838c55 Mon Sep 17 00:00:00 2001 From: Chris Kleeschulte Date: Tue, 4 Aug 2015 17:11:03 -0400 Subject: [PATCH 11/26] Fixed the host name for the s3 repo. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index accb1b0b..2548e061 100644 --- a/package.json +++ b/package.json @@ -67,6 +67,6 @@ "module_path" : "./build/{configuration}/{node_abi}-{platform}-{arch}/", "remote_path" : "./{module_name}/v{version}/{configuration}/", "package_name": "{module_name}-v{version}-{node_abi}-{platform}-{arch}.tar.gz", - "host" : "https://kleetus-bitcoindjs.s3-us-east-1.amazonaws.com" + "host" : "https://bitcore-node.s3-us-west-2.amazonaws.com" } } From 05d8cf521defd69c248ab9307457dc1c4ab82b30 Mon Sep 17 00:00:00 2001 From: Chris Kleeschulte Date: Tue, 4 Aug 2015 17:14:27 -0400 Subject: [PATCH 12/26] Resolved merge conflict. --- lib/daemon.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/daemon.js b/lib/daemon.js index c9cfd2ec..5a3357d4 100644 --- a/lib/daemon.js +++ b/lib/daemon.js @@ -7,6 +7,8 @@ var binding_path = binary.find(path.resolve(path.join(__dirname,'../package.json var bitcoind = require(binding_path); var util = require('util'); var bitcore = require('bitcore'); +var chainlib = require('chainlib'); +var log = chainlib.log; var $ = bitcore.util.preconditions; function Daemon(options) { From 6fe8bc7702736e7b205e7e00f840cc2b0756abd1 Mon Sep 17 00:00:00 2001 From: Chris Kleeschulte Date: Tue, 4 Aug 2015 18:13:21 -0400 Subject: [PATCH 13/26] - put variables.sh in bin/ - fixed wording and description in README.md - make clean in libbitcoind for clean script - changed references to variables.sh --- .travis.yml | 2 +- README.md | 2 +- bin/build-bindings | 8 +------- bin/build-libbitcoind | 25 +++++++++++++++++++++---- bin/clean | 2 +- variables.sh => bin/variables.sh | 2 +- binding.gyp | 28 ++++++++++++++-------------- etc/bitcoin.patch | 4 ++-- package.json | 10 +++++----- 9 files changed, 47 insertions(+), 36 deletions(-) rename variables.sh => bin/variables.sh (97%) diff --git a/.travis.yml b/.travis.yml index 8cb338a2..452c878d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,5 +12,5 @@ script: - _mocha -R spec --recursive cache: directories: - - build + - libbitcoind - cache diff --git a/README.md b/README.md index 81a28e6f..70684f34 100644 --- a/README.md +++ b/README.md @@ -153,7 +153,7 @@ $ node index.js ## Static Library Patch -To provide native bindings to JavaScript *(or any other language for that matter)*, Bitcoin code, itself, must be linkable. Currently, Bitcoin Core provides a JSON RPC interface to bitcoind as well as a shared library for script validation *(and hopefully more)* called libbitcoinconsensus. There is a node module, [node-libbitcoinconsensus](https://github.com/bitpay/node-libbitcoinconsensus), that exposes these methods. While these interfaces are useful for several use cases, there are additional use cases that are not fulfilled, and being able to implement customized interfaces is necessary. To be able to do this a few simple changes need to be made to Bitcoin Core to compile as a shared library. +To provide native bindings to JavaScript *(or any other language for that matter)*, Bitcoin code, itself, must be linkable. Currently, Bitcoin Core provides a JSON RPC interface to bitcoind as well as a shared library for script validation *(and hopefully more)* called libbitcoinconsensus. There is a node module, [node-libbitcoinconsensus](https://github.com/bitpay/node-libbitcoinconsensus), that exposes these methods. While these interfaces are useful for several use cases, there are additional use cases that are not fulfilled, and being able to implement customized interfaces is necessary. To be able to do this a few simple changes need to be made to Bitcoin Core to compile as a static library. The patch is located at `etc/bitcoin.patch` and adds a configure option `--enable-daemonlib` to compile all object files with `-fPIC` (Position Independent Code - needed to create a shared object), exposes leveldb variables and objects, exposes the threadpool to the bindings, and conditionally includes the main function. diff --git a/bin/build-bindings b/bin/build-bindings index 941c526d..7b535542 100755 --- a/bin/build-bindings +++ b/bin/build-bindings @@ -7,14 +7,8 @@ cd "${root_dir}" debug= if test x"$1" = x'debug'; then debug=--debug - cached_file="${root_dir}"/build/Debug/bitcoind.node -else - cached_file="${root_dir}"/build/Release/bitcoind.node fi - -if [ ! -f "${cached_file}" ]; then - node-pre-gyp ${debug} rebuild --fallback-to-build -fi +node-pre-gyp ${debug} rebuild --fallback-to-build diff --git a/bin/build-libbitcoind b/bin/build-libbitcoind index ac72bbb3..d0175da8 100755 --- a/bin/build-libbitcoind +++ b/bin/build-libbitcoind @@ -1,10 +1,10 @@ #!/bin/bash root_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/.." options=`cat ${root_dir}/bin/config_options.sh` -depends_dir=$($root_dir/variables.sh depends_dir) -host=$(${root_dir}/variables.sh host) +depends_dir=$($root_dir/bin/variables.sh depends_dir) +host=$(${root_dir}/bin/variables.sh host) btc_dir="${root_dir}/libbitcoind" -patch_sha=$($root_dir/variables.sh patch_sha) +patch_sha=$($root_dir/bin/variables.sh patch_sha) export CPPFLAGS="-I${depends_dir}/${host}/include/boost -I${depends_dir}/${host}/include -L${depends_dir}/${host}/lib" echo "Using BTC directory: ${btc_dir}" @@ -40,6 +40,22 @@ compare_patch () { matching_patch=`diff -w /tmp/tmp.patch "${root_dir}/etc/bitcoin.patch"` } +prepare_for_caching () { + cp -r $("${root_dir}"/bin/variables.sh bitcoind) /tmp/bitcoind.tmp + cp -r $("${root_dir}"/bin/variables.sh libsecp256k1) /tmp/libsecp256k1.tmp + cp -r $("${root_dir}"/bin/variables.sh memenv) /tmp/libmemenv.tmp + cp -r $("${root_dir}"/bin/variables.sh leveldb) /tmp/leveldb.tmp + pushd "${btc_dir}" + make clean + mkdir -p "${btc_dir}"/src/.libs + mkdir -p "${btc_dir}"/src/secp256k1/.libs + cp -r /tmp/bitcoind.tmp $("${root_dir}"/bin/variables.sh bitcoind) + cp -r /tmp/libsecp256k1.tmp $("${root_dir}"/bin/variables.sh libsecp256k1) + cp -r /tmp/libmemenv.tmp $("${root_dir}"/bin/variables.sh memenv) + cp -r /tmp/leveldb.tmp $("${root_dir}"/bin/variables.sh leveldb) + popd +} + debug= if [ "${BITCORENODE_ENV}" == "debug" ]; then options=`cat ${root_dir}/bin/config_options_debug.sh` @@ -65,7 +81,7 @@ fi if [ "${shared_file_built}" = false ]; then echo "Looks like the patch to bitcoin changed since last build -or- this is the first build, so rebuilding libbitcoind itself..." - mac_response=$($root_dir/variables.sh mac_dependencies) + mac_response=$($root_dir/bin/variables.sh mac_dependencies) if [ "${mac_response}" != "" ]; then echo "${mac_response}" exit -1 @@ -133,6 +149,7 @@ apply the current patch from "${root_dir}"/etc/bitcoin.patch? (y/N): " echo "Creating the sha marker for the patching in libbitcoind..." echo "Writing patch sha file to: \"${patch_sha}\"" echo -n `shasum -a 256 "${root_dir}"/etc/bitcoin.patch | awk '{print $1}'` > "${patch_sha}" + prepare_for_caching echo 'Build finished successfully.' else echo 'Using existing shared library.' diff --git a/bin/clean b/bin/clean index be22e8e6..a36a42b1 100755 --- a/bin/clean +++ b/bin/clean @@ -3,5 +3,5 @@ root_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/.." cd "${root_dir}" -rm -fr libbitcoind +make clean node-pre-gyp clean diff --git a/variables.sh b/bin/variables.sh similarity index 97% rename from variables.sh rename to bin/variables.sh index 6a63e8dd..7ff215ce 100755 --- a/variables.sh +++ b/bin/variables.sh @@ -2,7 +2,7 @@ exec 2> /dev/null -root_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +root_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/.." BITCOIN_DIR="${root_dir}/libbitcoind" host=`uname -m`-`uname -a | awk '{print tolower($1)}'` diff --git a/binding.gyp b/binding.gyp index 03b2d6b1..b44ee1d8 100755 --- a/binding.gyp +++ b/binding.gyp @@ -3,9 +3,9 @@ 'target_name': "<(module_name)", 'include_dirs' : [ ' Date: Wed, 5 Aug 2015 11:16:02 -0400 Subject: [PATCH 14/26] Spacing, RELEASE notes, clean up - Removed main Makefile - Fixed wording in README - Altered build script - Fixed clean script --- Makefile | 9 ---- README.md | 12 +++++ RELEASE.md | 35 ++++++++++++++ bin/build-libbitcoind | 2 +- bin/clean | 3 +- binding.gyp | 110 ++++++++++++++++++++++-------------------- 6 files changed, 107 insertions(+), 64 deletions(-) delete mode 100644 Makefile create mode 100644 RELEASE.md diff --git a/Makefile b/Makefile deleted file mode 100644 index 38c38adc..00000000 --- a/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -all: - @node-gyp clean 2>/dev/null - node-gyp -d configure - node-gyp build - -clean: - @node-gyp clean 2>/dev/null - -.PHONY: all clean diff --git a/README.md b/README.md index 70684f34..54ec1402 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,12 @@ If Node.js v0.12 isn't installed, it can be installed using "nvm", it can be don nvm install v0.12 ``` +Install node-pre-gyp to allow you to get the binaries for bindings or to build the objects from source: + +```bash +npm install node-pre-gyp -g +``` + To build Bitcoin Core and bindings development packages are needed: ```bash @@ -79,6 +85,12 @@ If Node.js v0.12 and associated commands "node", "npm" and "nvm" are not already nvm install v0.12 ``` +Install node-pre-gyp to allow you to get the binaries for bindings or to build the objects from source: + +```bash +npm install node-pre-gyp -g +``` + Clone the bitcore-node repository locally: ```bash diff --git a/RELEASE.md b/RELEASE.md new file mode 100644 index 00000000..ca46c42e --- /dev/null +++ b/RELEASE.md @@ -0,0 +1,35 @@ +Bitcore Node +======= + +A Node.js module that adds a native interface to Bitcoin Core for querying information about the Bitcoin blockchain. Bindings are linked to Bitcore Core compiled as a static library. + +## Release Notes + +Binaries for the C++ binding file (which includes libbitcoind statically linked in) are distributed with the help of node-pre-gyp. Node-pre-gyp publishes pre-built binaries to S3 for later download and installation. Source files can also be built if binaries are not desired. + +## How to release + +Ensure you've followed the instructions in the README.md for building the project from source. You will be using the node-pre-gyp to package and publish the project to S3. You will also need credentials for Bitpay's bitcore-node S3 bucket and be listed as an author for the bitcore-node's npm module. + +- Create a file, ".node_pre_gyprc" in your home directory +- The format of this file should be: + + +```json +{ + "accessKeyId": "xxx", + "secretAccessKey": "yyy" +} +``` + +- then run the commands to push binaries corresponding to the version in package.json to S3 and npm + +```bash +npm install +node-pre-gyp package publish +npm publish +``` + + + + diff --git a/bin/build-libbitcoind b/bin/build-libbitcoind index d0175da8..c39f4079 100755 --- a/bin/build-libbitcoind +++ b/bin/build-libbitcoind @@ -152,5 +152,5 @@ apply the current patch from "${root_dir}"/etc/bitcoin.patch? (y/N): " prepare_for_caching echo 'Build finished successfully.' else - echo 'Using existing shared library.' + echo 'Using existing static library.' fi diff --git a/bin/clean b/bin/clean index a36a42b1..ff0d42b8 100755 --- a/bin/clean +++ b/bin/clean @@ -2,6 +2,7 @@ root_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/.." cd "${root_dir}" - +pushd "${root_dir}"/libbitcoind make clean +popd node-pre-gyp clean diff --git a/binding.gyp b/binding.gyp index b44ee1d8..ccd650ca 100755 --- a/binding.gyp +++ b/binding.gyp @@ -1,59 +1,63 @@ { - 'targets': [{ - 'target_name': "<(module_name)", - 'include_dirs' : [ - ' Date: Wed, 5 Aug 2015 16:26:55 -0400 Subject: [PATCH 15/26] Cache strategy changes - Fixed wording in README - changed caching directory again - realigning include and lib directories --- .travis.yml | 1 - RELEASE.md | 5 ----- bin/build-libbitcoind | 20 +++++++------------ bin/variables.sh | 45 +++++++++++++++++++++++++++---------------- binding.gyp | 7 ++++--- cache/.gitignore | 2 ++ 6 files changed, 41 insertions(+), 39 deletions(-) diff --git a/.travis.yml b/.travis.yml index 452c878d..86d0f69a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,5 +12,4 @@ script: - _mocha -R spec --recursive cache: directories: - - libbitcoind - cache diff --git a/RELEASE.md b/RELEASE.md index ca46c42e..8acb7d23 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -1,8 +1,3 @@ -Bitcore Node -======= - -A Node.js module that adds a native interface to Bitcoin Core for querying information about the Bitcoin blockchain. Bindings are linked to Bitcore Core compiled as a static library. - ## Release Notes Binaries for the C++ binding file (which includes libbitcoind statically linked in) are distributed with the help of node-pre-gyp. Node-pre-gyp publishes pre-built binaries to S3 for later download and installation. Source files can also be built if binaries are not desired. diff --git a/bin/build-libbitcoind b/bin/build-libbitcoind index c39f4079..53c8b380 100755 --- a/bin/build-libbitcoind +++ b/bin/build-libbitcoind @@ -40,19 +40,13 @@ compare_patch () { matching_patch=`diff -w /tmp/tmp.patch "${root_dir}/etc/bitcoin.patch"` } -prepare_for_caching () { - cp -r $("${root_dir}"/bin/variables.sh bitcoind) /tmp/bitcoind.tmp - cp -r $("${root_dir}"/bin/variables.sh libsecp256k1) /tmp/libsecp256k1.tmp - cp -r $("${root_dir}"/bin/variables.sh memenv) /tmp/libmemenv.tmp - cp -r $("${root_dir}"/bin/variables.sh leveldb) /tmp/leveldb.tmp +cache_files () { + cache_file="${root_dir}"/cache/cache.tar pushd "${btc_dir}" - make clean - mkdir -p "${btc_dir}"/src/.libs - mkdir -p "${btc_dir}"/src/secp256k1/.libs - cp -r /tmp/bitcoind.tmp $("${root_dir}"/bin/variables.sh bitcoind) - cp -r /tmp/libsecp256k1.tmp $("${root_dir}"/bin/variables.sh libsecp256k1) - cp -r /tmp/libmemenv.tmp $("${root_dir}"/bin/variables.sh memenv) - cp -r /tmp/leveldb.tmp $("${root_dir}"/bin/variables.sh leveldb) + find . -type f \( -name "*.h" -or -name "*.hpp" -or -name \ +"*.ipp" -or -name "*.a" \) | tar -cf "${cache_file}" -T - + tar xf "${cache_file}" -C "${root_dir}"/cache + rm -fr "${cache_file}" popd } @@ -149,7 +143,7 @@ apply the current patch from "${root_dir}"/etc/bitcoin.patch? (y/N): " echo "Creating the sha marker for the patching in libbitcoind..." echo "Writing patch sha file to: \"${patch_sha}\"" echo -n `shasum -a 256 "${root_dir}"/etc/bitcoin.patch | awk '{print $1}'` > "${patch_sha}" - prepare_for_caching + cache_files echo 'Build finished successfully.' else echo 'Using existing static library.' diff --git a/bin/variables.sh b/bin/variables.sh index 7ff215ce..77202be2 100755 --- a/bin/variables.sh +++ b/bin/variables.sh @@ -3,14 +3,16 @@ exec 2> /dev/null root_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/.." -BITCOIN_DIR="${root_dir}/libbitcoind" +bitcoin_dir="${root_dir}"/libbitcoind +cache_dir="${root_dir}"/cache -host=`uname -m`-`uname -a | awk '{print tolower($1)}'` -depends_dir="${BITCOIN_DIR}"/depends +platform=`uname -a | awk '{print tolower($1)}'` +arch=`uname -m` +host="${arch}"-"${platform}" mac_response= check_mac_build_system () { - if [ "${ext}" == "dylib" ]; then + if [ "${platform}" == "darwin" ]; then if [ ! -d "/usr/include" ]; then if hash xcode-select 2>/dev/null; then mac_response="Please run 'xcode-select --install' from the command line because it seems that you've got Xcode, but not the Xcode command line tools that are required for compiling this project from source..." @@ -21,19 +23,28 @@ check_mac_build_system () { fi } +depends_dir="${bitcoin_dir}"/depends +thread="${cache_dir}"/depends/"${host}"/lib/libboost_thread-mt.a +filesystem="${cache_dir}"/depends/"${host}"/lib/libboost_filesystem-mt.a +chrono="${cache_dir}"/depends/"${host}"/lib/libboost_chrono-mt.a +program_options="${cache_dir}"/depends/"${host}"/lib/libboost_program_options-mt.a +system="${cache_dir}"/depends/"${host}"/lib/libboost_system-mt.a +leveldb="${cache_dir}"/src/leveldb/libleveldb.a +memenv="${cache_dir}"/src/leveldb/libmemenv.a +libsecp256k1="${cache_dir}"/src/secp256k1/.libs/libsecp256k1.a -thread="${BITCOIN_DIR}"/depends/"${host}"/lib/libboost_thread-mt.a -filesystem="${BITCOIN_DIR}"/depends/"${host}"/lib/libboost_filesystem-mt.a -chrono="${BITCOIN_DIR}"/depends/"${host}"/lib/libboost_chrono-mt.a -program_options="${BITCOIN_DIR}"/depends/"${host}"/lib/libboost_program_options-mt.a -system="${BITCOIN_DIR}"/depends/"${host}"/lib/libboost_system-mt.a -leveldb="${BITCOIN_DIR}"/src/leveldb/libleveldb.a -memenv="${BITCOIN_DIR}"/src/leveldb/libmemenv.a -libsecp256k1="${BITCOIN_DIR}"/src/secp256k1/.libs/libsecp256k1.a +if test x"$1" = x'anl'; then + if [ "${platform}" != "darwin" ]; then + echo -n "-lanl" + fi +fi + +if test x"$1" = x'cache_dir'; then + echo -n "${cache_dir}" +fi if test x"$1" = x'btcdir'; then - echo -n "${BITCOIN_DIR}" - exit 0 + echo -n "${bitcoin_dir}" fi if test -z "$1" -o x"$1" = x'thread'; then @@ -78,7 +89,7 @@ fi if test -z "$1" -o x"$1" = x'bdb'; then if [ "${BITCORENODE_ENV}" == "test" ]; then - echo -n "${BITCOIN_DIR}"/depends/"${host}"/lib/libdb_cxx.a + echo -n "${cache_dir}"/depends/"${host}"/lib/libdb_cxx.a fi fi @@ -90,7 +101,7 @@ if test -z "$1" -o x"$1" = x'load_archive'; then if [ "${os}" == "osx" ]; then echo -n "-Wl,-all_load -Wl,--no-undefined" else - echo -n "-Wl,--whole-archive ${filesystem} ${thread} "${BITCOIN_DIR}"/src/.libs/libbitcoind.a -Wl,--no-whole-archive" + echo -n "-Wl,--whole-archive ${filesystem} ${thread} "${cache_dir}"/src/.libs/libbitcoind.a -Wl,--no-whole-archive" fi fi @@ -100,5 +111,5 @@ if test -z "$1" -o x"$1" = x'mac_dependencies'; then fi if test -z "$1" -o x"$1" = x'bitcoind'; then - echo -n "${BITCOIN_DIR}"/src/.libs/libbitcoind.a + echo -n "${cache_dir}"/src/.libs/libbitcoind.a fi diff --git a/binding.gyp b/binding.gyp index ccd650ca..48deb620 100755 --- a/binding.gyp +++ b/binding.gyp @@ -4,9 +4,9 @@ "target_name": "<(module_name)", "include_dirs" : [ " Date: Wed, 5 Aug 2015 16:31:48 -0400 Subject: [PATCH 16/26] Added the clean script. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 396dc1b5..0dba559b 100644 --- a/package.json +++ b/package.json @@ -30,6 +30,7 @@ "preinstall": "./bin/build-libbitcoind", "install": "./bin/build-bindings", "start": "node bin/start.js", + "clean": "./bin/clean", "test": "NODE_ENV=test mocha --recursive", "coverage": "istanbul cover _mocha -- --recursive", "libbitcoind": "node bin/start-libbitcoind.js" @@ -41,7 +42,6 @@ "dependencies": { "node-pre-gyp": "0.5.x", "async": "1.3.0", - "bindings": "^1.2.1", "bitcore": "^0.12.15", "chainlib": "^0.1.1", "errno": "^0.1.2", From c8f3cbe390a3e550cc3d52dca4a23de4237960e3 Mon Sep 17 00:00:00 2001 From: Chris Kleeschulte Date: Wed, 5 Aug 2015 16:34:51 -0400 Subject: [PATCH 17/26] Fixed README for Bitcore versus Bitcoin. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 54ec1402..c1352044 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ Bitcore Node ======= -A Node.js module that adds a native interface to Bitcoin Core for querying information about the Bitcoin blockchain. Bindings are linked to Bitcore Core compiled as a static library. +A Node.js module that adds a native interface to Bitcoin Core for querying information about the Bitcoin blockchain. Bindings are linked to Bitcoin Core compiled as a static library. ## Install From e4c42fa6cbcebc3e7aa1cb01a8167be2f1186560 Mon Sep 17 00:00:00 2001 From: Braydon Fuller Date: Wed, 5 Aug 2015 20:06:36 -0400 Subject: [PATCH 18/26] Download and upload binary distribution. --- README.md | 19 ++------ RELEASE.md | 24 +++++----- bin/{build-libbitcoind => build} | 13 ++++++ bin/build-bindings | 14 ------ bin/get-tarball-name.js | 12 +++++ bin/install | 22 +++++++++ bin/upload.js | 77 ++++++++++++++++++++++++++++++++ binding.gyp | 13 +----- lib/daemon.js | 9 ++-- package.json | 19 +++----- 10 files changed, 152 insertions(+), 70 deletions(-) rename bin/{build-libbitcoind => build} (97%) delete mode 100755 bin/build-bindings create mode 100644 bin/get-tarball-name.js create mode 100755 bin/install create mode 100644 bin/upload.js mode change 100755 => 100644 binding.gyp diff --git a/README.md b/README.md index c1352044..7142e0f7 100644 --- a/README.md +++ b/README.md @@ -32,12 +32,6 @@ If Node.js v0.12 isn't installed, it can be installed using "nvm", it can be don nvm install v0.12 ``` -Install node-pre-gyp to allow you to get the binaries for bindings or to build the objects from source: - -```bash -npm install node-pre-gyp -g -``` - To build Bitcoin Core and bindings development packages are needed: ```bash @@ -85,12 +79,6 @@ If Node.js v0.12 and associated commands "node", "npm" and "nvm" are not already nvm install v0.12 ``` -Install node-pre-gyp to allow you to get the binaries for bindings or to build the objects from source: - -```bash -npm install node-pre-gyp -g -``` - Clone the bitcore-node repository locally: ```bash @@ -123,8 +111,7 @@ To run tests against the bindings, as defined in `bindings.gyp` the regtest feat ```bash export BITCORENODE_ENV=test -node-pre-gyp clean -npm install +npm run build ``` If you do not already have mocha installed: @@ -142,9 +129,11 @@ mocha -R spec integration/regtest.js If any changes have been made to the bindings in the "src" directory, manually compile the Node.js bindings, as defined in `bindings.gyp`, you can run (-d for debug): ```bash -$ node-pre-gyp -d rebuild +$ node-gyp -d rebuild ``` +Note: `node-gyp` can be installed with `npm install node-gyp -g` + To be able to debug you'll need to have `gdb` and `node` compiled for debugging with gdb using `--gdb` (sometimes called node_g), and you can then run: ```bash diff --git a/RELEASE.md b/RELEASE.md index 8acb7d23..245cb203 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -1,30 +1,34 @@ -## Release Notes +## Release Process -Binaries for the C++ binding file (which includes libbitcoind statically linked in) are distributed with the help of node-pre-gyp. Node-pre-gyp publishes pre-built binaries to S3 for later download and installation. Source files can also be built if binaries are not desired. +Binaries for the C++ binding file (which includes libbitcoind statically linked in) are distributed for convenience. The binary binding file `bitcoind.node` is published to S3 for later download and installation. Source files can also be built if binaries are not desired. -## How to release +### How to Release -Ensure you've followed the instructions in the README.md for building the project from source. You will be using the node-pre-gyp to package and publish the project to S3. You will also need credentials for Bitpay's bitcore-node S3 bucket and be listed as an author for the bitcore-node's npm module. +Ensure you've followed the instructions in the README.md for building the project from source. You will be using the node-gyp to build buildings and a script upload the binary to S3. You will also need credentials for BitPay's bitcore-node S3 bucket and be listed as an author for the bitcore-node's npm module. -- Create a file, ".node_pre_gyprc" in your home directory +- Create a file `.bitcore-node-upload.json` in your home directory - The format of this file should be: - ```json { + "region": "us-east-1", "accessKeyId": "xxx", "secretAccessKey": "yyy" } ``` -- then run the commands to push binaries corresponding to the version in package.json to S3 and npm +To make a release, bump the version of the package.json: ```bash +git commit -a -m "Bump package version to " npm install -node-pre-gyp package publish +npm run upload npm publish ``` - - +And then update the version of the package.json for development (e.g. "0.3.2-dev"): +```bash +git commit -a -m "Bump development version to " +git push upstream master +``` diff --git a/bin/build-libbitcoind b/bin/build similarity index 97% rename from bin/build-libbitcoind rename to bin/build index 53c8b380..c2ba552e 100755 --- a/bin/build-libbitcoind +++ b/bin/build @@ -148,3 +148,16 @@ apply the current patch from "${root_dir}"/etc/bitcoin.patch? (y/N): " else echo 'Using existing static library.' fi + +# Building the Bindings + +set -e + +cd "${root_dir}" + +debug= +if test x"$1" = x'debug'; then + debug=--debug +fi + +node-gyp ${debug} rebuild diff --git a/bin/build-bindings b/bin/build-bindings deleted file mode 100755 index 7b535542..00000000 --- a/bin/build-bindings +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -set -e - -root_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/.." -cd "${root_dir}" - -debug= -if test x"$1" = x'debug'; then - debug=--debug -fi - -node-pre-gyp ${debug} rebuild --fallback-to-build - - diff --git a/bin/get-tarball-name.js b/bin/get-tarball-name.js new file mode 100644 index 00000000..0c54e732 --- /dev/null +++ b/bin/get-tarball-name.js @@ -0,0 +1,12 @@ +'use strict'; + +var bindings = require('bindings'); +var packageRoot = bindings.getRoot(bindings.getFileName()); +var version = require(packageRoot + '/package.json').version; +var platform = process.platform; +var arch = process.arch; +var tarballName = 'libbitcoind-' + version + '-' + platform + '-' + arch + '.tgz'; + +if (require.main === module) { + process.stdout.write(tarballName); +} diff --git a/bin/install b/bin/install new file mode 100755 index 00000000..54ff97f1 --- /dev/null +++ b/bin/install @@ -0,0 +1,22 @@ +#!/bin/bash + +root_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/.." + +cd "${root_dir}" + +tarball_name=`node bin/get-tarball-name.js` +bucket_name="bitcore-node" +binary_url="https://${bucket_name}.s3.amazonaws.com/${tarball_name}" + +echo "Downloading binary: ${binary_url}" + +wget -N $binary_url + +if test -e "${tarball_name}"; then + echo "Unpacking binary distribution" + tar -xvzf $tarball_name + exit 0; +else + echo "Prebuild binary could not be downloaded, building from source..." + ./bin/build +fi diff --git a/bin/upload.js b/bin/upload.js new file mode 100644 index 00000000..3d5a59d2 --- /dev/null +++ b/bin/upload.js @@ -0,0 +1,77 @@ +'use strict'; + +var fs = require('fs'); +var chainlib = require('chainlib'); +var log = chainlib.log; +var AWS = require('aws-sdk'); + +var config = require(process.env.HOME + '/.bitcore-node-upload.json'); + +AWS.config.region = config.region; +AWS.config.update({ + accessKeyId: config.accessKeyId, + secretAccessKey: config.secretAccessKey +}); + +var bindings = require('bindings'); +var packageRoot = bindings.getRoot(bindings.getFileName()); +var binaryPath = bindings({ + path: true, + bindings: 'bitcoind.node' +}); + +var relativeBinaryPath = binaryPath.replace(packageRoot + '/', ''); +var exec = require('child_process').exec; +var version = require(packageRoot + '/package.json').version; +var platform = process.platform; +var arch = process.arch; +var tarballName = 'libbitcoind-' + version + '-' + platform + '-' + arch + '.tgz'; +var bucketName = 'bitcore-node'; +var url = 'https://' + bucketName + '.s3.amazonaws.com/' + tarballName; + +var child = exec('tar -C ' + packageRoot + ' -cvzf ' + tarballName + ' ' + relativeBinaryPath, + function (error, stdout, stderr) { + + if (error) { + throw error; + } + + if (stdout) { + log.info('Tar:', stdout); + } + + if (stderr) { + log.error(stderr); + } + + var fileStream = fs.createReadStream(packageRoot + '/' + tarballName); + + fileStream.on('error', function(err) { + if (err) { + throw err; + } + }); + + fileStream.on('open', function() { + + var s3 = new AWS.S3(); + + var params = { + ACL: 'public-read', + Key: tarballName, + Body: fileStream, + Bucket: bucketName + }; + + s3.putObject(params, function(err, data) { + if (err) { + throw err; + } else { + log.info('Successfully uploaded to: ' + url); + } + }); + + }); + + } +); diff --git a/binding.gyp b/binding.gyp old mode 100755 new mode 100644 index 48deb620..c4f034e3 --- a/binding.gyp +++ b/binding.gyp @@ -1,7 +1,7 @@ { "targets": [ { - "target_name": "<(module_name)", + "target_name": "libbitcoind", "include_dirs" : [ "", - "version": "0.2.0", + "version": "0.2.0-dev", "main": "./index.js", "repository": "git://github.com/bitpay/bitcore-node.git", "homepage": "https://github.com/bitpay/bitcore-node.js", @@ -27,10 +27,11 @@ } ], "scripts": { - "preinstall": "./bin/build-libbitcoind", - "install": "./bin/build-bindings", - "start": "node bin/start.js", + "install": "./bin/install", + "build": "./bin/build", "clean": "./bin/clean", + "upload": "node bin/upload.js", + "start": "node bin/start.js", "test": "NODE_ENV=test mocha --recursive", "coverage": "istanbul cover _mocha -- --recursive", "libbitcoind": "node bin/start-libbitcoind.js" @@ -40,8 +41,8 @@ "bitcoind" ], "dependencies": { - "node-pre-gyp": "0.5.x", "async": "1.3.0", + "bindings": "^1.2.1", "bitcore": "^0.12.15", "chainlib": "^0.1.1", "errno": "^0.1.2", @@ -60,13 +61,5 @@ "proxyquire": "^1.3.1", "rimraf": "^2.4.2", "sinon": "^1.15.4" - }, - "bundledDependencies": ["node-pre-gyp"], - "binary": { - "module_name" : "bitcoind", - "module_path" : "./build/{configuration}/{node_abi}-{platform}-{arch}/", - "remote_path" : "./{module_name}/v{version}/{configuration}/", - "package_name": "{module_name}-v{version}-{node_abi}-{platform}-{arch}.tar.gz", - "host" : "https://bitcore-node.s3-us-west-2.amazonaws.com" } } From 19fdd54cdcb95a156e20a9247af63735b16f5a74 Mon Sep 17 00:00:00 2001 From: Chris Kleeschulte Date: Thu, 6 Aug 2015 11:01:36 -0400 Subject: [PATCH 19/26] Switched to curl when getting the tgz. --- bin/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/install b/bin/install index 54ff97f1..651eb8bd 100755 --- a/bin/install +++ b/bin/install @@ -10,7 +10,7 @@ binary_url="https://${bucket_name}.s3.amazonaws.com/${tarball_name}" echo "Downloading binary: ${binary_url}" -wget -N $binary_url +curl $binary_url > $tarball_name if test -e "${tarball_name}"; then echo "Unpacking binary distribution" From c94f493915843d092ddd049127be4e3cf4939109 Mon Sep 17 00:00:00 2001 From: Chris Kleeschulte Date: Thu, 6 Aug 2015 11:28:17 -0400 Subject: [PATCH 20/26] Fixed curl statement to check return HEADERS. --- bin/install | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/bin/install b/bin/install index 651eb8bd..fccfd879 100755 --- a/bin/install +++ b/bin/install @@ -10,13 +10,17 @@ binary_url="https://${bucket_name}.s3.amazonaws.com/${tarball_name}" echo "Downloading binary: ${binary_url}" -curl $binary_url > $tarball_name +curl --fail -I $binary_url -if test -e "${tarball_name}"; then - echo "Unpacking binary distribution" - tar -xvzf $tarball_name - exit 0; -else - echo "Prebuild binary could not be downloaded, building from source..." - ./bin/build +if test $? -eq 0; then + curl $binary_url > $tarball_name + if test -e "${tarball_name}"; then + echo "Unpacking binary distribution" + tar -xvzf $tarball_name + if test $? -eq 0; then + exit 0 + fi + fi fi +echo "Prebuild binary could not be downloaded, building from source..." +./bin/build From 4735c583557a6ae2138d007db94c821f9fbe4e56 Mon Sep 17 00:00:00 2001 From: Chris Kleeschulte Date: Thu, 6 Aug 2015 11:43:58 -0400 Subject: [PATCH 21/26] added removing of the cache from the clean script. --- bin/clean | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/clean b/bin/clean index ff0d42b8..bfced19b 100755 --- a/bin/clean +++ b/bin/clean @@ -6,3 +6,4 @@ pushd "${root_dir}"/libbitcoind make clean popd node-pre-gyp clean +rm -fr cache/* From 8ef0b3b3d9204a90834b791d793f919ff4af3c21 Mon Sep 17 00:00:00 2001 From: Chris Kleeschulte Date: Thu, 6 Aug 2015 11:51:25 -0400 Subject: [PATCH 22/26] changed back to node-gyp clean. --- bin/clean | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/clean b/bin/clean index bfced19b..414df579 100755 --- a/bin/clean +++ b/bin/clean @@ -5,5 +5,5 @@ cd "${root_dir}" pushd "${root_dir}"/libbitcoind make clean popd -node-pre-gyp clean +node-gyp clean rm -fr cache/* From b02b65d142d3424fa32d898b7e3cbb9d932f73dc Mon Sep 17 00:00:00 2001 From: Chris Kleeschulte Date: Thu, 6 Aug 2015 12:32:11 -0400 Subject: [PATCH 23/26] Added a default case for default to be false. --- bin/build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/build b/bin/build index c2ba552e..2121eb9a 100755 --- a/bin/build +++ b/bin/build @@ -155,7 +155,7 @@ set -e cd "${root_dir}" -debug= +debug=--debug=false if test x"$1" = x'debug'; then debug=--debug fi From 4a2dcddaa91c25d1dd4136da56ce300fbfce442a Mon Sep 17 00:00:00 2001 From: Braydon Fuller Date: Thu, 6 Aug 2015 13:48:02 -0400 Subject: [PATCH 24/26] Remove binding dependency in get-tarball-name --- bin/get-tarball-name.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bin/get-tarball-name.js b/bin/get-tarball-name.js index 0c54e732..0bcac687 100644 --- a/bin/get-tarball-name.js +++ b/bin/get-tarball-name.js @@ -1,7 +1,6 @@ 'use strict'; -var bindings = require('bindings'); -var packageRoot = bindings.getRoot(bindings.getFileName()); +var packageRoot = __dirname + '/..'; var version = require(packageRoot + '/package.json').version; var platform = process.platform; var arch = process.arch; From 2a576eae6207626ef48cca34d1259daa75b35428 Mon Sep 17 00:00:00 2001 From: Chris Kleeschulte Date: Thu, 6 Aug 2015 13:56:39 -0400 Subject: [PATCH 25/26] Added automake to the install directions. On Mint Linux, automake isn't part of auto tools package for some reason. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7142e0f7..3f34fb5f 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ nvm install v0.12 To build Bitcoin Core and bindings development packages are needed: ```bash -sudo apt-get install build-essential libtool autotools-dev autoconf pkg-config libssl-dev +sudo apt-get install build-essential libtool autotools-dev automake autoconf pkg-config libssl-dev ``` Clone the bitcore-node repository locally: From 2fee4b2404488fc9f1094ae32432f61644316269 Mon Sep 17 00:00:00 2001 From: Chris Kleeschulte Date: Thu, 6 Aug 2015 14:57:54 -0400 Subject: [PATCH 26/26] Fixed wording in RELEASE.md --- RELEASE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RELEASE.md b/RELEASE.md index 245cb203..e5243e79 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -4,7 +4,7 @@ Binaries for the C++ binding file (which includes libbitcoind statically linked ### How to Release -Ensure you've followed the instructions in the README.md for building the project from source. You will be using the node-gyp to build buildings and a script upload the binary to S3. You will also need credentials for BitPay's bitcore-node S3 bucket and be listed as an author for the bitcore-node's npm module. +Ensure you've followed the instructions in the README.md for building the project from source. You will be using node-gyp to build the C++ bindings. A script will then upload the bindings to S3 for later use. You will also need credentials for BitPay's bitcore-node S3 bucket and be listed as an author for the bitcore-node's npm module. - Create a file `.bitcore-node-upload.json` in your home directory - The format of this file should be: