Skip to content

fix(node-operators): replace Moralis holder lookup - #46

Merged
aledefra merged 1 commit into
developfrom
codex/remove-moralis-node-operators
Jul 23, 2026
Merged

fix(node-operators): replace Moralis holder lookup#46
aledefra merged 1 commit into
developfrom
codex/remove-moralis-node-operators

Conversation

@aledefra

Copy link
Copy Markdown
Collaborator

Summary

  • replace the Moralis NFT-owner pagination used by /node-operators with the existing Reader contract
  • fetch all license holders in bounded pages and cache the server-side result for five minutes
  • remove the now-unused API route, Moralis dependency, Docker build arguments, and workflow secret plumbing

Root cause

Moralis returns the first 100 ND owners on Base mainnet, but rejects the returned cursor on the next request with 400 cursor is not valid. That makes /api/license-holders fail and prevents /node-operators from rendering.

Validation

  • npm run lint
  • npm run build:mainnet
  • local mainnet /node-operators: HTTP 200 and populated list (49 unique holders)
  • Playwright desktop and mobile screenshots
  • direct mainnet Reader pagination: 273 unique licenses, no zero-address owners
  • Moralis first-page parity: 100/100 ND token-owner pairs exactly match Reader data; 0 mismatches
  • npm ls moralis @moralisweb3/common-core --depth=0: empty

Notes

The existing branding-logo endpoint still returns 400 for operators without a configured logo; this is unrelated and falls back to the existing placeholder UI.

@aledefra
aledefra marked this pull request as ready for review July 23, 2026 10:10
Copilot AI review requested due to automatic review settings July 23, 2026 10:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes /node-operators rendering by replacing the failing Moralis-based NFT owner pagination with on-chain pagination via the existing Reader contract, and simplifies build/deploy configuration by removing Moralis-related plumbing.

Changes:

  • Replace the /node-operators holder fetch to use Reader pagination and cache results server-side for 5 minutes.
  • Remove the now-unused /api/license-holders API route.
  • Remove Moralis dependency and related Docker/workflow build arguments and secrets wiring.

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
package.json Removes the Moralis dependency from runtime dependencies.
package-lock.json Removes Moralis and its transitive dependencies from the lockfile.
lib/api/blockchain.ts Implements Reader-based pagination to fetch all license holders in bounded pages.
app/node-operators/page.tsx Switches node operators holder retrieval to cached Reader-based holder data.
app/api/license-holders/route.ts Deletes the obsolete Moralis-backed license holders API route.
Dockerfile_devnet Removes MORALIS_API_KEY build arg/env wiring.
Dockerfile_testnet Removes MORALIS_API_KEY build arg/env wiring.
Dockerfile_mainnet Removes MORALIS_API_KEY build arg/env wiring.
.github/workflows/release.yml Removes MORALIS_API_KEY from build env.
.github/workflows/build_testnet_mainnet.yml Removes MORALIS_API_KEY from Docker build args.
.github/workflows/build_devnet.yml Removes MORALIS_API_KEY from Docker build args.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/api/blockchain.ts
Comment on lines +484 to +488
let totalLicenses = 0;

do {
const response = await Moralis.EvmApi.nft.getNFTOwners({
chain: evmChain,
format: 'decimal',
cursor,
address,
limit: 100,
const page = await getLicensesPage(offset, LICENSE_HOLDERS_BATCH_SIZE);
totalLicenses = Number(page.mndTotalSupply + page.ndTotalSupply);
@aledefra
aledefra merged commit ade1c0e into develop Jul 23, 2026
3 checks passed
@aledefra
aledefra deleted the codex/remove-moralis-node-operators branch July 23, 2026 10:16
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.

2 participants