Skip to content

Instantly share code, notes, and snippets.

@alanshaw
Created October 31, 2024 11:49
Show Gist options
  • Save alanshaw/dd7f2eccac68d956007e8fa55845b7fa to your computer and use it in GitHub Desktop.
Save alanshaw/dd7f2eccac68d956007e8fa55845b7fa to your computer and use it in GitHub Desktop.
Get the commitments
const cids = [
'bafybeiei72mvsmckxh6jliaxtgtmktcucw6zjktmjko6lpdb76uy677nym',
'bafybeige7or65xqaqzbrsrnyf3alrcmr3mbkiwvbevc3hpkpiydbixjcte',
'bafybeidovp3gf6h6aye6vv25o3r6ayc32c3znzgijtvqqmqrnsfcljvz7i',
'bafybeigqhr6wptfw6a2jjvvd6alq73mgnn2ugfmnnzdksmaid44divhnju',
'bafybeicih3gpoxip4n2ozuqqfskdwymxcr27i6xgtdmnivuhy5q76weklu',
'bafybeia2fnngg5gzhc6v6ul23j67m4b4j3ekyxnonvyx5n4uo7jtq236my',
'bafybeieymcyqlnif4rtzt3cfterlyudr6lz6bpt3kkchji7bxgcjq3a4iy',
'bafybeibh4swn5lir77xo3sdxps5h3kl6xygmhutdkqwewnyrdvjz435nue',
'bafybeifef47tawlpfdjlrmvohjrnxgozarrwxkrdcqx3mmwigf4fakfr6a',
'bafybeid7fysnwk27pwahhxxlrbqjitz3rmd32n5zdypmaxvzjn6ctro3pm',
'bafybeihkihcnufnxzwfyjuk3dfuettm5kiyzagug5q76npx4vhm6r4g6ym',
'bafybeienluqbu7nc7wslei7jh45d567ttg3qwbo7dalvltsqeadc7sfgiy',
'bafybeihjdoljlrlq5c275j6ejlpgcisvxgfp5wp5f54v3qi4nn4onu7mfe',
'bafybeicg2qgfntkqp6yssbtlz4ah7cbsrz45p2zfydryyymxsrh44ltiim',
'bafybeidw3wnxohegwrdsyoxylgx47yvkfntp5c35fdbwf6krub4p5e3gaa',
'bafybeiajrktbuzc4fgrrbyld7qm434cmvawre7awyhjelncha3gev5fm3u',
'bafybeif6jpr3tr2vsjzqsmyhhapi5zzs37rqap2czmeeyc4hqjwvsuh6qi',
'bafybeicrklj7j7mpge7bll6wjoljo72jxwvj5eq5ns3leq473wcdiryjue',
'bafybeifhjd5crqek7h5lg3ndyukkjj6gbcrb2k3g75w62xigwfleq5aa74',
'bafybeifaelkpg3i7iee7e72f6u72cfb2djpyird7bqfjw4q67trxnuoo3e',
'bafybeice2krkbwakenvccjqgcs6ahbiwzxlv6tjkbt52qm5jps2k4b5rj4',
'bafybeihzbuhiukkyznhaj6mvzsbyz3w75ymiag7lcd77phcgqof7jsdl5e',
'bafybeieh75ezi5w2lyuyrdh5dp6tv4l6gtbrpjzqezgbth52mvd6ushynu',
'bafybeicdewk6uh52se6rfwt35pq2tf42j243s3r2s6rjet22qlvxzzgu5q',
'bafybeigk77dnns5efx4fjuirzi4fqvaxut5zkeaf7daqj4ikw5urwoqi7e',
'bafybeibq7ws6z5co3k5avvd7u7uxghkd77xnaep33jogy3su43n2pua5iu',
'bafybeibhfvnlzx7ixxudwkglbdtrtldiiwav3oca3y2dwugzj6lvyzc3l4',
'bafybeigvv7n2t2olhfkrflbly7s3gry6eww4hfryuo2mjcwfuhyz6rwjti',
'bafybeiagptnc42pssssism62lz6seytii76mumgrlz5bx6ckorvrgy63ya',
'bafybeianjs7xusbd6dxu73ofxkbbiz57izsq3463mzknwjht3b6ksb2owe',
'bafybeicmqgwzke7l5ad765ltklktljjjjfj5csk4u3otzcpnrxvjvptadu',
'bafybeid2ebloi4daahv772w3bh7qt77bwcwb574cb3w6usawtqdrutiz7a',
'bafybeicem3ygmu65s53w3xkwvbsvdxfe3nzno7ezix6yh73wh5rl7hantm',
'bafybeiayam67wysiuqmzhvnv2qqdeo3fx2cu66frdp2tzb5kd6p4r2upra',
'bafybeidd4xluu67q3gg72q5w5tlfn5qhjwijzhg2rkrzamipm3urg7s43e',
'bafybeiaopiijseb3rp6hhbgompmxqfce7zzj3xfrwajsmzpyljbzhkopyq',
'bafybeigffbydpbdnknlzhiwptqwyediezariogvjahwn4jh6mp53gj3qe4',
'bafybeifmraoyjrfovdmagucuy4n6w4uohrxs47ip4oyipfeyoad6zuxprm',
'bafybeic4dytzdeip7nvayepsj7np5gnmypmgpbhecvmqdsk4y43yzej2zq',
'bafybeiekxmx4wp3h576s6bkwzuhpltbuirarrjktt7xdqe3pz4bui6ynna',
'bafybeigykop326ch7jcpcacpgwvgcy6yfjn6sbujxep7hqf6quvlehym7q',
'bafybeigqfstqm2drppjcegvd7g3tdsrbzfjb2oqkpyujejjrkafwyz3hw4',
'bafybeidotjo7vt7dmyjykg6fx4xr5iz723fbc35zvc26et3vaciuvzpgh4',
'bafybeiay24a3kz6c5reswugg7asbhrye4bt3trr6jcehb3mas7y4quvhlu',
'bafybeifhvu2owcojvsgrkwb44uezbh4romo3eawrxcetm5jgaj73g4piw4',
'bafybeid5c5aq7xlsfiavtqrzxkjyapjgdkeg4p7im5fwdymo4mobc6mtvm',
'bafybeiekv2cx5hdden4t6ascexkexilgezcq6uzx7qln4krd6r6hcsupyq',
'bafybeicssi54wbndobf7wxj7jf4fss5muofgzefibmagvupody6cprppua',
'bafybeialk7ta3ssoyyo3w6pq2vu2zdm7t6xfaztebrncwrlfvwreungv4e',
'bafybeifsgvaxxzav54jrhxhx4kkeptrwrj4jzoicwyjgniesg2y5py4f24',
'bafybeiguax3uzqhcgmra2xurrid6kamswtcfczl6mqwqlh6eu4glh6itsi',
'bafybeibol65qgu4akjoguxwainjvloa34unfkmfv2fzsn5n76rml3l4fta',
'bafybeigw3y5ohrxl62v4tp4mnqmogdwbqkaqoxvuctdojn6zmxa7dckfp4',
'bafybeifh6zfdw5yhcu5na3btewgzxga56trka6jgvyxua2iodlnmatmine',
'bafybeidir43dh2vbthcyuqxctnfram6uac5rvkclpbv2k5y3pjprtdpd3u',
'bafybeifuv3x3mz5psfigc66yywaqmt2mbgad7kpaj5wu3fnkageg3mfy3u',
'bafybeia5czodbh7zghifiban3ekwxjnc64ulxrumgkt7spwzitzsy5arbi',
'bafybeicl4renvodbydtjdsnk7aiceyffvwahpvxprzu57zspqjz7i73tji',
'bafybeihlfysircgpwrd4fhhcmuf3n2skr6e3o36baqd7zq5v22z4me3gla',
'bafybeihn53yd4fpygalpa6txaltnhfo4l565fb34raqvbafqbe2ybt3d24',
'bafybeibsyuvyiwqhlyu57w74yyxmxwwmpg22e23t6bsvv5uhnzdf7kq62q',
'bafybeigbpcqvlfmniytxlmoaqj7hxsvlai2h5pp6b5a75yvinb2r3lxzw4',
'bafybeihzq5as7hfglf7o3vl2j3y2jckbvmgakgqfyqeirj2bhylkrrowoe',
'bafybeifjeyywfdvlvl7jdajtd25p7h67izpm7hnibiog4wtby2r5av2kwm'
]
for (const cid of cids) {
console.time(`${cid} total`)
console.time(`${cid} TTFB`)
try {
const res = await fetch(`https://${cid}.ipfs.w3s.link/commitment.json`)
console.timeEnd(`${cid} TTFB`)
if (res.status !== 200) {
throw new Error(`${cid} bad status: ${res.status}`)
}
try {
await res.json()
} catch (err) {
throw new Error(`${cid} bad data: ${err.message}`)
}
} catch (err) {
console.error(err)
} finally {
console.timeEnd(`${cid} total`)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment