From 481ba902f6c394203398b5ce1249b0045a2cbda1 Mon Sep 17 00:00:00 2001
From: Ittrium Cryptocurrency <37259191+IttriumCore@users.noreply.github.com>
Date: Sat, 13 Oct 2018 17:05:17 +0800
Subject: [PATCH] v1.1.0
---
README.md | 28 +-
configure.ac | 12 +-
contrib/devtools/check-doc.py | 2 +-
contrib/ittrium-qt.pro | 2 +-
contrib/linearize/README.md | 58 +-
contrib/linearize/example-linearize.cfg | 16 +-
contrib/linearize/linearize-data.py | 110 +-
contrib/linearize/linearize-hashes.py | 74 +-
contrib/macdeploy/background.svg | 47 +-
contrib/macdeploy/custom_dsstore.py | 2 +-
contrib/macdeploy/fancy.plist | 12 +-
contrib/macdeploy/macdeployqtplus | 4 +-
contrib/seeds/makeseeds.py | 2 +-
contrib/testgen/gen_base58_test_vectors.py | 8 +-
depends/packages/openssl.mk | 6 +-
doc/Doxyfile | 2 +-
doc/README.md | 11 +-
doc/README_osx.md | 2 +-
doc/README_windows.txt | 2 +-
doc/build-osx.md | 10 +-
doc/build-unix.md | 1 +
doc/developer-notes.md | 2 +-
doc/dnsseed-policy.md | 2 +-
doc/gitian-building.md | 6 +-
doc/guide-startmany.md | 10 +-
doc/img/bootstrap2.png | Bin 35610 -> 35412 bytes
doc/init.md | 2 +-
doc/masternode-budget.md | 161 +-
doc/release-notes.md | 184 +-
doc/release-process.md | 12 +-
doc/swifttx.md | 26 +-
doc/tor.md | 25 +-
qa/pull-tester/rpc-tests.sh | 1 +
share/pixmaps/bitcoin-bc.ico | Bin 62716 -> 370070 bytes
share/pixmaps/bitcoin.ico | Bin 62716 -> 370070 bytes
share/pixmaps/bitcoin128.png | Bin 8970 -> 10244 bytes
share/pixmaps/bitcoin128.xpm | 863 ++++---
share/pixmaps/bitcoin16.png | Bin 746 -> 813 bytes
share/pixmaps/bitcoin16.xpm | 217 +-
share/pixmaps/bitcoin256.png | Bin 17454 -> 26298 bytes
share/pixmaps/bitcoin256.xpm | 1377 +++++++----
share/pixmaps/bitcoin32.png | Bin 1663 -> 1837 bytes
share/pixmaps/bitcoin32.xpm | 339 ++-
share/pixmaps/bitcoin64.png | Bin 2733 -> 4319 bytes
share/pixmaps/bitcoin64.xpm | 461 ++--
share/pixmaps/favicon.ico | Bin 5430 -> 370070 bytes
share/pixmaps/nsis-header.bmp | Bin 19492 -> 14676 bytes
share/pixmaps/nsis-wizard.bmp | Bin 132552 -> 196664 bytes
share/setup.nsi.in | 2 +-
src/Makefile.am | 5 +
src/Makefile.qt.include | 86 +-
src/activemasternode.cpp | 5 +-
src/activemasternode.h | 4 +-
src/addrman.h | 2 -
src/chain.h | 4 +-
src/chainparams.cpp | 7 +-
src/clientversion.h | 6 +-
src/coincontrol.h | 11 +
src/crypter.cpp | 48 +-
src/ecwrapper.cpp | 32 +-
src/hash.cpp | 3 +
src/hash.h | 6 +-
src/init.cpp | 17 +-
src/kernel.cpp | 2 +-
src/keystore.cpp | 27 +
src/keystore.h | 13 +
src/leveldb/db/memtable.cc | 2 +-
src/leveldb/util/bloom.cc | 2 +-
src/leveldb/util/logging.cc | 2 +-
src/main.cpp | 111 +-
src/masternode-budget.cpp | 10 +-
src/masternode-payments.cpp | 10 +-
src/masternode.cpp | 2 +-
src/masternode.h | 1 -
src/masternodeman.cpp | 78 +-
src/miner.cpp | 13 +-
src/net.cpp | 149 +-
src/net.h | 17 +-
src/netbase.cpp | 73 +-
src/netbase.h | 13 +-
src/obfuscation.cpp | 14 +-
src/obfuscation.h | 10 +-
src/pow.cpp | 14 +-
src/primitives/block.h | 6 +-
src/primitives/transaction.h | 14 +-
src/qt/addressbookpage.cpp | 3 +-
src/qt/askpassphrasedialog.cpp | 10 +-
src/qt/askpassphrasedialog.h | 3 +-
src/qt/bip38tooldialog.cpp | 1 +
src/qt/bitcoingui.cpp | 140 +-
src/qt/bitcoingui.h | 9 +-
src/qt/bitcoinunits.cpp | 6 +-
src/qt/blockexplorer.cpp | 9 +-
src/qt/clientmodel.cpp | 21 +-
src/qt/clientmodel.h | 4 +
src/qt/coincontroldialog.cpp | 91 +-
src/qt/coincontroldialog.h | 9 +-
src/qt/forms/addressbookpage.ui | 55 +-
src/qt/forms/askpassphrasedialog.ui | 97 +-
src/qt/forms/bip38tooldialog.ui | 77 +-
src/qt/forms/blockexplorer.ui | 10 +-
src/qt/forms/coincontroldialog.ui | 62 +-
src/qt/forms/helpmessagedialog.ui | 4 +-
src/qt/forms/intro.ui | 2 +-
src/qt/forms/masternodelist.ui | 16 +-
src/qt/forms/multisenddialog.ui | 488 ++--
src/qt/forms/obfuscationconfig.ui | 6 +-
src/qt/forms/openuridialog.ui | 220 +-
src/qt/forms/optionsdialog.ui | 43 +-
src/qt/forms/overviewpage.ui | 564 +++--
src/qt/forms/receivecoinsdialog.ui | 37 +-
src/qt/forms/receiverequestdialog.ui | 74 +-
src/qt/forms/rpcconsole.ui | 158 +-
src/qt/forms/sendcoinsdialog.ui | 53 +-
src/qt/forms/sendcoinsentry.ui | 190 +-
src/qt/forms/signverifymessagedialog.ui | 86 +-
src/qt/forms/tradingdialog.ui | 57 +-
src/qt/guiconstants.h | 8 +-
src/qt/guiutil.cpp | 23 +-
src/qt/guiutil.h | 2 +
src/qt/intro.cpp | 1 +
src/qt/ittrium.cpp | 8 +-
src/qt/ittrium.qrc | 55 +-
src/qt/ittriumstrings.cpp | 2 +-
src/qt/locale/ittrium_bg.ts | 28 +-
src/qt/locale/ittrium_ca.ts | 28 +-
src/qt/locale/ittrium_cs.ts | 146 +-
src/qt/locale/ittrium_da.ts | 304 +--
src/qt/locale/ittrium_de.ts | 156 +-
src/qt/locale/ittrium_en.ts | 161 +-
src/qt/locale/ittrium_en_US.ts | 310 +--
src/qt/locale/ittrium_es.ts | 310 +--
src/qt/locale/ittrium_fi.ts | 176 +-
src/qt/locale/ittrium_fr_FR.ts | 80 +-
src/qt/locale/ittrium_it.ts | 96 +-
src/qt/locale/ittrium_ko_KR.ts | 312 +--
src/qt/locale/ittrium_nl.ts | 156 +-
src/qt/locale/ittrium_pl.ts | 80 +-
src/qt/locale/ittrium_pt.ts | 44 +-
src/qt/locale/ittrium_pt_BR.ts | 250 +-
src/qt/locale/ittrium_ru.ts | 240 +-
src/qt/locale/ittrium_sk.ts | 100 +-
src/qt/locale/ittrium_sv.ts | 92 +-
src/qt/locale/ittrium_uk.ts | 12 +-
src/qt/locale/ittrium_zh_TW.ts | 104 +-
src/qt/masternodelist.cpp | 1 +
src/qt/multisenddialog.cpp | 284 +--
src/qt/multisenddialog.h | 22 +-
src/qt/obfuscationconfig.cpp | 1 +
src/qt/openuridialog.cpp | 7 +-
src/qt/openuridialog.h | 5 +-
src/qt/optionsdialog.cpp | 3 +
src/qt/optionsmodel.cpp | 14 +-
src/qt/optionsmodel.h | 2 +
src/qt/overviewpage.cpp | 38 +-
src/qt/overviewpage.h | 4 +-
src/qt/paymentrequestplus.cpp | 20 +-
src/qt/receiverequestdialog.cpp | 8 +-
src/qt/receiverequestdialog.h | 2 +-
src/qt/res/css/default.css | 2299 +++++++------------
src/qt/res/icons/add.png | Bin 1232 -> 655 bytes
src/qt/res/icons/address-book.png | Bin 532 -> 554 bytes
src/qt/res/icons/bitcoin.png | Bin 24906 -> 18271 bytes
src/qt/res/icons/browse.png | Bin 1300 -> 242 bytes
src/qt/res/icons/clock1.png | Bin 1048 -> 2443 bytes
src/qt/res/icons/clock2.png | Bin 1048 -> 2213 bytes
src/qt/res/icons/clock3.png | Bin 1045 -> 1870 bytes
src/qt/res/icons/clock4.png | Bin 1049 -> 1758 bytes
src/qt/res/icons/clock5.png | Bin 1044 -> 1532 bytes
src/qt/res/icons/configure.png | Bin 1078 -> 2532 bytes
src/qt/res/icons/connect0_16.png | Bin 667 -> 2224 bytes
src/qt/res/icons/connect1_16.png | Bin 282 -> 1991 bytes
src/qt/res/icons/connect2_16.png | Bin 463 -> 1761 bytes
src/qt/res/icons/connect3_16.png | Bin 736 -> 1601 bytes
src/qt/res/icons/connect4_16.png | Bin 1012 -> 1412 bytes
src/qt/res/icons/debugwindow.png | Bin 5256 -> 337 bytes
src/qt/res/icons/edit.png | Bin 1241 -> 374 bytes
src/qt/res/icons/editcopy.png | Bin 640 -> 441 bytes
src/qt/res/icons/editpaste.png | Bin 478 -> 385 bytes
src/qt/res/icons/explorer.png | Bin 8544 -> 325 bytes
src/qt/res/icons/export.png | Bin 2053 -> 1228 bytes
src/qt/res/icons/eye.png | Bin 496 -> 679 bytes
src/qt/res/icons/eye_minus.png | Bin 575 -> 709 bytes
src/qt/res/icons/eye_plus.png | Bin 637 -> 736 bytes
src/qt/res/icons/filesave.png | Bin 1300 -> 405 bytes
src/qt/res/icons/history.png | Bin 25364 -> 321 bytes
src/qt/res/icons/import.png | Bin 939 -> 2090 bytes
src/qt/res/icons/key.png | Bin 269 -> 1525 bytes
src/qt/res/icons/lock_closed.png | Bin 464 -> 394 bytes
src/qt/res/icons/lock_open.png | Bin 457 -> 414 bytes
src/qt/res/icons/masternodes.png | Bin 8316 -> 876 bytes
src/qt/res/icons/notsynced.png | Bin 1013 -> 241 bytes
src/qt/res/icons/overview.png | Bin 6327 -> 717 bytes
src/qt/res/icons/qrcode.png | Bin 174 -> 163 bytes
src/qt/res/icons/quit.png | Bin 1951 -> 441 bytes
src/qt/res/icons/receive.png | Bin 6475 -> 438 bytes
src/qt/res/icons/remove.png | Bin 250 -> 739 bytes
src/qt/res/icons/send.png | Bin 6500 -> 431 bytes
src/qt/res/icons/staking_active.png | Bin 1142 -> 1235 bytes
src/qt/res/icons/staking_inactive.png | Bin 1003 -> 1199 bytes
src/qt/res/icons/synced.png | Bin 881 -> 750 bytes
src/qt/res/icons/trade.png | Bin 303 -> 330 bytes
src/qt/res/icons/transaction0.png | Bin 285 -> 396 bytes
src/qt/res/icons/transaction2.png | Bin 2969 -> 333 bytes
src/qt/res/icons/transaction_conflicted.png | Bin 288 -> 432 bytes
src/qt/res/icons/tx_inout.png | Bin 3440 -> 564 bytes
src/qt/res/icons/tx_input.png | Bin 3124 -> 379 bytes
src/qt/res/icons/tx_mined.png | Bin 3593 -> 876 bytes
src/qt/res/icons/tx_output.png | Bin 533 -> 344 bytes
src/qt/res/images/about.png | Bin 1713 -> 1219 bytes
src/qt/res/images/downArrow.png | Bin 265 -> 175 bytes
src/qt/res/images/downArrow_small.png | Bin 195 -> 121 bytes
src/qt/res/images/leftArrow_small.png | Bin 196 -> 104 bytes
src/qt/res/images/qtreeview_selected.png | Bin 283 -> 196 bytes
src/qt/res/images/rightArrow_small.png | Bin 196 -> 108 bytes
src/qt/res/images/splash.png | Bin 40473 -> 27417 bytes
src/qt/res/images/splash_testnet.png | Bin 22666 -> 27417 bytes
src/qt/res/images/upArrow_small.png | Bin 198 -> 116 bytes
src/qt/res/images/walletFrame.png | Bin 73780 -> 346 bytes
src/qt/res/movies/spinner-000.png | Bin 989 -> 2021 bytes
src/qt/res/movies/spinner-001.png | Bin 917 -> 2015 bytes
src/qt/res/movies/spinner-002.png | Bin 923 -> 2028 bytes
src/qt/res/movies/spinner-003.png | Bin 953 -> 1970 bytes
src/qt/res/movies/spinner-004.png | Bin 936 -> 1989 bytes
src/qt/res/movies/spinner-005.png | Bin 934 -> 1995 bytes
src/qt/res/movies/spinner-006.png | Bin 960 -> 2174 bytes
src/qt/res/movies/spinner-007.png | Bin 987 -> 2048 bytes
src/qt/res/src/bitcoin.svg | 59 +-
src/qt/res/src/clock1.svg | 262 +--
src/qt/res/src/clock2.svg | 263 +--
src/qt/res/src/clock3.svg | 262 +--
src/qt/res/src/clock4.svg | 262 +--
src/qt/res/src/clock5.svg | 263 +--
src/qt/res/src/clock_green.svg | 263 +--
src/qt/res/src/inout.svg | 123 +-
src/qt/res/src/questionmark.svg | 160 +-
src/qt/rpcconsole.cpp | 157 +-
src/qt/rpcconsole.h | 19 +-
src/qt/sendcoinsdialog.cpp | 1 +
src/qt/signverifymessagedialog.cpp | 1 +
src/qt/splashscreen.cpp | 2 +-
src/qt/test/uritests.cpp | 36 +-
src/qt/transactionrecord.cpp | 7 +-
src/qt/transactiontablemodel.cpp | 2 +-
src/qt/walletframe.cpp | 7 +
src/qt/walletframe.h | 3 +
src/qt/walletmodel.cpp | 42 +-
src/qt/walletmodel.h | 8 +
src/qt/walletview.cpp | 15 +-
src/qt/walletview.h | 3 +
src/rpcclient.cpp | 3 +-
src/rpcmasternode-budget.cpp | 8 +-
src/rpcmining.cpp | 63 +
src/rpcnet.cpp | 107 +
src/rpcprotocol.h | 1 +
src/rpcserver.cpp | 3 +
src/rpcserver.h | 3 +
src/rpcwallet.cpp | 53 +-
src/script/script.h | 3 +-
src/secp256k1/obj/.gitignore | 2 +
src/spork.cpp | 16 +-
src/spork.h | 2 +
src/sync.cpp | 113 +-
src/sync.h | 78 +-
src/test/Checkpoints_tests.cpp | 19 +-
src/test/data/script_invalid.json | 2 +
src/test/data/script_valid.json | 3 +
src/test/data/sighash.json | 11 +-
src/test/data/tx_invalid.json | 16 +-
src/test/data/tx_valid.json | 2 +-
src/test/data/txcreate1.hex | 2 +-
src/test/data/txcreatesign.hex | 2 +-
src/test/getarg_tests.cpp | 24 +-
src/test/key_tests.cpp | 28 +-
src/test/main_tests.cpp | 12 +-
src/test/rpc_tests.cpp | 13 +-
src/test/rpc_wallet_tests.cpp | 18 +-
src/test/transaction_tests.cpp | 29 +-
src/test/util_tests.cpp | 70 -
src/txdb.cpp | 2 +-
src/ui_interface.h | 3 +
src/util.cpp | 2 +-
src/utilstrencodings.cpp | 6 +-
src/utilstrencodings.h | 4 +-
src/version.h | 7 +-
src/wallet.cpp | 178 +-
src/wallet.h | 21 +-
src/wallet_ismine.cpp | 30 +-
src/wallet_ismine.h | 7 +-
src/walletdb.cpp | 63 +-
src/walletdb.h | 7 +-
291 files changed, 8224 insertions(+), 8551 deletions(-)
diff --git a/README.md b/README.md
index 9a01f49..a0f8480 100755
--- a/README.md
+++ b/README.md
@@ -16,31 +16,6 @@
- Near instantaneous transactions via SwiftTX.
- Masternode technology used to secure the network and provide the above features.
-### Addnodes
-To improve the network speed/performance it's recommended that you connect to the following nodes.
-
-How to add nodes to the ittrium.conf file.
-1. Backup your wallet file by clicking File > Backup Wallet
-2. Shut your wallet.
-3. Navigate to %AppData%/Ittrium (Windows), ~./ittrium (Linux) or ~/Library/Application Support/Ittrium (Mac)
-4. Open ittrium.conf file in a word editor (i.e. Notepad).
-5. Paste the following text into the ittrium.conf file, Save and Exit.
-
-```
-addnode=195.201.28.86
-addnode=195.201.30.56
-addnode=51.38.127.99
-addnode=51.38.68.244
-addnode=51.38.68.255
-addnode=51.38.98.231
-addnode=88.99.123.145
-addnode=95.216.136.26
-addnode=95.216.148.31
-addnode=95.216.169.173
-addnode=159.69.3.16
-addnode=
-```
-
### Coin Specs
Algo | Lyra2z |
@@ -52,6 +27,7 @@ addnode=
### Reward Distribution
+
Phase | Block Height | Reward | Proof of Stake (27%) | Masternodes (73%) |
Phase 1 | 0-300 | 1650 XIT | na | na |
@@ -67,5 +43,3 @@ addnode=
Phase 11 | 650,001-1,800,000 | 6 XIT | 1.62 XIT | 4.38 XIT |
Phase 12 | 1,800,000-7,868,633 | 3 XIT | 0.81 XIT | 2.19 XIT |
-
-
diff --git a/configure.ac b/configure.ac
index 57d4d1b..f8b36e6 100755
--- a/configure.ac
+++ b/configure.ac
@@ -1,9 +1,9 @@
dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N)
AC_PREREQ([2.60])
define(_CLIENT_VERSION_MAJOR, 1)
-define(_CLIENT_VERSION_MINOR, 0)
-define(_CLIENT_VERSION_REVISION, 3)
-define(_CLIENT_VERSION_BUILD, 3)
+define(_CLIENT_VERSION_MINOR, 1)
+define(_CLIENT_VERSION_REVISION, 0)
+define(_CLIENT_VERSION_BUILD, 0)
define(_CLIENT_VERSION_IS_RELEASE, true)
define(_COPYRIGHT_YEAR, 2018)
AC_INIT([Ittrium Core],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[www.ittrium.io],[ittrium])
@@ -19,9 +19,9 @@ BITCOIN_TX_NAME=ittrium-tx
AC_CANONICAL_HOST
-AH_TOP([#ifndef ITTRIUM_CONFIG_H])
-AH_TOP([#define ITTRIUM_CONFIG_H])
-AH_BOTTOM([#endif //ITTRIUM_CONFIG_H])
+AH_TOP([#ifndef XIT_CONFIG_H])
+AH_TOP([#define XIT_CONFIG_H])
+AH_BOTTOM([#endif //XIT_CONFIG_H])
dnl faketime breaks configure and is only needed for make. Disable it here.
unset FAKETIME
diff --git a/contrib/devtools/check-doc.py b/contrib/devtools/check-doc.py
index 3a38dfa..7f0e5e1 100755
--- a/contrib/devtools/check-doc.py
+++ b/contrib/devtools/check-doc.py
@@ -20,7 +20,7 @@
REGEX_ARG = re.compile(r'(?:map(?:Multi)?Args(?:\.count\(|\[)|Get(?:Bool)?Arg\()\"(\-[^\"]+?)\"')
REGEX_DOC = re.compile(r'HelpMessageOpt\(\"(\-[^\"=]+?)(?:=|\")')
# list unsupported, deprecated and duplicate args as they need no documentation
-SET_DOC_OPTIONAL = set(['-rpcssl', '-benchmark', '-h', '-help', '-socks', '-tor', '-debugnet', '-whitelistalwaysrelay', '-prematurewitness', '-walletprematurewitness', '-promiscuousmempoolflags', '-blockminsize', '-sendfreetransactions'])
+SET_DOC_OPTIONAL = set(['-rpcssl', '-benchmark', '-h', '-help', '-socks', '-tor', '-debugnet', '-whitelistalwaysrelay', '-prematurewitness', '-walletprematurewitness', '-promiscuousmempoolflags', '-blockminsize', '-sendfreetransactions', '-checklevel', '-liquidityprovider', '-anonymizeittriumamount'])
def main():
used = check_output(CMD_GREP_ARGS, shell=True)
diff --git a/contrib/ittrium-qt.pro b/contrib/ittrium-qt.pro
index 5b74832..9237cdb 100755
--- a/contrib/ittrium-qt.pro
+++ b/contrib/ittrium-qt.pro
@@ -62,6 +62,7 @@ HEADERS += src/activemasternode.h \
src/allocators.h \
src/amount.h \
src/base58.h \
+ src/bignum.h \
src/bloom.h \
src/chain.h \
src/chainparams.h \
@@ -222,7 +223,6 @@ HEADERS += src/activemasternode.h \
src/script/sigcache.h \
src/script/sign.h \
src/script/standard.h \
- src/test/bignum.h \
src/univalue/univalue.h \
src/univalue/univalue_escapes.h \
src/leveldb/db/builder.h \
diff --git a/contrib/linearize/README.md b/contrib/linearize/README.md
index 157586e..7529934 100755
--- a/contrib/linearize/README.md
+++ b/contrib/linearize/README.md
@@ -1,33 +1,57 @@
# Linearize
-Construct a linear, no-fork, best version of the blockchain.
+Construct a linear, no-fork, best version of the Bitcoin blockchain. The scripts
+run using Python 3 but are compatible with Python 2.
+
+REQUIRED: [nist5_hash](https://github.com/IttriumCore/nist5_hash)
## Step 1: Download hash list
- $ ./linearize-hashes.py linearize.cfg > hashlist.txt
+ $ ./linearize-hashes.py linearize.cfg > hashlist.txt
Required configuration file settings for linearize-hashes:
-* RPC: rpcuser, rpcpassword
+* RPC: `datadir` (Required if `rpcuser` and `rpcpassword` are not specified)
+* RPC: `rpcuser`, `rpcpassword` (Required if `datadir` is not specified)
Optional config file setting for linearize-hashes:
-* RPC: host, port
-* Block chain: min_height, max_height
+* RPC: `host` (Default: `127.0.0.1`)
+* RPC: `port` (Default: `8332`)
+* Blockchain: `min_height`, `max_height`
+* `rev_hash_bytes`: If true, the written block hash list will be
+byte-reversed. (In other words, the hash returned by getblockhash will have its
+bytes reversed.) False by default. Intended for generation of
+standalone hash lists but safe to use with linearize-data.py, which will output
+the same data no matter which byte format is chosen.
+
+The `linearize-hashes` script requires a connection, local or remote, to a
+JSON-RPC server. Running `bitcoind` or `bitcoin-qt -server` will be sufficient.
## Step 2: Copy local block data
- $ ./linearize-data.py linearize.cfg
+ $ ./linearize-data.py linearize.cfg
Required configuration file settings:
-* "input": bitcoind blocks/ directory containing blkNNNNN.dat
-* "hashlist": text file containing list of block hashes, linearized-hashes.py
-output.
-* "output_file": bootstrap.dat
+* `output_file`: The file that will contain the final blockchain.
or
-* "output": output directory for linearized blocks/blkNNNNN.dat output
+* `output`: Output directory for linearized `blocks/blkNNNNN.dat` output.
Optional config file setting for linearize-data:
-* "netmagic": network magic number
-* "max_out_sz": maximum output file size (default 1000*1000*1000)
-* "split_timestamp": Split files when a new month is first seen, in addition to
-reaching a maximum file size.
-* "file_timestamp": Set each file's last-modified time to that of the
-most recent block in that file.
+* `debug_output`: Some printouts may not always be desired. If true, such output
+will be printed.
+* `file_timestamp`: Set each file's last-accessed and last-modified times,
+respectively, to the current time and to the timestamp of the most recent block
+written to the script's blockchain.
+* `genesis`: The hash of the genesis block in the blockchain.
+* `input`: bitcoind blocks/ directory containing blkNNNNN.dat
+* `hashlist`: text file containing list of block hashes created by
+linearize-hashes.py.
+* `max_out_sz`: Maximum size for files created by the `output_file` option.
+(Default: `1000*1000*1000 bytes`)
+* `netmagic`: Network magic number.
+* `out_of_order_cache_sz`: If out-of-order blocks are being read, the block can
+be written to a cache so that the blockchain doesn't have to be sought again.
+This option specifies the cache size. (Default: `100*1000*1000 bytes`)
+* `rev_hash_bytes`: If true, the block hash list written by linearize-hashes.py
+will be byte-reversed when read by linearize-data.py. See the linearize-hashes
+entry for more information.
+* `split_timestamp`: Split blockchain files when a new month is first seen, in
+addition to reaching a maximum file size (`max_out_sz`).
diff --git a/contrib/linearize/example-linearize.cfg b/contrib/linearize/example-linearize.cfg
index cb13dd6..dd543fc 100755
--- a/contrib/linearize/example-linearize.cfg
+++ b/contrib/linearize/example-linearize.cfg
@@ -1,29 +1,29 @@
# bitcoind RPC settings (linearize-hashes)
-rpcuser=someuser
-rpcpassword=somepassword
+rpcuser=RPCUSERNAME
+rpcpassword=RPCPASSWORD
#datadir=~/.ittrium
host=127.0.0.1
#mainnet default
-port=39993
+port=50369
#testnet default
-#port=3993
+#port=51369
# bootstrap.dat hashlist settings (linearize-hashes)
-max_height=313000
+max_height=1000
# bootstrap.dat input/output settings (linearize-data)
# mainnet
netmagic=08020117
-genesis=00000908a5fd7c4c863c9a0281def7b5b9c137b782d66a75753c3954d369eb5c
-input=/home/example/.ittrium/blocks
+genesis000000fdacddaba54eb66a4c09dc795efbfc75fcd0572c99f489424367bc9ec9
+input=/home/ittrium/.ittrium/blocks
# "output" option causes blockchain files to be written to the given location,
# with "output_file" ignored. If not used, "output_file" is used instead.
# output=/home/example/blockchain_directory
-output_file=/home/example/Downloads/bootstrap.dat
+output_file=/home/ittrium/bootstrap.dat
hashlist=hashlist.txt
# Maximum size in bytes of out-of-order blocks cache in memory
diff --git a/contrib/linearize/linearize-data.py b/contrib/linearize/linearize-data.py
index 0aee9b6..a2a68f1 100755
--- a/contrib/linearize/linearize-data.py
+++ b/contrib/linearize/linearize-data.py
@@ -1,29 +1,35 @@
-#!/usr/bin/python
+#!/usr/bin/env python3
#
# linearize-data.py: Construct a linear, no-fork version of the chain.
#
-# Copyright (c) 2013-2014 The Bitcoin developers
-# Distributed under the MIT/X11 software license, see the accompanying
+# Copyright (c) 2013-2017 The Bitcoin Core developers
+# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
from __future__ import print_function, division
-import json
import struct
import re
import os
-import base64
-import httplib
+import os.path
import sys
import hashlib
import datetime
import time
from collections import namedtuple
+from binascii import hexlify, unhexlify
+import nist5_hash
settings = {}
+##### Switch endian-ness #####
+def hex_switchEndian(s):
+ """ Switches the endianness of a hex string (in pairs of hex chars) """
+ pairList = [s[i:i+2].encode() for i in range(0, len(s), 2)]
+ return b''.join(pairList[::-1]).decode()
+
def uint32(x):
- return x & 0xffffffffL
+ return x & 0xffffffff
def bytereverse(x):
return uint32(( ((x) << 24) | (((x) << 8) & 0x00ff0000) |
@@ -34,31 +40,23 @@ def bufreverse(in_buf):
for i in range(0, len(in_buf), 4):
word = struct.unpack('@I', in_buf[i:i+4])[0]
out_words.append(struct.pack('@I', bytereverse(word)))
- return ''.join(out_words)
+ return b''.join(out_words)
def wordreverse(in_buf):
out_words = []
for i in range(0, len(in_buf), 4):
out_words.append(in_buf[i:i+4])
out_words.reverse()
- return ''.join(out_words)
+ return b''.join(out_words)
def calc_hdr_hash(blk_hdr):
- hash1 = hashlib.sha256()
- hash1.update(blk_hdr)
- hash1_o = hash1.digest()
-
- hash2 = hashlib.sha256()
- hash2.update(hash1_o)
- hash2_o = hash2.digest()
-
- return hash2_o
+ return nist5_hash.getPoWHash(blk_hdr)
def calc_hash_str(blk_hdr):
hash = calc_hdr_hash(blk_hdr)
hash = bufreverse(hash)
hash = wordreverse(hash)
- hash_str = hash.encode('hex')
+ hash_str = hexlify(hash).decode('utf-8')
return hash_str
def get_blk_dt(blk_hdr):
@@ -68,17 +66,21 @@ def get_blk_dt(blk_hdr):
dt_ym = datetime.datetime(dt.year, dt.month, 1)
return (dt_ym, nTime)
+# When getting the list of block hashes, undo any byte reversals.
def get_block_hashes(settings):
blkindex = []
f = open(settings['hashlist'], "r")
for line in f:
line = line.rstrip()
+ if settings['rev_hash_bytes'] == 'true':
+ line = hex_switchEndian(line)
blkindex.append(line)
print("Read " + str(len(blkindex)) + " hashes")
return blkindex
+# The block map shouldn't give or receive byte-reversed hashes.
def mkblockmap(blkindex):
blkmap = {}
for height,hash in enumerate(blkindex):
@@ -115,29 +117,30 @@ def __init__(self, settings, blkindex, blkmap):
self.setFileTime = True
if settings['split_timestamp'] != 0:
self.timestampSplit = True
- # Extents and cache for out-of-order blocks
+ # Extents and cache for out-of-order blocks
self.blockExtents = {}
self.outOfOrderData = {}
self.outOfOrderSize = 0 # running total size for items in outOfOrderData
def writeBlock(self, inhdr, blk_hdr, rawblock):
- if not self.fileOutput and ((self.outsz + self.inLen) > self.maxOutSz):
+ blockSizeOnDisk = len(inhdr) + len(blk_hdr) + len(rawblock)
+ if not self.fileOutput and ((self.outsz + blockSizeOnDisk) > self.maxOutSz):
self.outF.close()
if self.setFileTime:
- os.utime(outFname, (int(time.time()), highTS))
+ os.utime(self.outFname, (int(time.time()), self.highTS))
self.outF = None
self.outFname = None
- self.outFn = outFn + 1
+ self.outFn = self.outFn + 1
self.outsz = 0
(blkDate, blkTS) = get_blk_dt(blk_hdr)
if self.timestampSplit and (blkDate > self.lastDate):
- print("New month " + blkDate.strftime("%Y-%m") + " @ " + hash_str)
- lastDate = blkDate
- if outF:
- outF.close()
- if setFileTime:
- os.utime(outFname, (int(time.time()), highTS))
+ print("New month " + blkDate.strftime("%Y-%m") + " @ " + self.hash_str)
+ self.lastDate = blkDate
+ if self.outF:
+ self.outF.close()
+ if self.setFileTime:
+ os.utime(self.outFname, (int(time.time()), self.highTS))
self.outF = None
self.outFname = None
self.outFn = self.outFn + 1
@@ -145,11 +148,11 @@ def writeBlock(self, inhdr, blk_hdr, rawblock):
if not self.outF:
if self.fileOutput:
- outFname = self.settings['output_file']
+ self.outFname = self.settings['output_file']
else:
- outFname = "%s/blk%05d.dat" % (self.settings['output'], outFn)
- print("Output file" + outFname)
- self.outF = open(outFname, "wb")
+ self.outFname = os.path.join(self.settings['output'], "blk%05d.dat" % self.outFn)
+ print("Output file " + self.outFname)
+ self.outF = open(self.outFname, "wb")
self.outF.write(inhdr)
self.outF.write(blk_hdr)
@@ -165,7 +168,7 @@ def writeBlock(self, inhdr, blk_hdr, rawblock):
(self.blkCountIn, self.blkCountOut, len(self.blkindex), 100.0 * self.blkCountOut / len(self.blkindex)))
def inFileName(self, fn):
- return "%s/blk%05d.dat" % (self.settings['input'], fn)
+ return os.path.join(self.settings['input'], "blk%05d.dat" % fn)
def fetchBlock(self, extent):
'''Fetch block contents from disk given extents'''
@@ -189,7 +192,7 @@ def run(self):
while self.blkCountOut < len(self.blkindex):
if not self.inF:
fname = self.inFileName(self.inFn)
- print("Input file" + fname)
+ print("Input file " + fname)
try:
self.inF = open(fname, "rb")
except IOError:
@@ -205,7 +208,7 @@ def run(self):
inMagic = inhdr[:4]
if (inMagic != self.settings['netmagic']):
- print("Invalid magic:" + inMagic)
+ print("Invalid magic: " + hexlify(inMagic).decode('utf-8'))
return
inLenLE = inhdr[4:]
su = struct.unpack("
-
-