Skip to content

Feature/blockchain sync service - #208

Merged
SudiptaPaul-31 merged 2 commits into
SudiptaPaul-31:mainfrom
AugistineCreates:feature/blockchain-sync-service
Oct 3, 2026
Merged

SudiptaPaul-31 merged 2 commits into
SudiptaPaul-31:mainfrom
AugistineCreates:feature/blockchain-sync-service

Conversation

@AugistineCreates

Copy link
Copy Markdown
Contributor

Closes #197

Description

This PR introduces a service that periodically compares blockchain ownership/verification data with the application's database. It detects discrepancies and safely synchronizes the database without overwriting valid newer application state.

Changes Included

  1. Periodic Sync Job: Configured vercel.json with a new cron job schedule and created the corresponding API route (app/api/cron/blockchain-sync/route.ts).
  2. Blockchain Sync Repository: Added lib/blockchain-sync.repository.ts to fetch/update database snippets and log discrepancies.
  3. Reconciliation Service: Added lib/blockchain-sync.service.ts with logic to detect mismatches, enforce safe reconciliation, and handle transient network failures with exponential backoff retries.
  4. Database Schema: Included the example schema SQL script in scripts/add-blockchain-sync-log.sql for the blockchain_sync_log table.

Acceptance Criteria Met

  • Blockchain data fetched periodically via scheduled background tasks.
  • Discrepancies detected between on-chain and off-chain data.
  • Safe reconciliation applied (database updated only when blockchain state is authoritative).
  • No overwriting of newer application state.
  • Traceability supported via logging mismatches and resolutions.
  • Resilient to failures (retries applied for transient errors).

@vercel

vercel Bot commented Sep 27, 2026

Copy link
Copy Markdown

@AugistineCreates is attempting to deploy a commit to the Sudipta 's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Sep 27, 2026

Copy link
Copy Markdown

@AugistineCreates Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@SudiptaPaul-31
SudiptaPaul-31 merged commit 150b32e into SudiptaPaul-31:main Oct 3, 2026
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Blockchain Sync & Reconciliation Service

2 participants