Summary
Add an indexing worker that consumes MembershipNFT events and synchronises membership state into the access API database.
Current Behaviour
The Solidity contract emits MembershipMinted, MembershipRenewed, and MembershipSuspended events, and the contracts package exposes ABI fragments. The backend currently relies on seeded database data and does not ingest contract events.
Expected Behaviour
The backend should be able to synchronise membership records from on-chain events for a configured MEMBERSHIP_NFT_ADDRESS and CHAIN_ID.
Suggested Implementation
Create an indexer package or access API worker that connects to an EVM RPC endpoint, scans from a configured block, decodes membership events, and upserts wallet, member, membership, and role-related state. Persist indexing progress to avoid duplicate processing.
Files or Areas Likely Affected
packages/contracts/src/index.ts
contracts/src/MembershipNFT.sol
apps/access-api/prisma/schema.prisma
apps/access-api/src/services/
apps/access-api/src/workers/
.env.example
README.md
Acceptance Criteria
Additional Notes
Assumption: this should remain MVP-friendly and can start as a manually invoked worker before becoming a long-running service.
Summary
Add an indexing worker that consumes
MembershipNFTevents and synchronises membership state into the access API database.Current Behaviour
The Solidity contract emits
MembershipMinted,MembershipRenewed, andMembershipSuspendedevents, and the contracts package exposes ABI fragments. The backend currently relies on seeded database data and does not ingest contract events.Expected Behaviour
The backend should be able to synchronise membership records from on-chain events for a configured
MEMBERSHIP_NFT_ADDRESSandCHAIN_ID.Suggested Implementation
Create an indexer package or access API worker that connects to an EVM RPC endpoint, scans from a configured block, decodes membership events, and upserts wallet, member, membership, and role-related state. Persist indexing progress to avoid duplicate processing.
Files or Areas Likely Affected
packages/contracts/src/index.tscontracts/src/MembershipNFT.solapps/access-api/prisma/schema.prismaapps/access-api/src/services/apps/access-api/src/workers/.env.exampleREADME.mdAcceptance Criteria
MembershipMintedcreates or updates wallet, member, and membership recordsMembershipRenewedupdates membership expiryMembershipSuspendedupdates suspension stateAdditional Notes
Assumption: this should remain MVP-friendly and can start as a manually invoked worker before becoming a long-running service.