Skip to content

Commit 47b53ff

Browse files
authored
Merge pull request #103 from citp/v0.5
Update BlockSci to v0.5.0 Version 0.5.0 focuses mainly on improvements and cleanups in the python interface. The largest new feature is the introduction of vectorized operations which return NumPy arrays, enabling much more rapid usage of BlockSci's python interface. You can read more details about the release in the [release notes](https://citp.github.io/BlockSci/changelog.html#version-0-5-0). Fixes #72, fixes #76, fixes #84, and fixes #98
2 parents 9ea0aa3 + 2a3db11 commit 47b53ff

File tree

570 files changed

+15292
-11245
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

570 files changed

+15292
-11245
lines changed

.gitignore

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
release
2+
xcode
3+
debug
4+
build
5+
*.DS_Store
6+
Notebooks/blocksci
7+
*.so
8+
*.dylib
9+
*.pyc
10+
include/blocksci/external
11+
python/blocksci/pybind11
12+
*.egg-info

.gitmodules

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
[submodule "libs/pybind11"]
2-
path = libs/pybind11
2+
path = blockscipy/blocksci/pybind11
33
url = https://github.com/pybind/pybind11/
44
[submodule "libs/bitcoin-api-cpp"]
5-
path = libs/bitcoin-api-cpp
5+
path = external/bitcoin-api-cpp
66
url = https://github.com/hkalodner/bitcoin-api-cpp.git
77
[submodule "libs/dset"]
8-
path = libs/dset
8+
path = external/dset
99
url = https://github.com/wjakob/dset.git
1010
[submodule "libs/variant"]
11-
path = libs/variant
11+
path = external/variant
1212
url = https://github.com/mpark/variant.git
1313
[submodule "libs/range-v3"]
14-
path = libs/range-v3
14+
path = external/range-v3
1515
url = https://github.com/ericniebler/range-v3.git
16-
[submodule "libs/type_safe"]
17-
path = libs/type_safe
18-
url = https://github.com/foonathan/type_safe
1916
[submodule "Notebooks/blocksci/Blockchain-Known-Pools"]
20-
path = Notebooks/blocksci/Blockchain-Known-Pools
17+
path = blockscipy/blocksci/Blockchain-Known-Pools
2118
url = https://github.com/blockchain/Blockchain-Known-Pools
2219
[submodule "libs/clipp"]
23-
path = libs/clipp
20+
path = external/clipp
2421
url = https://github.com/muellan/clipp
22+
[submodule "libs/rocksdb"]
23+
path = external/rocksdb
24+
url = https://github.com/facebook/rocksdb

CHANGELOG.rst

+53
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,59 @@
44
Release notes
55
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
66

7+
Version 0.5.0
8+
========================
9+
10+
Feature Enhancements
11+
---------------------
12+
13+
- Expanded iterator and range functionality to return NumPy arrays.
14+
15+
Many methods and properties of BlockSci objects return range or iterator objects such as :class:`blocksci.TxRange`. These objects allow vectorized operations over sequences of BlockSci objects. Their API matches up with the API of their member objects, and thus :class:`blocksci.TxRange` has almost the same set of methods as :class:`blocksci.Tx`. These methods will effiently call the given method over all items in the range or iterator. Depending on the return type of the method, the result will either be another range, a NumPy array, or a python list. For further information, look for these classes in the reference.
16+
17+
- Add custom BlockSci pickler to enable sending and recieving serialized BlockSci objects. This means that returning BlockSci objects from the multiprocessing interface now works correctly.
18+
19+
- Enhance the change address heuristics interface
20+
21+
Change address heuristics are now composible in order to form new customized heuristics using the :class:`blocksci.heuristics.change.ChangeHeuristic` interface. These can be used in combination with the new clustering interface described below.
22+
23+
- Incorporate clustering module into main BlockSci library
24+
25+
The formerly external clustering module is now avaiable as :mod:`blocksci.cluster`. Further, it is now possible to generate new clusterings through the python interface using the :func:`~blocksci.cluster.ClusterManager.create_clustering` method. Users can select their choice of change address heuristic in order to experiment with different clustering strategies.
26+
27+
- Simplified build system
28+
29+
BlockSci's install process no longer requires the compilation of any external dependencies to compile on Ubuntu 16.04.
30+
31+
The BlockSci library no longer has any public dependencies so compiling against it will not require linking against anything else.
32+
33+
The CMake build script has now been updated to install a Config file which allows you to use `find_package(blocksci)` to import BlockSci's target's into your build script. This makes it much easier to build libraries that use BlockSci as a dependency.
34+
35+
The BlockSci python module has been moved into a separate module to allow for a simple SetupTools or pip based install process: `pip install -e pyblocksci`. The main BlockSci library must be installed first for this to work.
36+
37+
- Updated mempool recorder and integrated it into BlockSci interface.
38+
39+
For instructions on running the mempool recorder and using the data it produces, see the setup_ section.
40+
41+
- Improve and clean up auto generated API reference.
42+
43+
All method signatures display correct types and all properties display the type of the returned value. Further, all types link to their definition in the documentation.
44+
45+
46+
Bug Fixes
47+
----------
48+
49+
- Removed hardcoded paths (`Issue #72`_)
50+
- Fixed :func:`~blocksci.Block.miner` (`Issue #76`_)
51+
- Added pickling support (`Issue #84`_)
52+
- Added :func:`~blocksci.Blockchain.reload` (`Issue #98`_)
53+
54+
.. _setup: https://citp.github.io/BlockSci/setup.html
55+
.. _Issue #72: https://github.com/citp/BlockSci/issues/72
56+
.. _Issue #76: https://github.com/citp/BlockSci/issues/76
57+
.. _Issue #84: https://github.com/citp/BlockSci/issues/84
58+
.. _Issue #98: https://github.com/citp/BlockSci/issues/98
59+
760
Version 0.4.5
861
========================
962

