From 1bbedef565d45cab4802998ec1cba92cc3345ecb Mon Sep 17 00:00:00 2001 From: Brannon King Date: Wed, 9 Oct 2019 21:53:07 -0600 Subject: [PATCH 1/6] ensure we don't return witness data in the transaction w/o segwit rule --- configure.ac | 2 +- src/rpc/mining.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 0af532822..255c7e9d2 100644 --- a/configure.ac +++ b/configure.ac @@ -3,7 +3,7 @@ AC_PREREQ([2.60]) define(_CLIENT_VERSION_MAJOR, 0) define(_CLIENT_VERSION_MINOR, 17) define(_CLIENT_VERSION_REVISION, 3) -define(_CLIENT_VERSION_BUILD, 1) +define(_CLIENT_VERSION_BUILD, 2) define(_CLIENT_VERSION_IS_RELEASE, true) define(_COPYRIGHT_YEAR, 2019) define(_COPYRIGHT_HOLDERS,[The %s developers]) diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp index 0d1ba67ed..87b160145 100644 --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -451,7 +451,7 @@ static UniValue getblocktemplate(const JSONRPCRequest& request) if (strMode != "template") throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid mode"); - if (Params().NetworkIDString() != CBaseChainParams::REGTEST) // who should own this constant? + if (Params().NetworkIDString() == CBaseChainParams::MAIN) { if (!g_connman) throw JSONRPCError(RPC_CLIENT_P2P_DISABLED, "Error: Peer-to-peer functionality missing or disabled"); @@ -585,7 +585,7 @@ static UniValue getblocktemplate(const JSONRPCRequest& request) UniValue entry(UniValue::VOBJ); - entry.pushKV("data", EncodeHexTx(tx)); + entry.pushKV("data", EncodeHexTx(tx, fSupportsSegwit ? 0 : SERIALIZE_TRANSACTION_NO_WITNESS)); entry.pushKV("txid", txHash.GetHex()); entry.pushKV("hash", tx.GetWitnessHash().GetHex()); From b16356b9279f3226d66f00bca09265e28174c7ef Mon Sep 17 00:00:00 2001 From: Brannon King Date: Thu, 10 Oct 2019 10:50:02 -0600 Subject: [PATCH 2/6] added segwit instructions --- contrib/mining/README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/contrib/mining/README.md b/contrib/mining/README.md index cace968db..1c89cffb1 100644 --- a/contrib/mining/README.md +++ b/contrib/mining/README.md @@ -36,7 +36,7 @@ insert into coins(name, symbol, symbol2, algo, enable, auto_ready, rpcuser, rpcp values('Local LBRY Instance', 'LBC', 'LBC', 'lbry', 1, 1, 'ruser', 'rpswd', '127.0.0.1', 19245, 1, 'utf-8', 0, 1, 0, 0, 0); exit ``` -Use port 19245 for testnet, port 9245 for main. +Use port 19245 for testnet, port 9245 for main. Set usesegwit to 1 after the segwit fork is enabled on December 11, 2019. #### 3. Run the stratum server: ``` docker run --network host -d lbry/yiimp_stratum @@ -47,10 +47,11 @@ docker run --network host -it lbry/yiimp_stratum bash cat config/lbry.conf ./stratum config/lbry ``` +When testing with an ASIC you may need to modify the TCP server address in said lbry.conf file to be an external IP address. #### 4. Connect sgminer to it: ``` sgminer -k lbry -o stratum+tcp://127.0.0.1:3334/ -D -T -O mn824Su1wX7ip8WcNYzXwwWqvBvkeWGRo6:x ``` The username there is the account to receive payments from the pool. The password is unused. Tested with https://github.com/lbryio/sgminer-gm. -You can use whatever miner you prefer. \ No newline at end of file +You can use whatever miner you prefer. From 76e3d8861ca9b09912fe85b6e24d34c02f551789 Mon Sep 17 00:00:00 2001 From: Brannon King Date: Fri, 11 Oct 2019 14:16:38 -0600 Subject: [PATCH 3/6] error w/o segwit after fork --- src/rpc/mining.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp index 87b160145..7875f05e4 100644 --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -567,6 +567,8 @@ static UniValue getblocktemplate(const JSONRPCRequest& request) // NOTE: If at some point we support pre-segwit miners post-segwit-activation, this needs to take segwit support into consideration const bool fPreSegWit = (ThresholdState::ACTIVE != VersionBitsState(pindexPrev, consensusParams, Consensus::DEPLOYMENT_SEGWIT, versionbitscache)); + if (!fPreSegWit && !fSupportsSegwit) + throw JSONRPCError(RPC_INVALID_PARAMETER, "Segwit support is now required. Please include \"segwit\" in the client's rules."); UniValue aCaps(UniValue::VARR); aCaps.push_back("proposal"); UniValue result(UniValue::VOBJ); @@ -585,7 +587,7 @@ static UniValue getblocktemplate(const JSONRPCRequest& request) UniValue entry(UniValue::VOBJ); - entry.pushKV("data", EncodeHexTx(tx, fSupportsSegwit ? 0 : SERIALIZE_TRANSACTION_NO_WITNESS)); + entry.pushKV("data", EncodeHexTx(tx)); entry.pushKV("txid", txHash.GetHex()); entry.pushKV("hash", tx.GetWitnessHash().GetHex()); @@ -621,7 +623,6 @@ static UniValue getblocktemplate(const JSONRPCRequest& request) aMutable.push_back("time"); aMutable.push_back("transactions"); aMutable.push_back("prevblock"); - aMutable.push_back("submit/coinbase"); result.pushKV("capabilities", aCaps); From ab08f6b35e4bbb52c47f8707ba91a6618fd54a94 Mon Sep 17 00:00:00 2001 From: addy1510 <56705141+addy1510@users.noreply.github.com> Date: Fri, 18 Oct 2019 06:33:42 +0530 Subject: [PATCH 4/6] Fix typo in README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index af98b1c8c..ffdbc35c1 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ txindex=1 ``` ## Running from Source -The easiest way to compile is to utilize the Docker image that contains the necessary compilers: lbry/build_lbrycrd. This will allow you to reproduce the build as made on our build servers. I this sample we map a local lbrycrd folder and a local ccache folder inside the image: +The easiest way to compile is to utilize the Docker image that contains the necessary compilers: lbry/build_lbrycrd. This will allow you to reproduce the build as made on our build servers. In this sample we map a local lbrycrd folder and a local ccache folder inside the image: ``` git clone https://github.com/lbryio/lbrycrd.git cd lbrycrd From 51ec0a92f70ecb7c83d80fb6e2f685e7b00da2b9 Mon Sep 17 00:00:00 2001 From: Eric Brian Anil <38664231+EricBrianAnil@users.noreply.github.com> Date: Sun, 20 Oct 2019 23:04:33 +0530 Subject: [PATCH 5/6] MIT License badge Added the MIT license badge that redirects to the license page --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index ffdbc35c1..014885307 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # LBRYcrd - The LBRY blockchain [![Build Status](https://travis-ci.org/lbryio/lbrycrd.svg?branch=master)](https://travis-ci.org/lbryio/lbrycrd) +[![MIT licensed](https://img.shields.io/dub/l/vibe-d.svg?style=flat)](https://github.com/lbryio/lbry-desktop/blob/master/LICENSE) LBRYcrd uses a blockchain similar to bitcoin's to implement an index and payment system for content on the LBRY network. It is a fork of bitcoin core. In addition to the libraries used by bitcoin, LBRYcrd also uses icu4c. From 6fe70b58ce8fea69d6359bf8423cf89759b13c6c Mon Sep 17 00:00:00 2001 From: GwanYeong Kim Date: Fri, 25 Oct 2019 05:00:50 +0000 Subject: [PATCH 6/6] Fix 'Use $(...) notation instead of legacy backticked `...`.' issue in shell script --- autogen.sh | 2 +- contrib/macdeploy/detached-sig-apply.sh | 6 +++--- contrib/macdeploy/detached-sig-create.sh | 10 +++++----- contrib/windeploy/detached-sig-create.sh | 2 +- packaging/build_darwin_64bit.sh | 6 +++--- packaging/build_linux_64bit.sh | 8 ++++---- packaging/build_windows_32bit.sh | 6 +++--- packaging/build_windows_64bit.sh | 6 +++--- src/univalue/autogen.sh | 2 +- test/lint/commit-script-check.sh | 8 ++++---- 10 files changed, 28 insertions(+), 28 deletions(-) diff --git a/autogen.sh b/autogen.sh index 0c05626cc..5b2aa0ffc 100755 --- a/autogen.sh +++ b/autogen.sh @@ -7,7 +7,7 @@ export LC_ALL=C set -e srcdir="$(dirname $0)" cd "$srcdir" -if [ -z ${LIBTOOLIZE} ] && GLIBTOOLIZE="`which glibtoolize 2>/dev/null`"; then +if [ -z ${LIBTOOLIZE} ] && GLIBTOOLIZE="$(which glibtoolize 2>/dev/null)"; then LIBTOOLIZE="${GLIBTOOLIZE}" export LIBTOOLIZE fi diff --git a/contrib/macdeploy/detached-sig-apply.sh b/contrib/macdeploy/detached-sig-apply.sh index f8503e4de..af2b11fa0 100755 --- a/contrib/macdeploy/detached-sig-apply.sh +++ b/contrib/macdeploy/detached-sig-apply.sh @@ -36,13 +36,13 @@ if [ -z "${CODESIGN_ALLOCATE}" ]; then fi find ${TEMPDIR} -name "*.sign" | while read i; do - SIZE=`stat -c %s "${i}"` - TARGET_FILE="`echo "${i}" | sed 's/\.sign$//'`" + SIZE=$(stat -c %s "${i}") + TARGET_FILE="$(echo "${i}" | sed 's/\.sign$//')" echo "Allocating space for the signature of size ${SIZE} in ${TARGET_FILE}" ${CODESIGN_ALLOCATE} -i "${TARGET_FILE}" -a ${ARCH} ${SIZE} -o "${i}.tmp" - OFFSET=`${PAGESTUFF} "${i}.tmp" -p | tail -2 | grep offset | sed 's/[^0-9]*//g'` + OFFSET=$(${PAGESTUFF} "${i}.tmp" -p | tail -2 | grep offset | sed 's/[^0-9]*//g') if [ -z ${QUIET} ]; then echo "Attaching signature at offset ${OFFSET}" fi diff --git a/contrib/macdeploy/detached-sig-create.sh b/contrib/macdeploy/detached-sig-create.sh index 5281ebcc4..b69335042 100755 --- a/contrib/macdeploy/detached-sig-create.sh +++ b/contrib/macdeploy/detached-sig-create.sh @@ -27,19 +27,19 @@ ${CODESIGN} -f --file-list ${TEMPLIST} "$@" "${BUNDLE}" grep -v CodeResources < "${TEMPLIST}" | while read i; do TARGETFILE="${BUNDLE}/`echo "${i}" | sed "s|.*${BUNDLE}/||"`" - SIZE=`pagestuff "$i" -p | tail -2 | grep size | sed 's/[^0-9]*//g'` - OFFSET=`pagestuff "$i" -p | tail -2 | grep offset | sed 's/[^0-9]*//g'` + SIZE=$(pagestuff "$i" -p | tail -2 | grep size | sed 's/[^0-9]*//g') + OFFSET=$(pagestuff "$i" -p | tail -2 | grep offset | sed 's/[^0-9]*//g') SIGNFILE="${TEMPDIR}/${OUTROOT}/${TARGETFILE}.sign" - DIRNAME="`dirname "${SIGNFILE}"`" + DIRNAME="$(dirname "${SIGNFILE}")" mkdir -p "${DIRNAME}" echo "Adding detached signature for: ${TARGETFILE}. Size: ${SIZE}. Offset: ${OFFSET}" dd if="$i" of="${SIGNFILE}" bs=1 skip=${OFFSET} count=${SIZE} 2>/dev/null done grep CodeResources < "${TEMPLIST}" | while read i; do - TARGETFILE="${BUNDLE}/`echo "${i}" | sed "s|.*${BUNDLE}/||"`" + TARGETFILE="${BUNDLE}/$(echo "${i}" | sed "s|.*${BUNDLE}/||")" RESOURCE="${TEMPDIR}/${OUTROOT}/${TARGETFILE}" - DIRNAME="`dirname "${RESOURCE}"`" + DIRNAME="$(dirname "${RESOURCE}")" mkdir -p "${DIRNAME}" echo "Adding resource for: \"${TARGETFILE}\"" cp "${i}" "${RESOURCE}" diff --git a/contrib/windeploy/detached-sig-create.sh b/contrib/windeploy/detached-sig-create.sh index 15f8108cf..e1b186607 100755 --- a/contrib/windeploy/detached-sig-create.sh +++ b/contrib/windeploy/detached-sig-create.sh @@ -23,7 +23,7 @@ TIMESERVER=http://timestamp.comodoca.com CERTFILE="win-codesign.cert" mkdir -p "${OUTSUBDIR}" -basename -a `ls -1 "${SRCDIR}"/*-unsigned.exe` | while read UNSIGNED; do +basename -a $(ls -1 "${SRCDIR}"/*-unsigned.exe) | while read UNSIGNED; do echo Signing "${UNSIGNED}" "${OSSLSIGNCODE}" sign -certs "${CERTFILE}" -t "${TIMESERVER}" -in "${SRCDIR}/${UNSIGNED}" -out "${WORKDIR}/${UNSIGNED}" "$@" "${OSSLSIGNCODE}" extract-signature -pem -in "${WORKDIR}/${UNSIGNED}" -out "${OUTSUBDIR}/${UNSIGNED}.pem" && rm "${WORKDIR}/${UNSIGNED}" diff --git a/packaging/build_darwin_64bit.sh b/packaging/build_darwin_64bit.sh index c69c78417..163afde1e 100755 --- a/packaging/build_darwin_64bit.sh +++ b/packaging/build_darwin_64bit.sh @@ -30,13 +30,13 @@ if which ccache >/dev/null; then fi pushd depends -make -j`getconf _NPROCESSORS_ONLN` HOST=x86_64-apple-darwin14 NO_QT=1 V=1 +make -j$(getconf _NPROCESSORS_ONLN) HOST=x86_64-apple-darwin14 NO_QT=1 V=1 popd ./autogen.sh -DEPS_DIR=`pwd`/depends/x86_64-apple-darwin14 +DEPS_DIR=$(pwd)/depends/x86_64-apple-darwin14 CONFIG_SITE=${DEPS_DIR}/share/config.site ./configure --enable-reduce-exports --without-gui --with-icu="${DEPS_DIR}" --enable-static --disable-shared -make -j`getconf _NPROCESSORS_ONLN` +make -j$(getconf _NPROCESSORS_ONLN) ${DEPS_DIR}/native/bin/x86_64-apple-darwin14-strip src/lbrycrdd src/lbrycrd-cli src/lbrycrd-tx if which ccache >/dev/null; then diff --git a/packaging/build_linux_64bit.sh b/packaging/build_linux_64bit.sh index 5aac6a2b5..834ed6944 100755 --- a/packaging/build_linux_64bit.sh +++ b/packaging/build_linux_64bit.sh @@ -20,13 +20,13 @@ export CXXFLAGS="${CXXFLAGS:--frecord-gcc-switches}" echo "CXXFLAGS set to $CXXFLAGS" cd depends -make -j`getconf _NPROCESSORS_ONLN` HOST=x86_64-pc-linux-gnu NO_QT=1 V=1 +make -j$(getconf _NPROCESSORS_ONLN) HOST=x86_64-pc-linux-gnu NO_QT=1 V=1 cd .. ./autogen.sh -DEPS_DIR=`pwd`/depends/x86_64-pc-linux-gnu +DEPS_DIR=$(pwd)/depends/x86_64-pc-linux-gnu CONFIG_SITE=${DEPS_DIR}/share/config.site ./configure --enable-static --disable-shared --with-pic --without-gui -make -j`getconf _NPROCESSORS_ONLN` +make -j$(getconf _NPROCESSORS_ONLN) strip src/lbrycrdd src/lbrycrd-cli src/lbrycrd-tx if which ccache >/dev/null; then @@ -34,4 +34,4 @@ if which ccache >/dev/null; then ccache -s fi -echo "Linux 64bit build is complete" \ No newline at end of file +echo "Linux 64bit build is complete" diff --git a/packaging/build_windows_32bit.sh b/packaging/build_windows_32bit.sh index 8d9bcfbf9..31aae4d74 100755 --- a/packaging/build_windows_32bit.sh +++ b/packaging/build_windows_32bit.sh @@ -21,13 +21,13 @@ if which ccache >/dev/null; then fi pushd depends -make -j`getconf _NPROCESSORS_ONLN` HOST=i686-w64-mingw32 NO_QT=1 V=1 +make -j$(getconf _NPROCESSORS_ONLN) HOST=i686-w64-mingw32 NO_QT=1 V=1 popd ./autogen.sh -DEPS_DIR=`pwd`/depends/i686-w64-mingw32 +DEPS_DIR=$(pwd)/depends/i686-w64-mingw32 CONFIG_SITE=${DEPS_DIR}/share/config.site ./configure --prefix=/ --without-gui --with-icu="$DEPS_DIR" --enable-static --disable-shared -make -j`getconf _NPROCESSORS_ONLN` +make -j$(getconf _NPROCESSORS_ONLN) i686-w64-mingw32-strip src/lbrycrdd.exe src/lbrycrd-cli.exe src/lbrycrd-tx.exe if which ccache >/dev/null; then diff --git a/packaging/build_windows_64bit.sh b/packaging/build_windows_64bit.sh index 121f4f206..d9372dbf1 100755 --- a/packaging/build_windows_64bit.sh +++ b/packaging/build_windows_64bit.sh @@ -20,13 +20,13 @@ if which ccache >/dev/null; then fi pushd depends -make -j`getconf _NPROCESSORS_ONLN` HOST=x86_64-w64-mingw32 NO_QT=1 V=1 +make -j$(getconf _NPROCESSORS_ONLN) HOST=x86_64-w64-mingw32 NO_QT=1 V=1 popd ./autogen.sh -DEPS_DIR=`pwd`/depends/x86_64-w64-mingw32 +DEPS_DIR=$(pwd)/depends/x86_64-w64-mingw32 CONFIG_SITE=${DEPS_DIR}/share/config.site ./configure --prefix=/ --without-gui --with-icu="$DEPS_DIR" --enable-static --disable-shared -make -j`getconf _NPROCESSORS_ONLN` +make -j$(getconf _NPROCESSORS_ONLN) x86_64-w64-mingw32-strip src/lbrycrdd.exe src/lbrycrd-cli.exe src/lbrycrd-tx.exe if which ccache >/dev/null; then diff --git a/src/univalue/autogen.sh b/src/univalue/autogen.sh index 4b38721fa..b35c6d726 100755 --- a/src/univalue/autogen.sh +++ b/src/univalue/autogen.sh @@ -2,7 +2,7 @@ set -e srcdir="$(dirname $0)" cd "$srcdir" -if [ -z ${LIBTOOLIZE} ] && GLIBTOOLIZE="`which glibtoolize 2>/dev/null`"; then +if [ -z ${LIBTOOLIZE} ] && GLIBTOOLIZE="$(which glibtoolize 2>/dev/null)"; then LIBTOOLIZE="${GLIBTOOLIZE}" export LIBTOOLIZE fi diff --git a/test/lint/commit-script-check.sh b/test/lint/commit-script-check.sh index f1327469f..2b70f9f9c 100755 --- a/test/lint/commit-script-check.sh +++ b/test/lint/commit-script-check.sh @@ -18,12 +18,12 @@ if test "x$1" = "x"; then fi RET=0 -PREV_BRANCH=`git name-rev --name-only HEAD` -PREV_HEAD=`git rev-parse HEAD` -for i in `git rev-list --reverse $1`; do +PREV_BRANCH=$(git name-rev --name-only HEAD) +PREV_HEAD=$(git rev-parse HEAD) +for i in $(git rev-list --reverse $1); do if git rev-list -n 1 --pretty="%s" $i | grep -q "^scripted-diff:"; then git checkout --quiet $i^ || exit - SCRIPT="`git rev-list --format=%b -n1 $i | sed '/^-BEGIN VERIFY SCRIPT-$/,/^-END VERIFY SCRIPT-$/{//!b};d'`" + SCRIPT="$(git rev-list --format=%b -n1 $i | sed '/^-BEGIN VERIFY SCRIPT-$/,/^-END VERIFY SCRIPT-$/{//!b};d')" if test "x$SCRIPT" = "x"; then echo "Error: missing script for: $i" echo "Failed"