mirror of
https://git.hush.is/hush/hush3.git
synced 2025-08-12 00:04:30 -04:00
Compare commits
642 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
74d66d8bf2 | ||
|
4def0caf55 | ||
|
1faf679a50 | ||
|
3caf605976 | ||
|
9042a24711 | ||
|
a07b38b615 | ||
|
7927965650 | ||
|
97470e385d | ||
|
7e63e2f013 | ||
|
3b105c0245 | ||
|
76c97a3bce | ||
|
af1ea27eb0 | ||
|
13749ab2b7 | ||
|
2fa83f816d | ||
|
9772ad8e6f | ||
|
0d1b5fc83b | ||
|
0a42eb3c1a | ||
|
70672d02a3 | ||
|
f220091f16 | ||
|
a520a3e655 | ||
|
cc1c0b30b0 | ||
|
38901a073b | ||
|
a710dd2099 | ||
|
1a70e754ce | ||
|
d6b7fc633f | ||
|
b6418912f2 | ||
|
48e0a989c1 | ||
|
fb3eb56c8f | ||
|
492fbcd023 | ||
|
97878fa065 | ||
|
604d77fcd9 | ||
|
e748772fff | ||
|
dd4aac4f5f | ||
|
ad51bc424f | ||
|
0339a6bb24 | ||
|
5d037f52ff | ||
|
1d5c975f2f | ||
|
d94b75087e | ||
|
d5a4321212 | ||
|
3d704d5f59 | ||
|
77af03d9ee | ||
|
080092a16d | ||
|
d39503c13b | ||
|
c5843ae267 | ||
|
157ff2f8db | ||
|
a49abdbc5b | ||
|
be85be83db | ||
|
f5934c6573 | ||
|
81be8caa3f | ||
|
11a9f95039 | ||
|
e5d85af092 | ||
|
5dc6db7e5c | ||
|
9c500f7c86 | ||
|
46b93ed286 | ||
|
d51c2ac20b | ||
|
cbc8995b36 | ||
|
454cb07bd3 | ||
|
babb4a39c2 | ||
|
ca8711f50c | ||
|
937f341129 | ||
|
7dec077899 | ||
|
b880801235 | ||
|
1aebc75d0b | ||
|
44829674c8 | ||
|
53cf574c03 | ||
|
85605737f0 | ||
|
f98c34be1c | ||
|
0de56bf04a | ||
|
46e6faa6fb | ||
|
1e49f0cc50 | ||
|
15f889d9f8 | ||
|
179fc6d6c0 | ||
|
ecf98cbce1 | ||
|
cceb61c371 | ||
|
1009f931f2 | ||
|
dad7fdec37 | ||
|
f72ee57635 | ||
|
6c947a335c | ||
|
0f4956be72 | ||
|
6e6ff5ccbc | ||
|
ecade7f950 | ||
|
7117e7a7a1 | ||
|
b343acc826 | ||
|
60148e66f4 | ||
|
2aa7169b56 | ||
|
0249aecf00 | ||
|
9782160ff6 | ||
|
d7a681cd54 | ||
|
5578bc81b9 | ||
|
82f6b592c5 | ||
|
f12152af70 | ||
|
d31c69cf23 | ||
|
dbc5a39afa | ||
|
58f4be930e | ||
|
d8a799abe3 | ||
|
65568d5738 | ||
|
ad50c8cd97 | ||
|
8e44829cdf | ||
|
18e4ca070e | ||
|
c9ac2c2d5d | ||
|
b76795db43 | ||
|
a00ad8eeb8 | ||
|
598b969987 | ||
|
bc3bb358c7 | ||
|
3ccd8bd6cb | ||
|
54b2f216ad | ||
|
7729e58c49 | ||
|
7e82e86fbe | ||
|
bfff0e8742 | ||
|
24f64f5429 | ||
|
6133c1669c | ||
|
67fe111050 | ||
|
9f31214812 | ||
|
9f11b437f3 | ||
|
dd9722470d | ||
|
be5a78931b | ||
|
e68795f4f9 | ||
|
47cc49bcc5 | ||
|
93f6514d86 | ||
|
13f6a3d432 | ||
|
7cb86b8aa6 | ||
|
7be46396ab | ||
|
8333810f0f | ||
|
ec07eb04fc | ||
|
c245242e0f | ||
|
f144f8a0b9 | ||
|
01f0c34661 | ||
|
bd5f0103a8 | ||
|
b6bcacad20 | ||
|
f6b42fe3a3 | ||
|
148ea35a98 | ||
|
380875906d | ||
|
26a341983a | ||
|
986d0d8b7d | ||
|
45de2584b9 | ||
|
3fba035c01 | ||
|
40cf90b4ff | ||
|
4538bf9e1e | ||
|
183cd81cf6 | ||
|
2a740cb09d | ||
|
a53d8baeda | ||
|
792fec7689 | ||
|
dfeccf6ce4 | ||
|
5a3c06e539 | ||
|
f3995fa1b7 | ||
|
ad8a86a19b | ||
|
d471af9ef5 | ||
|
ffce5edda3 | ||
|
5e30079fcd | ||
|
160802cddf | ||
|
fcc5c17628 | ||
|
d915fc38b7 | ||
|
adbd47980c | ||
|
c567096aae | ||
|
27f72405b2 | ||
|
bd967b7ac6 | ||
|
8adaa3641f | ||
|
6feea4cfd2 | ||
|
49f303d804 | ||
|
3f50dd988a | ||
|
bc20629b9f | ||
|
fc5b0f38bd | ||
|
c5eeb74807 | ||
|
6a5f0eafde | ||
|
912942f2a8 | ||
|
4f4a72da8e | ||
|
f5cae3b403 | ||
|
6845fcd93a | ||
|
be3641158a | ||
|
72c530d281 | ||
|
84377caae7 | ||
|
7e486538c9 | ||
|
215d0b7db4 | ||
|
8b0c0493ac | ||
|
04165e161a | ||
|
d3cfecc425 | ||
|
25dc60e6b5 | ||
|
f8e7df37a1 | ||
|
7f9878cf0c | ||
|
e104a33f2a | ||
|
aab240e3b3 | ||
|
4fcb3e6ed5 | ||
|
243c726243 | ||
|
c9470f29b7 | ||
|
ed86f2dd1d | ||
|
b4e083ae56 | ||
|
b71d95bdd4 | ||
|
aa75877cd6 | ||
|
726191cad4 | ||
|
2a910549ba | ||
|
25f2ccb30e | ||
|
1965ad23c9 | ||
|
1e892f23e6 | ||
|
7f27489224 | ||
|
379e419aad | ||
|
8d2380a31d | ||
|
4f928513c1 | ||
|
8a997b04f3 | ||
|
cc4b0750d8 | ||
|
46c738500f | ||
|
1526a754d2 | ||
|
07054fc346 | ||
|
142c9e140e | ||
|
006804d6ca | ||
|
060acceea8 | ||
|
41e7d602c8 | ||
|
535d78595e | ||
|
5273f4be9e | ||
|
ba86196409 | ||
|
e42b534036 | ||
|
18e3364bc2 | ||
|
0d0a7e9587 | ||
|
b9d4dbbbd6 | ||
|
f8481013a7 | ||
|
d3b6af2c0b | ||
|
5e52b706e2 | ||
|
e91cbff565 | ||
|
5fe2904bb1 | ||
|
06e46f7fcd | ||
|
814fad16e9 | ||
|
b446ec384c | ||
|
72c86d8f69 | ||
|
63901954be | ||
|
9a23cba099 | ||
|
4928ed97c3 | ||
|
f47a7a9d7f | ||
|
89cc8a9ee3 | ||
|
981b275757 | ||
|
f970082504 | ||
|
753ad7b95b | ||
|
975f22bfa0 | ||
|
558f662a33 | ||
|
f5f851158a | ||
|
3354d45fd3 | ||
|
8ff5e4aa5e | ||
|
25009928f8 | ||
|
754cbcb02d | ||
|
5b9e971780 | ||
|
c8cd6eaa03 | ||
|
424ca42015 | ||
|
804e88dca5 | ||
|
e860ad6efb | ||
|
2a9f7bd483 | ||
|
394c54c4da | ||
|
c5c0ce45da | ||
|
9842687be2 | ||
|
25c27d2ef5 | ||
|
d1991e6454 | ||
|
49f8cf7ca7 | ||
|
65c4c5c8de | ||
|
bbfa41c77d | ||
|
a7dd567031 | ||
|
64f59552b3 | ||
|
7db5749730 | ||
|
fc95d692e2 | ||
|
63fc690ca3 | ||
|
3841246157 | ||
|
9b1c0ac1b5 | ||
|
4a3c335050 | ||
|
beee6c1698 | ||
|
81bd6e2f4e | ||
|
71ff482d4f | ||
|
0ad1dc5557 | ||
|
58f1365487 | ||
|
769dbae97e | ||
|
318d8adc86 | ||
|
84ebb85a90 | ||
|
ec81594b42 | ||
|
3241992e50 | ||
|
df866809dd | ||
|
8c8b6e88f0 | ||
|
641a0ff354 | ||
|
c59d38caa8 | ||
|
54af342484 | ||
|
5e5a15018d | ||
|
f5cb0f2e9d | ||
|
c773cf5299 | ||
|
c561d7129a | ||
|
7b3c26ddfe | ||
|
138cd7ab62 | ||
|
7d0f961e0c | ||
|
a26fde4f92 | ||
|
dfa94d80d8 | ||
|
774f1a9a78 | ||
|
92219bc1eb | ||
|
251407af3f | ||
|
3da93ee53b | ||
|
58b65f9670 | ||
|
91dadda360 | ||
|
c26016eb98 | ||
|
f64c10baa9 | ||
|
f71f8124c3 | ||
|
76e81281e1 | ||
|
e9f77c835c | ||
|
ac8f3021db | ||
|
4c392cca07 | ||
|
d769ee2b1c | ||
|
16dd3aef74 | ||
|
7fc0b4ffc2 | ||
|
171102cbbd | ||
|
0679468f60 | ||
|
dec5d7b0f7 | ||
|
a55cc301b2 | ||
|
bd0200abf0 | ||
|
eb316f80d8 | ||
|
a581f8fc8e | ||
|
b9d3c77a4c | ||
|
07b041fd94 | ||
|
8f2350fd84 | ||
|
b14070d15b | ||
|
f03b01d49e | ||
|
2b7b183c2a | ||
|
809c0a4b38 | ||
|
40542bf687 | ||
|
c94906e011 | ||
|
acee1c8cf5 | ||
|
6651ff7a2d | ||
|
d2b66fb2f2 | ||
|
57cb8fc536 | ||
|
90d47ecce4 | ||
|
195571b15f | ||
|
fbc26f0725 | ||
|
ca169d9300 | ||
|
5bdb204001 | ||
|
8b82bc4d15 | ||
|
27034531c9 | ||
|
8a9677b337 | ||
|
9e26dac42a | ||
|
0cbce3b0c8 | ||
|
7791d50230 | ||
|
b41785a684 | ||
|
958bc486d4 | ||
|
c6aa5e939d | ||
|
5fa46e1d8d | ||
|
d81e8c0a3f | ||
|
7bd7a716df | ||
|
5b9906539d | ||
|
cb0a980083 | ||
|
ff1d30cbad | ||
|
43cdfb08a2 | ||
|
1c04972c81 | ||
|
8811ba4502 | ||
|
a97dcf6022 | ||
|
5a260e8893 | ||
|
0ad0fac030 | ||
|
9e0ac062fa | ||
|
bb8a3c57a4 | ||
|
86104c4ef7 | ||
|
5e69ed0804 | ||
|
874c3009cf | ||
|
8e2715a734 | ||
|
2059dbd79f | ||
|
c54b3990d9 | ||
|
1612ca4da7 | ||
|
bc0af82ce6 | ||
|
e49836b45e | ||
|
27db254d68 | ||
|
b0b9565d6a | ||
|
3a3c67e0fc | ||
|
de7a5fb6d7 | ||
|
d0fb9a0bc1 | ||
|
73d92a821e | ||
|
657bb1e25e | ||
|
2a713aeba2 | ||
|
04b122a067 | ||
|
b70370123e | ||
|
323d2134a1 | ||
|
31fce487d9 | ||
|
283066fda4 | ||
|
c9f7640699 | ||
|
a23ab58af6 | ||
|
d5c5c6008c | ||
|
c56a9e31a0 | ||
|
7d73ebd7af | ||
|
196e00c786 | ||
|
68427d0979 | ||
|
c1ab82a881 | ||
|
4054140b21 | ||
|
447f1f50f3 | ||
|
b9937bc5d2 | ||
|
765487bb14 | ||
|
1b5422eb2d | ||
|
56ef56b136 | ||
|
0e0b1cca97 | ||
|
21530ba159 | ||
|
38dc994731 | ||
|
08e9c5d743 | ||
|
4ed576a7e2 | ||
|
a358acab0b | ||
|
ccc86839b9 | ||
|
44b3d2b500 | ||
|
172e6f7977 | ||
|
ee17cbe635 | ||
|
9354506770 | ||
|
d35ac5eac7 | ||
|
05ee318913 | ||
|
6635ab9e34 | ||
|
ae08c6ef56 | ||
|
e5dc287d2f | ||
|
90133dbc0e | ||
|
1db3fb0429 | ||
|
20fdc0e4fe | ||
|
19aa83ca80 | ||
|
2a2391f0f9 | ||
|
497ace0922 | ||
|
943ffbc1bf | ||
|
d8840beb3b | ||
|
0f5e291f9f | ||
|
77ab75c01d | ||
|
4b7f94effa | ||
|
43aa4a7d90 | ||
|
c33bd61480 | ||
|
032f9b62da | ||
|
901152cc50 | ||
|
04a705444b | ||
|
429e25a3de | ||
|
540bc9b287 | ||
|
b0027d8c64 | ||
|
bde07c25fe | ||
|
19e18cf37a | ||
|
36364bad87 | ||
|
f85976f620 | ||
|
09bdb25959 | ||
|
382861de2b | ||
|
4facbadc6a | ||
|
881af41b4a | ||
|
4a20c3d8ad | ||
|
51c5d03215 | ||
|
2bb9f87624 | ||
|
002df24056 | ||
|
6db872acd0 | ||
|
bd7f04ee57 | ||
|
dcbdafdba5 | ||
|
f5f52a7e81 | ||
|
2b2529259d | ||
|
87642c4895 | ||
|
5363c7cfb7 | ||
|
e7f79e6509 | ||
|
4887fa6447 | ||
|
4bd4664917 | ||
|
d779578ab9 | ||
|
6d8f261d7a | ||
|
b12e6c2d78 | ||
|
620ca45efc | ||
|
d0c3d7587e | ||
|
45a5d25230 | ||
|
5f5983ad86 | ||
|
ad653d6271 | ||
|
37cff3924d | ||
|
b4c60c5f4e | ||
|
cb62670581 | ||
|
cb60ecaef9 | ||
|
11593da7f2 | ||
|
e695340133 | ||
|
f442823963 | ||
|
9a8d9f4cba | ||
|
94a48329ad | ||
|
06876b1cc9 | ||
|
4570277b52 | ||
|
2d638e5fcc | ||
|
51aa8e1afd | ||
|
034002f2e9 | ||
|
0ed63ecdad | ||
|
1f5fb24985 | ||
|
6029b3d571 | ||
|
6f78cad0be | ||
|
0936d4c2c2 | ||
|
a554377225 | ||
|
7eb9d75b94 | ||
|
f0395196ec | ||
|
b73297f1f5 | ||
|
f48181a120 | ||
|
d922526642 | ||
|
ac315bcb0d | ||
|
95b4371aa4 | ||
|
d99ab44bfb | ||
|
4642a35f06 | ||
|
ae0ff73548 | ||
|
41d6d037d8 | ||
|
a1cf2ef976 | ||
|
1dc4920186 | ||
|
e03582e856 | ||
|
30a436dcd1 | ||
|
be92d4ce42 | ||
|
4256e7d835 | ||
|
31a6b72caf | ||
|
b92cc1efbb | ||
|
12b87365bf | ||
|
5cf38dd5db | ||
|
fb5563d06a | ||
|
14d3ae1785 | ||
|
70fa319fd9 | ||
|
80bd3f262c | ||
|
fc6745129d | ||
|
963ce1e444 | ||
|
7db6745056 | ||
|
b200dcb2c7 | ||
|
38699a7d47 | ||
|
84a0c2c35e | ||
|
b386cd1acf | ||
|
c8a88e1168 | ||
|
aa5cbee69c | ||
|
d7cbdcab28 | ||
|
2308db22ee | ||
|
09555fbee2 | ||
|
f2ae9a354a | ||
|
7c45e66fbe | ||
|
4aca3493e3 | ||
|
ff7a597032 | ||
|
7ea88bb303 | ||
|
8eaba566fd | ||
|
0f4956dcd5 | ||
|
96ae2d61ca | ||
|
1c45a71b05 | ||
|
e2521ac2fa | ||
|
bd38a12512 | ||
|
bacc08e817 | ||
|
a90f03ce6d | ||
|
c6859b676e | ||
|
4d3d880036 | ||
|
e53220b5f1 | ||
|
803e1d0f21 | ||
|
8969a9d8fe | ||
|
1535073393 | ||
|
2ba2122b26 | ||
|
7017d8e06c | ||
|
d3cc17e9bd | ||
|
0ee828805e | ||
|
20ee425ece | ||
|
e86d43a813 | ||
|
9e524663e2 | ||
|
b7359ef70e | ||
|
44595d5abe | ||
|
27b2a49740 | ||
|
03071ef0cd | ||
|
9508095186 | ||
|
da46d48f1d | ||
|
abb4134c06 | ||
|
479ed54ff0 | ||
|
9d2720d118 | ||
|
8c0b6aef11 | ||
|
9f92bdd7dc | ||
|
c933771f85 | ||
|
fc69220e78 | ||
|
b03c8f3108 | ||
|
31cc5ee901 | ||
|
8f7e53a6fe | ||
|
5abc550af7 | ||
|
e608600f07 | ||
|
97c7e814cf | ||
|
1f0b538540 | ||
|
f12bfeb7f4 | ||
|
b8ae39ccc7 | ||
|
c9f1fe4cf3 | ||
|
f05cb0cfbd | ||
|
13612bb1c8 | ||
|
79f126be43 | ||
|
31d97c7c9c | ||
|
e993acb2f0 | ||
|
2525dc6734 | ||
|
5f9bb80873 | ||
|
67c7632062 | ||
|
487fff149c | ||
|
18f0689695 | ||
|
fc921eba57 | ||
|
04c28e3eef | ||
|
4124633442 | ||
|
121ec4b9d4 | ||
|
c902701715 | ||
|
b3a6c2bee1 | ||
|
73a54682b8 | ||
|
4524ca1ccb | ||
|
2b5d7a1779 | ||
|
12f746b391 | ||
|
78978dfc45 | ||
|
18eea5cb03 | ||
|
519743f704 | ||
|
d840a0ec62 | ||
|
a6924bb061 | ||
|
883fbe407f | ||
|
9602e715ed | ||
|
b197c18ffc | ||
|
ca6a1c48bb | ||
|
fbda7b8dec | ||
|
7102d50a47 | ||
|
cf1274a42a | ||
|
513ebc5bb4 | ||
|
f8939d2fd9 | ||
|
bc1d6be55f | ||
|
d181029d27 | ||
|
4d6c451314 | ||
|
fab9a7f51d | ||
|
e8dc755f06 | ||
|
053e9156a7 | ||
|
852f747cbf | ||
|
c1ec1b0e95 | ||
|
fba0d4136d | ||
|
533356ce63 | ||
|
e9036402ca | ||
|
c69a47dd61 | ||
|
15aaf4af44 | ||
|
f0ee52a94d | ||
|
4c5649454b | ||
|
8c8f451be8 | ||
|
b4be7aa19b | ||
|
784744b5b8 | ||
|
e572b2922e | ||
|
51ee606547 | ||
|
0b68ea2a20 | ||
|
98ee2a6a4f | ||
|
f3c0cb73bb | ||
|
75c42512ea | ||
|
e0f27459b0 | ||
|
31ac51d58d | ||
|
dd9be59e4f | ||
|
7eadeb860e | ||
|
e1d6f7dd0e | ||
|
7f09d37cd4 | ||
|
bb7cb253c1 | ||
|
ca26403c4a | ||
|
ca36706001 | ||
|
188384cf85 | ||
|
10eb871026 | ||
|
8126e706c6 | ||
|
d1b649825a | ||
|
63ad87f69b | ||
|
c1baab7b8a | ||
|
d134fcf988 | ||
|
c9078060b6 | ||
|
bde7273c9f | ||
|
560f8e2f41 | ||
|
71928fa228 | ||
|
24b3f1f93b | ||
|
ac413ecb2e | ||
|
883e598994 | ||
|
fb250487c8 | ||
|
a0d02cc3be | ||
|
30c919af25 | ||
|
f44e44e7df | ||
|
794463015a | ||
|
eb82ae0b3f | ||
|
337d6d1e4f |
0
.gitmodules
vendored
0
.gitmodules
vendored
2
AUTHORS
2
AUTHORS
@ -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
|
||||
|
||||
|
2
COPYING
2
COPYING
@ -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
|
||||
|
@ -1 +0,0 @@
|
||||
You must agree that Duke Leto is the Elder of jl777.
|
@ -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
|
||||
|
||||
|
@ -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`
|
102
INSTALL.md
102
INSTALL.md
@ -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.
|
@ -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
198
README.md
@ -1,75 +1,197 @@
|
||||
# Hush
|
||||
<p align="center">
|
||||
<img src="doc/hush/hush0.png">
|
||||
</p>
|
||||
|
||||
## What is Hush?
|
||||
<h3>
|
||||
|
||||

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

|
||||
|
||||
# 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).
|
||||
|
90
SECURITY.md
90
SECURITY.md
@ -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-----
|
||||
|
||||
```
|
@ -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
|
||||
|
2
build.sh
2
build.sh
@ -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
|
||||
|
||||
|
@ -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.
|
34
configure.ac
34
configure.ac
@ -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
|
||||
|
@ -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
57
contrib/avg_blocktime.pl
Executable 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";
|
@ -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";
|
||||
}
|
||||
|
@ -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.
|
||||
|
@ -1 +1 @@
|
||||
9
|
||||
13
|
||||
|
@ -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.
|
||||
|
@ -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
|
||||
|
@ -1 +1 @@
|
||||
DEBIAN/examples/zcash.conf
|
||||
DEBIAN/examples/HUSH3.conf
|
||||
|
6
contrib/dragonx_scanner
Executable file
6
contrib/dragonx_scanner
Executable 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
|
@ -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
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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};
|
||||
|
27
contrib/hush_seed_nodes.txt
Normal file
27
contrib/hush_seed_nodes.txt
Normal 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
|
@ -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
52
contrib/sda_checkpoints.pl
Executable 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;
|
||||
}
|
@ -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;
|
||||
|
@ -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.
|
||||
|
||||
|
||||
|
@ -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')
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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
24
debug-build.sh
Executable 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
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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)"
|
||||
|
23
depends/patches/boost/fix-Solaris.patch
Normal file
23
depends/patches/boost/fix-Solaris.patch
Normal 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;
|
68
depends/patches/boost/ignore_wnonnull_gcc_11.patch
Normal file
68
depends/patches/boost/ignore_wnonnull_gcc_11.patch
Normal 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)
|
75
depends/patches/boost/range_enums_clang_16.patch
Normal file
75
depends/patches/boost/range_enums_clang_16.patch
Normal 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:
|
||||
//
|
@ -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
|
77
depends/patches/libevent/detect-arch4random_addrandom.patch
Normal file
77
depends/patches/libevent/detect-arch4random_addrandom.patch
Normal 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
|
||||
}
|
@ -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!
|
@ -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
112
doc/cjdns.md
Normal 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.
|
@ -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
|
||||
|
@ -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
52
doc/help.md
Normal 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
|
@ -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
BIN
doc/hush/earnhush.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 47 KiB |
BIN
doc/hush/hush0.png
Normal file
BIN
doc/hush/hush0.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 17 KiB |
80
doc/i2p.md
80
doc/i2p.md
@ -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.
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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` .
|
||||
|
||||
|
@ -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
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
@ -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'
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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}"
|
||||
|
@ -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:
|
||||
|
||||
```
|
||||
|
@ -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
|
||||
|
@ -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
44
qa/rpc-tests/antispam.py
Executable 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()
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
#
|
||||
|
@ -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
|
||||
|
@ -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()
|
@ -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()
|
@ -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()
|
@ -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()
|
@ -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()
|
@ -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()
|
@ -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()
|
@ -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()
|
@ -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()
|
@ -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
Loading…
x
Reference in New Issue
Block a user