// Converstion routines - IPFS's API is odd, some functions want a multihash (e.g. "Q..." or "z...") some wanta path e.g. "/ipfs/Q..." and soem want a CID data structure
// Note this hash is fetchable via https://ipfs.io/ipfs/Qmbzs7jhkBZuVixhnM3J3QhMrL6bcAoSYiRPZrdoX3DhzB
letcid=newCID(multihash);
// Uncomment one or both of these tests
awaittest_files_cat(cid,len,false);// Works in node and in Chrome
//await test_bylinks(cid, len, false);
}
asyncfunctiontest_ipfs(){
awaitp_ipfsstart(true);
//Working 9May using files.cat and Addresses libp2p.io
awaittest_long_file('PDF sent to http api a long time ago',"Qmbzs7jhkBZuVixhnM3J3QhMrL6bcAoSYiRPZrdoX3DhzB",262438);
//Fails 9May using files.cat and Addresses libp2p.io - doesnt succeed at files.cat,
//On TransportIPFS test of same file, the first dag.get times out.
//Note prior to these tests, this file was successfully retrieved from https://ipfs.io/ipfs/zdj7WkPCyjRgfCAMosMxCx8UhtW6rZvPNRsxCzg3mrxTLRVBr
awaittest_long_file('Using curl urlstore add','zdj7WkPCyjRgfCAMosMxCx8UhtW6rZvPNRsxCzg3mrxTLRVBr',321761);//Same video as above but via urlstore
//await test_long_file('Commute 11Mb video sent a few months ago almost certainly via urlstore', 'zdj7Wc9BBA2kar84oo8S6VotYc9PySAnmc8ji6kzKAFjqMxHS', 11919082);
//await test_long_file('500Mb file sent few days ago via urlstore', 'zdj7WfaG5e1PWoqxWUyUyS2nTe4pgNQZ4tRnrfd5uoxrXAANA', 521998952);
//await test_long_file('Smaller 22Mb video sent 2018-03-13', 'zdj7WaHjDtE2e7g614UfXNwyrBwRUd6JkujRsLc9M2ufozLct', 22207578);
//await test_long_file('Using ipfs add on dweb server 2018-05-09', 'QmYuULjZVhkj6NDFRzbJncVx4DGVcwiyofgmgADBfcVozs', 0);
//await test_long_file('Not sure how this one was added its a video', 'QmRfcgjWEWdzKBnnSYwmV7Kt5wVVuWZvLm96o4dj7myWuy', 321761);
//await test_long_file('Using a hash from the DHT Provide logs', 'zb2rhmFWNJ7TVEKQF6UEjnPbw4ESoq8CwbVTPHwQbacnoRd9M', 321761); // files.cat says invalid node type, object.links returns undefined
//await test_long_file('Using ipfs add on standard deployment on my mac', 'QmUktxW4tz3dvDymDQ3ZRdMBFeCF8CKU3gb5GWJrbGaF4V', 321761); // Same file as above as of 27Mar doesnt respond on links?
//await test_long_file('Using a hash from the DHT Provide logs', 'zdj7WXHDDkXthYNLKNQg2DZkBD8vmAQ2K37dURNRwAAM1iMSQ', 321761); // files.cat says invalid node type, object.links returns undefined
//await test_long_file('Using a hash from add.csv using http add', 'QmfWQzucB7QWq32meSSKk8xLEtouAEWnWs7RatbxJz9wkj', 13980); // files.cat says invalid node type, object.links returns undefined
//await test_long_file('Using a hash from add.csv using http urlstore', 'zb2rhXDUQRraHn3tQcq8MHVMVSVP9RwRyEMzyBhehssVjnPWb', 9613); // files.cat says invalid node type, object.links returns undefined