diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1a519de1..ef22697d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,28 +1,33 @@ name: Build +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true on: push: branches: - - 'master' + - '**' tags: - - 'v*.*.*' - pull_request: - branches: - - 'master' + - '*.*.*' jobs: build: name: Build - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 env: - ACTIONS_ALLOW_UNSECURE_COMMANDS: true DOCKER_REGISTRY: ghcr.io DOCKER_IMAGE_NAME: ${{ github.repository }} + steps: - name: Check out the repo uses: actions/checkout@v2 + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v2 + with: + install: true - name: Log in to the registry uses: docker/login-action@v1 @@ -31,19 +36,25 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Indexer image tags & labels + - name: Set up metadata id: meta uses: docker/metadata-action@v3 with: images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_NAME }} + flavor: | + latest=false + tags: | + type=ref,event=branch + type=ref,event=tag - - name: Indexer image build & push - uses: docker/build-push-action@v2 + - name: Publish nightly image + uses: docker/build-push-action@v3 with: - context: tezos_domains - file: tezos_domains/deploy/Dockerfile + context: api/tzprofiles + file: api/tzprofiles/deploy/Dockerfile + platforms: linux/amd64 push: true cache-from: type=gha cache-to: type=gha,mode=max tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file + labels: ${{ steps.meta.outputs.labels }} diff --git a/api/README.md b/api/README.md index cbea88f5..da3edecf 100644 --- a/api/README.md +++ b/api/README.md @@ -2,7 +2,7 @@ For convenience the retrieval function of the SDK is exposed as an API ([service/](service)). -And for performances, an indexer ([tzprofiles_indexer/](indexer)) stores the retrieved +And for performances, an indexer ([tzprofiles/](indexer)) stores the retrieved claims for every profile deployed. You can deploy both using the [docker-compose file](docker-compose.yml). diff --git a/api/tzprofiles_indexer/.dockerignore b/api/tzprofiles/.dockerignore similarity index 92% rename from api/tzprofiles_indexer/.dockerignore rename to api/tzprofiles/.dockerignore index f324b67d..be4140ec 100644 --- a/api/tzprofiles_indexer/.dockerignore +++ b/api/tzprofiles/.dockerignore @@ -2,7 +2,7 @@ * # Add metadata and build files -!tzprofiles_indexer +!tzprofiles !pyproject.toml !pdm.lock !README.md diff --git a/api/tzprofiles_indexer/.gitignore b/api/tzprofiles/.gitignore similarity index 94% rename from api/tzprofiles_indexer/.gitignore rename to api/tzprofiles/.gitignore index fd2b5c26..6a945192 100644 --- a/api/tzprofiles_indexer/.gitignore +++ b/api/tzprofiles/.gitignore @@ -3,7 +3,7 @@ !*/ # Add metadata and build files -!tzprofiles_indexer +!tzprofiles !.gitignore !.dockerignore !py.typed diff --git a/api/tzprofiles_indexer/README.md b/api/tzprofiles/README.md similarity index 97% rename from api/tzprofiles_indexer/README.md rename to api/tzprofiles/README.md index 108b6b26..a31ee182 100644 --- a/api/tzprofiles_indexer/README.md +++ b/api/tzprofiles/README.md @@ -1,6 +1,6 @@ -# tzprofiles_indexer +# tzprofiles -Tezos Profiles (TZP) is a web application that helps users regain control +DipDup indexer for Tezos Profiles ## Installation diff --git a/api/tzprofiles_indexer/__init__.py b/api/tzprofiles/__init__.py similarity index 100% rename from api/tzprofiles_indexer/__init__.py rename to api/tzprofiles/__init__.py diff --git a/api/tzprofiles_indexer/abi/.keep b/api/tzprofiles/abi/.keep similarity index 100% rename from api/tzprofiles_indexer/abi/.keep rename to api/tzprofiles/abi/.keep diff --git a/api/tzprofiles_indexer/configs/.keep b/api/tzprofiles/configs/.keep similarity index 100% rename from api/tzprofiles_indexer/configs/.keep rename to api/tzprofiles/configs/.keep diff --git a/api/tzprofiles_indexer/configs/dipdup.compose.yaml b/api/tzprofiles/configs/dipdup.compose.yaml similarity index 77% rename from api/tzprofiles_indexer/configs/dipdup.compose.yaml rename to api/tzprofiles/configs/dipdup.compose.yaml index d98cd924..98824f36 100644 --- a/api/tzprofiles_indexer/configs/dipdup.compose.yaml +++ b/api/tzprofiles/configs/dipdup.compose.yaml @@ -14,4 +14,9 @@ hasura: sentry: dsn: ${SENTRY_DSN:-""} - environment: ${SENTRY_ENVIRONMENT:-compose} \ No newline at end of file + environment: ${SENTRY_ENVIRONMENT:-""} + +prometheus: + host: 0.0.0.0 + +logging: ${LOGLEVEL:-INFO} \ No newline at end of file diff --git a/api/tzprofiles/configs/dipdup.sqlite.yaml b/api/tzprofiles/configs/dipdup.sqlite.yaml new file mode 100644 index 00000000..2ad3ded7 --- /dev/null +++ b/api/tzprofiles/configs/dipdup.sqlite.yaml @@ -0,0 +1,5 @@ +database: + kind: sqlite + path: ${SQLITE_PATH:-/tmp/tzprofiles.sqlite} + +logging: ${LOGLEVEL:-INFO} \ No newline at end of file diff --git a/api/tzprofiles_indexer/configs/dipdup.swarm.yaml b/api/tzprofiles/configs/dipdup.swarm.yaml similarity index 61% rename from api/tzprofiles_indexer/configs/dipdup.swarm.yaml rename to api/tzprofiles/configs/dipdup.swarm.yaml index 7c90fe2c..edf123dd 100644 --- a/api/tzprofiles_indexer/configs/dipdup.swarm.yaml +++ b/api/tzprofiles/configs/dipdup.swarm.yaml @@ -1,20 +1,22 @@ database: kind: postgres - host: tzprofiles_indexer_db + host: ${POSTGRES_HOST:-tzprofiles_db} port: 5432 user: ${POSTGRES_USER:-dipdup} password: ${POSTGRES_PASSWORD} database: ${POSTGRES_DB:-dipdup} hasura: - url: http://tzprofiles_indexer_hasura:8080 + url: http://${HASURA_HOST:-tzprofiles_hasura}:8080 admin_secret: ${HASURA_SECRET} allow_aggregations: false camel_case: true sentry: dsn: ${SENTRY_DSN:-""} - environment: ${SENTRY_ENVIRONMENT:-swarm} + environment: ${SENTRY_ENVIRONMENT:-""} prometheus: - host: 0.0.0.0 \ No newline at end of file + host: 0.0.0.0 + +logging: ${LOGLEVEL:-INFO} \ No newline at end of file diff --git a/api/tzprofiles_indexer/configs/replay.yaml b/api/tzprofiles/configs/replay.yaml similarity index 50% rename from api/tzprofiles_indexer/configs/replay.yaml rename to api/tzprofiles/configs/replay.yaml index 7b676823..52f868e9 100644 --- a/api/tzprofiles_indexer/configs/replay.yaml +++ b/api/tzprofiles/configs/replay.yaml @@ -3,12 +3,13 @@ spec_version: 2.0 replay: dipdup_version: 7 template: demo_blank - package: tzprofiles_indexer + package: tzprofiles version: 0.0.1 - description: Tezos Profiles (TZP) is a web application that helps users regain control + description: DipDup indexer for Tezos Profiles license: Apache 2.0 - name: + name: Spruce Systems, Inc. email: - postgresql_image: postgres:15 - hasura_image: hasura/graphql-engine:v2.30.0 + postgres_image: postgres:15 + postgres_data_path: /var/lib/postgresql/data + hasura_image: hasura/graphql-engine:latest line_length: 120 diff --git a/api/tzprofiles_indexer/deploy/.env.default b/api/tzprofiles/deploy/.env.default similarity index 89% rename from api/tzprofiles_indexer/deploy/.env.default rename to api/tzprofiles/deploy/.env.default index 937dcfc5..00b262cb 100644 --- a/api/tzprofiles_indexer/deploy/.env.default +++ b/api/tzprofiles/deploy/.env.default @@ -3,9 +3,10 @@ # HASURA_HOST=hasura HASURA_SECRET= +LOGLEVEL=INFO POSTGRES_DB=dipdup POSTGRES_HOST=db POSTGRES_PASSWORD= POSTGRES_USER=dipdup SENTRY_DSN="" -SENTRY_ENVIRONMENT=compose +SENTRY_ENVIRONMENT="" diff --git a/api/tzprofiles_indexer/deploy/.keep b/api/tzprofiles/deploy/.keep similarity index 100% rename from api/tzprofiles_indexer/deploy/.keep rename to api/tzprofiles/deploy/.keep diff --git a/api/tzprofiles/deploy/Dockerfile b/api/tzprofiles/deploy/Dockerfile new file mode 100644 index 00000000..f5aaca6f --- /dev/null +++ b/api/tzprofiles/deploy/Dockerfile @@ -0,0 +1,9 @@ +FROM dipdup/dipdup:7 +# FROM ghcr.io/dipdup-io/dipdup:7 +# FROM ghcr.io/dipdup-io/dipdup:next + +COPY --chown=dipdup pyproject.toml README.md . +RUN pip install . + +COPY --chown=dipdup . tzprofiles +WORKDIR tzprofiles \ No newline at end of file diff --git a/api/tzprofiles_indexer/deploy/compose.sqlite.yaml b/api/tzprofiles/deploy/compose.sqlite.yaml similarity index 75% rename from api/tzprofiles_indexer/deploy/compose.sqlite.yaml rename to api/tzprofiles/deploy/compose.sqlite.yaml index b5b2ffd3..6bb3b8d1 100644 --- a/api/tzprofiles_indexer/deploy/compose.sqlite.yaml +++ b/api/tzprofiles/deploy/compose.sqlite.yaml @@ -1,4 +1,5 @@ -name: tzprofiles_indexer +version: "3.8" +name: tzprofiles services: dipdup: @@ -12,7 +13,7 @@ services: - 46339 - 9000 volumes: - - sqlite:${SQLITE_PATH:-/tmp/tzprofiles_indexer.sqlite} + - sqlite:${SQLITE_PATH:-/tmp/tzprofiles.sqlite} volumes: sqlite: \ No newline at end of file diff --git a/api/tzprofiles_indexer/deploy/compose.swarm.yaml b/api/tzprofiles/deploy/compose.swarm.yaml similarity index 91% rename from api/tzprofiles_indexer/deploy/compose.swarm.yaml rename to api/tzprofiles/deploy/compose.swarm.yaml index 2248b890..44d337f4 100644 --- a/api/tzprofiles_indexer/deploy/compose.swarm.yaml +++ b/api/tzprofiles/deploy/compose.swarm.yaml @@ -1,4 +1,5 @@ -name: tzprofiles_indexer +version: "3.8" +name: tzprofiles services: dipdup: @@ -9,7 +10,7 @@ services: command: ["-c", "dipdup.yaml", "-c", "configs/dipdup.swarm.yaml", "run"] env_file: .env networks: - - dipdup-private + - internal - prometheus-private deploy: mode: replicated @@ -32,7 +33,7 @@ services: volumes: - db:/var/lib/postgresql/data env_file: .env - environment: + environment: - POSTGRES_USER=dipdup - POSTGRES_DB=dipdup - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} @@ -42,7 +43,7 @@ services: timeout: 5s retries: 5 networks: - - dipdup-private + - internal deploy: mode: replicated replicas: 1 @@ -50,11 +51,11 @@ services: logging: *logging hasura: - image: hasura/graphql-engine:v2.30.0 + image: hasura/graphql-engine:latest depends_on: - db environment: - - HASURA_GRAPHQL_DATABASE_URL=postgres://dipdup:${POSTGRES_PASSWORD}@tzprofiles_indexer_db:5432/dipdup + - HASURA_GRAPHQL_DATABASE_URL=postgres://dipdup:${POSTGRES_PASSWORD}@tzprofiles_db:5432/dipdup - HASURA_GRAPHQL_ADMIN_SECRET=${HASURA_SECRET} - HASURA_GRAPHQL_ENABLE_CONSOLE=true - HASURA_GRAPHQL_DEV_MODE=false @@ -63,7 +64,7 @@ services: - HASURA_GRAPHQL_UNAUTHORIZED_ROLE=user - HASURA_GRAPHQL_STRINGIFY_NUMERIC_TYPES=true networks: - - dipdup-private + - internal - traefik-public deploy: mode: replicated @@ -84,7 +85,7 @@ volumes: db: networks: - dipdup-private: + internal: traefik-public: external: true prometheus-private: diff --git a/api/tzprofiles_indexer/deploy/compose.yaml b/api/tzprofiles/deploy/compose.yaml similarity index 94% rename from api/tzprofiles_indexer/deploy/compose.yaml rename to api/tzprofiles/deploy/compose.yaml index a0130d0d..40531ee8 100644 --- a/api/tzprofiles_indexer/deploy/compose.yaml +++ b/api/tzprofiles/deploy/compose.yaml @@ -1,4 +1,5 @@ -name: tzprofiles_indexer +version: "3.8" +name: tzprofiles services: dipdup: @@ -34,7 +35,7 @@ services: retries: 5 hasura: - image: hasura/graphql-engine:v2.30.0 + image: hasura/graphql-engine:latest ports: - 8080 depends_on: diff --git a/api/tzprofiles_indexer/deploy/sqlite.env.default b/api/tzprofiles/deploy/sqlite.env.default similarity index 68% rename from api/tzprofiles_indexer/deploy/sqlite.env.default rename to api/tzprofiles/deploy/sqlite.env.default index 8c3d6675..68aa3da6 100644 --- a/api/tzprofiles_indexer/deploy/sqlite.env.default +++ b/api/tzprofiles/deploy/sqlite.env.default @@ -1,6 +1,5 @@ # This env file was generated automatically by DipDup. Do not edit it! # Create a copy with .env extension, fill it with your values and run DipDup with `--env-file` option. # -SENTRY_DSN="" -SENTRY_ENVIRONMENT=dev -SQLITE_PATH=/tmp/tzprofiles_indexer.sqlite +LOGLEVEL=INFO +SQLITE_PATH=/tmp/tzprofiles.sqlite diff --git a/api/tzprofiles_indexer/deploy/swarm.env.default b/api/tzprofiles/deploy/swarm.env.default similarity index 73% rename from api/tzprofiles_indexer/deploy/swarm.env.default rename to api/tzprofiles/deploy/swarm.env.default index 2caf0344..75bc4278 100644 --- a/api/tzprofiles_indexer/deploy/swarm.env.default +++ b/api/tzprofiles/deploy/swarm.env.default @@ -1,9 +1,12 @@ # This env file was generated automatically by DipDup. Do not edit it! # Create a copy with .env extension, fill it with your values and run DipDup with `--env-file` option. # +HASURA_HOST=tzprofiles_hasura HASURA_SECRET= +LOGLEVEL=INFO POSTGRES_DB=dipdup +POSTGRES_HOST=tzprofiles_db POSTGRES_PASSWORD= POSTGRES_USER=dipdup SENTRY_DSN="" -SENTRY_ENVIRONMENT=swarm +SENTRY_ENVIRONMENT="" diff --git a/api/tzprofiles_indexer/dipdup.yaml b/api/tzprofiles/dipdup.yaml similarity index 95% rename from api/tzprofiles_indexer/dipdup.yaml rename to api/tzprofiles/dipdup.yaml index 2ec319a3..1dee898c 100644 --- a/api/tzprofiles_indexer/dipdup.yaml +++ b/api/tzprofiles/dipdup.yaml @@ -1,5 +1,5 @@ spec_version: 2.0 -package: tzprofiles_indexer +package: tzprofiles contracts: tzprofile: @@ -57,5 +57,5 @@ jobs: advanced: early_realtime: False - postpone_jobs: False + postpone_jobs: True merge_subscriptions: True diff --git a/api/tzprofiles_indexer/graphql/.keep b/api/tzprofiles/graphql/.keep similarity index 100% rename from api/tzprofiles_indexer/graphql/.keep rename to api/tzprofiles/graphql/.keep diff --git a/api/tzprofiles_indexer/handlers/.keep b/api/tzprofiles/handlers/.keep similarity index 100% rename from api/tzprofiles_indexer/handlers/.keep rename to api/tzprofiles/handlers/.keep diff --git a/api/tzprofiles_indexer/handlers/__init__.py b/api/tzprofiles/handlers/__init__.py similarity index 97% rename from api/tzprofiles_indexer/handlers/__init__.py rename to api/tzprofiles/handlers/__init__.py index 6ccc6191..78441727 100644 --- a/api/tzprofiles_indexer/handlers/__init__.py +++ b/api/tzprofiles/handlers/__init__.py @@ -14,9 +14,9 @@ from tenacity import stop_after_attempt from tenacity import wait_exponential -from tzprofiles_indexer.models import TZProfile -from tzprofiles_indexer.types.tzprofile import tezos_storage as storage -from tzprofiles_indexer.types.tzprofile_old import tezos_storage as old_storage +from tzprofiles.models import TZProfile +from tzprofiles.types.tzprofile import tezos_storage as storage +from tzprofiles.types.tzprofile_old import tezos_storage as old_storage Claim = storage.Claim | old_storage.Claim ClaimList = list[storage.Claim] | list[old_storage.Claim] diff --git a/api/tzprofiles_indexer/handlers/on_origination.py b/api/tzprofiles/handlers/on_origination.py similarity index 68% rename from api/tzprofiles_indexer/handlers/on_origination.py rename to api/tzprofiles/handlers/on_origination.py index 1bfd77fc..330ba49e 100644 --- a/api/tzprofiles_indexer/handlers/on_origination.py +++ b/api/tzprofiles/handlers/on_origination.py @@ -1,10 +1,10 @@ from dipdup.context import HandlerContext from dipdup.models.tezos_tzkt import TzktOrigination -from tzprofiles_indexer import models -from tzprofiles_indexer.handlers import save_claims -from tzprofiles_indexer.types.tzprofile.tezos_storage import TzprofileStorage -from tzprofiles_indexer.types.tzprofile_old.tezos_storage import TzprofileOldStorage +from tzprofiles import models +from tzprofiles.handlers import save_claims +from tzprofiles.types.tzprofile.tezos_storage import TzprofileStorage +from tzprofiles.types.tzprofile_old.tezos_storage import TzprofileOldStorage async def on_origination( diff --git a/api/tzprofiles_indexer/handlers/on_update.py b/api/tzprofiles/handlers/on_update.py similarity index 73% rename from api/tzprofiles_indexer/handlers/on_update.py rename to api/tzprofiles/handlers/on_update.py index 065776be..c473e10a 100644 --- a/api/tzprofiles_indexer/handlers/on_update.py +++ b/api/tzprofiles/handlers/on_update.py @@ -4,10 +4,10 @@ from dipdup.context import HandlerContext from dipdup.models.tezos_tzkt import TzktTransaction -import tzprofiles_indexer.models as models -from tzprofiles_indexer.handlers import save_claims -from tzprofiles_indexer.types.tzprofile.tezos_parameters.default import DefaultParameter -from tzprofiles_indexer.types.tzprofile.tezos_storage import TzprofileStorage +import tzprofiles.models as models +from tzprofiles.handlers import save_claims +from tzprofiles.types.tzprofile.tezos_parameters.default import DefaultParameter +from tzprofiles.types.tzprofile.tezos_storage import TzprofileStorage async def on_update( diff --git a/api/tzprofiles_indexer/hasura/.keep b/api/tzprofiles/hasura/.keep similarity index 100% rename from api/tzprofiles_indexer/hasura/.keep rename to api/tzprofiles/hasura/.keep diff --git a/api/tzprofiles_indexer/hooks/.keep b/api/tzprofiles/hooks/.keep similarity index 100% rename from api/tzprofiles_indexer/hooks/.keep rename to api/tzprofiles/hooks/.keep diff --git a/api/tzprofiles_indexer/hooks/on_index_rollback.py b/api/tzprofiles/hooks/on_index_rollback.py similarity index 100% rename from api/tzprofiles_indexer/hooks/on_index_rollback.py rename to api/tzprofiles/hooks/on_index_rollback.py diff --git a/api/tzprofiles_indexer/hooks/on_reindex.py b/api/tzprofiles/hooks/on_reindex.py similarity index 100% rename from api/tzprofiles_indexer/hooks/on_reindex.py rename to api/tzprofiles/hooks/on_reindex.py diff --git a/api/tzprofiles_indexer/hooks/on_restart.py b/api/tzprofiles/hooks/on_restart.py similarity index 100% rename from api/tzprofiles_indexer/hooks/on_restart.py rename to api/tzprofiles/hooks/on_restart.py diff --git a/api/tzprofiles_indexer/hooks/on_synchronized.py b/api/tzprofiles/hooks/on_synchronized.py similarity index 100% rename from api/tzprofiles_indexer/hooks/on_synchronized.py rename to api/tzprofiles/hooks/on_synchronized.py diff --git a/api/tzprofiles_indexer/hooks/resolver.py b/api/tzprofiles/hooks/resolver.py similarity index 85% rename from api/tzprofiles_indexer/hooks/resolver.py rename to api/tzprofiles/hooks/resolver.py index 58d6bd02..39958254 100644 --- a/api/tzprofiles_indexer/hooks/resolver.py +++ b/api/tzprofiles/hooks/resolver.py @@ -5,18 +5,26 @@ from dipdup.context import HookContext -from tzprofiles_indexer.handlers import resolve_profile -from tzprofiles_indexer.handlers import set_logger -from tzprofiles_indexer.models import TZProfile +from tzprofiles.handlers import resolve_profile +from tzprofiles.handlers import set_logger +from tzprofiles.models import TZProfile SLEEP = 5 _ENV_BATCH = os.getenv('BATCH') BATCH = int(_ENV_BATCH) if _ENV_BATCH is not None else 100 - +IGNORED_PROFILES = ( + 'KT1G6jaUQkRcxJcnrNLjCTn7xgD686PM2mEd', +) async def _resolve(ctx: HookContext, profile: TZProfile): ctx.logger.info(f'Resolving profile {profile.contract}') + if profile.contract in IGNORED_PROFILES: + profile.failed = True + profile.resolved = True + await profile.save() + return + success = False while not success: async with ctx.transactions.in_transaction(): @@ -28,6 +36,7 @@ async def _resolve(ctx: HookContext, profile: TZProfile): resolved_at = time.perf_counter() await profile.save() + assert profile.account is not None await ctx.update_contract_metadata( network='mainnet', diff --git a/api/tzprofiles_indexer/models/.keep b/api/tzprofiles/models/.keep similarity index 100% rename from api/tzprofiles_indexer/models/.keep rename to api/tzprofiles/models/.keep diff --git a/api/tzprofiles_indexer/models/__init__.py b/api/tzprofiles/models/__init__.py similarity index 100% rename from api/tzprofiles_indexer/models/__init__.py rename to api/tzprofiles/models/__init__.py diff --git a/api/tzprofiles_indexer/pdm.lock b/api/tzprofiles/pdm.lock similarity index 95% rename from api/tzprofiles_indexer/pdm.lock rename to api/tzprofiles/pdm.lock index 68898abd..5280a307 100644 --- a/api/tzprofiles_indexer/pdm.lock +++ b/api/tzprofiles/pdm.lock @@ -6,7 +6,7 @@ groups = ["default", "dev"] cross_platform = true static_urls = false lock_version = "4.3" -content_hash = "sha256:78f793a9dc10bb837f4610ac4489fa1c91e92722f78f7d1e22718dc16c494220" +content_hash = "sha256:4c2974fbd83bc660a5792adf0bce2abe20d617a6741f472c8d78b48c1afafde2" [[package]] name = "aiohttp" @@ -217,7 +217,7 @@ files = [ [[package]] name = "black" -version = "23.7.0" +version = "23.9.1" requires_python = ">=3.8" summary = "The uncompromising code formatter." dependencies = [ @@ -228,13 +228,13 @@ dependencies = [ "platformdirs>=2", ] files = [ - {file = "black-23.7.0-cp311-cp311-macosx_10_16_arm64.whl", hash = "sha256:b5b0ee6d96b345a8b420100b7d71ebfdd19fab5e8301aff48ec270042cd40ac2"}, - {file = "black-23.7.0-cp311-cp311-macosx_10_16_universal2.whl", hash = "sha256:893695a76b140881531062d48476ebe4a48f5d1e9388177e175d76234ca247cd"}, - {file = "black-23.7.0-cp311-cp311-macosx_10_16_x86_64.whl", hash = "sha256:c333286dc3ddca6fdff74670b911cccedacb4ef0a60b34e491b8a67c833b343a"}, - {file = "black-23.7.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:831d8f54c3a8c8cf55f64d0422ee875eecac26f5f649fb6c1df65316b67c8926"}, - {file = "black-23.7.0-cp311-cp311-win_amd64.whl", hash = "sha256:7f3bf2dec7d541b4619b8ce526bda74a6b0bffc480a163fed32eb8b3c9aed8ad"}, - {file = "black-23.7.0-py3-none-any.whl", hash = "sha256:9fd59d418c60c0348505f2ddf9609c1e1de8e7493eab96198fc89d9f865e7a96"}, - {file = "black-23.7.0.tar.gz", hash = "sha256:022a582720b0d9480ed82576c920a8c1dde97cc38ff11d8d8859b3bd6ca9eedb"}, + {file = "black-23.9.1-cp311-cp311-macosx_10_16_arm64.whl", hash = "sha256:8431445bf62d2a914b541da7ab3e2b4f3bc052d2ccbf157ebad18ea126efb91f"}, + {file = "black-23.9.1-cp311-cp311-macosx_10_16_universal2.whl", hash = "sha256:8fc1ddcf83f996247505db6b715294eba56ea9372e107fd54963c7553f2b6dfe"}, + {file = "black-23.9.1-cp311-cp311-macosx_10_16_x86_64.whl", hash = "sha256:7d30ec46de88091e4316b17ae58bbbfc12b2de05e069030f6b747dfc649ad186"}, + {file = "black-23.9.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:031e8c69f3d3b09e1aa471a926a1eeb0b9071f80b17689a655f7885ac9325a6f"}, + {file = "black-23.9.1-cp311-cp311-win_amd64.whl", hash = "sha256:538efb451cd50f43aba394e9ec7ad55a37598faae3348d723b59ea8e91616300"}, + {file = "black-23.9.1-py3-none-any.whl", hash = "sha256:6ccd59584cc834b6d127628713e4b6b968e5f79572da66284532525a042549f9"}, + {file = "black-23.9.1.tar.gz", hash = "sha256:24b6b3ff5c6d9ea08a8888f6977eae858e1f340d7260cf56d70a49823236b62d"}, ] [[package]] @@ -387,10 +387,8 @@ files = [ [[package]] name = "dipdup" -version = "7.0.0rc4" -requires_python = ">=3.11,<3.12" -editable = true -path = "../../../dipdup" +version = "7.0.0" +requires_python = "<3.12,>=3.11" summary = "Modular framework for creating selective indexers and featureful backends for dapps" dependencies = [ "APScheduler~=3.8", @@ -420,6 +418,10 @@ dependencies = [ "tortoise-orm==0.19.3", "web3~=6.2", ] +files = [ + {file = "dipdup-7.0.0-py3-none-any.whl", hash = "sha256:fff15430a1cc12a182876f5678f08ac3f596d16a994303e3ba341e7064164fd2"}, + {file = "dipdup-7.0.0.tar.gz", hash = "sha256:3403218f61b8b2dd3b75d2725ffb56b62d3e8fcbeafe76a4080c01e2e5ffa17d"}, +] [[package]] name = "dnspython" @@ -1293,27 +1295,27 @@ files = [ [[package]] name = "ruff" -version = "0.0.285" +version = "0.0.291" requires_python = ">=3.7" summary = "An extremely fast Python linter, written in Rust." files = [ - {file = "ruff-0.0.285-py3-none-macosx_10_7_x86_64.whl", hash = "sha256:72a3a0936369b986b0e959f9090206ed3c18f9e5e439ea5b8e6867c6707aded5"}, - {file = "ruff-0.0.285-py3-none-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl", hash = "sha256:0d9ab6ad16742eb78919e0fba09f914f042409df40ad63423c34bb20d350162a"}, - {file = "ruff-0.0.285-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6c48926156288b8ac005eb1db5e77c15e8a37309ae49d9fb6771d5cf5f777590"}, - {file = "ruff-0.0.285-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:1d2a60c102e7a5e147b58fc2cbea12a563c565383effc527c987ea2086a05742"}, - {file = "ruff-0.0.285-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b02aae62f922d088bb01943e1dbd861688ada13d735b78b8348a7d90121fd292"}, - {file = "ruff-0.0.285-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:f572c4296d8c7ddd22c3204de4031965be524fdd1fdaaef273945932912b28c5"}, - {file = "ruff-0.0.285-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:80effdf4fe69763d69eb4ab9443e186fd09e668b59fe70ba4b49f4c077d15a1b"}, - {file = "ruff-0.0.285-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5977ce304da35c263f5e082901bd7ac0bd2be845a8fcfd1a29e4d6680cddb307"}, - {file = "ruff-0.0.285-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:72a087712d474fa17b915d7cb9ef807e1256182b12ddfafb105eb00aeee48d1a"}, - {file = "ruff-0.0.285-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:7ce67736cd8dfe97162d1e7adfc2d9a1bac0efb9aaaff32e4042c7cde079f54b"}, - {file = "ruff-0.0.285-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:5473a4c6cac34f583bff08c5f63b8def5599a0ea4dc96c0302fbd2cc0b3ecbad"}, - {file = "ruff-0.0.285-py3-none-musllinux_1_2_i686.whl", hash = "sha256:e6b1c961d608d373a032f047a20bf3c55ad05f56c32e7b96dcca0830a2a72348"}, - {file = "ruff-0.0.285-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:2933cc9631f453305399c7b8fb72b113ad76b49ae1d7103cc4afd3a423bed164"}, - {file = "ruff-0.0.285-py3-none-win32.whl", hash = "sha256:770c5eb6376de024111443022cda534fb28980a9dd3b4abc83992a8770167ba6"}, - {file = "ruff-0.0.285-py3-none-win_amd64.whl", hash = "sha256:a8c6ad6b9cd77489bf6d1510950cbbe47a843aa234adff0960bae64bd06c3b6d"}, - {file = "ruff-0.0.285-py3-none-win_arm64.whl", hash = "sha256:de44fbc6c3b25fccee473ddf851416fd4e246fc6027b2197c395b1b3b3897921"}, - {file = "ruff-0.0.285.tar.gz", hash = "sha256:45866048d1dcdcc80855998cb26c4b2b05881f9e043d2e3bfe1aa36d9a2e8f28"}, + {file = "ruff-0.0.291-py3-none-macosx_10_7_x86_64.whl", hash = "sha256:b97d0d7c136a85badbc7fd8397fdbb336e9409b01c07027622f28dcd7db366f2"}, + {file = "ruff-0.0.291-py3-none-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl", hash = "sha256:6ab44ea607967171e18aa5c80335237be12f3a1523375fa0cede83c5cf77feb4"}, + {file = "ruff-0.0.291-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a04b384f2d36f00d5fb55313d52a7d66236531195ef08157a09c4728090f2ef0"}, + {file = "ruff-0.0.291-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:b727c219b43f903875b7503a76c86237a00d1a39579bb3e21ce027eec9534051"}, + {file = "ruff-0.0.291-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:87671e33175ae949702774071b35ed4937da06f11851af75cd087e1b5a488ac4"}, + {file = "ruff-0.0.291-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:b75f5801547f79b7541d72a211949754c21dc0705c70eddf7f21c88a64de8b97"}, + {file = "ruff-0.0.291-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b09b94efdcd162fe32b472b2dd5bf1c969fcc15b8ff52f478b048f41d4590e09"}, + {file = "ruff-0.0.291-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8d5b56bc3a2f83a7a1d7f4447c54d8d3db52021f726fdd55d549ca87bca5d747"}, + {file = "ruff-0.0.291-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:13f0d88e5f367b2dc8c7d90a8afdcfff9dd7d174e324fd3ed8e0b5cb5dc9b7f6"}, + {file = "ruff-0.0.291-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:b3eeee1b1a45a247758ecdc3ab26c307336d157aafc61edb98b825cadb153df3"}, + {file = "ruff-0.0.291-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:6c06006350c3bb689765d71f810128c9cdf4a1121fd01afc655c87bab4fb4f83"}, + {file = "ruff-0.0.291-py3-none-musllinux_1_2_i686.whl", hash = "sha256:fd17220611047de247b635596e3174f3d7f2becf63bd56301fc758778df9b629"}, + {file = "ruff-0.0.291-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:5383ba67ad360caf6060d09012f1fb2ab8bd605ab766d10ca4427a28ab106e0b"}, + {file = "ruff-0.0.291-py3-none-win32.whl", hash = "sha256:1d5f0616ae4cdc7a938b493b6a1a71c8a47d0300c0d65f6e41c281c2f7490ad3"}, + {file = "ruff-0.0.291-py3-none-win_amd64.whl", hash = "sha256:8a69bfbde72db8ca1c43ee3570f59daad155196c3fbe357047cd9b77de65f15b"}, + {file = "ruff-0.0.291-py3-none-win_arm64.whl", hash = "sha256:d867384a4615b7f30b223a849b52104214442b5ba79b473d7edd18da3cde22d6"}, + {file = "ruff-0.0.291.tar.gz", hash = "sha256:c61109661dde9db73469d14a82b42a88c7164f731e6a3b0042e71394c1c7ceed"}, ] [[package]] @@ -1391,12 +1393,12 @@ files = [ [[package]] name = "tenacity" -version = "8.2.3" -requires_python = ">=3.7" +version = "8.0.1" +requires_python = ">=3.6" summary = "Retry code until it succeeds" files = [ - {file = "tenacity-8.2.3-py3-none-any.whl", hash = "sha256:ce510e327a630c9e1beaf17d42e6ffacc88185044ad85cf74c0a8887c6a0f88c"}, - {file = "tenacity-8.2.3.tar.gz", hash = "sha256:5398ef0d78e63f40007c1fb4c0bff96e1911394d2fa8d194f77619c05ff6cc8a"}, + {file = "tenacity-8.0.1-py3-none-any.whl", hash = "sha256:f78f4ea81b0fabc06728c11dc2a8c01277bfc5181b321a4770471902e3eb844a"}, + {file = "tenacity-8.0.1.tar.gz", hash = "sha256:43242a20e3e73291a28bcbcacfd6e000b02d3857a9a9fff56b297a27afdc932f"}, ] [[package]] diff --git a/api/tzprofiles_indexer/py.typed b/api/tzprofiles/py.typed similarity index 100% rename from api/tzprofiles_indexer/py.typed rename to api/tzprofiles/py.typed diff --git a/api/tzprofiles_indexer/pyproject.toml b/api/tzprofiles/pyproject.toml similarity index 77% rename from api/tzprofiles_indexer/pyproject.toml rename to api/tzprofiles/pyproject.toml index b567a7d3..d09140bc 100644 --- a/api/tzprofiles_indexer/pyproject.toml +++ b/api/tzprofiles/pyproject.toml @@ -1,16 +1,16 @@ [project] -name = "tzprofiles_indexer" +name = "tzprofiles" version = "0.0.1" description = "DipDup indexer for Tezos Profiles" -license = { text = "Apache-2.0" } +license = { text = "Apache 2.0" } authors = [ - { name = "Spruce Systems, Inc." } + { name = "Spruce Systems, Inc.", email = "" } ] readme = "README.md" requires-python = ">=3.11,<3.12" dependencies = [ - "dipdup~=7.0.0rc3", - "tenacity>=8.2.2", + "dipdup>=7,<8", + "tenacity==8.0.1", "didkit>=0.3.2", ] @@ -26,11 +26,11 @@ dev = [ _isort = "isort ." _black = "black ." _ruff = "ruff check --fix ." -_mypy = "mypy --no-incremental --exclude tzprofiles_indexer ." +_mypy = "mypy --no-incremental --exclude tzprofiles ." all = { composite = ["fmt", "lint"] } fmt = { composite = ["_isort", "_black"] } lint = { composite = ["_ruff", "_mypy"] } -image = "docker buildx build . --load --progress plain -f deploy/Dockerfile -t tzprofiles_indexer:latest" +image = "docker buildx build . --load --progress plain -f deploy/Dockerfile -t tzprofiles:latest" [tool.isort] line_length = 120 diff --git a/api/tzprofiles_indexer/sql/.keep b/api/tzprofiles/sql/.keep similarity index 100% rename from api/tzprofiles_indexer/sql/.keep rename to api/tzprofiles/sql/.keep diff --git a/api/tzprofiles_indexer/sql/on_index_rollback/.keep b/api/tzprofiles/sql/on_index_rollback/.keep similarity index 100% rename from api/tzprofiles_indexer/sql/on_index_rollback/.keep rename to api/tzprofiles/sql/on_index_rollback/.keep diff --git a/api/tzprofiles_indexer/sql/on_reindex/.keep b/api/tzprofiles/sql/on_reindex/.keep similarity index 100% rename from api/tzprofiles_indexer/sql/on_reindex/.keep rename to api/tzprofiles/sql/on_reindex/.keep diff --git a/api/tzprofiles_indexer/sql/on_restart/.keep b/api/tzprofiles/sql/on_restart/.keep similarity index 100% rename from api/tzprofiles_indexer/sql/on_restart/.keep rename to api/tzprofiles/sql/on_restart/.keep diff --git a/api/tzprofiles_indexer/sql/on_synchronized/.keep b/api/tzprofiles/sql/on_synchronized/.keep similarity index 100% rename from api/tzprofiles_indexer/sql/on_synchronized/.keep rename to api/tzprofiles/sql/on_synchronized/.keep diff --git a/api/tzprofiles_indexer/tests/test_resolve_profile.py b/api/tzprofiles/tests/test_resolve_profile.py similarity index 98% rename from api/tzprofiles_indexer/tests/test_resolve_profile.py rename to api/tzprofiles/tests/test_resolve_profile.py index 524b9f16..d5dc1709 100644 --- a/api/tzprofiles_indexer/tests/test_resolve_profile.py +++ b/api/tzprofiles/tests/test_resolve_profile.py @@ -1,8 +1,8 @@ import json from unittest import IsolatedAsyncioTestCase -from tzprofiles_indexer.handlers import resolve_profile -from tzprofiles_indexer.models import TZProfile +from tzprofiles.handlers import resolve_profile +from tzprofiles.models import TZProfile class ResolveProfileTest(IsolatedAsyncioTestCase): diff --git a/api/tzprofiles_indexer/types/.keep b/api/tzprofiles/types/.keep similarity index 100% rename from api/tzprofiles_indexer/types/.keep rename to api/tzprofiles/types/.keep diff --git a/api/tzprofiles_indexer/types/tzprofile/tezos_parameters/default.py b/api/tzprofiles/types/tzprofile/tezos_parameters/default.py similarity index 100% rename from api/tzprofiles_indexer/types/tzprofile/tezos_parameters/default.py rename to api/tzprofiles/types/tzprofile/tezos_parameters/default.py diff --git a/api/tzprofiles_indexer/types/tzprofile/tezos_storage.py b/api/tzprofiles/types/tzprofile/tezos_storage.py similarity index 100% rename from api/tzprofiles_indexer/types/tzprofile/tezos_storage.py rename to api/tzprofiles/types/tzprofile/tezos_storage.py diff --git a/api/tzprofiles_indexer/types/tzprofile_old/tezos_parameters/default.py b/api/tzprofiles/types/tzprofile_old/tezos_parameters/default.py similarity index 100% rename from api/tzprofiles_indexer/types/tzprofile_old/tezos_parameters/default.py rename to api/tzprofiles/types/tzprofile_old/tezos_parameters/default.py diff --git a/api/tzprofiles_indexer/types/tzprofile_old/tezos_storage.py b/api/tzprofiles/types/tzprofile_old/tezos_storage.py similarity index 100% rename from api/tzprofiles_indexer/types/tzprofile_old/tezos_storage.py rename to api/tzprofiles/types/tzprofile_old/tezos_storage.py diff --git a/api/tzprofiles_indexer/tzprofiles_indexer b/api/tzprofiles/tzprofiles similarity index 100% rename from api/tzprofiles_indexer/tzprofiles_indexer rename to api/tzprofiles/tzprofiles diff --git a/api/tzprofiles_indexer/configs/dipdup.sqlite.yaml b/api/tzprofiles_indexer/configs/dipdup.sqlite.yaml deleted file mode 100644 index a53ce6f4..00000000 --- a/api/tzprofiles_indexer/configs/dipdup.sqlite.yaml +++ /dev/null @@ -1,7 +0,0 @@ -database: - kind: sqlite - path: ${SQLITE_PATH:-/tmp/tzprofiles_indexer.sqlite} - -sentry: - dsn: ${SENTRY_DSN:-""} - environment: ${SENTRY_ENVIRONMENT:-dev} \ No newline at end of file diff --git a/api/tzprofiles_indexer/deploy/Dockerfile b/api/tzprofiles_indexer/deploy/Dockerfile deleted file mode 100644 index 3c44563f..00000000 --- a/api/tzprofiles_indexer/deploy/Dockerfile +++ /dev/null @@ -1,6 +0,0 @@ -FROM dipdup/dipdup:7 -# FROM ghcr.io/dipdup-io/dipdup:7 -# FROM ghcr.io/dipdup-io/dipdup:next - -COPY --chown=dipdup . tzprofiles_indexer -WORKDIR tzprofiles_indexer \ No newline at end of file