-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'forked/feat/builder' into feat/generic-…
…relayer
- Loading branch information
Showing
17 changed files
with
272 additions
and
348 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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,62 @@ | ||
# Docker Compose configuration for local development environment | ||
# This setup provides a playground environment for developing and testing the relayer | ||
# It includes: | ||
# - A PostgreSQL database for storing relayer data | ||
# - The relayer service built from local source code | ||
version: '3.8' | ||
|
||
services: | ||
db: | ||
image: postgres:15 | ||
environment: | ||
POSTGRES_USER: relayer | ||
POSTGRES_PASSWORD: relayer_password | ||
POSTGRES_DB: relayer | ||
ports: | ||
- "5432:5432" | ||
volumes: | ||
- postgres_data:/var/lib/postgresql/data | ||
healthcheck: | ||
test: [ "CMD-SHELL", "pg_isready -U relayer" ] | ||
interval: 5s | ||
timeout: 5s | ||
retries: 5 | ||
|
||
smtp: | ||
build: | ||
context: . | ||
dockerfile: SMTP.Dockerfile | ||
environment: | ||
- SERVER_HOST=${SMTP_INTERNAL_SERVER_HOST} | ||
- SERVER_PORT=${SMTP_INTERNAL_SERVER_PORT} | ||
- SMTP_DOMAIN_NAME=${SMTP_DOMAIN_NAME} | ||
- SMTP_LOGIN_ID=${SMTP_LOGIN_ID} | ||
- SMTP_LOGIN_PASSWORD=${SMTP_LOGIN_PASSWORD} | ||
- MESSAGE_ID_DOMAIN=${SMTP_MESSAGE_ID_DOMAIN} | ||
- JSON_LOGGER=${SMPT_JSON_LOGGER} | ||
ports: | ||
- "${SMTP_PORT}:${SMTP_INTERNAL_SERVER_PORT}" | ||
healthcheck: | ||
test: [ "CMD", "curl", "-f", "http://localhost:${SMTP_INTERNAL_SERVER_PORT}/api/ping" ] | ||
interval: 1m30s | ||
timeout: 30s | ||
retries: 5 | ||
start_period: 30s | ||
|
||
imap: | ||
build: | ||
context: . | ||
dockerfile: IMAP.Dockerfile | ||
environment: | ||
- RELAYER_ENDPOINT=http://host.docker.internal:8000/api/receiveEmail | ||
- IMAP_LOGIN_ID=${IMAP_LOGIN_ID} | ||
- IMAP_LOGIN_PASSWORD=${IMAP_LOGIN_PASSWORD} | ||
- IMAP_DOMAIN_NAME=${IMAP_DOMAIN_NAME} | ||
- IMAP_PORT=${IMAP_PORT} | ||
- AUTH_TYPE=${IMAP_AUTH_TYPE} | ||
- JSON_LOGGER=${IMAP_JSON_LOGGER} | ||
extra_hosts: | ||
- "host.docker.internal:host-gateway" | ||
|
||
volumes: | ||
postgres_data: |
15 changes: 15 additions & 0 deletions
15
...relayer/.sqlx/query-7aefad132b94f2d7cc3baf2e9cf9ee83b772ea1e914666757da17235fc27fa4c.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
22 changes: 22 additions & 0 deletions
22
...relayer/.sqlx/query-87f63ec8051ab2fcd3fc963b1f3e0ec9d94a412ad0afd53e96c2c42d5c52ef36.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
...relayer/.sqlx/query-9806be5aa72ee7b28a08c6e0b126e4ea4c0e713b0d6b0f6cba6525a9f85bb2f1.json
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
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 +1,33 @@ | ||
# Generic Relayer | ||
|
||
## Build | ||
|
||
make sure to build the contracts before building the relayer | ||
|
||
``` | ||
cd ../contracts | ||
yarn && yarn build | ||
``` | ||
|
||
cd back into the relayer and build it | ||
|
||
``` | ||
cargo build | ||
``` | ||
|
||
## Setup the local development environment | ||
|
||
cd into the root directory and run | ||
|
||
``` | ||
docker compose up --build | ||
``` | ||
|
||
This will build the docker images for the node, bundler, scanner, smtp, and imap services. | ||
|
||
## Applying the migrations | ||
|
||
``` | ||
cd packages/relayer | ||
DATABASE_URL=postgres://relayer:relayer_password@localhost:5432/relayer sqlx migrate run | ||
``` |
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
1 change: 1 addition & 0 deletions
1
packages/relayer/migrations/20241128143748_create_email_auth_messages.down.sql
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 @@ | ||
DROP TABLE IF EXISTS email_auth_messages; |
7 changes: 7 additions & 0 deletions
7
packages/relayer/migrations/20241128143748_create_email_auth_messages.up.sql
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 @@ | ||
CREATE TABLE email_auth_messages ( | ||
id UUID PRIMARY KEY DEFAULT gen_random_uuid(), | ||
request_id TEXT NOT NULL, | ||
response JSONB NOT NULL | ||
); | ||
|
||
CREATE INDEX idx_email_auth_messages_request_id ON email_auth_messages(request_id); |
Oops, something went wrong.