| 72 | } |
| 73 | |
| 74 | export async function extendCommits(assetCid, blockchainInfo, fromIndex, toIndex) { |
| 75 | const commitEvents = await nit.iterateCommitEvents(assetCid, blockchainInfo, fromIndex, toIndex); |
| 76 | const commitsSummary = await nit.getCommits(commitEvents); |
| 77 | await nit.showCommits(commitsSummary); |
| 78 | let extendedCommits = []; |
| 79 | for (const summary of commitsSummary) { |
| 80 | const extendedCommit = await extend(assetCid, summary, nit.blockchainNames[blockchainInfo.chainId]) |
| 81 | extendedCommits.push(extendedCommit); |
| 82 | } |
| 83 | return extendedCommits; |
| 84 | } |
| 85 | |
| 86 | // bubble -> calculate how many items to retrieve -> call update -> push extended commints to db -> return updated entry amount |
| 87 | export async function update(assetCid, blockchainInfo, dbEntryAmount, dbEndpointUrl, accessToken=null) { |