Compare commits

...

642 Commits

Author SHA1 Message Date
Duke
74d66d8bf2 Merge branch 'dev' 2025-07-06 09:48:13 -04:00
Duke
4def0caf55 Merge branch 'master' into dev 2025-07-06 09:46:04 -04:00
Duke
1faf679a50 Update man pages via ./util/gen-manpages.sh 2025-07-03 12:57:20 -04:00
Duke
3caf605976 -ac_minopreturnfee is in puposhis 2025-06-27 10:46:42 -04:00
Duke
9042a24711 Update relnotes 2025-06-27 10:44:17 -04:00
Duke
a07b38b615 Hush 3.10.4 "Hazy Hākuturi" 2025-06-27 10:20:53 -04:00
Duke
7927965650 Update relnotes 2025-06-27 08:50:18 -04:00
Duke
97470e385d Disallow using -mineraddress and -clearnet=0 at the same time 2025-06-27 05:45:24 -04:00
Duke
7e63e2f013 We call them HACs now 2025-06-27 05:32:12 -04:00
Duke
3b105c0245 Update Dragonx checkpoints to 2241000 2025-06-26 13:42:03 -04:00
Duke
76c97a3bce Update Hush checkpoint to 2241000 2025-06-26 10:21:35 -04:00
Duke
af1ea27eb0 Remove Hush onions from drgx seed list and add fixed seeds to hush list 2025-06-25 10:21:52 -04:00
Duke
13749ab2b7 Add another .onion seed 2025-06-25 06:13:08 -04:00
Duke
2fa83f816d Add some seeds from chainparamsseeds.h to hush_utils.h 2025-06-25 06:09:59 -04:00
Duke
9772ad8e6f Add help doc that documents fixing database corruption 2025-06-09 12:51:25 -04:00
onryo
0d1b5fc83b make seeds 2025-06-08 19:11:04 +02:00
Duke
0a42eb3c1a Don't warn about no nodes to relay to when -testnode=1 2025-05-30 13:50:52 -04:00
duke
70672d02a3 Merge pull request 'z_sendmany_opreturn' (#467) from z_sendmany_opreturn into dev
Reviewed-on: https://git.hush.is/hush/hush3/pulls/467
2025-05-30 08:33:47 -04:00
duke
f220091f16 Fix relnotes formatting 2025-05-29 17:19:40 -04:00
Duke
a520a3e655 Support using non-hex utf8 strings with z_sendmany memo 2025-05-29 15:40:07 -04:00
Duke
cc1c0b30b0 There is now only one opreturn possible in z_sendmany so pull the assignment to opret out of the loop 2025-05-29 15:31:47 -04:00
Duke
38901a073b opreturn is no longer a valid json key in z_sendmany 2025-05-29 15:24:17 -04:00
Duke
a710dd2099 Allow an optional opreturn param 2025-05-29 15:08:40 -04:00
Duke
1a70e754ce Revert "Add new opreturn param for z_sendmany to conversion list"
This reverts commit d6b7fc633f8285579129b20f546f936dd09baa4c.
2025-05-29 15:08:27 -04:00
Duke
d6b7fc633f Add new opreturn param for z_sendmany to conversion list 2025-05-29 15:06:47 -04:00
Duke
b6418912f2 Document utf8: prefix in z_sendmany opreturn and add example to RPC help 2025-05-29 13:53:21 -04:00
Duke
48e0a989c1 Decode utf8 in opreturn and convert to hex 2025-05-29 02:39:58 -04:00
Duke
fb3eb56c8f Begin supporting utf8: in z_sendmany opreturn 2025-05-20 12:29:56 -04:00
Duke
492fbcd023 Leave opretValue null unless a 5th argument is given to avoid adding empty opreturns 2025-05-20 12:21:47 -04:00
Duke
97878fa065 There can be only one OP_RETURN in a tx 2025-05-20 11:47:22 -04:00
Duke
604d77fcd9 No use wasting memory to keep track of the set of all addresses and never use it 2025-05-17 23:28:31 -04:00
Duke
e748772fff Validate -ac_minopreturnfee as a consensus rule 2025-05-17 10:23:51 -04:00
Duke
dd4aac4f5f Ensure ASSETCHAINS_MINOPRETURNFEE modifies chain magic and document why 2025-05-16 21:18:56 -04:00
duke
ad51bc424f Merge pull request 'Add HAC option -ac_minopreturnfee to change OP_RETURN fee per tx, regardless of tx size, default is 1 coin' (#460) from jhendrix/hush3:ac_minopreturnfee into dev
Reviewed-on: https://git.hush.is/hush/hush3/pulls/460
2025-05-16 17:09:58 -04:00
jhendrix
0339a6bb24 Clarify that it is a minimum fee per tx that uses OP_RETURN
Blocking point for merging https://git.hush.is/hush/hush3/pulls/460.
2025-05-16 15:53:53 -04:00
jhendrix
5d037f52ff Add HAC option -ac_minopreturnfee to change OP_RETURN fee per tx, regardless of tx size, default is 1 coin 2025-05-16 15:03:42 +01:00
Duke
1d5c975f2f Merge branch 'dev' of https://git.hush.is/hush/hush3 into dev 2025-05-15 12:22:56 -04:00
Duke
d94b75087e Update relnotes 2025-05-15 12:22:51 -04:00
duke
d5a4321212 Merge pull request 'Add HAC option to allow sending funds to the transparent burn address when -ac_private=1' (#459) from ac_burn into dev
Reviewed-on: https://git.hush.is/hush/hush3/pulls/459
2025-05-15 12:06:06 -04:00
Duke
3d704d5f59 Merge branch 'dev' into ac_burn 2025-05-07 11:23:40 -04:00
Duke
77af03d9ee Merge branch 'opreturnfee' into dev 2025-05-07 11:20:35 -04:00
Duke
080092a16d -ac_burn=1 requires a z2t tx, -ac_burn=2 does not 2025-05-06 00:31:13 -04:00
Duke
d39503c13b Add HAC option to allow sending funds to the transparent burn address when -ac_private=1 2025-04-29 14:52:25 -04:00
Duke
c5843ae267 Merge branch 'dev' into opreturnfee 2025-04-28 09:41:17 -04:00
onryo
157ff2f8db Update seed list 2025-04-21 11:20:57 +02:00
Duke
a49abdbc5b Disable ASN healthcheck if clearnet=0 2025-03-26 09:03:18 -04:00
Duke
be85be83db -clearnet implies -dns=0 -dnsseed=0 2025-03-07 09:15:12 -05:00
Duke
f5934c6573 Fix SoftSetArg to also set value in mapMultiArgs
Without this fix, setting -bind=x on the CLI is different from
SoftSetArg("-bind", "x") in C++, which previously only set
the value in mapArgs
2025-03-07 09:04:35 -05:00
Duke
81be8caa3f Revert "Try to fix 'Failed to listen' error"
This reverts commit 11a9f950395c9a52572bbd2b1d387a57c0f385ab.
2025-03-06 10:24:26 -05:00
Duke
11a9f95039 Try to fix 'Failed to listen' error 2025-03-04 12:05:09 -05:00
Duke
e5d85af092 Also set -bind=127.0.0.1 when -clearnet=0 2025-03-03 11:59:52 -05:00
Duke
5dc6db7e5c Prevent unary_function warning and other warnings #449 2025-03-02 18:52:16 -05:00
duke
9c500f7c86 Merge pull request 'clearnet=0' (#457) from clearnet into dev
Reviewed-on: https://git.hush.is/hush/hush3/pulls/457
2025-03-02 13:13:08 -06:00
duke
46b93ed286 Merge branch 'dev' into opreturnfee 2025-03-02 10:09:56 -06:00
Duke
d51c2ac20b Detect -clearnet correctly 2025-03-01 10:13:34 -05:00
Duke
cbc8995b36 -clearnet=0 2025-02-28 12:58:01 -05:00
jahway603
454cb07bd3 Merge pull request 'Removed RPCs we do not have from TOR, i2p, and CJDNS docs' (#452) from jahway603 into dev
Reviewed-on: https://git.hush.is/hush/hush3/pulls/452
2025-02-26 22:44:22 -06:00
jahway603
babb4a39c2 Removed RPCs we do not have from TOR, i2p, and CJDNS docs 2025-02-26 23:42:31 -05:00
Duke
ca8711f50c Start adding 3.10.4 relnotes 2025-02-18 09:40:29 -05:00
Duke
937f341129 Merge branch 'dev' of https://git.hush.is/hush/hush3 into dev 2025-02-18 09:36:48 -05:00
Duke
7dec077899 Bump version and protocol version 2025-02-18 09:36:39 -05:00
Duke
b880801235 Move -disableipv4/-disableipv6 parsing to be after -onlynet parsing 2025-02-18 07:04:10 -05:00
Duke
1aebc75d0b Merge branch 'disableipv' into dev 2025-02-16 22:39:37 -05:00
Duke
44829674c8 Prevent the use of -disableipv4/-disableipv6 multiple times 2025-02-16 21:45:10 -05:00
Duke
53cf574c03 Use constants for the defaults of disableipv4/disableipv6 so the code and docs cannot be out of sync 2025-02-12 17:23:48 -05:00
Duke
85605737f0 Fix 'Not enough conversion specifiers in format string' 2025-02-12 17:13:46 -05:00
Duke
f98c34be1c Make -disableipv4/-disableipv6 do something useful 2025-02-12 13:38:53 -05:00
duke
0de56bf04a Update 'COPYING' 2025-02-03 22:19:03 -06:00
Duke
46e6faa6fb New script to calculate average blocktime between block heights
To use the script:
    ./contrib/avg_blocktime.pl DRAGONX

It has some default block heights defined, if you want custom ones
than those are given as 2nd and 3rd arguments. Currently the script
prints out:

Avg blocktime over 3000 blocks = 36.0526666666667

So with this evidence it seems that DRAGONX has the correct average
blocktime and network hashrate.
2024-12-25 12:03:29 -05:00
duke
1e49f0cc50 Merge pull request 'ASMap Health Check' (#447) from asmaphealth into dev
Reviewed-on: https://git.hush.is/hush/hush3/pulls/447
2024-12-03 10:56:27 -06:00
Duke
15f889d9f8 Cleanup 2024-12-03 11:55:43 -05:00
Duke
179fc6d6c0 Skip networks which do not have ASNs 2024-12-03 11:53:30 -05:00
Duke
ecf98cbce1 Schedule asmap health check to run once 5 mins after node starts 2024-12-03 11:28:11 -05:00
Duke
cceb61c371 Initial implementation of asmap health check 2024-12-02 11:11:40 -05:00
Duke
1009f931f2 Remove duplicate scheduling of peers.dat 2024-12-01 20:05:34 -05:00
duke
dad7fdec37 Merge pull request 'Updated asmap.dat to use 1730210400_asmap.dat from upstream commit dcce69e48211facdbd52a461cfce333d5800b7de' (#446) from jahway603 into dev
Reviewed-on: https://git.hush.is/hush/hush3/pulls/446
2024-11-21 16:49:06 +01:00
jahway603
f72ee57635 Updated asmap.dat to use 1730210400_asmap.dat from upstream commit dcce69e48211facdbd52a461cfce333d5800b7de 2024-11-20 23:53:45 -05:00
jahway603
6c947a335c Merge remote-tracking branch 'origin/master' into jahway603 2024-11-20 23:34:29 -05:00
Duke
0f4956be72 Support an env var to generate SDL checkpoints for a HAC 2024-11-18 10:43:08 -05:00
Duke
6e6ff5ccbc Support an env var to generate SDL checkpoints for a HAC 2024-11-18 07:10:25 -08:00
fekt
ecade7f950 revert 7117e7a7a12c829709beaae2e19d3ecb5f4ccc76
revert Update checkpoints
2024-11-18 04:03:30 +01:00
fekt
7117e7a7a1 Update checkpoints 2024-11-17 22:01:21 -05:00
jahway603
b343acc826 Merge pull request 'Added Debian check to util/build-debian-package.sh' (#443) from jahway603 into dev
Reviewed-on: https://git.hush.is/hush/hush3/pulls/443
2024-11-16 16:28:21 +01:00
jahway603
60148e66f4 Added Debian check to util/build-debian-package.sh 2024-11-16 10:26:33 -05:00
jahway603
2aa7169b56 Merge pull request 'Update debian/compat to version 13' (#442) from jahway603 into dev
Reviewed-on: https://git.hush.is/hush/hush3/pulls/442
2024-11-14 22:37:31 +01:00
jahway603
0249aecf00 Fixed contrib/debian/hush.example 2024-11-14 16:05:25 -05:00
jahway603
9782160ff6 Debchange package does not exist and bin lives in devscripts package 2024-11-14 15:54:46 -05:00
jahway603
d7a681cd54 Update debian/compat to version 13 2024-11-14 15:29:09 -05:00
Duke
5578bc81b9 Remove dead code 2024-11-11 08:25:38 -05:00
Duke
82f6b592c5 Remove dead code 2024-11-09 12:01:02 -05:00
Duke
f12152af70 Remove dead code 2024-11-09 10:27:58 -05:00
Duke
d31c69cf23 Remove dead code 2024-11-09 09:18:08 -05:00
Duke
dbc5a39afa Fee requirement only applies to txs with OP_RETURN 2024-11-02 10:39:47 -04:00
Duke
58f4be930e Require 1 COIN fee per tx that uses OP_RETURN, regardless of tx size 2024-11-01 11:40:54 -04:00
Duke
d8a799abe3 Make time warning correct for any HAC 2024-10-22 08:50:39 -04:00
Duke
65568d5738 Remove opreturn amnesty 2024-10-07 06:03:41 -04:00
duke
ad50c8cd97 Merge pull request 'Sync duke to dev' (#434) from duke into dev
Reviewed-on: https://git.hush.is/hush/hush3/pulls/434
2024-10-03 17:23:48 +02:00
Duke
8e44829cdf Merge branch 'dev' into duke 2024-10-03 11:11:07 -04:00
Duke
18e4ca070e Remove more cc stuff 2024-10-01 10:49:13 -04:00
jahway603
c9ac2c2d5d Merge pull request 'Fixed Debian package lintian errors' (#433) from jahway603 into dev
Reviewed-on: https://git.hush.is/hush/hush3/pulls/433
2024-10-01 16:44:03 +02:00
jahway603
b76795db43 Merge remote-tracking branch 'origin/dev' into jahway603 2024-10-01 08:58:18 -04:00
Duke
a00ad8eeb8 Merge branch 'dev' into duke 2024-10-01 08:58:09 -04:00
Duke
598b969987 Use our own hosted version of libgmp 2024-10-01 08:46:46 -04:00
jahway603
bc3bb358c7 Fixed Debian package lintian errors 2024-09-30 22:49:22 -04:00
onryo
3ccd8bd6cb Merge branch 'dev' 2024-09-30 23:42:13 +02:00
onryo
54b2f216ad make seeds 2024-09-30 23:37:08 +02:00
onryo
7729e58c49 Correct URLs to video tutorials
We no longer use PeerTube, so the path has changed
2024-09-30 20:06:30 +02:00
jahway603
7e82e86fbe Merge pull request 'Added link to README.md for the ARM cross compilation documentation' (#432) from jahway603 into dev
Reviewed-on: https://git.hush.is/hush/hush3/pulls/432
2024-09-30 18:44:28 +02:00
jahway603
bfff0e8742 Added link to README.md for the ARM cross compilation documentation 2024-09-30 12:41:16 -04:00
jahway603
24f64f5429 Merge pull request 'Updated Debian package changelog' (#431) from jahway603 into dev
Reviewed-on: https://git.hush.is/hush/hush3/pulls/431
2024-09-30 15:27:06 +02:00
jahway603
6133c1669c Updated Debian package changelog 2024-09-30 09:24:34 -04:00
Duke
67fe111050 Mention wolfssl change in relnotes 2024-09-30 04:36:21 -07:00
onryo
9f31214812 Add notes to 3.10.3 2024-09-29 02:44:50 +02:00
duke
9f11b437f3 Merge pull request 'Fix fatal error and the version flag option warning when compiling for windows on dev' (#425) from onryo into dev
Reviewed-on: https://git.hush.is/hush/hush3/pulls/425
2024-09-28 14:56:46 +02:00
duke
dd9722470d Merge pull request 'OP_RETURN fees' (#429) from opretfees into dev
Reviewed-on: https://git.hush.is/hush/hush3/pulls/429
2024-09-28 13:34:19 +02:00
onryo
be5a78931b Fix fatal error when compiling for windows on dev 2024-09-27 22:40:46 +02:00
onryo
e68795f4f9 Revert "Fix fatal error and the version flag option when compiling for windows"
This reverts commit f144f8a0b907e5573230fd23c4c11c931f94276b.
2024-09-27 22:39:32 +02:00
Duke
47cc49bcc5 Change OP_RETURN fee requirements
This commit removes the CLI option -opretmintxfee, makes it always
enabled, changes the required fee rate and changes which OP_RETURNS
get "amnesty" and do not need to pay this fee rate.
2024-09-27 09:09:31 -04:00
Duke
93f6514d86 Disable absurd fee checks when adding to the mempool
To protect users who are not using opreturn we prevent any use of z_sendmany
with absurd fees if opreturn is not being used, so this change only affects
users who are adding opreturn data. Since there is no way to currently send
opreturn data via a GUI this still protects all GUI users from absurd fees
while allowing CLI users to decide to use higher fees.
2024-09-26 11:13:07 -04:00
jahway603
13f6a3d432 Merge pull request 'Updated doc/release-process.md to resolve Issue #407' (#428) from jahway603 into dev
Reviewed-on: https://git.hush.is/hush/hush3/pulls/428
2024-09-26 17:08:55 +02:00
jahway603
7cb86b8aa6 Updated doc/release-process.md to resolve Issue #407 2024-09-26 11:06:29 -04:00
jahway603
7be46396ab Merge pull request 'Added build.sh checks for as and ld to be installed' (#427) from build.sh_changes into dev
Reviewed-on: https://git.hush.is/hush/hush3/pulls/427
2024-09-26 16:42:23 +02:00
jahway603
8333810f0f Added build.sh checks for as and ld to be installed 2024-09-26 10:39:28 -04:00
jahway603
ec07eb04fc Merge pull request 'updated Debian package copyright to resolve Issue #134' (#426) from jahway603 into dev
Reviewed-on: https://git.hush.is/hush/hush3/pulls/426
2024-09-26 16:23:28 +02:00
jahway603
c245242e0f updated Debian package copyright to resolve Issue #134 2024-09-26 10:21:20 -04:00
onryo
f144f8a0b9 Fix fatal error and the version flag option when compiling for windows 2024-09-26 05:04:55 +02:00
Duke
01f0c34661 We do not support coin imports 2024-09-24 09:35:20 -04:00
Duke
bd5f0103a8 Remove more cc code 2024-09-22 12:19:12 -04:00
Duke
b6bcacad20 We do not support coin imports 2024-09-22 12:16:21 -04:00
Duke
f6b42fe3a3 We do not support coin imports 2024-09-22 12:12:22 -04:00
Duke
148ea35a98 Remove dead sprout code 2024-09-22 11:56:12 -04:00
Duke
380875906d Remove more CC stuff 2024-09-22 09:40:37 -04:00
Duke
26a341983a const some stuff 2024-09-22 08:57:23 -04:00
Duke
986d0d8b7d isStake is always zero 2024-09-22 08:51:48 -04:00
Duke
45de2584b9 ASSETCHAINS_STAKED is always zero 2024-09-21 11:25:48 -04:00
Duke
3fba035c01 const some stuff 2024-09-21 11:04:25 -04:00
Duke
40cf90b4ff Fix compile issue with missing cast to unsigned int 2024-09-21 11:03:49 -04:00
onryo
4538bf9e1e Add agorax.is 2024-09-20 21:13:54 +02:00
onryo
183cd81cf6 Small fix in README
OLD_WALLETS.md will be in the correct path once dev is merged into master, changing it to master now to prevent users reading docs from the dev branch
2024-09-20 20:50:51 +02:00
Duke
2a740cb09d Merge branch 'duke' of https://git.hush.is/hush/hush3 into duke 2024-09-20 13:43:15 -04:00
Duke
a53d8baeda Do not lock cs_main in mining code
Technically we should take this lock but it has never been there before
and it leads to potentially large slow downs when mining with multiple cores.
We see basically the same hashrate for a single core if we have the lock or
not and that makes sense, since there is only one core, there are no other
mining threads that have to wait. But on one particular CPU I saw a 6% slower
hashing when mining with 2 threads and 35% slower with 3 threads.

This change also means debug builds will coredump if mining is enabled.
2024-09-20 13:41:51 -04:00
Duke
792fec7689 Do not lock cs_main in mining code
Technically we should take this lock but it has never been there before
and it leads to potentially large slow downs when mining with multiple cores.
We see basically the same hashrate for a single core if we have the lock or
not and that makes sense, since there is only one core, there are no other
mining threads that have to wait. But on one particular CPU I saw a 6% slower
hashing when mining with 2 threads and 35% slower with 3 threads.

This change also means debug builds will coredump if mining is enabled.
2024-09-20 13:35:38 -04:00
Duke
dfeccf6ce4 Make nBlockPrioritySize and nBlockMinSize consts 2024-09-20 11:24:59 -04:00
Duke
5a3c06e539 MAX_BLOCK_SIZE ignores height argument
The function no longer looks at this argument so don't waste resources calculating a height.
2024-09-20 11:18:16 -04:00
Duke
f3995fa1b7 Cleanup MAX_BLOCK_SIZE 2024-09-18 18:12:01 -04:00
Duke
ad8a86a19b Merge branch 'dev' into duke 2024-09-18 12:16:29 -04:00
Duke
d471af9ef5 IsPegsImport() is always false
Since this function always returns false and is used in many "hot"
code paths, removing it from the code should give us a performance boost.
2024-09-18 12:13:37 -04:00
Duke
ffce5edda3 Remove commented out code 2024-09-18 11:59:00 -04:00
Duke
5e30079fcd IsPegsImport() always returns false 2024-09-18 11:53:40 -04:00
Duke
160802cddf Update relnotes 2024-09-18 11:48:52 -04:00
Duke
fcc5c17628 Bump protocol version and client version 2024-09-18 10:59:37 -04:00
Duke
d915fc38b7 Add some useful comments to the wolfssl package 2024-09-18 10:53:28 -04:00
Duke
adbd47980c Merge branch 'dev' of https://git.hush.is/hush/hush3 into dev 2024-09-18 10:50:42 -04:00
duke
c567096aae Merge pull request 'wolfssl downgrade to 4.8.1' (#422) from wolfssldowngrade into dev
Reviewed-on: https://git.hush.is/hush/hush3/pulls/422
2024-09-18 16:48:29 +02:00
Duke
27f72405b2 Also print address to stderr in hush_isnotaryvout 2024-09-17 13:11:11 -04:00
Duke
bd967b7ac6 Exit out of TLSManager::waitFor() loop if shutdown requested 2024-09-17 11:30:01 -04:00
Duke
8adaa3641f Exit out of TLSManager::waitFor() loop if shutdown requested 2024-09-17 11:29:24 -04:00
onryo
6feea4cfd2 wolfssl downgrade to 4.8.1 test 2024-09-17 09:25:58 +00:00
duke
49f303d804 Merge pull request 'Sync duke branch to dev' (#420) from duke into dev
Reviewed-on: https://git.hush.is/hush/hush3/pulls/420
2024-09-16 17:31:37 +02:00
Duke
3f50dd988a Only use -rdynamic on debug builds 2024-09-16 11:26:28 -04:00
Duke
bc20629b9f Revert "Fix memory DoS"
This reverts commit 84377caae78116b817dbb64434def0b1ecffab74.
2024-09-16 11:18:16 -04:00
Duke
fc5b0f38bd Revert "Memory DoS fixes"
This reverts commit 6a5f0eafde1d055dec2124e7564180cdaa9c7194.
2024-09-16 11:17:56 -04:00
Duke
c5eeb74807 Simplify MAX_BLOCK_SIZE
Our code requires sapling activation at height 1 so we can simplify this function
which should lead to some performance improvements since it is called from many
places, including mining code.
2024-09-16 11:06:31 -04:00
fekt
6a5f0eafde Memory DoS fixes 2024-09-15 01:20:06 -04:00
Duke
912942f2a8 Delete more CC stuff 2024-09-13 18:50:28 -04:00
Duke
4f4a72da8e Go back to taking both main+wallet lock in DecrementWitnesses
By taking a wallet lock first and then main later we run into
a potential deadlock :

2024-09-13 11:14:37 POTENTIAL DEADLOCK DETECTED
2024-09-13 11:14:37 Previous lock order was:
2024-09-13 11:14:37  (1) cs_wallet  wallet/wallet.cpp:985
2024-09-13 11:14:37  (2) cs_main  wallet/wallet.cpp:890
2024-09-13 11:14:37 Current lock order is:
2024-09-13 11:14:37  (2) cs_main  wallet/wallet.cpp:2845
2024-09-13 11:14:37  (1) cs_wallet  wallet/wallet.cpp:2845
2024-09-13 09:34:10 -04:00
Duke
f5cae3b403 getinfo rpc needs a cs_wallet lock
Without it we get an AssertLockHeld when calling GetKeyPoolSize .
We could probably make this lock apply to less code, possibly only
the single line that calls GetKeyPoolSize() needs it.
2024-09-13 04:37:48 -04:00
Duke
6845fcd93a This rpc can only be used on non z2z chains 2024-09-13 04:22:28 -04:00
Duke
be3641158a Only take cs_main lock in GetSaplingSpendDepth
We do not seem to need this lock for the entire DecrementNoteWitnesses function,
we need it only when calling GetSaplingSpendDepth. Also protects against
the case in the future where some code without cs_main calls GetSaplingSpendDepth.
2024-09-13 04:11:38 -04:00
Duke
72c530d281 SMART_CHAIN_SYMBOL is always defined 2024-09-13 03:50:07 -04:00
fekt
84377caae7 Fix memory DoS 2024-09-13 04:22:08 +00:00
Duke
7e486538c9 SMART_CHAIN_SYMBOL is always set, so we can remove these checks 2024-09-12 20:12:26 -04:00
Duke
215d0b7db4 Remove commented out code 2024-09-12 20:02:10 -04:00
Duke
8b0c0493ac Ensure cs_main lock is held when TestBlockValidity() is called 2024-09-12 19:47:42 -04:00
Duke
04165e161a Explain more details about the burn address 2024-09-12 13:40:30 -04:00
onryo
d3cfecc425 Revert "Add burn address to the notary list"
This reverts commit 4fcb3e6ed5d0909fcebc50a2ac86c2dea0b2dc63.
2024-09-12 19:28:30 +02:00
onryo
25dc60e6b5 Revert "Add season 8"
This reverts commit e104a33f2a0cd5af959c43a1b94c62fefdc07500.
2024-09-12 19:26:51 +02:00
Duke
f8e7df37a1 Delete commented out code 2024-09-12 12:12:59 -04:00
Duke
7f9878cf0c Take a lock on cs_main in DecrementNoteWitnesses
Another possibly better approach would be to take a lock inside
GetSaplingSpendDepth since we want the lock to apply to as little
code as possible and it is GetSaplingSpendDepth that calls GetDepthInMainChain
which requires a cs_main lock .
2024-09-12 11:47:58 -04:00
onryo
e104a33f2a Add season 8 2024-09-12 17:42:42 +02:00
Duke
aab240e3b3 Temporary change to add -rdynamic to build flags
This allows us to see function names in a backtrace when AssertLockHeld
gives us an assert, which is helping to debug our deadlock bug.

This code should be improved to only do this for debug builds.
2024-09-12 11:21:46 -04:00
onryo
4fcb3e6ed5 Add burn address to the notary list
This change allows sending funds to the burn address.
2024-09-12 16:21:29 +02:00
onryo
243c726243 Update checkpoints for Hush and DragonX 2024-09-12 15:38:57 +02:00
onryo
c9470f29b7 Update checkpoints for Hush and DragonX 2024-09-12 15:19:01 +02:00
Duke
ed86f2dd1d Sleep for 200us before each ActivateBestChainStep call
This should lower the main thread's likelihood to immediately reacquire
cs_main after dropping it, which should help ThreadNotifyWallets and the
RPC methods to acquire cs_main more quickly.

Ported from ZEC commit e2cd1b761fe556bc6d61849346902c3611530307
2024-09-12 00:21:56 -04:00
Duke
b4e083ae56 Add what seems to be missing locks in mining code 2024-09-11 23:59:57 -04:00
Duke
b71d95bdd4 Delete disabled code 2024-09-11 23:32:46 -04:00
Duke
aa75877cd6 Print stacktrace when asserting a lock is held 2024-09-11 23:31:44 -04:00
Duke
726191cad4 Merge branch 'dev' into duke 2024-09-11 22:27:33 -04:00
Duke
2a910549ba Merge branch 'dev' of https://git.hush.is/hush/hush3 into dev 2024-09-11 14:53:58 -04:00
Duke
25f2ccb30e Document exactly what the RD6GgnrMpPaTSMn8vai6yiGA7mN4QGPVMY address is and how it is derived 2024-09-11 14:53:33 -04:00
duke
1965ad23c9 Merge pull request 'Sync duke to dev' (#415) from duke into dev
Reviewed-on: https://git.hush.is/hush/hush3/pulls/415
2024-08-11 19:01:17 +02:00
Duke
1e892f23e6 Remove dead nVersion code
This is very old code from the early days of Bitcoin, our mainnets have
never used peer protocol version.

Originally 150ab1d34c
2024-08-07 07:18:08 -07:00
Duke
7f27489224 Speed up compile by disabling libevent sample code, originally f38c051048 2024-08-07 07:11:13 -07:00
Duke
379e419aad Convenience script for doing a debug build while autodecting correct OS build script 2024-06-12 13:12:20 -04:00
Duke
8d2380a31d Record value of DEBUG_LOCKORDER in debug.log 2024-06-09 12:10:59 -04:00
Duke
4f928513c1 Revert "Fix bug when using build-mac.sh and remove cryptoconditions from mac+win build scripts"
This reverts commit 46c738500fd8bf596eb4b7a068384b3c74a7d8b3.
2024-06-09 11:25:37 -04:00
Duke
8a997b04f3 Check if the node should stop when processing thread interrupts and exceptions, in hopes of stopping before a deadlock occurs 2024-06-09 11:22:21 -04:00
Duke
cc4b0750d8 Merge branch 'dev' into duke 2024-06-08 07:33:58 -07:00
Duke
46c738500f Fix bug when using build-mac.sh and remove cryptoconditions from mac+win build scripts 2024-06-08 07:16:37 -07:00
duke
1526a754d2 Merge pull request 'Prevent communication between HUSH3 nodes and DRAGONX nodes in both directions' (#410) from hushutils into dev
Reviewed-on: https://git.hush.is/hush/hush3/pulls/410
2024-05-22 13:11:15 +02:00
onryo
07054fc346 Prevent communication between HUSH3 nodes and DRAGONX nodes in both directions 2024-05-16 19:07:29 +02:00
jahway603
142c9e140e Merge pull request 'Updated urgency tags in contrib/debian/changelog' (#408) from jahway603 into dev
Reviewed-on: https://git.hush.is/hush/hush3/pulls/408
2024-05-09 16:44:44 +02:00
jahway603
006804d6ca Updated urgency tags in contrib/debian/changelog 2024-05-09 10:43:34 -04:00
jahway603
060acceea8 Merge pull request 'Updated Debian package changelog to resolve Issue #405' (#406) from jahway603 into dev
Reviewed-on: https://git.hush.is/hush/hush3/pulls/406
2024-05-09 16:16:47 +02:00
jahway603
41e7d602c8 Added changelog to Debian package building script 2024-05-09 10:12:44 -04:00
jahway603
535d78595e Updated Debian package changelog to resolve Issue #405 2024-05-09 09:43:56 -04:00
Duke
5273f4be9e Give Hush mainnet a dedicated minimum protocol version #345
Hush and DragonX do not have the same requirements for which nodes they
should talk to because they don't necessarily have consensus changes at
the same time. For instance, 3.10.0 was a consensus change for Hush but
not DragonX. This commit changes things so that Hush nodes will no
longer talk to old nodes that are not consensus compatible but leaves
things the same for DragonX mainnet, which has never had a consensus
change.
2024-05-06 08:46:21 -07:00
Duke
ba86196409 This document is bitrotten and not useful 2024-05-06 08:33:20 -07:00
Duke
e42b534036 Keybase is no longer used 2024-05-06 08:29:24 -07:00
Duke
18e3364bc2 Make docs for addnode/disconnectnode correct for HACs #376 2024-04-19 07:32:23 -04:00
Duke
0d0a7e9587 Fix 'writing 1 byte into region of size 0' 2024-04-18 06:41:25 -07:00
jahway603
b9d4dbbbd6 Merge pull request 'Update readme' (#402) from onryo/hush3:dev into dev
Reviewed-on: https://git.hush.is/hush/hush3/pulls/402
2024-04-03 20:46:37 +00:00
onryo
f8481013a7 Update README 2024-04-03 19:01:21 +00:00
onryo
d3b6af2c0b Add image 2024-04-03 18:46:12 +00:00
onryo
5e52b706e2 Update README 2024-04-03 18:45:31 +00:00
jahway603
e91cbff565 Merge pull request 'Move README to dev from master' (#401) from master into dev
Reviewed-on: https://git.hush.is/hush/hush3/pulls/401
2024-04-03 13:06:44 +00:00
jahway603
5fe2904bb1 Merge branch 'dev' into master 2024-04-03 13:02:27 +00:00
jahway603
06e46f7fcd Fixes to README.md
- Updated table on top of README
- Changed version specific instructions
- Removed SDX link, as that is not Hush
- Added back the Raspberry Pi ARM CPU info back under "Install on ARM Architecture"
- Changed Supportd and Socials section to use native Markdown instead of HTML
- Changed numbered lists to native Markdown format
2024-04-01 14:23:18 +00:00
duke
814fad16e9 Merge pull request 'Move files making the root directory clean' (#400) from mvstuff into dev
Reviewed-on: https://git.hush.is/hush/hush3/pulls/400
2024-04-01 05:44:46 +00:00
onryo
b446ec384c make sure genbuild.sh builds 2024-03-31 23:54:32 +02:00
onryo
72c86d8f69 move stuff 2024-03-31 23:17:16 +02:00
onryo
63901954be move stuff 2024-03-31 23:16:47 +02:00
Duke
9a23cba099 Merge branch 'duke' into dev 2024-03-22 05:49:33 -07:00
Duke
4928ed97c3 Merge branch 'dev' into duke 2024-03-22 05:16:34 -07:00
Duke
f47a7a9d7f We no longer need this junk 2024-03-22 05:15:58 -07:00
Duke
89cc8a9ee3 Move toolchain-info.sh to util/ 2024-03-22 05:11:03 -07:00
Duke
981b275757 Delete unnecessary stuff 2024-03-22 05:10:19 -07:00
Duke
f970082504 Remove migratecoin.sh 2024-03-22 05:07:00 -07:00
Duke
753ad7b95b Remove .gitmodules 2024-03-22 05:05:50 -07:00
Duke
975f22bfa0 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.
2024-03-21 11:30:54 -04:00
Duke
558f662a33 Do not apply sapling network rules to block height 0 or 1 in ScanForWalletTransactions 2024-03-21 11:17:58 -04:00
Duke
f5f851158a Merge branch 'dev' into duke 2024-03-21 11:07:56 -04:00
Duke
3354d45fd3 Make getchaintxstats less noisy in debug log 2024-03-20 16:19:54 -04:00
Duke
8ff5e4aa5e Make getchaintxstats less noisy in debug log 2024-03-20 14:09:02 -04:00
onryo
25009928f8 Update README 2024-03-18 20:08:50 +00:00
onryo
754cbcb02d Update README 2024-03-18 20:07:21 +00:00
onryo
5b9e971780 Update README 2024-03-18 19:32:08 +00:00
onryo
c8cd6eaa03 Update README 2024-03-18 19:23:54 +00:00
onryo
424ca42015 Update README 2024-03-18 19:20:02 +00:00
onryo
804e88dca5 Update image 2024-03-18 18:03:34 +00:00
onryo
e860ad6efb Image to README 2024-03-18 18:03:06 +00:00
onryo
2a9f7bd483 Merge pull request 'doc: update Matrix chatroom link in README.md' (#398) from jahway603 into master
Reviewed-on: https://git.hush.is/hush/hush3/pulls/398
2024-03-17 05:57:18 +00:00
jahway603
394c54c4da doc: update Matrix chatroom link in README.md 2024-03-17 00:07:39 -04:00
onryo
c5c0ce45da We call it hush arrakis chains 2024-03-15 19:48:12 +00:00
Duke
9842687be2 It is called hush-arrakis-chain now 2024-03-15 15:17:04 -04:00
Duke
25c27d2ef5 It is called hush-arrakis-chain now 2024-03-15 15:16:04 -04:00
Duke
d1991e6454 It is called hush-arrakis-chain now 2024-03-15 15:14:26 -04:00
Duke
49f8cf7ca7 Remove some unneeded cc code 2024-03-15 15:08:10 -04:00
Duke
65c4c5c8de They are called Hush Arrakis Chains (HACs) now 2024-03-15 14:06:57 -04:00
Duke
bbfa41c77d They are called Hush Arrakis Chains (HACs) now 2024-03-15 13:34:07 -04:00
Duke
a7dd567031 They are called Hush Arrakis Chains (HACs) now 2024-03-15 13:33:18 -04:00
Duke
64f59552b3 They are called Hush Arrakis Chains (HACs) now 2024-03-15 13:32:46 -04:00
Duke
7db5749730 Merge branch 'dev' into duke 2024-03-15 13:29:14 -04:00
onryo
fc95d692e2 Update cross-compile on Linux INSTALL.md for Windows 2024-03-06 09:09:00 +00:00
onryo
63fc690ca3 Update cross-compile on Linux INSTALL.md for Windows 2024-03-05 17:51:45 +00:00
onryo
3841246157 Merge pull request 'Release 3.10.2' (#395) from dev into master
Reviewed-on: https://git.hush.is/hush/hush3/pulls/395
2024-03-05 16:59:22 +00:00
onryo
9b1c0ac1b5 Merge pull request 'minor QA changes' (#396) from jahway603 into dev
Reviewed-on: https://git.hush.is/hush/hush3/pulls/396
2024-03-04 14:11:33 +00:00
jahway603
4a3c335050 minor QA changes 2024-03-04 08:57:14 -05:00
onryo
beee6c1698 Update HUSH/DRGX checkpoints 2024-03-04 10:32:51 +01:00
Duke
81bd6e2f4e Merge branch 'dev' into duke 2024-03-03 09:58:12 -05:00
Duke
71ff482d4f Update relnotes 2024-03-03 09:27:33 -05:00
Duke
0ad1dc5557 Update relnotes 2024-03-03 09:26:18 -05:00
jahway603
58f1365487 Merge pull request 'Update relnotes with PR #393' (#394) from jahway603 into dev
Reviewed-on: https://git.hush.is/hush/hush3/pulls/394
2024-03-03 02:29:17 +00:00
jahway603
769dbae97e Update relnotes 2024-03-02 21:21:33 -05:00
jahway603
318d8adc86 Merge pull request 'Add Arch install process' (#393) from jahway603 into dev
Reviewed-on: https://git.hush.is/hush/hush3/pulls/393
2024-03-03 02:19:38 +00:00
jahway603
84ebb85a90 Add Arch install process 2024-03-02 21:18:05 -05:00
Duke
ec81594b42 Update relnotes 2024-03-02 09:43:16 -05:00
Duke
3241992e50 make seeds is an alias for this other much longer annoying command 2024-03-02 09:38:46 -05:00
jahway603
df866809dd Merge pull request 'make i2p seed' (#392) from jahway603 into dev
Reviewed-on: https://git.hush.is/hush/hush3/pulls/392
2024-03-01 21:56:41 +00:00
jahway603
8c8b6e88f0 make i2p seed 2024-03-01 16:52:25 -05:00
jahway603
641a0ff354 Merge pull request 'updated i2p seed node to correct i2p address' (#391) from jahway603 into dev
Reviewed-on: https://git.hush.is/hush/hush3/pulls/391
2024-03-01 15:32:19 +00:00
jahway603
c59d38caa8 updated i2p seed node to correct i2p address 2024-03-01 10:28:59 -05:00
onryo
54af342484 make seeds 2024-03-01 10:16:38 +01:00
fekt
5e5a15018d Use 4.8.1 for wind0ze 2024-03-01 02:54:03 +00:00
fekt
f5cb0f2e9d Revert "Fix for cross-compiling windows"
This reverts commit c773cf52994cc46bd373ad303ff069fbcc46f723.
2024-02-28 22:26:34 -05:00
fekt
c773cf5299 Fix for cross-compiling windows 2024-02-28 20:36:02 -05:00
onryo
c561d7129a make manpages 2024-02-28 19:58:55 +01:00
Duke
7b3c26ddfe Remove CC dingleberries 2024-02-28 12:43:43 -05:00
onryo
138cd7ab62 Update HUSH/DRGX checkpoints 2024-02-28 18:41:50 +01:00
Duke
7d0f961e0c Merge branch 'dev' into duke 2024-02-28 11:50:31 -05:00
Duke
a26fde4f92 Update relnotes 2024-02-28 11:50:16 -05:00
Duke
dfa94d80d8 Fix copyright years which were incorrectly changed 2024-02-28 11:39:22 -05:00
Duke
774f1a9a78 Fix copyright years which were incorrectly changed 2024-02-28 11:38:07 -05:00
Duke
92219bc1eb Update relnotes 2024-02-28 11:37:23 -05:00
Duke
251407af3f Update relnotes 2024-02-28 09:08:52 -05:00
Duke
3da93ee53b Update relnotes 2024-02-28 08:48:24 -05:00
onryo
58b65f9670 Update copyrights 2024-02-27 23:59:59 +01:00
onryo
91dadda360 Update HUSH/DRGX checkpoints, add release name 2024-02-27 23:49:06 +01:00
onryo
c26016eb98 Add release notes for 3.10.2 2024-02-27 20:48:26 +00:00
Duke
f64c10baa9 Replace hushd with 'Full node' in a few error messages 2024-02-24 06:09:50 -05:00
Duke
f71f8124c3 Give a better error message which does not mention a specific coin name, so as to not confuse DragonX/etc users 2024-02-21 10:54:51 -05:00
Duke
76e81281e1 Bump version to 3.10.2 2024-02-21 10:37:27 -05:00
Duke
e9f77c835c Merge branch 'wolfssl' into dev 2024-02-20 09:24:54 -05:00
Duke
ac8f3021db Merge branch 'dev' into wolfssl 2024-02-19 10:32:29 -05:00
Duke
4c392cca07 Merge branch 'dev' into duke 2024-02-19 10:32:10 -05:00
Duke
d769ee2b1c Fix bug where SMART_CHAIN_SYMBOL was being used before being set, which caused custom addnodes to not be used and made the full node unable to sync 2024-02-19 10:31:45 -05:00
Duke
16dd3aef74 Improve hush_scanner and seed node contrib file 2024-02-18 22:26:32 -05:00
Duke
7fc0b4ffc2 Remove unused Makefile #291 2024-02-18 09:38:28 -05:00
Duke
171102cbbd Remove unused Makefile #291 2024-02-18 09:37:06 -05:00
Duke
0679468f60 Add script for scanning dragonx nodes 2024-02-16 08:08:20 -05:00
Duke
dec5d7b0f7 Merge branch 'dev' of https://git.hush.is/hush/hush3 into dev 2024-02-15 14:18:57 -05:00
Duke
a55cc301b2 Text file of hush seed nodes to use with contrib/hush_scanner 2024-02-15 14:18:44 -05:00
Duke
bd0200abf0 Merge branch 'dev' into wolfssl 2024-02-15 11:03:44 -05:00
Duke
eb316f80d8 Merge branch 'dev' into duke 2024-02-15 11:03:18 -05:00
Duke
a581f8fc8e Fix compile error and remove some cryptocondition dingleberries 2024-02-15 11:03:05 -05:00
Duke
b9d3c77a4c Merge branch 'duke' into dev 2024-02-15 10:41:50 -05:00
Duke
07b041fd94 Do not apply overwinter/sapling consensus rules to block 0 2024-02-15 10:40:22 -05:00
Duke
8f2350fd84 Merge branch 'dev' into duke 2024-02-15 10:11:52 -05:00
Duke
b14070d15b Overwinter+sapling consensus rules do not apply to height=0 2024-02-15 10:06:37 -05:00
Duke
f03b01d49e Update to wolfssl 5.2.0 2024-02-12 13:24:34 -05:00
Duke
2b7b183c2a Update to wolfssl 5.0.0 2024-02-12 13:10:20 -05:00
Duke
809c0a4b38 Update to wolfssl 4.8.0 and do not verify cert 2024-02-12 12:52:01 -05:00
Duke Leto
40542bf687 Merge branch 'dev' into wolfssl 2024-02-12 10:18:25 -05:00
Duke
c94906e011 Do not spam debug.log with 'Received addr' unless -debug 2024-02-12 09:57:52 -05:00
Duke
acee1c8cf5 Do not spam debug.log with 'Received addr' unless -debug 2024-02-12 09:57:09 -05:00
Duke
6651ff7a2d Merge branch 'duke' into dev 2024-02-12 07:05:41 -05:00
duke
d2b66fb2f2 Merge pull request 'Add Fedora install process' (#384) from onryo/hush3:dev into dev
Reviewed-on: https://git.hush.is/hush/hush3/pulls/384
2024-02-11 16:47:01 +00:00
onryo
57cb8fc536 Add Fedora install process 2024-02-11 13:26:22 +00:00
Duke
90d47ecce4 Potentially fix #382 by not checking the genesis block against sapling consensus rules 2024-02-11 06:29:29 -05:00
Duke
195571b15f We aint got no stinking joinsplits 2024-02-11 06:02:22 -05:00
Duke
fbc26f0725 Clean up importcoin.h 2024-02-11 06:00:02 -05:00
Duke
ca169d9300 Delete more CCs #381 2024-02-11 00:50:36 -05:00
Duke
5bdb204001 Delete more CCs #381 2024-02-11 00:29:13 -05:00
Duke
8b82bc4d15 Delete more CCs #381 2024-02-11 00:21:29 -05:00
Duke
27034531c9 Delete more CCs #381 2024-02-11 00:12:59 -05:00
Duke
8a9677b337 Delete more CCs #381 2024-02-11 00:09:03 -05:00
Duke
9e26dac42a Remove libcryptoconditions dependency #381 2024-02-11 00:04:55 -05:00
Duke
0cbce3b0c8 Delete more CCs #381 2024-02-10 23:16:34 -05:00
Duke
7791d50230 Delete more CCs #381 2024-02-10 23:06:56 -05:00
Duke
b41785a684 Delete more CCs #381 2024-02-10 22:56:34 -05:00
Duke
958bc486d4 Delete more CCs #381 2024-02-10 22:37:22 -05:00
Duke
c6aa5e939d Delete more CCs #381 2024-02-10 21:54:36 -05:00
Duke
5fa46e1d8d Delete more CCs #381 2024-02-10 21:46:36 -05:00
Duke
d81e8c0a3f Delete more CCs #381 2024-02-10 18:56:37 -05:00
Duke
7bd7a716df Delete more CCs #381 2024-02-10 12:59:10 -05:00
Duke
5b9906539d Delete more CCs #381 2024-02-10 12:44:47 -05:00
Duke
cb0a980083 Delete more CCs #381 2024-02-10 12:36:28 -05:00
Duke
ff1d30cbad Delete more CCs #381 2024-02-10 12:16:47 -05:00
Duke
43cdfb08a2 Delete more CCs #381 2024-02-10 12:07:52 -05:00
Duke
1c04972c81 Delete more CCs #381 2024-01-31 20:46:37 -05:00
Duke
8811ba4502 Delete more CCs #381 2024-01-31 20:27:46 -05:00
Duke
a97dcf6022 Delete more CCs #381 2024-01-31 13:50:03 -05:00
Duke
5a260e8893 Delete more CCs #381 2024-01-31 13:28:12 -05:00
Duke
0ad0fac030 Delete more CCs #381 2024-01-30 11:28:13 -05:00
Duke
9e0ac062fa Delete a lot of CC stuff #381 2024-01-30 11:23:35 -05:00
Duke
bb8a3c57a4 Delete auction/faucet/heir CC rpcs #381 2024-01-30 10:48:21 -05:00
Duke
86104c4ef7 Remove oracles RPCs 2024-01-29 12:04:59 -05:00
Duke
5e69ed0804 Fix compile and const some stuff 2024-01-28 09:52:24 -05:00
Duke
874c3009cf Only Hush + DragonX connect to these nodes by default #379 2024-01-28 06:30:52 -08:00
Duke Leto
8e2715a734 wolfssl 4.7.0 2024-01-27 11:44:07 -05:00
Duke
2059dbd79f Merge branch 'dev' into wolfssl 2024-01-27 11:43:13 -05:00
Duke
c54b3990d9 Compiling Hush basics 2024-01-25 09:13:56 -08:00
Duke
1612ca4da7 Add some useful tips about gdb and testcoins to dev notes 2024-01-25 08:56:47 -08:00
Duke
bc0af82ce6 SMART_CHAIN_SYMBOL is always defined, no need to check which slows this hot path down 2024-01-24 11:25:48 -05:00
Duke
e49836b45e Enforce sapling activation at height=1
We used to have the -ac_sapling option which defaulted to one, now we
enforce that it must always be one, it cannot be changed and is no
longer a CLI option.
2024-01-21 16:59:09 -05:00
Duke
27db254d68 Sapling and Overwinter network upgrades are always active
These NU's are always active for Hush Arrakis Chains so this code only serves
to slow down all operations by constantly being checked. So we disable them
which will speed up syncing, mining and creating transactions.
2024-01-21 16:34:53 -05:00
Duke
b0b9565d6a Sapling and Overwinter network upgrades are always active 2024-01-21 15:32:23 -05:00
Duke
3a3c67e0fc Delete many things we do not want or need 2024-01-13 00:06:09 -05:00
Duke
de7a5fb6d7 remove cc payments and rewards 2024-01-12 20:47:46 -05:00
Duke
d0fb9a0bc1 remove rogue 2024-01-12 20:05:15 -05:00
Duke
73d92a821e remove sudoku 2024-01-12 12:54:56 -05:00
Duke
657bb1e25e remove dice, channels, lotto 2024-01-11 22:30:50 -05:00
Duke
2a713aeba2 remove gateways 2024-01-11 21:39:08 -05:00
Duke
04b122a067 Merge branch 'duke' into dev 2024-01-11 07:36:29 -08:00
Duke
b70370123e Fix boost download link 2024-01-07 23:34:36 -05:00
Duke
323d2134a1 Boost download has been broken for over a week, so we will host our own 2024-01-07 23:34:25 -05:00
Duke
31fce487d9 Fix boost download link 2024-01-07 23:32:56 -05:00
Duke
283066fda4 Merge branch 'duke' of https://git.hush.is/hush/hush3 into duke 2024-01-07 23:25:42 -05:00
Duke
c9f7640699 Boost download has been broken for over a week, so we will host our own 2024-01-07 23:25:35 -05:00
Duke
a23ab58af6 Start removing unused gateway code 2024-01-07 13:20:17 -08:00
Duke
d5c5c6008c Remove unused code 2024-01-07 13:05:31 -08:00
Duke
c56a9e31a0 Merge branch 'duke' of https://git.hush.is/hush/hush3 into duke 2024-01-07 10:36:16 -08:00
Duke
7d73ebd7af Remove voutsum variable which is calculated but never used 2024-01-07 10:25:36 -08:00
Duke
196e00c786 Remove unused variables 2024-01-07 10:24:12 -08:00
Duke
68427d0979 Remove unused code 2024-01-07 11:15:08 -05:00
Duke
c1ab82a881 Remove unused variables and add a const 2024-01-06 23:57:39 -08:00
Duke
4054140b21 RandomX interval and block lag are consensus changes and will never change at run-time, so they can be static 2024-01-06 23:47:00 -08:00
Duke
447f1f50f3 SMART_CHAIN_SYMBOL is always nonzero 2024-01-06 23:39:24 -08:00
Duke
b9937bc5d2 Release randomx cache in normal exit 2024-01-06 23:37:48 -08:00
Duke
765487bb14 Remove unused code 2024-01-06 23:30:19 -08:00
Duke
1b5422eb2d Dynamically determine thread count for dataset init 2024-01-07 02:19:03 -05:00
Duke
56ef56b136 randomx_get_flags() automatically sets all flags except RANDOMX_FLAG_FULL_MEM, RANDOMX_FLAG_LARGE_PAGES and RANDOMX_FLAG_SECURE 2024-01-06 22:30:41 -08:00
Duke Leto
0e0b1cca97 Attempt to try different randomx flags 2024-01-06 21:33:23 -08:00
Duke Leto
21530ba159 Remove unused code 2024-01-06 21:24:57 -08:00
Duke
38dc994731 Remove unused code 2024-01-06 21:49:17 -05:00
Duke
08e9c5d743 Merge branch 'dev' into duke 2024-01-06 21:47:53 -05:00
Duke
4ed576a7e2 Explain the importance of p2p encryption 2024-01-05 13:06:21 -08:00
Duke
a358acab0b More info about ciphersuites 2024-01-05 13:02:36 -08:00
Duke
ccc86839b9 More details about p2p encryption 2024-01-05 12:48:35 -08:00
Duke
44b3d2b500 Merge branch 'dev' 2024-01-02 09:16:40 -05:00
Duke
172e6f7977 Update relnotes for 3.10.1 2024-01-02 06:14:40 -08:00
Duke
ee17cbe635 Update manpages 2024-01-02 09:07:37 -05:00
Duke
9354506770 Start 3.10.1 relnotes 2024-01-01 20:25:11 -08:00
Duke
d35ac5eac7 Update dragonx checkpoints 2023-12-31 09:32:16 -05:00
Duke
05ee318913 Update hush checkpoints 2023-12-31 08:58:00 -05:00
Duke
6635ab9e34 Bump version and copyright year 2023-12-31 06:55:58 -05:00
Duke
ae08c6ef56 Remove unused code 2023-12-27 21:06:33 -05:00
Duke
e5dc287d2f Cleanup 2023-12-27 20:35:11 -05:00
Duke
90133dbc0e Also log flush mode in FlushStateToDisk() 2023-12-27 17:56:44 -05:00
Duke
1db3fb0429 Fix warning 2023-12-27 17:06:47 -05:00
Duke
20fdc0e4fe Get rid of deprecation entirely which allows current code to run past block height 5555555 2023-12-27 12:57:35 -05:00
Duke
19aa83ca80 You can now estimate future blocktimes of Arrakis Chains with: ./contrib/block_time.pl 5555555 DRAGONX 2023-12-27 12:53:07 -05:00
Duke
2a2391f0f9 Log when trimming block solutions 2023-12-27 11:43:53 -05:00
Duke
497ace0922 Add debug output to stderr when decode_hex() is called on invalid hex input 2023-12-27 08:38:24 -05:00
Duke
943ffbc1bf Remove unused variables in BitcoinMiner/RandomXMiner which saves about 3.5KB of memory per mining thread 2023-12-27 08:37:20 -05:00
Duke
d8840beb3b Remove unused code 2023-12-27 08:36:24 -05:00
Duke
0f5e291f9f Remove unused pubkeys variable 2023-12-27 08:35:50 -05:00
Duke
77ab75c01d Document hush_block2pubkey33() 2023-12-27 08:35:22 -05:00
duke
4b7f94effa Merge pull request 'Create a local variable instead of modifying the global ASSETCHAINS_SCRIPTPUB' (#371) from syncbug into dev
Reviewed-on: https://git.hush.is/hush/hush3/pulls/371
2023-12-27 10:32:30 +00:00
Duke
43aa4a7d90 Create a local variable instead of modifying the global ASSETCHAINS_SCRIPTPUB 2023-12-25 14:05:05 -05:00
Duke
c33bd61480 Fix typo in default clientname 2023-12-06 11:19:40 -05:00
fekt
032f9b62da MXE cross-compile fix for Windows builds
CMAKE_SIZEOF_VOID_P EQUAL 8 was added in newer versions of RandomX and breaks cross-compiling with MXE for Windows builds even though they are 64-bit.
3f69ad7b79
2023-12-04 05:10:48 +00:00
Duke
901152cc50 Also log incoming script when we see an incorrect coinbase pubkey 2023-12-03 23:31:16 -05:00
Duke
04a705444b Improve rpc docs for getblocktemplate 2023-12-03 19:01:45 -08:00
Duke
429e25a3de Log ASSETCHAINS_SCRIPTPUB to stderr when we see an incorrect coinbase pubkey 2023-12-03 18:51:55 -08:00
Duke
540bc9b287 Document git tag command in release process, fixes #364 2023-12-02 10:27:16 -05:00
Duke
b0027d8c64 Merge branch 'dev' of https://git.hush.is/hush/hush3 into dev 2023-11-30 09:53:33 -05:00
fekt
bde07c25fe Mac fix 2023-11-30 05:30:50 +00:00
fekt
19e18cf37a Temp Mac workaround 2023-11-30 05:01:53 +00:00
Duke
36364bad87 Merge branch 'master' into dev 2023-11-28 10:51:32 -05:00
Duke
f85976f620 Merge branch 'dev' 2023-11-28 10:47:59 -05:00
Duke
09bdb25959 Update man pages 2023-11-27 20:26:59 -05:00
Duke
382861de2b Fixes #362
Array index 2 does not exist, which caused the foundersrewardaddress
key of getblocktemplate to be incorrect. It would either show the next
address in the list or be empty if it caused a read past the end of the
2D DEVTAX_DATA array. This is what happens in gcc 9.4.0 but since this
is technically Undefined Behavior according to the C Standard it could
cause a crash or even make demons fly out of your nose.

See http://catb.org/jargon/html/N/nasal-demons.html for details.
2023-11-27 18:45:49 -05:00
Duke
4facbadc6a Update relnotes 2023-11-27 08:32:09 -05:00
Duke
881af41b4a Update relnotes for 3.10.0 2023-11-24 08:11:54 -05:00
duke
4a20c3d8ad Merge pull request 'Sync duke branch to dev' (#361) from duke into dev
Reviewed-on: https://git.hush.is/hush/hush3/pulls/361
2023-11-24 13:05:01 +00:00
Duke
51c5d03215 Fix notary code 2023-11-24 07:18:54 -05:00
jahway603
2bb9f87624 Merge pull request 'doc: I2P documentation updates' (#359) from jahway603 into dev
Reviewed-on: https://git.hush.is/hush/hush3/pulls/359
2023-11-22 22:18:34 +00:00
jahway603
002df24056 doc: I2P documentation updates 2023-11-22 17:17:11 -05:00
Duke
6db872acd0 Merge branch 'dev' into duke 2023-11-22 14:05:31 -08:00
jahway603
bd7f04ee57 Merge pull request 'Ported Bitcoin PR 7229 to resolve Issue #16' (#358) from jahway603 into dev
Reviewed-on: https://git.hush.is/hush/hush3/pulls/358
2023-11-22 21:57:46 +00:00
jahway603
dcbdafdba5 Merge branch 'dev' into jahway603 2023-11-22 21:56:44 +00:00
jahway603
f5f52a7e81 ported Bitcoin PR 7229 to resolve Issue #16 2023-11-22 16:55:19 -05:00
Duke
2b2529259d Update dragonx checkpoints up to 896000 2023-11-22 13:45:00 -08:00
Duke
87642c4895 Fix bug in checkpoints.pl using numeric instead of string equality 2023-11-22 13:30:43 -08:00
duke
5363c7cfb7 Merge pull request 'ported cjdns documentation to resolve issue #355' (#357) from jahway603 into dev
Reviewed-on: https://git.hush.is/hush/hush3/pulls/357
2023-11-22 17:33:28 +00:00
Duke
e7f79e6509 Update hush checkpoints up to 1578000 2023-11-22 12:28:04 -05:00
jahway603
4887fa6447 ported cjdns documentation to resolve issue #355 2023-11-22 12:13:09 -05:00
jahway603
4bd4664917 Merge remote-tracking branch 'origin/dev' into jahway603 2023-11-22 12:06:01 -05:00
jahway603
d779578ab9 added stratum server options 2023-11-22 11:33:17 -05:00
duke
6d8f261d7a Merge pull request 'Decentralized Devtax' (#305) from danger into duke
Reviewed-on: https://git.hush.is/hush/hush3/pulls/305
2023-11-22 15:09:44 +00:00
Duke
b12e6c2d78 Merge branch 'dev' into duke 2023-11-22 09:58:38 -05:00
Duke
620ca45efc Cleanup notary code 2023-11-22 09:48:09 -05:00
Duke
d0c3d7587e Add memoStr to RPC help of z_listunspent and z_listreceivedbyaddress 2023-11-22 09:43:47 -05:00
Duke
45a5d25230 Update next consensus hardfork to be block 1605555 on Dec 16th 2023 2023-11-22 08:00:26 -05:00
Duke
5f5983ad86 Update production devtax data 2023-11-22 07:51:00 -05:00
jahway603
ad653d6271 added stratum server options 2023-11-21 22:24:00 -05:00
Duke
37cff3924d Fix #346 2023-11-20 17:05:42 -08:00
Duke
b4c60c5f4e Update relnotes 2023-11-20 10:21:17 -05:00
Duke
cb62670581 Add memoStr to z_listunspent output 2023-11-20 09:40:15 -05:00
Duke
cb60ecaef9 Update to take an optional file of addresses 2023-11-19 08:32:23 -05:00
Duke
11593da7f2 Merge branch 'dev' into danger 2023-11-18 08:12:29 -05:00
Duke
e695340133 Update RPC help for z_listreceivedaddress 2023-11-15 07:54:30 -05:00
Duke
f442823963 Fix unoptimized libraries in depends
This was a bug we inherited from BTC which causes some dependencies to
be built without optimization essentially replacing -O2 -pipe with
-O0 because cxxflags is assigned to instead of appended to.

We no longer have zeromq so for us this fixes the fact that bdb is being
compiled without optimization.

https://github.com/bitcoin/bitcoin/pull/22840
2023-11-13 19:44:28 -08:00
Duke
9a8d9f4cba Merge branch 'dev' into danger 2023-11-13 10:26:19 -05:00
Duke
94a48329ad Return help output if no address is given to z_listreceivedaddress 2023-11-13 10:22:04 -05:00
Duke
06876b1cc9 Bump version to 3.10.0 2023-11-13 08:40:04 -05:00
Duke
4570277b52 Bump protocol version 2023-11-12 14:30:52 -05:00
duke
2d638e5fcc Update 'doc/relnotes/README.md' 2023-11-12 05:45:21 +00:00
duke
51aa8e1afd Update 'doc/relnotes/README.md' 2023-11-12 05:29:55 +00:00
duke
034002f2e9 Update 'doc/relnotes/README.md' 2023-11-12 05:23:34 +00:00
duke
0ed63ecdad Update 'doc/release-process.md' 2023-11-12 04:27:28 +00:00
Duke
1f5fb24985 Revert to our custom RandomX config options 2023-11-07 09:32:45 -05:00
Duke
6029b3d571 Update to RandomX v1.2.1
Commit 102f8acf90a7649ada410de5499a7ec62e49e1da
2023-11-07 09:29:03 -05:00
Duke
6f78cad0be Merge branch 'duke' into dev 2023-11-07 07:51:14 -05:00
Duke
0936d4c2c2 Add option to disable automatic resending of txs
This option can disable automatic resending of txs. It defaults to the
normal behavior of resending txs automatically and resending can be disabled
with -resendtx=0 .

This is not intended for normal usage and is undocumented for now. It is
useful for devs who are debugging internals and also when rescanning large
wallets. We seem to have either some bugs and/or performance problems when
rescanning wallets with many txs.
2023-11-06 11:53:59 -05:00
Duke
a554377225 Clean up 2023-10-31 10:30:18 -04:00
Duke
7eb9d75b94 Support * or ANY_ZADDR in z_mergetoaddress 2023-10-30 09:31:48 -04:00
Duke
f0395196ec Do not resend wallet txs during IBD, rescan or loading blocks 2023-10-29 21:45:30 -04:00
Duke
b73297f1f5 More debugging when resending txs 2023-10-25 13:17:10 -04:00
Duke
f48181a120 Add help for -consolidationinterval which was missing 2023-10-25 13:16:47 -04:00
Duke
d922526642 Merge remote-tracking branch 'origin/dev' into danger 2023-10-25 12:44:18 -04:00
Duke
ac315bcb0d Merge remote-tracking branch 'origin/dev' into duke 2023-10-25 12:44:00 -04:00
duke
95b4371aa4 Merge pull request 'Reduce memory usage' (#332) from reduce_memory into dev
Reviewed-on: https://git.hush.is/hush/hush3/pulls/332
2023-10-25 15:11:51 +00:00
Duke
d99ab44bfb Fix implementation of GetBlockHash in CBlockIndex and CDiskBlockIndex 2023-10-23 22:41:29 -04:00
Duke
4642a35f06 Stop building witnesses if abortrescan is called #331 2023-10-23 10:47:12 -04:00
Duke
ae0ff73548 Stop building witnesses if shutdown requested, fixes #330 2023-10-23 09:49:50 -04:00
Duke
41d6d037d8 Log number of SpendDescriptions and note value if an invalid sapling spend happens 2023-10-23 09:43:40 -04:00
Duke
a1cf2ef976 Log txid being relayed to stdout 2023-10-23 09:43:01 -04:00
Duke
1dc4920186 Merge branch 'dev' of https://git.hush.is/hush/hush3 into dev 2023-10-17 14:18:20 -04:00
Duke
e03582e856 Fix shell quoting of dragonx-cli 2023-10-17 14:18:14 -04:00
duke
30a436dcd1 Merge pull request 'Upgrade curl to 8.4.0' (#328) from jahway603 into dev
Reviewed-on: https://git.hush.is/hush/hush3/pulls/328
2023-10-17 12:18:34 +00:00
jahway603
be92d4ce42 Merge branch 'dev' into jahway603 2023-10-16 21:17:00 +00:00
Duke
4256e7d835 Suppress 'Ignoring nbits' debug 2023-10-16 10:36:57 -04:00
Duke
31a6b72caf Merge branch 'dev' into reduce_memory 2023-10-16 06:04:56 -04:00
jahway603
b92cc1efbb Upgraded curl to 8.4.0 to resolve Issue #325 2023-10-14 22:47:27 -04:00
jahway603
12b87365bf Merge branch 'dev' into jahway603 2023-10-14 22:19:07 -04:00
Duke
5cf38dd5db Merge branch 'dev' into danger 2023-10-13 09:27:38 -04:00
duke
fb5563d06a Merge pull request 'Reject ztxs with duplicate zkproofs' (#327) from duplicate_proofs into dev
Reviewed-on: https://git.hush.is/hush/hush3/pulls/327
2023-10-13 11:58:00 +00:00
Duke
14d3ae1785 Reject ztxs with duplicate zkproofs
This is a greatly simplified and slightly tweaked version of
af2e3713e2

Their version will detect duplicate zkproofs across transactions while
this code will only detect duplicate zkproofs in a single ztx. If dupes
are found, the tx will be denied entry into the mempool.

This provides most of the benefit (increased CPU cost to attackers) with the
least code change and no annoyance to full node operators. Detecting
duplicate zkproofs across transactions requires a one-time reindex of
all of history, which means significant downtime for nodes.

Since Hush + HSCs have a much more strict policy on number of shielded
outputs and shielded inputs, only detecting duplicate zkproofs in
individual ztxs seems sufficient for now.

No correctly functioning node or wallet will ever create duplicate
zkproofs, so there is no worry of this accidentally affecting normal
users. Currently this is not a consensus rule but it could become one
in the future.
2023-10-13 04:31:41 -07:00
duke
70fa319fd9 Merge pull request 'Fix randomx mining memleak' (#326) from memleak into dev
Reviewed-on: https://git.hush.is/hush/hush3/pulls/326
2023-10-13 11:18:29 +00:00
Duke
80bd3f262c Verbosify randomx debug logging in case that helps debug mismatched height coinbase issue 2023-10-12 10:01:01 -04:00
Duke
fc6745129d Fix randomx memory leak but create some mining errors
This change lifts the declaration of the randomx VM out of an inner loop
into the main function body of RandomXMiner(), which allows us to destroy
it later on when catching exceptions. We cannot lift the allocation of it's
memory (randomx_create_vm) because it depends on things that change in every
iteration of the inner loop. Otherwise, the VM will only sometimes
be destroyed, which is what I think causes the memleak.

But this seems to create one invalid block when mining each block height :

STDOUT:

TestBlockValidity: failure C checkPOW=1
RandomXMiner: Invalid randomx block mined, try again 05f30f419133b2d862106b89c20059967639e4f2699dd5afc5d2b0832f1ac76a

debug.log:
2023-10-11 16:10:41 CreateNewBlock(): total size 1000 blocktime.1697040642 nBits.200e77d1
2023-10-11 16:10:41 Running HushRandomXMiner with 1 transactions in block (260 bytes)
2023-10-11 16:10:41 ERROR: ContextualCheckBlock: block height mismatch in coinbase

Mining does seem to continue normally when testing with -testnode=1
2023-10-11 12:07:40 -04:00
Duke
963ce1e444 Release randomx dataset+cache when mining is interrupted or errors 2023-10-10 22:04:15 -04:00
Duke
7db6745056 s/zouts/zins/ in debug log 2023-10-10 12:05:53 -04:00
Duke
b200dcb2c7 Update test_antispam 2023-10-10 12:03:41 -04:00
duke
38699a7d47 Merge pull request 'Antispam defenses' (#322) from antispam into dev
Reviewed-on: https://git.hush.is/hush/hush3/pulls/322
2023-10-10 15:55:11 +00:00
Duke
84a0c2c35e antispam test 2023-10-07 14:16:59 -04:00
Duke
b386cd1acf Scripts to test this branch 2023-10-07 14:15:12 -04:00
Duke
c8a88e1168 Check null randomx dataset before calling randomx_dataset_item_count 2023-10-07 14:07:34 -04:00
Duke
aa5cbee69c Remove dead code 2023-09-18 20:57:47 -04:00
Duke
d7cbdcab28 Always log when skipping a zaddr during z_importwallet 2023-09-18 20:44:16 -04:00
Duke
2308db22ee Antispam defenses
This code is inspired by
db292a49dd
with various improvements that will be documented below.

The largest improvement is that this code will defend against a spammer using shielded inputs (zins)
or shielded outputs (zouts) while the Pirate code only defends against zout spam.

We wrote a new RPC called z_getstats to study exactly what the distribution of shielded inputs (zins)
and shielded outputs (zouts) look like on HUSH mainnet. Sietch will never make a ztx that contains
more than 9 zouts and so transactions with 10 or more zouts are extremely rare. They correspond to custom
transactions created via code or CLI or mining pool payouts. We allow at most one of these per block. If
there are two, one will remain in the mempool and be mined in the subsequent block. Our code is more strict,
as Pirate will allow up to 6 of these transactions in a single block.

Transactions with many shielded inputs do occur normally when users spend many small shielded unspent outputs
(zutxos) in one transaction, but we determined that a cutoff of 50 zins is quite rare. Between blocks
14000000 and 15000000 only 27 ztxs had 50 or more zins, which is 0.03% . We allow at most one of these
per block and if there are more, they will wait to be mined in a subsequent block.

Also note that a transaction can match both criteria of having large zins and large zouts, so for instance,
if there is a transaction with 50 zins and 10 zouts, it counts towards both requirements and no other
transactions with >=50 zins or >=10 zouts will be mined in that block.

If >=200 transactions with either large zins or large zouts are broadcast to the network it will take at least
200 blocks for them to be mined and so via existing rules for ztx expiration they will expire and be removed
from the mempool, since by default all ztxs expire after 200 blocks. Since normal ztxs that match these
criteria are very rare, the only case when this might happen is during a spam attack and so the attackers
transactions expiring is another part of these defenses.

Other improvements are that we log txids of transactions with large zins or zouts and we do not support a
command line option to turn this protection off. This forces a potential attacker to compile their own custom
code if they want to subvert these protections on their own node and blocks they mine.

Similar to Pirate, these changes are not consensus changes but may be made consensus requirements
in the future.

These protections are not specific to HUSH and are enabled for all HSC's, including DragonX.
2023-09-18 13:30:40 -04:00
Duke
09555fbee2 Allow abortrescan during RPC warmup
If we don't, we can get the hilarious error message that the node is Rescanning...
when trying to run abortrescan when the node automatically does a rescan on boot.
2023-09-18 12:43:27 -04:00
duke
f2ae9a354a Merge pull request 'z_getstats RPC' (#321) from z_getstats into dev
Reviewed-on: https://git.hush.is/hush/hush3/pulls/321
2023-09-09 15:08:52 +00:00
Duke
7c45e66fbe Also return start and ending height in z_getstats json 2023-09-08 08:28:14 -04:00
Duke
4aca3493e3 Even more zstats
Example data for the entire history of the current HUSH mainnet :

  ./src/hush-cli z_getstats 1 1487622
{
  "total_ztxs": 414962,
  "total_zins": 798083,
  "total_zouts": 3312131,
  "total_ztxs_10_or_more_zins": 6789,
  "total_ztxs_25_or_more_zins": 1779,
  "total_ztxs_50_or_more_zins": 688,
  "total_ztxs_100_or_more_zins": 174,
  "total_ztxs_10_or_more_zouts": 2855,
  "total_ztxs_25_or_more_zouts": 394,
  "total_ztxs_50_or_more_zouts": 314,
  "total_ztxs_100_or_more_zouts": 208,
  "avg_zins": 1.923267672702561,
  "avg_zouts": 7.981769415030774,
  "largest_zins": 517,
  "largest_zins_txid": "69f126edd5a0189fbbe84b0824eb48e16eddf180e7d5d4f34c4296d0f868ac7f",
  "largest_zouts": 210,
  "largest_zouts_txid": "2a3155f73fab9191978e77e03be8ec7167372c4549113a6eb3f8a9d343f749ba"
}
2023-09-05 11:30:27 -04:00
Duke
ff7a597032 Lots of more data for z_getstats 2023-09-05 00:35:11 -04:00
Duke
7ea88bb303 Return total zins+zouts in json 2023-09-04 09:03:06 -04:00
Duke
8eaba566fd Force avg zins/zouts to be a double 2023-09-04 08:57:23 -04:00
Duke
0f4956dcd5 Initialize variables in z_getstats correctly 2023-09-04 08:50:05 -04:00
Duke
96ae2d61ca z_getstats RPC that calculates various stats about ztxs in a block range 2023-09-04 08:22:12 -04:00
Duke
1c45a71b05 Remove dead code 2023-09-03 08:52:28 -04:00
Duke
e2521ac2fa Remove unused sproutfunds argument 2023-09-03 08:48:06 -04:00
Duke
bd38a12512 Remove useless sprout key from coinsupply RPC 2023-09-03 08:40:06 -04:00
Duke
bacc08e817 Remove sprout data from valuePools
This codebase does not support sprout, the data will always be zero/empty
and is essentially useless cruft, so we delete it.
2023-09-03 08:37:19 -04:00
Duke
a90f03ce6d Fix build-debian-package.sh docs and document how to make an aarch64 deb 2023-08-16 10:37:23 -04:00
duke
c6859b676e Update 'doc/developer-notes.md' 2023-08-09 00:05:00 +00:00
Duke
4d3d880036 Add docs for adding a new PoW algo 2023-08-08 15:40:52 -04:00
fekt
e53220b5f1 Save checkpoints as individual .json files 2023-07-09 11:49:55 -04:00
fekt
803e1d0f21 Use older version of cURL for Windows 2023-07-05 13:29:36 -04:00
Duke
8969a9d8fe Put binaries into a properly named subdirectory, fixes #311 2023-07-04 11:14:56 -04:00
fekt
1535073393 Merge branch 'dev' 2023-07-02 11:29:37 -04:00
fekt
2ba2122b26 Update relnotes 2023-07-02 11:26:54 -04:00
Duke
7017d8e06c Add info about DRAGONX checkpoints to release process 2023-06-30 06:42:33 -04:00
Duke
d3cc17e9bd Update relnotes for 3.9.4 2023-06-30 06:37:37 -04:00
fekt
0ee828805e Update README 2023-06-29 23:39:33 -04:00
fekt
20ee425ece Updated checkpoints 2023-06-29 23:31:53 -04:00
fekt
e86d43a813 Merge branch 'dev' of https://git.hush.is/hush/hush3 into dev 2023-06-29 22:28:49 -04:00
fekt
9e524663e2 Update manpages 2023-06-29 22:28:39 -04:00
fekt
b7359ef70e Update chainparamsseeds.h 2023-06-29 21:16:46 -04:00
nullfekt
44595d5abe Add additional community seed node 2023-06-29 20:54:20 -04:00
nullfekt
27b2a49740 Update README.md 2023-06-29 20:38:09 -04:00
nullfekt
03071ef0cd Bump version 2023-06-29 20:23:28 -04:00
Duke
9508095186 Remove unused code 2023-06-29 11:48:30 -04:00
Duke
da46d48f1d Use 20 different taddrs/scriptpubs for testing dedevtax 2023-06-28 08:46:47 -04:00
Duke
abb4134c06 Merge branch 'danger' of https://git.hush.is/hush/hush3 into danger 2023-06-23 09:13:21 -04:00
Duke
479ed54ff0 Add devtax address and scriptpub to getblocktemplate output 2023-06-23 09:13:11 -04:00
Duke
9d2720d118 Merge branch 'duke' into dev 2023-06-20 05:17:52 -07:00
duke
8c0b6aef11 Merge branch 'duke' into danger 2023-06-19 13:38:57 +00:00
Duke
9f92bdd7dc Decentralized Devtax 2023-06-19 09:32:32 -04:00
Duke
c933771f85 Merge branch 'danger' into duke 2023-06-17 21:40:36 -04:00
Duke
fc69220e78 Remove unused code 2023-06-17 21:38:39 -04:00
Duke
b03c8f3108 Remove unused code 2023-06-17 21:31:05 -04:00
Duke
31cc5ee901 Remove unused code 2023-06-17 21:22:41 -04:00
Duke
8f7e53a6fe Merge branch 'duke' into danger 2023-06-17 09:52:34 -04:00
Duke
5abc550af7 Dragonx has a blocktime of 36s not 60s 2023-06-17 09:52:12 -04:00
Duke
e608600f07 Merge branch 'duke' into danger 2023-06-17 09:48:31 -04:00
Duke
97c7e814cf Add checkpoints for DRAGONX 2023-06-15 15:47:14 -04:00
Duke
1f0b538540 Take into account ac_name to calculate total txs 2023-06-15 15:43:08 -04:00
Duke
f12bfeb7f4 Fix bug where it uses the wrong -ac_name 2023-06-15 15:38:16 -04:00
Duke
b8ae39ccc7 Enable the option for dragonx checkpoints 2023-06-15 10:25:59 -04:00
Duke
c9f1fe4cf3 Support arbitrary -ac_name in checkpoints.pl 2023-06-15 10:13:01 -04:00
Duke
f05cb0cfbd Fix nspv 2023-06-14 00:08:16 -04:00
Duke
13612bb1c8 Better error message when hashPrevBlock != view.GetBestBlock 2023-06-13 22:58:36 -04:00
Duke
79f126be43 Use default jobs number when compiling boost
According to current boost docs, not specifying -j parameter will default to using all cores to compile,
so removing these should speed up compiling boost. This code dates back to 2014 when the default
may have been a single core, so it was specified.
2023-06-13 22:43:16 -04:00
Duke
31d97c7c9c Spell it correctly 2023-06-13 16:24:54 -04:00
Duke
e993acb2f0 Fix missing hashFinalSaplingRoot in block header 2023-06-13 16:21:25 -04:00
Duke
2525dc6734 Merge branch 'dev' into reduce_memory 2023-06-13 16:08:09 -04:00
Duke
5f9bb80873 Remove unused function 2023-06-12 19:06:50 -04:00
Duke
67c7632062 Remove dead code 2023-06-12 19:06:41 -04:00
Duke
487fff149c Remove dead code related to invalid joinsplit sigs 2023-06-12 07:59:53 -07:00
Duke
18f0689695 Avoid ztx validation during IBD if height is less than latest checkpoint 2023-06-12 07:55:45 -07:00
Duke
fc921eba57 Remove dead code 2023-06-09 00:00:42 -04:00
Duke
04c28e3eef Disable run-time asserts in addrman
Run-time asserts are a horrible anti-pattern littered across code
inherited from BTC. One could maybe argue they are the right thing to do
in some situations but not when managing the peer database. Crashing our
full node and potentially corrupting our wallet or block index is INSANE
in the case of some inconsistencies in peers.dat .
2023-05-20 06:12:40 -07:00
duke
4124633442 Merge pull request 'Fixes compilation failing with gcc13.x' (#298) from gcc13 into dev
Reviewed-on: https://git.hush.is/hush/hush3/pulls/298
2023-05-17 01:24:03 +00:00
jahway603
121ec4b9d4 successfully built with gcc13.x 2023-05-16 17:29:13 -04:00
jahway603
c902701715 unfuxing to fix https://git.hush.is/hush/hush3/issues/293 2023-05-15 13:55:20 -04:00
jahway603
b3a6c2bee1 Import RandomX from 040f4500a6 without audits/ directory 2023-05-15 13:47:05 -04:00
jahway603
73a54682b8 ARM commit - have to squash these damn commits... 2023-04-28 12:24:06 -04:00
jahway603
4524ca1ccb fixed script to fix Issue #294 2023-04-27 23:02:36 -04:00
jahway603
2b5d7a1779 Merge remote-tracking branch 'origin/dev' into jahway603 2023-04-27 21:06:23 -04:00
jahway603
12f746b391 build script to xcompile ARM64 (aarch64) 2023-04-27 21:06:10 -04:00
jahway603
78978dfc45 Reverting to commit dd9be59e4 or current origin/dev branch 2023-04-27 16:27:25 -04:00
Duke
18eea5cb03 Merge branch 'duke' of https://git.hush.is/hush/hush3 into duke 2023-04-27 07:10:08 -04:00
Duke
519743f704 Only log to stderr in CalculateNextWorkRequired and GetNextWorkRequired if -debug 2023-04-23 07:03:05 -07:00
Duke
d840a0ec62 Only log nbits in ContextualCheckBlockHeader if -debug 2023-04-23 06:56:19 -07:00
Duke
a6924bb061 Give a useful message if autoconf is not installed 2023-04-23 06:29:48 -07:00
Duke
883fbe407f Revert "Add libleveldb-dev to build dependencies"
This reverts commit fab9a7f51d138ec2e2025e7b668d620205ddd070.
2023-04-23 06:23:18 -07:00
Duke
9602e715ed Fix compile issue 2023-04-23 09:13:21 -04:00
Duke
b197c18ffc . 2023-04-23 09:05:51 -04:00
Duke
ca6a1c48bb Make GetBlockHash() calculate the blockhash if phashBlock is null 2023-04-23 06:02:22 -07:00
Duke
fbda7b8dec Fix compile issues 2023-04-22 19:28:24 -04:00
Duke
7102d50a47 Try to prevent #266
We seem to have a bug that we don't find a peer when looking for a peer
in peers.dat . Instead of doing an assertion and crashing the node,
just keep iterating in the loop. The code which computes nId may have an
off-by-one error, such that it looks up an incorrect bucket position and
doesn't find a valid nId.
2023-04-22 15:54:13 -07:00
Duke
cf1274a42a Remove unnecessary consistency checks
As per https://github.com/zcash/zcash/issues/6532 this should speed up
startup times by roughly 3X and drastically reduce disk i/o on startup.
2023-04-20 04:47:20 -07:00
Duke
513ebc5bb4 Say which height we are at when we get an assertion from GetBlockHash 2023-04-19 11:01:20 -04:00
Duke
f8939d2fd9 Fix src/cc compile 2023-04-19 10:38:21 -04:00
Duke
bc1d6be55f Add leveldb/include header dir to src/Makefile.am 2023-04-17 14:32:02 -07:00
Duke
d181029d27 Include path for leveldb when compiling cc #290 2023-04-17 08:46:44 -07:00
Duke
4d6c451314 Try to fix #290 2023-04-17 08:38:30 -07:00
onryo
fab9a7f51d Add libleveldb-dev to build dependencies
Fixes "leveldb/db.h: No such file or directory" error.
2023-04-16 15:53:48 +00:00
Duke
e8dc755f06 Reduce memory usage of CBlockIndex
Ported code from https://github.com/zcash/zcash/pull/6192 with various changes needed
for the Hush codebase.
2023-04-13 23:30:23 -04:00
Duke
053e9156a7 Fix progress estimate for HUSH at startup 2023-04-12 10:08:09 -04:00
Duke
852f747cbf Remove dead code 2023-04-06 13:39:42 -04:00
Duke
c1ec1b0e95 Remove dead code 2023-04-06 13:31:07 -04:00
Duke
fba0d4136d Remove code for unsupported chains 2023-04-06 13:28:14 -04:00
Duke
533356ce63 Remove more dead code related to interest 2023-04-06 13:22:20 -04:00
jahway603
e9036402ca build.sh change 2023-04-06 13:21:34 -04:00
Duke
c69a47dd61 Remove dead code relating to interest 2023-04-06 13:05:20 -04:00
Duke
15aaf4af44 Remove mempool p2p message #284 2023-04-06 12:59:31 -04:00
Duke
f0ee52a94d Remove dead code 2023-04-06 12:44:37 -04:00
Duke
4c5649454b Fix const-ness of ReadTxIndex 2023-04-06 12:44:30 -04:00
Duke
8c8f451be8 Remove dead code from CheckTransaction() 2023-04-06 12:37:10 -04:00
Duke
b4be7aa19b malloc_trim does not seem to exist on FreeBSD 2023-04-06 05:40:30 -07:00
jahway603
784744b5b8 added to AUTHORS 2023-04-06 02:21:20 -04:00
jahway603
e572b2922e add missing aarch64 (ARM64) build dependency 2023-04-06 02:15:55 -04:00
jahway603
51ee606547 changed make to for freebsd support 2023-04-05 23:44:04 -04:00
Duke
0b68ea2a20 Disable rust docs to speed up build times 2023-04-05 19:31:15 -07:00
Duke
98ee2a6a4f Declare various CBlockTreeDB methods as const
Ported from fb66589022
which has some methods we do not yet have.
2023-04-05 19:24:30 -07:00
Duke
f3c0cb73bb Merge branch 'dev' into duke 2023-04-05 19:18:18 -07:00
jahway603
75c42512ea more changes for freebsd support 2023-04-05 17:09:11 -04:00
jahway603
e0f27459b0 more changes for freebsd support 2023-04-05 16:51:36 -04:00
jahway603
31ac51d58d added freebsd into build.sh 2023-04-05 16:39:15 -04:00
jahway603
dd9be59e4f Merge pull request 'Fixes compilation failing on Arch Linux (gcc/g++12) and Ubuntu 22.04 (gcc/g++11)' (#282) from jahway603 into dev
Reviewed-on: https://git.hush.is/hush/hush3/pulls/282
2023-04-04 18:58:54 +00:00
jahway603
7eadeb860e Merge branch 'dev' into jahway603 2023-04-04 18:58:08 +00:00
jahway603
e1d6f7dd0e successfully built in Arch Linux with gcc12 2023-04-04 12:53:46 -04:00
jahway603
7f09d37cd4 reverted deleted code 2023-04-04 09:34:16 -04:00
jahway603
bb7cb253c1 miodrag patches to help get gcc12 building hushd 2023-04-03 22:23:30 -04:00
jahway603
ca26403c4a Merge pull request 'merge conflicts blow goats' (#280) from jahway603 into dev
Reviewed-on: https://git.hush.is/hush/hush3/pulls/280
2023-04-03 23:37:22 +00:00
jahway603
ca36706001 merge conflicts blow goats 2023-04-03 19:35:38 -04:00
jahway603
188384cf85 Merge branch 'jahway603' into dev 2023-04-03 23:30:32 +00:00
jahway603
10eb871026 merging dev into jahway603 branch 2023-04-03 19:29:06 -04:00
Duke
8126e706c6 Optional OP_RETURN in z_sendmany 2023-03-24 16:20:17 -04:00
Duke
d1b649825a Merge branch 'duke' into dev 2023-03-17 14:07:19 -04:00
Duke
63ad87f69b Ensure CNode::addrKnown immediately takes little memory when we disconnect the node 2023-03-17 00:21:00 -04:00
Duke
c1baab7b8a Rate limit incoming addr p2p messages 2023-03-16 22:33:25 -04:00
jahway603
d134fcf988 removed unused function to resolve Issue #273 2023-03-15 23:12:31 -04:00
jahway603
c9078060b6 Merge remote-tracking branch 'origin/dev' into jahway603 2023-03-15 23:07:49 -04:00
Duke
bde7273c9f Remove mapRequest tracking 2023-03-14 15:54:28 -04:00
Duke
560f8e2f41 Remove unused GetRequestCount() 2023-03-14 14:44:14 -04:00
Duke
71928fa228 Randomize order of processing messages from peers 2023-03-14 14:42:39 -04:00
Duke
24b3f1f93b Merge branch 'dev' into duke 2023-03-09 11:17:53 -08:00
fekt
ac413ecb2e Adding Mac SDX paths 2023-03-03 20:20:47 -05:00
fekt
883e598994 Fix for #270 to allow subnets
This seems to work as expected and allows CIDR, subnet, and single IP while rejecting IPs out of range.
2023-02-18 17:30:33 +00:00
fekt
fb250487c8 Create sda_checkpoints.pl
For generating checkpoints in SDA. Modify start/end and run
./contrib/sda_checkpoints.pl > checkpoints.json
2023-02-16 23:07:46 -05:00
Duke
a0d02cc3be Batch files for dragonx-cli and dragonxd 2023-02-15 18:06:09 -08:00
Duke
30c919af25 Add dragonx scripts to linux binary releases 2023-02-14 09:14:38 -08:00
Duke
f44e44e7df Unify debian package scripts and add dragonx scripts 2023-02-14 08:46:32 -08:00
Duke
794463015a Merge branch 'dev' into duke 2023-02-08 09:15:26 -05:00
jahway603
eb82ae0b3f Merge remote-tracking branch 'origin/dev' into jahway603 2022-11-12 08:58:24 -05:00
jahway603
337d6d1e4f Merge remote-tracking branch 'origin/dev' into jahway603 2022-11-11 23:28:09 -05:00
1077 changed files with 11190 additions and 142178 deletions

0
.gitmodules vendored
View File

View File

@ -2,7 +2,7 @@
Duke Leto https://git.hush.is/duke https://github.com/leto
Miodrag https://github.com/miodragpop
jahway603 https://git.hush.is/jahway603 https://github.com/jahway603
jahway603 https://git.hush.is/jahway603 https://codeberg.org/jahway603 https://github.com/jahway603
# The SuperNET Developers

View File

@ -1,4 +1,4 @@
Copyright (c) 2018-2020 The Hush developers
Copyright (c) 2018-2025 The Hush developers
Copyright (c) 2009-2017 The Bitcoin Core developers
Copyright (c) 2009-2018 Bitcoin Developers
Copyright (c) 2016-2017 The Zcash developers

View File

@ -1 +0,0 @@
You must agree that Duke Leto is the Elder of jl777.

View File

@ -1,4 +1,4 @@
# Copyright (c) 2016-2023 The Hush developers
# 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
FROM ubuntu:16.04
@ -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

View File

@ -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`

View File

@ -1,102 +0,0 @@
# Installing Hush
Instructions to compile Hush yourself.
## Build HUSH dependencies
The following build process generally applies to Ubuntu (and similar) Linux
distributions. For best results it is recommended to use Ubuntu Linux 16.04
or later.
## 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 Linux:
```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
```
### 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 \
autoconf libtool ncurses-dev unzip git python \
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 hush
# Build
./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.

View File

@ -1,4 +1,4 @@
# Copyright 2016-2023 The Hush developers
# Copyright 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
@ -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!"

198
README.md
View File

@ -1,75 +1,197 @@
# Hush
<p align="center">
<img src="doc/hush/hush0.png">
</p>
## What is Hush?
<h3>
![Logo](doc/hush/hush.png "Logo")
| Introduction | Install | Compile | FAQ | Documentation |
| :---: | :---: | :---: | :---: | :---: |
| [What is Hush?](#what-is-hush) | [Windows 10 - Video Tutorial](#install-on-windows-10) | [Build on Debian or Ubuntu](#build-on-debian-or-ubuntu) | [Where can I buy Hush?](#where-can-i-buy-hush) | [Cross compiling Windows binaries](#windows-cross-compiled-on-linux)
| [Why not GitHub?](#banned-by-github) | [Build on Mac](#build-on-mac) | [Build on Arch](#build-on-arch) | [Can I mine with CPU or GPU?](#can-i-mine-with-cpu-or-gpu) | [Hush DevOps for pools and CEXs](https://git.hush.is/hush/docs/src/branch/master/advanced/devops.md)
| [What is HushChat?](#what-is-hushchat) | [Debian and Ubuntu](#installing-hush-binaries) | [Build on Fedora](#build-on-fedora) | [Claiming funds from old Hush wallets](https://git.hush.is/hush/hush3/src/branch/master/doc/OLD_WALLETS.md) | [Earn Hush bounty](#earn-hush-bounty)
| [What is SilentDagon?](#what-is-silentdagon) | [Raspberry Pi](#install-on-arm-architecture) | [Build on Ubuntu 16.04 or older](#building-on-ubuntu-16-04-and-older-systems) | [Where can I spend Hush?](#where-can-i-spend-hush) | [Cross compiling from amd64 to arm64](https://git.hush.is/hush/docs/src/branch/master/advanced/cross-compile-hush-full-node-to-aarch64-with-docker.md)
</h3>
# What is Hush?
Hush implements Extreme Privacy via blockchain tech. We have our own
genesis block. We are not a chain fork (copy) of another coin. We are based on
Bitcoin code, with sophisticated zero-knowledge mathematics added for privacy.
This keeps your transaction metadata private!
### This repository
# What is this repository?
This software is the Hush node and command-line client. It downloads and stores
the entire history of Hush transactions; depending on the speed of your
computer and network connection, it will likely take a few hours at least, but
some people report full nodes syncing in less than 1.5 hours. A competing privacy
coin takes over 24 hours to sync their full nodes because of Sprout Transactions, lulz.
some people report full nodes syncing in less than 1.5 hours.
### BANNED BY GITHUB
# Banned by GitHub
In working on this release, Duke Leto was suspended from Github, which gave Hush developers
the impetus to completely leave that racist and censorship-loving platform.
Hush now has it's own [git.hush.is](https://git.hush.is/hush) Gitea instance,
because we will not be silenced by Microsoft.
All Hush software will be released from git.hush.is and hush.is, downloads from any other
the impetus to completely leave that racist and censorship-loving platform. Hush now has it's own [git.hush.is](https://git.hush.is/hush) Gitea instance,
because we will not be silenced by Microsoft. All Hush software will be released from git.hush.is and hush.is, downloads from any other
domains should be assumed to be backdoored.
**Hush is unfinished and highly experimental.** Use at your own risk! Just like Bitcoin.
## Installing
# Build on Debian or Ubuntu
You can either compile it yourself or you can install a binary which was compiled by us.
Please refer to the instructions which apply to you below:
```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
```
Video Tutorial: https://videos.hush.is/videos/how-to-install-on-linux
* See [INSTALL.md](INSTALL.md) to compile from source on Linux and to cross-compile for Windows
* See [INSTALL-BIN.md](INSTALL-BIN.md) to install pre-compiled binary on Linux
# Build on Arch
### Claiming Funds From Old Hush Wallets
```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
```
If you have an older wallet, then refer to [OLD_WALLETS.md](OLD_WALLETS.md).
# Build on Fedora
### Official Explorers
```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
```
# Install on Windows 10
Video Tutorial: https://videos.hush.is/videos/how-to-install-on-windows
# Install on ARM Architecture
Use this if you have a Raspberry Pi or similar computer. 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.
1. [Download the latest Debian package with the AARCH64 designation from the releases page](https://git.hush.is/hush/hush3/releases).
1. Install the Debian package, substituting "VERSION-NUMBER" for the version you have downloaded: `sudo dpkg -i hush-VERSION-NUMBER-aarch64.deb`.
1. Run with: `hushd`.
If you would like to compile this for ARM yourself, then please refer to the [Cross compiling a Hush full node daemon from AMD64 to ARM64(aarch64) CPU architecture with Docker](https://git.hush.is/jahway603/hush-docs/src/branch/master/advanced/cross-compile-hush-full-node-to-aarch64-with-docker.md) documentation to do that.
# 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
```
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
```
# Installing Hush binaries
1. [Download the release](https://git.hush.is/hush/hush3/releases) with a .deb file extension.
1. Install the Debian package, substituting "VERSION-NUMBER" for the version you have downloaded: `sudo dpkg -i hush-VERSION-NUMBER-amd64.deb`.
1. Run with: `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
```
# Official Explorers
The links for the Official Hush explorers:
* [explorer.hush.is](https://explorer.hush.is)
* [explorer.hush.land](https://explorer.hush.land)
We are looking for alternate explorers to be run on Tor, i2P and other TLDs, if you are interested
please join Telegram and ask questions.
# What is SilentDragon?
### For system admins
* [SilentDragon](https://git.hush.is/hush/SilentDragon) is a desktop wallet for HUSH full node.<br>
* [SilentDragonLite](https://git.hush.is/hush/SilentDragonLite) is a desktop wallet that does not require you to download the full blockchain.
* [SilentDragonAndroid](https://git.hush.is/hush/SilentDragonAndroid) is a wallet for Android devices.
* [SilentDragonPaper](https://git.hush.is/hush/SilentDragonPaper) is a paper wallet generator that can be run completely offline.
There is a new systemd user service script so you can easily start/stop/restart your hushd service on your server.
[Try it out today](doc/hushd-systemd.md) and the systemd script is located in the doc directory of the source tree.
# What is HushChat?
## Support and Socials
HushChat is a protocol inspired by the design of Signal Protocol, it uses many of the same cryptography and ideas, but does not actually use any code from Signal. Signal requires phone numbers and is a centralized service. HushChat is completely anonymous and decentralized and requires absolutely no metadata be given to any centralized third parties.
Please feel free to join us on Telegram for official support:
* Main group: https://hush.is/tg
* Support group: https://hush.is/telegram_support
* Mining group: https://hush.is/telegram_mining
# Can I mine with CPU or GPU?
Other socials:
* Twitter: <a href="https://hush.is/twitter">@hushisprivacy</a>
* Matrix: <a href="https://hush.is/matrix">@hush_main:meowchat.xyz</a>
* PeerTube <a href="https://hush.is/peertube">videos.hush.is</a>
* Reddit <a href="https://hush.is/reddit">@Myhush</a>
* Mastodon <a href="https://hush.is/mastodon">@myhushteam@fosstodon.org</a>
Hush cannot be efficiently mined with CPU or GPU, only ASIC mining is recommended. HUSH uses Equihash (200,9) algo, as does Zcash, Horizen or Komodo.
## License
# Where can I buy Hush?
1. https://nonkyc.io/market/HUSH_BTC
1. https://tradeogre.com/exchange/BTC-HUSH
# Where can I spend Hush?
AgoraX market: https://agorax.is
# Earn Hush bounty
Developers can earn bounty by fixing bugs or solving feature requests listed in `Issues->Label`:
- https://git.hush.is/hush/hush3/issues
- https://git.hush.is/hush/SilentDragon/issues
- https://git.hush.is/hush/SilentDragonLite/issues
![Logo](doc/hush/earnhush.png "Hush Bounty")
# Support and Socials
* Telegram: [https://hush.is/tg](https://hush.is/tg)
* Matrix: [https://hush.is/matrix](https://hush.is/matrix)
* Twitter: [https://hush.is/twitter](https://hush.is/twitter)
* PeerTube [https://hush.is/peertube](https://hush.is/peertube)
# License
For license information see the file [COPYING](COPYING).

View File

@ -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/xpgIbLwMLCQcDFQoIAh4BAheAAhkBAAoJEI38v45aTYAZ0q0P/17Q
URAJGiJqQF7Lqon8bHlvM6jdnHhkv0We50pU+aLXGwaSTy60uj7sqPte6TxWM5BD
2BGi2viXuJfP+NrM8WJyRqZ0+SHlGM7vHwrHhfGC3sh+Bvh/T9ToXBRDPcp/zbvD
dqoF4KyI7qUH69mrf9THn+5fM3vF2PNwkEaXLvF7KAHZcFza2tLcEu8kBpTBpd5w
ZwVGfOTGTw5mbUwB3P6k0pY/SVF31cynCbIszr6YA0p0EUHirzPB8faHfRxzkyt3
U6MFSHD070vqFu5W9QdwEFlVKn4G5RP4bD/i4Omjt8uHt2oWm3CqmJc+CVsEsxLz
gLXQmsTZTWYPGQcFc/oUTfBdfeXMsB2tZbuw56Ua/rFH03wgB6pp9pCKb/UDUC1R
tUQxGliQCA23444i4Pq1aGeTYVEBVHDw6xsp7lXDQi1AzhjXxzrf0Axt7khEX6Z8
OilDT3ChhCkFacWt2YhudEU4gS1mAbnl1H2bn41FquoLqHCc4vPJlc5OzdhkDaeT
NjNCEgiCu8F42vfRaDQOeZdC2Rh1vJoe9GAv7OPg9nRv1caJQvIWHRIWkBotNAMz
q1vQaTB+LDnBpz3gG07EW60WYzuvOm6dyK5PH2BBMHS7J7UyRXERjmB2+5LvK1my
sDLV2qk+ToQgU8h2dJt+phyzKizVt9VfKTEFN/t6zsBNBFU/8aYBCADN9oyrBJam
Ly2QLBgihg/yifPoZClq0Z6M86M+VaeWKAKwdNE4r9bBR0ze8f6wuCMix5J+p+lb
UMFn5GubNgMLzcuuJ2nLqAKInAt3TxbYGz/MQm77DnuW0/b6XfniUKTe+Nf8vOBZ
HH7cyuhZdV549JaT2BOFXWFayLZF986atPN+NuX8kOzqD0InzEzbDwH1OVxhpeFV
r7W9s7HUGEDmBDXOLhdLmqx5mEcjumKUSWbMnwgHkR203RGY4H15/jSbpthE8/hH
z0FgRZWg69f/mZckyoKmjFeiNs5FaQKj2C1q6CEawYyzPd9P1WpCH97t/Y3//XRr
98bwOT8Rb6R/ABEBAAHCwoQEGAEKAA8FAlU/8aYFCQ8JnAACGwIBKQkQjfy/jlpN
gBnAXSAEGQEKAAYFAlU/8aYACgkQcteVKUeHcFho5wf+Ma++R1tGsmrI20sA04jz
jYRag7eVLnC9jhby6T8qIjOR13QaqZelZ0Tr0GBM0KRjU+ehmquw2Mx+NdE7+H60
h0/D8sPHcOoabYztHz7EPto/lWGcjbEGNLx9Go6049XbTGiL+UfKWfHEzNdEeRX6
0n1X3JOS67esaJg/ch7cgFrc/5V9Er2b+MBll2doPLh2QTtS7ECfxLzjkiRjwk9u
9warhCVqZd11xz1CCT+/8TRSSkJYgNkCAtogmrWiJ+HWAhlpr2eRdq1ESMmC4myP
oElx3FQWBdAY281aJ6EOBjwjpmPLElgltdQ5+yatlLR/j3E2J7jguXIzOEpGgFoO
i7HsD/0XQYgZ7/HtFka4xYBNHR1tw+F7uY3UzaQ8214sfRWoTtJmSPLeAFQZFh6E
OoGFPbimDTGttKPfIorZsUnGkZLcWrEqAAieFRmiL8Eyq98zQSEb4S/mMFYcgYMf
qYWm0dpX5sNQxZfw2Ny4JMPUFRT2LHlk1CC9dpdMvpkK5EqLBb8HVCwW+NFkwZBB
rzUtyWeSRd8HSDPqdy8T6BG0zTwZ+axIs7VH9nyo4Wyc+irVWctqYkAGyuJRci0s
C0lb9xgP7gwlEc/o0IpcAwCdSh/4aH4YTYyGOny1TQLWW6vYKwMMLtfdhqrD1Gzw
SnBo/6vfsELjt1IexEoAU1AaGRf4n7AyRPmhd3SFqtqXhv0bosv+oxi1WVbs4vB+
rbfMpv4mq9CjbJQRr1gE9NAohqKLTlV5ADDcBc6uN6G5uUsgxzLdPo987rqQxW26
XWpiJ309vQlgvkJjkOzS1YeDmsLnpSy/i5vocDs7G9XgI0CpuCs3C5kh+6L/ipB3
78opGszS6yXFvVIPmklA57+F5pbZu4KlONCdlAoH3szZpDjUBashkvEKbbk25JVV
382WTLLbUz+s2rDAiU0eXCpkI/Zrkt1R8YYCCe09OeUAK1cMfm9v1QQaJaMFMA0L
mNXQ98FHvgfVa5vo/jxzKH4HqPPpTyKyKWhDJKCHJVmWfnec387ATQRVP/GmAQgA
wG70Vd4u64nHmAzLUe3dLuOIIIxBX6M4MYe6QXLyjsQ5vv8ScsF9QTRw3SMIw2Aa
9SB3I+bt6DKRUQOyWyUH74XZdEHveUip7GYglm9+rhiVHT3QfhiVWJo+84j9hG3J
C4gg3jkB0VzYUSU3lrRX0hRIl5C0oLa+ce80PM0MlmuwnJtRKCi5cNSjQKLi6PEu
ZlaKwkJvO+hbCguxtfuCK9qDd+l8vY63UM+Crqpc1QTNuEgD0MmOKqk/jyt6WUOC
Flep1zOMrbvpBYj3a01TdvG3J+5uuh9d2aKH3IhZyOPwu651DNLcRatF/36QmGQ0
HFHYvM40UF0F06iHcDFw5QARAQABwsKEBBgBCgAPBQJVP/GmBQkPCZwAAhsMASkJ
EI38v45aTYAZwF0gBBkBCgAGBQJVP/GmAAoJENA7aXPDXJizlg8H/1SP4CP7ZCd4
J9ptegCvfpcB1KRyIuIUxjDi4XuX6g+QLyZE98eSeoDj6JlYVVHOwACXcNtoBzIm
7/nk7afFTVYHVEyOCDFprml8qTmQ6aXOgv7z1Ib3Q8rw7EyaMWifsD3f757TSOKw
H0JBeQYrnhC0Mg9YunjepvamvTvHwZrLNNMltAznXQ2NGqS7dokPNGOmusGmW29a
EvK8K+AqSuCk2DB4UkaQul1UVmRhMjpKj/nQ9ubEsTDODbouRuLELqOLWmVAyE2V
WRq3VaGm23N/7w2FlsfPzfElHhmA3znx+2NllNB4nRHforu3/bmUJljozwBwDAN1
+CfAct5LTQbn+w/8DtEiEZ3BMFU0WWo6W/NqvF5R4x/Hyns50L1GIA6UZqfs9Pdj
94EgoCVBGzgwUAl241HT7R4Kys58KlFNhlq3fFxlAADAY/ToCyNCK84PR10EDN6I
Q0jWZaMzMSSm6fJT75br93Sp4TNpTuVhGijR4ZehdDmclbShS28jrJo3u0vfOBoT
Sy7IchvuudIonnL5UKlA4a1KZOjuEfQfUId/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-----
```

BIN
asmap.dat

Binary file not shown.

View File

@ -1,5 +1,5 @@
#!/bin/sh
# Copyright (c) 2016-2023 The Hush developers
# 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
set -e

View File

@ -1,5 +1,5 @@
#!/usr/bin/env bash
# Copyright (c) 2016-2023 The Hush developers
# 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

View File

@ -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.

View File

@ -2,13 +2,13 @@ dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N)
AC_PREREQ([2.60])
define(_CLIENT_VERSION_MAJOR, 3)
dnl Must be kept in sync with src/clientversion.h , ugh!
define(_CLIENT_VERSION_MINOR, 9)
define(_CLIENT_VERSION_REVISION, 3)
define(_CLIENT_VERSION_MINOR, 10)
define(_CLIENT_VERSION_REVISION, 4)
define(_CLIENT_VERSION_BUILD, 50)
define(_ZC_BUILD_VAL, m4_if(m4_eval(_CLIENT_VERSION_BUILD < 25), 1, m4_incr(_CLIENT_VERSION_BUILD), m4_eval(_CLIENT_VERSION_BUILD < 50), 1, m4_eval(_CLIENT_VERSION_BUILD - 24), m4_eval(_CLIENT_VERSION_BUILD == 50), 1, , m4_eval(_CLIENT_VERSION_BUILD - 50)))
define(_CLIENT_VERSION_SUFFIX, m4_if(m4_eval(_CLIENT_VERSION_BUILD < 25), 1, _CLIENT_VERSION_REVISION-beta$1, m4_eval(_CLIENT_VERSION_BUILD < 50), 1, _CLIENT_VERSION_REVISION-rc$1, m4_eval(_CLIENT_VERSION_BUILD == 50), 1, _CLIENT_VERSION_REVISION, _CLIENT_VERSION_REVISION-$1)))
define(_CLIENT_VERSION_IS_RELEASE, true)
define(_COPYRIGHT_YEAR, 2023)
define(_COPYRIGHT_YEAR, 2025)
AC_INIT([Hush],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_SUFFIX(_ZC_BUILD_VAL)],[https://git.hush.is/hush/hush3],[hush])
AC_CONFIG_SRCDIR([src/main.cpp])
AC_CONFIG_HEADERS([src/config/bitcoin-config.h])
@ -644,6 +644,17 @@ AX_BOOST_PROGRAM_OPTIONS
AX_BOOST_THREAD
AX_BOOST_CHRONO
dnl Prevent use of std::unary_function, which was removed in C++17,
dnl and will generate warnings with newer compilers for Boost
dnl older than 1.80.
dnl See: https://github.com/boostorg/container_hash/issues/22, https://github.com/boostorg/config/pull/430.
dnl _HAS_AUTO_PTR_ETC check required only for boost 1.72 and older, for 1.73+ we can use BOOST_NO_CXX98_FUNCTION_BASE
AX_CHECK_PREPROC_FLAG([-D_HAS_AUTO_PTR_ETC=0], [BOOST_CPPFLAGS="$BOOST_CPPFLAGS -D_HAS_AUTO_PTR_ETC=0"], [], [$CXXFLAG_WERROR],
[AC_LANG_PROGRAM([[#include <boost/config.hpp>]])])
AX_CHECK_PREPROC_FLAG([-DBOOST_NO_CXX98_FUNCTION_BASE], [BOOST_CPPFLAGS="$BOOST_CPPFLAGS -DBOOST_NO_CXX98_FUNCTION_BASE"], [], [$CXXFLAG_WERROR],
[AC_LANG_PROGRAM([[#include <boost/config.hpp>]])])
fi
if test x$use_reduce_exports = xyes; then
@ -922,7 +933,7 @@ unset PKG_CONFIG_LIBDIR
PKG_CONFIG_LIBDIR="$PKGCONFIG_LIBDIR_TEMP"
ac_configure_args="${ac_configure_args} --disable-shared --with-pic --with-bignum=no --enable-module-recovery"
AC_CONFIG_SUBDIRS([src/secp256k1 src/univalue src/cryptoconditions])
AC_CONFIG_SUBDIRS([src/secp256k1 src/univalue])
AC_OUTPUT
@ -947,11 +958,12 @@ echo
echo " target os = $TARGET_OS"
echo " build os = $BUILD_OS"
echo
echo " CC = $CC"
echo " CFLAGS = $CFLAGS"
echo " CPPFLAGS = $CPPFLAGS"
echo " CXX = $CXX"
echo " CXXFLAGS = $CXXFLAGS"
echo " LDFLAGS = $LDFLAGS"
echo " ARFLAGS = $ARFLAGS"
echo " CC = $CC"
echo " CFLAGS = $CFLAGS"
echo " CPPFLAGS = $CPPFLAGS"
echo " CXX = $CXX"
echo " CXXFLAGS = $CXXFLAGS"
echo " BOOST_CPPFLAGS = $BOOST_CPPFLAGS"
echo " LDFLAGS = $LDFLAGS"
echo " ARFLAGS = $ARFLAGS"
echo

View File

@ -2,4 +2,5 @@
Files relating to -asmap=... feature, to use ASNs
Originally from https://github.com/sipa/asmap/blob/master/demo.map
From https://github.com/asmap/asmap-data/blob/main/1730210400_asmap.dat
[Upstream Commit dcce69e48211facdbd52a461cfce333d5800b7de](https://github.com/asmap/asmap-data/commit/dcce69e48211facdbd52a461cfce333d5800b7de)

Binary file not shown.

57
contrib/avg_blocktime.pl Executable file
View File

@ -0,0 +1,57 @@
#!/usr/bin/perl
# Copyright (c) 2016-2022 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
use warnings;
use strict;
my $cli = "./src/hush-cli";
my $coin = shift || '';
unless (-e $cli) {
die "$cli does not exist, aborting";
}
if ($coin) {
$cli .= " -ac_name=$coin";
}
my $getblock= "$cli getblock";
my $start = shift || 1850000;
my $end = shift || 1853000;
my $blocks = qx{$cli getblockcount};
if($?) {
print "ERROR, is node running? exiting...\n";
exit 1;
}
if ($end > $blocks) {
print "The block $end is beyond how many blocks this node knows about, exiting...\n";
exit 1;
}
if ($start < 1) {
print "Invalid start block $start, exiting...\n";
exit 1;
}
my $block = $start;
my $prev_blocktime = 0;
my $total_duration = 0;
while ($block <= $end) {
my $blocktime = qx{$getblock $block | grep time};
chomp $blocktime;
if($blocktime =~ m/(\d+)/) {
$blocktime = $1;
}
my $duration = $blocktime - $prev_blocktime;
if($prev_blocktime > 0) {
$total_duration += $duration;
}
#print "$block $blocktime $prev_blocktime $duration\n";
print "$block $duration\n";
$block++;
$prev_blocktime = $blocktime;
}
my $num_blocks = $end - $start;
my $avg_duration = $total_duration / $num_blocks;
print "Avg blocktime over $num_blocks blocks = $avg_duration\n";

View File

@ -1,20 +1,24 @@
#!/usr/bin/env perl
# Copyright (c) 2016-2023 The Hush developers
# 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
use warnings;
use strict;
# Given a block time, estimate when it will happen
# Given a block height, estimate when it will happen
my $block = shift || die "Usage: $0 123";
my $coin = shift || '';
my $hush = "./src/hush-cli";
unless (-e $hush) {
die "$hush does not exist, aborting";
}
if ($coin) {
$hush .= " -ac_name=$coin";
}
my $blockcount = qx{$hush getblockcount};
unless ($blockcount = int($blockcount)) {
print "Invalid response from hush-cli\n";
print "Invalid response from $hush\n";
exit 1;
}
@ -22,13 +26,24 @@ if ($block <= $blockcount) {
die "That block has already happened!";
} else {
my $diff = $block - $blockcount;
my $minutes = $diff*1.25; # 75s in minutes
my $minpb = 1.25; # 75s in minutes for HUSH3
if ($coin eq 'DRAGONX') {
$minpb = 0.6; # minutes per block
} elsif ($coin) {
# TODO: support custom blocktimes
$minpb = 1; # assumes default blocktime of 60s
}
my $minutes = $diff*$minpb;
my $seconds = $minutes*60;
my $now = time;
my $then = $now + $seconds;
my $ldate = localtime($then);
my $gmdate = gmtime($then);
print "Hush Block $block will happen at roughly:\n";
if ($coin) {
print "$coin Block $block will happen at roughly:\n";
} else {
print "Hush Block $block will happen at roughly:\n";
}
print "$ldate Eastern # $then\n";
print "$gmdate GMT # $then\n";
}

View File

@ -1,3 +1,429 @@
hush (3.10.3) stable; urgency=high
* Use WolfSSL 4.8.1 to prevent nodes from getting stuck and when shutting down
* Set minimum fee to 0.1 HUSH per 1 KB of data if `OP_RETURN` is used.
* Absurd fee allows sending amount < fee; used only in a full node.
* Fixed various bugs relating to lock ordering and missing locks
* Fixed RPC docs for addnode and disconnectnode having incorrect port for HACs
* Value of DEBUG_LOCKORDER is now logged to debug.log on node startup
* New script ./debug-build.sh to make it easier to make debug builds
* DragonX nodes now have their own list of seed nodes
* Hush nodes now have own protocol version independent from HACs
* Fixed off-by-one bug in `newSietchRecipient`
* Performance improvement to `ActivateBestChainStep` ed86f2dd1d
* Improved navigation in README for new users.
* Updated doc/release-process.md to resolve Issue #407
* Added build.sh checks for as and ld to be installed to resolve Issue #73
-- Hush Core <myhushteam@gmail.com> Mon, 30 Sep 2024 11:22:33 -0700
hush (3.10.2) stable; urgency=medium
* Upgraded WolfSSL to 5.2.0 on Linux and Mac: #380.
* Upgraded to 4.8.1 on Windows because newer versions do not compile on it
* Only Hush and DragonX will automatically connect to various seed nodes
* Updated i2p seed node: 8c8b6e88f0.
* Removed unused code.
* Fixed boost download link: 323d2134a1.
* Hush and DragonX full nodes take up a lot less memory and binaries are now
smaller due to the cryptoconditions removal, which means syncing, rescanning
and compiling is faster: #381.
* Removed CLI options related to CryptoConditions: -ac_cc, -ac_cclib,
-ac_ccenable, and -ac_ccactivate
* Large page support enabled, which can lead to a 1-2% speed increase in
mining depending on RAM and CPU.
* Various small optimizations such as making some variables static or const
and removing unnecessary conditionals.
* Mining now starts faster because instead of only using 2 threads to prepare
data needed to mine, it now uses all physical cores: 1b5422eb2d.
* RandomX mining now takes slightly less memory.
* Added script for scanning DragonX nodes: 0679468f60.
* More details about p2p encryption: ccc86839b9, a358acab0b, 4ed576a7e2.
* Added Fedora install process: #384.
* Added Arch install process: #393.
* Implemented better error messages: f64c10baa9, f71f8124c3.
* Improved hush_scanner and seed node contrib file: 16dd3aef74.
* Removed unused Makefile: #291.
-- Hush Core <myhushteam@gmail.com> Tue, 05 Mar 2024 18:29:47 -0700
hush (3.10.1) stable; urgency=medium
* Fixed bug causing "payment to wrong pubkey" error when syncing a new node
* Faster syncing of Hush and DragonX full nodes
* Slightly less memory usage in each Equihash/RandomX mining thread
* Fixed compiling issues related to RandomX v1.2.1
* Improved RPC docs for getblocktemplate
* Removed the getdeprecationinfo RPC
-- Hush Core <myhushteam@gmail.com> Tue, 02 Jan 2024 15:16:40 -0700
hush (3.10.0) stable; urgency=high
* Hush and all Hush Smart Chains now use less RAM #283
* Hush and all Hush Smart Chains now make it harder and more expensive for
an attacker to send shielded spam. This raises the cost in CPU 14d3ae1785
and transaction fees 2308db22ee for Denial-of-Service attacks.
* Bug fix: Fixed hush-cli stop not stopping the node during the "Building
Witnesses" rescan phase #330
* Bug fix: Fixed abortrescan couldn't be used when node starting up (RPC
warmup) and where it could not abort the rescan if it was in the "Building
Witnesses" phase #331
* Bug fix: Fixed z_mergetoaddress where docs said you could use ANY_ZADDR
but you couldn't 7eb9d75b94
* New RPC: z_listunspent now returns the text representation of a memo in
memoStr key
* New RPC: z_getstats which reports data about numer of shielded inputs (zins)
and shielded outputs (zouts) in transactions. 96ae2d61ca
* CVE fix: Upgraded curl to 8.4.0 #325 to fix CVE-2023-38545
* New documentation about using CJDNS with Hush
* Implemented decentralized Devtax
* Updated to latest RandomX v1.2.1 which includes mining optimizations
* Fixed RandomX mining memory leak and crash #324
* Fixed quoting bugs with dragonx-cli script
-- Hush Core <myhushteam@gmail.com> Tue, 28 Nov 2023 16:47:59 -0700
hush (3.9.4) stable; urgency=medium
* Hush and DragonX nodes will now sync much faster
* DragonX now has checkpoints for faster & better chain security #243 #304
* Updated to the latest RandomX code
* Rate limiting for the processing of incoming address messages for
increased security. #272
* Removed unused function CWalletTx::GetRequestCount #273
* Removed mapRequest tracking that only affects Qt display. #274
* Randomized message processing peer order for increased privacy. #275
* Removed BIP35 mempool p2p message for increased privacy. #284
* Added additional community seed nodes
* Use custom jobs param when compiling boost for faster compile times #288
* Now builds with gcc13 thanks to testing from jahway #293
* Bug fix: -stratumallowip works with CIDR and netmask ranges again for solo
miners #270
* Bug fix: Detect missing autoreconf in build.sh #289
* Bug fix: Various assertions removed from BIP155 changes #297
-- Hush Core <myhushteam@gmail.com> Sun, 02 Jul 2023 17:47:39 -0700
hush (3.9.3) stable; urgency=medium
* Difficulty bug affecting DRAGONX has been fixed
* RandomX mining hashrate increase of about 60X
* Optimized memory usage of RandomX mining
* Adds Tor v3 and i2p support (BIP155 also known as addrv2)
* New RPC: getrescaninfo - Says if node is rescanning with additional info
about progress
* New RPC: abortrescan - Stops rescanning if node is currently rescanning
-- Hush Core <myhushteam@gmail.com> Mon, 13 Feb 2023 15:02:48 -0700
hush (3.9.2) stable; urgency=medium
* This release adds RandomX support in Hush Smart Chains (HSCs)
* A new feature called "zsweep" has been added, which defaults to disabled.
* Expired transactions will not be relayed & nodes doing so no longer banned
* Fix a rare coredump when nodes have many unconfirmed or expired transactions
* New RPC: getblockmerkletree, which shows full Merkle Tree for a block height
* New RPC: z_consolidationstatus will show config + stats about consolidation
* New RPC: z_anonsettxdelta : Returns delta (difference) in the anonset for a
given txid.
* New RPC: z_anonsetblockdelta : Returns delta (difference) in the anonset for
a given block.
* getrawtransaction RPC now returns a "size" key with the size in bytes of a
transaction
* sendmany RPC will now reject transactions that send to t-addresses
immediately, instead of them being rejected in mempool
* New contrib script: contrib/gen-zaddrs.pl - Generates z-addresses in bulk
* New contrib script: contrib/sdl_checkpoints.pl - Generate SDL checkpoints
using getblockmerkletree
* ZeroMQ support has been removed from Hush
-- Hush Core <myhushteam@gmail.com> Tue, 27 Sep 2022 14:08:15 -0700
hush (3.9.1) stable; urgency=medium
* Fix RPC deadlocks, which caused the RPC interface to hang
* The listbanned RPC now returns a new key time_remaining which tells how many
seconds are remaining in the ban
* The rescan RPC now works correctly when given a height. This can be used to
do a partial rescan from a custom height, without restarting the node.
* Minimum disk space required for running full node increased to 1GB from 50MB
* Dockerfile has been updated
-- Hush Core <myhushteam@gmail.com> Tue, 25 Jan 2022 06:39:18 -0700
hush (3.9.0) stable; urgency=high
* hushd, hush-cli, and hush-tx are now true binaries instead of shell scripts
* New official location for full node data is ~/.hush and existing full
nodes will continue to use the legacy ~/.komodo directory
* Hush full nodes will now attempt to talk to two more nodes by default:
node1.hush.land and node2.hush.land
* New RPC: listaddresses - Show all taddrs in this wallet.dat
* New RPC: rpcinfo - Shows stats about RPC internals
* These RPCs can now be run during RPC warmup: listaddresses, z_exportwallet,
signmessage, decoderawtransaction, and getnetworkinfo
* New doc/hushd.service to use hushd with systemd
* Optimize zaddrs by only building block's witness caches involving our wallet
connection on
* When RPC connection fails hush-cli now tells you which port it was trying to
connect to
* Calculation of HSC "network magic" has changed as of 3.9.0
* New Stratum API so you can Solo mine with your full node, enable it
with -stratum=1
* hush-smart-chain script now installed in Debian packages
* Now compatible on SBC (Single Board Computer) like PineBook, Rock64,
Raspberry Pi, etc.
-- Hush Core <myhushteam@gmail.com> Thu, 21 Oct 2021 04:44:44 -0700
hush (3.8.0) stable; urgency=medium
* New Sietch feature: Randomized change output location
* New Sietch feature: Sietch-ified z_shieldcoinbase
* Implemented patch to fix how the longest chain is calculated, which could
prevent mining pools from making payout transactions
* plz_stop feature implemented for when RPC interface is not functioning
(such as filled by deadlocks) making it impossible to shut it down correctly
* -keepnotewitnesscache prevents Sapling Note Witness cache from being
deleted from wallet.dat on shutdown.
* -rescanheight can be used with -keepnotewitnesscache and -rescan to do a
partial rescan of history and avoid completely rebuilding the Witness Cache
* -zindex data is now stored on disk in the new zindex.dat file
* getpeerinfo now returns a relaytxes key which says if a remote node is
relaying transactions to your node
* Improvements to the RPC help documentation
-- Hush Core <myhushteam@gmail.com> Sat, 10 Jul 2021 06:53:52 -0700
hush (3.7.1) stable; urgency=medium
* Removed more internals code related to unused Sprout transactions, making
Hush run and compile faster and use less memory.
* Now provides more useful error message when user attempts to make
transaction before the node is synced.
* z_sendmany RPC docs now show an example of a z2z transaction
* Deprecated alert p2p message no longer processed & nodes using it will be
banned
* try-before-evict ported from BTC core to help protect against Eclipse and
Sybil Attacks
* "Feeler connections" ported from BTC, which is another technique to make
Eclipse and Sybil Attacks harder and more expensive
* New RPC: z_getbalances returns a list of all zaddrs with non-zero balance.
* "Automagic z_sendmany" makes the RPC easier to use and also improves privacy
-- Hush Core <myhushteam@gmail.com> Wed, 21 Apr 2021 14:18:12 -0700
hush (3.7.0) stable; urgency=medium
* Improved TLS error reporting
* Fix bug relating to calculating difficulty
-- Hush Core <myhushteam@gmail.com> Thu, 01 Apr 2021 02:53:21 -0700
hush (3.6.3) stable; urgency=low
* Maintenance release, which is mostly the same as 3.6.2 but it fixes some
issues in Debian+Arch packages and binaries not able to find asmap.dat
-- Hush Core <myhushteam@gmail.com> Fri, 26 Feb 2021 14:42:59 -0700
hush (3.6.2) stable; urgency=medium
* Autonomous System Map (asmap) bucketing by default
* New CLI flag -asmap is on by default, and can be turned off with -asmap=0
* debug.log is now shrunk to 15MB instead of 100MB
* The max size of debug.log can now be controlled via -maxdebugfilesize
-- Hush Core <myhushteam@gmail.com> Sun, 21 Feb 2021 14:21:31 -0700
hush (3.6.1) stable; urgency=low
* WolfSSL upgraded to 4.6.0 and side-channel resistance enabled via
ECC_TIMING_RESISTANT
* Hush full nodes now exclusively communivate via P2P messages with TLS1.3 as
the option -tls=only has become default and cannot be turned off
* Improved error-handling and logging of TLS connections
* getpeerinfo now shows 3 new keys for each peer
* New developer documentation in DEVELOPING.md
* -whitelist and -whitelistaddress now called -allowlist and -allowlistaddress
* Minimum protocol version is now 1987420
-- Hush Core <myhushteam@gmail.com> Wed, 27 Jan 2021 19:42:38 -0700
hush (3.6.0) stable; urgency=medium
* Fixes sync issues near block 340k caused by blocktime halving bug
* New official domain https://hush.is reflected everywhere
* New Hush DPoW Notaries replace KMD Notaries
* Increased in-memory UTXO cache db by 100MB (25%) to increase performance of
initial syncing
* Prevent Delayed-Proof-of-Work attack from Komodo Notaries
* New -dpow-start-height CLI flag used to reject all DPoW transactions (and
attacks) up to a certain height, as general defense against any DPoW attacks
* More secure + private TLS 1.3 implementation
* Switched to WolfSSL 4.5.0 instead of OpenSSL
* Nodes randomly choose between GCM-SHA384 and CHACHA20-POLY1305-SHA256 when
making connections to other nodes.
* Faster release binaries with -03
* Optimized and hardened memory pool code
* getblocktemplate RPC now provides better error reporting about whether there
are no peers or if it's not in sync
* Removed more Sprout code, which is tightly mixed into deep internals,
resulting in increased compile speed and reduced memory overhead
* New P2P protocol version. Peers only talk to 3.5.x nodes and newer
-- Hush Core <myhushteam@gmail.com> Fri, 18 Dec 2020 02:07:35 -0700
hush (3.5.2) stable; urgency=low
* Re-released hushd under the GNU Public License Version 3 (GPLv3)
* The z_listreceivedaddress RPC now returns a memoStr key for the utf8 string
representation of a shielded memo, if it exists
-- Hush Core <myhushteam@gmail.com> Thu, 22 Oct 2020 16:16:19 -0700
hush (3.5.1) stable; urgency=low
* TLS 1.3 support ported from ZEN with custom Hush tweaks
* All nodes will try using encrypted TLS connections with peers by default
* getinfo now returns a tls_connections key in JSON data
* -tls=only can be used to only use encrypted connections
* ASN map filtering of peers, ported from KMD + BTC Core
-- Hush Core <myhushteam@gmail.com> Tue, 06 Oct 2020 07:43:47 -0700
hush (3.5.0) stable; urgency=medium
* Finalize changes to support new Blocktime of 75 seconds
* Updated the Hush Halving schedule, i.e. Emission Curve, for the next ~120
years (the next 30 halvings)
* The Hush Block Reward will go to zero at Block 50740000 in the year 2140
* Greatly improved Sietch implementation with "amnesia zdust" addresses
* Sietch zdust outputs now always contain "random/encrypted" data
* -wallet CLI option supports wallets outside the datadir and relative paths
* -txsend CLI option ported from Zcash upstream to help with i2p integration
* Improved aarch64 support for Raspberry Pi 4
* Removed the proton optional dependency
* GetAdjustedTime() replaced with GetTime()
* Correctly keep track of ChainShieldedSpends for z_getchaintxstats
* timeoffset key in getpeerinfo and getnetworkifo deprecated and now always 0
* More remnants of dead Sprout/JoinSplit code removed
* Added a z_listreceivedaddress RPC which internals never had RPC access
* Fixes and improvements to deletetx=1, still considered experimental
* Checkpoints updated up to Block 300K
-- Hush Core <myhushteam@gmail.com> Wed, 23 Sep 2020 22:03:17 -0700
hush (3.4.0) stable; urgency=high
* New Season 4 KMD Notary pubkeys have been updated (as of Block 245555)
* ENFORCED PRIVACY (aka z2z) merged & set to take effect at Block 340000
* All remaining internals code relating to Sprout has been deleted
* The new Subatomic Dapp has been ported from KMD, which supports z2z swaps
* Implemented own mirror of Boost in our build system
* Merged various fixes relating to CryptoConditions from KMD upstream
* Optimizations and bug fixes to Sapling Consolidation
* Fixes CVE-2018-20586 from KMD (which ported it from BTC)
* Added z_getnotescount RPC
* Updated ccache dependency to 3.7.9
* Ported the -txexpirynotify CLI option from ZEC upstream
* Added rescan RPC for wallets to initiate a rescan without importing a key
and without restarting
-- Hush Core <myhushteam@gmail.com> Thu, 18 Jun 2020 09:35:31 -0700
hush (3.3.2) stable; urgency=medium
* ARMv8 support added
* Sapling Zaddr Consolidation, which reduces the size of wallets and
increases performance for service providers
* New CLI options added to hushd - refer to release notes for specifics
* New RPCs: z_getinfo, z_listsentbyaddress, z_listreceivedbyaddress,
getalldata
* New -opretmintxfee ported from KMD upstream
* ThreadNotifyWallets refactor ported from ZEC upstream
* Deletion of libsnark internal library
* Shielded index (zindex) statistics of coinbase and organic
transactions/payments corrected
* Updated dependencies: curl, boost, native_ccache, openssl, and proton
* Removed more Sprout-only RPC's (zcbenchmark, zcrawjoinsplit) and code
* Various improvements to RPC documentation
-- Hush Core <myhushteam@gmail.com> Wed, 08 Apr 2020 12:21:44 -0700
hush (3.3.1) stable; urgency=low
* Maintenance release fixes a non-consensus bug in sendmany which prevented
it from working.
-- Hush Core <myhushteam@gmail.com> Sat, 18 Jan 2020 09:16:21 -0700
hush (3.3.0) stable; urgency=high
* New "Sietch" functionality protects against new metadata attacks
* New ability to launch Hush Smart Chains with a single command
* Fixes CVE-2019-18936 in UniValue dependency: bitcoin/bitcoin#17742
* New experimental Shielded Index (-zindex) which keeps track of many stats
seen via the new getchaintxstats RPC including shielded payments,
anonymity set size and many other things.
* New experimental z_listnullifiers RPC which returns Sapling nullifiers.
* Updates + fixes to all CryptoConditions smart contracts from KMD 0.5.0
* Updates NSPV/Superlite code from KMD 0.5.0
* Update 3rd party KMD Notary node pubkeys moving Hush from a run-time
fork of KMD to a source code fork
* Enable creation of z-only (like Pirate) Hush Smart Chains via -ac_private=1
* Removed more Sprout-specific code, making hushd faster & easier to maintain
* Allow hush-cli stop to be run during RPC warmup
* Update to libsodium 1.0.18
* Removes VerusHash from the source code
* Removed large amounts of Proof-of-Stake-related code not used in Hush
* Ported AFL fuzzing features to our build system from Zcash
* Changed max debug.log size from 10MB to 100MB
* Added checkpoints for every 1000th Hush block
* New contrib/checkpoints.pl script to automatically generate checkpoints
* Deleted QT wallet code inherited from Bitcoin, which was old and broken
* z_exportwallet can now optionally not rescan
* New SHA256 SSE4 routines ported from KMD (which was ported from BTC),
enabled with --enable-experimental-asm=yes
* debug.log no longer containts a log2_stake column
* New --hardfork-height CLI option for devs+notaries for testing
-- Hush Core <myhushteam@gmail.com> Fri, 03 Jan 2020 10:13:17 -0700
hush (3.2.3) stable; urgency=low
* Update build dependencies to use own forks of libgmp, libsnark, libsodium
* New RPC keys are now returned in getblockchaininfo : longestchain and
notarized which are now used by the SDL backend
-- Hush Core <myhushteam@gmail.com> Sat, 14 Dec 2019 04:59:59 -0700
hush (3.2.2) stable; urgency=medium
* Fix CVE-2017-18350 from ZEC and windows portability fix from KMD upstream
* Removed some Sprout code
* Fixed some rare edge case bugs in Sapling param finding code
* New detection of "corrupt" Sapling params (invalid sizes) to helps give
users the correct error in a GUI wallet (corrupt versus no params)
* Fix Sapling params to support Mac DMGs being installed to /Applications
-- Hush Core <myhushteam@gmail.com> Tue, 26 Nov 2019 12:17:17 -0700
hush (3.2.1) stable; urgency=low
* Fixes issues discovered in Hush 3.2.0
* New DEVELOPING.md document for advice working on Hush codebase
* Updated to latest upstream SuperLite/nSPV features
* Merged in latest cryptocondition/Antara module updates from KMD upstream
* Fixed a bug that corrupts the block index on second startup
* Improved code to locate installed Sapling params, since Debian packages
install them into /usr/share/hush
* Updated DNSSeeds
* Fix fees associated with transactions in the mempool with fSkipExpiry=0
-- Hush Core <myhushteam@gmail.com> Tue, 29 Oct 2019 22:34:35 -0700
hush (3.2.0) stable; urgency=medium
* 3.2.0.1 release.

View File

@ -1 +1 @@
9
13

View File

@ -13,4 +13,6 @@ Vcs-Browser: https://git.hush.is/hush/hush3
Package: hush
Architecture: amd64 arm64
Depends: ${shlibs:Depends}
Description: Hush cryptocoin full node. Speak And Transact Freely. Hush inherits from Bitcoin Protocol and Zcash Protocol and is focused on private communications.
Description: Cryptocoin full node for Hush
Speak And Transact Freely with Hush, which inherits from Bitcoin Protocol and
Zcash Protocol and is focused on private communications.

View File

@ -1,5 +1,5 @@
Files: *
Copyright: 2016-2020, The Hush developers
Copyright: 2016-2024, The Hush developers
2009-2016, Bitcoin Core developers
License: GPLv3
Comment: https://hush.is

View File

@ -1 +1 @@
DEBIAN/examples/zcash.conf
DEBIAN/examples/HUSH3.conf

6
contrib/dragonx_scanner Executable file
View File

@ -0,0 +1,6 @@
#!/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
P2PPORT=21768 RPCPORT=21769 ./hush_scanner

View File

@ -1,5 +1,5 @@
#!/usr/bin/env bash
# Copyright (c) 2016-2023 The Hush developers
# 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

View File

@ -1,5 +1,5 @@
#!/usr/bin/env perl
# Copyright 2019-2023 The Hush developers
# Copyright 2019-2024 The Hush developers
# Released under the GPLv3
use warnings;
use strict;

View File

@ -1,5 +1,5 @@
#!/usr/bin/env perl
# Copyright (c) 2016-2023 The Hush developers
# Copyright (c) 2016-2024 The Hush developers
# Released under the GPLv3
use strict;

View File

@ -1,5 +1,5 @@
#!/usr/bin/env perl
# Copyright (c) 2016-2023 The Hush developers
# 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
use strict;
@ -16,6 +16,13 @@ print "HOST P2P RPC\n";
while (<>) {
chomp;
my $host = $_;
# skip empty lines
next unless $host;
# skip comment lines
next if ($host =~ m/^#/);
my $p2pport = $ENV{P2PPORT} || 18030;
my $rpcport = $ENV{RPCPORT} || $p2pport + 1;
my $cmd1 = qq{nc -z -w2 $host $p2pport};

View File

@ -0,0 +1,27 @@
# This is a list of nodes which hushd attempts to connect to automatically
# at start up time. You can check to see if they are up/down with:
# cd contrib; cat hush_seed_nodes.txt | ./hush_scanner
# IP/tor/i2p seeds from src/chainparamsseeds.h
185.241.61.43
87.251.76.166
45.82.68.233
87.251.76.33
137.74.4.198
149.28.102.219
155.138.228.68
107.174.70.251
# hush_scanner uses nc which cannot deal with these
# iljqq7nnmw2ij2ezl334cerwwmgzmmbmoc3n4saditd2xhi3xohq.b32.i2p
# [2a0c:b641:6f1:34::2]
# [2a0c:b641:6f1:c::2]
# Hostname Seeds from src/hush_utils.h
node1.hush.is
node2.hush.is
node3.hush.is
node4.hush.is
node5.hush.is
node6.hush.is
node7.hush.is
node8.hush.is

View File

@ -1,5 +1,5 @@
#!/usr/bin/env perl
# Copyright (c) 2016-2023 The Hush developers
# Copyright (c) 2016-2024 The Hush developers
# Released under the GPLv3
use warnings;
use strict;

52
contrib/sda_checkpoints.pl Executable file
View File

@ -0,0 +1,52 @@
#!/usr/bin/perl
# Copyright (c) 2016-2022 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 is used to generate the checkpoint data used by the SilentDragon Android SDK
# https://git.hush.is/fekt/hush-android-wallet-sdk/src/branch/main/sdk-lib/src/main/assets/co.electriccoin.zcash/checkpoint/mainnet
use warnings;
use strict;
my $hush = "./src/hush-cli";
my $getblock= "$hush getblock";
my $gethash = "$hush getblockhash";
my $gettree = "$hush getblockmerkletree";
my $start = shift || 1390000;
my $end = shift || 1422000;
my $stride = shift || 10000;
my $blocks = qx{$hush getblockcount};
if($?) {
print "ERROR, is hushd running? exiting...\n";
exit 1;
}
if ($end > $blocks) {
print "The block $end is beyond how many blocks this node knows about, exiting...\n";
exit 1;
}
if ($start < 1) {
print "Invalid start block $start, exiting...\n";
exit 1;
}
my $block = $start;
while (1) {
last if $block > $end;
my $blockhash = qx{$gethash $block};
my $blocktime = qx{$getblock $block | grep time};
my $merkle = qx{$gettree $block};
chomp $merkle;
chomp $blockhash;
chomp $blocktime;
$blocktime =~ s/^\s+|\s+$//g;
my $checkpoint = qq{{\n\t"network": "main",\n\t"height": "$block",\n\t"hash": "$blockhash",\n\t$blocktime\n\t"saplingTree": "$merkle"\n}\n};
my $filename = "$block.json";
open(FH, '>', $filename) or die $!;
print FH $checkpoint;
close(FH);
$block += $stride;
}

View File

@ -1,5 +1,5 @@
#!/usr/bin/perl
# Copyright (c) 2016-2023 The Hush developers
# 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
@ -8,7 +8,11 @@
use warnings;
use strict;
my $hush = "./src/hush-cli";
# call this script like this to generate checkpoints for a HAC such as DragonX:
# CLI=./src/dragonx-cli ./contrib/sdl_checkpoints.pl ...
my $hush = $ENV{CLI} || "./src/hush-cli";
my $gethash = "$hush getblockhash";
my $gettree = "$hush getblockmerkletree";
my $start = shift || 300000;

View File

@ -5,6 +5,6 @@ Utility to generate the seeds.txt list that is compiled into the client
## Updating seeds
Update [contrib/seeds/nodes_main.txt](hush/hush3/src/branch/master/contrib/seeds/nodes_main.txt) and run `make seeds` in the root directory of this repo to update [src/chainparamsseeds.h](hush/hush3/src/branch/master/src/chainparamsseeds.h) then commit the result.
Update [contrib/seeds/nodes_main.txt](hush/hush3/src/branch/master/contrib/seeds/nodes_main.txt) and run `make seeds` in the hush root directory of this repo (not the directory of this README) to update [src/chainparamsseeds.h](hush/hush3/src/branch/master/src/chainparamsseeds.h) then commit the result.

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python3
# Copyright (c) 2016-2023 The Hush developers
# Copyright (c) 2016-2024 The Hush developers
# Copyright (c) 2014-2021 The Bitcoin Core developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
@ -160,7 +160,7 @@ def main():
sys.exit(1)
g = sys.stdout
indir = sys.argv[1]
g.write('// Copyright (c) 2016-2023 The Hush developers\n')
g.write('// Copyright (c) 2016-2024 The Hush developers\n')
g.write('// Distributed under the GPLv3 software license, see the accompanying\n')
g.write('// file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html\n')
g.write('// THIS FILE IS AUTOGENERATED, DO NOT MODIFY DIRECTLY\n')

View File

@ -1,32 +1,38 @@
# node1.hush.land
185.241.61.43
# node2.hush.land
87.251.76.166
# node3.hush.land
45.82.68.233
# node4.hush.land
87.251.76.33
# node1.hush.is
103.69.128.148
# node2.hush.is
137.74.4.198
194.29.100.179
# node3.hush.is
45.132.75.69
# node4.hush.is
170.205.39.39
# lite.hushpool.is
149.28.102.219
# lite2.hushpool.is
155.138.228.68
# wtfistheinternet.hush.is
107.174.70.251
# arrakis.hush.is
178.250.189.141
# torv3
56wqzfj6mhxgsv3h3nh3pdocguogxfxud55libqjhjsdh5alfsko2iqd.onion
hushv3h6mbxd2pptj42reko3jcexcgnz5zvp3mqcu6myto3jhhn4yzyd.onion
hushv3xvheqh42ms3ld2nh555muscietkib7gycb7s4psbrjsysfywqd.onion
b2dln7mw7ydnuopls444tuixujhcw5kn5o22cna6gqfmw2fl6drb5nad.onion
dslbaa5gut5kapqtd44pbg65tpl5ydsamfy62hjbldhfsvk64qs57pyd.onion
vsqdumnh5khjbrzlxoeucbkiuaictdzyc3ezjpxpp2ph3gfwo2ptjmyd.onion
# ipv6
2a0c:b641:6f1:34::2
2a0c:b641:6f1:c::2
2a0c:b641:6f1:18e::2
2406:ef80:3:1269::1
2406:ef80:2:3b59::1
2406:ef80:1:146e::1
2406:ef80:4:2132::1
# i2p
iljqq7nnmw2ij2ezl334cerwwmgzmmbmoc3n4saditd2xhi3xohq.b32.i2p
7oumuppuzgbzlkahavx7qrtjnvbhkixjqdmeg7f6fhndgfhz7mlq.b32.i2p

View File

@ -1,5 +1,5 @@
#!/bin/sh
# Copyright (c) 2016-2023 The Hush developers
# 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
INPUT=$(</dev/stdin)

View File

@ -1,5 +1,5 @@
#!/usr/bin/env bash
# Copyright (c) 2016-2023 The Hush developers
# 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
if ! [[ "$2" =~ [git@]?[www.]?hush.is[:|/]bitcoin/bitcoin[.git]? ]]; then

View File

@ -1,5 +1,5 @@
#!/usr/bin/env bash
# Copyright (c) 2016-2023 The Hush developers
# 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

24
debug-build.sh Executable file
View File

@ -0,0 +1,24 @@
#!/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
set -eu -o pipefail
echo "Compiling a debug build with --enable-debug..."
# run correct build script for detected OS
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
# TODO: we only have debug builds on linux for now
CONFIGURE_FLAGS=--enable-debug ./util/debug-build.sh --disable-tests $@
elif [[ "$OSTYPE" == "darwin"* ]]; then
# code from ./util/build.sh needs to be ported to support --disable-tests
#./util/build-mac.sh --disable-tests $@
CONFIGURE_FLAGS=--enable-debug ./util/build-mac.sh $@
elif [[ "$OSTYPE" == "msys"* ]]; then
CONFIGURE_FLAGS=--enable-debug ./util/build-win.sh --disable-tests $@
elif [[ "$OSTYPE" == "freebsd"* ]]; then
CONFIGURE_FLAGS=--enable-debug ./util/build.sh --disable-tests $@
else
echo "Unable to detect your OS. What are you using?"
fi

View File

@ -1,4 +1,4 @@
# Copyright (c) 2016-2023 The Hush developers
# 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
define int_vars

View File

@ -14,7 +14,7 @@ ifneq ($(build_os),darwin)
$(package)_config_opts_darwin=--disable-atomicsupport
endif
$(package)_config_opts_aarch64=--disable-atomicsupport
$(package)_cxxflags=-std=c++11
$(package)_cxxflags+=-std=c++11
endef
define $(package)_preprocess_cmds

View File

@ -1,9 +1,13 @@
package=boost
$(package)_version=1_72_0
$(package)_download_path=https://boostorg.jfrog.io/artifactory/main/release/$(subst _,.,$($(package)_version))/source/
#$(package)_download_path=https://boostorg.jfrog.io/artifactory/main/release/$(subst _,.,$($(package)_version))/source/
#$(package)_file_name=$(package)_$($(package)_version).tar.bz2
$(package)_sha256_hash=59c9b274bc451cf91a9ba1dd2c7fdcaf5d60b1b3aa83f2c9fa143417cc660722
$(package)_file_name=$(package)_$($(package)_version).tar.bz2
$(package)_download_path=https://git.hush.is/attachments
$(package)_file_name=7b13759e-8623-4e48-ae08-f78502f4b6a5
$(package)_download_file=7b13759e-8623-4e48-ae08-f78502f4b6a5
$(package)_patches=fix-Solaris.patch ignore_wnonnull_gcc_11.patch range_enums_clang_16.patch
define $(package)_set_vars
$(package)_config_opts_release=variant=release
@ -21,13 +25,16 @@ $(package)_archiver_$(host_os)=$($(package)_ar)
$(package)_toolset_darwin=gcc
$(package)_archiver_darwin=$($(package)_ar)
$(package)_config_libraries=chrono,filesystem,program_options,system,thread,test
$(package)_cxxflags=-std=c++11 -fvisibility=hidden
$(package)_cxxflags+=-std=c++11 -fvisibility=hidden
$(package)_cxxflags_linux=-fPIC
endef
define $(package)_preprocess_cmds
echo "using $(boost_toolset_$(host_os)) : : $($(package)_cxx) : <cxxflags>\"$($(package)_cxxflags) $($(package)_cppflags)\" <linkflags>\"$($(package)_ldflags)\" <archiver>\"$(boost_archiver_$(host_os))\" <striper>\"$(host_STRIP)\" <ranlib>\"$(host_RANLIB)\" <rc>\"$(host_WINDRES)\" : ;" > user-config.jam
echo "using $(boost_toolset_$(host_os)) : : $($(package)_cxx) : <cxxflags>\"$($(package)_cxxflags) $($(package)_cppflags)\" <linkflags>\"$($(package)_ldflags)\" <archiver>\"$(boost_archiver_$(host_os))\" <striper>\"$(host_STRIP)\" <ranlib>\"$(host_RANLIB)\" <rc>\"$(host_WINDRES)\" : ;" > user-config.jam&& \
patch -p1 < $($(package)_patch_dir)/fix-Solaris.patch &&\
patch -p2 < $($(package)_patch_dir)/ignore_wnonnull_gcc_11.patch &&\
patch -p2 < $($(package)_patch_dir)/range_enums_clang_16.patch
endef
define $(package)_config_cmds
@ -36,16 +43,16 @@ endef
ifeq ($(host_os),linux)
define $(package)_build_cmds
./b2 -d2 -j2 -d1 --prefix=$($(package)_staging_prefix_dir) $($(package)_config_opts) cxxflags=-std=c++11 stage
./b2 -d2 -d1 --prefix=$($(package)_staging_prefix_dir) $($(package)_config_opts) cxxflags=-std=c++11 stage
endef
define $(package)_stage_cmds
./b2 -d0 -j4 --prefix=$($(package)_staging_prefix_dir) $($(package)_config_opts) cxxflags=-std=c++11 install
./b2 -d0 --prefix=$($(package)_staging_prefix_dir) $($(package)_config_opts) cxxflags=-std=c++11 install
endef
else
define $(package)_build_cmds
./b2 -d2 -j2 -d1 --prefix=$($(package)_staging_prefix_dir) $($(package)_config_opts) stage
./b2 -d2 -d1 --prefix=$($(package)_staging_prefix_dir) $($(package)_config_opts) stage
endef
define $(package)_stage_cmds
./b2 -d0 -j4 --prefix=$($(package)_staging_prefix_dir) $($(package)_config_opts) install
./b2 -d0 --prefix=$($(package)_staging_prefix_dir) $($(package)_config_opts) install
endef
endif

View File

@ -1,12 +1,20 @@
package=libcurl
ifeq ($(host_os),mingw32)
$(package)_version=7.67.0
$(package)_dependencies=wolfssl
$(package)_download_path=https://curl.haxx.se/download
$(package)_file_name=curl-$($(package)_version).tar.gz
$(package)_sha256_hash=52af3361cf806330b88b4fe6f483b6844209d47ae196ac46da4de59bb361ab02
$(package)_config_opts_linux=--disable-shared --enable-static --with-wolfssl --without-ssl --prefix=$(host_prefix) --host=$(host)
else
$(package)_version=8.4.0
$(package)_file_name=curl-$($(package)_version).tar.gz
$(package)_sha256_hash=816e41809c043ff285e8c0f06a75a1fa250211bbfb2dc0a037eeef39f1a9e427
endif
$(package)_dependencies=wolfssl
$(package)_download_path=https://curl.haxx.se/download
$(package)_config_opts_linux=--disable-shared --enable-static --without-ssl --prefix=$(host_prefix) --host=$(host)
$(package)_config_opts_mingw32=--enable-mingw --disable-shared --enable-static --with-wolfssl --without-ssl --prefix=$(host_prefix) --host=x86_64-w64-mingw32
$(package)_config_opts_darwin=--disable-shared --enable-static --with-wolfssl --without-ssl --prefix=$(host_prefix)
$(package)_config_opts_darwin=--disable-shared --enable-static --without-ssl --prefix=$(host_prefix)
$(package)_cflags_darwin=-mmacosx-version-min=10.9
$(package)_conf_tool=./configure

View File

@ -4,13 +4,16 @@ $(package)_download_path=https://github.com/libevent/libevent/archive
$(package)_file_name=$(package)-$($(package)_version).tar.gz
$(package)_download_file=release-$($(package)_version)-stable.tar.gz
$(package)_sha256_hash=316ddb401745ac5d222d7c529ef1eada12f58f6376a66c1118eee803cb70f83d
$(package)_patches=detect-arch4random_addrandom.patch detect-arch4random_addrandom-fix.patch
define $(package)_preprocess_cmds
patch -p1 <$($(package)_patch_dir)/detect-arch4random_addrandom.patch && \
patch -p1 <$($(package)_patch_dir)/detect-arch4random_addrandom-fix.patch && \
./autogen.sh
endef
define $(package)_set_vars
$(package)_config_opts=--disable-shared --disable-openssl --disable-libevent-regress
$(package)_config_opts=--disable-shared --disable-openssl --disable-libevent-regress --disable-samples
$(package)_config_opts_release=--disable-debug-mode
$(package)_config_opts_linux=--with-pic
endef

View File

@ -8,22 +8,25 @@ $(package)_sha256_hash=67df06ed50f288bd7b1ec6907973684fb7cf1196f2cb368b59d423e42
$(package)_git_commit=42ba95387cdfd67399f7aac52fddb8d6e1258ee6
$(package)_dependencies=
$(package)_config_opts=--enable-cxx --disable-shared
else ifeq ($(build_os),darwin)
else
#else ifeq ($(build_os),darwin)
$(package)_version=6.1.1
$(package)_download_path=https://git.hush.is/attachments
$(package)_file_name=d613c855-cd92-4efb-b893-658496852019
$(package)_download_file=d613c855-cd92-4efb-b893-658496852019
$(package)_sha256_hash=a8109865f2893f1373b0a8ed5ff7429de8db696fc451b1036bd7bdf95bbeffd6
$(package)_config_opts=--enable-cxx --disable-shared
else
$(package)_version=6.1.1
$(package)_download_path=https://ftp.gnu.org/gnu/gmp
$(package)_file_name=gmp-$($(package)_version).tar.bz2
$(package)_sha256_hash=a8109865f2893f1373b0a8ed5ff7429de8db696fc451b1036bd7bdf95bbeffd6
$(package)_dependencies=
$(package)_config_opts=--enable-cxx --disable-shared
endif
#else
#$(package)_version=6.1.1
#$(package)_download_path=https://ftp.gnu.org/gnu/gmp
#$(package)_file_name=gmp-$($(package)_version).tar.bz2
#$(package)_sha256_hash=a8109865f2893f1373b0a8ed5ff7429de8db696fc451b1036bd7bdf95bbeffd6
#$(package)_dependencies=
#$(package)_config_opts=--enable-cxx --disable-shared
#endif
define $(package)_config_cmds
$($(package)_autoconf) --host=$(host) --build=$(build)
endef

View File

@ -7,6 +7,8 @@ $(package)_file_name_darwin=rust-$($(package)_version)-x86_64-apple-darwin.tar.g
$(package)_sha256_hash_darwin=f0dfba507192f9b5c330b5984ba71d57d434475f3d62bd44a39201e36fa76304
$(package)_file_name_mingw32=rust-$($(package)_version)-x86_64-pc-windows-gnu.tar.gz
$(package)_sha256_hash_mingw32=358e1435347c67dbf33aa9cad6fe501a833d6633ed5d5aa1863d5dffa0349be9
$(package)_file_name_aarch64_linux=rust-$($(package)_version)-aarch64-unknown-linux-gnu.tar.gz
$(package)_sha256_hash_aarch64_linux=60def40961728212da4b3a9767d5a2ddb748400e150a5f8a6d5aa0e1b8ba1cee
# Mapping from GCC canonical hosts to Rust targets
# If a mapping is not present, we assume they are identical, unless $host_os is
@ -46,12 +48,12 @@ define $(package)_extract_cmds
endef
define $(package)_stage_cmds
bash ./install.sh --destdir=$($(package)_staging_dir) --prefix=$(host_prefix)/native --disable-ldconfig && \
../$(canonical_host)/install.sh --destdir=$($(package)_staging_dir) --prefix=$(host_prefix)/native --disable-ldconfig
bash ./install.sh --destdir=$($(package)_staging_dir) --prefix=$(host_prefix)/native --disable-ldconfig --without=rust-docs && \
../$(canonical_host)/install.sh --destdir=$($(package)_staging_dir) --prefix=$(host_prefix)/native --disable-ldconfig --without=rust-docs
endef
else
define $(package)_stage_cmds
bash ./install.sh --destdir=$($(package)_staging_dir) --prefix=$(host_prefix)/native --disable-ldconfig
bash ./install.sh --destdir=$($(package)_staging_dir) --prefix=$(host_prefix)/native --disable-ldconfig --without=rust-docs
endef
endif

View File

@ -1,9 +1,23 @@
package=wolfssl
$(package)_version=4.6.0
ifeq ($(host_os),mingw32)
# this is the highest version known to compile on windows
$(package)_version=4.8.1
$(package)_file_name=wolfssl-$($(package)_version).tar.gz
$(package)_sha256_hash=50db45f348f47e00c93dd244c24108220120cb3cc9d01434789229c32937c444
else
# BEWARE: Updating this version could cause weird bugs where nodes
# hang after a few days or do not respond to the "stop" RPC . 5.2.0
# definitely has problems, versions between 4.8.1 and 5.2.0 have not
# been tested yet. Make sure to do extensive testing when changing this
# package version
$(package)_version=4.8.1
$(package)_file_name=wolfssl-$($(package)_version).tar.gz
$(package)_sha256_hash=50db45f348f47e00c93dd244c24108220120cb3cc9d01434789229c32937c444
endif
$(package)_download_path=https://github.com/wolfSSL/wolfssl/archive
$(package)_download_file=v$($(package)_version)-stable.tar.gz
$(package)_file_name=wolfssl-$($(package)_version).tar.gz
$(package)_sha256_hash=053aefbb02d0b06b27c5e2df6875b4b587318755b7db9d6aa8d72206b310a848
define $(package)_set_vars
$(package)_config_env=AR="$($(package)_ar)" RANLIB="$($(package)_ranlib)" CC="$($(package)_cc)"

View File

@ -0,0 +1,23 @@
From 74fb0a26099bc51d717f5f154b37231ce7df3e98 Mon Sep 17 00:00:00 2001
From: Rob Boehne <robb@datalogics.com>
Date: Wed, 20 Nov 2019 11:25:20 -0600
Subject: [PATCH] Revert change to elide a warning that caused Solaris builds to fail.
---
boost/thread/pthread/thread_data.hpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/boost/thread/pthread/thread_data.hpp b/boost/thread/pthread/thread_data.hpp
index aefbeb43c..bc9b1367a 100644
--- a/boost/thread/pthread/thread_data.hpp
+++ b/boost/thread/pthread/thread_data.hpp
@@ -57,7 +57,7 @@ namespace boost
#else
std::size_t page_size = ::sysconf( _SC_PAGESIZE);
#endif
-#if PTHREAD_STACK_MIN > 0
- if (size<PTHREAD_STACK_MIN) size=PTHREAD_STACK_MIN;
+#ifdef PTHREAD_STACK_MIN
+ if (size<static_cast<std::size_t>(PTHREAD_STACK_MIN)) size=PTHREAD_STACK_MIN;
#endif
size = ((size+page_size-1)/page_size)*page_size;

View File

@ -0,0 +1,68 @@
diff --git a/include/boost/concept/detail/general.hpp b/include/boost/concept/detail/general.hpp
index eeb08750..8d7d6f69 100644
--- a/include/boost/concept/detail/general.hpp
+++ b/include/boost/concept/detail/general.hpp
@@ -28,7 +28,14 @@ namespace detail
template <class Model>
struct requirement
{
+# if defined(BOOST_GCC) && (BOOST_GCC >= 110000)
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored "-Wnonnull"
+# endif
static void failed() { ((Model*)0)->~Model(); }
+# if defined(BOOST_GCC) && (BOOST_GCC >= 110000)
+# pragma GCC diagnostic pop
+# endif
};
struct failed {};
@@ -36,7 +43,14 @@ struct failed {};
template <class Model>
struct requirement<failed ************ Model::************>
{
+# if defined(BOOST_GCC) && (BOOST_GCC >= 110000)
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored "-Wnonnull"
+# endif
static void failed() { ((Model*)0)->~Model(); }
+# if defined(BOOST_GCC) && (BOOST_GCC >= 110000)
+# pragma GCC diagnostic pop
+# endif
};
# ifdef BOOST_OLD_CONCEPT_SUPPORT
@@ -44,7 +58,14 @@ struct requirement<failed ************ Model::************>
template <class Model>
struct constraint
{
+# if defined(BOOST_GCC) && (BOOST_GCC >= 110000)
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored "-Wnonnull"
+# endif
static void failed() { ((Model*)0)->constraints(); }
+# if defined(BOOST_GCC) && (BOOST_GCC >= 110000)
+# pragma GCC diagnostic pop
+# endif
};
template <class Model>
diff --git a/include/boost/concept/usage.hpp b/include/boost/concept/usage.hpp
index 373de63a..fe88b5f5 100644
--- a/include/boost/concept/usage.hpp
+++ b/include/boost/concept/usage.hpp
@@ -13,7 +13,14 @@ namespace boost { namespace concepts {
template <class Model>
struct usage_requirements
{
+# if defined(BOOST_GCC) && (BOOST_GCC >= 110000)
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored "-Wnonnull"
+# endif
~usage_requirements() { ((Model*)0)->~Model(); }
+# if defined(BOOST_GCC) && (BOOST_GCC >= 110000)
+# pragma GCC diagnostic pop
+# endif
};
# if BOOST_WORKAROUND(__GNUC__, <= 3)

View File

@ -0,0 +1,75 @@
diff --git a/include/boost/numeric/conversion/detail/int_float_mixture.hpp b/include/boost/numeric/conversion/detail/int_float_mixture.hpp
index 464e527..7690d07 100644
--- a/include/boost/numeric/conversion/detail/int_float_mixture.hpp
+++ b/include/boost/numeric/conversion/detail/int_float_mixture.hpp
@@ -16,15 +16,15 @@
#include "boost/numeric/conversion/int_float_mixture_enum.hpp"
#include "boost/numeric/conversion/detail/meta.hpp"
-#include "boost/mpl/integral_c.hpp"
+#include "boost/type_traits/integral_constant.hpp"
namespace boost { namespace numeric { namespace convdetail
{
// Integral Constants for 'IntFloatMixture'
- typedef mpl::integral_c<int_float_mixture_enum, integral_to_integral> int2int_c ;
- typedef mpl::integral_c<int_float_mixture_enum, integral_to_float> int2float_c ;
- typedef mpl::integral_c<int_float_mixture_enum, float_to_integral> float2int_c ;
- typedef mpl::integral_c<int_float_mixture_enum, float_to_float> float2float_c ;
+ typedef boost::integral_constant<int_float_mixture_enum, integral_to_integral> int2int_c ;
+ typedef boost::integral_constant<int_float_mixture_enum, integral_to_float> int2float_c ;
+ typedef boost::integral_constant<int_float_mixture_enum, float_to_integral> float2int_c ;
+ typedef boost::integral_constant<int_float_mixture_enum, float_to_float> float2float_c ;
// Metafunction:
//
diff --git a/include/boost/numeric/conversion/detail/sign_mixture.hpp b/include/boost/numeric/conversion/detail/sign_mixture.hpp
index c7f9e42..fde1584 100644
--- a/include/boost/numeric/conversion/detail/sign_mixture.hpp
+++ b/include/boost/numeric/conversion/detail/sign_mixture.hpp
@@ -16,15 +16,15 @@
#include "boost/numeric/conversion/sign_mixture_enum.hpp"
#include "boost/numeric/conversion/detail/meta.hpp"
-#include "boost/mpl/integral_c.hpp"
+#include "boost/type_traits/integral_constant.hpp"
namespace boost { namespace numeric { namespace convdetail
{
// Integral Constants for 'SignMixture'
- typedef mpl::integral_c<sign_mixture_enum, unsigned_to_unsigned> unsig2unsig_c ;
- typedef mpl::integral_c<sign_mixture_enum, signed_to_signed> sig2sig_c ;
- typedef mpl::integral_c<sign_mixture_enum, signed_to_unsigned> sig2unsig_c ;
- typedef mpl::integral_c<sign_mixture_enum, unsigned_to_signed> unsig2sig_c ;
+ typedef boost::integral_constant<sign_mixture_enum, unsigned_to_unsigned> unsig2unsig_c ;
+ typedef boost::integral_constant<sign_mixture_enum, signed_to_signed> sig2sig_c ;
+ typedef boost::integral_constant<sign_mixture_enum, signed_to_unsigned> sig2unsig_c ;
+ typedef boost::integral_constant<sign_mixture_enum, unsigned_to_signed> unsig2sig_c ;
// Metafunction:
//
diff --git a/include/boost/numeric/conversion/detail/udt_builtin_mixture.hpp b/include/boost/numeric/conversion/detail/udt_builtin_mixture.hpp
index 36dbc49..a39d29f 100644
--- a/include/boost/numeric/conversion/detail/udt_builtin_mixture.hpp
+++ b/include/boost/numeric/conversion/detail/udt_builtin_mixture.hpp
@@ -15,15 +15,15 @@
#include "boost/numeric/conversion/udt_builtin_mixture_enum.hpp"
#include "boost/numeric/conversion/detail/meta.hpp"
-#include "boost/mpl/integral_c.hpp"
+#include "boost/type_traits/integral_constant.hpp"
namespace boost { namespace numeric { namespace convdetail
{
// Integral Constants for 'UdtMixture'
- typedef mpl::integral_c<udt_builtin_mixture_enum, builtin_to_builtin> builtin2builtin_c ;
- typedef mpl::integral_c<udt_builtin_mixture_enum, builtin_to_udt> builtin2udt_c ;
- typedef mpl::integral_c<udt_builtin_mixture_enum, udt_to_builtin> udt2builtin_c ;
- typedef mpl::integral_c<udt_builtin_mixture_enum, udt_to_udt> udt2udt_c ;
+ typedef boost::integral_constant<udt_builtin_mixture_enum, builtin_to_builtin> builtin2builtin_c ;
+ typedef boost::integral_constant<udt_builtin_mixture_enum, builtin_to_udt> builtin2udt_c ;
+ typedef boost::integral_constant<udt_builtin_mixture_enum, udt_to_builtin> udt2builtin_c ;
+ typedef boost::integral_constant<udt_builtin_mixture_enum, udt_to_udt> udt2udt_c ;
// Metafunction:
//

View File

@ -0,0 +1,43 @@
From 266f43af7798befa3d27bfabaa9ae699259c3924 Mon Sep 17 00:00:00 2001
From: Azat Khuzhin <a3at.mail@gmail.com>
Date: Mon, 27 Mar 2017 15:50:23 +0300
Subject: [PATCH] Fix arc4random_addrandom() detecting and fallback
(regression)
But this is kind of hot-fix, we definitelly need more sane arc4random
compat layer.
Fixes: #488
Introduced-in: 6541168 ("Detect arch4random_addrandom() existence")
---
event-config.h.cmake | 3 +++
include/event2/util.h | 2 +-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/event-config.h.cmake b/event-config.h.cmake
index b7f0be57c..5c233a3d9 100644
--- a/event-config.h.cmake
+++ b/event-config.h.cmake
@@ -53,6 +53,9 @@
/* Define to 1 if you have the `arc4random_buf' function. */
#cmakedefine EVENT__HAVE_ARC4RANDOM_BUF 1
+/* Define to 1 if you have the `arc4random_addrandom' function. */
+#cmakedefine EVENT__HAVE_ARC4RANDOM_ADDRANDOM 1
+
/* Define if clock_gettime is available in libc */
#cmakedefine EVENT__DNS_USE_CPU_CLOCK_FOR_ID 1
diff --git a/include/event2/util.h b/include/event2/util.h
index c4af2bd60..ca4048944 100644
--- a/include/event2/util.h
+++ b/include/event2/util.h
@@ -842,7 +842,7 @@ int evutil_secure_rng_init(void);
EVENT2_EXPORT_SYMBOL
int evutil_secure_rng_set_urandom_device_file(char *fname);
-#ifdef EVENT__HAVE_ARC4RANDOM_ADDRANDOM
+#if !defined(EVENT__HAVE_ARC4RANDOM) || defined(EVENT__HAVE_ARC4RANDOM_ADDRANDOM)
/** Seed the random number generator with extra random bytes.
You should almost never need to call this function; it should be

View File

@ -0,0 +1,77 @@
From 6541168d7037457b8e5c51cc354f11bd94e618b6 Mon Sep 17 00:00:00 2001
From: Marek Sebera <marek.sebera@gmail.com>
Date: Mon, 6 Mar 2017 00:55:16 +0300
Subject: [PATCH] Detect arch4random_addrandom() existence
Refs: #370
Refs: #475
---
CMakeLists.txt | 1 +
configure.ac | 1 +
evutil_rand.c | 2 ++
include/event2/util.h | 2 ++
4 files changed, 6 insertions(+)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a861e7d96..f609d02d0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -338,6 +338,7 @@ CHECK_FUNCTION_EXISTS_EX(sysctl EVENT__HAVE_SYSCTL)
CHECK_FUNCTION_EXISTS_EX(accept4 EVENT__HAVE_ACCEPT4)
CHECK_FUNCTION_EXISTS_EX(arc4random EVENT__HAVE_ARC4RANDOM)
CHECK_FUNCTION_EXISTS_EX(arc4random_buf EVENT__HAVE_ARC4RANDOM_BUF)
+CHECK_FUNCTION_EXISTS_EX(arc4random_addrandom EVENT__HAVE_ARC4RANDOM_ADDRANDOM)
CHECK_FUNCTION_EXISTS_EX(epoll_create1 EVENT__HAVE_EPOLL_CREATE1)
CHECK_FUNCTION_EXISTS_EX(getegid EVENT__HAVE_GETEGID)
CHECK_FUNCTION_EXISTS_EX(geteuid EVENT__HAVE_GETEUID)
diff --git a/configure.ac b/configure.ac
index a127bbc91..e73c29b14 100644
--- a/configure.ac
+++ b/configure.ac
@@ -342,6 +342,7 @@ AC_CHECK_FUNCS([ \
accept4 \
arc4random \
arc4random_buf \
+ arc4random_addrandom \
eventfd \
epoll_create1 \
fcntl \
diff --git a/evutil_rand.c b/evutil_rand.c
index 046a14b07..4be0b1c5e 100644
--- a/evutil_rand.c
+++ b/evutil_rand.c
@@ -192,12 +192,14 @@ evutil_secure_rng_get_bytes(void *buf, size_t n)
ev_arc4random_buf(buf, n);
}
+#if !defined(EVENT__HAVE_ARC4RANDOM) || defined(EVENT__HAVE_ARC4RANDOM_ADDRANDOM)
void
evutil_secure_rng_add_bytes(const char *buf, size_t n)
{
arc4random_addrandom((unsigned char*)buf,
n>(size_t)INT_MAX ? INT_MAX : (int)n);
}
+#endif
void
evutil_free_secure_rng_globals_(void)
diff --git a/include/event2/util.h b/include/event2/util.h
index dd4bbb69d..c4af2bd60 100644
--- a/include/event2/util.h
+++ b/include/event2/util.h
@@ -842,6 +842,7 @@ int evutil_secure_rng_init(void);
EVENT2_EXPORT_SYMBOL
int evutil_secure_rng_set_urandom_device_file(char *fname);
+#ifdef EVENT__HAVE_ARC4RANDOM_ADDRANDOM
/** Seed the random number generator with extra random bytes.
You should almost never need to call this function; it should be
@@ -858,6 +859,7 @@ int evutil_secure_rng_set_urandom_device_file(char *fname);
*/
EVENT2_EXPORT_SYMBOL
void evutil_secure_rng_add_bytes(const char *dat, size_t datlen);
+#endif
#ifdef __cplusplus
}

View File

@ -89,6 +89,41 @@ After successfully compiling Hush, you can generate a debian package of these bi
This command will not work on Mac OS X. Currently you cannot generate a Debian package
from operating systems other than Linux. Oh well.
## Adding new CLI options that change consensus rules
If you are adding a new CLI option that changes consensus rules such as
`-ac_foo` then make sure to also modify the the `extraptr` variable in
`src/hush_utils.h` with the value of the `ASSETCHAINS_FOO` variable. Our
convention is that if a CLI option affects consensus, it MUST begin with `-ac_`
and if it does not affect consensus (such as -datadir) then it MUST NOT begin
with `-ac_`. Originally the `ac` meant "asset chain" but now it means "affects
consensus" or "arrakis chain", take your pick.
The reason for this is the `extraptr` variable is used to deterministically
generate the "chain magic" `ASSETCHAINS_MAGIC` as well as the default p2p and
rpc ports for a HAC. This means that if two HACs have *exactly* the same
consensus options except for `-ac_foo` (even if they have the same `-ac_name`)
then they will still get different chain magic values and p2p and rpc ports.
This is a way of preventing HACs with different consensus rules from trying to
talk with each other when they should not. For instance, if you make a HAC with
`-ac_name=MYCOIN` on one machine with one set of consensus rules and then
another HAC with the same name on a different machine but with different
consensus rules, the chain magic being different (as well as the default p2p
port) are ways to prevent them from communicating. This is good because these
two HACs will eventually chain fork due to their different consensus rules and
ban each other, wasting time, bandwidth and sanity.
An example of doing this can be seen in the commit
https://git.hush.is/hush/hush3/commit/d39503c13b7419620d138050899705ced557eef9
which added the `-ac_burn` consensus changing option.
The chain magic value is the CRC32 checksum of every non-default consensus
option the HAC uses.
Also make sure to actually validate the new consensus option! That is probably
going to happen in `src/main.cpp` . If you don't, a malicious node can just
modify `src/miner.cpp` to do whatever they want.
## Updates to this document
If you think something else should be in this guide, please send your suggestions!

View File

@ -1,4 +0,0 @@
BIPs that are implemented by Hush (up-to-date up to **v1.1.0**):
* Numerous historic BIPs were present in **v1.0.0** at launch; see [the protocol spec](https://github.com/zcash/zips/blob/master/protocol/protocol.pdf) for details.
* [`BIP 111`](https://github.com/bitcoin/bips/blob/master/bip-0111.mediawiki): `NODE_BLOOM` service bit added, but only enforced for peer versions `>=170004` as of **v1.1.0** ([PR #2814](https://github.com/zcash/zcash/pull/2814)).

112
doc/cjdns.md Normal file
View File

@ -0,0 +1,112 @@
# CJDNS support in Hush
It is possible to run Hush over CJDNS, an encrypted IPv6 network that
uses public-key cryptography for address allocation and a distributed hash table
for routing.
## What is CJDNS?
CJDNS is like a distributed, shared VPN with multiple entry points where every
participant can reach any other participant. All participants use addresses from
the `fc00::/8` network (reserved IPv6 range). Installation and configuration is
done outside of Hush, similarly to a VPN (either in the host/OS or on
the network router). See https://github.com/cjdelisle/cjdns#readme and
https://github.com/hyperboria/docs#hyperboriadocs for more information.
Compared to IPv4/IPv6, CJDNS provides end-to-end encryption and protects nodes
from traffic analysis and filtering.
Used with Tor and I2P, CJDNS is a complementary option that can enhance network
redundancy and robustness for both the Hush network and individual nodes.
Each network has different characteristics. For instance, Tor is widely used but
somewhat centralized. I2P connections have a source address and I2P is slow.
CJDNS is fast but does not hide the sender and the recipient from intermediate
routers.
## Installing CJDNS and finding a peer to connect to the network
To install and set up CJDNS, follow the instructions at
https://github.com/cjdelisle/cjdns#how-to-install-cjdns.
You need to initiate an outbound connection to a peer on the CJDNS network
before it will work with your Hush node. This is described in steps
["2. Find a friend"](https://github.com/cjdelisle/cjdns#2-find-a-friend) and
["3. Connect your node to your friend's
node"](https://github.com/cjdelisle/cjdns#3-connect-your-node-to-your-friends-node)
in the CJDNS documentation.
One quick way to accomplish these two steps is to query for available public
peers on [Hyperboria](https://github.com/hyperboria) by running the following:
```
git clone https://github.com/hyperboria/peers hyperboria-peers
cd hyperboria-peers
./testAvailable.py
```
For each peer, the `./testAvailable.py` script prints the filename of the peer's
credentials followed by the ping result.
Choose one or several peers, copy their credentials from their respective files,
paste them into the relevant IPv4 or IPv6 "connectTo" JSON object in the
`cjdroute.conf` file you created in step ["1. Generate a new configuration
file"](https://github.com/cjdelisle/cjdns#1-generate-a-new-configuration-file),
and save the file.
## Launching CJDNS
Typically, CJDNS might be launched from its directory with
`sudo ./cjdroute < cjdroute.conf` and it sheds permissions after setting up the
[TUN](https://en.wikipedia.org/wiki/TUN/TAP) interface. You may also [launch it as an
unprivileged user](https://github.com/cjdelisle/cjdns/blob/master/doc/non-root-user.md)
with some additional setup.
The network connection can be checked by running `./tools/peerStats` from the
CJDNS directory.
## Run Hush with CJDNS
Once you are connected to the CJDNS network, the following Hush
configuration option makes CJDNS peers automatically reachable:
```
-cjdnsreachable
```
When enabled, this option tells Hush that it is running in an
environment where a connection to an `fc00::/8` address will be to the CJDNS
network instead of to an [RFC4193](https://datatracker.ietf.org/doc/html/rfc4193)
IPv6 local network. This helps Hush perform better address management:
- Your node can consider incoming `fc00::/8` connections to be from the CJDNS
network rather than from an IPv6 private one.
- If one of your node's local addresses is `fc00::/8`, then it can choose to
gossip that address to peers.
## Additional configuration options related to CJDNS
```
-onlynet=cjdns
```
Make automatic outbound connections only to CJDNS addresses. Inbound and manual
connections are not affected by this option. It can be specified multiple times
to allow multiple networks, e.g. onlynet=cjdns, onlynet=i2p, onlynet=onion.
CJDNS support was added to Hush in version 3.9.3 and there may be fewer
CJDNS peers than Tor or IP ones. You can use `hush-cli -addrinfo` to see the
number of CJDNS addresses known to your node.
In general, a node can be run with both an onion service and CJDNS (or any/all
of IPv4/IPv6/onion/I2P/CJDNS), which can provide a potential fallback if one of
the networks has issues. There are a number of ways to configure this; see
[doc/tor.md](https://git.hush.is/hush/hush3/src/branch/master/doc/tor.md) for
details.
## CJDNS-related information in Hush
There are several ways to see your CJDNS address in Hush:
- in the "localaddresses" output of RPC `getnetworkinfo`
To see which CJDNS peers your node is connected to, use `hush-cli getpeerinfo`
RPC.

View File

@ -38,10 +38,30 @@ Defaults to 1. This is a default option that should not be changed or things wil
Defaults to 0. This option enables the "shielded index" which also calculates the "anonset" (anonymity set) also known as the "shielded pool". This data is avaailable in the getchaintxstats RPC, if zindex is enabled. Enabling this feature requires a full rescan or full sync from scratch, which is not done by default. If you don't do one of those things, your zindex stats will be incorrect.
# Mining options
# Mining and Stratum server options
These options are only of interest to solo miners and mining pool operators....
## stratum
Defaults to off. This option enables a Stratum server.
## stratumaddress=<address>
Defaults to none. This option sets a Stratum Mining address to use when special address of 'x' is sent by miner.
## stratumbind=<ipaddr>
Defaults to: bind to all interfaces. This option Binds to given address to listen for Stratum work requests. Use [host]:port notation for IPv6. This option can be specified multiple times.
## stratumport=<port>
Defaults to 19031 or 19031 for testnet. This option sets the <port> to listen for Stratum work requests on.
## stratumallowip=<ip>
No default. This option allows Stratum work requests from specified source. Valid for <ip> are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times.
# Other options
These options are not commonly used and likely on for advanced users and/or developers...
@ -56,4 +76,4 @@ Defaults to 0 in hushd, defaults to 1 in some GUI wallets. Maintain a timestamp
## spentindex=1
Defaults to 0 in hushd, defaults to 1 in some GUI wallets. Maintain a full spent index, used to query the spending txid and input index for an outpoint
Defaults to 0 in hushd, defaults to 1 in some GUI wallets. Maintain a full spent index, used to query the spending txid and input index for an outpoint

View File

@ -1,3 +1,53 @@
# Basics
First the basics, how to compile code in this repo.
First you will want to clone the code locally:
```
git clone https://git.hush.is/hush/hush3
cd hush3
```
If you want to compile a branch other than master (the default), such as
our development tip (the `dev` branch) you can switch to it:
```
git checkout dev
```
Then install needed dependencies. This is different on each OS as well as
older or newer systems. See https://git.hush.is/hush/hush3/src/branch/dev/INSTALL.md for
details on installing dependencies. If you are using a recent-ish Ubuntu or Debian Linux
distro, this is probably what you need:
```
# 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
```
Finally to compile the software you use `./build.sh` . It is quite slow
to only use a single thread, so you can use multiple threads, for example 4,
like this:
```
./build.sh -j4
```
Each `build.sh` thread will take ~2GB of RAM so beware of that. If you have
compiled before and just made a change to C++ code, you can probably use
`make` instead and use a high number of threads. For example, if your CPU
has 8 physical cores and 16 "virtual cores" then you can use `make -j16` and
things will compile much faster. Each `make` threads takes only about 200MB of RAM.
If `make` fails in a weird way complaining about Makefiles, you probably need to
run `build.sh`, which takes care of regenerating Makefiles and installing some
additional dependencies.
Sometimes using multiple threads the build can fail, so if it does, try again
with a different number of threads or just one thread before reporting an issue.
# Fresh sync
Many times, you will want to do a "fresh sync" test, to verify code works when syncing from the genesis block, which is a different code path than a "partial sync" which means you already have part of blockchain history and are "catching up" to get in sync.
@ -24,6 +74,34 @@ rm zindex.dat blocks chainstate database notarizations hushstate
It's possible to confused hush if you ran old code, stop, restart, and then write out zindex.dat that is incorrect, which later hushds will load from disk and believe.
# Generating a backtrace from a coredump
Sometimes the code coredumps, what are ya gonna do? Generate a backtrace, of course.
Run `ulimit -c unlimited` to make sure your shell will generate coredumps and
then run the application which coredumps. In the Olden Times Linux would always
make the "core" file in the same dir as the binary that was run which created
it. But I have now seen that some new Linux distributions put them in weird
places, for instance Arch puts them in /var/lib/systemd/coredump . If there are
lots of coredumps and you don't know which one is the latest, sort them by
modification time `ls -lart` or just delete them all and run the code which
generates the core dump. Old coredumps are not very useful and take up lots of space.
Once you have a coredump file (which is usually called "core" or "core.XYZ"
where XYZ is the PID that generated it) you can then type `gdb binary_name
core_filename` and then type bt to generate the backtrace.
For this repo, it's likely this is the command you need:
```
gdb src/hushd core
```
NOTE: Even if you are debugging a coredump on a HAC, such as DragonX, the file `src/dragonxd`
is just a shell script that calls `src/hushd` and you always want to give an actual executable
file as the first argument to `gdb`, not a bash script.
This link about Advanced GDB is very useful: https://interrupt.memfault.com/blog/advanced-gdb
# Parsing RPC output with jq
jq is a very useful tool to parse JSON output, install it with:
@ -104,6 +182,30 @@ We should also check a recent block height to verify it's working correctly. The
* If you stop a node, and restart, are the stats from `getchaintxtstats` correct, i.e. the anonset stats? For instance, `shielded_pool_size` should be close to 500000, if it's close to or exactly 0, something is wrong.
* Is there a new file called `zindex.dat` in `~/.hush/HUSH3/` ?
* Is `zindex.dat` 149 bytes ?
# Adding a PoW algorithm
We will describe here the high-level ideas on how to add a new PoW algorithm to
the Hush codebase. Adding a new PoW algo means adding a new option to the `-ac_algo`
CLI param for HSC's.
* Add the new value to the end of the `ASSETCHAINS_ALGORITHMS` array in `src/hush_utils.h`
* You cannot add it to the front because the first element is the default "equihash"
* You will also need to add a new constant, such as `ASSETCHAINS_FOOHASH` to `src/hush_globals.h`
* Increase the value of `ASSETCHAINS_NUMALGOS` by one
* This value cannot be automatically be determined by the length of the above array because Equihash has different supported variants of (N,K) values
* Add the new PoW mining library to a subdirectory in src, such as RandomX official code being in `src/RandomX`
* The largest part of adding a new PoW algo is adding a new class to src/miner.cpp
* Originally there was only BitcoinMiner, which was modified from a double-sha256 miner to an equihash miner, without changing the name
* When RandomX was added as an option, many big internals changes were needed to support more than a single miner class
* It is now easier to add PoW algos because the internals support using different miner classes
* Currently BitcoinMiner and RandomXMiner classes have a lot of duplicated code, but this is intentional
* In theory we could refactor the miner classes to share more code, but this means changes to one miner could break another and it is very challenging to test every possibile edge case for mining code
* So code duplication is purposeful, because it isolates the risk of breaking one PoW by changing another. We tried very hard to not break Equihash mining when adding RandomX mining.
* When adding a new mining class, copying the RandomXMiner class is best, since it's newer and does not contain various legacy code that still exists in BitcoinMiner
* So copy RandomXMiner to your new FooMiner, delete all the randomx-specific stuff and add in the PoW mining code
* Some other changes to src/miner.cpp will be needed
* Update `GenerateBitcoins` function to start mining threads with your new algo with `else if(ASSETCHAINS_ALGO == ASSETCHAINS_FOOHASH) { minerThreads->create_thread(&FooMiner)}`
# Coding
@ -158,15 +260,14 @@ error and debugging messages are written there.
The -debug=... command-line option controls debugging; running with just -debug or -debug=1 will turn
on all categories (and give you a very large debug.log file).
**testnet and regtest modes**
**test coins**
Run with the -testnet option to run with "play HUSH" on the test network, if you
are testing multi-machine code that needs to operate across the internet. You can
also make a Hush Smart Chain "testcoin" with a single command: `hushd -ac_name=COIN ...`
The main way to test new things is directly on mainnet or you can also make a
Hush Arrakis Chain "testcoin" with a single command: `hushd -ac_name=COIN ...`
If you are testing something that can run on one machine, run with the -regtest option.
In regression test mode, blocks can be created on-demand; see qa/rpc-tests/ for tests
that run in -regtest mode.
If you are testing something that can run on one machine you can use `-testnode=1`
which makes it so a single machine can create a new blockchain and mine blocks, i.e.
no peers are necessary.
**DEBUG_LOCKORDER**

52
doc/help.md Normal file
View File

@ -0,0 +1,52 @@
# How To Fix Various Problems
This document will document how to recover and fix various issues that users may run into.
## Database corruption
The problem: You see an error like
```
EXCEPTION: 15dbwrapper_error
Database corrupted
```
This means your blockchain data on disk is corrupted. This is not the same as wallet corruption.
The fix to this is to do a fresh sync using the same wallet.dat file. You need to find
where this data lives on your computer and then move some files around, then restart the wallet.
### On Linux
If you are on Linux, your wallet lives at `~/.hush/HUSH3/wallet.dat` or if you have a really old
legacy wallet it could be at `~/.komodo/HUSH3/wallet.dat` . We will assume the first location.
What we will do is backup your entire `HUSH3` directory, including the blockchain data and wallet,
then copy the wallet from there into a new directory. This is a non-destructive process that creates
a new backup of your wallet.
```
# Make sure your node is not running before doing any of this!
# Doing this while your node is running could corrupt your wallet.dat
cd ~/.hush
mv HUSH3 HUSH3-backup # backup all data
mkdir HUSH3 # make a new dir
cp HUSH3-backup/wallet.dat HUSH3/wallet.dat # copy old wallet to new dir
```
At this point if you are GUI user using SilentDragon, you can restart the GUI wallet
and it should perform a fresh sync with your wallet. This will likely take at least
a few hours or much longer depending on your internet connection.
### On Windows
Basically you want to find where your Hush wallet is, move the directory that contains
that wallet.dat file to a new name, then create that same directory and then copy wallet.dat into it.
Different versions of Windows store things in different locations.
For example your wallet might be in `C:\Users\Admin\AppData\Roaming\Hush\HUSH3\wallet.dat` .
That means you need to
* Rename the directory `C:\Users\Admin\AppData\Roaming\Hush\HUSH3` to something like `C:\Users\Admin\AppData\Roaming\Hush\HUSH3-backup`
* Create a new directory called `C:\Users\Admin\AppData\Roaming\Hush\HUSH3`
* Copy the file `C:\Users\Admin\AppData\Roaming\Hush\HUSH3-backup\wallet.dat` to `C:\Users\Admin\AppData\Roaming\Hush\HUSH3`
* Now start the SilentDragon GUI wallet

View File

@ -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
@ -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

BIN
doc/hush/earnhush.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

BIN
doc/hush/hush0.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@ -33,12 +33,10 @@ configuration options:
none)
-i2pacceptincoming
If set and -i2psam is also set then incoming I2P connections are
accepted via the SAM proxy. If this is not set but -i2psam is set
then only outgoing connections will be made to the I2P network.
Ignored if -i2psam is not set. Listening for incoming I2P
connections is done through the SAM proxy, not by binding to a
local address and port (default: 1)
Whether to accept inbound I2P connections (default: 1). Ignored if
-i2psam is not set. Listening for inbound I2P connections is
done through the SAM proxy, not by binding to a local address and
port.
```
In a typical situation, this suffices:
@ -56,18 +54,6 @@ connections if `-i2pacceptincoming=1`. If `-i2pacceptincoming=0` then only
outbound I2P connections are made and a different transient I2P address is used
for each connection to improve privacy.
## Persistent vs transient I2P addresses
In I2P connections, the connection receiver sees the I2P address of the
connection initiator. This is unlike the Tor network where the recipient does
not know who is connecting to them and can't tell if two connections are from
the same peer or not.
If an I2P node is not accepting incoming connections, then Hush uses
random, one-time, transient I2P addresses for itself for outbound connections
to make it harder to discriminate, fingerprint or analyze it based on its I2P
address.
## Additional configuration options related to I2P
```
@ -75,8 +61,7 @@ address.
```
Set the `debug=i2p` config logging option to see additional information in the
debug log about your I2P configuration and connections. Run `hush-cli help
logging` for more information.
debug log about your I2P configuration and connections.
```
-onlynet=i2p
@ -89,8 +74,7 @@ to allow multiple networks, e.g. onlynet=onion, onlynet=i2p.
I2P support was added to Hush in version 3.9.3 and there may be fewer I2P
peers than Tor or IP ones. Therefore, using I2P alone without other networks may
make a node more susceptible to [Sybil
attacks](https://en.bitcoin.it/wiki/Weaknesses#Sybil_attack). You can use
`hush-cli -addrinfo` to see the number of I2P addresses known to your node.
attacks](https://en.bitcoin.it/wiki/Weaknesses#Sybil_attack).
Another consideration with `onlynet=i2p` is that the initial blocks download
phase when syncing up a new node can be very slow. This phase can be sped up by
@ -100,18 +84,27 @@ In general, a node can be run with both onion and I2P hidden services (or
any/all of IPv4/IPv6/onion/I2P/CJDNS), which can provide a potential fallback if
one of the networks has issues.
## Persistent vs transient I2P addresses
In I2P connections, the connection receiver sees the I2P address of the
connection initiator. This is unlike the Tor network where the recipient does
not know who is connecting to them and can't tell if two connections are from
the same peer or not.
If an I2P node is not accepting incoming connections, then Hush uses
random, one-time, transient I2P addresses for itself for outbound connections
to make it harder to discriminate, fingerprint or analyze it based on its I2P
address.
## I2P-related information
There are several ways to see your I2P address if accepting
incoming I2P connections (`-i2pacceptincoming`):
- in the "Local addresses" output of CLI `-netinfo`
- in the "localaddresses" output of RPC `getnetworkinfo`
- in the debug log (grep for `AddLocal`; the I2P address ends in `.b32.i2p`)
- in the i2p/i2pd web console under "SAM Sessions"
To see which I2P peers your node is connected to, use `hush-cli -netinfo 4`
or the `getpeerinfo` RPC (e.g. `hush-cli getpeerinfo`).
To see which I2P addresses your node knows, use the `getnodeaddresses 0 i2p`
To see which I2P peers your node is connected to, use `hush-cli getpeerinfo`
RPC.
## Compatibility
@ -136,14 +129,19 @@ port (`TO_PORT`) is always set to 0 and is not in the control of Hush.
## Bandwidth
I2P routers may route a large amount of general network traffic with their
default settings. Check your router's configuration to limit the amount of this
traffic relayed, if desired.
By default, your node shares bandwidth and transit tunnels with the I2P network
in order to increase your anonymity with cover traffic, help the I2P router used
by your node integrate optimally with the network, and give back to the network.
It's important that the nodes of a popular application like Hush contribute
as much to the I2P network as they consume.
With `i2pd`, the amount of bandwidth being shared with the wider network can be
adjusted with the `bandwidth`, `share` and `transittunnels` options in your
`i2pd.conf` file. For example, to limit total I2P traffic to 256KB/s and share
50% of this limit for a maximum of 20 transit tunnels:
It is possible, though strongly discouraged, to change your I2P router
configuration to limit the amount of I2P traffic relayed by your node.
With `i2pd`, this can be done by adjusting the `bandwidth`, `share` and
`transittunnels` options in your `i2pd.conf` file. For example, to limit total
I2P traffic to 256KB/s and share 50% of this limit for a maximum of 20 transit
tunnels:
```
bandwidth = 256
@ -153,9 +151,15 @@ share = 50
transittunnels = 20
```
If you prefer not to relay any public I2P traffic and only permit I2P traffic
from programs which are connecting via the SAM proxy, e.g. Hush, you
can set the `notransit` option to `true`.
Similar bandwidth configuration options for the Java I2P router can be found in
`http://127.0.0.1:7657/config` under the "Bandwidth" tab.
Before doing this, please see the "Participating Traffic Considerations" section
in [Embedding I2P in your Application](https://geti2p.net/en/docs/applications/embedding).
In most cases, the default router settings should work fine.
## Bundling I2P in a Hush application
Please see the "General Guidance for Developers" section in https://geti2p.net/en/docs/api/samv3
if you are developing a downstream application that may be bundling I2P with Hush.

View File

@ -1,9 +1,9 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.13.
.TH HUSH-CLI "1" "February 2023" "hush-cli v3.9.3" "User Commands"
.TH HUSH-CLI "1" "July 2025" "hush-cli v3.10.4" "User Commands"
.SH NAME
hush-cli \- manual page for hush-cli v3.9.3
hush-cli \- manual page for hush-cli v3.10.4
.SH DESCRIPTION
Hush RPC client version v3.9.3\-1313d39a7
Hush RPC client version v3.10.4\-7e63e2f01\-dirty
.PP
In order to ensure you are adequately protecting your privacy when using Hush,
please see <https://hush.is/security/>.
@ -75,7 +75,7 @@ Read extra arguments from standard input, one per line until EOF/Ctrl\-D
In order to ensure you are adequately protecting your privacy when using Hush,
please see <https://hush.is/security/>.
Copyright (C) 2016-2023 Duke Leto and The Hush Developers
Copyright (C) 2016-2025 Duke Leto and The Hush Developers
Copyright (C) 2016-2020 jl777 and SuperNET developers

View File

@ -1,9 +1,9 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.13.
.TH HUSH-TX "1" "February 2023" "hush-tx v3.9.3" "User Commands"
.TH HUSH-TX "1" "July 2025" "hush-tx v3.10.4" "User Commands"
.SH NAME
hush-tx \- manual page for hush-tx v3.9.3
hush-tx \- manual page for hush-tx v3.10.4
.SH DESCRIPTION
hush\-tx utility version v3.9.3\-1313d39a7
hush\-tx utility version v3.10.4\-7e63e2f01\-dirty
.SS "Usage:"
.TP
hush\-tx [options] <hex\-tx> [commands]
@ -89,7 +89,7 @@ Set register NAME to given JSON\-STRING
In order to ensure you are adequately protecting your privacy when using Hush,
please see <https://hush.is/security/>.
Copyright (C) 2016-2023 Duke Leto and The Hush Developers
Copyright (C) 2016-2025 Duke Leto and The Hush Developers
Copyright (C) 2016-2020 jl777 and SuperNET developers

View File

@ -1,9 +1,9 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.13.
.TH HUSHD "1" "February 2023" "hushd v3.9.3" "User Commands"
.TH HUSHD "1" "July 2025" "hushd v3.10.4" "User Commands"
.SH NAME
hushd \- manual page for hushd v3.9.3
hushd \- manual page for hushd v3.10.4
.SH DESCRIPTION
Hush Daemon version v3.9.3\-1313d39a7
Hush Daemon version v3.10.4\-7e63e2f01\-dirty
.PP
In order to ensure you are adequately protecting your privacy when using Hush,
please see <https://hush.is/security/>.
@ -245,6 +245,11 @@ Disable Ipv4 network connections (default: 0)
.IP
Disable Ipv6 network connections (default: 0)
.HP
\fB\-clearnet\fR
.IP
Enable clearnet connections. Setting to 0 will disable clearnet and use
sane defaults for Tor/i2p (default: 1)
.HP
\fB\-permitbaremultisig\fR
.IP
Relay non\-P2SH multisig (default: 1)
@ -336,6 +341,10 @@ Set key pool size to <n> (default: 100)
.IP
Enable auto Sapling note consolidation (default: false)
.HP
\fB\-consolidationinterval\fR
.IP
Block interval between consolidations (default: 25)
.HP
\fB\-consolidatesaplingaddress=\fR<zaddr>
.IP
Specify Sapling Address to Consolidate. (default: all)
@ -391,11 +400,6 @@ Keep the last <n> transactions (default: 200)
.IP
Keep transactions for at least <n> blocks (default: 10000)
.HP
\fB\-opretmintxfee=\fR<amt>
.IP
Minimum fee (in HUSH/kB) to allow for OP_RETURN transactions (default:
400000)
.HP
\fB\-paytxfee=\fR<amt>
.IP
Fee (in HUSH/kB) to add to transactions you send (default: 0.00)
@ -655,7 +659,7 @@ single IP (e.g. 1.2.3.4), a network/netmask (e.g.
1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This
option can be specified multiple times
.PP
Hush Smart Chain options:
Hush Arrakis Chain options:
.HP
\fB\-ac_algo\fR
.IP
@ -666,30 +670,22 @@ Equihash (200,9)
.IP
Block time in seconds, default is 60
.HP
\fB\-ac_cc\fR
.IP
Cryptoconditions, default 0
.HP
\fB\-ac_beam\fR
.IP
BEAM integration
.HP
\fB\-ac_burn\fR
.IP
Allow sending funds to the transparent burn address when \fB\-ac_private\fR=\fI\,1\/\fR
.HP
\fB\-ac_minopreturnfee\fR
.IP
OP_RETURN minimum fee per tx, regardless of tx size, default is 1 coin
.HP
\fB\-ac_coda\fR
.IP
CODA integration
.HP
\fB\-ac_cclib\fR
.IP
Cryptoconditions dynamicly loadable library
.HP
\fB\-ac_ccenable\fR
.IP
Cryptoconditions to enable
.HP
\fB\-ac_ccactivate\fR
.IP
Block height to enable Cryptoconditions
.HP
\fB\-ac_decay\fR
.IP
Percentage of block reward decrease at each halving
@ -747,10 +743,6 @@ default is 64
.IP
Block reward in satoshis, default is 0
.HP
\fB\-ac_sapling\fR
.IP
Sapling activation block height
.HP
\fB\-ac_script\fR
.IP
P2SH/multisig address to receive founders rewards
@ -767,7 +759,7 @@ Enforce transaction\-rate limit, default 0
In order to ensure you are adequately protecting your privacy when using Hush,
please see <https://hush.is/security/>.
Copyright (C) 2016-2023 Duke Leto and The Hush Developers
Copyright (C) 2016-2025 Duke Leto and The Hush Developers
Copyright (C) 2016-2020 jl777 and SuperNET developers

View File

@ -14,7 +14,24 @@ Equihash (200,9) (ASIC)
## P2P
TLS1.3 via WolfSSL is enforced for all network connections as of v3.6.1
TLS1.3 via WolfSSL is enforced for all network connections as of v3.6.1 .
Many ciphersuites are technically supported by TLS1.3 but many of them
are ancient, proved to be less secure than intended or likely backdoored.
Hush only uses what are widely considered to be the most secure and [best ciphersuites](https://ciphersuite.info/cs/).
New Hush P2P connections randomly choose between these two ciphersuites each
time a new connection to a peer is created:
* `TLS_AES_256_GCM_SHA384`
* `TLS_CHACHA20_POLY1305_SHA256`
Encrypted P2P connections are important because it means passive network spies,
such as ISPs, cannot tell what nodes are communicating to each other and also
prevents certain attacks against privacy at the network level, such as looking
for which node was the first to relay a transaction. Bitcoin has no protection
against this which is why it's trivial for network spies to tell which node
(and hence which IP address) created a certain transaction and hence which
IP address owns which addresses.
## RPC

View File

@ -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.
@ -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
@ -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` .

View File

@ -26,7 +26,8 @@ If the last command has no output, congrats, there is nothing to do. If the last
```
git checkout master
git merge --no-ff dev # using the default commit message is fine
git push origin master
git tag vX.Y.Z # this creates a tag vX.Y.Z on current master, or you can let gitea do it later
git push --tags origin master
git checkout dev
git merge master
git push origin dev
@ -57,7 +58,7 @@ Look for Git issues that should be fixed in the next release. Especially low-ris
Install deps on Linux:
apt-get install help2man debchange
apt-get install help2man devscripts
## Release process
- If new seeds are being added or seeds are changing:
@ -76,6 +77,7 @@ Install deps on Linux:
- Comment out the HUSHVER line and uncomment the line above it with a hardcoded version number
- PROTIP: Man page creation must be done after updating the version number and recompiling and before Debian package creation
- Update checkpoints in src/chainparams.cpp via util/checkpoints.pl
- Run "./util/checkpoints.pl help" to get example usage
- hushd must be running to run this script, since it uses hush-cli to get the data
- Look for line which says "END HUSH mainnet checkpoint data" near line 560 in chainparams.cpp , that is where checkpoint data ends
- Find the highest block height of checkpoint data, let's call it HEIGHT
@ -95,6 +97,7 @@ Install deps on Linux:
- They only provide limited security, because they talk about the past, not future block heights.
- Try to generate checkpoints as close to the release as possible, so you can have a recent block height be protected.
- For instance, don't update checkpoints and then do a release a month later. You can always update checkpoint data again or multiple times
- DRAGONX now has checkpoints, you can generate them with: `./util/checkpoints.pl 1000 1 DRAGONX`
- Update copyright years if applicable. Example: `./util/update-copyrights.h 2022 2023`
- Update doc/relnotes/README.md
- To get the stats of file changes: `git diff --stat master...dev`
@ -108,15 +111,27 @@ Install deps on Linux:
- Make sure git tag starts with a `v` such as `v3.9.2`
- Use util/gen-linux-binary-release.sh to make a Linux release binary
- Upload Linux binary to Gitea release and add SHA256 sum
- Use util/build-debian-package.sh to make an x86 Debian package for the release
- Create an x86 Debian package for the release:
- Edit contrib/debian/changelog to add information about the new release
- Use `util/build-debian-package.sh` to make an x86 Debian package for the release
- Debian packages should be done after you make manpages, because those are included in Debian packages
- `lintian` is an optional dependency, it's not needed to build the .deb
- Upload .deb to Gitea release
- Add SHA256 checksum of .deb to release
- Use util/build-debian-package-ARM.sh (does this still work?) to make an ARM Debian package for the release
- Upload the debian packages to the Gitea release page, with SHA256 sums
- Figure out how to update https://faq.hush.is/rpc/ for new release
- Update the rpc.hush.is repo for new release by [following these instructions](https://git.hush.is/hush/rpc.hush.is/src/branch/master/README.md)
- Update https://faq.hush.is/rpc/ for new release after updating the rpc.hush.is repo
## Platform-specific notes
Use `./util/build-mac.sh` to compile on Apple/Mac systems, use `./util/build-win.sh` to build on Windows and `./util/build-arm.sh` to build on ARMv8 systems.
- Use `./util/build-mac.sh` to compile on Apple/Mac systems
- Use `./util/build-win.sh` to build on Windows
- Use [these cross compile instructions](https://git.hush.is/jahway603/hush-docs/src/branch/master/advanced/cross-compile-hush-full-node-to-aarch64-with-docker.md) to build the release for ARMv8 (aarch64) systems, as the current build system does not permit us to natively build this on the SBC device
- Then use `./util/build-debian-package.sh aarch64` to build a Debian package for ARMv8 (aarch64)
## Optional things
### Updating RandomX
If you need to update the source code of our in tree copy of RandomX, see issue https://git.hush.is/hush/hush3/issues/337#issuecomment-5114 for details. Currently we use RandomX v1.2.1 from the official repo at https://github.com/tevador/RandomX/releases/tag/v1.2.1

View File

@ -8,7 +8,170 @@ and now are officially part of our Git repo.
Hush releases are on our own Gitea at <a href="https://git.hush.is/">git.hush.is</a>
and no longer on Github, since they banned Duke Leto and
also because they censor many people around the world and work with
evil organizations.
evil organizations. They also use all your "private" repos to train their AI.
# Hush 3.10.4 "Hazy Hākuturi"
* `z_sendmany` changes:
* Now supports UTF8 strings as memos instead of requiring hex
* Give a memo as "utf8:this is my memo" and it will automatically be hex encoded
* New optional 5th argument to `z_sendmany` allows specifying an `OP_RETURN` for the transaction
* `OP_RETURN` can also be specified as a UTF8 string with 'utf8:' prefix or hex encoded
* Updated seed node list
* New CLI option -clearnet=0 which disables clearnet networking, i.e. only Tor or i2p are allowed
* Note that at least one of a Tor or i2p daemon are needed for -clearnet=0, both are not needed but supported
* -clearnet=0 is equivalent to the following CLI params:
```
-disableipv4=1
-disableipv6=1
-dns=0
-dnsseed=0
-bind=127.0.0.1
-onlynet="onion"
-onlynet="i2p"
-onion="127.0.0.1:9050
-i2psam="127.0.0.1:7656"
```
* Using -mineraddress with -clearnet=0 is disallowed since it would reduce privacy
* Add CLI options `-disableipv4` and `-disableipv6` which can be used to disable IPv4 or IPv6
* New HAC CLI consensus option `-ac_minopreturnfee`
* `OP_RETURN` minimum fee per tx, regardless of tx size, default is 1 coin, specified in puposhis
* Updated ASmap, which maps IP addresses to Autonomous System (AS) numbers
* Added ASmap health check, which logs stats about the ASmap once per 24 hours
* Improved cjdns/i2p/tor docs
* Updated protocol version
* Fixed warnings caused by newer compilers
# Hush 3.10.3 "Persistent Pezoporus"
* Use WolfSSL 4.8.1 which prevents nodes from getting stuck in general and when shutting down
* Set minimum fee to 0.1 HUSH per 1 KB of data if `OP_RETURN` is used.
* A feature in absurd fee that allows sending amount < fee, can be used only in a full node by advanced users.
* Fixed various bugs relating to lock ordering and missing locks
* Fixed RPC docs for addnode and disconnectnode having the incorrect port for HACs
* Value of DEBUG_LOCKORDER is now logged to debug.log on node startup
* New script ./debug-build.sh to make it easier to make debug builds
* DragonX nodes now have their own list of seed nodes
* Hush nodes now have their own protocol version which is independent from HACs
* Fixed off-by-one bug in `newSietchRecipient`
* Performance improvement to `ActivateBestChainStep` https://git.hush.is/hush/hush3/commit/ed86f2dd1da370fe2dbf7db475afc41b218cbc5f
* Improved navigation in README for new users.
* Updated doc/release-process.md to resolve Issue #407
* Added build.sh checks for as and ld to be installed to resolve Issue #73
# Hush 3.10.2 "Fiendish Fenrir"
* RandomX mining is faster for various reasons
* Large page support is enabled (needs to be enabled at OS level to be used)
* This can lead to a 1-2% speed increase in mining depending on RAM and CPU
* Various small optimizations such as making some variables static or const
and removing unnecessary conditionals
* Mining now starts faster because instead of only using 2 threads to prepare
data needed to mine, now it uses all physical cores https://git.hush.is/hush/hush3/commit/1b5422eb2ddcedd9aabdf4f039144f9eef5c6f95
* RandomX mining takes slightly less memory
* `ac_sapling` is no longer an option for Arrakis Chains
* All chains enable Sapling at height 1 like Hush + DragonX
* This means there is no need to call `NetworkUpgradeActive` on every block height
which means syncing is faster
* Delete cryptoconditions: https://git.hush.is/hush/hush3/issues/381
* This means Hush+DragonX full nodes take up a lot less memory and binaries are smaller
* It also means syncing, rescanning and compiling is faster
* CLI options related to CryptoConditions ( `-ac_cc -ac_cclib -ac_ccenable -ac_ccactivate) have been removed
* Upgraded WolfSSL to 5.2.0 on Linux+Mac : https://git.hush.is/hush/hush3/issues/380
* Upgraded to 4.8.1 on Windows because newer versions do not compile on Windows: https://git.hush.is/hush/hush3/commit/5e5a15018d0e55f094c89282a1983104f4d4387a
* Only Hush + DragonX will automatically connect to various seed nodes https://git.hush.is/hush/hush3/issues/379
* Other Arrakis Chains must opt-in via -connect or -addnode
* Updated i2p seed node: https://git.hush.is/hush/hush3/commit/8c8b6e88f0c076c86c713e7e22e2d826202cc64d
* Better error message: https://git.hush.is/hush/hush3/commit/f64c10baa9ae6940f434f6ff6750b299c1da548e, https://git.hush.is/hush/hush3/commit/f71f8124c3ffb8df6d83f6fd00201cb11aa0f239
* Improve `hush_scanner` and seed node contrib file: https://git.hush.is/hush/hush3/commit/16dd3aef74ac312bc8953af34a3d9a297b03d9f4
* Remove unused Makefile: https://git.hush.is/hush/hush3/issues/291
* Add script for scanning DragonX nodes: https://git.hush.is/hush/hush3/commit/0679468f609215a0958a95edc70643108ee6530a
* Add Fedora install process: https://git.hush.is/hush/hush3/pulls/384
* Add Arch install process: https://git.hush.is/hush/hush3/pulls/393
* More details about p2p encryption: https://git.hush.is/hush/hush3/commit/ccc86839b9774934882fec4cbf3428003cf75fd5, https://git.hush.is/hush/hush3/commit/a358acab0b1a589cebc45846ab54f7fa751c4820, https://git.hush.is/hush/hush3/commit/4ed576a7e256abb46e15d8f3606dc30ac276d461
* Fix boost download link: https://git.hush.is/hush/hush3/commit/323d2134a1fcc119a4da82f9fc37e912b67e58c6
* Remove unused code
# Hush 3.10.1 "Oneiric Octopus"
This is an OPTIONAL but RECOMMENDED release for Hush full nodes. It fixes an important bug
that affects new Hush nodes. It also makes syncing faster for both Hushd and DragonX nodes.
```
26 files changed, 257 insertions(+), 429 deletions(-)
```
* Fix the bug which causes "payment to wrong pubkey" error when syncing a new node
* Faster syncing of Hush and DragonX full nodes
* Slightly less memory usage in each Equihash/RandomX mining thread
* Fixed compiling issues related to RandomX v1.2.1
* Improved RPC docs for `getblocktemplate`
* Removed the `getdeprecationinfo` RPC
# Hush 3.10.0 "Sassy Siphonophore"
```
132 files changed, 6387 insertions(+), 2084 deletions(-)
```
This is a MANDATORY release for Hush and *ALL* nodes must upgrade by block height 1605555, which will happen
on approximately Dec 16th 2023. YOU MUST UPGRADE YOUR HUSH FULL NODE TO THIS RELEASE BY DEC 15th 2023.
If you do not, your node will not work correctly and will require a fresh sync to fix.
This is an OPTIONAL release for DragonX but it is highly recommended for miners and exchanges
to update to this release.
* Hush and all Hush Smart Chains now use less RAM https://git.hush.is/hush/hush3/issues/283
* Hush full nodes will use ~2GB less RAM
* DragonX full nodes will use ~30MB less RAM
* Antispam defenses
* Hush and all Hush Smart Chains now make it harder and more expensive for an attacker to send shielded spam. This raises the cost in CPU https://git.hush.is/hush/hush3/commit/14d3ae17851615a69c33cb7eed623b904b140e3d and transaction fees https://git.hush.is/hush/hush3/commit/2308db22eec78d0a10bde0f674243b2700d59e4a for Denial-of-Service attacks.
* New RPC `z_getstats` which reports data about numer of shielded inputs (zins) and shielded outputs (zouts) in transactions. https://git.hush.is/hush/hush3/commit/96ae2d61ca5a392cb476da4c7f6ab1f638839a7f
* Fix a bug where `hush-cli stop` would not stop the node during the "Building Witnesses" rescan phase https://git.hush.is/hush/hush3/issues/330
* Fix bugs where `abortrescan` couldn't be used when node is start up (RPC warmup) and where it could not abort the rescan if it was in the "Building Witnesses" phase https://git.hush.is/hush/hush3/issues/331
* Fix bug in `z_mergetoaddress` where docs said you could use `ANY_ZADDR` but you couldn't https://git.hush.is/hush/hush3/commit/7eb9d75b94469c3fc8c028f29b35be9ac764a10c
* RPC `z_listunspent` now returns the text representation of a memo in `memoStr` key
* Upgraded curl to 8.4.0 https://git.hush.is/hush/hush3/issues/325
* This fixes CVE-2023-38545 which affects very few or potentially no Hush/DragonX users. It could only affect people who compile Hush full node software (not those who use binaries or packages) and who use a malicious SOCKS5 proxy for all network traffic via the operating system.
* New documentation about using CJDNS with Hush: https://git.hush.is/hush/hush3/src/branch/dev/doc/cjdns.md
* Decentralized Devtax for improved scalability and operational security. This is a consensus change.
* DragonX specific changes:
* Updated to latest RandomX v1.2.1 which includes mining optimizations https://git.hush.is/hush/hush3/commit/6029b3d571009991ae9c4aea0397f4d00be6a817 https://git.hush.is/hush/hush3/issues/337
* Fix RandomX mining memory leak and crash https://git.hush.is/hush/hush3/issues/324
* This fixes the bug where stopping mining, making a transaction and then starting mining again
* This also avoids an out-of-memory crash when miners change the number of threads of mining
* Fixing this bug lead to a 10% hashrate increase vs the previous release
* Fixed quoting bugs with dragonx-cli script
* For instance, many RPCs such as `dragonx z_sendmany ...` would not previously work because the arguments to the RPC were not quoted correctly.
# Hush 3.9.4 "Maniacal Manticore"
```
68 files changed, 1304 insertions(+), 1343 deletions(-)
```
This is an OPTIONAL release. It is recommended for exchanges, solo miners and mining pools to update to this release.
* New features and improvements
* Hush and DragonX nodes will now sync much faster
* DragonX now has checkpoints for faster better chain security
* Updated to the latest RandomX code
* Rate limiting for the processing of incoming addr messages for increased security.
* Removed unused function CWalletTx::GetRequestCount
* Removed mapRequest tracking that only affects Qt display.
* Randomized message processing peer order for increased privacy.
* Removed BIP35 mempool p2p message for increased privacy.
* Additional community seed node
* Build Improvements
* Use custom jobs param when compiling boost for faster compile times
* Now builds with gcc13 thanks to testing from jahway
* We have an aarch64 deb now thanks to jahway
* Bug fixes:
* -stratumallowip works with CIDR and netmask ranges again for solo miners
* Detect missing autoreconf in build.sh
* Various assertions removed from BIP155 changes in previous release.
# Hush 3.9.3 "Lateral Larvacean"

View File

@ -16,7 +16,6 @@ configure Tor.
## How to see information about your Tor configuration via Hush
There are several ways to see your local onion address in Hush:
- in the "Local addresses" output of CLI `-netinfo`
- in the "localaddresses" output of RPC `getnetworkinfo`
- in the debug log (grep for "AddLocal"; the Tor address ends in `.onion`)
@ -27,9 +26,6 @@ CLI `-addrinfo` returns the number of addresses known to your node per
network. This can be useful to see how many onion peers your node knows,
e.g. for `-onlynet=onion`.
To fetch a number of onion addresses that your node knows, for example seven
addresses, use the `getnodeaddresses 7 onion` RPC.
## 1. Run Hush behind a Tor proxy
The first step is running Hush behind a Tor proxy. This will already anonymize all

View File

@ -1,43 +0,0 @@
#!/usr/usr/bin/env bash
# Copyright (c) 2016-2023 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

View File

@ -1,4 +1,5 @@
# Copyright (c) 2016-2023 The Hush developers
#!/usr/bin/env python2
# 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
import binascii

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2023 The Hush developers
# Copyright (c) 2016-2024 The Hush developers
# Copyright (c) 2017 The Zcash developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2023 The Hush developers
# Copyright (c) 2016-2024 The Hush developers
# Execute all of the automated tests related to Hush
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2023 The Hush developers
# 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
# Execute all of the automated tests related to Hush

View File

@ -1,85 +0,0 @@
#!/usr/bin/env bash
set -e -o pipefail
CURDIR=$(cd $(dirname "$0"); pwd)
# Get BUILDDIR and REAL_BITCOIND
. "${CURDIR}/tests-config.sh"
export BITCOINCLI=${BUILDDIR}/qa/pull-tester/run-bitcoin-cli
export BITCOIND=${REAL_BITCOIND}
#Run the tests
# FAUCET test should be permanently first!!!
testScripts=(
'cryptoconditions_faucet.py'
'cryptoconditions_dice.py'
'cryptoconditions_oracles.py'
'cryptoconditions_rewards.py'
'cryptoconditions_token.py'
#'cryptoconditions_gateways.py'
'cryptoconditions_heir.py'
# TODO: cant reconnect nodes back in channels test because of crash (seems regtest only specific)
'cryptoconditions_channels.py'
);
extArg="-extended"
passOn=${@#$extArg}
successCount=0
declare -a failures
function runTestScript
{
local testName="$1"
shift
echo -e "=== Running testscript ${testName} ==="
if eval "$@"
then
successCount=$(expr $successCount + 1)
echo "--- Success: ${testName} ---"
else
failures[${#failures[@]}]="$testName"
echo "!!! FAIL: ${testName} !!!"
fi
echo
}
if [ "x${ENABLE_BITCOIND}${ENABLE_UTILS}${ENABLE_WALLET}" = "x111" ]; then
for (( i = 0; i < ${#testScripts[@]}; i++ ))
do
if [ -z "$1" ] || [ "${1:0:1}" == "-" ] || [ "$1" == "${testScripts[$i]}" ] || [ "$1.py" == "${testScripts[$i]}" ]
then
runTestScript \
"${testScripts[$i]}" \
"${BUILDDIR}/qa/rpc-tests/${testScripts[$i]}" \
--srcdir "${BUILDDIR}/src" ${passOn}
fi
done
for (( i = 0; i < ${#testScriptsExt[@]}; i++ ))
do
if [ "$1" == $extArg ] || [ "$1" == "${testScriptsExt[$i]}" ] || [ "$1.py" == "${testScriptsExt[$i]}" ]
then
runTestScript \
"${testScriptsExt[$i]}" \
"${BUILDDIR}/qa/rpc-tests/${testScriptsExt[$i]}" \
--srcdir "${BUILDDIR}/src" ${passOn}
fi
done
echo -e "\n\nTests completed: $(expr $successCount + ${#failures[@]})"
echo "successes $successCount; failures: ${#failures[@]}"
if [ ${#failures[@]} -gt 0 ]
then
echo -e "\nFailing tests: ${failures[*]}"
exit 1
else
exit 0
fi
else
echo "No rpc tests to run. Wallet, utils, and bitcoind must all be enabled"
fi

View File

@ -1,5 +1,5 @@
#!/usr/bin/env bash
# Copyright (c) 2016-2023 The Hush developers
# Copyright (c) 2016-2024 The Hush developers
# Released under the GPLv3
set -e -o pipefail
@ -14,6 +14,7 @@ export BITCOIND=${REAL_BITCOIND}
#Run the tests
testScripts=(
'antispam.py'
'dpow.py'
'dpowconfs.py'
'ac_private.py'

View File

@ -1,5 +1,5 @@
#!/usr/bin/env bash
# Copyright (c) 2016-2023 The Hush developers
# Copyright (c) 2016-2024 The Hush developers
# Released under the GPLv3
# This is a thin wrapper around bitcoin-cli that strips the Windows-style EOLs

View File

@ -1,7 +1,7 @@
#!/usr/bin/env bash
# THIS FILE IS GENERATED FROM run-bitcoind-for-test.sh.in
# Copyright (c) 2013-2014 The Bitcoin Core developers
# Copyright (c) 2016-2023 The Hush developers
# Copyright (c) 2016-2024 The Hush developers
# Released under the GPLv3
#
HUSH_LOAD_TIMEOUT=500

View File

@ -1,7 +1,7 @@
#!/usr/bin/env bash
# THIS FILE IS GENERATED FROM tests-config.sh.in
# Copyright (c) 2013-2014 The Bitcoin Core developers
# Copyright (c) 2016-2023 The Hush developers
# Copyright (c) 2016-2024 The Hush developers
# Released under the GPLv3
BUILDDIR="@abs_top_builddir@"
@ -11,7 +11,6 @@ EXEEXT="@EXEEXT@"
@ENABLE_WALLET_TRUE@ENABLE_WALLET=1
@BUILD_BITCOIN_UTILS_TRUE@ENABLE_UTILS=1
@BUILD_BITCOIND_TRUE@ENABLE_BITCOIND=1
@ENABLE_PROTON_TRUE@ENABLE_PROTON=1
REAL_BITCOIND="$BUILDDIR/src/hushd${EXEEXT}"
REAL_BITCOINCLI="$BUILDDIR/src/hush-cli${EXEEXT}"

View File

@ -14,8 +14,6 @@ You can run a single test by calling `qa/pull-tester/rpc-tests.sh <testname>`.
Run all possible tests with `qa/pull-tester/rpc-tests.sh -extended`.
Also it's possible to run CryptoConditions tests only by `qa/pull-tester/cc-tests.sh --noshutdown --tracerpc`
Possible options:
```

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2023 The Hush developers
# Copyright (c) 2016-2024 The Hush developers
# Copyright (c) 2018 SuperNET developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python2
# Copyright (c) 2014-2015 The Bitcoin Core developers
# Copyright (c) 2016-2023 The Hush developers
# 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
# Test addressindex generation and fetching

44
qa/rpc-tests/antispam.py Executable file
View File

@ -0,0 +1,44 @@
#!/usr/bin/env python2
# 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
from test_framework.test_framework import BitcoinTestFramework
from test_framework.authproxy import JSONRPCException
from test_framework.util import (
assert_equal,
start_nodes,
wait_and_assert_operationid_status,
)
from decimal import Decimal
class AntispamTest(BitcoinTestFramework):
def setup_nodes(self):
return start_nodes(2, self.options.tmpdir, [[ ]] * 2)
def run_test(self):
# Sanity-check the test harness
assert_equal(self.nodes[0].getblockcount(), 200)
# make sure we can mine a block
self.nodes[1].generate(1)
self.sync_all()
# make a new zaddr on each node
saplingAddr0 = self.nodes[0].z_getnewaddress()
saplingAddr1 = self.nodes[1].z_getnewaddress()
# Verify addresses
assert(saplingAddr0 in self.nodes[0].z_listaddresses())
assert(saplingAddr1 in self.nodes[1].z_listaddresses())
assert_equal(self.nodes[0].z_validateaddress(saplingAddr0)['type'], 'sapling')
assert_equal(self.nodes[0].z_validateaddress(saplingAddr1)['type'], 'sapling')
# Verify balance
assert_equal(self.nodes[0].z_getbalance(saplingAddr0), Decimal('0'))
assert_equal(self.nodes[1].z_getbalance(saplingAddr1), Decimal('0'))
if __name__ == '__main__':
AntispamTest().main()

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2023 The Hush developers
# 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

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2023 The Hush developers
# Copyright (c) 2016-2024 The Hush developers
# Distributed under the GPLv3/X11 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
#

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2023 The Hush developers
# Copyright (c) 2016-2024 The Hush developers
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

View File

@ -1,691 +0,0 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2023 The Hush developers
# Copyright (c) 2018 SuperNET developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
from test_framework.test_framework import BitcoinTestFramework
from test_framework.authproxy import JSONRPCException
from test_framework.util import assert_equal, assert_greater_than, \
initialize_chain_clean, initialize_chain, start_nodes, start_node, connect_nodes_bi, \
stop_nodes, sync_blocks, sync_mempools, wait_bitcoinds, rpc_port, assert_raises
import time
from decimal import Decimal
from random import choice
from string import ascii_uppercase
def assert_success(result):
assert_equal(result['result'], 'success')
def assert_error(result):
assert_equal(result['result'], 'error')
def generate_random_string(length):
random_string = ''.join(choice(ascii_uppercase) for i in range(length))
return random_string
class CryptoConditionsTest (BitcoinTestFramework):
def setup_chain(self):
print("Initializing CC test directory "+self.options.tmpdir)
self.num_nodes = 2
initialize_chain_clean(self.options.tmpdir, self.num_nodes)
def setup_network(self, split = False):
print("Setting up network...")
self.addr = "RWPg8B91kfK5UtUN7z6s6TeV9cHSGtVY8D"
self.pubkey = "02676d00110c2cd14ae24f95969e8598f7ccfaa675498b82654a5b5bd57fc1d8cf"
self.privkey = "UqMgxk7ySPNQ4r9nKAFPjkXy6r5t898yhuNCjSZJLg3RAM4WW1m9"
self.addr1 = "RXEXoa1nRmKhMbuZovpcYwQMsicwzccZBp"
self.pubkey1 = "024026d4ad4ecfc1f705a9b42ca64af6d2ad947509c085534a30b8861d756c6ff0"
self.privkey1 = "UtdydP56pGTFmawHzHr1wDrc4oUwCNW1ttX8Pc3KrvH3MA8P49Wi"
self.nodes = start_nodes(self.num_nodes, self.options.tmpdir,
extra_args=[[
# always give -ac_name as first extra_arg and port as third
'-ac_name=REGTEST',
'-conf='+self.options.tmpdir+'/node0/REGTEST.conf',
'-port=64367',
'-rpcport=64368',
'-regtest',
'-addressindex=1',
'-spentindex=1',
'-ac_supply=5555555',
'-ac_reward=10000000000000',
'-pubkey=' + self.pubkey,
'-ac_cc=2',
'-allowlist=127.0.0.1',
'-debug',
'--daemon',
'-rpcuser=rt',
'-rpcpassword=rt'
],
['-ac_name=REGTEST',
'-conf='+self.options.tmpdir+'/node1/REGTEST.conf',
'-port=64365',
'-rpcport=64366',
'-regtest',
'-addressindex=1',
'-spentindex=1',
'-ac_supply=5555555',
'-ac_reward=10000000000000',
'-pubkey=' + self.pubkey1,
'-ac_cc=2',
'-allowlist=127.0.0.1',
'-debug',
'-addnode=127.0.0.1:64367',
'--daemon',
'-rpcuser=rt',
'-rpcpassword=rt']]
)
self.is_network_split = split
self.rpc = self.nodes[0]
self.rpc1 = self.nodes[1]
self.sync_all()
print("Done setting up network")
def send_and_mine(self, xtn, rpc_connection):
txid = rpc_connection.sendrawtransaction(xtn)
assert txid, 'got txid'
# we need the tx above to be confirmed in the next block
rpc_connection.generate(1)
return txid
def run_faucet_tests(self):
rpc = self.rpc
rpc1 = self.rpc1
# basic sanity tests
result = rpc.getwalletinfo()
assert_greater_than(result['txcount'], 100)
assert_greater_than(result['balance'], 0.0)
balance = result['balance']
faucet = rpc.faucetaddress()
assert_equal(faucet['result'], 'success')
# verify all keys look like valid AC addrs, could be better
for x in ['myCCAddress(Faucet)', 'FaucetCCAddress', 'FaucetCCTokensAddress', 'myaddress', 'FaucetNormalAddress']:
assert_equal(faucet[x][0], 'R')
result = rpc.faucetaddress(self.pubkey)
assert_success(result)
# test that additional CCaddress key is returned
for x in ['myCCAddress(Faucet)', 'FaucetCCAddress', 'FaucetCCTokensAddress', 'myaddress', 'FaucetNormalAddress']:
assert_equal(result[x][0], 'R')
# no funds in the faucet yet
result = rpc.faucetget()
assert_error(result)
result = rpc.faucetinfo()
assert_success(result)
result = rpc.faucetfund("0")
assert_error(result)
result = rpc.faucetfund("-1")
assert_error(result)
# we need at least 1 + txfee to get
result = rpc.faucetfund("2")
assert_success(result)
assert result['hex'], "hex key found"
# broadcast the xtn
result = rpc.sendrawtransaction(result['hex'])
txid = result[0]
assert txid, "found txid"
# we need the tx above to be confirmed in the next block
rpc.generate(1)
self.sync_all()
result = rpc.getwalletinfo()
# minus one block reward
balance2 = result['balance'] - 100000
# make sure our balance is less now
assert_greater_than(balance, balance2)
result = rpc.faucetinfo()
assert_success(result)
assert_greater_than( result['funding'], 0 )
# claiming faucet on second node
faucetgethex = rpc1.faucetget()
assert_success(faucetgethex)
assert faucetgethex['hex'], "hex key found"
balance1 = rpc1.getwalletinfo()['balance']
# try to broadcast the faucetget transaction
result = self.send_and_mine(faucetgethex['hex'], rpc1)
assert txid, "transaction broadcasted"
balance2 = rpc1.getwalletinfo()['balance']
assert_greater_than(balance2, balance1)
self.sync_all()
def run_dice_tests(self):
rpc = self.nodes[0]
rpc1 = self.nodes[1]
self.sync_all()
# have to generate few blocks on second node to be able to place bets
rpc1.generate(10)
result = rpc1.getbalance()
assert_greater_than(result, 100000)
dice = rpc.diceaddress()
assert_equal(dice['result'], 'success')
for x in ['myCCAddress(Dice)', 'DiceCCAddress', 'DiceCCTokensAddress', 'myaddress', 'DiceNormalAddress']:
assert_equal(dice[x][0], 'R')
dice = rpc.diceaddress(self.pubkey)
assert_equal(dice['result'], 'success')
for x in ['myCCAddress(Dice)', 'DiceCCAddress', 'DiceCCTokensAddress', 'myaddress', 'DiceNormalAddress']:
assert_equal(dice[x][0], 'R')
# no dice created yet
result = rpc.dicelist()
assert_equal(result, [])
# creating dice plan with too long name (>8 chars)
result = rpc.dicefund("THISISTOOLONG", "10000", "10", "10000", "10", "5")
assert_error(result)
# creating dice plan with < 100 funding
result = rpc.dicefund("LUCKY","10","1","10000","10","5")
assert_error(result)
# creating dice plan with 0 blocks timeout
result = rpc.dicefund("LUCKY","10","1","10000","10","0")
assert_error(result)
# creating dice plan
dicefundtx = rpc.dicefund("LUCKY","1000","1","800","10","5")
diceid = self.send_and_mine(dicefundtx['hex'], rpc)
# checking if it in plans list now
result = rpc.dicelist()
assert_equal(result[0], diceid)
# set dice name for futher usage
dicename = "LUCKY"
# adding zero funds to plan
result = rpc.diceaddfunds(dicename,diceid,"0")
assert_error(result)
# adding negative funds to plan
result = rpc.diceaddfunds(dicename,diceid,"-1")
assert_error(result)
# adding funds to plan
addfundstx = rpc.diceaddfunds(dicename,diceid,"1100")
result = self.send_and_mine(addfundstx['hex'], rpc)
# checking if funds added to plan
result = rpc.diceinfo(diceid)
assert_equal(result["funding"], "2100.00000000")
# not valid dice info checking
result = rpc.diceinfo("invalid")
assert_error(result)
# placing 0 amount bet
result = rpc1.dicebet(dicename,diceid,"0","2")
assert_error(result)
# placing negative amount bet
result = rpc1.dicebet(dicename,diceid,"-1","2")
assert_error(result)
# placing bet more than maxbet
result = rpc1.dicebet(dicename,diceid,"900","2")
assert_error(result)
# placing bet with amount more than funding
result = rpc1.dicebet(dicename,diceid,"3000","2")
assert_error(result)
# placing bet with potential won more than funding
result = rpc1.dicebet(dicename,diceid,"750","9")
assert_error(result)
# placing 0 odds bet
result = rpc1.dicebet(dicename,diceid,"1","0")
assert_error(result)
# placing negative odds bet
result = rpc1.dicebet(dicename,diceid,"1","-1")
assert_error(result)
# placing bet with odds more than allowed
result = rpc1.dicebet(dicename,diceid,"1","11")
assert_error(result)
# placing bet with not correct dice name
result = rpc1.dicebet("nope",diceid,"100","2")
assert_error(result)
# placing bet with not correct dice id
result = rpc1.dicebet(dicename,self.pubkey,"100","2")
assert_error(result)
# have to make some entropy for the next test
entropytx = 0
fundingsum = 1
while entropytx < 110:
fundingsuminput = str(fundingsum)
fundinghex = rpc.diceaddfunds(dicename,diceid,fundingsuminput)
result = self.send_and_mine(fundinghex['hex'], rpc)
entropytx = entropytx + 1
fundingsum = fundingsum + 1
rpc.generate(2)
self.sync_all()
# valid bet placing
placebet = rpc1.dicebet(dicename,diceid,"100","2")
betid = self.send_and_mine(placebet["hex"], rpc1)
assert result, "bet placed"
# check bet status
result = rpc1.dicestatus(dicename,diceid,betid)
assert_success(result)
# note initial dice funding state at this point.
# TODO: track player balance somehow (hard to do because of mining and fees)
diceinfo = rpc.diceinfo(diceid)
funding = float(diceinfo['funding'])
# # placing same amount bets with amount 1 and odds 1:3, checking if balance changed correct
# losscounter = 0
# wincounter = 0
# betcounter = 0
#
# while (betcounter < 10):
# placebet = rpc1.dicebet(dicename,diceid,"1","2")
# betid = self.send_and_mine(placebet["hex"], rpc1)
# time.sleep(3)
# self.sync_all()
# finish = rpc.dicefinish(dicename,diceid,betid)
# self.send_and_mine(finish["hex"], rpc1)
# self.sync_all()
# time.sleep(3)
# betresult = rpc1.dicestatus(dicename,diceid,betid)
# betcounter = betcounter + 1
# if betresult["status"] == "loss":
# losscounter = losscounter + 1
# elif betresult["status"] == "win":
# wincounter = wincounter + 1
# else:
# pass
#
# # funding balance should increase if player loss, decrease if player won
# fundbalanceguess = funding + losscounter - wincounter * 2
# fundinfoactual = rpc.diceinfo(diceid)
# assert_equal(round(fundbalanceguess),round(float(fundinfoactual['funding'])))
def run_token_tests(self):
rpc = self.nodes[0]
result = rpc.tokenaddress()
assert_success(result)
for x in ['myCCAddress(Tokens)', 'TokensNormalAddress', 'TokensNormalAddress', 'myaddress','TokensCCAddress']:
assert_equal(result[x][0], 'R')
result = rpc.tokenaddress(self.pubkey)
assert_success(result)
for x in ['myCCAddress(Tokens)', 'TokensNormalAddress', 'TokensNormalAddress', 'myaddress','TokensCCAddress']:
assert_equal(result[x][0], 'R')
# there are no tokens created yet
result = rpc.tokenlist()
assert_equal(result, [])
# trying to create token with negaive supply
result = rpc.tokencreate("NUKE", "-1987420", "no bueno supply")
assert_error(result)
# creating token with name more than 32 chars
result = rpc.tokencreate("NUKE123456789012345678901234567890", "1987420", "name too long")
assert_error(result)
# creating valid token
result = rpc.tokencreate("DUKE", "1987.420", "Duke's custom token")
assert_success(result)
tokenid = self.send_and_mine(result['hex'], rpc)
result = rpc.tokenlist()
assert_equal(result[0], tokenid)
# get token balance for token with pubkey
result = rpc.tokenbalance(tokenid, self.pubkey)
assert_success(result)
assert_equal(result['balance'], 198742000000)
assert_equal(result['tokenid'], tokenid)
# get token balance for token without pubkey
result = rpc.tokenbalance(tokenid)
assert_success(result)
assert_equal(result['balance'], 198742000000)
assert_equal(result['tokenid'], tokenid)
# this is not a valid assetid
result = rpc.tokeninfo(self.pubkey)
assert_error(result)
# check tokeninfo for valid token
result = rpc.tokeninfo(tokenid)
assert_success(result)
assert_equal(result['tokenid'], tokenid)
assert_equal(result['owner'], self.pubkey)
assert_equal(result['name'], "DUKE")
assert_equal(result['supply'], 198742000000)
assert_equal(result['description'], "Duke's custom token")
# invalid numtokens ask
result = rpc.tokenask("-1", tokenid, "1")
assert_error(result)
# invalid numtokens ask
result = rpc.tokenask("0", tokenid, "1")
assert_error(result)
# invalid price ask
result = rpc.tokenask("1", tokenid, "-1")
assert_error(result)
# invalid price ask
result = rpc.tokenask("1", tokenid, "0")
assert_error(result)
# invalid tokenid ask
result = rpc.tokenask("100", "deadbeef", "1")
assert_error(result)
# valid ask
tokenask = rpc.tokenask("100", tokenid, "7.77")
tokenaskhex = tokenask['hex']
tokenaskid = self.send_and_mine(tokenask['hex'], rpc)
result = rpc.tokenorders(tokenid)
order = result[0]
assert order, "found order"
# invalid ask fillunits
result = rpc.tokenfillask(tokenid, tokenaskid, "0")
assert_error(result)
# invalid ask fillunits
result = rpc.tokenfillask(tokenid, tokenaskid, "-777")
assert_error(result)
# valid ask fillunits
fillask = rpc.tokenfillask(tokenid, tokenaskid, "777")
result = self.send_and_mine(fillask['hex'], rpc)
txid = result[0]
assert txid, "found txid"
# should be no token orders
result = rpc.tokenorders(tokenid)
assert_equal(result, [])
# checking ask cancellation
testorder = rpc.tokenask("100", tokenid, "7.77")
testorderid = self.send_and_mine(testorder['hex'], rpc)
cancel = rpc.tokencancelask(tokenid, testorderid)
self.send_and_mine(cancel["hex"], rpc)
result = rpc.tokenorders(tokenid)
assert_equal(result, [])
# invalid numtokens bid
result = rpc.tokenbid("-1", tokenid, "1")
assert_error(result)
# invalid numtokens bid
result = rpc.tokenbid("0", tokenid, "1")
assert_error(result)
# invalid price bid
result = rpc.tokenbid("1", tokenid, "-1")
assert_error(result)
# invalid price bid
result = rpc.tokenbid("1", tokenid, "0")
assert_error(result)
# invalid tokenid bid
result = rpc.tokenbid("100", "deadbeef", "1")
assert_error(result)
tokenbid = rpc.tokenbid("100", tokenid, "10")
tokenbidhex = tokenbid['hex']
tokenbidid = self.send_and_mine(tokenbid['hex'], rpc)
result = rpc.tokenorders(tokenid)
order = result[0]
assert order, "found order"
# invalid bid fillunits
result = rpc.tokenfillbid(tokenid, tokenbidid, "0")
assert_error(result)
# invalid bid fillunits
result = rpc.tokenfillbid(tokenid, tokenbidid, "-777")
assert_error(result)
# valid bid fillunits
fillbid = rpc.tokenfillbid(tokenid, tokenbidid, "1000")
result = self.send_and_mine(fillbid['hex'], rpc)
txid = result[0]
assert txid, "found txid"
# should be no token orders
result = rpc.tokenorders(tokenid)
assert_equal(result, [])
# checking bid cancellation
testorder = rpc.tokenbid("100", tokenid, "7.77")
testorderid = self.send_and_mine(testorder['hex'], rpc)
cancel = rpc.tokencancelbid(tokenid, testorderid)
self.send_and_mine(cancel["hex"], rpc)
result = rpc.tokenorders(tokenid)
assert_equal(result, [])
# invalid token transfer amount (have to add status to CC code!)
randompubkey = "021a559101e355c907d9c553671044d619769a6e71d624f68bfec7d0afa6bd6a96"
result = rpc.tokentransfer(tokenid,randompubkey,"0")
assert_error(result)
# invalid token transfer amount (have to add status to CC code!)
result = rpc.tokentransfer(tokenid,randompubkey,"-1")
assert_error(result)
# valid token transfer
sendtokens = rpc.tokentransfer(tokenid,randompubkey,"1")
self.send_and_mine(sendtokens["hex"], rpc)
result = rpc.tokenbalance(tokenid,randompubkey)
assert_equal(result["balance"], 1)
def run_rewards_tests(self):
rpc = self.nodes[0]
result = rpc.rewardsaddress()
for x in ['myCCAddress(Rewards)', 'myaddress', 'RewardsCCAddress', 'RewardsCCTokensAddress', 'RewardsNormalAddress']:
assert_equal(result[x][0], 'R')
result = rpc.rewardsaddress(self.pubkey)
for x in ['myCCAddress(Rewards)', 'myaddress', 'RewardsCCAddress', 'RewardsCCTokensAddress', 'RewardsNormalAddress']:
assert_equal(result[x][0], 'R')
# no rewards yet
result = rpc.rewardslist()
assert_equal(result, [])
# looking up non-existent reward should return error
result = rpc.rewardsinfo("none")
assert_error(result)
# creating rewards plan with name > 8 chars, should return error
result = rpc.rewardscreatefunding("STUFFSTUFF", "7777", "25", "0", "10", "10")
assert_error(result)
# creating rewards plan with 0 funding
result = rpc.rewardscreatefunding("STUFF", "0", "25", "0", "10", "10")
assert_error(result)
# creating rewards plan with 0 maxdays
result = rpc.rewardscreatefunding("STUFF", "7777", "25", "0", "10", "0")
assert_error(result)
# creating rewards plan with > 25% APR
result = rpc.rewardscreatefunding("STUFF", "7777", "30", "0", "10", "10")
assert_error(result)
# creating valid rewards plan
result = rpc.rewardscreatefunding("STUFF", "7777", "25", "0", "10", "10")
assert result['hex'], 'got raw xtn'
fundingtxid = rpc.sendrawtransaction(result['hex'])
assert fundingtxid, 'got txid'
# confirm the above xtn
rpc.generate(1)
result = rpc.rewardsinfo(fundingtxid)
assert_success(result)
assert_equal(result['name'], 'STUFF')
assert_equal(result['APR'], "25.00000000")
assert_equal(result['minseconds'], 0)
assert_equal(result['maxseconds'], 864000)
assert_equal(result['funding'], "7777.00000000")
assert_equal(result['mindeposit'], "10.00000000")
assert_equal(result['fundingtxid'], fundingtxid)
# checking if new plan in rewardslist
result = rpc.rewardslist()
assert_equal(result[0], fundingtxid)
# creating reward plan with already existing name, should return error
result = rpc.rewardscreatefunding("STUFF", "7777", "25", "0", "10", "10")
assert_error(result)
# add funding amount must be positive
result = rpc.rewardsaddfunding("STUFF", fundingtxid, "-1")
assert_error(result)
# add funding amount must be positive
result = rpc.rewardsaddfunding("STUFF", fundingtxid, "0")
assert_error(result)
# adding valid funding
result = rpc.rewardsaddfunding("STUFF", fundingtxid, "555")
addfundingtxid = self.send_and_mine(result['hex'], rpc)
assert addfundingtxid, 'got funding txid'
# checking if funding added to rewardsplan
result = rpc.rewardsinfo(fundingtxid)
assert_equal(result['funding'], "8332.00000000")
# trying to lock funds, locking funds amount must be positive
result = rpc.rewardslock("STUFF", fundingtxid, "-5")
assert_error(result)
# trying to lock funds, locking funds amount must be positive
result = rpc.rewardslock("STUFF", fundingtxid, "0")
assert_error(result)
# trying to lock less than the min amount is an error
result = rpc.rewardslock("STUFF", fundingtxid, "7")
assert_error(result)
# locking funds in rewards plan
result = rpc.rewardslock("STUFF", fundingtxid, "10")
assert_success(result)
locktxid = result['hex']
assert locktxid, "got lock txid"
# locktxid has not been broadcast yet
result = rpc.rewardsunlock("STUFF", fundingtxid, locktxid)
assert_error(result)
# broadcast xtn
txid = rpc.sendrawtransaction(locktxid)
assert txid, 'got txid from sendrawtransaction'
# confirm the xtn above
rpc.generate(1)
# will not unlock since reward amount is less than tx fee
result = rpc.rewardsunlock("STUFF", fundingtxid, locktxid)
assert_error(result)
def run_oracles_tests(self):
rpc = self.nodes[0]
rpc1 = self.nodes[1]
result = rpc1.oraclesaddress()
result = rpc.oraclesaddress()
assert_success(result)
for x in ['OraclesCCAddress', 'OraclesNormalAddress', 'myCCAddress(Oracles)','OraclesCCTokensAddress', 'myaddress']:
assert_equal(result[x][0], 'R')
result = rpc.oraclesaddress(self.pubkey)
assert_success(result)
for x in ['OraclesCCAddress', 'OraclesNormalAddress', 'myCCAddress(Oracles)','OraclesCCTokensAddress', 'myaddress']:
assert_equal(result[x][0], 'R')
# there are no oracles created yet
result = rpc.oracleslist()
assert_equal(result, [])
# looking up non-existent oracle should return error.
result = rpc.oraclesinfo("none")
assert_error(result)
# attempt to create oracle with not valid data type should return error
result = rpc.oraclescreate("Test", "Test", "Test")
assert_error(result)
# attempt to create oracle with description > 32 symbols should return error
too_long_name = generate_random_string(33)
result = rpc.oraclescreate(too_long_name, "Test", "s")
# attempt to create oracle with description > 4096 symbols should return error
too_long_description = generate_random_string(4100)
result = rpc.oraclescreate("Test", too_long_description, "s")
assert_error(result)
# # valid creating oracles of different types
# # using such naming to re-use it for data publishing / reading (e.g. oracle_s for s type)
# valid_formats = ["s", "S", "d", "D", "c", "C", "t", "T", "i", "I", "l", "L", "h", "Ihh"]
# for f in valid_formats:
# result = rpc.oraclescreate("Test", "Test", f)
# assert_success(result)
# globals()["oracle_{}".format(f)] = self.send_and_mine(result['hex'], rpc)
def run_test (self):
print("Mining blocks...")
rpc = self.nodes[0]
rpc1 = self.nodes[1]
# utxos from block 1 become mature in block 101
rpc.generate(101)
self.sync_all()
rpc.getinfo()
rpc1.getinfo()
# this corresponds to -pubkey above
print("Importing privkeys")
rpc.importprivkey(self.privkey)
rpc1.importprivkey(self.privkey1)
self.run_faucet_tests()
self.sync_all()
self.run_rewards_tests()
self.sync_all()
self.run_dice_tests()
self.sync_all()
self.run_token_tests()
self.sync_all()
self.run_oracles_tests()
if __name__ == '__main__':
CryptoConditionsTest ().main()

View File

@ -1,261 +0,0 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2023 The Hush developers
# Copyright (c) 2018 SuperNET developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
import time
from test_framework.test_framework import CryptoconditionsTestFramework
from test_framework.authproxy import JSONRPCException
from test_framework.util import assert_equal, assert_greater_than, \
initialize_chain_clean, initialize_chain, start_nodes, start_node, connect_nodes_bi, \
stop_nodes, sync_blocks, sync_mempools, wait_bitcoinds, rpc_port, assert_raises
from cryptoconditions import assert_success, assert_error, generate_random_string
class CryptoconditionsChannelsTest(CryptoconditionsTestFramework):
def run_channels_tests(self):
"""!!! for testing needed test daemon which built with custom flag
export CONFIGURE_FLAGS='CPPFLAGS=-DTESTMODE'
since in usual mode 101 confirmations are needed for payment/refund
"""
rpc = self.nodes[0]
rpc1 = self.nodes[1]
# checking channelsaddress call
result = rpc.channelsaddress(self.pubkey)
assert_success(result)
# test that additional CCaddress key is returned
for x in result.keys():
if x.find('ddress') > 0:
assert_equal(result[x][0], 'R')
# getting empty channels list
result = rpc.channelslist()
assert_equal(len(result), 2)
assert_equal(result["result"], "success")
assert_equal(result["name"], "Channels List")
# 10 payments, 100000 sat denomination channel opening with second node pubkey
new_channel_hex = rpc.channelsopen(self.pubkey1, "10", "100000")
assert_success(new_channel_hex)
channel_txid = self.send_and_mine(new_channel_hex["hex"], rpc)
assert channel_txid, "got channel txid"
# checking if our new channel in common channels list
result = rpc.channelslist()
assert_equal(len(result), 3)
# checking info about channel directly
result = rpc.channelsinfo(channel_txid)
assert_success(result)
assert_equal(result["Transactions"][0]["Open"], channel_txid)
# open transaction should be confirmed
rpc.generate(1)
# trying to make wrong denomination channel payment
result = rpc.channelspayment(channel_txid, "199000")
assert_error(result)
# trying to make 0 channel payment
result = rpc.channelspayment(channel_txid, "0")
assert_error(result)
# trying to make negative channel payment
result = rpc.channelspayment(channel_txid, "-1")
assert_error(result)
# valid channel payment
result = rpc.channelspayment(channel_txid, "100000")
assert_success(result)
payment_tx_id = self.send_and_mine(result["hex"], rpc)
assert payment_tx_id, "got txid"
# now in channelinfo payment information should appear
result = rpc.channelsinfo(channel_txid)
assert_equal(result["Transactions"][1]["Payment"], payment_tx_id)
# number of payments should be equal 1 (one denomination used)
result = rpc.channelsinfo(channel_txid)["Transactions"][1]["Number of payments"]
assert_equal(result, 1)
# payments left param should reduce 1 and be equal 9 now ( 10 - 1 = 9 )
result = rpc.channelsinfo(channel_txid)["Transactions"][1]["Payments left"]
assert_equal(result, 9)
# lets try payment with x2 amount to ensure that counters works correct
result = rpc.channelspayment(channel_txid, "200000")
assert_success(result)
payment_tx_id = self.send_and_mine(result["hex"], rpc)
assert payment_tx_id, "got txid"
result = rpc.channelsinfo(channel_txid)
assert_equal(result["Transactions"][2]["Payment"], payment_tx_id)
result = rpc.channelsinfo(channel_txid)["Transactions"][2]["Number of payments"]
assert_equal(result, 2)
result = rpc.channelsinfo(channel_txid)["Transactions"][2]["Payments left"]
assert_equal(result, 7)
# check if payment value really transferred
raw_transaction = rpc.getrawtransaction(payment_tx_id, 1)
result = raw_transaction["vout"][3]["valueSat"]
assert_equal(result, 200000)
result = rpc1.validateaddress(raw_transaction["vout"][3]["scriptPubKey"]["addresses"][0])["ismine"]
assert_equal(result, True)
# have to check that second node have coins to cover txfee at least
rpc.sendtoaddress(rpc1.getnewaddress(), 1)
rpc.sendtoaddress(rpc1.getnewaddress(), 1)
rpc.generate(2)
self.sync_all()
result = rpc1.getbalance()
assert_greater_than(result, 0.1)
# trying to initiate channels payment from node B without any secret
# TODO: have to add RPC validation
payment_hex = rpc1.channelspayment(channel_txid, "100000")
try:
result = rpc1.sendrawtransaction(payment_hex["hex"])
except Exception as e:
pass
# trying to initiate channels payment from node B with secret from previous payment
result = rpc1.channelspayment(channel_txid, "100000", rpc1.channelsinfo(channel_txid)["Transactions"][1]["Secret"])
#result = rpc1.sendrawtransaction(payment_hex["hex"])
assert_error(result)
# executing channel close
result = rpc.channelsclose(channel_txid)
assert_success(result)
channel_close_txid = self.send_and_mine(result["hex"], rpc)
assert channel_close_txid, "got txid"
rpc.generate(2)
self.sync_all()
# now in channelinfo closed flag should appear
result = rpc.channelsinfo(channel_txid)
assert_equal(result["Transactions"][3]["Close"], channel_close_txid)
# executing channel refund
result = rpc.channelsrefund(channel_txid, channel_close_txid)
assert_success(result)
refund_txid = self.send_and_mine(result["hex"], rpc)
assert refund_txid, "got txid"
# checking if it refunded to opener address
raw_transaction = rpc.getrawtransaction(refund_txid, 1)
result = raw_transaction["vout"][2]["valueSat"]
assert_equal(result, 700000)
result = rpc.validateaddress(raw_transaction["vout"][2]["scriptPubKey"]["addresses"][0])["ismine"]
assert_equal(result, True)
# creating and draining channel (10 payment by 100000 satoshies in total to fit full capacity)
new_channel_hex1 = rpc.channelsopen(self.pubkey1, "10", "100000")
assert_success(new_channel_hex1)
channel1_txid = self.send_and_mine(new_channel_hex1["hex"], rpc)
assert channel1_txid, "got channel txid"
# need to have 2+ confirmations in the test mode
rpc.generate(2)
self.sync_all()
for i in range(10):
result = rpc.channelspayment(channel1_txid, "100000")
assert_success(result)
payment_tx_id = self.send_and_mine(result["hex"], rpc)
assert payment_tx_id, "got txid"
# last payment should indicate that 0 payments left
result = rpc.channelsinfo(channel1_txid)["Transactions"][10]["Payments left"]
assert_equal(result, 0)
# no more payments possible
result = rpc.channelspayment(channel1_txid, "100000")
assert_error(result)
# creating new channel to test the case when node B initiate payment when node A revealed secret in offline
# 10 payments, 100000 sat denomination channel opening with second node pubkey
new_channel_hex2 = rpc.channelsopen(self.pubkey1, "10", "100000")
assert_success(new_channel_hex)
channel2_txid = self.send_and_mine(new_channel_hex2["hex"], rpc)
assert channel2_txid, "got channel txid"
rpc.generate(2)
self.sync_all()
# disconnecting first node from network
rpc.setban("127.0.0.0/24","add")
assert_equal(rpc.getinfo()["connections"], 0)
assert_equal(rpc1.getinfo()["connections"], 0)
rpc1.generate(1)
# sending one payment to mempool to reveal the secret but not mine it
payment_hex = rpc.channelspayment(channel2_txid, "100000")
result = rpc.sendrawtransaction(payment_hex["hex"])
assert result, "got payment txid"
secret = rpc.channelsinfo(channel2_txid)["Transactions"][1]["Secret"]
assert secret, "Secret revealed"
# secret shouldn't be available for node B
secret_not_revealed = None
try:
rpc1.channelsinfo(channel2_txid)["Transactions"][1]["Secret"]
except Exception:
secret_not_revealed = True
assert_equal(secret_not_revealed, True)
# trying to initiate payment from second node with revealed secret
assert_equal(rpc1.getinfo()["connections"], 0)
dc_payment_hex = rpc1.channelspayment(channel2_txid, "100000", secret)
assert_success(dc_payment_hex)
result = rpc1.sendrawtransaction(dc_payment_hex["hex"])
assert result, "got channelspayment transaction id"
# TODO: it crash first node after block generating on mempools merging
# # restoring connection between nodes
# rpc.setban("127.0.0.0/24","remove")
# #rpc.generate(1)
# #rpc1.generate(1)
# sync_blocks(self.nodes)
# rpc.generate(1)
# sync_blocks(self.nodes)
# sync_mempools(self.nodes)
# assert_equal(rpc.getinfo()["connections"], 1)
# assert_equal(rpc1.getinfo()["connections"], 1)
def run_test(self):
print("Mining blocks...")
rpc = self.nodes[0]
rpc1 = self.nodes[1]
# utxos from block 1 become mature in block 101
if not self.options.noshutdown:
rpc.generate(101)
self.sync_all()
rpc.getinfo()
rpc1.getinfo()
# this corresponds to -pubkey above
print("Importing privkeys")
rpc.importprivkey(self.privkey)
rpc1.importprivkey(self.privkey1)
self.run_channels_tests()
if __name__ == '__main__':
CryptoconditionsChannelsTest().main()

View File

@ -1,204 +0,0 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2023 The Hush developers
# Copyright (c) 2018 SuperNET developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
from test_framework.test_framework import CryptoconditionsTestFramework
from test_framework.authproxy import JSONRPCException
from test_framework.util import assert_equal, assert_greater_than, \
initialize_chain_clean, initialize_chain, start_nodes, start_node, connect_nodes_bi, \
stop_nodes, sync_blocks, sync_mempools, wait_bitcoinds, rpc_port, assert_raises
from cryptoconditions import assert_success, assert_error, generate_random_string
class CryptoconditionsDiceTest(CryptoconditionsTestFramework):
def run_dice_tests(self):
rpc = self.nodes[0]
rpc1 = self.nodes[1]
self.sync_all()
# have to generate few blocks on second node to be able to place bets
rpc1.generate(10)
result = rpc1.getbalance()
assert_greater_than(result, 100000)
result = rpc.diceaddress()
assert_equal(result['result'], 'success')
for x in result.keys():
if x.find('ddress') > 0:
assert_equal(result[x][0], 'R')
result = rpc.diceaddress(self.pubkey)
for x in result.keys():
print(x+": "+str(result[x]))
assert_equal(result['result'], 'success')
for x in result.keys():
if x.find('ddress') > 0:
assert_equal(result[x][0], 'R')
# no dice created yet
result = rpc.dicelist()
assert_equal(result, [])
# creating dice plan with too long name (>8 chars)
result = rpc.dicefund("THISISTOOLONG", "10000", "10", "10000", "10", "5")
assert_error(result)
# creating dice plan with < 100 funding
result = rpc.dicefund("LUCKY","10","1","10000","10","5")
assert_error(result)
# creating dice plan with 0 blocks timeout
result = rpc.dicefund("LUCKY","10","1","10000","10","0")
assert_error(result)
# creating dice plan
dicefundtx = rpc.dicefund("LUCKY","1000","1","800","10","5")
diceid = self.send_and_mine(dicefundtx['hex'], rpc)
# checking if it in plans list now
result = rpc.dicelist()
assert_equal(result[0], diceid)
# set dice name for futher usage
dicename = "LUCKY"
# adding zero funds to plan
result = rpc.diceaddfunds(dicename,diceid,"0")
assert_error(result)
# adding negative funds to plan
result = rpc.diceaddfunds(dicename,diceid,"-1")
assert_error(result)
# adding funds to plan
addfundstx = rpc.diceaddfunds(dicename,diceid,"1100")
result = self.send_and_mine(addfundstx['hex'], rpc)
# checking if funds added to plan
result = rpc.diceinfo(diceid)
assert_equal(result["funding"], "2100.00000000")
# not valid dice info checking
result = rpc.diceinfo("invalid")
assert_error(result)
# placing 0 amount bet
result = rpc1.dicebet(dicename,diceid,"0","2")
assert_error(result)
# placing negative amount bet
result = rpc1.dicebet(dicename,diceid,"-1","2")
assert_error(result)
# placing bet more than maxbet
result = rpc1.dicebet(dicename,diceid,"900","2")
assert_error(result)
# placing bet with amount more than funding
result = rpc1.dicebet(dicename,diceid,"3000","2")
assert_error(result)
# placing bet with potential won more than funding
result = rpc1.dicebet(dicename,diceid,"750","9")
assert_error(result)
# placing 0 odds bet
result = rpc1.dicebet(dicename,diceid,"1","0")
assert_error(result)
# placing negative odds bet
result = rpc1.dicebet(dicename,diceid,"1","-1")
assert_error(result)
# placing bet with odds more than allowed
result = rpc1.dicebet(dicename,diceid,"1","11")
assert_error(result)
# placing bet with not correct dice name
result = rpc1.dicebet("nope",diceid,"100","2")
assert_error(result)
# placing bet with not correct dice id
result = rpc1.dicebet(dicename,self.pubkey,"100","2")
assert_error(result)
# have to make some entropy for the next test
entropytx = 0
fundingsum = 1
while entropytx < 110:
fundingsuminput = str(fundingsum)
fundinghex = rpc.diceaddfunds(dicename,diceid,fundingsuminput)
result = self.send_and_mine(fundinghex['hex'], rpc)
entropytx = entropytx + 1
fundingsum = fundingsum + 1
rpc.generate(2)
self.sync_all()
# valid bet placing
placebet = rpc1.dicebet(dicename,diceid,"100","2")
betid = self.send_and_mine(placebet["hex"], rpc1)
assert result, "bet placed"
# check bet status
result = rpc1.dicestatus(dicename,diceid,betid)
assert_success(result)
# note initial dice funding state at this point.
# TODO: track player balance somehow (hard to do because of mining and fees)
diceinfo = rpc.diceinfo(diceid)
funding = float(diceinfo['funding'])
# # placing same amount bets with amount 1 and odds 1:3, checking if balance changed correct
# losscounter = 0
# wincounter = 0
# betcounter = 0
#
# while (betcounter < 10):
# placebet = rpc1.dicebet(dicename,diceid,"1","2")
# betid = self.send_and_mine(placebet["hex"], rpc1)
# time.sleep(3)
# self.sync_all()
# finish = rpc.dicefinish(dicename,diceid,betid)
# self.send_and_mine(finish["hex"], rpc1)
# self.sync_all()
# time.sleep(3)
# betresult = rpc1.dicestatus(dicename,diceid,betid)
# betcounter = betcounter + 1
# if betresult["status"] == "loss":
# losscounter = losscounter + 1
# elif betresult["status"] == "win":
# wincounter = wincounter + 1
# else:
# pass
#
# # funding balance should increase if player loss, decrease if player won
# fundbalanceguess = funding + losscounter - wincounter * 2
# fundinfoactual = rpc.diceinfo(diceid)
# assert_equal(round(fundbalanceguess),round(float(fundinfoactual['funding'])))
def run_test(self):
print("Mining blocks...")
rpc = self.nodes[0]
rpc1 = self.nodes[1]
# utxos from block 1 become mature in block 101
if not self.options.noshutdown:
rpc.generate(101)
self.sync_all()
rpc.getinfo()
rpc1.getinfo()
# this corresponds to -pubkey above
print("Importing privkeys")
rpc.importprivkey(self.privkey)
rpc1.importprivkey(self.privkey1)
self.run_dice_tests()
if __name__ == '__main__':
CryptoconditionsDiceTest ().main()

View File

@ -1,116 +0,0 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2023 The Hush developers
# Copyright (c) 2018 SuperNET developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
from test_framework.test_framework import CryptoconditionsTestFramework
from test_framework.authproxy import JSONRPCException
from test_framework.util import assert_equal, assert_greater_than, \
initialize_chain_clean, initialize_chain, start_nodes, start_node, connect_nodes_bi, \
stop_nodes, sync_blocks, sync_mempools, wait_bitcoinds, rpc_port, assert_raises
from cryptoconditions import assert_success, assert_error, generate_random_string
class CryptoconditionsFaucetTest(CryptoconditionsTestFramework):
def run_faucet_tests(self):
rpc = self.rpc
rpc1 = self.rpc1
# basic sanity tests
result = rpc.getwalletinfo()
assert_greater_than(result['txcount'], 100)
assert_greater_than(result['balance'], 0.0)
balance = result['balance']
result = rpc.faucetaddress()
assert_equal(result['result'], 'success')
# verify all keys look like valid AC addrs, could be better
for x in result.keys():
if x.find('ddress') > 0:
assert_equal(result[x][0], 'R')
result = rpc.faucetaddress(self.pubkey)
assert_success(result)
for x in result.keys():
print(x+": "+str(result[x]))
# test that additional CCaddress key is returned
for x in result.keys():
if x.find('ddress') > 0:
assert_equal(result[x][0], 'R')
# no funds in the faucet yet
result = rpc.faucetget()
assert_error(result)
result = rpc.faucetinfo()
assert_success(result)
result = rpc.faucetfund("0")
assert_error(result)
result = rpc.faucetfund("-1")
assert_error(result)
# we need at least 1 + txfee to get
result = rpc.faucetfund("2")
assert_success(result)
assert result['hex'], "hex key found"
# broadcast the xtn
result = rpc.sendrawtransaction(result['hex'])
txid = result[0]
assert txid, "found txid"
# we need the tx above to be confirmed in the next block
rpc.generate(1)
self.sync_all()
result = rpc.getwalletinfo()
# minus one block reward
balance2 = result['balance'] - 100000
# make sure our balance is less now
assert_greater_than(balance, balance2)
result = rpc.faucetinfo()
assert_success(result)
assert_greater_than( result['funding'], 0 )
# claiming faucet on second node
faucetgethex = rpc1.faucetget()
assert_success(faucetgethex)
assert faucetgethex['hex'], "hex key found"
balance1 = rpc1.getwalletinfo()['balance']
# try to broadcast the faucetget transaction
result = self.send_and_mine(faucetgethex['hex'], rpc1)
assert txid, "transaction broadcasted"
balance2 = rpc1.getwalletinfo()['balance']
assert_greater_than(balance2, balance1)
self.sync_all()
def run_test(self):
print("Mining blocks...")
rpc = self.nodes[0]
rpc1 = self.nodes[1]
# utxos from block 1 become mature in block 101
rpc.generate(101)
self.sync_all()
rpc.getinfo()
rpc1.getinfo()
# this corresponds to -pubkey above
print("Importing privkeys")
rpc.importprivkey(self.privkey)
rpc1.importprivkey(self.privkey1)
self.run_faucet_tests()
if __name__ == '__main__':
CryptoconditionsFaucetTest ().main()

View File

@ -1,97 +0,0 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2023 The Hush developers
# Copyright (c) 2018 SuperNET developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
from test_framework.test_framework import CryptoconditionsTestFramework
from test_framework.authproxy import JSONRPCException
from test_framework.util import assert_equal, assert_greater_than, \
initialize_chain_clean, initialize_chain, start_nodes, start_node, connect_nodes_bi, \
stop_nodes, sync_blocks, sync_mempools, wait_bitcoinds, rpc_port, assert_raises
from cryptoconditions import assert_success, assert_error, generate_random_string
class CryptoconditionsGatewaysTest(CryptoconditionsTestFramework):
def run_gateways_tests(self):
rpc = self.nodes[0]
rpc1 = self.nodes[1]
result = rpc.gatewaysaddress()
assert_success(result)
for x in result.keys():
if x.find('ddress') > 0:
assert_equal(result[x][0], 'R')
assert_equal("03ea9c062b9652d8eff34879b504eda0717895d27597aaeb60347d65eed96ccb40", result["GatewaysPubkey"])
# getting an empty gateways list
result = rpc.gatewayslist()
assert_equal(result, [])
# Gateways binding preparation
# creating oracle
oracle_hex = rpc.oraclescreate("Test", "Testing", "Ihh")
assert_success(oracle_hex)
oracle_txid = self.send_and_mine(oracle_hex["hex"], rpc)
assert oracle_txid, "got txid"
# registering as an oracle publisher
reg_hex = rpc.oraclesregister(oracle_txid, "10000")
assert_success(reg_hex)
reg_txid = self.send_and_mine(reg_hex["hex"], rpc)
assert reg_txid, "got txid"
# subscribing on oracle
sub_hex = rpc.oraclessubscribe(oracle_txid, self.pubkey, "1")
assert_success(sub_hex)
sub_txid = self.send_and_mine(sub_hex["hex"], rpc)
assert sub_txid, "got txid"
# creating token
token_hex = rpc.tokencreate("Test", "1", "Testing")
assert_success(token_hex)
token_txid = self.send_and_mine(token_hex["hex"], rpc)
assert token_txid, "got txid"
# converting tokens
convertion_hex = rpc.tokenconvert("241",token_txid,"03ea9c062b9652d8eff34879b504eda0717895d27597aaeb60347d65eed96ccb40","100000000")
assert_success(convertion_hex)
convertion_txid = self.send_and_mine(convertion_hex["hex"], rpc)
assert convertion_txid, "got txid"
# binding gateway
bind_hex = rpc.gatewaysbind(token_txid, oracle_txid, "KMD", "100000000", "1", "1", self.pubkey)
assert_success(bind_hex)
bind_txid = self.send_and_mine(bind_hex["hex"], rpc)
assert bind_txid, "got txid"
# checking if created gateway in list
result = rpc.gatewayslist()
assert_equal(result[0], bind_txid)
def run_test(self):
print("Mining blocks...")
rpc = self.nodes[0]
rpc1 = self.nodes[1]
# utxos from block 1 become mature in block 101
if not self.options.noshutdown:
rpc.generate(101)
self.sync_all()
rpc.getinfo()
rpc1.getinfo()
# this corresponds to -pubkey above
print("Importing privkeys")
rpc.importprivkey(self.privkey)
rpc1.importprivkey(self.privkey1)
self.run_gateways_tests()
if __name__ == '__main__':
CryptoconditionsGatewaysTest().main()

View File

@ -1,177 +0,0 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2023 The Hush developers
# Copyright (c) 2018 SuperNET developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
import time
from test_framework.test_framework import CryptoconditionsTestFramework
from test_framework.authproxy import JSONRPCException
from test_framework.util import assert_equal, assert_greater_than, \
initialize_chain_clean, initialize_chain, start_nodes, start_node, connect_nodes_bi, \
stop_nodes, sync_blocks, sync_mempools, wait_bitcoinds, rpc_port, assert_raises
from cryptoconditions import assert_success, assert_error, generate_random_string
class CryptoconditionsHeirTest(CryptoconditionsTestFramework):
def run_heir_tests(self):
rpc = self.nodes[0]
rpc1 = self.nodes[1]
result = rpc.heiraddress('')
assert_success(result)
# verify all keys look like valid AC addrs, could be better
for x in result.keys():
if x.find('ddress') > 0:
assert_equal(result[x][0], 'R')
result = rpc.heiraddress(self.pubkey)
assert_success(result)
# test that additional CCaddress key is returned
for x in result.keys():
if x.find('ddress') > 0:
assert_equal(result[x][0], 'R')
# getting empty heir list
result = rpc.heirlist()
assert_equal(result, [])
# valid heirfund case with coins
result = rpc.heirfund("0", "1000", "UNITHEIR", self.pubkey1, "10", "TESTMEMO")
assert_success(result)
heir_fund_txid = self.send_and_mine(result["hex"], rpc)
assert heir_fund_txid, "got heir funding txid"
# heir fund txid should be in heirlist now
result = rpc.heirlist()
assert_equal(result, [heir_fund_txid])
# checking heirinfo
result = rpc.heirinfo(heir_fund_txid)
assert_success(result)
assert_equal(result["fundingtxid"], heir_fund_txid)
assert_equal(result["name"], "UNITHEIR")
assert_equal(result["owner"], self.pubkey)
assert_equal(result["heir"], self.pubkey1)
assert_equal(result["memo"], "TESTMEMO")
assert_equal(result["lifetime"], "1000.00000000")
assert_equal(result["type"], "coins")
assert_equal(result["InactivityTimeSetting"], "10")
assert_equal(result["InactivityTime"], "0")
assert_equal(result["IsHeirSpendingAllowed"], "false")
# waiting for 11 seconds to be sure that needed time passed for heir claiming
time.sleep(11)
rpc.generate(1)
self.sync_all()
result = rpc.heirinfo(heir_fund_txid)
assert_equal(result["lifetime"], "1000.00000000")
assert_equal(result["IsHeirSpendingAllowed"], "true")
# have to check that second node have coins to cover txfee at least
rpc.sendtoaddress(rpc1.getnewaddress(), 1)
rpc.sendtoaddress(rpc1.getnewaddress(), 1)
rpc.generate(2)
self.sync_all()
second_node_balance = rpc1.getbalance()
assert_greater_than(second_node_balance, 0.1)
# let's claim whole heir sum from second node
result = rpc1.heirclaim("0", "1000", heir_fund_txid)
assert_success(result)
heir_claim_txid = self.send_and_mine(result["hex"], rpc1)
assert heir_claim_txid, "got claim txid"
# balance of second node after heirclaim should increase for 1000 coins - txfees
# + get one block reward when broadcasted heir_claim_txid
result = round(rpc1.getbalance()) - round(second_node_balance)
assert_greater_than(result, 100999)
self.sync_all()
# no more funds should be available for claiming
result = rpc.heirinfo(heir_fund_txid)
assert_equal(result["lifetime"], "1000.00000000")
assert_equal(result["available"], "0.00000000")
# creating tokens which we put to heir contract
token_hex = rpc.tokencreate("TEST", "1", "TESTING")
token_txid = self.send_and_mine(token_hex["hex"], rpc)
assert token_txid, "got token txid"
# checking possesion over the tokens and balance
result = rpc.tokenbalance(token_txid, self.pubkey)["balance"]
assert_equal(result, 100000000)
# valid heir case with tokens
token_heir_hex = rpc.heirfund("0", "100000000", "UNITHEIR", self.pubkey1, "10", "TESTMEMO", token_txid)
token_heir_txid = self.send_and_mine(token_heir_hex["hex"], rpc)
assert token_heir_txid, "got txid of heirfund with tokens"
self.sync_all()
# checking heirinfo
result = rpc.heirinfo(token_heir_txid)
assert_success(result)
assert_equal(result["fundingtxid"], token_heir_txid)
assert_equal(result["name"], "UNITHEIR")
assert_equal(result["owner"], self.pubkey)
assert_equal(result["heir"], self.pubkey1)
assert_equal(result["lifetime"], "100000000")
assert_equal(result["type"], "tokens")
assert_equal(result["InactivityTimeSetting"], "10")
assert_equal(result["InactivityTime"], "0")
assert_equal(result["IsHeirSpendingAllowed"], "false")
# waiting for 11 seconds to be sure that needed time passed for heir claiming
time.sleep(11)
rpc.generate(1)
self.sync_all()
result = rpc.heirinfo(token_heir_txid)
assert_equal(result["lifetime"], "100000000")
assert_equal(result["IsHeirSpendingAllowed"], "true")
# let's claim whole heir sum from second node
result = rpc1.heirclaim("0", "100000000", token_heir_txid)
assert_success(result)
heir_tokens_claim_txid = self.send_and_mine(result["hex"], rpc1)
assert heir_tokens_claim_txid, "got claim txid"
# claiming node should have correct token balance now
result = rpc1.tokenbalance(token_txid, self.pubkey1)["balance"]
assert_equal(result, 100000000)
self.sync_all()
# no more funds should be available for claiming
result = rpc.heirinfo(token_heir_txid)
assert_equal(result["lifetime"], "100000000")
assert_equal(result["available"], "0")
def run_test(self):
print("Mining blocks...")
rpc = self.nodes[0]
rpc1 = self.nodes[1]
# utxos from block 1 become mature in block 101
if not self.options.noshutdown:
rpc.generate(101)
self.sync_all()
rpc.getinfo()
rpc1.getinfo()
# this corresponds to -pubkey above
print("Importing privkeys")
rpc.importprivkey(self.privkey)
rpc1.importprivkey(self.privkey1)
self.run_heir_tests()
if __name__ == '__main__':
CryptoconditionsHeirTest().main()

View File

@ -1,265 +0,0 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2023 The Hush developers
# Copyright (c) 2018 SuperNET developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
from test_framework.test_framework import CryptoconditionsTestFramework
from test_framework.authproxy import JSONRPCException
from test_framework.util import assert_equal, assert_greater_than, \
initialize_chain_clean, initialize_chain, start_nodes, start_node, connect_nodes_bi, \
stop_nodes, sync_blocks, sync_mempools, wait_bitcoinds, rpc_port, assert_raises
from cryptoconditions import assert_success, assert_error, generate_random_string
class CryptoconditionsOraclesTest(CryptoconditionsTestFramework):
def run_oracles_tests(self):
rpc = self.nodes[0]
rpc1 = self.nodes[1]
result = rpc1.oraclesaddress()
result = rpc.oraclesaddress()
assert_success(result)
for x in result.keys():
if x.find('ddress') > 0:
assert_equal(result[x][0], 'R')
result = rpc.oraclesaddress(self.pubkey)
assert_success(result)
for x in result.keys():
if x.find('ddress') > 0:
assert_equal(result[x][0], 'R')
# there are no oracles created yet
result = rpc.oracleslist()
assert_equal(result, [])
# looking up non-existent oracle should return error.
result = rpc.oraclesinfo("none")
assert_error(result)
# attempt to create oracle with not valid data type should return error
result = rpc.oraclescreate("Test", "Test", "Test")
assert_error(result)
# attempt to create oracle with description > 32 symbols should return error
too_long_name = generate_random_string(33)
result = rpc.oraclescreate(too_long_name, "Test", "s")
# attempt to create oracle with description > 4096 symbols should return error
too_long_description = generate_random_string(4100)
result = rpc.oraclescreate("Test", too_long_description, "s")
assert_error(result)
# need uxtos to create oracle? Crashes if without generate
rpc.generate(2)
# valid creating oracles of different types
# using such naming to re-use it for data publishing / reading (e.g. oracle_s for s type)
valid_formats = ["s", "S", "d", "D", "c", "C", "t", "T", "i", "I", "l", "L", "h", "Ihh"]
for f in valid_formats:
result = rpc.oraclescreate("Test_"+f, "Test_"+f, f)
assert_success(result)
globals()["oracle_{}".format(f)] = self.send_and_mine(result['hex'], rpc)
# trying to register with negative datafee
result = rpc.oraclesregister(globals()["oracle_{}".format(f)], "-100")
assert_error(result)
# trying to register with zero datafee
result = rpc.oraclesregister(globals()["oracle_{}".format(f)], "0")
assert_error(result)
# trying to register with datafee less than txfee
result = rpc.oraclesregister(globals()["oracle_{}".format(f)], "500")
assert_error(result)
# trying to register valid (unfunded)
result = rpc.oraclesregister(globals()["oracle_{}".format(f)], "10000")
assert_error(result)
# Fund the oracles
result = rpc.oraclesfund(globals()["oracle_{}".format(f)])
assert_success(result)
fund_txid = self.send_and_mine(result["hex"], rpc)
assert fund_txid, "got txid"
# trying to register valid (funded)
result = rpc.oraclesregister(globals()["oracle_{}".format(f)], "10000")
print(f)
assert_success(result)
register_txid = self.send_and_mine(result["hex"], rpc)
assert register_txid, "got txid"
# TODO: for most of the non valid oraclesregister and oraclessubscribe transactions generating and broadcasting now
# so trying only valid oraclessubscribe atm
result = rpc.oraclessubscribe(globals()["oracle_{}".format(f)], self.pubkey, "1")
assert_success(result)
subscribe_txid = self.send_and_mine(result["hex"], rpc)
assert register_txid, "got txid"
rpc.generate(1)
# now lets publish and read valid data for each oracle type
# s type
result = rpc.oraclesdata(globals()["oracle_{}".format("s")], "05416e746f6e")
assert_success(result)
oraclesdata_s = self.send_and_mine(result["hex"], rpc)
info = rpc.oraclesinfo(globals()["oracle_{}".format("s")])
batonaddr = info['registered'][0]['baton']
result = rpc.oraclessamples(globals()["oracle_{}".format("s")], batonaddr, "1")
assert_equal("[u'Anton']", str(result["samples"][0]['data']), "Data match")
# S type
result = rpc.oraclesdata(globals()["oracle_{}".format("S")], "000161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161")
assert_success(result)
oraclesdata_S = self.send_and_mine(result["hex"], rpc)
info = rpc.oraclesinfo(globals()["oracle_{}".format("S")])
batonaddr = info['registered'][0]['baton']
result = rpc.oraclessamples(globals()["oracle_{}".format("S")], batonaddr, "1")
assert_equal("[u'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa']", str(result["samples"][0]['data']), "Data match")
# d type
result = rpc.oraclesdata(globals()["oracle_{}".format("d")], "0101")
assert_success(result)
# baton
oraclesdata_d = self.send_and_mine(result["hex"], rpc)
info = rpc.oraclesinfo(globals()["oracle_{}".format("d")])
batonaddr = info['registered'][0]['baton']
result = rpc.oraclessamples(globals()["oracle_{}".format("d")], batonaddr, "1")
assert_equal("[u'01']", str(result["samples"][0]['data']), "Data match")
# D type
result = rpc.oraclesdata(globals()["oracle_{}".format("D")], "010001")
assert_success(result)
# baton
oraclesdata_D = self.send_and_mine(result["hex"], rpc)
info = rpc.oraclesinfo(globals()["oracle_{}".format("D")])
batonaddr = info['registered'][0]['baton']
result = rpc.oraclessamples(globals()["oracle_{}".format("D")], batonaddr, "1")
assert_equal("[u'01']", str(result["samples"][0]['data']), "Data match")
# c type
result = rpc.oraclesdata(globals()["oracle_{}".format("c")], "ff")
assert_success(result)
# baton
oraclesdata_c = self.send_and_mine(result["hex"], rpc)
info = rpc.oraclesinfo(globals()["oracle_{}".format("c")])
batonaddr = info['registered'][0]['baton']
result = rpc.oraclessamples(globals()["oracle_{}".format("c")], batonaddr, "1")
assert_equal("[u'-1']", str(result["samples"][0]['data']), "Data match")
# C type
result = rpc.oraclesdata(globals()["oracle_{}".format("C")], "ff")
assert_success(result)
# baton
oraclesdata_C = self.send_and_mine(result["hex"], rpc)
info = rpc.oraclesinfo(globals()["oracle_{}".format("C")])
batonaddr = info['registered'][0]['baton']
result = rpc.oraclessamples(globals()["oracle_{}".format("C")], batonaddr, "1")
assert_equal("[u'255']", str(result["samples"][0]['data']), "Data match")
# t type
result = rpc.oraclesdata(globals()["oracle_{}".format("t")], "ffff")
assert_success(result)
# baton
oraclesdata_t = self.send_and_mine(result["hex"], rpc)
info = rpc.oraclesinfo(globals()["oracle_{}".format("t")])
batonaddr = info['registered'][0]['baton']
result = rpc.oraclessamples(globals()["oracle_{}".format("t")], batonaddr, "1")
assert_equal("[u'-1']", str(result["samples"][0]['data']), "Data match")
# T type
result = rpc.oraclesdata(globals()["oracle_{}".format("T")], "ffff")
assert_success(result)
# baton
oraclesdata_T = self.send_and_mine(result["hex"], rpc)
info = rpc.oraclesinfo(globals()["oracle_{}".format("T")])
batonaddr = info['registered'][0]['baton']
result = rpc.oraclessamples(globals()["oracle_{}".format("T")], batonaddr, "1")
assert_equal("[u'65535']", str(result["samples"][0]['data']), "Data match")
# i type
result = rpc.oraclesdata(globals()["oracle_{}".format("i")], "ffffffff")
assert_success(result)
# baton
oraclesdata_i = self.send_and_mine(result["hex"], rpc)
info = rpc.oraclesinfo(globals()["oracle_{}".format("i")])
batonaddr = info['registered'][0]['baton']
result = rpc.oraclessamples(globals()["oracle_{}".format("i")], batonaddr, "1")
assert_equal("[u'-1']", str(result["samples"][0]['data']), "Data match")
# I type
result = rpc.oraclesdata(globals()["oracle_{}".format("I")], "ffffffff")
assert_success(result)
# baton
oraclesdata_I = self.send_and_mine(result["hex"], rpc)
info = rpc.oraclesinfo(globals()["oracle_{}".format("I")])
batonaddr = info['registered'][0]['baton']
result = rpc.oraclessamples(globals()["oracle_{}".format("I")], batonaddr, "1")
assert_equal("[u'4294967295']", str(result["samples"][0]['data']), "Data match")
# l type
result = rpc.oraclesdata(globals()["oracle_{}".format("l")], "00000000ffffffff")
assert_success(result)
# baton
oraclesdata_l = self.send_and_mine(result["hex"], rpc)
info = rpc.oraclesinfo(globals()["oracle_{}".format("l")])
batonaddr = info['registered'][0]['baton']
result = rpc.oraclessamples(globals()["oracle_{}".format("l")], batonaddr, "1")
assert_equal("[u'-4294967296']", str(result["samples"][0]['data']), "Data match")
# L type
result = rpc.oraclesdata(globals()["oracle_{}".format("L")], "00000000ffffffff")
assert_success(result)
# baton
oraclesdata_L = self.send_and_mine(result["hex"], rpc)
info = rpc.oraclesinfo(globals()["oracle_{}".format("L")])
batonaddr = info['registered'][0]['baton']
result = rpc.oraclessamples(globals()["oracle_{}".format("L")], batonaddr, "1")
assert_equal("[u'18446744069414584320']", str(result["samples"][0]['data']), "Data match")
# h type
result = rpc.oraclesdata(globals()["oracle_{}".format("h")], "00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff")
assert_success(result)
# baton
oraclesdata_h = self.send_and_mine(result["hex"], rpc)
info = rpc.oraclesinfo(globals()["oracle_{}".format("h")])
batonaddr = info['registered'][0]['baton']
result = rpc.oraclessamples(globals()["oracle_{}".format("h")], batonaddr, "1")
assert_equal("[u'ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000']", str(result["samples"][0]['data']), "Data match")
# Ihh type
result = rpc.oraclesdata(globals()["oracle_{}".format("Ihh")], "ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000ffffffff")
assert_success(result)
# baton
oraclesdata_Ihh = self.send_and_mine(result["hex"], rpc)
info = rpc.oraclesinfo(globals()["oracle_{}".format("Ihh")])
batonaddr = info['registered'][0]['baton']
result = rpc.oraclessamples(globals()["oracle_{}".format("Ihh")], batonaddr, "1")
print(result)
assert_equal("[u'4294967295', u'ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000', u'ffffffff00000000ffffffff00000000ffffffff00000000ffffffff00000000']", str(result["samples"][0]['data']), "Data match")
def run_test(self):
print("Mining blocks...")
rpc = self.nodes[0]
rpc1 = self.nodes[1]
# utxos from block 1 become mature in block 101
if not self.options.noshutdown:
rpc.generate(101)
self.sync_all()
rpc.getinfo()
rpc1.getinfo()
# this corresponds to -pubkey above
print("Importing privkeys")
rpc.importprivkey(self.privkey)
rpc1.importprivkey(self.privkey1)
self.run_oracles_tests()
if __name__ == '__main__':
CryptoconditionsOraclesTest().main()

View File

@ -1,149 +0,0 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2023 The Hush developers
# Copyright (c) 2018 SuperNET developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
from test_framework.test_framework import CryptoconditionsTestFramework
from test_framework.authproxy import JSONRPCException
from test_framework.util import assert_equal, assert_greater_than, \
initialize_chain_clean, initialize_chain, start_nodes, start_node, connect_nodes_bi, \
stop_nodes, sync_blocks, sync_mempools, wait_bitcoinds, rpc_port, assert_raises
from cryptoconditions import assert_success, assert_error, generate_random_string
class CryptoconditionsRewardsTest(CryptoconditionsTestFramework):
def run_rewards_tests(self):
rpc = self.nodes[0]
result = rpc.rewardsaddress()
for x in result.keys():
if x.find('ddress') > 0:
assert_equal(result[x][0], 'R')
result = rpc.rewardsaddress(self.pubkey)
for x in result.keys():
if x.find('ddress') > 0:
assert_equal(result[x][0], 'R')
# no rewards yet
result = rpc.rewardslist()
assert_equal(result, [])
# looking up non-existent reward should return error
result = rpc.rewardsinfo("none")
assert_error(result)
# creating rewards plan with name > 8 chars, should return error
result = rpc.rewardscreatefunding("STUFFSTUFF", "7777", "25", "0", "10", "10")
assert_error(result)
# creating rewards plan with 0 funding
result = rpc.rewardscreatefunding("STUFF", "0", "25", "0", "10", "10")
assert_error(result)
# creating rewards plan with 0 maxdays
result = rpc.rewardscreatefunding("STUFF", "7777", "25", "0", "10", "0")
assert_error(result)
# creating rewards plan with > 25% APR
result = rpc.rewardscreatefunding("STUFF", "7777", "30", "0", "10", "10")
assert_error(result)
# creating valid rewards plan
result = rpc.rewardscreatefunding("STUFF", "7777", "25", "0", "10", "10")
assert result['hex'], 'got raw xtn'
fundingtxid = rpc.sendrawtransaction(result['hex'])
assert fundingtxid, 'got txid'
# confirm the above xtn
rpc.generate(1)
result = rpc.rewardsinfo(fundingtxid)
assert_success(result)
assert_equal(result['name'], 'STUFF')
assert_equal(result['APR'], "25.00000000")
assert_equal(result['minseconds'], 0)
assert_equal(result['maxseconds'], 864000)
assert_equal(result['funding'], "7777.00000000")
assert_equal(result['mindeposit'], "10.00000000")
assert_equal(result['fundingtxid'], fundingtxid)
# checking if new plan in rewardslist
result = rpc.rewardslist()
assert_equal(result[0], fundingtxid)
# creating reward plan with already existing name, should return error
result = rpc.rewardscreatefunding("STUFF", "7777", "25", "0", "10", "10")
assert_error(result)
# add funding amount must be positive
result = rpc.rewardsaddfunding("STUFF", fundingtxid, "-1")
assert_error(result)
# add funding amount must be positive
result = rpc.rewardsaddfunding("STUFF", fundingtxid, "0")
assert_error(result)
# adding valid funding
result = rpc.rewardsaddfunding("STUFF", fundingtxid, "555")
addfundingtxid = self.send_and_mine(result['hex'], rpc)
assert addfundingtxid, 'got funding txid'
# checking if funding added to rewardsplan
result = rpc.rewardsinfo(fundingtxid)
assert_equal(result['funding'], "8332.00000000")
# trying to lock funds, locking funds amount must be positive
result = rpc.rewardslock("STUFF", fundingtxid, "-5")
assert_error(result)
# trying to lock funds, locking funds amount must be positive
result = rpc.rewardslock("STUFF", fundingtxid, "0")
assert_error(result)
# trying to lock less than the min amount is an error
result = rpc.rewardslock("STUFF", fundingtxid, "7")
assert_error(result)
# locking funds in rewards plan
result = rpc.rewardslock("STUFF", fundingtxid, "10")
assert_success(result)
locktxid = result['hex']
assert locktxid, "got lock txid"
# locktxid has not been broadcast yet
result = rpc.rewardsunlock("STUFF", fundingtxid, locktxid)
assert_error(result)
# broadcast xtn
txid = rpc.sendrawtransaction(locktxid)
assert txid, 'got txid from sendrawtransaction'
# confirm the xtn above
rpc.generate(1)
# will not unlock since reward amount is less than tx fee
result = rpc.rewardsunlock("STUFF", fundingtxid, locktxid)
assert_error(result)
def run_test(self):
print("Mining blocks...")
rpc = self.nodes[0]
rpc1 = self.nodes[1]
# utxos from block 1 become mature in block 101
if not self.options.noshutdown:
rpc.generate(101)
self.sync_all()
rpc.getinfo()
rpc1.getinfo()
# this corresponds to -pubkey above
print("Importing privkeys")
rpc.importprivkey(self.privkey)
rpc1.importprivkey(self.privkey1)
self.run_rewards_tests()
if __name__ == '__main__':
CryptoconditionsRewardsTest().main()

View File

@ -1,264 +0,0 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2023 The Hush developers
# Copyright (c) 2018 SuperNET developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
from test_framework.test_framework import CryptoconditionsTestFramework
from test_framework.authproxy import JSONRPCException
from test_framework.util import assert_equal, assert_greater_than, \
initialize_chain_clean, initialize_chain, start_nodes, start_node, connect_nodes_bi, \
stop_nodes, sync_blocks, sync_mempools, wait_bitcoinds, rpc_port, assert_raises
from cryptoconditions import assert_success, assert_error, generate_random_string
class CryptoconditionsTokenTest(CryptoconditionsTestFramework):
def run_token_tests(self):
rpc = self.nodes[0]
rpc1 = self.nodes[1]
result = rpc.tokenaddress()
assert_success(result)
for x in result.keys():
if x.find('ddress') > 0:
assert_equal(result[x][0], 'R')
result = rpc.tokenaddress(self.pubkey)
assert_success(result)
for x in result.keys():
if x.find('ddress') > 0:
assert_equal(result[x][0], 'R')
result = rpc.assetsaddress()
assert_success(result)
for x in result.keys():
if x.find('ddress') > 0:
assert_equal(result[x][0], 'R')
result = rpc.assetsaddress(self.pubkey)
assert_success(result)
for x in result.keys():
if x.find('ddress') > 0:
assert_equal(result[x][0], 'R')
# there are no tokens created yet
result = rpc.tokenlist()
assert_equal(result, [])
# trying to create token with negative supply
result = rpc.tokencreate("NUKE", "-1987420", "no bueno supply")
assert_error(result)
# creating token with name more than 32 chars
result = rpc.tokencreate("NUKE123456789012345678901234567890", "1987420", "name too long")
assert_error(result)
# creating valid token
result = rpc.tokencreate("DUKE", "1987.420", "Duke's custom token")
assert_success(result)
tokenid = self.send_and_mine(result['hex'], rpc)
result = rpc.tokenlist()
assert_equal(result[0], tokenid)
# there are no token orders yet
result = rpc.tokenorders(tokenid)
assert_equal(result, [])
# getting token balance for non existing tokenid
result = rpc.tokenbalance(self.pubkey)
assert_error(result)
# get token balance for token with pubkey
result = rpc.tokenbalance(tokenid, self.pubkey)
assert_success(result)
assert_equal(result['balance'], 198742000000)
assert_equal(result['tokenid'], tokenid)
# get token balance for token without pubkey
result = rpc.tokenbalance(tokenid)
assert_success(result)
assert_equal(result['balance'], 198742000000)
assert_equal(result['tokenid'], tokenid)
# this is not a valid assetid
result = rpc.tokeninfo(self.pubkey)
assert_error(result)
# check tokeninfo for valid token
result = rpc.tokeninfo(tokenid)
assert_success(result)
assert_equal(result['tokenid'], tokenid)
assert_equal(result['owner'], self.pubkey)
assert_equal(result['name'], "DUKE")
assert_equal(result['supply'], 198742000000)
assert_equal(result['description'], "Duke's custom token")
# invalid numtokens ask
result = rpc.tokenask("-1", tokenid, "1")
assert_error(result)
# invalid numtokens ask
result = rpc.tokenask("0", tokenid, "1")
assert_error(result)
# invalid price ask
result = rpc.tokenask("1", tokenid, "-1")
assert_error(result)
# invalid price ask
result = rpc.tokenask("1", tokenid, "0")
assert_error(result)
# invalid tokenid ask
result = rpc.tokenask("100", "deadbeef", "1")
assert_error(result)
# valid ask
tokenask = rpc.tokenask("100", tokenid, "7.77")
tokenaskhex = tokenask['hex']
tokenaskid = self.send_and_mine(tokenask['hex'], rpc)
result = rpc.tokenorders(tokenid)
order = result[0]
assert order, "found order"
# invalid ask fillunits
result = rpc.tokenfillask(tokenid, tokenaskid, "0")
assert_error(result)
# invalid ask fillunits
result = rpc.tokenfillask(tokenid, tokenaskid, "-777")
assert_error(result)
# valid ask fillunits
fillask = rpc.tokenfillask(tokenid, tokenaskid, "777")
result = self.send_and_mine(fillask['hex'], rpc)
txid = result[0]
assert txid, "found txid"
# should be no token orders
result = rpc.tokenorders(tokenid)
assert_equal(result, [])
# checking ask cancellation
testorder = rpc.tokenask("100", tokenid, "7.77")
testorderid = self.send_and_mine(testorder['hex'], rpc)
# from other node (ensuring that second node have enough balance to cover txfee
# to get the actual error - not "not enough balance" one
rpc.sendtoaddress(rpc1.getnewaddress(), 1)
rpc.sendtoaddress(rpc1.getnewaddress(), 1)
rpc.generate(2)
self.sync_all()
result = rpc1.getbalance()
assert_greater_than(result, 0.1)
result = rpc1.tokencancelask(tokenid, testorderid)
assert_error(result)
# from valid node
cancel = rpc.tokencancelask(tokenid, testorderid)
self.send_and_mine(cancel["hex"], rpc)
result = rpc.tokenorders(tokenid)
assert_equal(result, [])
# invalid numtokens bid
result = rpc.tokenbid("-1", tokenid, "1")
assert_error(result)
# invalid numtokens bid
result = rpc.tokenbid("0", tokenid, "1")
assert_error(result)
# invalid price bid
result = rpc.tokenbid("1", tokenid, "-1")
assert_error(result)
# invalid price bid
result = rpc.tokenbid("1", tokenid, "0")
assert_error(result)
# invalid tokenid bid
result = rpc.tokenbid("100", "deadbeef", "1")
assert_error(result)
tokenbid = rpc.tokenbid("100", tokenid, "10")
tokenbidhex = tokenbid['hex']
tokenbidid = self.send_and_mine(tokenbid['hex'], rpc)
result = rpc.tokenorders(tokenid)
order = result[0]
assert order, "found order"
# invalid bid fillunits
result = rpc.tokenfillbid(tokenid, tokenbidid, "0")
assert_error(result)
# invalid bid fillunits
result = rpc.tokenfillbid(tokenid, tokenbidid, "-777")
assert_error(result)
# valid bid fillunits
fillbid = rpc.tokenfillbid(tokenid, tokenbidid, "1000")
result = self.send_and_mine(fillbid['hex'], rpc)
txid = result[0]
assert txid, "found txid"
# should be no token orders
result = rpc.tokenorders(tokenid)
assert_equal(result, [])
# checking bid cancellation
testorder = rpc.tokenbid("100", tokenid, "7.77")
testorderid = self.send_and_mine(testorder['hex'], rpc)
# from other node
result = rpc1.getbalance()
assert_greater_than(result, 0.1)
result = rpc1.tokencancelbid(tokenid, testorderid)
assert_error(result)
# from valid node
cancel = rpc.tokencancelbid(tokenid, testorderid)
self.send_and_mine(cancel["hex"], rpc)
result = rpc.tokenorders(tokenid)
assert_equal(result, [])
# invalid token transfer amount (have to add status to CC code!)
randompubkey = "021a559101e355c907d9c553671044d619769a6e71d624f68bfec7d0afa6bd6a96"
result = rpc.tokentransfer(tokenid,randompubkey,"0")
assert_error(result)
# invalid token transfer amount (have to add status to CC code!)
result = rpc.tokentransfer(tokenid,randompubkey,"-1")
assert_error(result)
# valid token transfer
sendtokens = rpc.tokentransfer(tokenid,randompubkey,"1")
self.send_and_mine(sendtokens["hex"], rpc)
result = rpc.tokenbalance(tokenid,randompubkey)
assert_equal(result["balance"], 1)
def run_test(self):
print("Mining blocks...")
rpc = self.nodes[0]
rpc1 = self.nodes[1]
# utxos from block 1 become mature in block 101
if not self.options.noshutdown:
rpc.generate(101)
self.sync_all()
rpc.getinfo()
rpc1.getinfo()
# this corresponds to -pubkey above
print("Importing privkeys")
rpc.importprivkey(self.privkey)
rpc1.importprivkey(self.privkey1)
self.run_token_tests()
if __name__ == '__main__':
CryptoconditionsTokenTest().main()

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python2
# Copyright (c) 2016-2023 The Hush developers
# Copyright (c) 2016-2024 The Hush developers
# Copyright (c) 2015 The Bitcoin Core developers
# Distributed under the GPLv3 software license, see the accompanying
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html

Some files were not shown because too many files have changed in this diff Show More