forked from HemeraProtocol/hemera-indexer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request HemeraProtocol#174 from HemeraProtocol/pre-release…
…/v0.3.0 Release/v0.3.0
- Loading branch information
Showing
277 changed files
with
35,640 additions
and
1,711 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: Hemera Indexer Continuous Integration | ||
|
||
on: [pull_request] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
services: | ||
postgres: | ||
image: postgres:15 | ||
env: | ||
POSTGRES_USER: hemera | ||
POSTGRES_PASSWORD: password | ||
options: >- | ||
--health-cmd pg_isready | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
ports: | ||
- 5432:5432 | ||
env: | ||
ETHEREUM_PUBLIC_NODE_DEBUG_RPC_URL: '${{ secrets.ETHEREUM_PUBLIC_NODE_DEBUG_RPC_URL }}' | ||
ETHEREUM_PUBLIC_NODE_RPC_URL: '${{ secrets.ETHEREUM_PUBLIC_NODE_RPC_URL }}' | ||
LINEA_PUBLIC_NODE_DEBUG_RPC_URL: '${{ secrets.LINEA_PUBLIC_NODE_DEBUG_RPC_URL }}' | ||
LINEA_PUBLIC_NODE_RPC_URL: '${{ secrets.LINEA_PUBLIC_NODE_RPC_URL }}' | ||
POSTGRES_USER: hemera | ||
POSTGRES_PASSWORD: password | ||
POSTGRES_URL: postgresql://hemera:password@localhost:5432/hemera | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: '3.9' | ||
|
||
- name: Install dependencies | ||
run: | | ||
pip install --upgrade pip | ||
pip install poetry | ||
poetry update | ||
poetry install -v | ||
poetry show | ||
- name: Set PYTHONPATH | ||
run: echo "PYTHONPATH=\$PYTHONPATH:$(pwd)" >> $GITHUB_ENV | ||
|
||
- name: Verify PYTHONPATH | ||
run: echo $PYTHONPATH | ||
|
||
- name: Init database | ||
run: | | ||
export PYTHONPATH=$(pwd) | ||
make init_db | ||
- name: Pipeline Test with pytest | ||
run: | | ||
export PYTHONPATH=$(pwd) | ||
make test indexer |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Python application unit test | ||
|
||
on: [pull_request] | ||
|
||
jobs: | ||
test: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: '3.9' | ||
|
||
- name: Install dependencies | ||
run: | | ||
pip install --upgrade pip | ||
pip install poetry | ||
poetry update | ||
poetry install -v | ||
- name: Set PYTHONPATH | ||
run: echo "PYTHONPATH=\$PYTHONPATH:$(pwd)" >> $GITHUB_ENV | ||
|
||
- name: Verify PYTHONPATH | ||
run: echo $PYTHONPATH | ||
|
||
- name: Unit Test with pytest | ||
env: | ||
ETHEREUM_PUBLIC_NODE_DEBUG_RPC_URL: '${{ secrets.ETHEREUM_PUBLIC_NODE_DEBUG_RPC_URL }}' | ||
ETHEREUM_PUBLIC_NODE_RPC_URL: '${{ secrets.ETHEREUM_PUBLIC_NODE_RPC_URL }}' | ||
LINEA_PUBLIC_NODE_DEBUG_RPC_URL: '${{ secrets.LINEA_PUBLIC_NODE_DEBUG_RPC_URL }}' | ||
LINEA_PUBLIC_NODE_RPC_URL: '${{ secrets.LINEA_PUBLIC_NODE_RPC_URL }}' | ||
run: | | ||
export PYTHONPATH=$(pwd) | ||
make test indexer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,22 @@ | ||
FROM python:3.9-slim | ||
FROM python:3.9-slim AS builder | ||
|
||
ENV PYTHONUNBUFFERED=1 | ||
ENV PYTHONDONTWRITEBYTECODE=1 | ||
|
||
WORKDIR /app | ||
RUN pip install poetry && poetry config virtualenvs.in-project true | ||
|
||
WORKDIR "/app" | ||
COPY . . | ||
|
||
RUN pip install --no-cache-dir build && \ | ||
python -m build && \ | ||
pip install dist/*.whl && \ | ||
rm dist/*.whl | ||
RUN poetry install | ||
RUN poetry build | ||
|
||
FROM python:3.9-slim | ||
|
||
WORKDIR "/app" | ||
|
||
ENV PYTHONPATH=/app:$PYTHONPATH | ||
COPY --from=builder /app/migrations ./migrations | ||
COPY --from=builder /app/dist/*.whl . | ||
RUN pip install *.whl | ||
|
||
ENTRYPOINT ["hemera"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
from pathlib import Path | ||
|
||
VERSION_FILE = Path(__file__).parent / "VERSION" | ||
__version__ = VERSION_FILE.read_text().strip() | ||
import tomli | ||
|
||
__version__ = "0.3.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from flask_restx.namespace import Namespace | ||
|
||
address_features_namespace = Namespace( | ||
"Address Features", | ||
path="/", | ||
description="Address Features API", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
from sqlalchemy import Column, Integer, PrimaryKeyConstraint, func | ||
from sqlalchemy.dialects.postgresql import BOOLEAN, BYTEA, INTEGER, NUMERIC, TEXT, TIMESTAMP | ||
|
||
from common.models import HemeraModel | ||
|
||
|
||
class AddressBaseProfile(HemeraModel): | ||
__tablename__ = "af_base_profile" | ||
|
||
address = Column(BYTEA, primary_key=True, nullable=False) | ||
init_funding_from_address = Column(BYTEA) | ||
init_funding_value = Column(NUMERIC) | ||
init_funding_transaction_hash = Column(BYTEA) | ||
init_funding_block_timestamp = Column(TIMESTAMP) | ||
init_block_hash = Column(BYTEA) | ||
init_block_number = Column(INTEGER) | ||
creation_code = Column(BYTEA) | ||
deployed_code = Column(BYTEA) | ||
deployed_block_timestamp = Column(TIMESTAMP) | ||
deployed_block_number = Column(INTEGER) | ||
deployed_block_hash = Column(BYTEA) | ||
deployed_transaction_hash = Column(BYTEA) | ||
deployed_internal_transaction_from_address = Column(BYTEA) | ||
deployed_transaction_from_address = Column(BYTEA) | ||
deployed_trace_id = Column(TEXT) | ||
is_contract = Column(BOOLEAN) | ||
first_transaction_hash = Column(BYTEA) | ||
first_block_hash = Column(BYTEA) | ||
first_block_number = Column(INTEGER) | ||
first_block_timestamp = Column(TIMESTAMP) | ||
first_trace_id = Column(TEXT) | ||
first_is_from_address = Column(BOOLEAN) | ||
first_trace_type = Column(TEXT) | ||
first_call_type = Column(TEXT) | ||
|
||
|
||
class ScheduledMetadata(HemeraModel): | ||
__tablename__ = "af_base_na_scheduled_metadata" | ||
|
||
id = Column(Integer, primary_key=True) | ||
dag_id = Column(TEXT) | ||
execution_date = Column(TIMESTAMP) | ||
last_data_timestamp = Column(TIMESTAMP) |
Oops, something went wrong.