This service acts as a notification service for IO contract events from the ar.io network process. It can be set up to run alongside any ar.io gateway.
The service depends on the ar.io gateway GraphQL endpoint (defaulting to https://arweave-search.goldsky.com) which provides indexed data from the ARIO contract for querying contract events and state.
Example (permagate.io .env)
ANS_104_UNBUNDLE_FILTER=
ANS_104_INDEX_FILTER=
WEBHOOK_SERVERS_URL=
WEBHOOK_INDEX_FILTER=nvmnode(>=18)yarnsqlite3docker
All should be easy to install on a Mac via homebrew (e.g. brew install <name>). Refer to their documentation if any issues.
cp .env.example .env- creates a local environment file, update the values as necessaryyarn start- runs the service in watch modeyarn build- builds the service
The service uses magic link authentication. Users receive an email with a secure link that allows them to authenticate without passwords. The authentication is handled by the service itself using secure tokens.
The service uses AWS SES (Simple Email Service) to send emails including magic link authentication emails and notifications. The following environment variables should be set:
AWS_REGION- the AWS region for SESAWS_ACCESS_KEY_ID- the AWS access key IDAWS_SECRET_ACCESS_KEY- the AWS secret access keySES_FROM_EMAIL- the email address to send from (must be verified in AWS SES)
The service uses a SQLite database store user data. The database is stored in the data directory. The database schema is defined in src/db/schema.sql. Knex is used to perform database migrations and queries.
yarn knex migrate:latest- runs the latest migrationyarn knex migrate:rollback- rolls back the latest migrationyarn knex migrate:make <name>- creates a new migration
The image can be built and run using Docker.
docker build -t permagate-alerts .- builds the docker imagedocker run -p 3000:3000 --env-file .env -v ${PWD}/data:/usr/src/app/data permagate-alerts- runs the docker image and attaches the data directory
Alternatively, the service can be run using docker-compose.
docker-compose up- runs the service usingdocker-composeand defaults to using the .env file for environment variables