Skip to main content

An unassuming ARK minter, binder, and resolver

Project description

Arklet - A basic ARK resolver

lint_python

What is an ARK?

See https://arks.org/

What is Arklet?

Arklet is a Python Django application for minting, binding, and resolving ARKs. It is intended to follow best practices set out by https://arks.org/.

Technical design notes:

  • Django is the only required dependency.
  • Supports each Django and Python version that is itself supported by the maintainers (Python 3.7-3.10, Django 3.2.x-4.0.x).
    • Tests are run against the upcoming versions of Python and Django as well.
  • This repo can be run as a standalone service
  • ...or the ark package can be installed as a reusable app in other Django projects.
    • If using the included arklet/settings.py file django-environ is also required.
  • Arklet is database agnostic.

Arklet is developed with poetry, pytest, black, tox, and more.

Running

Locally with Postgres

Create the default .env file in the project's root directory

# /!\ Set your own secret key /!\
ARKLET_DJANGO_SECRET_KEY=[YOUR_SECRET]

# For local development, set to True
ARKLET_DEBUG=True

The following steps walk through running Postgres, installing with poetry, and starting the app. You can omit any of the extras listed in the poetry install step if they are not used in your deployment. The included arklet/settings.py file does require environ. You can skip installing the development dependencies by passing --no-dev to poetry. Django is the only required dependency.

cd path/to/project
mkdir postgres-data
docker run --name arklet-postgres -v postgres-data:/var/lib/postgresql/data \
    -p 5432:5432 \
    -e POSTGRES_USER=arklet -e POSTGRES_PASSWORD=arklet \
    -d postgres
poetry install --extras "postgres sentry environ"
poetry run python manage.py migrate
poetry run python manage.py createsuperuser
poetry run python manage.py runserver

Separate dockers

Using docker, we can use a this provided config file.

See above for running PostgreSQL, and run the Arklet docker as follows (in bash):

docker build \
    --target dev \
    -t "arklet" -f ./Dockerfile . \
    --build-arg ENV=DEV \
&& docker run --rm -it \
    -p 8000:8000 \
    --env-file=./docker/env.docker.local \
    -e ARKLETDEBUG="true" \
    --name arklet \
    -v `pwd`/ark:/app/ark \
    -v `pwd`/ark_import:/app/ark_import \
    -v `pwd`/arklet:/app/arklet \
    arklet

With docker-compose

Using the provided docker-compose.yml with default settings in the docker configuration directory :

docker-compose up

By default, the folders ark, ark_import and arklet are mounted in the container. Should you wish to attach a console to the arklet container (needed to create the django superuser) :

# In another shell
docker exec -it arklet_django /bin/bash
# You're now in the docker container
./manage.py createsuperuser

First steps

Create your first NAAN, Key, and Shoulder in the admin: 127.0.0.1:8000/admin

And by the way, you now host a working ARK resolver! You can already try the following ones :

Happy minting, binding, and resolving!

Configuration Options

See arklet/settings.py for the full list of options to put in your config file.

Deploying

With docker

Using the provided Dockerfile (is you wish to set a build target, use prod, but being the default target you can skip this), provide the following values in your environment:

  • ARKLET_DJANGO_SECRET_KEY=[YOUR_SECRET]
  • ARKLET_DEBUG=False
  • ARKLET_HOST=0.0.0.0
  • ARKLET_PORT=[Port of choice]
  • ARKLET_POSTGRES_NAME=[DB NAME]
  • ARKLET_POSTGRES_USER=[DB USER]
  • ARKLET_POSTGRES_PASSWORD=[DB PASS]
  • ARKLET_POSTGRES_HOST=[DB HOST]
  • ARKLET_POSTGRES_PORT=[DB PORT]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

arklet-0.1.0.tar.gz (14.9 kB view details)

Uploaded Source

Built Distribution

arklet-0.1.0-py3-none-any.whl (15.8 kB view details)

Uploaded Python 3

File details

Details for the file arklet-0.1.0.tar.gz.

File metadata

  • Download URL: arklet-0.1.0.tar.gz
  • Upload date:
  • Size: 14.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.8.5 Darwin/21.4.0

File hashes

Hashes for arklet-0.1.0.tar.gz
Algorithm Hash digest
SHA256 970187d68a6fd60fb5888262c8e078f0e659132964cba54683f993af09280126
MD5 9324ebd867f5060ef9ce4d7869c7a4e7
BLAKE2b-256 3861202e7435f5f15264875de37cbb6576621e3067bf09a9883a2c032dbb940b

See more details on using hashes here.

File details

Details for the file arklet-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: arklet-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 15.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.8.5 Darwin/21.4.0

File hashes

Hashes for arklet-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fee3c0e16c569b7700709088ed46ff7633f6dfe065ae920b6cf82c1ae7ee2094
MD5 a97a9a0702cc756e91aa5b539ca403fc
BLAKE2b-256 b70084dc4903dabdfbf3eeddec9e3d73215283b13d3a592153945c83a9476db9

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page