Skip to content

Commit

Permalink
feat: manual check for a given task (#71)
Browse files Browse the repository at this point in the history
Signed-off-by: Miroslav Bajtoš <[email protected]>
  • Loading branch information
bajtos authored May 27, 2024
1 parent 241d153 commit 60bb692
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ipni-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@ export async function queryTheIndex (cid, providerId) {
}
}

console.log('All advertisements are for unsupported protocols.')
console.log('All advertisements are from other miners or for unsupported protocols.')
return { indexerResult: 'NO_VALID_ADVERTISEMENT' }
}
15 changes: 15 additions & 0 deletions manual-check.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//
// Usage:
// zinnia run manual-check.js
//

import Spark from './lib/spark.js'

// The task to check, replace with your own values
const cid = 'bafkreih25dih6ug3xtj73vswccw423b56ilrwmnos4cbwhrceudopdp5sq'
const minerId = 'f010479'

// Run the check
const spark = new Spark()
const stats = {}
await spark.executeRetrievalCheck({ cid, minerId }, stats)
4 changes: 4 additions & 0 deletions test/integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,7 @@ test('retrieval check for our CID', async () => {
// TODO - spark-api does not record this field yet
// assertProp('carChecksum', '122069f03061f7ad4c14a5691b7e96d3ddd109023a6539a0b4230ea3dc92050e7136')
})

test('can execute manual check for our CID', async () => {
await import('../manual-check.js')
})

0 comments on commit 60bb692

Please sign in to comment.