CMakeLists.txt

+9-61
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,15 @@
1-
cmake_minimum_required(VERSION 3.9)
1+
cmake_minimum_required(VERSION 3.5)
22
project(blocksci)
33

4-
set(CMAKE_CXX_STANDARD 14)
5-
set(CMAKE_MACOSX_RPATH 1)
4+
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/")
65

7-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic")
6+
set(BlockSci_VERSION 0.5.0)
87

9-
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Weverything -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-old-style-cast -Wno-documentation-unknown-command -Wno-documentation -Wno-shadow -Wno-switch-enum -Wno-missing-prototypes -Wno-weak-vtables -Wno-exit-time-destructors -Wno-unused-macros -Wno-padded -Wno-undefined-func-template")
8+
include(GNUInstallDirs)
109

11-
#set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_GLIBCXX_DEBUG")
10+
add_subdirectory(external)
1211

13-
# use, i.e. don't skip the full RPATH for the build tree
14-
SET(CMAKE_SKIP_BUILD_RPATH FALSE)
15-
16-
# when building, don't use the install RPATH already
17-
# (but later on when installing)
18-
SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
19-
20-
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
21-
22-
# add the automatically determined parts of the RPATH
23-
# which point to directories outside the build tree to the install RPATH
24-
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
25-
26-
# the RPATH to be used when installing, but only if it's not a system directory
27-
LIST(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
28-
IF("${isSystemDir}" STREQUAL "-1")
29-
SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
30-
ENDIF("${isSystemDir}" STREQUAL "-1")
31-
32-
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
33-
34-
set(THREADS_PREFER_PTHREAD_FLAG ON)
35-
find_package(Threads REQUIRED)
36-
37-
find_package( Boost 1.58 COMPONENTS system filesystem thread iostreams serialization REQUIRED )
38-
add_library(boost INTERFACE)
39-
target_link_libraries(boost INTERFACE ${Boost_LIBRARIES})
40-
target_include_directories(boost INTERFACE SYSTEM ${Boost_INCLUDE_DIR})
41-
42-
find_package(OpenSSL REQUIRED)
43-
add_library(openssl INTERFACE)
44-
target_link_libraries(openssl INTERFACE ${OPENSSL_LIBRARIES})
45-
target_include_directories(openssl INTERFACE SYSTEM ${OPENSSL_INCLUDE_DIR})
46-
47-
add_library(Ranges INTERFACE)
48-
target_include_directories(Ranges INTERFACE SYSTEM libs/range-v3/include)
49-
50-
add_library(clipp INTERFACE)
51-
target_include_directories(clipp INTERFACE SYSTEM libs/clipp/include)
52-
53-
link_directories(/usr/local/lib)
54-
include_directories("src")
55-
56-
set(PYBIND11_INSTALL true)
57-
add_subdirectory(libs/pybind11)
58-
59-
add_subdirectory(libs/variant)
60-
61-
add_subdirectory(libs/type_safe)
62-
63-
add_subdirectory(src/blocksci)
64-
add_subdirectory(src/parser)
65-
add_subdirectory(src/mempool_recorder)
66-
add_subdirectory(src/python-interface)
67-
add_subdirectory(src/example)
12+
add_subdirectory(src)
13+
add_subdirectory(tools)
14+
add_subdirectory(benchmark)
15+
add_subdirectory(example)

Notebooks/BlockSci Demo.ipynb

+6-5
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106
"metadata": {},
107107
"outputs": [],
108108
"source": [
109-
"%time txes = chain.address_type_txes(0, len(chain), blocksci.address_type.nulldata)"
109+
"%time txes = chain.blocks.txes.including_output_of_type(blocksci.address_type.nulldata).all"
110110
]
111111
},
112112
{
@@ -156,8 +156,10 @@
156156
"metadata": {},
157157
"outputs": [],
158158
"source": [
159-
"fees = [sum(block.txes.fee) / len(block) for block in chain.range('2017')]\n",
160-
"times = [block.time for block in chain.range('2017')]"
159+
"# BlockSci vectorized interface\n",
160+
"blocks = chain.range('2017')\n",
161+
"fees = blocks.fee / blocks.tx_count\n",
162+
"times = blocks.time"
161163
]
162164
},
163165
{
@@ -233,10 +235,9 @@
233235
"metadata": {},
234236
"outputs": [],
235237
"source": [
236-
"import blocksci.cluster_python\n",
237238
"# cluster_data_directory should be set to the directory containing the\n",
238239
"# output of the `clusterer` program\n",
239-
"cm = blocksci.cluster_python.ClusterManager(cluster_data_directory, chain)"
240+
"cm = blocksci.cluster.ClusterManager(cluster_data_directory, chain)"
240241
]
241242
},
242243
{

Notebooks/blocksci/templateMakefile

-46
This file was deleted.

0 commit comments

Comments
 (0)