Skip to content

Commit 34e2581

Browse files
authored
chore: algod integration updates (#11)
* feat:added scripts to find data * feat: add algod API endpoint recordings and binary msgpack support - Add comprehensive algod request functions in src/requests/algodRequests.ts - Add beforePersist hook to ensure msgpack responses are base64 encoded - Refactor record.ts to use modular request functions - Update HAR recordings with complete endpoint coverage - Add indexer and kmd request modules * feat: add URL rewriting to record localhost as TestNet URLs - Add URL rewriting in getPolly to convert localhost:4001 to TestNet during recording - Remove algosdkAlgodRequestsWithLocalnet function and dependency - Add TestNet box storage endpoints using xgov app - Update algod recordings with new TestNet box data * chore: removed finding data scripts * chore: removed unused code * chore: updated snapshot for failing test
1 parent 3f74f06 commit 34e2581

File tree

9 files changed

+1855
-464
lines changed

9 files changed

+1855
-464
lines changed

resources/mock-server/.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,5 @@ report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json
3535

3636

3737
.tmp/
38-
scripts/find-data
38+
scripts/find-data
39+
tmp-recordings/

resources/mock-server/.vscode/launch.json

Lines changed: 55 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"name": "Debug Replay Server",
1111
"program": "${workspaceFolder}/bin/server.ts",
1212
"args": ["algod"], // Change to: algod, indexer, or kmd
13+
// "args": ["algod", "${workspaceFolder}/tmp-recordings"], // Change to: algod, indexer, or kmd
1314
"cwd": "${workspaceFolder}",
1415
"stopOnEntry": false,
1516
"watchMode": false,
@@ -21,15 +22,62 @@
2122
{
2223
"type": "bun",
2324
"request": "launch",
24-
"name": "Debug Record",
25-
"program": "${workspaceFolder}/bin/record.ts",
26-
"args": ["algod", "record-new"], // Change client: algod, indexer, kmd | mode: record-new, record-overwrite
25+
"name": "Debug Find Pending Transactions",
26+
"program": "${workspaceFolder}/scripts/find-pending-transactions.ts",
27+
"args": ["60", "1000"], // [pollDuration in seconds, pollInterval in ms]
2728
"cwd": "${workspaceFolder}",
2829
"stopOnEntry": false,
29-
"watchMode": false,
30-
"env": {
31-
"NODE_ENV": "development"
32-
}
30+
"watchMode": false
31+
},
32+
{
33+
"type": "bun",
34+
"request": "launch",
35+
"name": "Debug Find Apps With Boxes",
36+
"program": "${workspaceFolder}/scripts/find-apps-with-boxes.ts",
37+
"args": ["1", "50"], // [batch number, batchSize]
38+
"cwd": "${workspaceFolder}",
39+
"stopOnEntry": false,
40+
"watchMode": false
41+
},
42+
{
43+
"type": "bun",
44+
"request": "launch",
45+
"name": "Debug Find Transaction With Proof",
46+
"program": "${workspaceFolder}/scripts/find-transaction-with-proof.ts",
47+
"args": ["latest", "100"], // [startBlock or "latest", numBlocks]
48+
"cwd": "${workspaceFolder}",
49+
"stopOnEntry": false,
50+
"watchMode": false
51+
},
52+
{
53+
"type": "bun",
54+
"request": "launch",
55+
"name": "Debug Find Round With Txn Groups",
56+
"program": "${workspaceFolder}/scripts/find-round-with-txn-groups.ts",
57+
"args": ["latest", "250"], // [startBlock or "latest", numBlocks]
58+
"cwd": "${workspaceFolder}",
59+
"stopOnEntry": false,
60+
"watchMode": false
61+
},
62+
{
63+
"type": "bun",
64+
"request": "launch",
65+
"name": "Debug Find Transaction Group ID",
66+
"program": "${workspaceFolder}/scripts/find-transaction-group-id.ts",
67+
"args": ["latest", "300"], // [startBlock or "latest", numBlocks]
68+
"cwd": "${workspaceFolder}",
69+
"stopOnEntry": false,
70+
"watchMode": false
71+
},
72+
{
73+
"type": "bun",
74+
"request": "launch",
75+
"name": "Debug Find Blocks With StateProof",
76+
"program": "${workspaceFolder}/scripts/find-blocks-with-stateproof.ts",
77+
"args": ["latest", "275"], // [startBlock or "latest", numBlocks]
78+
"cwd": "${workspaceFolder}",
79+
"stopOnEntry": false,
80+
"watchMode": false
3381
}
3482
]
3583
}

resources/mock-server/__test__/__snapshots__/replay.test.ts.snap

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ NodeStatusResponse {
1313
"catchpointVerifiedKvs": 0,
1414
"catchupTime": 0n,
1515
"lastCatchpoint": "",
16-
"lastRound": 57490072n,
16+
"lastRound": 57711496n,
1717
"lastVersion": "https://github.com/algorandfoundation/specs/tree/953304de35264fc3ef91bcd05c123242015eeaed",
1818
"nextVersion": "https://github.com/algorandfoundation/specs/tree/953304de35264fc3ef91bcd05c123242015eeaed",
19-
"nextVersionRound": 57490073n,
19+
"nextVersionRound": 57711497n,
2020
"nextVersionSupported": true,
2121
"stoppedAtUnsupportedRound": false,
22-
"timeSinceLastRound": 998402345n,
22+
"timeSinceLastRound": 504021303n,
2323
"upgradeDelay": undefined,
2424
"upgradeNextProtocolVoteBefore": undefined,
2525
"upgradeNoVotes": undefined,

0 commit comments

Comments
 (0)