From 171102cbbd4300ea3b0f1d8a21e50b012c7a6f59 Mon Sep 17 00:00:00 2001 From: Duke Date: Sun, 18 Feb 2024 09:37:06 -0500 Subject: [PATCH 01/25] Remove unused Makefile #291 --- src/cc/Makefile | 41 ----------------------------------------- 1 file changed, 41 deletions(-) delete mode 100644 src/cc/Makefile diff --git a/src/cc/Makefile b/src/cc/Makefile deleted file mode 100644 index 54f290573..000000000 --- a/src/cc/Makefile +++ /dev/null @@ -1,41 +0,0 @@ -SHELL = /bin/sh -CC = gcc -CC_DARWIN = g++-6 -CC_WIN = x86_64-w64-mingw32-gcc-posix -CFLAGS = -arch x86_64 -CXXFLAGS_DARWIN = -std=c++11 -arch x86_64 -I/usr/local/Cellar/gcc\@6/6.4.0_2/include/c++/6.4.0/ -I../../depends/$(shell echo `../..//depends/config.guess`/include) -I../univalue/include -I../cryptoconditions/include -I../cryptoconditions/src -I../cryptoconditions/src/asn -I -I../leveldb/include -I.. -I. -fPIC -c -Wl,-undefined -Wl,dynamic_lookup -dynamiclib -CXXFLAGS = -std=c++11 -I../../depends/$(shell echo `../..//depends/config.guess`/include) -I../univalue/include -I../cryptoconditions/include -I../cryptoconditions/src -I../cryptoconditions/src/asn -I../leveldb/include -I.. -I. -fPIC -shared -c -CXXFLAGS_WIN = -std=c++11 -I../../depends/$(shell echo `../..//depends/config.guess`/include) -I../univalue/include -I../cryptoconditions/include -I../cryptoconditions/src -I../cryptoconditions/src/asn -I../leveldb/include -I.. -I. -fPIC -shared -c -DEBUGFLAGS = -O0 -D _DEBUG -RELEASEFLAGS = -O2 -D NDEBUG -combine -fwhole-program -$(info $(OS)) -OS := $(shell uname -s) -$(info $(OS)) -TARGET = ../libcc.so -TARGET_DARWIN = ../libcc.dylib -TARGET_WIN = ../libcc.dll -SOURCES = cclib.cpp ../cJSON.c -OBJS = cclib.o ../cJSON.o - -all: $(TARGET) - -%.o: %.c - $(CC) -o $@ $< $(CFLAGS) $(DEBUGFLAGS) - -%.o: %.cpp - $(CC) -o $@ $< $(CXXFLAGS) $(DEBUGFLAGS) - -$(TARGET): $(OBJS) - $(info Building cclib to src/) -ifeq ($(OS),Darwin) - $(CC_DARWIN) $(CXXFLAGS_DARWIN) $(DEBUGFLAGS) -o $(TARGET_DARWIN) $(OBJS) -else ifeq ($(OS),Linux) - $(CC) $(CXXFLAGS) $(DEBUGFLAGS) -o $(TARGET) $(OBJS) -#else ifeq ($(WIN_HOST),True) - todo: pass ENV var from build.sh if WIN host -else - $(info WINDOWS) - $(CC_WIN) $(CXXFLAGS_WIN) $(DEBUGFLAGS) -o $(TARGET_WIN) $(OBJS) -endif - -clean: - rm -rf $(TARGET) From 7b3c26ddfeaf3dfff17eee123618473bc61a5480 Mon Sep 17 00:00:00 2001 From: Duke Date: Wed, 28 Feb 2024 12:43:43 -0500 Subject: [PATCH 02/25] Remove CC dingleberries --- src/cc/CCcustom.cpp | 5 --- src/cc/CCinclude.h | 65 --------------------------------- src/cc/CCutils.cpp | 2 - src/cc/cclib.cpp | 89 --------------------------------------------- src/cc/eval.cpp | 1 - 5 files changed, 162 deletions(-) diff --git a/src/cc/CCcustom.cpp b/src/cc/CCcustom.cpp index 8a30feadf..a98851afc 100644 --- a/src/cc/CCcustom.cpp +++ b/src/cc/CCcustom.cpp @@ -19,11 +19,6 @@ #include "key_io.h" #include "CCinclude.h" -int32_t CClib_initcp(struct CCcontract_info *cp,uint8_t evalcode) -{ - return(-1); -} - struct CCcontract_info *CCinit(struct CCcontract_info *cp, uint8_t evalcode) { return(cp); diff --git a/src/cc/CCinclude.h b/src/cc/CCinclude.h index fb9ac7c47..29cc60d6c 100644 --- a/src/cc/CCinclude.h +++ b/src/cc/CCinclude.h @@ -216,7 +216,6 @@ int32_t CCgetspenttxid(uint256 &spenttxid,int32_t &vini,int32_t &height,uint256 /// @private UniValue CClib(struct CCcontract_info *cp,char *method,char *jsonstr); -UniValue CClib_info(struct CCcontract_info *cp); static const uint256 zeroid; //!< null uint256 constant @@ -430,67 +429,6 @@ void CCaddr3set(struct CCcontract_info *cp,uint8_t evalcode,CPubKey pk,uint8_t * /// @see GetCCaddress1of2 void CCaddr1of2set(struct CCcontract_info *cp, CPubKey pk1, CPubKey pk2,uint8_t *priv,char *coinaddr); -/// Creates a token transaction output with a cryptocondition that allows to spend it by one key. -/// The resulting vout will have two eval codes (EVAL_TOKENS and evalcode parameter value). -/// The returned output should be added to a transaction vout array. -/// @param evalcode cryptocondition eval code (transactions with this eval code in cc inputs will be forwarded to the contract associated with this eval code) -/// @param nValue value of the output in satoshi -/// @param pk pubkey to spend the cc -/// @returns vout object -/// @see CCinit -/// @see CCcontract_info -CTxOut MakeTokensCC1vout(uint8_t evalcode, CAmount nValue, CPubKey pk); - -/// Another MakeTokensCC1vout overloaded function that creates a token transaction output with a cryptocondition with two eval codes that allows to spend it by one key. -/// Resulting vout will have three eval codes (EVAL_TOKENS, evalcode and evalcode2 parameter values). -/// The returned output should be added to a transaction vout array. -/// @param evalcode cryptocondition eval code (transactions with this eval code in cc inputs will be forwarded to the contract associated with this eval code) -/// @param evalcode2 yet another cryptocondition eval code (transactions with this eval code in cc inputs will be forwarded to the contract associated with this eval code) -/// @param nValue value of the output in satoshi -/// @param pk pubkey to spend the cc -/// @returns vout object -/// @see CCinit -/// @see CCcontract_info -CTxOut MakeTokensCC1vout(uint8_t evalcode, uint8_t evalcode2, CAmount nValue, CPubKey pk); - -/// MakeTokensCC1of2vout creates a token transaction output with a 1of2 cryptocondition that allows to spend it by either of two keys. -/// The resulting vout will have two eval codes (EVAL_TOKENS and evalcode parameter value). -/// The returned output should be added to a transaction vout array. -/// @param evalcode cryptocondition eval code (transactions with this eval code in cc inputs will be forwarded to the contract associated with this eval code) -/// @param nValue value of the output in satoshi -/// @param pk1 one of two pubkeys to spend the cc -/// @param pk2 second of two pubkeys to spend the cc -/// @returns vout object -/// @see CCinit -/// @see CCcontract_info -CTxOut MakeTokensCC1of2vout(uint8_t evalcode, CAmount nValue, CPubKey pk1, CPubKey pk2); - -/// Another overload of MakeTokensCC1of2vout creates a token transaction output with a 1of2 cryptocondition with two eval codes that allows to spend it by either of two keys. -/// The resulting vout will have three eval codes (EVAL_TOKENS, evalcode and evalcode2 parameter values). -/// The returned output should be added to a transaction vout array. -/// @param evalcode cryptocondition eval code (transactions with this eval code in cc inputs will be forwarded to the contract associated with this eval code) -/// @param evalcode2 yet another cryptocondition eval code (transactions with this eval code in cc inputs will be forwarded to the contract associated with this eval code) -/// @param nValue value of the output in satoshi -/// @param pk1 one of two pubkeys to spend the cc -/// @param pk2 second of two pubkeys to spend the cc -/// @returns vout object -/// @see CCinit -/// @see CCcontract_info -CTxOut MakeTokensCC1of2vout(uint8_t evalcode, uint8_t evalcode2, CAmount nValue, CPubKey pk1, CPubKey pk2); - -/// Gets adddress for token cryptocondition vout -/// @param cp CCcontract_info structure initialized with EVAL_TOKENS eval code -/// @param[out] destaddr retrieved address -/// @param pk public key to create the cryptocondition -bool GetTokensCCaddress(struct CCcontract_info *cp, char *destaddr, CPubKey pk); - -/// Gets adddress for token 1of2 cc vout -/// @param cp CCcontract_info structure initialized with EVAL_TOKENS eval code -/// @param[out] destaddr retrieved address -/// @param pk first public key to create the cryptocondition -/// @param pk2 second public key to create the cryptocondition -bool GetTokensCCaddress1of2(struct CCcontract_info *cp, char *destaddr, CPubKey pk, CPubKey pk2); - /// CCaddrTokens1of2set sets pubkeys, private key and cc addr for spending from 1of2 token cryptocondition vout /// @param cp contract info structure where the private key is set /// @param pk1 one of the two public keys of the 1of2 cc @@ -501,9 +439,6 @@ bool GetTokensCCaddress1of2(struct CCcontract_info *cp, char *destaddr, CPubKey /// @see CCcontract_info void CCaddrTokens1of2set(struct CCcontract_info *cp, CPubKey pk1, CPubKey pk2, uint8_t *priv, char *coinaddr); -/// @private -int32_t CClib_initcp(struct CCcontract_info *cp,uint8_t evalcode); - /// IsCCInput checks if scriptSig object contains a cryptocondition /// @param scriptSig scriptSig object with a cryptocondition /// @returns true if the scriptSig object contains a cryptocondition diff --git a/src/cc/CCutils.cpp b/src/cc/CCutils.cpp index a96fe02de..e46793288 100644 --- a/src/cc/CCutils.cpp +++ b/src/cc/CCutils.cpp @@ -456,6 +456,4 @@ int64_t TotalPubkeyCCInputs(const CTransaction &tx, const CPubKey &pubkey) return total; } -extern struct CCcontract_info CCinfos[0x100]; extern std::string MYCCLIBNAME; -bool CClib_validate(struct CCcontract_info *cp,int32_t height,Eval *eval,const CTransaction tx,unsigned int nIn); diff --git a/src/cc/cclib.cpp b/src/cc/cclib.cpp index 695ecc91f..cf0dfcfe2 100644 --- a/src/cc/cclib.cpp +++ b/src/cc/cclib.cpp @@ -40,70 +40,6 @@ extern std::string MYCCLIBNAME; char *CClib_name() { return((char *)MYCCLIBNAME.c_str()); } -struct CClib_rpcinfo -{ - char *CCname,*method,*help; - int32_t numrequiredargs,maxargs; - uint8_t funcid,evalcode; -} - -CClib_methods[] = -{ - { (char *)"faucet2", (char *)"fund", (char *)"amount", 1, 1, 'F', EVAL_FAUCET2 }, - { (char *)"faucet2", (char *)"get", (char *)"", 0, 0, 'G', EVAL_FAUCET2 }, -#ifdef BUILD_CUSTOMCC - RPC_FUNCS -#endif -}; - -std::string CClib_rawtxgen(struct CCcontract_info *cp,uint8_t funcid,cJSON *params); - -cJSON *cclib_reparse(int32_t *nump,char *jsonstr) // assumes origparams will be freed by caller -{ - cJSON *params; char *newstr; int32_t i,j; - *nump = 0; - if ( jsonstr != 0 ) - { - if ( jsonstr[0] == '"' && jsonstr[strlen(jsonstr)-1] == '"' ) - { - jsonstr[strlen(jsonstr)-1] = 0; - jsonstr++; - } - newstr = (char *)malloc(strlen(jsonstr)+1); - for (i=j=0; jsonstr[i]!=0; i++) - { - if ( jsonstr[i] == '%' && jsonstr[i+1] == '2' && jsonstr[i+2] == '2' ) - { - newstr[j++] = '"'; - i += 2; - } - else if ( jsonstr[i] == '\'' ) - newstr[j++] = '"'; - else newstr[j++] = jsonstr[i]; - } - newstr[j] = 0; - params = cJSON_Parse(newstr); - if ( 0 && params != 0 ) - printf("new.(%s) -> %s\n",newstr,jprint(params,0)); - free(newstr); - *nump = cJSON_GetArraySize(params); - //free(origparams); - } else params = 0; - return(params); -} - -UniValue CClib_method(struct CCcontract_info *cp,char *method,char *jsonstr) -{ - UniValue result(UniValue::VOBJ); - return(result); -} - -UniValue CClib_info(struct CCcontract_info *cp) -{ - UniValue result(UniValue::VOBJ); - return(result); -} - UniValue CClib(struct CCcontract_info *cp,char *method,char *jsonstr) { UniValue result(UniValue::VOBJ); @@ -120,11 +56,6 @@ bool CClibExactAmounts(struct CCcontract_info *cp,Eval* eval,const CTransaction return false; } -bool CClib_validate(struct CCcontract_info *cp,int32_t height,Eval *eval,const CTransaction tx,unsigned int nIn) -{ - return false; -} - int64_t AddCClibInputs(struct CCcontract_info *cp,CMutableTransaction &mtx,CPubKey pk,int64_t total,int32_t maxinputs,char *cmpaddr,int32_t CCflag) { return 0; @@ -135,21 +66,6 @@ int64_t AddCClibtxfee(struct CCcontract_info *cp,CMutableTransaction &mtx,CPubKe return(0); } -std::string Faucet2Fund(struct CCcontract_info *cp,uint64_t txfee,int64_t funds) -{ - return(""); -} - -std::string CClib_rawtxgen(struct CCcontract_info *cp,uint8_t funcid,cJSON *params) -{ - return(""); -} - -UniValue cclib_error(UniValue &result,const char *errorstr) -{ - return(result); -} - uint256 juint256(cJSON *obj) { uint256 tmp; bits256 t = jbits256(obj,0); @@ -157,11 +73,6 @@ uint256 juint256(cJSON *obj) return(revuint256(tmp)); } -int32_t cclib_parsehash(uint8_t *hash32,cJSON *item,int32_t len) -{ - return(0); -} - #if BUILD_CUSTOMCC #include "customcc.cpp" diff --git a/src/cc/eval.cpp b/src/cc/eval.cpp index 93e7d3927..4ee4547ff 100644 --- a/src/cc/eval.cpp +++ b/src/cc/eval.cpp @@ -30,7 +30,6 @@ char *CClib_name(); Eval* EVAL_TEST = 0; -struct CCcontract_info CCinfos[0x100]; extern pthread_mutex_t HUSH_CC_mutex; From 63fc690ca35655b0e7c267417021ea828a43142d Mon Sep 17 00:00:00 2001 From: onryo Date: Tue, 5 Mar 2024 17:51:45 +0000 Subject: [PATCH 03/25] Update cross-compile on Linux INSTALL.md for Windows --- INSTALL.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 51edd9fdb..76b8f2730 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -105,9 +105,9 @@ Downloading Git source repo, building and running Hush: ```sh # pull git clone https://git.hush.is/hush/hush3 -cd hush +cd hush3 # Build -./build-win.sh -j$(nproc) +./util/build-win.sh -j$(nproc) # Run a HUSH node ./src/hushd ``` From fc95d692e2063ea543d6eb012ebabbb048145e86 Mon Sep 17 00:00:00 2001 From: onryo Date: Wed, 6 Mar 2024 09:09:00 +0000 Subject: [PATCH 04/25] Update cross-compile on Linux INSTALL.md for Windows --- INSTALL.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 76b8f2730..1557ed4e4 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -95,8 +95,8 @@ After you have compiled Hush, then you can run it with the following command: Get dependencies: ```ssh sudo apt-get install \ - build-essential pkg-config libc6-dev m4 g++-multilib \ - autoconf libtool ncurses-dev unzip git python \ + build-essential pkg-config libc6-dev m4 g++-multilib libdb++-dev \ + autoconf libtool ncurses-dev unzip git zip \ zlib1g-dev wget bsdmainutils automake mingw-w64 cmake libsodium-dev ``` From 64f59552b381ab1dd0f50ec597a1d56bdcff0ad7 Mon Sep 17 00:00:00 2001 From: Duke Date: Fri, 15 Mar 2024 13:32:46 -0400 Subject: [PATCH 05/25] They are called Hush Arrakis Chains (HACs) now --- src/cc/dapps/zmigrate.c | 2 +- src/rpc/misc.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cc/dapps/zmigrate.c b/src/cc/dapps/zmigrate.c index e373d788b..4ccbc3636 100644 --- a/src/cc/dapps/zmigrate.c +++ b/src/cc/dapps/zmigrate.c @@ -23,7 +23,7 @@ #include "cJSON.c" /* -NOTE: HUSH nor any Hush Smart Chain has any sprout outputs. This code is kept for historical and educational purposes. +NOTE: HUSH nor any Hush Arrakis Chain has any sprout outputs. This code is kept for historical and educational purposes. z_migrate: the purpose of z_migrate is to make converting of all sprout outputs into sapling. the usage would be for the user to specify a sapling address and call z_migrate zsaddr, until it returns that there is nothing left to be done. diff --git a/src/rpc/misc.cpp b/src/rpc/misc.cpp index 5273d40d8..f70f60f79 100644 --- a/src/rpc/misc.cpp +++ b/src/rpc/misc.cpp @@ -482,7 +482,7 @@ UniValue validateaddress(const UniValue& params, bool fHelp, const CPubKey& mypk if (fHelp || params.size() != 1) throw runtime_error( "validateaddress \"addr\"\n" - "\nReturn information about the given Hush or Hush Smart Chain (HSC) address.\n" + "\nReturn information about the given Hush or Hush Arrakis Chain (HAC) address.\n" "\nArguments:\n" "1. \"addr\" (string, required) The address to validate\n" "\nResult:\n" From a7dd567031a9a26736833dcc5e625c04966ab02c Mon Sep 17 00:00:00 2001 From: Duke Date: Fri, 15 Mar 2024 13:33:18 -0400 Subject: [PATCH 06/25] They are called Hush Arrakis Chains (HACs) now --- src/{hush-smart-chain => hush-arrakis-chain} | 0 src/{hush-smart-chain.bat => hush-arrakis-chain.bat} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename src/{hush-smart-chain => hush-arrakis-chain} (100%) rename src/{hush-smart-chain.bat => hush-arrakis-chain.bat} (100%) diff --git a/src/hush-smart-chain b/src/hush-arrakis-chain similarity index 100% rename from src/hush-smart-chain rename to src/hush-arrakis-chain diff --git a/src/hush-smart-chain.bat b/src/hush-arrakis-chain.bat similarity index 100% rename from src/hush-smart-chain.bat rename to src/hush-arrakis-chain.bat From bbfa41c77d16759bd3f564ddc8f2ea2bef973474 Mon Sep 17 00:00:00 2001 From: Duke Date: Fri, 15 Mar 2024 13:34:07 -0400 Subject: [PATCH 07/25] They are called Hush Arrakis Chains (HACs) now --- doc/randomx.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/randomx.md b/doc/randomx.md index a690ded2b..474024041 100644 --- a/doc/randomx.md +++ b/doc/randomx.md @@ -1,9 +1,9 @@ # RandomX -Hush Smart Chains support using RandomX as a Proof-Of-Work algorithm as of release 3.9.2 . +Hush Arrakis Chains support using RandomX as a Proof-Of-Work algorithm as of release 3.9.2 . This means you can now launch a privacy coin with Hush tech that can be mined with a CPU instead of requiring an ASIC or GPU. RandomX is the same algorithm that Monero (XMR) and -various other cryptocoins use. As far as we know, Hush Smart Chains are the first coins +various other cryptocoins use. As far as we know, Hush Arrakis Chains are the first coins based on Zcash Protocol that can use the RandomX PoW algorithm. Many thanks to all the people who helped make this possible. @@ -67,7 +67,7 @@ HUSH RandomX currently has two advanced options that some may want to use: This section is not required reading if you just want to use it as a PoW algorithm for an HSC. Here we will explain how the internals of RandomX works inside of the Hush codebase. -We use the official RandomX implementation from https://github.com/tevador/RandomX with custom configuration options. If some type of hardware is created to mine the XMR RandomX algorithm, it will not be compatible with the Hush RandomX algorithm. This is by design. All Hush Smart Chains use the same RandomX config options, so if a hardware device is created to mine one HSC that uses RandomX, it can be used to mine any HSC using RandomX. Every HSC with unique consensus parameters will start off with it's own unique key block with at least 9 bytes of entropy. +We use the official RandomX implementation from https://github.com/tevador/RandomX with custom configuration options. If some type of hardware is created to mine the XMR RandomX algorithm, it will not be compatible with the Hush RandomX algorithm. This is by design. All Hush Arrakis Chains use the same RandomX config options, so if a hardware device is created to mine one HSC that uses RandomX, it can be used to mine any HSC using RandomX. Every HSC with unique consensus parameters will start off with it's own unique key block with at least 9 bytes of entropy. The source code of RandomX is embedded in the Hush source code at `./src/RandomX` and the configuration options used are at `./src/RandomX/src/configuration.h` . From 65c4c5c8de9b27c6e3c17d8ef1de49c9d5cb108c Mon Sep 17 00:00:00 2001 From: Duke Date: Fri, 15 Mar 2024 14:06:57 -0400 Subject: [PATCH 08/25] They are called Hush Arrakis Chains (HACs) now --- doc/hsc.md | 4 ++-- src/chainparams.cpp | 2 +- src/hush_bitcoind.h | 2 +- src/hush_utils.h | 2 +- src/init.cpp | 2 +- src/miner.cpp | 2 +- src/net.cpp | 2 +- src/pow.cpp | 2 +- src/wallet/asyncrpcoperation_sendmany.cpp | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/doc/hsc.md b/doc/hsc.md index 3ff3bc263..17e5cbb07 100644 --- a/doc/hsc.md +++ b/doc/hsc.md @@ -1,10 +1,10 @@ -# Hush Smart Chains +# Hush Arrakis Chains An overview of HSCs can be found here: https://git.hush.is/hush/hush-smart-chains -Hush Smart Chains allow you to create a privacy coin with no custom C++ code, just running one command! +Hush Arrakis Chains allow you to create a privacy coin with no custom C++ code, just running one command! The new coin that is created can use either Equihash PoW (ASIC or GPU) or RandomX PoW (CPU). ## HSC Creator diff --git a/src/chainparams.cpp b/src/chainparams.cpp index e2603e14c..02ab894a9 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -117,7 +117,7 @@ public: consensus.nPowMaxAdjustDown = 32; // 32% adjustment down consensus.nPowMaxAdjustUp = 16; // 16% adjustment up // we are emulating old node behavior at startup, they used 150s - consensus.nPowTargetSpacing = 150; // 75; // HUSH is 75 seconds, Hush Smart Chains are 60 seconds by default + consensus.nPowTargetSpacing = 150; // 75; // HUSH is 75 seconds, Hush Arrakis Chains are 60 seconds by default consensus.nPowAllowMinDifficultyBlocksAfterHeight = boost::none; // HUSH never had Sprout in our blockchain history, but some internals require *knowing* about Sprout // or it breaks backward compatibility. We do what we can. diff --git a/src/hush_bitcoind.h b/src/hush_bitcoind.h index 57eb1c8f3..7a05c4146 100644 --- a/src/hush_bitcoind.h +++ b/src/hush_bitcoind.h @@ -948,7 +948,7 @@ CAmount GetBlockSubsidy(int nHeight, const Consensus::Params& consensusParams); // This function defines the Hush Founders Reward (AKA Dev Tax) // 10% of all block rewards go towards Hush core team // If you do not like this, you are encouraged to fork the chain -// or start your own Hush Smart Chain: https://git.hush.is/hush/hush-smart-chains +// or start your own Hush Arrakis Chain: https://git.hush.is/hush/hush-smart-chains // HUSH supply curve cannot be exactly represented via CLI args, so we do it ourselves. // You specify the BR, and the FR % gets added so 10% of 12.5 is 1.25 // but to tell the AC params, I need to say "11% of 11.25" is 1.25 diff --git a/src/hush_utils.h b/src/hush_utils.h index 7b9269f0b..7da3fc452 100644 --- a/src/hush_utils.h +++ b/src/hush_utils.h @@ -1611,7 +1611,7 @@ uint64_t hush_block_subsidy(int height) return subsidy; } -// wrapper for more general supply curves of Hush Smart Chains +// wrapper for more general supply curves of Hush Arrakis Chains uint64_t hush_sc_block_subsidy(int nHeight) { // Find current era, start from beginning reward, and determine current subsidy diff --git a/src/init.cpp b/src/init.cpp index 89b3a3a12..91aeda565 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1128,7 +1128,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) LogPrintf("%s: parameter interaction: -externalip set -> setting -discover=0\n", __func__); } - // Read asmap file by default for HUSH3 and all Hush Smart Chains + // Read asmap file by default for HUSH3 and all Hush Arrakis Chains if (GetArg("-asmap",1)) { fs::path asmap_path = fs::path(GetArg("-asmap", "")); diff --git a/src/miner.cpp b/src/miner.cpp index 95797c684..9a4b17842 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -1128,7 +1128,7 @@ void static RandomXMiner() char randomxHash[RANDOMX_HASH_SIZE]; rxdebug("%s: created randomxHash of size %d\n", RANDOMX_HASH_SIZE); char randomxKey[82]; // randomx spec says keysize of >60 bytes is implementation-specific - // initial randomx key is unique to every Hush Smart Chain, and has at least 9 bytes (2^9=128 bits) of entropy + // initial randomx key is unique to every Hush Arrakis Chain, and has at least 9 bytes (2^9=128 bits) of entropy // since magic is 4 bytes, rpc port is 4 bytes and smart chain symbol must be at least 1 character long snprintf(randomxKey, 81, "%08x%s%08x", ASSETCHAINS_MAGIC, SMART_CHAIN_SYMBOL, ASSETCHAINS_RPCPORT); diff --git a/src/net.cpp b/src/net.cpp index 1223e252f..fd6ec86fe 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -2733,7 +2733,7 @@ bool CNode::GetTlsValidate() { if (tlsValidate == eTlsOption::FALLBACK_UNSET) { - // This is useful for private Hush Smart Chains, that want to exist + // This is useful for private Hush Arrakis Chains, that want to exist // on a closed VPN with an internal CA or trusted cert system, or // various other use cases if ( GetBoolArg("-tlsvalidate", false)) { diff --git a/src/pow.cpp b/src/pow.cpp index ac5bbb1f8..484b25b95 100644 --- a/src/pow.cpp +++ b/src/pow.cpp @@ -578,7 +578,7 @@ unsigned int CalculateNextWorkRequired(arith_uint256 bnAvg, return bnNew.GetCompact(); } -// HUSH does not use these functions but Hush Smart Chains can opt-in to using more bleeding edge DAA's +// HUSH does not use these functions but Hush Arrakis Chains can opt-in to using more bleeding edge DAA's // ASIC chains do not need these protections as much -- Duke Leto unsigned int lwmaGetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHeader *pblock, const Consensus::Params& params) { diff --git a/src/wallet/asyncrpcoperation_sendmany.cpp b/src/wallet/asyncrpcoperation_sendmany.cpp index f754158e3..311fc217c 100644 --- a/src/wallet/asyncrpcoperation_sendmany.cpp +++ b/src/wallet/asyncrpcoperation_sendmany.cpp @@ -363,7 +363,7 @@ bool AsyncRPCOperation_sendmany::main_impl() { /** - * SCENARIO #0 (All HUSH and Hush Smart Chains) + * SCENARIO #0 (All HUSH and Hush Arrakis Chains) * Sprout not involved, so we just use the TransactionBuilder and we're done. * We added the transparent inputs to the builder earlier. */ From 49f8cf7ca7fc196bafd0f6c1822b0dca10173917 Mon Sep 17 00:00:00 2001 From: Duke Date: Fri, 15 Mar 2024 15:08:10 -0400 Subject: [PATCH 09/25] Remove some unneeded cc code --- src/cc/customcc.cpp | 75 +-------------------------------------------- src/cc/customcc.h | 33 -------------------- 2 files changed, 1 insertion(+), 107 deletions(-) diff --git a/src/cc/customcc.cpp b/src/cc/customcc.cpp index 7edb95f79..961089de8 100644 --- a/src/cc/customcc.cpp +++ b/src/cc/customcc.cpp @@ -1,88 +1,15 @@ // Copyright (c) 2016-2024 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html -/* - simple stub custom cc - - Just update the functions in this file, then from ~/hush3/src/cc - - ../hush-cli -ac_name=CUSTOM stop - ./makecustom - ../hush-smart-chain -ac_name=CUSTOM -ac_cclib=custom -ac_cc=2 ... - - The above will rebuild hushd and get it running again - */ - -CScript custom_opret(uint8_t funcid,CPubKey pk) -{ - CScript opret; uint8_t evalcode = EVAL_CUSTOM; - opret << OP_RETURN << E_MARSHAL(ss << evalcode << funcid << pk); - return(opret); -} - -uint8_t custom_opretdecode(CPubKey &pk,CScript scriptPubKey) -{ - std::vector vopret; uint8_t e,f; - GetOpReturnData(scriptPubKey,vopret); - if ( vopret.size() > 2 && E_UNMARSHAL(vopret,ss >> e; ss >> f; ss >> pk) != 0 && e == EVAL_CUSTOM ) - { - return(f); - } - return(0); -} - -UniValue custom_rawtxresult(UniValue &result,std::string rawtx,int32_t broadcastflag) -{ - CTransaction tx; - if ( rawtx.size() > 0 ) - { - result.push_back(Pair("hex",rawtx)); - if ( DecodeHexTx(tx,rawtx) != 0 ) - { - if ( broadcastflag != 0 && myAddtomempool(tx) != 0 ) - RelayTransaction(tx); - result.push_back(Pair("txid",tx.GetHash().ToString())); - result.push_back(Pair("result","success")); - } else result.push_back(Pair("error","decode hex")); - } else result.push_back(Pair("error","couldnt finalize CCtx")); - return(result); -} UniValue custom_func0(uint64_t txfee,struct CCcontract_info *cp,cJSON *params) { UniValue result(UniValue::VOBJ); - result.push_back(Pair("result","success")); - result.push_back(Pair("message","just an example of an information returning rpc")); return(result); } -// send yourself 1 coin to your CC address using normal utxo from your -pubkey - UniValue custom_func1(uint64_t txfee,struct CCcontract_info *cp,cJSON *params) { - CMutableTransaction mtx = CreateNewContextualCMutableTransaction(Params().GetConsensus(), hush_nextheight()); std::string rawtx; - UniValue result(UniValue::VOBJ); CPubKey mypk; int64_t amount = COIN; int32_t broadcastflag=0; - if ( txfee == 0 ) - txfee = CUSTOM_TXFEE; - mypk = pubkey2pk(Mypubkey()); - if ( AddNormalinputs2(mtx,COIN+txfee,64) >= COIN+txfee ) // add utxo to mtx - { - // make op_return payload as normal. - CScript opret = custom_opret('1',mypk); - std::vector> vData = std::vector>(); - if ( makeCCopret(opret, vData) ) - { - // make vout0 with op_return included as payload. - mtx.vout.push_back(MakeCC1vout(cp->evalcode,amount,mypk,&vData)); - fprintf(stderr, "vout size2.%li\n", mtx.vout.size()); - rawtx = FinalizeCCTx(0,cp,mtx,mypk,txfee,CScript()); - return(custom_rawtxresult(result,rawtx,broadcastflag)); - } - } + UniValue result(UniValue::VOBJ); return(result); } - -bool custom_validate(struct CCcontract_info *cp,int32_t height,Eval *eval,const CTransaction tx) -{ - return false; -} diff --git a/src/cc/customcc.h b/src/cc/customcc.h index 4159d9608..7dfb78f84 100644 --- a/src/cc/customcc.h +++ b/src/cc/customcc.h @@ -1,20 +1,6 @@ // Copyright (c) 2016-2024 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html -/* - to create a custom libcc.so: - - 1. change "func0" and "func1" to method names that fit your custom cc. Of course, you can create more functions by adding another entry to RPC_FUNCS. there is not any practical limit to the number of methods. - - 2. For each method make sure there is a UniValue function declaration and CUSTOM_DISPATCH has an if statement checking for it that calls the custom_func - - 3. write the actual custom_func0, custom_func1 and custom_validate in customcc.cpp - - 4. ./makecustom, which builds cclib.cpp with -DBUILD_CUSTOMCC and puts the libcc.so in ~/hush3/src and rebuilds hushd - - 5. launch your chain with -ac_cclib=customcc -ac_cc=2 - - */ std::string MYCCLIBNAME = (char *)"customcc"; @@ -27,22 +13,3 @@ std::string MYCCLIBNAME = (char *)"customcc"; { (char *)MYCCNAME, (char *)"func0", (char *)"", 1, 1, '0', EVAL_CUSTOM }, \ { (char *)MYCCNAME, (char *)"func1", (char *)"", 0, 0, '1', EVAL_CUSTOM }, -bool custom_validate(struct CCcontract_info *cp,int32_t height,Eval *eval,const CTransaction tx); -UniValue custom_func0(uint64_t txfee,struct CCcontract_info *cp,cJSON *params); -UniValue custom_func1(uint64_t txfee,struct CCcontract_info *cp,cJSON *params); - -#define CUSTOM_DISPATCH \ -if ( cp->evalcode == EVAL_CUSTOM ) \ -{ \ - if ( strcmp(method,"func0") == 0 ) \ - return(custom_func0(txfee,cp,params)); \ - else if ( strcmp(method,"func1") == 0 ) \ - return(custom_func1(txfee,cp,params)); \ - else \ - { \ - result.push_back(Pair("result","error")); \ - result.push_back(Pair("error","invalid customcc method")); \ - result.push_back(Pair("method",method)); \ - return(result); \ - } \ -} From d1991e6454e47f181e2b82ba2f6d90176ad37c14 Mon Sep 17 00:00:00 2001 From: Duke Date: Fri, 15 Mar 2024 15:14:26 -0400 Subject: [PATCH 10/25] It is called hush-arrakis-chain now --- Dockerfile | 2 +- doc/randomx.md | 10 +++++----- qa/rpc-tests/test_framework/test_framework.py | 4 ++-- src/cc/dapps/dappinc.h | 2 +- src/dragonxd | 2 +- src/hush_bitcoind.h | 2 +- src/smartchains | 2 +- src/smartchains.old | 17 ----------------- src/testdragonxd | 2 +- util/build-debian-package.sh | 2 +- util/gen-linux-binary-release.sh | 2 +- 11 files changed, 15 insertions(+), 32 deletions(-) delete mode 100755 src/smartchains.old diff --git a/Dockerfile b/Dockerfile index b011397d8..946cbbd88 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,7 +25,7 @@ RUN cd /hush && \ RUN ln -sf /hush/src/hushd /usr/bin/hushd && \ ln -sf /hush/src/hush-tx /usr/bin/hush-tx && \ ln -sf /hush/src/wallet-utility /usr/bin/hush-wallet-utility && \ - ln -sf /hush/src/hush-smart-chain /usr/bin/hush-smart-chain && \ + ln -sf /hush/src/hush-arrakis-chain /usr/bin/hush-arrakis-chain && \ ln -sf /hush/util/docker-entrypoint.sh /usr/bin/entrypoint && \ ln -sf /hush/util/docker-hush-cli.sh /usr/bin/hush-cli diff --git a/doc/randomx.md b/doc/randomx.md index 474024041..1075c8890 100644 --- a/doc/randomx.md +++ b/doc/randomx.md @@ -13,12 +13,12 @@ The following command can be used to launch an HSC on a single computer. Each op HSC CLI arguments that start with `-ac_` means they *Affect Consensus*. ``` -./src/hush-smart-chain -ac_halving=100 -ac_algo=randomx -ac_name=RANDOMX -ac_private=1 -ac_blocktime=15 -ac_reward=500000000 -ac_supply=55555 -gen=1 -genproclimit=1 -testnode=1 +./src/hush-arrakis-chain -ac_halving=100 -ac_algo=randomx -ac_name=RANDOMX -ac_private=1 -ac_blocktime=15 -ac_reward=500000000 -ac_supply=55555 -gen=1 -genproclimit=1 -testnode=1 ``` - * `hush-smart-chain` is the script used to launch or connect to HSCs + * `hush-arrakis-chain` is the script used to launch or connect to HSCs * It lives in the `./src` directory, next to `hushd` and `hush-cli` - * It is called `hush-smart-chain.bat` on Windows + * It is called `hush-arrakis-chain.bat` on Windows * `-ac_halving=100` means "the block reward halves every 100 blocks" * `-ac_algo=randomx` means "use RandomX for Proof-Of-Work * The default is Equihash (200,9) @@ -41,12 +41,12 @@ HSC CLI arguments that start with `-ac_` means they *Affect Consensus*. * One node would use ``` # first node -./src/hush-smart-chain -ac_halving=100 -ac_algo=randomx -ac_name=RANDOMX -ac_private=1 -ac_blocktime=15 -ac_reward=500000000 -ac_supply=55555 +./src/hush-arrakis-chain -ac_halving=100 -ac_algo=randomx -ac_name=RANDOMX -ac_private=1 -ac_blocktime=15 -ac_reward=500000000 -ac_supply=55555 ``` * And the second node would use: ``` # mining node. NOTE: This node will mine the genesis block and pre-mine, if any -./src/hush-smart-chain -ac_halving=100 -ac_algo=randomx -ac_name=RANDOMX -ac_private=1 -ac_blocktime=15 -ac_reward=500000000 -ac_supply=55555 -gen=1 -genproclimit=1 +./src/hush-arrakis-chain -ac_halving=100 -ac_algo=randomx -ac_name=RANDOMX -ac_private=1 -ac_blocktime=15 -ac_reward=500000000 -ac_supply=55555 -gen=1 -genproclimit=1 ``` # Advanced Options diff --git a/qa/rpc-tests/test_framework/test_framework.py b/qa/rpc-tests/test_framework/test_framework.py index ff9cfaea6..273d9c6bf 100755 --- a/qa/rpc-tests/test_framework/test_framework.py +++ b/qa/rpc-tests/test_framework/test_framework.py @@ -162,10 +162,10 @@ class ComparisonTestFramework(BitcoinTestFramework): def add_options(self, parser): parser.add_option("--testbinary", dest="testbinary", - default=os.getenv("BITCOIND", "hush-smart-chain"), + default=os.getenv("BITCOIND", "hush-arrakis-chain"), help="bitcoind binary to test") parser.add_option("--refbinary", dest="refbinary", - default=os.getenv("BITCOIND", "hush-smart-chain"), + default=os.getenv("BITCOIND", "hush-arrakis-chain"), help="bitcoind binary to use for reference nodes (if any)") def setup_chain(self): diff --git a/src/cc/dapps/dappinc.h b/src/cc/dapps/dappinc.h index d9d77e4dc..e9afd7fdc 100644 --- a/src/cc/dapps/dappinc.h +++ b/src/cc/dapps/dappinc.h @@ -339,7 +339,7 @@ cJSON *get_hushcli(char *refcoin,char **retstrp,char *acname,char *method,char * if ( acname[0] != 0 ) { if ( refcoin[0] != 0 && strcmp(refcoin,"HUSH3") != 0 && strcmp(refcoin,acname) != 0 ) printf("unexpected: refcoin.(%s) acname.(%s)\n",refcoin,acname); - sprintf(cmdstr,"hush-smart-chain -ac_name=%s %s %s %s %s %s %s %s %s > %s\n",acname,method,arg0,arg1,arg2,arg3,arg4,arg5,arg6,fname); + sprintf(cmdstr,"hush-arrakis-chain -ac_name=%s %s %s %s %s %s %s %s %s > %s\n",acname,method,arg0,arg1,arg2,arg3,arg4,arg5,arg6,fname); } else if ( strcmp(refcoin,"HUSH3") == 0 ) sprintf(cmdstr,"hush-cli %s %s %s %s %s %s %s %s > %s\n",method,arg0,arg1,arg2,arg3,arg4,arg5,arg6,fname); diff --git a/src/dragonxd b/src/dragonxd index 7e6320ba5..076ce94dc 100755 --- a/src/dragonxd +++ b/src/dragonxd @@ -13,4 +13,4 @@ cd $DIR SEEDNODE=176.126.87.241 # Remember Remember the 5th November for freedom of speech is not free!! -./hush-smart-chain -ac_name=DRAGONX -ac_algo=randomx -ac_halving=3500000 -ac_reward=300000000 -ac_blocktime=36 -ac_private=1 -addnode=$SEEDNODE $@ +./hush-arrakis-chain -ac_name=DRAGONX -ac_algo=randomx -ac_halving=3500000 -ac_reward=300000000 -ac_blocktime=36 -ac_private=1 -addnode=$SEEDNODE $@ diff --git a/src/hush_bitcoind.h b/src/hush_bitcoind.h index 7a05c4146..59de08708 100644 --- a/src/hush_bitcoind.h +++ b/src/hush_bitcoind.h @@ -948,7 +948,7 @@ CAmount GetBlockSubsidy(int nHeight, const Consensus::Params& consensusParams); // This function defines the Hush Founders Reward (AKA Dev Tax) // 10% of all block rewards go towards Hush core team // If you do not like this, you are encouraged to fork the chain -// or start your own Hush Arrakis Chain: https://git.hush.is/hush/hush-smart-chains +// or start your own Hush Arrakis Chain: https://git.hush.is/hush/hush-arrakis-chains // HUSH supply curve cannot be exactly represented via CLI args, so we do it ourselves. // You specify the BR, and the FR % gets added so 10% of 12.5 is 1.25 // but to tell the AC params, I need to say "11% of 11.25" is 1.25 diff --git a/src/smartchains b/src/smartchains index ce46c8f18..e48482da2 100755 --- a/src/smartchains +++ b/src/smartchains @@ -6,7 +6,7 @@ set -eo pipefail source pubkey.txt overide_args="$@" seed_ip=$(SEEDNODE) -hsc='./hush-smart-chain' +hsc='./hush-arrakis-chain' if [ -z "$delay" ]; then delay=20; fi diff --git a/src/smartchains.old b/src/smartchains.old deleted file mode 100755 index 4df00be85..000000000 --- a/src/smartchains.old +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -# Copyright (c) 2018-2024 The Hush developers -set -x -delay=60 -source pubkey.txt -echo $pubkey -echo "jl777 is a traitor to his village of cypherpunks, ca333 is his obedient servant" - -hsc="./hush-smart-chain" -ip=$(HUSHDEX_SEEDNODE) - -# this chain helps power HushDEX -$hsc -pubkey=$pubkey -ac_name=ZEX -ac_supply=100000000 -addnode=$ip $@ & - -# these are testcoins, like ARRR -$hsc -pubkey=$pubkey -ac_name=ZUSH -ac_supply=100000000 -addnode=$ip $@ & -$hsc -pubkey=$pubkey -ac_name=KOOLAID -ac_supply=100000000 -addnode=$ip $@ & diff --git a/src/testdragonxd b/src/testdragonxd index 640152196..953ffd4ae 100755 --- a/src/testdragonxd +++ b/src/testdragonxd @@ -14,4 +14,4 @@ BLOCKTIME=18 SUPPLY=0 # Remember Remember the 5th November for freedom of speech is not free!! -./hush-smart-chain -ac_name=TESTDRAGONX -ac_algo=randomx -ac_halving=3500000 -ac_reward=300000000 -ac_blocktime=$BLOCKTIME -ac_private=1 -ac_supply=$SUPPLY -debug=randomx $@ +./hush-arrakis-chain -ac_name=TESTDRAGONX -ac_algo=randomx -ac_halving=3500000 -ac_reward=300000000 -ac_blocktime=$BLOCKTIME -ac_private=1 -ac_supply=$SUPPLY -debug=randomx $@ diff --git a/util/build-debian-package.sh b/util/build-debian-package.sh index c9719fd18..6fa0f1f7e 100755 --- a/util/build-debian-package.sh +++ b/util/build-debian-package.sh @@ -77,7 +77,7 @@ strip $DEB_BIN/hush-tx cp $SRC_PATH/src/dragonx-cli $DEB_BIN cp $SRC_PATH/src/dragonxd $DEB_BIN -cp $SRC_PATH/src/hush-smart-chain $DEB_BIN +cp $SRC_PATH/src/hush-arrakis-chain $DEB_BIN #cp $SRC_DEB/changelog $DEB_DOC/changelog.Debian cp $SRC_DEB/copyright $DEB_DOC cp -r $SRC_DEB/examples $DEB_DOC diff --git a/util/gen-linux-binary-release.sh b/util/gen-linux-binary-release.sh index f658fc5da..dbf5f392e 100755 --- a/util/gen-linux-binary-release.sh +++ b/util/gen-linux-binary-release.sh @@ -24,7 +24,7 @@ echo "Created new build dir $BUILD" cp contrib/asmap/asmap.dat $BUILD cp sapling*.params $BUILD cd src -cp hushd hush-cli hush-tx hush-smart-chain dragonx-cli dragonxd ../$BUILD +cp hushd hush-cli hush-tx hush-arrakis-chain dragonx-cli dragonxd ../$BUILD cd ../$BUILD strip hushd hush-cli hush-tx cd .. From 25c27d2ef56c3adb1e352753d89ddcfe7061d208 Mon Sep 17 00:00:00 2001 From: Duke Date: Fri, 15 Mar 2024 15:16:04 -0400 Subject: [PATCH 11/25] It is called hush-arrakis-chain now --- src/sc/koolaid | 2 +- src/sc/kush | 2 +- src/sc/zex | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sc/koolaid b/src/sc/koolaid index 9db2e58ce..a46b71aeb 100755 --- a/src/sc/koolaid +++ b/src/sc/koolaid @@ -1,3 +1,3 @@ #!/usr/bin/env bash # Copyright (c) 2018-2024 The Hush developers -./hush-smart-chain -ac_name=KOOLAID $@ +./hush-arrakis-chain -ac_name=KOOLAID $@ diff --git a/src/sc/kush b/src/sc/kush index bb8a34893..a5349a6a3 100755 --- a/src/sc/kush +++ b/src/sc/kush @@ -1,3 +1,3 @@ #!/usr/bin/env bash # Copyright (c) 2018-2024 The Hush developers -./hush-smart-chain -ac_name=KUSH $@ +./hush-arrakis-chain -ac_name=KUSH $@ diff --git a/src/sc/zex b/src/sc/zex index 12ffea170..55b4640ef 100755 --- a/src/sc/zex +++ b/src/sc/zex @@ -1,3 +1,3 @@ #!/usr/bin/env bash # Copyright (c) 2018-2024 The Hush developers -./hush-smart-chain -ac_name=ZEX $@ +./hush-arrakis-chain -ac_name=ZEX $@ From 9842687be2658f836e0812a4177e796b046ac38a Mon Sep 17 00:00:00 2001 From: Duke Date: Fri, 15 Mar 2024 15:17:04 -0400 Subject: [PATCH 12/25] It is called hush-arrakis-chain now --- src/testequihashd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/testequihashd b/src/testequihashd index 3de539bd9..5e46cddc1 100755 --- a/src/testequihashd +++ b/src/testequihashd @@ -15,4 +15,4 @@ SUPPLY=0 # same as TESTDRAGONX except equihash and different ac_name # and debug=pow which is the equivalent of debug=randomx for equihash mining -./hush-smart-chain -ac_name=TESTEQUIHASH -ac_halving=3500000 -ac_reward=300000000 -ac_blocktime=$BLOCKTIME -ac_private=1 -ac_supply=$SUPPLY -debug=pow $@ +./hush-arrakis-chain -ac_name=TESTEQUIHASH -ac_halving=3500000 -ac_reward=300000000 -ac_blocktime=$BLOCKTIME -ac_private=1 -ac_supply=$SUPPLY -debug=pow $@ From c5c0ce45da7ed5d6b41ef2f2ea8959e6e83df559 Mon Sep 17 00:00:00 2001 From: onryo Date: Fri, 15 Mar 2024 19:48:12 +0000 Subject: [PATCH 13/25] We call it hush arrakis chains --- doc/hsc.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/hsc.md b/doc/hsc.md index 17e5cbb07..1636419b6 100644 --- a/doc/hsc.md +++ b/doc/hsc.md @@ -13,7 +13,7 @@ https://git.hush.is/hush/hsc-creator with its site https://hush.is/hsc-creator ## HSC HOWTO -https://git.hush.is/onryo/hush-smart-chain-how-to +https://git.hush.is/onryo/hush-arrakis-chain-how-to ## HSC CLI From 8ff5e4aa5ea924205b33efd1edf67c059817aa99 Mon Sep 17 00:00:00 2001 From: Duke Date: Wed, 20 Mar 2024 14:09:02 -0400 Subject: [PATCH 14/25] Make getchaintxstats less noisy in debug log --- src/rpc/blockchain.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index 6b5f2e6b3..27f17852d 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -1620,12 +1620,12 @@ UniValue getchaintxstats(const UniValue& params, bool fHelp, const CPubKey& mypk throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid block count: should be between 0 and the block's height - 1"); } } - LogPrintf("%s: blockcount = %d\n", __func__, blockcount); + // LogPrintf("%s: blockcount = %d\n", __func__, blockcount); const CBlockIndex* pindexPast = pindex->GetAncestor(pindex->GetHeight() - blockcount); int nTimeDiff = pindex->GetMedianTimePast() - pindexPast->GetMedianTimePast(); int nTxDiff = pindex->nChainTx - pindexPast->nChainTx; - LogPrintf("%s: pindexPast.height = %d, pindex.height = %d\n", __func__, pindexPast->GetHeight(), pindex->GetHeight() ); + // LogPrintf("%s: pindexPast.height = %d, pindex.height = %d\n", __func__, pindexPast->GetHeight(), pindex->GetHeight() ); UniValue ret(UniValue::VOBJ); ret.pushKV("time", (int64_t)pindex->nTime); From 3354d45fd362d89a1a45a7a1686117b809ec2b64 Mon Sep 17 00:00:00 2001 From: Duke Date: Wed, 20 Mar 2024 16:19:54 -0400 Subject: [PATCH 15/25] Make getchaintxstats less noisy in debug log --- src/rpc/blockchain.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index 27f17852d..dbd0da9ed 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -1657,7 +1657,7 @@ UniValue getchaintxstats(const UniValue& params, bool fHelp, const CPubKey& mypk ret.pushKV("window_tx_count", nTxDiff); ret.pushKV("window_interval", nTimeDiff); int64_t nPaymentsDiff = pindex->nChainPayments - pindexPast->nChainPayments; - LogPrintf("%s: pindexPast.nChainPayments = %d, pindex.nChainPayments = %d\n", __func__, pindexPast->nChainPayments, pindex->nChainPayments ); + //LogPrintf("%s: pindexPast.nChainPayments = %d, pindex.nChainPayments = %d\n", __func__, pindexPast->nChainPayments, pindex->nChainPayments ); int64_t nShieldedTxDiff = pindex->nChainShieldedTx - pindexPast->nChainShieldedTx; int64_t nShieldingTxDiff = pindex->nChainShieldingTx - pindexPast->nChainShieldingTx; int64_t nDeshieldingTxDiff = pindex->nChainDeshieldingTx - pindexPast->nChainDeshieldingTx; From 558f662a3356e971056305ed43756849d5f22a87 Mon Sep 17 00:00:00 2001 From: Duke Date: Thu, 21 Mar 2024 11:17:58 -0400 Subject: [PATCH 16/25] Do not apply sapling network rules to block height 0 or 1 in ScanForWalletTransactions --- src/wallet/wallet.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 37b31ec85..18e38cb0c 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -2790,7 +2790,7 @@ int CWallet::ScanForWalletTransactions(CBlockIndex* pindexStart, bool fUpdate) // This should never fail: we should always be able to get the tree // state on the path to the tip of our chain if (pindex->pprev) { - const bool sapling = true; + const bool sapling = pindex->GetHeight() >= 2 ? true : false; if (sapling) { // NetworkUpgradeActive(pindex->pprev->GetHeight(), Params().GetConsensus(), Consensus::UPGRADE_SAPLING)) { assert(pcoinsTip->GetSaplingAnchorAt(pindex->pprev->hashFinalSaplingRoot, saplingTree)); } From 975f22bfa0caecbf4f7519fec907168ba50e0d4a Mon Sep 17 00:00:00 2001 From: Duke Date: Thu, 21 Mar 2024 11:30:34 -0400 Subject: [PATCH 17/25] Improve error message in z_sendmany if tx is estimated to be too large The previous error message was incorrect, it could be too many inputs or a combination of too many inputs and outputs and also did not report the estimated size. --- src/wallet/rpcwallet.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 51273a754..ec99d7516 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -5311,7 +5311,7 @@ UniValue z_sendmany(const UniValue& params, bool fHelp, const CPubKey& mypk) } txsize += CTXOUT_REGULAR_SIZE * taddrRecipients.size(); if (txsize > max_tx_size) { - throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("Too many outputs, size of raw transaction would be larger than limit of %d bytes", max_tx_size )); + throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("Size of raw transaction %d would be larger than limit of %d bytes", txsize, max_tx_size )); } // Minimum confirmations From 753ad7b95b073f7e579a78ad0dedea62137352d9 Mon Sep 17 00:00:00 2001 From: Duke Date: Fri, 22 Mar 2024 05:05:50 -0700 Subject: [PATCH 18/25] Remove .gitmodules --- .gitmodules | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 .gitmodules diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index e69de29bb..000000000 From f97008250409d9dd06ee70a136cce8e96617b73c Mon Sep 17 00:00:00 2001 From: Duke Date: Fri, 22 Mar 2024 05:07:00 -0700 Subject: [PATCH 19/25] Remove migratecoin.sh --- migratecoin.sh | 43 ------------------------------------------- 1 file changed, 43 deletions(-) delete mode 100644 migratecoin.sh diff --git a/migratecoin.sh b/migratecoin.sh deleted file mode 100644 index a4b05f417..000000000 --- a/migratecoin.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/usr/bin/env bash -# Copyright (c) 2016-2024 The Hush developers -# Distributed under the GPLv3 software license, see the accompanying -# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html -# This script makes the neccesary transactions to migrate -# coin between 2 assetchains on the same -ac_cc id -set -e -source=DERPZ -target=DERPZ000 -address="Rxxx" -amount=1 - -# Alias for running cli on source chain -cli_source="hush-cli -ac_name=$source" - -# Raw tx that we will work with -txraw=`$cli_source createrawtransaction "[]" "{\"$address\":$amount}"` - -# Convert to an export tx -exportData=`$cli_source migrate_converttoexport $txraw $target $amount` -exportRaw=`echo $exportData | jq -r .exportTx` -exportPayouts=`echo $exportData | jq -r .payouts` - -# Fund -exportFundedData=`$cli_source fundrawtransaction $exportRaw` -exportFundedTx=`echo $exportFundedData | jq -r .hex` - -# Sign -exportSignedData=`$cli_source signrawtransaction $exportFundedTx` -exportSignedTx=`echo $exportSignedData | jq -r .hex` - -# Send -echo "Sending export tx" -$cli_source sendrawtransaction $exportSignedTx - -read -p "Wait for a notarization to HUSH, and then two more notarizations from the target chain, and then press enter to continue" - -# Create import -importTx=`$cli_source migrate_createimporttransaction $exportSignedTx $payouts` -importTx=`hush-cli migrate_completeimporttransaction $importTx` - -# Send import -hush-cli -ac_name=$target sendrawtransaction $importTx From 981b27575719e32890125f8c698df0e4a57fd710 Mon Sep 17 00:00:00 2001 From: Duke Date: Fri, 22 Mar 2024 05:10:19 -0700 Subject: [PATCH 20/25] Delete unnecessary stuff --- antispam | 4 ---- test_antispam | 10 ---------- 2 files changed, 14 deletions(-) delete mode 100755 antispam delete mode 100755 test_antispam diff --git a/antispam b/antispam deleted file mode 100755 index 143c8ef32..000000000 --- a/antispam +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -echo "./src/hush-cli -ac_name=ANTISPAM $@" -./src/hush-cli -ac_name=ANTISPAM "$@" diff --git a/test_antispam b/test_antispam deleted file mode 100755 index 5ccfb4752..000000000 --- a/test_antispam +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -# any CLI args given to this script will be passed along -# example: ./test_antispam -debug=blah -#./src/hushd -ac_name=ANTISPAM -ac_private=1 -ac_blocktime=180 -ac_reward=500000000 -ac_supply=55555 -gen=1 -genproclimit=1 -testnode=1 $@ - -./src/hushd -ac_name=ANTISPAM -ac_private=1 -ac_blocktime=180 -ac_reward=500000000 -ac_supply=55555 $@ -# to run via the debugger -# type "run" when gdb prompt appears -#gdb --args ./src/hushd -- -ac_algo=randomx -ac_name=ANTISPAM -ac_private=1 -ac_blocktime=180 -ac_reward=500000000 -ac_supply=55555 -gen=1 -genproclimit=1 -testnode=1 From 89cc8a9ee3cf0a1a6aa715563b14e03d4d5d315a Mon Sep 17 00:00:00 2001 From: Duke Date: Fri, 22 Mar 2024 05:11:03 -0700 Subject: [PATCH 21/25] Move toolchain-info.sh to util/ --- toolchain-info.sh => util/toolchain-info.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename toolchain-info.sh => util/toolchain-info.sh (100%) diff --git a/toolchain-info.sh b/util/toolchain-info.sh similarity index 100% rename from toolchain-info.sh rename to util/toolchain-info.sh From f47a7a9d7f193079fab2d688f563510147051e44 Mon Sep 17 00:00:00 2001 From: Duke Date: Fri, 22 Mar 2024 05:15:58 -0700 Subject: [PATCH 22/25] We no longer need this junk --- DEVELOPER-AGREEMENT | 1 - code_of_conduct.md | 8 -------- 2 files changed, 9 deletions(-) delete mode 100644 DEVELOPER-AGREEMENT delete mode 100644 code_of_conduct.md diff --git a/DEVELOPER-AGREEMENT b/DEVELOPER-AGREEMENT deleted file mode 100644 index 85d69b4f3..000000000 --- a/DEVELOPER-AGREEMENT +++ /dev/null @@ -1 +0,0 @@ -You must agree that Duke Leto is the Elder of jl777. diff --git a/code_of_conduct.md b/code_of_conduct.md deleted file mode 100644 index 3c8ae50a3..000000000 --- a/code_of_conduct.md +++ /dev/null @@ -1,8 +0,0 @@ -# Contributor Code of Conduct - -As contributors and maintainers of this project, and in the interest of -fostering an open and welcoming community, we pledge to respect all people who -contribute through reporting issues, posting feature requests, updating -documentation, submitting pull requests or patches, and other activities. - -Don't be an asshole. From 63901954bedc065de3b031f05df7dd4bc8be1bb9 Mon Sep 17 00:00:00 2001 From: onryo Date: Sun, 31 Mar 2024 23:16:47 +0200 Subject: [PATCH 23/25] move stuff --- CONTRIBUTING.md | 58 ---------------------- DEVELOPING.md | 96 ------------------------------------ INSTALL-BIN.md | 11 ----- INSTALL.md | 122 ---------------------------------------------- OLD_WALLETS.md | 71 --------------------------- SECURITY.md | 90 ---------------------------------- share/genbuild.sh | 48 ------------------ test_randomx | 9 ---- 8 files changed, 505 deletions(-) delete mode 100644 CONTRIBUTING.md delete mode 100644 DEVELOPING.md delete mode 100644 INSTALL-BIN.md delete mode 100644 INSTALL.md delete mode 100644 OLD_WALLETS.md delete mode 100644 SECURITY.md delete mode 100755 share/genbuild.sh delete mode 100755 test_randomx diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 5866ab2e3..000000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,58 +0,0 @@ - -# Hush Core (hushd) Software Contribution Guidelines - -Thank you for reaching out and trying to make Hush an even better software application and cryptocoin platform. These contribution guidelines shall help you figuring out where you can be helpful and how to easily get started. - -## Table of Contents - -0. [Types of contributions we're looking for](#types-of-contributions-were-looking-for) -0. [Ground rules & expectations](#ground-rules--expectations) -0. [How to contribute](#how-to-contribute) -0. [Style guide](#style-guide) -0. [Setting up your environment](#setting-up-your-environment) -0. [Contribution review process](#contribution-review-process) -0. [Community](#community) - -## Types of contributions we're looking for -There are many ways you can directly contribute to Hush: - -* Debug and test the Hush Core code -* Find and fix bugs -* Improve suboptimal code -* Extend our software -* Perform a secure code review of Hush Full Node and other Hush-related software - -We have a curated list of projects with details about difficulty level and languages involved: https://git.hush.is/hush/projects - -Interested in making a contribution? Read on! - -## Ground rules & expectations - -Before we get started, here are a few things we expect from you (and that you should expect from others): - -* Be kind and thoughtful in your conversations around this project. We all come from different backgrounds and projects, which means we likely have different perspectives on "how free software and open source is done." Try to listen to others rather than convince them that your way is correct. -* Open Source Guides are released with a [Contributor Code of Conduct](./code_of_conduct.md). By participating in this project, you agree to abide by its terms. -* If you open a pull request, please ensure that your contribution does not increase test failures. If there are additional test failures, you will need to address them before we can merge your contribution. -* When adding content, please consider if it is widely valuable. Please don't add references or links to things you or your employer have created as others will do so if they appreciate it. - -## How to contribute - -If you'd like to contribute, start by searching through the [issues](https://git.hush.is/hush/hush3/issues) and [pull requests](https://git.hush.is/hush/hush3/pulls) to see whether someone else has raised a similar idea or question. - -If you don't see your idea listed, and you think it can contribute to Hush, do one of the following: -* **If your contribution is minor,** such as a fixing a typo, open a pull request. -* **If your contribution is major,** such as a new feature or bugfix, start by opening an issue first. That way, other contributors can weigh in on the discussion before you do any work. - -## Style guide - -Don't write shitty code. Do not emulate "jl777 code style" from Komodo, we consider that a bug, not a feature. - -## Setting up your environment - -The Hush Core (hushd) is mainly written in C++ with specific modules written in C. Follow the [Install](https://git.hush.is/hush/hush3/src/branch/master/INSTALL.md) instructions to build hushd from sources. For more informations about the Hush Platform and a full API documentation please visit the official [Hush Developer documentation](https://faq.hush.is/rpc/) - -Other Hush software is written in Rust or Go. We avoid Javascript at all costs. - -## Contribution review process - -We will tell you if we like your stuff. diff --git a/DEVELOPING.md b/DEVELOPING.md deleted file mode 100644 index 1de87fcc6..000000000 --- a/DEVELOPING.md +++ /dev/null @@ -1,96 +0,0 @@ -# Being a Hush Developer - -## Compiling Hush - -Normal compiling is as simple as: - - ./build.sh - -To make it use as many CPU threads as you have: - - ./build.sh -j$(nproc) # assumes linux - ./build.sh -j8 # use a fixed 8 threads, more portable - -This is dangerous! You need about 2GB of RAM per thread, plus all the -other programs and Operating System overhead. A good rule of thumb is: - -Divide how many GBs of RAM you have by 2, subtract one. Use that many jobs. - - -## Dealing with dependency changes - -Let's say you change a dependency and want the compile to notice. If your -change is outside of the main Hush source code, in ./src, simply running -`make` will not notice, and sometimes not even `build.sh`. You can always -do a fresh clone or `make clean`, but that will take a lot of time. Those -methods are actually best for Continuous Integration systems, but to help -reduce the time a developer has to wait, here are some PROTIPs. - - -If you are changing how a dependency is built, you should remove the entire directory like this: - - rm -rf depends/work/build/x86_64-unknown-linux-gnu/wolfssl/ - -The above will delete the entire source code of wolfssl dependency on `x86_64` -but it will keep the tar.gz and you will not need to download it again. If -you are testing a change in URL or SHA256, you will want to force it to download -again: - - rm -rf depends/sources/wolfssl*.tar.gz - -Now when you run `build.sh` again, you will be able to test your changes. - - -## Good Hygiene - -To avoid weird build system issues, it's often good to run: - - make clean - -*before* you switch Git branches. Otherwise, the new branches Makefiles -often are incompatible and `make clean` will be impossible, which can -sometimes introduce weird bugs or make compiling really annoying. -If `make clean` produces a compilation error, you just experienced it. - -## Switching branches - -Switching branches and doing partial compiles in Hush source code -can introduce weird bugs, which are fixed by running `build.sh` again. -Additionally, it's a good idea to run `make clean` before you switch -between branches. - -## Partial compiles - -At any point, you can modify hush source code and then use `make` or `build.sh` -to do a partial compile. The first is faster but the latter is more likely to -work correctly in all circustances. Sometimes partial compiles break weird -build system dependencies, and you must do a `make clean` first, or even -`git clean -fdx` (look up what it means first!) to clean things. The nuclear -option is to re-clone the repo, which sometimes is the least work to fix -the problem. - -Running `make` doesn't understand about dependency changes, such as Rust crates. -A simple C/C++ change can be tested with just `make` but if you change the version -of a dependency or something inside of Rust, you will need `build.sh` . - -## Generating new unix man pages - -Make sure that you have updated all version numbers in hushd and compiled, then -to generate new unix man pages for that version : - - ./util/gen-manpages.sh - -## Generating new debian packages - -After successfully compiling Hush, you can generate a debian package of these binaries with: - - ./util/build-debian-package.sh - -This command will not work on Mac OS X. Currently you cannot generate a Debian package -from operating systems other than Linux. Oh well. - -## Updates to this document - -If you think something else should be in this guide, please send your suggestions! - -Gitea: https://git.hush.is/hush/hush3 diff --git a/INSTALL-BIN.md b/INSTALL-BIN.md deleted file mode 100644 index 38c8e5a7d..000000000 --- a/INSTALL-BIN.md +++ /dev/null @@ -1,11 +0,0 @@ -# Installing Hush binaries - -1. First [download the release](https://git.hush.is/hush/hush3/releases) you want to install. It will have a .deb file extension. - -1. Next install the Debian package (change the version to what you downloaded above): - - `dpkg -i hush-3.8.0-amd64.deb` - -1. If you want to remove it, then run this to uninstall: - - `apt-get remove hush` diff --git a/INSTALL.md b/INSTALL.md deleted file mode 100644 index 1557ed4e4..000000000 --- a/INSTALL.md +++ /dev/null @@ -1,122 +0,0 @@ -# Installing Hush - -Instructions to compile Hush yourself. - -## Swap Space (Optional) -You will need at least 4GB of RAM to build hush from git source, OR you can -enable a swap file. To enable a 4GB swap file on modern Linux distributions: - -```sh -sudo fallocate -l 4G /swapfile -sudo chmod 600 /swapfile -sudo mkswap /swapfile -sudo swapon /swapfile -``` - -## Build on Debian/Ubuntu: - -```sh -# install build dependencies -sudo apt-get install build-essential pkg-config libc6-dev m4 g++-multilib \ - autoconf libtool ncurses-dev unzip git zlib1g-dev wget \ - bsdmainutils automake curl unzip nano libsodium-dev cmake -# clone git repo -git clone https://git.hush.is/hush/hush3 -cd hush3 -# Build -# This uses 3 build processes, you need 2GB of RAM for each. -./build.sh -j3 -``` - -## Build on Arch: - -```sh -# install build dependencies -sudo pacman -S gcc libsodium lib32-zlib unzip wget git python rust curl autoconf cmake -# clone git repo -git clone https://git.hush.is/hush/hush3 -cd hush3 -# Build -# This uses 3 build processes, you need 2GB of RAM for each. -./build.sh -j3 -``` - -## Build on Fedora: - -```sh -# install build dependencies -sudo dnf install make automake gcc gcc-c++ kernel-devel cmake libtool ncurses-devel patch -y -# clone git repo -git clone https://git.hush.is/hush/hush3 -cd hush3 -# Build -# This uses 3 build processes, you need 2GB of RAM for each. -./build.sh -j3 -``` - -### Building On Ubuntu 16.04 and older systems - -Some older compilers may not be able to compile modern code, such as gcc 5.4 which comes with Ubuntu 16.04 by default. Here is how to install gcc 7 on Ubuntu 16.04. Run these commands as root: - -``` -add-apt-repository ppa:ubuntu-toolchain-r/test && \ -apt update && \ -apt-get install -y gcc-7 g++-7 && \ - update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 60 && \ - update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 60 -``` - -### Build on Mac - -These instructions are a work in progress. Please report issues to https://hush.is/tg_support - -``` -sudo port update -sudo port upgrade outdated -sudo port install qt5 - -# clone git repo -git clone https://git.hush.is/hush/hush3 -cd hush3 -# Build -# This uses 3 build processes, you need 2GB of RAM for each. -./build.sh -j3 -``` - -## Run a HUSH Node - -After you have compiled Hush, then you can run it with the following command: - -```sh -./src/hushd -``` - -## Windows (cross-compiled on Linux) -Get dependencies: -```ssh -sudo apt-get install \ - build-essential pkg-config libc6-dev m4 g++-multilib libdb++-dev \ - autoconf libtool ncurses-dev unzip git zip \ - zlib1g-dev wget bsdmainutils automake mingw-w64 cmake libsodium-dev -``` - -Downloading Git source repo, building and running Hush: - -```sh -# pull -git clone https://git.hush.is/hush/hush3 -cd hush3 -# Build -./util/build-win.sh -j$(nproc) -# Run a HUSH node -./src/hushd -``` - -## ARM Architecture - -Currently, any ARMv7 machine will not be able to build this repo, because the -underlying tech (zcash and the zksnark library) do not support that instruction -set. - -This also means that old RaspberryPi devices will not work, unless they have a -newer ARMv8-based Raspberry Pi. Raspberry Pi 4 and newer are known to work. diff --git a/OLD_WALLETS.md b/OLD_WALLETS.md deleted file mode 100644 index 99f96f46f..000000000 --- a/OLD_WALLETS.md +++ /dev/null @@ -1,71 +0,0 @@ -## Claiming Funds From Old Hush Wallets - -Hush migrated to a new mainnet after Block 500,000 on the old Hush blockchain. -Funds in addresses as of Block 500,000 were transported to our new chain. About -31,000 addresses with at least 0.00000001 HUSH were transported to the new Hush -mainnet. - -To claim funds on the new chain, there are few options. - -### Funds on exchanges - -Firstly, no bueno! Not your keys, not your coins. It's best not to store coins -on exchanges. But in this case, you lucked out! There is nothing to do to claim -new coins if you have coins on an exchange that supports the new Hush chain. -The exchange will follow the instructions from the next section and you will -magically have funds on the new chain. Note that old Hush addresses started -with `t1` and now they begin with `R`. - -To see what an old HUSH v2 address looks like on the new chain, this online tool -can be used: https://dexstats.info/addressconverter.php - -or this command line tool: https://git.hush.is/hush/hush3/src/master/contrib/convert_address.py - - -### Using an old wallet.dat - -Backup your old HUSH wallet.dat, and backup any current wallet.dat that is in - - ~/.komodo/HUSH3/ - -OR - ~/.hush/HUSH3/ - -There is no way to lose funds, as long as you have backups!!! Make sure -to make backups. Do not skip this step. - -Make sure any/all GUI wallets are stopped! Also make sure your old Hush node -and new Hush3 node are stopped: - - cd hush3 - ./src/hush-cli stop - -Do not copy wallets or move wallets while your full node is running! This could -corrupt your wallet! - -Now copy your old Hush wallet.dat to - - ~/.hush/HUSH3/ - -with a command like - - # DO NOT RUN THIS WITHOUT MAKING BACKUPS! - cp ~/.hush/wallet.dat ~/.hush/HUSH3/ - -The reason this works is that both old HUSH and new HUSH are still Bitcoin Protocol -coins, which both use secp256k1 public keys. Now start your HUSH3 node again, -with this special CLI argument that will clear out transactions from your wallet: - - cd hush3 - ./src/hushd -zapwallettxes - -This will cause a full history rescan, which will take some time. Once it's complete, -you can see your funds with this command: - - ./src/hush-cli getwalletinfo - -NOTE: Do not use this wallet except to send funds to a new wallet! - -### Private Keys - -You can also transport funds one address at a time via private keys. diff --git a/SECURITY.md b/SECURITY.md deleted file mode 100644 index 97a9a68ce..000000000 --- a/SECURITY.md +++ /dev/null @@ -1,90 +0,0 @@ -## Reporting a Vulnerability - -You can use [Keybase](https://keybase.io/dukeleto) to find secure contact information. - -You can also contact Duke directly via SilentDragon wallet, via "Contact Duke". Encrypted sensitive data -in memo fields in highly encouraged. - -We kindly ask you to not publish or exploit any found vulnerabilities without at least contacting us first. - -Fingerprint: F16219F4C23F91112E9C734A8DFCBF8E5A4D8019 - -``` ------BEGIN PGP PUBLIC KEY BLOCK----- -Version: Keybase OpenPGP v2.0.8 -Comment: https://keybase.io/crypto - -xsFNBFU/8aYBEADf7eIcersi4Fbxdc2O6fuy3F9eoW6ap+bBz53fvZFMgBrKcUoV -2q6HkTQr/CWgPjx1LDwwBo7CBxOeg5FI8W5NVmVA+1XQ0TSa1fx8COpkPOAyCeDa -6aNQI1ciZS9xJeWy65gF2Mn+iJpgdkQj7xFxxaQpg8Uadq+jKzKp8BIMFyK10eSa -Pdn1xRDN3Bp5Ze2KUkv59nUc+C1Qx8mE5taXspSdHhrIL/78saGUZ4Q1bnlNex5u -aiAGRr5L/Qr0e5oEmfId56aQiCBqfvZmgUoun4djLdkAdhMW9bR8msbL/AycFvBn -C7fNTvic/vOw3yShd5jlr92OfNfHSgzJ5oa+BvMxPDbY4be8GPiTEvaGlPeEAec+ -HyQQHD2yzkhDCLPKbf6WDyRfnUTe3YoAEEmZWkgyP36ggB9gpoW5QuGC0P0Oz8Gz -jeqBdtnSwR30cwkH535ChjDP/W+KR1yoKZgenV5KuyA6WOZTkdFnDr1R33CkWA+q -NlZixmSYXZKPeL/z95ZDOiMTuUpG2/fqJsZMSfJ4GcMuF6UtWT5jM+/pzxPg0szq -8vEu8UZJD4UnUKJAb8XgfQbTXgmG3C+xAxPO2nrUD4etr375yyLR922mc9IRNj3v -oJqGYsYUfPwKS7ZsJU1N8bAtjdaxRHs6BL0r2sqEyvLwJLh/CdaNCK4HQQARAQAB -zSlrZXliYXNlLmlvL2R1a2VsZXRvIDxkdWtlbGV0b0BrZXliYXNlLmlvPsLBcAQT -AQoAGgUCVT/xpgIbLwMLCQcDFQoIAh4BAheAAhkBAAoJEI38v45aTYAZ0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UId/iiIzRhTF+cPsvjqRv6lxLNjdbrDr -BMCsvwqZl4Qst2Z2kAZYND6gSSQAlef4j3EGtoVrS46maPTimv1KoLsgCQ4ycFmP -4uU+2KebEY1IdJW50gAEipajiqwH0Biy+H1muanSluZLeC/LYRdH+ebXuguhYZbI -m4qCbO5rupke0gBFZ7rmqmnDhDg7riVUWvIrtL2YtWX8y8u50TCaQaRjyf0Fqyv8 -G76/DUCUCYcwNkm2qJdHpjVqOU+7E+iWfooA4obfGyPLtuLw2fpVDEDgn+csd+M4 -KlRY6butx+NDUqHtx1Axf6aC9Dl6LAE33UY8nlQWWFvJbQBAY54IzU0WehSgrJSB -tnKq9uroBB7qDoJExmOnlUaAsmJWjkfxsQS9lFam6lf1UD01AFiIql0rQTcacxrF -NvQ1HJmZvDZF/K37DrE72NmkYz1aJhTokGFHOGoCqLt146bA2IRkpQRXCv4= -=YSWs ------END PGP PUBLIC KEY BLOCK----- - -``` diff --git a/share/genbuild.sh b/share/genbuild.sh deleted file mode 100755 index 08fb91dc5..000000000 --- a/share/genbuild.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/sh -# Copyright (c) 2018-2024 The Hush developers -# Distributed under the GPLv3 software license, see the accompanying -# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html -if [ $# -gt 1 ]; then - cd "$2" -fi -if [ $# -gt 0 ]; then - FILE="$1" - shift - if [ -f "$FILE" ]; then - INFO="$(head -n 1 "$FILE")" - fi -else - echo "Usage: $0 " - exit 1 -fi - -DESC="" -SUFFIX="" -if [ -e "$(which git 2>/dev/null)" -a "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = "true" ]; then - # clean 'dirty' status of touched files that haven't been modified - git diff >/dev/null 2>/dev/null - - # if latest commit is tagged and not dirty, then override using the tag name - RAWDESC=$(git describe --abbrev=0 2>/dev/null) - if [ "$(git rev-parse HEAD)" = "$(git rev-list -1 $RAWDESC 2>/dev/null)" ]; then - git diff-index --quiet HEAD -- && DESC=$RAWDESC - fi - - # otherwise generate suffix from git, i.e. string like "59887e8-dirty" - SUFFIX=$(git rev-parse --short HEAD) - git diff-index --quiet HEAD -- || SUFFIX="$SUFFIX-dirty" - -fi - -if [ -n "$DESC" ]; then - NEWINFO="#define BUILD_DESC \"$DESC\"" -elif [ -n "$SUFFIX" ]; then - NEWINFO="#define BUILD_SUFFIX $SUFFIX" -else - NEWINFO="// No build information available" -fi - -# only update build.h if necessary -if [ "$INFO" != "$NEWINFO" ]; then - echo "$NEWINFO" >"$FILE" -fi diff --git a/test_randomx b/test_randomx deleted file mode 100755 index bc41bb85c..000000000 --- a/test_randomx +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash - -# any CLI args given to this script will be passed along -# example: ./test_randomx -debug=randomx - ./src/hushd -ac_randomx_interval=10 -ac_randomx_lag=3 -ac_halving=20 -ac_algo=randomx -ac_name=RANDOMX10 -ac_private=1 -ac_blocktime=20 -ac_reward=500000000 -ac_supply=55555 -gen=1 -genproclimit=1 -testnode=1 $@ - -# to run via the debugger -# type "run" when gdb prompt appears -#gdb --args ./src/hushd -- -ac_algo=randomx -ac_name=RANDOMX -ac_private=1 -ac_blocktime=30 -ac_reward=500000000 -ac_supply=55555 -gen=1 -genproclimit=1 -testnode=1 From 72c86d8f69ac580095ff0653f7525dc9cc8e0bc0 Mon Sep 17 00:00:00 2001 From: onryo Date: Sun, 31 Mar 2024 23:17:16 +0200 Subject: [PATCH 24/25] move stuff --- doc/CONTRIBUTING.md | 58 +++++++++++++++++++++++++++ doc/DEVELOPING.md | 96 +++++++++++++++++++++++++++++++++++++++++++++ doc/OLD_WALLETS.md | 71 +++++++++++++++++++++++++++++++++ doc/SECURITY.md | 90 ++++++++++++++++++++++++++++++++++++++++++ util/genbuild.sh | 48 +++++++++++++++++++++++ util/test_randomx | 9 +++++ 6 files changed, 372 insertions(+) create mode 100644 doc/CONTRIBUTING.md create mode 100644 doc/DEVELOPING.md create mode 100644 doc/OLD_WALLETS.md create mode 100644 doc/SECURITY.md create mode 100755 util/genbuild.sh create mode 100755 util/test_randomx diff --git a/doc/CONTRIBUTING.md b/doc/CONTRIBUTING.md new file mode 100644 index 000000000..5866ab2e3 --- /dev/null +++ b/doc/CONTRIBUTING.md @@ -0,0 +1,58 @@ + +# Hush Core (hushd) Software Contribution Guidelines + +Thank you for reaching out and trying to make Hush an even better software application and cryptocoin platform. These contribution guidelines shall help you figuring out where you can be helpful and how to easily get started. + +## Table of Contents + +0. [Types of contributions we're looking for](#types-of-contributions-were-looking-for) +0. [Ground rules & expectations](#ground-rules--expectations) +0. [How to contribute](#how-to-contribute) +0. [Style guide](#style-guide) +0. [Setting up your environment](#setting-up-your-environment) +0. [Contribution review process](#contribution-review-process) +0. [Community](#community) + +## Types of contributions we're looking for +There are many ways you can directly contribute to Hush: + +* Debug and test the Hush Core code +* Find and fix bugs +* Improve suboptimal code +* Extend our software +* Perform a secure code review of Hush Full Node and other Hush-related software + +We have a curated list of projects with details about difficulty level and languages involved: https://git.hush.is/hush/projects + +Interested in making a contribution? Read on! + +## Ground rules & expectations + +Before we get started, here are a few things we expect from you (and that you should expect from others): + +* Be kind and thoughtful in your conversations around this project. We all come from different backgrounds and projects, which means we likely have different perspectives on "how free software and open source is done." Try to listen to others rather than convince them that your way is correct. +* Open Source Guides are released with a [Contributor Code of Conduct](./code_of_conduct.md). By participating in this project, you agree to abide by its terms. +* If you open a pull request, please ensure that your contribution does not increase test failures. If there are additional test failures, you will need to address them before we can merge your contribution. +* When adding content, please consider if it is widely valuable. Please don't add references or links to things you or your employer have created as others will do so if they appreciate it. + +## How to contribute + +If you'd like to contribute, start by searching through the [issues](https://git.hush.is/hush/hush3/issues) and [pull requests](https://git.hush.is/hush/hush3/pulls) to see whether someone else has raised a similar idea or question. + +If you don't see your idea listed, and you think it can contribute to Hush, do one of the following: +* **If your contribution is minor,** such as a fixing a typo, open a pull request. +* **If your contribution is major,** such as a new feature or bugfix, start by opening an issue first. That way, other contributors can weigh in on the discussion before you do any work. + +## Style guide + +Don't write shitty code. Do not emulate "jl777 code style" from Komodo, we consider that a bug, not a feature. + +## Setting up your environment + +The Hush Core (hushd) is mainly written in C++ with specific modules written in C. Follow the [Install](https://git.hush.is/hush/hush3/src/branch/master/INSTALL.md) instructions to build hushd from sources. For more informations about the Hush Platform and a full API documentation please visit the official [Hush Developer documentation](https://faq.hush.is/rpc/) + +Other Hush software is written in Rust or Go. We avoid Javascript at all costs. + +## Contribution review process + +We will tell you if we like your stuff. diff --git a/doc/DEVELOPING.md b/doc/DEVELOPING.md new file mode 100644 index 000000000..1de87fcc6 --- /dev/null +++ b/doc/DEVELOPING.md @@ -0,0 +1,96 @@ +# Being a Hush Developer + +## Compiling Hush + +Normal compiling is as simple as: + + ./build.sh + +To make it use as many CPU threads as you have: + + ./build.sh -j$(nproc) # assumes linux + ./build.sh -j8 # use a fixed 8 threads, more portable + +This is dangerous! You need about 2GB of RAM per thread, plus all the +other programs and Operating System overhead. A good rule of thumb is: + +Divide how many GBs of RAM you have by 2, subtract one. Use that many jobs. + + +## Dealing with dependency changes + +Let's say you change a dependency and want the compile to notice. If your +change is outside of the main Hush source code, in ./src, simply running +`make` will not notice, and sometimes not even `build.sh`. You can always +do a fresh clone or `make clean`, but that will take a lot of time. Those +methods are actually best for Continuous Integration systems, but to help +reduce the time a developer has to wait, here are some PROTIPs. + + +If you are changing how a dependency is built, you should remove the entire directory like this: + + rm -rf depends/work/build/x86_64-unknown-linux-gnu/wolfssl/ + +The above will delete the entire source code of wolfssl dependency on `x86_64` +but it will keep the tar.gz and you will not need to download it again. If +you are testing a change in URL or SHA256, you will want to force it to download +again: + + rm -rf depends/sources/wolfssl*.tar.gz + +Now when you run `build.sh` again, you will be able to test your changes. + + +## Good Hygiene + +To avoid weird build system issues, it's often good to run: + + make clean + +*before* you switch Git branches. Otherwise, the new branches Makefiles +often are incompatible and `make clean` will be impossible, which can +sometimes introduce weird bugs or make compiling really annoying. +If `make clean` produces a compilation error, you just experienced it. + +## Switching branches + +Switching branches and doing partial compiles in Hush source code +can introduce weird bugs, which are fixed by running `build.sh` again. +Additionally, it's a good idea to run `make clean` before you switch +between branches. + +## Partial compiles + +At any point, you can modify hush source code and then use `make` or `build.sh` +to do a partial compile. The first is faster but the latter is more likely to +work correctly in all circustances. Sometimes partial compiles break weird +build system dependencies, and you must do a `make clean` first, or even +`git clean -fdx` (look up what it means first!) to clean things. The nuclear +option is to re-clone the repo, which sometimes is the least work to fix +the problem. + +Running `make` doesn't understand about dependency changes, such as Rust crates. +A simple C/C++ change can be tested with just `make` but if you change the version +of a dependency or something inside of Rust, you will need `build.sh` . + +## Generating new unix man pages + +Make sure that you have updated all version numbers in hushd and compiled, then +to generate new unix man pages for that version : + + ./util/gen-manpages.sh + +## Generating new debian packages + +After successfully compiling Hush, you can generate a debian package of these binaries with: + + ./util/build-debian-package.sh + +This command will not work on Mac OS X. Currently you cannot generate a Debian package +from operating systems other than Linux. Oh well. + +## Updates to this document + +If you think something else should be in this guide, please send your suggestions! + +Gitea: https://git.hush.is/hush/hush3 diff --git a/doc/OLD_WALLETS.md b/doc/OLD_WALLETS.md new file mode 100644 index 000000000..99f96f46f --- /dev/null +++ b/doc/OLD_WALLETS.md @@ -0,0 +1,71 @@ +## Claiming Funds From Old Hush Wallets + +Hush migrated to a new mainnet after Block 500,000 on the old Hush blockchain. +Funds in addresses as of Block 500,000 were transported to our new chain. About +31,000 addresses with at least 0.00000001 HUSH were transported to the new Hush +mainnet. + +To claim funds on the new chain, there are few options. + +### Funds on exchanges + +Firstly, no bueno! Not your keys, not your coins. It's best not to store coins +on exchanges. But in this case, you lucked out! There is nothing to do to claim +new coins if you have coins on an exchange that supports the new Hush chain. +The exchange will follow the instructions from the next section and you will +magically have funds on the new chain. Note that old Hush addresses started +with `t1` and now they begin with `R`. + +To see what an old HUSH v2 address looks like on the new chain, this online tool +can be used: https://dexstats.info/addressconverter.php + +or this command line tool: https://git.hush.is/hush/hush3/src/master/contrib/convert_address.py + + +### Using an old wallet.dat + +Backup your old HUSH wallet.dat, and backup any current wallet.dat that is in + + ~/.komodo/HUSH3/ + +OR + ~/.hush/HUSH3/ + +There is no way to lose funds, as long as you have backups!!! Make sure +to make backups. Do not skip this step. + +Make sure any/all GUI wallets are stopped! Also make sure your old Hush node +and new Hush3 node are stopped: + + cd hush3 + ./src/hush-cli stop + +Do not copy wallets or move wallets while your full node is running! This could +corrupt your wallet! + +Now copy your old Hush wallet.dat to + + ~/.hush/HUSH3/ + +with a command like + + # DO NOT RUN THIS WITHOUT MAKING BACKUPS! + cp ~/.hush/wallet.dat ~/.hush/HUSH3/ + +The reason this works is that both old HUSH and new HUSH are still Bitcoin Protocol +coins, which both use secp256k1 public keys. Now start your HUSH3 node again, +with this special CLI argument that will clear out transactions from your wallet: + + cd hush3 + ./src/hushd -zapwallettxes + +This will cause a full history rescan, which will take some time. Once it's complete, +you can see your funds with this command: + + ./src/hush-cli getwalletinfo + +NOTE: Do not use this wallet except to send funds to a new wallet! + +### Private Keys + +You can also transport funds one address at a time via private keys. diff --git a/doc/SECURITY.md b/doc/SECURITY.md new file mode 100644 index 000000000..97a9a68ce --- /dev/null +++ b/doc/SECURITY.md @@ -0,0 +1,90 @@ +## Reporting a Vulnerability + +You can use [Keybase](https://keybase.io/dukeleto) to find secure contact information. + +You can also contact Duke directly via SilentDragon wallet, via "Contact Duke". Encrypted sensitive data +in memo fields in highly encouraged. + +We kindly ask you to not publish or exploit any found vulnerabilities without at least contacting us first. + +Fingerprint: F16219F4C23F91112E9C734A8DFCBF8E5A4D8019 + +``` +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: Keybase OpenPGP v2.0.8 +Comment: https://keybase.io/crypto + +xsFNBFU/8aYBEADf7eIcersi4Fbxdc2O6fuy3F9eoW6ap+bBz53fvZFMgBrKcUoV +2q6HkTQr/CWgPjx1LDwwBo7CBxOeg5FI8W5NVmVA+1XQ0TSa1fx8COpkPOAyCeDa +6aNQI1ciZS9xJeWy65gF2Mn+iJpgdkQj7xFxxaQpg8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FiIql0rQTcacxrF +NvQ1HJmZvDZF/K37DrE72NmkYz1aJhTokGFHOGoCqLt146bA2IRkpQRXCv4= +=YSWs +-----END PGP PUBLIC KEY BLOCK----- + +``` diff --git a/util/genbuild.sh b/util/genbuild.sh new file mode 100755 index 000000000..08fb91dc5 --- /dev/null +++ b/util/genbuild.sh @@ -0,0 +1,48 @@ +#!/bin/sh +# Copyright (c) 2018-2024 The Hush developers +# Distributed under the GPLv3 software license, see the accompanying +# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html +if [ $# -gt 1 ]; then + cd "$2" +fi +if [ $# -gt 0 ]; then + FILE="$1" + shift + if [ -f "$FILE" ]; then + INFO="$(head -n 1 "$FILE")" + fi +else + echo "Usage: $0 " + exit 1 +fi + +DESC="" +SUFFIX="" +if [ -e "$(which git 2>/dev/null)" -a "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = "true" ]; then + # clean 'dirty' status of touched files that haven't been modified + git diff >/dev/null 2>/dev/null + + # if latest commit is tagged and not dirty, then override using the tag name + RAWDESC=$(git describe --abbrev=0 2>/dev/null) + if [ "$(git rev-parse HEAD)" = "$(git rev-list -1 $RAWDESC 2>/dev/null)" ]; then + git diff-index --quiet HEAD -- && DESC=$RAWDESC + fi + + # otherwise generate suffix from git, i.e. string like "59887e8-dirty" + SUFFIX=$(git rev-parse --short HEAD) + git diff-index --quiet HEAD -- || SUFFIX="$SUFFIX-dirty" + +fi + +if [ -n "$DESC" ]; then + NEWINFO="#define BUILD_DESC \"$DESC\"" +elif [ -n "$SUFFIX" ]; then + NEWINFO="#define BUILD_SUFFIX $SUFFIX" +else + NEWINFO="// No build information available" +fi + +# only update build.h if necessary +if [ "$INFO" != "$NEWINFO" ]; then + echo "$NEWINFO" >"$FILE" +fi diff --git a/util/test_randomx b/util/test_randomx new file mode 100755 index 000000000..7afc95931 --- /dev/null +++ b/util/test_randomx @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +# any CLI args given to this script will be passed along +# example: ./test_randomx -debug=randomx + ../src/hushd -ac_randomx_interval=10 -ac_randomx_lag=3 -ac_halving=20 -ac_algo=randomx -ac_name=RANDOMX10 -ac_private=1 -ac_blocktime=20 -ac_reward=500000000 -ac_supply=55555 -gen=1 -genproclimit=1 -testnode=1 $@ + +# to run via the debugger +# type "run" when gdb prompt appears +#gdb --args ./src/hushd -- -ac_algo=randomx -ac_name=RANDOMX -ac_private=1 -ac_blocktime=30 -ac_reward=500000000 -ac_supply=55555 -gen=1 -genproclimit=1 -testnode=1 From b446ec384c8b5a27670b55454ba79e139c46fbe7 Mon Sep 17 00:00:00 2001 From: onryo Date: Sun, 31 Mar 2024 23:54:32 +0200 Subject: [PATCH 25/25] make sure genbuild.sh builds --- Makefile.am | 2 +- src/Makefile.am | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile.am b/Makefile.am index ace177a9d..216a1e1d0 100644 --- a/Makefile.am +++ b/Makefile.am @@ -235,7 +235,7 @@ endif dist_bin_SCRIPTS = dist_noinst_SCRIPTS = autogen.sh util/build-debian-package.sh util/build.sh -EXTRA_DIST = $(top_srcdir)/share/genbuild.sh qa/pull-tester/rpc-tests.sh qa/pull-tester/run-bitcoin-cli qa/rpc-tests qa/hush $(DIST_DOCS) $(BIN_CHECKS) +EXTRA_DIST = $(top_srcdir)/util/genbuild.sh qa/pull-tester/rpc-tests.sh qa/pull-tester/run-bitcoin-cli qa/rpc-tests qa/hush $(DIST_DOCS) $(BIN_CHECKS) install-exec-hook: echo "We no longer install fetch-params!" diff --git a/src/Makefile.am b/src/Makefile.am index 846c941fb..d6ed7eb41 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -251,7 +251,7 @@ LIBHUSH_H = \ obj/build.h: FORCE @$(MKDIR_P) $(builddir)/obj - @$(top_srcdir)/share/genbuild.sh $(abs_top_builddir)/src/obj/build.h \ + @$(top_srcdir)/util/genbuild.sh $(abs_top_builddir)/src/obj/build.h \ $(abs_top_srcdir) libbitcoin_util_a-clientversion.$(OBJEXT): obj/build.h