We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rework spark-piece-indexer as follows:
How does Curio map Piece Info to ContextID:
{PieceCID, PieceSize}
Example IPNI advertisement: https://http.f02620.devtty.eu/ipni-provider/12D3KooWBpYWsD4DuzTTVQdS6N5mt6rc5HtY11p7KLfhyVLw83d6/ipni/v1/ad/baguqeera6g3t7nianlk2kplejqyzl5wvbaq6h4vdqrhhgm2ctid7q4sgcx4a
{ "Addresses":["/dns/cid.contact/https/http-path/%2Fingest%2Fannounce"], "ContextID":{"/":{"bytes":"ghsAAAAIAAAAANgqWCgAAYHiA5IgIPxmN381s3gKZTaNDaP+GGLv+fs22x1BbOe5TC4QYugO"}}, // etc. }
Decoded ContextID (via https://cbor.me):
82 # array(2) 1B 0000000800000000 # unsigned(34359738368) D8 2A # tag(42) 58 28 # bytes(40) 000181E203922020FC66377F35B3780A65368D0DA3FE1862EFF9FB36DB1D416CE7B94C2E1062E80E #
Node.js script to inspect and reconstruct the ContextID:
import { encode, decode } from '@ipld/dag-cbor' import { CID } from 'multiformats' const contextId = 'ghsAAAAIAAAAANgqWCgAAYHiA5IgIPxmN381s3gKZTaNDaP+GGLv+fs22x1BbOe5TC4QYugO' console.log('Input ContextID', contextId) const contextIdBytes = Buffer.from(contextId, 'base64') const data = decode(contextIdBytes) console.log('decoded', data) console.log('PieceSize', data[0].toString()) console.log('PieceCID', data[1].toString()) const contextId2Bytes = encode([ Number(data[0].toString()), CID.parse(data[1].toString()) ]) const contextId2 = Buffer.from(contextId2Bytes).toString('base64') console.log('Reconstructed ContextID', contextId2) console.log('Match?', contextId === contextId2)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Rework spark-piece-indexer as follows:
How does Curio map Piece Info to ContextID:
{PieceCID, PieceSize}
Example IPNI advertisement:
https://http.f02620.devtty.eu/ipni-provider/12D3KooWBpYWsD4DuzTTVQdS6N5mt6rc5HtY11p7KLfhyVLw83d6/ipni/v1/ad/baguqeera6g3t7nianlk2kplejqyzl5wvbaq6h4vdqrhhgm2ctid7q4sgcx4a
Decoded ContextID (via https://cbor.me):
Node.js script to inspect and reconstruct the ContextID:
The text was updated successfully, but these errors were encountered: