Skip to content
This repository has been archived by the owner on Sep 16, 2024. It is now read-only.

Commit

Permalink
feat(sdk): bump @ar.io/sdk to use paginated requests
Browse files Browse the repository at this point in the history
The new changes use paginated requests for fetching larger items from state. The utility function being used to fetch arns records returns the same result as previous API behavior using the paginated approach.
  • Loading branch information
dtfiedler committed Jul 11, 2024
1 parent bcfcbd4 commit b099e31
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 479 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"url": "https://github.com/ar-io/arns-resolver"
},
"dependencies": {
"@ar.io/sdk": "1.2.0-alpha.16",
"@ar.io/sdk": "^2.0.0",
"cors": "^2.8.5",
"dotenv": "^16.3.1",
"express": "^4.18.2",
Expand Down
6 changes: 5 additions & 1 deletion src/system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
AoIORead,
IO,
ProcessId,
fetchAllArNSRecords,
isLeasedArNSRecord,
} from '@ar.io/sdk/node';
import pLimit from 'p-limit';
Expand Down Expand Up @@ -63,7 +64,10 @@ export async function evaluateArNSNames() {

// monitor the time it takes to evaluate the names
const startTime = Date.now();
const apexRecords = await contract.getArNSRecords();
const apexRecords = await fetchAllArNSRecords({
contract,
});

log.info('Retrieved apex records:', {
count: Object.keys(apexRecords).length,
});
Expand Down
Loading

0 comments on commit b099e31

Please sign in to comment.