Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure Webhook Infrastructure for escrow_transactions Event Triggers #98

Open
15 tasks
sotoJ24 opened this issue Feb 21, 2025 · 5 comments · May be fixed by #100
Open
15 tasks

Configure Webhook Infrastructure for escrow_transactions Event Triggers #98

sotoJ24 opened this issue Feb 21, 2025 · 5 comments · May be fixed by #100

Comments

@sotoJ24
Copy link
Contributor

sotoJ24 commented Feb 21, 2025

Description

Set up the webhook infrastructure for handling escrow_transactions event triggers, including endpoint configuration, retry mechanisms, and error handling.

Requirements

  • Configure appropriate webhook endpoints for each trigger type
  • Set up proper retry mechanisms for failed webhook calls
  • Implement webhook authentication/authorization
  • Design error handling protocol for various failure scenarios
  • Create logging system for webhook activity

Specific Configuration Tasks

  • Define retry policy (attempts, intervals, backoff strategy)
  • Configure timeout settings
  • Set up webhook headers for authentication
  • Implement webhook response handling
  • Create alerting for persistent webhook failures

Acceptance Criteria

  • All webhook endpoints are properly configured and secured
  • Retry mechanism successfully attempts to resend failed webhook calls
  • System properly handles and logs webhook failures
  • Transaction records are updated with webhook response data
  • Comprehensive logging of all webhook activity is implemented

Technical Implementation Details

  • Store webhook configuration in environment variables
  • Implement idempotency keys to prevent duplicate processing
  • Consider rate limiting based on API provider requirements
  • Document expected webhook response formats

Make sure to follow the Git Guidelines for Atomic Commits and read Contributing Guide

The Pull request needs to have the format mentioned below in the Git Guideline

Hasura Event-Triggers Documentation

https://hasura.io/docs/2.0/event-triggers/overview/

@psychemist
Copy link

Hello SafeTrust maintainers! I am an OnlyDust diamond contributor and I have relevant experience building and testing fullstack web applications. I would like to handle this task and will solve this issue by creating the webhook architecture that will handle various contract event triggers. I will handle errors, retries and logging for better visualization. I will also add unit test suites to ensure proper functionality. I can achieve this in 3 days and am looking forward to contributing to this project!

@Uyoxy
Copy link

Uyoxy commented Feb 22, 2025

I’d love to contribute to this task! With expertise in NestJS, TypeScript, and event-driven systems, I can build a secure, scalable webhook infrastructure with retries, authentication, logging, and error handling.

Looking forward to the opportunity!

@ikemHood
Copy link

Hello @sotoJ24 ,

I'd like to help implement the webhook infrastructure for escrow transaction events. I have extensive experience with event-driven systems and webhook implementations.

What I would be doing in this task involves:

Building core webhook functionality:
- Endpoint configuration for different triggers
- Retry mechanism with exponential backoff
- Authentication header management
- Comprehensive logging system

Implementation focus:
- Environment-based configuration
- Idempotency handling
- Response processing
- Failure monitoring

I can complete this in 2 days:
Day 1: Core webhook setup and retry logic
Day 2: Testing, logging, and documentation

Relevant experience:

  • Built webhook systems for payment processors
  • Implemented retry mechanisms at scale
  • Strong background in event-driven architecture
  • Experience with Hasura event triggers

i am ready to start immediately and will provide feedbacks as i implement.

@kellymusk-hash
Copy link

May I take care of this?

@ikemHood
Copy link

ikemHood commented Feb 23, 2025

Thank you for assigning.

So, how do we handle the data recieved by the webhook

specifically the webhook would recieve a data that looks like this

{
  // Headers above are not shown
  "payload": {
    "created_at": "<TIMESTAMP>",
    "delivery_info": {
      "current_retry": "<RETRY_NUMBER>",
      "max_retries": "<MAX_RETRIES>"
    },
    "event": {
      "data": {
        "new": "<OBJECT_OF_COLUMNS_AND_VALUES>",
        "old": "<OBJECT_OF_COLUMNS_AND_VALUES|NULL>"
      },
      "op": "<INSERT|UPDATE|DELETE|MANUAL>",
      "session_variables": {
        "x-hasura-role": "<ROLE_NAME>"
      },
      "trace_context": {
        "span_id": "<SPAN_ID>",
        "trace_id": "<TRACE_ID>"
      }
    },
    "id": "<UUID_FOR_INVOCATION>",
    "table": {
      "name": "<TABLE_NAME>",
      "schema": "<SCHEMA_NAME>"
    },
    "trigger": {
      "name": "<TRIGGER_NAME>"
    }
  }
  // Version below is not shown
}

how do we process the new and old data? | what do we do with the info

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants