From 60bb6922fe944bb0fc2cd1ba3ead8d99a230a101 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Bajto=C5=A1?= Date: Mon, 27 May 2024 07:45:51 +0200 Subject: [PATCH] feat: manual check for a given task (#71) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Miroslav Bajtoš --- lib/ipni-client.js | 2 +- manual-check.js | 15 +++++++++++++++ test/integration.js | 4 ++++ 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 manual-check.js diff --git a/lib/ipni-client.js b/lib/ipni-client.js index 7917f78..f93a63c 100644 --- a/lib/ipni-client.js +++ b/lib/ipni-client.js @@ -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' } } diff --git a/manual-check.js b/manual-check.js new file mode 100644 index 0000000..5d7b13c --- /dev/null +++ b/manual-check.js @@ -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) diff --git a/test/integration.js b/test/integration.js index d9eb7b7..8966dd1 100644 --- a/test/integration.js +++ b/test/integration.js @@ -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') +})