Commit c6e7539e authored by Artem B's avatar Artem B

Merge branch 'Current-dev' into master, Emerald release

parents e2fc8f96 682679d0
Pipeline #1184 failed with stage
in 11 minutes and 41 seconds
......@@ -117,3 +117,11 @@ qa/pull-tester/test.*/*
.cproject
.project
/doc/doxygen/
.idea/
cmake-build-*/
.vscode/
scripts/*.json
scripts/sb.sh
scripts/sb-wallet.sh
\ No newline at end of file
variables:
RELEASE_VERSION: "0.13.4.0"
RELEASE_VERSION: "0.14.0.0"
GIT_STRATEGY: "clone"
MAKEJOBS: "-j4"
CCACHE_SIZE: "100M"
......@@ -221,6 +221,6 @@ Osx-dmg-snapshot:
trigger_docker_build:
stage: deploy
script:
- curl --request POST --form "token=$CI_JOB_TOKEN" --form ref=master --form "variables[VERSION_TAG]=$CI_COMMIT_TAG" https://gitlab.crown.tech/api/v4/projects/17/trigger/pipeline
- curl --request POST --form "token=$CI_JOB_TOKEN" --form ref=master --form "variables[VERSION_TAG]=$CI_COMMIT_TAG" https://gitlab.crownplatform.com/api/v4/projects/17/trigger/pipeline
only:
- tags
......@@ -14,7 +14,7 @@
(The OS version, like Ubuntu 16.04.)
### Crown-core application info
(The wallet version, like v0.13.4.0; link to the pipeline/build if possible.)
(The wallet version, like v0.12.4.1; link to the pipeline/build if possible.)
### Relevant logs, dumps and/or screenshots
(Paste any relevant logs - please use code blocks (```) to format console output,
......
cmake_minimum_required(VERSION 3.0)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
find_package(Boost COMPONENTS thread program_options filesystem unit_test_framework REQUIRED)
find_package(OpenSSL REQUIRED)
find_package(BDB REQUIRED)
find_package(CURL REQUIRED)
find_package(Qt5Widgets REQUIRED)
find_package(Qt5Network REQUIRED)
find_package(Qt5LinguistTools REQUIRED)
find_package(Protobuf REQUIRED)
add_definitions(-DHAVE_ENDIAN_H=1)
add_definitions(-DHAVE_DECL_HTOBE16=1)
add_definitions(-DHAVE_DECL_HTOLE16=1)
add_definitions(-DHAVE_DECL_BE16TOH=1)
add_definitions(-DHAVE_DECL_LE16TOH=1)
add_definitions(-DHAVE_DECL_HTOBE32=1)
add_definitions(-DHAVE_DECL_HTOLE32=1)
add_definitions(-DHAVE_DECL_BE32TOH=1)
add_definitions(-DHAVE_DECL_LE32TOH=1)
add_definitions(-DHAVE_DECL_HTOBE64=1)
add_definitions(-DHAVE_DECL_HTOLE64=1)
add_definitions(-DHAVE_DECL_BE64TOH=1)
add_definitions(-DHAVE_DECL_LE64TOH=1)
add_definitions(-DHAVE_DECL_BSWAP_16=1)
add_definitions(-DHAVE_DECL_BSWAP_32=1)
add_definitions(-DHAVE_DECL_BSWAP_64=1)
add_definitions(-DHAVE_WORKING_BOOST_SLEEP_FOR=1)
add_definitions(-DUSE_NUM_NONE=1)
add_definitions(-DUSE_FIELD_10X26=1)
add_definitions(-DUSE_FIELD_INV_BUILTIN=1)
add_definitions(-DUSE_SCALAR_8X32=1)
add_definitions(-DUSE_SCALAR_INV_BUILTIN=1)
add_definitions(-DENABLE_MODULE_RECOVERY=1)
add_definitions(-DENABLE_WALLET=1)
message(${CURL_LIBRARIES})
message(${CURL_INCLUDE_DIR})
message(${CURL_FOUND})
if(CURL_FOUND)
set(CURL_LIBRARIES ${CURL_LIBRARY})
set(CURL_INCLUDE_DIRS ${CURL_INCLUDE_DIR})
if(NOT TARGET CURL::libcurl)
add_library(CURL::libcurl UNKNOWN IMPORTED)
set_target_properties(CURL::libcurl PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${CURL_INCLUDE_DIRS}")
if(EXISTS "${CURL_LIBRARY}")
set_target_properties(CURL::libcurl PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_LOCATION "${CURL_LIBRARY}")
endif()
if(CURL_LIBRARY_RELEASE)
set_property(TARGET CURL::libcurl APPEND PROPERTY
IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(CURL::libcurl PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_LOCATION_RELEASE "${CURL_LIBRARY_RELEASE}")
endif()
if(CURL_LIBRARY_DEBUG)
set_property(TARGET CURL::libcurl APPEND PROPERTY
IMPORTED_CONFIGURATIONS DEBUG)
set_target_properties(CURL::libcurl PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_LOCATION_DEBUG "${CURL_LIBRARY_DEBUG}")
endif()
endif()
endif()
add_subdirectory(src/univalue)
add_subdirectory(src/secp256k1)
add_subdirectory(src/test)
add_subdirectory(src)
add_subdirectory(src/qt)
......@@ -6,6 +6,6 @@ Use the autogen script to prepare the build environment.
./configure
make
Precompiled binaries are available at https://crown.tech/wallet/. Always verify the signatures and checksums.
Precompiled binaries are available at https://crownplatform.com/wallet/. Always verify the signatures and checksums.
See doc/build-\*.md for instructions on building crownd, the intended-for-services, no-graphical-interface, reference implementation of Crown.
Copyright © 2009-2018 Bitcoin Developers
Copyright © 2014-2016 Dash Developers
Copyright © 2014-2018 Crown Developers
Copyright © 2014-2020 Crown Developers
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
......
# Crown Platform 0.13.4
# Crown Platform 0.14.0
[![pipeline status](http://gitlab.crownplatform.com/crown/crown-core/badges/master/pipeline.svg)](http://gitlab.crownplatform.com/crown/crown-core/commits/master)
......@@ -22,8 +22,8 @@ For more information, as well as an immediately usable, binary version Crown see
Crown is ultimately a community-driven platform. Its potential to bring social and technological growth is contingent on the ideas and support its users provide. We invite you to lend your voice and imagination to this burgeoning platform and share in its success. Together, there’s no limit to what we can accomplish.
* Crown Forum: https://forum.crownplatform.com
* Discord: https://discord.gg/uFhNZNW
* Crown Forum: https://forum.crown.tech
* Discord: https://discord.gg/Tcrkazc
* Telegram: https://t.me/crownplatform
* Guides & How-to: https://forum.crownplatform.com/index.php?board=5.0
......@@ -69,6 +69,7 @@ When describing a bug please include following information:
Crown core developers are working hard on bug fixes, platform enhancements, and new product features.
Some of these tasks may be completed by talented community members through the bounty program.
Bounties are posted to the wiki and can be picked up by anyone who wants to submit new code to the project repository.
If you want to be directly notified of new bounties matching your specific skillset, fill out the short intake survey to get onto the [InSource Community Job Board](https://crown.link/insource).
If you have any questions regarding code submissions, please contact Artem Brazhnikov through Discord and ask about bounties.
## License
......@@ -81,4 +82,4 @@ Copyright © 2009-2018, Bitcoin Core Developers
Copyright © 2014-2016, Dash Core Developers
Copyright © 2014-2019, Crown Developers
Copyright © 2014-2020, Crown Developers
Crowncoin changelog:
* fixed compilation of QT wallet for Linux/Windows/MacOS
* removed traces from bcr
# Locate Berkeley DB C++
# This module defines
# BDB_LIBRARY
# BDB_FOUND, if false, do not try to link to zlib
# BDB_INCLUDE_DIR, where to find the headers
#
# $BDB_DIR is an environment variable that would
# correspond to the ./configure --prefix=$BDB_DIR
# used in building BDB.
#
# Created by Michael Gronager.
find_path(BDB_INCLUDE_DIR db_cxx.h
$ENV{BDB_DIR}/include
$ENV{BDB_DIR}
~/Library/Frameworks
/Library/Frameworks
/usr/local/include
/usr/include
/usr/local/opt/berkeley-db/include # HomeBrew
/usr/local/opt/berkeley-db4/include # HomeBrew, BDB4
/sw/include # Fink
/opt/local/include # DarwinPorts
/opt/csw/include # Blastwave
/opt/include
/usr/freeware/include
)
find_library(BDB_LIBRARY
NAMES db_cxx libdb_cxx
PATHS
$ENV{BDB_DIR}/lib
$ENV{BDB_DIR}
~/Library/Frameworks
/Library/Frameworks
/usr/local/lib
/usr/lib
/usr/local/opt/berkeley-db/lib # HomeBrew
/usr/local/opt/berkeley-db4/lib # HomeBrew, BDB4
/sw/lib
/opt/local/lib
/opt/csw/lib
/opt/lib
/usr/freeware/lib64
)
set(BDB_FOUND "NO")
if(BDB_LIBRARY AND BDB_INCLUDE_DIR)
set(BDB_FOUND "YES")
endif()
add_library(BDB::bdb UNKNOWN IMPORTED)
set_target_properties(BDB::bdb PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${BDB_INCLUDE_DIR}"
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
IMPORTED_LOCATION "${BDB_LIBRARY}")
dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N)
AC_PREREQ([2.60])
define(_CLIENT_VERSION_MAJOR, 0)
define(_CLIENT_VERSION_MINOR, 13)
define(_CLIENT_VERSION_REVISION, 4)
define(_CLIENT_VERSION_MINOR, 14)
define(_CLIENT_VERSION_REVISION, 0)
define(_CLIENT_VERSION_BUILD, 0)
define(_COPYRIGHT_YEAR, 2019)
AC_INIT([Crown Core],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[[email protected].tech],[crown])
define(_COPYRIGHT_YEAR, 2020)
AC_INIT([Crown Core],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[[email protected]platform.com],[crown])
AC_CONFIG_SRCDIR([src/main.cpp])
AC_CONFIG_HEADERS([src/config/crown-config.h])
AC_CONFIG_AUX_DIR([build-aux])
......@@ -37,7 +37,7 @@ else
CXXFLAGS_overridden=no
fi
AC_PROG_CXX
m4_ifdef([AC_PROG_OBJCXX],[AC_PROG_OBJCXX])
m4 ifdef([AC_PROG_OBJCXX],[AC_PROG_OBJCXX])
dnl By default, libtool for mingw refuses to link static libs into a dll for
dnl fear of mixing pic/non-pic objects, and import/export complications. Since
......
......@@ -22,7 +22,7 @@ Build-Depends: debhelper,
libqrencode-dev,
libprotobuf-dev, protobuf-compiler
Standards-Version: 3.9.2
Homepage: http://www.crown.tech/
Homepage: http://www.crownplatform.com/
Vcs-Git: git://github.com/crownpay/crown.git
Vcs-Browser: http://github.com/crownpay/crown
......
# Linearize
Construct a linear, no-fork, best version of the blockchain.
Construct a linear, no-fork, best version of the Crown blockchain.
## Step 1: Download hash list
$ ./linearize-hashes.py linearize.cfg > hashlist.txt
$ ./linearize-hashes.py crown.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: `9341`)
* 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 `crownd` or `crown-qt -server` will be sufficient.
## Step 2: Copy local block data
$ ./linearize-data.py linearize.cfg
$ ./linearize-data.py crown.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`: crownd 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`).
# crownd RPC settings (linearize-hashes)
host=127.0.0.1
port=9341
rpcuser=crownuser
rpcpassword=crownuserpassword
# bootstrap.dat hashlist settings (linearize-hashes)
max_height=2340250
# bootstrap.dat input/output settings (linearize-data)
netmagic=b8ebb3df
genesis=0000000085370d5e122f64f4ab19c68614ff3df78c8d13cb814fd7e69a1dc6da
input=/home/crown/.crown/blocks
output_file=/home/crown/bootstrap.dat
hashlist=hashlist.txt
split_year=1
file_timestamp=1
# Maxmimum size in bytes of out-of-order blocks cache in memory
out_of_order_cache_sz = 100000000
# Do we want the reverse the hash bytes coming from getblockhash?
rev_hash_bytes = false
# Do we want debug printouts?
debug_output = true
# bitcoind RPC settings (linearize-hashes)
rpcuser=someuser
rpcpassword=somepassword
#datadir=~/.bitcoin
host=127.0.0.1
port=9998
#mainnet default
port=8332
#testnet default
#port=18332
#regtest default
#port=18443
# bootstrap.dat hashlist settings (linearize-hashes)
max_height=313000
# bootstrap.dat input/output settings (linearize-data)
# mainnet
netmagic=f9beb4d9
genesis=000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f
input=/home/example/.bitcoin/blocks
# testnet
#netmagic=0b110907
#genesis=000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943
#input=/home/example/.bitcoin/testnet3/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
hashlist=hashlist.txt
split_year=1
# Maxmimum size in bytes of out-of-order blocks cache in memory
# Maximum size in bytes of out-of-order blocks cache in memory
out_of_order_cache_sz = 100000000
# Do we want the reverse the hash bytes coming from getblockhash?
rev_hash_bytes = False
# On a new month, do we want to set the access and modify times of the new
# blockchain file?
file_timestamp = 0
# Do we want to split the blockchain files given a new month or specific height?
split_timestamp = 0
# Do we want debug printouts?
debug_output = False
This diff is collapsed.
#!/usr/bin/python
#!/usr/bin/env python3
#
# linearize-hashes.py: List blocks in 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-2018 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
from http.client import HTTPConnection
import json
import struct
import re
import base64
import httplib
import sys
import os
import os.path
settings = {}
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()
class BitcoinRPC:
def __init__(self, host, port, username, password):
authpair = "%s:%s" % (username, password)
self.authhdr = "Basic %s" % (base64.b64encode(authpair))
self.conn = httplib.HTTPConnection(host, port, False, 30)
def execute(self, obj):
self.conn.request('POST', '/', json.dumps(obj),
{ 'Authorization' : self.authhdr,
'Content-type' : 'application/json' })
resp = self.conn.getresponse()
if resp is None:
print("JSON-RPC: no response", file=sys.stderr)
return None
body = resp.read()
resp_obj = json.loads(body)
return resp_obj
@staticmethod
def build_request(idx, method, params):
obj = { 'version' : '1.1',
'method' : method,
'id' : idx }
if params is None:
obj['params'] = []
else:
obj['params'] = params
return obj
@staticmethod
def response_is_error(resp_obj):
return 'error' in resp_obj and resp_obj['error'] is not None
def __init__(self, host, port, username, password):
authpair = "%s:%s" % (username, password)
authpair = authpair.encode('utf-8')
self.authhdr = b"Basic " + base64.b64encode(authpair)
self.conn = HTTPConnection(host, port=port, timeout=30)
def execute(self, obj):
try:
self.conn.request('POST', '/', json.dumps(obj),
{ 'Authorization' : self.authhdr,
'Content-type' : 'application/json' })
except ConnectionRefusedError:
print('RPC connection refused. Check RPC settings and the server status.',
file=sys.stderr)
return None
resp = self.conn.getresponse()
if resp is None:
print("JSON-RPC: no response", file=sys.stderr)
return None
body = resp.read().decode('utf-8')
resp_obj = json.loads(body)
return resp_obj
@staticmethod
def build_request(idx, method, params):
obj = { 'version' : '1.1',
'method' : method,
'id' : idx }
if params is None:
obj['params'] = []
else:
obj['params'] = params
return obj
@staticmethod
def response_is_error(resp_obj):
return 'error' in resp_obj and resp_obj['error'] is not None
def get_block_hashes(settings, max_blocks_per_call=10000):
rpc = BitcoinRPC(settings['host'], settings['port'],
settings['rpcuser'], settings['rpcpassword'])
height = settings['min_height']
while height < settings['max_height']+1:
num_blocks = min(settings['max_height']+1-height, max_blocks_per_call)
batch = []
for x in range(num_blocks):
batch.append(rpc.build_request(x, 'getblockhash', [height + x]))
reply = rpc.execute(batch)
for x,resp_obj in enumerate(reply):
if rpc.response_is_error(resp_obj):
print('JSON-RPC: error at height', height+x, ': ', resp_obj['error'], file=sys.stderr)
exit(1)
assert(resp_obj['id'] == x) # assume replies are in-sequence
print(resp_obj['result'])
height += num_blocks
rpc = BitcoinRPC(settings['host'], settings['port'],
settings['rpcuser'], settings['rpcpassword'])
height = settings['min_height']
while height < settings['max_height']+1:
num_blocks = min(settings['max_height']+1-height, max_blocks_per_call)
batch = []
for x in range(num_blocks):
batch.append(rpc.build_request(x, 'getblockhash', [height + x]))
reply = rpc.execute(batch)
if reply is None:
print('Cannot continue. Program will halt.')
return None
for x,resp_obj in enumerate(reply):
if rpc.response_is_error(resp_obj):
print('JSON-RPC: error at height', height+x, ': ', resp_obj['error'], file=sys.stderr)
sys.exit(1)
assert(resp_obj['id'] == x) # assume replies are in-sequence
if settings['rev_hash_bytes'] == 'true':
resp_obj['result'] = hex_switchEndian(resp_obj['result'])
print(resp_obj['result'])
height += num_blocks
def get_rpc_cookie():
# Open the cookie file
with open(os.path.join(os.path.expanduser(settings['datadir']), '.cookie'), 'r', encoding="ascii") as f:
combined = f.readline()
combined_split = combined.split(":")
settings['rpcuser'] = combined_split[0]
settings['rpcpassword'] = combined_split[1]
if __name__ == '__main__':
if len(sys.argv) != 2:
print("Usage: linearize-hashes.py CONFIG-FILE")
sys.exit(1)
f = open(sys.argv[1])
for line in f:
# skip comment lines
m = re.search('^\s*#', line)
if m:
continue
# parse key=value lines
m = re.search('^(\w+)\s*=\s*(\S.*)$', line)
if m is None:
continue
settings[m.group(1)] = m.group(2)
f.close()
if 'host' not in settings:
settings['host'] = '127.0.0.1'
if 'port' not in settings:
settings['port'] = 9998
if 'min_height' not in settings:
settings['min_height'] = 0
if 'max_height' not in settings:
settings['max_height'] = 313000
if 'rpcuser' not in settings or 'rpcpassword' not in settings:
print("Missing username and/or password in cfg file", file=stderr)
sys.exit(1)
settings['port'] = int(settings['port'])
settings['min_height'] = int(settings['min_height'])
settings['max_height'] = int(settings['max_height'])
get_block_hashes(settings)
if len(sys.argv) != 2:
print("Usage: linearize-hashes.py CONFIG-FILE")
sys.exit(1)
f = open(sys.argv[1], encoding="utf8")
for line in f:
# skip comment lines
m = re.search('^\s*#', line)
if m:
continue
# parse key=value lines
m = re.search('^(\w+)\s*=\s*(\S.*)$', line)
if m is None:
continue
settings[m.group(1)] = m.group(2)
f.close()
if 'host' not in settings:
settings['host'] = '127.0.0.1'
if 'port' not in settings:
settings['port'] = 9341
if 'min_height' not in settings:
settings['min_height'] = 0
if 'max_height' not in settings:
settings['max_height'] = 2340250
if 'rev_hash_bytes' not in settings:
settings['rev_hash_bytes'] = 'false'
use_userpass = True
use_datadir = False
if 'rpcuser' not in settings or 'rpcpassword' not in settings:
use_userpass = False
if 'datadir' in settings and not use_userpass:
use_datadir = True
if not use_userpass and not use_datadir:
print("Missing datadir or username and/or password in cfg file", file=sys.stderr)
sys.exit(1)
settings['port'] = int(settings['port'])
settings['min_height'] = int(settings['min_height'])
settings['max_height'] = int(settings['max_height'])
# Force hash byte format setting to be lowercase to make comparisons easier.
settings['rev_hash_bytes'] = settings['rev_hash_bytes'].lower()
# Get the rpc user and pass from the cookie if the datadir is set
if use_datadir:
get_rpc_cookie()
get_block_hashes(settings)