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

feat: implement docker and docker compose for run project on local host #3

Open
wants to merge 1 commit into
base: main
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
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FLASK_APP=api
2 changes: 1 addition & 1 deletion API.yaml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
bscscan: XXX
bscscan: <your api key here>
29 changes: 29 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
FROM python:3.9.13

ARG ENVIRONMENT=default

ENV PYTHONUNBUFFERED 1 \
PIP_NO_CACHE_DIR=off \
PIP_DISABLE_PIP_VERSION_CHECK=1

WORKDIR /app

COPY requirements.txt /tmp/requirements.txt

RUN set -x \
&& buildDeps=" \
build-essential \
libpq-dev \
unzip \
" \
&& runDeps=" \
git \
" \
&& apt-get update \
&& apt-get install -y --no-install-recommends $buildDeps \
&& apt-get install -y --no-install-recommends $runDeps \
&& pip install -r /tmp/requirements.txt \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

COPY . .
28 changes: 26 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Unzip it, install requeriments and execute it.
unzip poorSKeme.zip
cd poorSKeme
pip install -r requirements.txt
python3 poorSKeme --help
python3 collector --help
```
```
$$$$$$$\ $$$$$$\ $$\ $$\
Expand All @@ -42,7 +42,7 @@ $$ | \$$$$$$ |\$$$$$$ |$$ | \$$$$$$ |$$ | \$$\$$$$$$$\ $$ | $
\__| \______/ \______/ \__| \______/ \__| \__|\_______|\__| \__| \__| \_______|


usage: poorSKeme.py [-h] [-c CHUNK] [-ct CONTRACT] [-bf BLOCK_FROM] [-bt BLOCK_TO] [-f FILE] [-w]
usage: collector.py [-h] [-c CHUNK] [-ct CONTRACT] [-bf BLOCK_FROM] [-bt BLOCK_TO] [-f FILE] [-w]

PONZI contract analyzer

Expand All @@ -67,6 +67,30 @@ optional arguments:
```
If you use the web param, the port is 4200. The complete url is http://127.0.0.1:4200.

# Install using docker.

1. Configure your bsc API Key in the API.yaml file. for get the key go to next link https://bscscan.com/myapikey.

2. Download the example contract information (it can be takes some minutes)

``` shell
docker compose run --rm api python poorSKeme.py -ct 0xe878BccA052579C9061566Cec154B783Fc5b9fF1 -bf 14040726 -bt 15552901
```

3. Install frontend dependencies

``` shell
docker compose run --rm console npm i
```

4. Run services (api in port 5000 and frontend in port 4200)

``` shell
docker compose up
```

Open http://localhost:4200 for explore the contract.

# API
Get the Free API from https://bscscan.com/apis
Load them in the API.yaml file replacing the XXX by the APIKey
Expand Down
Loading