You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Check if the SP has announced the IPFS root CID to IPNI.
47
+
*
48
+
* This should not be called until you receive confirmation from the SP that the piece has been parked, i.e. `onPieceAdded` in the `synapse.storage.upload` callbacks.
49
+
*
50
+
* @param ipfsRootCid - The IPFS root CID to check
51
+
* @param options - Options for the check
52
+
* @returns True if the IPNI announce succeeded, false otherwise
53
+
*/
54
+
exportasyncfunctionvalidateIPNIAdvertisement(
55
+
ipfsRootCid: CID,
56
+
options?: ValidateIPNIAdvertisementOptions
57
+
): Promise<boolean>{
58
+
constdelayMs=options?.delayMs??5000
59
+
constmaxAttempts=options?.maxAttempts??10
60
+
61
+
returnnewPromise<boolean>((resolve,reject)=>{
62
+
letretryCount=0
63
+
constcheck=async(): Promise<void>=>{
64
+
try{
65
+
if(options?.signal?.aborted){
66
+
reject(newError('Check IPNI announce aborted'))
67
+
return
68
+
}
69
+
options?.logger?.info(
70
+
{
71
+
event: 'check-ipni-announce',
72
+
ipfsRootCid: ipfsRootCid.toString(),
73
+
},
74
+
'Checking IPNI for announcement of IPFS Root CID "%s"',
0 commit comments