Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(deps): bump tornado from 6.4.1 to 6.4.2 #12

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
BasedOnStyle: Google
IndentWidth: 4
TabWidth: 4
UseTab: Never
BreakBeforeBraces: Attach
SpaceBeforeParens: ControlStatements
PointerAlignment: Left
AllowShortFunctionsOnASingleLine: Inline
ColumnLimit: 120
NamespaceIndentation: All
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@ venv
cmake-build-debug
.vscode
*.ipynb_checkpoints

*.png
*.pdf
22 changes: 10 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,22 @@ RUN apt-get install -y cmake libtool autoconf libboost-filesystem-dev \
python3-pip pkg-config git g++-7 gcc-7 ffmpeg libcairo2 libcairo2-dev curl


ADD . /blocksci-compilable
ADD . /blocksci

# Clone BlockSci repository
# RUN git clone https://github.com/mmstanone/blocksci-compilable.git

RUN curl -LsSf https://astral.sh/uv/install.sh | sh
RUN /root/.cargo/bin/uv python install 3.8.20
RUN /root/.cargo/bin/uv python pin 3.8.20
RUN /root/.local/bin/uv python install 3.8.20
RUN /root/.local/bin/uv python pin 3.8.20

RUN /root/.cargo/bin/uv run which pip3
RUN /root/.local/bin/uv run which pip3

RUN mkdir -p /usr/lib/python3.8/site-packages/

RUN cd /blocksci-compilable && \
/root/.cargo/bin/uv venv && CC=gcc-7 CXX=g++ /root/.cargo/bin/uv run pip3 install -r /blocksci-compilable/pip-all-requirements.txt
RUN cd /blocksci && \
/root/.local/bin/uv venv && CC=gcc-7 CXX=g++ /root/.local/bin/uv run pip3 install -r /blocksci/pip-all-requirements.txt

# Build BlockSci
RUN cd blocksci-compilable && \
RUN cd blocksci && \
rm -rf build && \
mkdir build && \
cd build && \
Expand All @@ -42,12 +40,12 @@ RUN cd blocksci-compilable && \

# Install BlockSci Python bindings

RUN cd blocksci-compilable && rm -rf blockscipy/build && \
/root/.cargo/bin/uv venv && CC=gcc-7 CXX=g++-7 /root/.cargo/bin/uv run pip3 install -e blockscipy
RUN cd blocksci && rm -rf blockscipy/build && \
/root/.local/bin/uv venv && CC=gcc-7 CXX=g++-7 /root/.local/bin/uv run pip3 install -e blockscipy

# remove the build folder for blockscipy, as we will rebuild again anyway

RUN rm -rf /blocksci-compilable/blokscipy/build
RUN rm -rf /blocksci/blockscipy/build

# Set the default command for the container
CMD ["/bin/bash"]
Expand Down
49 changes: 39 additions & 10 deletions Notebooks/BlockSci Demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -35,12 +35,16 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"# parser_data_directory should be set to the data-directory which the blocksci_parser output\n",
"chain = blocksci.Blockchain(parser_data_directory)"
"from pathlib import Path\n",
"\n",
"parser_data_directory = Path(\"/mnt/anal/config.json\")\n",
"\n",
"chain = blocksci.Blockchain(str(parser_data_directory))"
]
},
{
Expand Down Expand Up @@ -223,21 +227,44 @@
{
"cell_type": "markdown",
"metadata": {
"collapsed": true
"collapsed": true,
"jupyter": {
"outputs_hidden": true
}
},
"source": [
"# Balance held by cluster"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"# cluster_data_directory should be set to the directory containing the\n",
"# output of the `clusterer` program\n",
"cm = blocksci.cluster.ClusterManager(cluster_data_directory, chain)"
"cm = blocksci.cluster.ClusterManager.create_clustering(\"/mnt/anal/simple_cluster/\", chain, 510000, 510100, should_overwrite=True)"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"True"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"len(cm.clusters()) > 1892728890"
]
},
{
Expand All @@ -249,13 +276,15 @@
"# Find the balance held by the cluster containing the given address at block height 494653 \n",
"address = chain.address_from_string(\"3EhLZarJUNSfV6TWMZY1Nh5mi3FMsdHa5U\")\n",
"cluster = cm.cluster_with_address(address)\n",
"sum(address.balance(494653) for address in cluster.addresses) / 1e8"
"sum(address.balance(494653) for address in cluster.addresses) / 1e8\n",
"\n",
"# 1892728890"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -269,9 +298,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.5.2"
"version": "3.8.10"
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
Loading