compare metdata objects
This commit is contained in:
parent
94154924a1
commit
913b2dbb15
|
@ -5,9 +5,10 @@
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"body-parser": "^1.19.0",
|
"body-parser": "^1.19.0",
|
||||||
|
"deep-object-diff": "^1.1.0",
|
||||||
"express": "^4.17.1",
|
"express": "^4.17.1",
|
||||||
"http-status-codes": "^2.1.2",
|
"http-status-codes": "^2.1.2",
|
||||||
"lodash": "^4.17.19",
|
"lodash": "^4.17.20",
|
||||||
"lowdb": "^1.0.0",
|
"lowdb": "^1.0.0",
|
||||||
"node-schedule": "^1.3.2",
|
"node-schedule": "^1.3.2",
|
||||||
"object-hash": "^2.0.3",
|
"object-hash": "^2.0.3",
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
const superagent = require("superagent");
|
const superagent = require("superagent");
|
||||||
const hash = require("object-hash");
|
const hash = require("object-hash");
|
||||||
|
const { detailedDiff } = require("deep-object-diff");
|
||||||
|
const { isEqual } = require("lodash");
|
||||||
const checks = require("./basicChecks");
|
const checks = require("./basicChecks");
|
||||||
|
|
||||||
// audioExampleCheck returns the result of trying to download the skylink
|
// audioExampleCheck returns the result of trying to download the skylink
|
||||||
|
@ -8,8 +10,8 @@ function audioExampleCheck(done) {
|
||||||
const linkInfo = {
|
const linkInfo = {
|
||||||
description: "Audio Example",
|
description: "Audio Example",
|
||||||
skylink: "_A2zt5SKoqwnnZU4cBF8uBycSKULXMyeg1c5ZISBr2Q3dA",
|
skylink: "_A2zt5SKoqwnnZU4cBF8uBycSKULXMyeg1c5ZISBr2Q3dA",
|
||||||
metadataHash: "35e70208d0cf5f9ba254a2772039713be46a69d6",
|
|
||||||
bodyHash: "be335f5ad9bc357248f3d35c7e49df491afb6b12",
|
bodyHash: "be335f5ad9bc357248f3d35c7e49df491afb6b12",
|
||||||
|
metadata: { filename: "feel-good.mp3" },
|
||||||
};
|
};
|
||||||
|
|
||||||
skylinkVerification(done, linkInfo);
|
skylinkVerification(done, linkInfo);
|
||||||
|
@ -21,8 +23,12 @@ function dappExampleCheck(done) {
|
||||||
const linkInfo = {
|
const linkInfo = {
|
||||||
description: "Dapp Example (UniSwap)",
|
description: "Dapp Example (UniSwap)",
|
||||||
skylink: "EAC5HJr5Pu086EAZG4fP_r6Pnd7Ft366vt6t2AnjkoFb9Q/index.html",
|
skylink: "EAC5HJr5Pu086EAZG4fP_r6Pnd7Ft366vt6t2AnjkoFb9Q/index.html",
|
||||||
metadataHash: "72ea3859b8d83b234b62e8f6e1931f969ec39402",
|
|
||||||
bodyHash: "d6ad2506590bb45b5acc6a8a964a3da4d657354f",
|
bodyHash: "d6ad2506590bb45b5acc6a8a964a3da4d657354f",
|
||||||
|
metadata: {
|
||||||
|
filename: "/index.html",
|
||||||
|
length: 4131,
|
||||||
|
subfiles: { "index.html": { filename: "index.html", contenttype: "text/html", len: 4131 } },
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
skylinkVerification(done, linkInfo);
|
skylinkVerification(done, linkInfo);
|
||||||
|
@ -34,8 +40,12 @@ function developMomentumIndexFileCheck(done) {
|
||||||
const linkInfo = {
|
const linkInfo = {
|
||||||
description: "Develop Momentum Index File",
|
description: "Develop Momentum Index File",
|
||||||
skylink: "EAA1fG_ip4C1Vi1Ijvsr1oyr8jpH0Bo9HXya0T3kw-elGw/index.html",
|
skylink: "EAA1fG_ip4C1Vi1Ijvsr1oyr8jpH0Bo9HXya0T3kw-elGw/index.html",
|
||||||
metadataHash: "f0d06f934d28b420a77529acdb779a117a0d4cf5",
|
|
||||||
bodyHash: "53b44a9d3cfa9b3d66ce5c29976f4383725d3652",
|
bodyHash: "53b44a9d3cfa9b3d66ce5c29976f4383725d3652",
|
||||||
|
metadata: {
|
||||||
|
filename: "/index.html",
|
||||||
|
length: 4981,
|
||||||
|
subfiles: { "index.html": { filename: "index.html", contenttype: "text/html", len: 4981 } },
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
skylinkVerification(done, linkInfo);
|
skylinkVerification(done, linkInfo);
|
||||||
|
@ -47,8 +57,8 @@ function htmlExampleCheck(done) {
|
||||||
const linkInfo = {
|
const linkInfo = {
|
||||||
description: "HTML Example",
|
description: "HTML Example",
|
||||||
skylink: "PAL0w4SdA5rFCDGEutgpeQ50Om-YkBabtXVOJAkmedslKw",
|
skylink: "PAL0w4SdA5rFCDGEutgpeQ50Om-YkBabtXVOJAkmedslKw",
|
||||||
metadataHash: "eebdbfe406466ed8bbd190127a5d5a07ada68403",
|
|
||||||
bodyHash: "c932fd56f98b6db589e56be8018817f13bb29f72",
|
bodyHash: "c932fd56f98b6db589e56be8018817f13bb29f72",
|
||||||
|
metadata: { filename: "introduction â Sia API Documentation.html" },
|
||||||
};
|
};
|
||||||
|
|
||||||
skylinkVerification(done, linkInfo);
|
skylinkVerification(done, linkInfo);
|
||||||
|
@ -60,8 +70,8 @@ function imageExampleCheck(done) {
|
||||||
const linkInfo = {
|
const linkInfo = {
|
||||||
description: "Image Example",
|
description: "Image Example",
|
||||||
skylink: "IADUs8d9CQjUO34LmdaaNPK_STuZo24rpKVfYW3wPPM2uQ",
|
skylink: "IADUs8d9CQjUO34LmdaaNPK_STuZo24rpKVfYW3wPPM2uQ",
|
||||||
metadataHash: "e77df549c8e5f41881e34c3844ec7e182a0db701",
|
|
||||||
bodyHash: "313207978d0a88bf2b961f098804e9ab0f82837f",
|
bodyHash: "313207978d0a88bf2b961f098804e9ab0f82837f",
|
||||||
|
metadata: { filename: "sia-lm.png" },
|
||||||
};
|
};
|
||||||
|
|
||||||
skylinkVerification(done, linkInfo);
|
skylinkVerification(done, linkInfo);
|
||||||
|
@ -73,8 +83,8 @@ function jsonExampleCheck(done) {
|
||||||
const linkInfo = {
|
const linkInfo = {
|
||||||
description: "JSON Example",
|
description: "JSON Example",
|
||||||
skylink: "AAC0uO43g64ULpyrW0zO3bjEknSFbAhm8c-RFP21EQlmSQ",
|
skylink: "AAC0uO43g64ULpyrW0zO3bjEknSFbAhm8c-RFP21EQlmSQ",
|
||||||
metadataHash: "0e6ee84c15ee3bc848058575337303ad9958ec64",
|
|
||||||
bodyHash: "198771c3d07d5c7302aadcc0697a7298e5e8ccc3",
|
bodyHash: "198771c3d07d5c7302aadcc0697a7298e5e8ccc3",
|
||||||
|
metadata: { filename: "consensus.json" },
|
||||||
};
|
};
|
||||||
|
|
||||||
skylinkVerification(done, linkInfo);
|
skylinkVerification(done, linkInfo);
|
||||||
|
@ -86,8 +96,8 @@ function pdfExampleCheck(done) {
|
||||||
const linkInfo = {
|
const linkInfo = {
|
||||||
description: "PDF Example",
|
description: "PDF Example",
|
||||||
skylink: "XABvi7JtJbQSMAcDwnUnmp2FKDPjg8_tTTFP4BwMSxVdEg",
|
skylink: "XABvi7JtJbQSMAcDwnUnmp2FKDPjg8_tTTFP4BwMSxVdEg",
|
||||||
metadataHash: "7cb17f927c37a1c9a78221ed8b17f1af4a7299e8",
|
|
||||||
bodyHash: "9bd8162e1575569a9041972f7f62d65887063dc3",
|
bodyHash: "9bd8162e1575569a9041972f7f62d65887063dc3",
|
||||||
|
metadata: { filename: "sia.pdf" },
|
||||||
};
|
};
|
||||||
|
|
||||||
skylinkVerification(done, linkInfo);
|
skylinkVerification(done, linkInfo);
|
||||||
|
@ -99,8 +109,12 @@ function randomImageCheck(done) {
|
||||||
const linkInfo = {
|
const linkInfo = {
|
||||||
description: "Random Image",
|
description: "Random Image",
|
||||||
skylink: "PAHx7JmsU9EFGbqm5q0LNKT2wKfoJ_mhPI8zWlNEXZ8uOQ/",
|
skylink: "PAHx7JmsU9EFGbqm5q0LNKT2wKfoJ_mhPI8zWlNEXZ8uOQ/",
|
||||||
metadataHash: "1ce51445b63d7c658b02392ca7268ea90119abd7",
|
|
||||||
bodyHash: "4c73c5a0eddd5823be677d7f93bf80cc9338ee9f",
|
bodyHash: "4c73c5a0eddd5823be677d7f93bf80cc9338ee9f",
|
||||||
|
metadata: {
|
||||||
|
filename: "30355444.png",
|
||||||
|
subfiles: { "30355444.png": { filename: "30355444.png", contenttype: "image/png", len: 350473 } },
|
||||||
|
defaultpath: "/30355444.png",
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
skylinkVerification(done, linkInfo);
|
skylinkVerification(done, linkInfo);
|
||||||
|
@ -112,8 +126,12 @@ function randomImageRedirectCheck(done) {
|
||||||
const linkInfo = {
|
const linkInfo = {
|
||||||
description: "Random Image Redirect",
|
description: "Random Image Redirect",
|
||||||
skylink: "PAHx7JmsU9EFGbqm5q0LNKT2wKfoJ_mhPI8zWlNEXZ8uOQ",
|
skylink: "PAHx7JmsU9EFGbqm5q0LNKT2wKfoJ_mhPI8zWlNEXZ8uOQ",
|
||||||
metadataHash: "1ce51445b63d7c658b02392ca7268ea90119abd7",
|
|
||||||
bodyHash: "4c73c5a0eddd5823be677d7f93bf80cc9338ee9f",
|
bodyHash: "4c73c5a0eddd5823be677d7f93bf80cc9338ee9f",
|
||||||
|
metadata: {
|
||||||
|
filename: "30355444.png",
|
||||||
|
subfiles: { "30355444.png": { filename: "30355444.png", contenttype: "image/png", len: 350473 } },
|
||||||
|
defaultpath: "/30355444.png",
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
skylinkVerification(done, linkInfo);
|
skylinkVerification(done, linkInfo);
|
||||||
|
@ -124,8 +142,11 @@ function skyBayCheck(done) {
|
||||||
const linkInfo = {
|
const linkInfo = {
|
||||||
description: "SkyBay",
|
description: "SkyBay",
|
||||||
skylink: "EABkMjXzxJRpPz0eO0Or5fy2eo-rz3prdigGwRlyNd9mwA/",
|
skylink: "EABkMjXzxJRpPz0eO0Or5fy2eo-rz3prdigGwRlyNd9mwA/",
|
||||||
metadataHash: "4b3e12932186ed6925d1c8ad2d71e0220bd957dd",
|
|
||||||
bodyHash: "25d63937c9734fb08d2749c6517d1b3de8ecb856",
|
bodyHash: "25d63937c9734fb08d2749c6517d1b3de8ecb856",
|
||||||
|
metadata: {
|
||||||
|
filename: "skybay.html",
|
||||||
|
subfiles: { "skybay.html": { filename: "skybay.html", contenttype: "text/html", len: 11655 } },
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
skylinkVerification(done, linkInfo);
|
skylinkVerification(done, linkInfo);
|
||||||
|
@ -137,8 +158,11 @@ function skyBayRedirectCheck(done) {
|
||||||
const linkInfo = {
|
const linkInfo = {
|
||||||
description: "SkyBay Redirect",
|
description: "SkyBay Redirect",
|
||||||
skylink: "EABkMjXzxJRpPz0eO0Or5fy2eo-rz3prdigGwRlyNd9mwA",
|
skylink: "EABkMjXzxJRpPz0eO0Or5fy2eo-rz3prdigGwRlyNd9mwA",
|
||||||
metadataHash: "4b3e12932186ed6925d1c8ad2d71e0220bd957dd",
|
|
||||||
bodyHash: "25d63937c9734fb08d2749c6517d1b3de8ecb856",
|
bodyHash: "25d63937c9734fb08d2749c6517d1b3de8ecb856",
|
||||||
|
metadata: {
|
||||||
|
filename: "skybay.html",
|
||||||
|
subfiles: { "skybay.html": { filename: "skybay.html", contenttype: "text/html", len: 11655 } },
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
skylinkVerification(done, linkInfo);
|
skylinkVerification(done, linkInfo);
|
||||||
|
@ -149,8 +173,8 @@ function skyBinCheck(done) {
|
||||||
const linkInfo = {
|
const linkInfo = {
|
||||||
description: "SkyBin",
|
description: "SkyBin",
|
||||||
skylink: "CAAVU14pB9GRIqCrejD7rlS27HltGGiiCLICzmrBV0wVtA/",
|
skylink: "CAAVU14pB9GRIqCrejD7rlS27HltGGiiCLICzmrBV0wVtA/",
|
||||||
metadataHash: "5c23ba16cd62d623bfb73e86a503d681d2ffcb24",
|
|
||||||
bodyHash: "767ec67c417e11b97c5db7dad9ea3b6b27cb0d39",
|
bodyHash: "767ec67c417e11b97c5db7dad9ea3b6b27cb0d39",
|
||||||
|
metadata: { filename: "skybin.html" },
|
||||||
};
|
};
|
||||||
|
|
||||||
skylinkVerification(done, linkInfo);
|
skylinkVerification(done, linkInfo);
|
||||||
|
@ -162,8 +186,8 @@ function skyBinRedirectCheck(done) {
|
||||||
const linkInfo = {
|
const linkInfo = {
|
||||||
description: "SkyBin Redirect",
|
description: "SkyBin Redirect",
|
||||||
skylink: "CAAVU14pB9GRIqCrejD7rlS27HltGGiiCLICzmrBV0wVtA",
|
skylink: "CAAVU14pB9GRIqCrejD7rlS27HltGGiiCLICzmrBV0wVtA",
|
||||||
metadataHash: "5c23ba16cd62d623bfb73e86a503d681d2ffcb24",
|
|
||||||
bodyHash: "767ec67c417e11b97c5db7dad9ea3b6b27cb0d39",
|
bodyHash: "767ec67c417e11b97c5db7dad9ea3b6b27cb0d39",
|
||||||
|
metadata: { filename: "skybin.html" },
|
||||||
};
|
};
|
||||||
|
|
||||||
skylinkVerification(done, linkInfo);
|
skylinkVerification(done, linkInfo);
|
||||||
|
@ -174,8 +198,129 @@ function skyGalleryCheck(done) {
|
||||||
const linkInfo = {
|
const linkInfo = {
|
||||||
description: "SkyGallery",
|
description: "SkyGallery",
|
||||||
skylink: "AADW6GsQcetwDBaDYnGCSTbYjSKY743NtY1A5VRx5sj3Dg/",
|
skylink: "AADW6GsQcetwDBaDYnGCSTbYjSKY743NtY1A5VRx5sj3Dg/",
|
||||||
metadataHash: "b17a16a3522f2877b5b9ebdcdfd98956eade8721",
|
|
||||||
bodyHash: "077e54054748d278114f1870f8045a162eb73641",
|
bodyHash: "077e54054748d278114f1870f8045a162eb73641",
|
||||||
|
metadata: {
|
||||||
|
filename: "skygallery-v0.1.1-76c4c115fcb526716b2564568850f433",
|
||||||
|
subfiles: {
|
||||||
|
"css/app.84a130ed.css": { filename: "css/app.84a130ed.css", contenttype: "text/css", len: 698 },
|
||||||
|
"css/chunk-5ce44031.d4e78528.css": {
|
||||||
|
filename: "css/chunk-5ce44031.d4e78528.css",
|
||||||
|
contenttype: "text/css",
|
||||||
|
offset: 698,
|
||||||
|
len: 45,
|
||||||
|
},
|
||||||
|
"css/chunk-6bef839b.593aa2be.css": {
|
||||||
|
filename: "css/chunk-6bef839b.593aa2be.css",
|
||||||
|
contenttype: "text/css",
|
||||||
|
offset: 743,
|
||||||
|
len: 5013,
|
||||||
|
},
|
||||||
|
"css/chunk-8ed50a48.8ba8c09d.css": {
|
||||||
|
filename: "css/chunk-8ed50a48.8ba8c09d.css",
|
||||||
|
contenttype: "text/css",
|
||||||
|
offset: 5756,
|
||||||
|
len: 7204,
|
||||||
|
},
|
||||||
|
"css/chunk-eb4c1efc.2a7e25ed.css": {
|
||||||
|
filename: "css/chunk-eb4c1efc.2a7e25ed.css",
|
||||||
|
contenttype: "text/css",
|
||||||
|
offset: 12960,
|
||||||
|
len: 45,
|
||||||
|
},
|
||||||
|
"css/chunk-vendors.b4f58487.css": {
|
||||||
|
filename: "css/chunk-vendors.b4f58487.css",
|
||||||
|
contenttype: "text/css",
|
||||||
|
offset: 13005,
|
||||||
|
len: 382063,
|
||||||
|
},
|
||||||
|
"img/skygallery_logo.2336197e.svg": {
|
||||||
|
filename: "img/skygallery_logo.2336197e.svg",
|
||||||
|
contenttype: "image/svg+xml",
|
||||||
|
offset: 395068,
|
||||||
|
len: 923,
|
||||||
|
},
|
||||||
|
"img/skynet-logo-animated.4d24345c.svg": {
|
||||||
|
filename: "img/skynet-logo-animated.4d24345c.svg",
|
||||||
|
contenttype: "image/svg+xml",
|
||||||
|
offset: 395991,
|
||||||
|
len: 2600,
|
||||||
|
},
|
||||||
|
"index.html": { filename: "index.html", contenttype: "text/html", offset: 398591, len: 2534 },
|
||||||
|
"js/app.cff1e0a4.js": {
|
||||||
|
filename: "js/app.cff1e0a4.js",
|
||||||
|
contenttype: "application/javascript",
|
||||||
|
offset: 401125,
|
||||||
|
len: 15604,
|
||||||
|
},
|
||||||
|
"js/app.cff1e0a4.js.map": {
|
||||||
|
filename: "js/app.cff1e0a4.js.map",
|
||||||
|
contenttype: "application/json",
|
||||||
|
offset: 416729,
|
||||||
|
len: 54424,
|
||||||
|
},
|
||||||
|
"js/chunk-5ce44031.7fb55da9.js": {
|
||||||
|
filename: "js/chunk-5ce44031.7fb55da9.js",
|
||||||
|
contenttype: "application/javascript",
|
||||||
|
offset: 471153,
|
||||||
|
len: 3644,
|
||||||
|
},
|
||||||
|
"js/chunk-5ce44031.7fb55da9.js.map": {
|
||||||
|
filename: "js/chunk-5ce44031.7fb55da9.js.map",
|
||||||
|
contenttype: "application/json",
|
||||||
|
offset: 474797,
|
||||||
|
len: 13494,
|
||||||
|
},
|
||||||
|
"js/chunk-6bef839b.b543fe7d.js": {
|
||||||
|
filename: "js/chunk-6bef839b.b543fe7d.js",
|
||||||
|
contenttype: "application/javascript",
|
||||||
|
offset: 488291,
|
||||||
|
len: 13349,
|
||||||
|
},
|
||||||
|
"js/chunk-6bef839b.b543fe7d.js.map": {
|
||||||
|
filename: "js/chunk-6bef839b.b543fe7d.js.map",
|
||||||
|
contenttype: "application/json",
|
||||||
|
offset: 501640,
|
||||||
|
len: 46690,
|
||||||
|
},
|
||||||
|
"js/chunk-8ed50a48.35f8ef35.js": {
|
||||||
|
filename: "js/chunk-8ed50a48.35f8ef35.js",
|
||||||
|
contenttype: "application/javascript",
|
||||||
|
offset: 548330,
|
||||||
|
len: 130329,
|
||||||
|
},
|
||||||
|
"js/chunk-8ed50a48.35f8ef35.js.map": {
|
||||||
|
filename: "js/chunk-8ed50a48.35f8ef35.js.map",
|
||||||
|
contenttype: "application/json",
|
||||||
|
offset: 678659,
|
||||||
|
len: 507145,
|
||||||
|
},
|
||||||
|
"js/chunk-eb4c1efc.57b6e01c.js": {
|
||||||
|
filename: "js/chunk-eb4c1efc.57b6e01c.js",
|
||||||
|
contenttype: "application/javascript",
|
||||||
|
offset: 1185804,
|
||||||
|
len: 4407,
|
||||||
|
},
|
||||||
|
"js/chunk-eb4c1efc.57b6e01c.js.map": {
|
||||||
|
filename: "js/chunk-eb4c1efc.57b6e01c.js.map",
|
||||||
|
contenttype: "application/json",
|
||||||
|
offset: 1190211,
|
||||||
|
len: 15355,
|
||||||
|
},
|
||||||
|
"js/chunk-vendors.1fd55121.js": {
|
||||||
|
filename: "js/chunk-vendors.1fd55121.js",
|
||||||
|
contenttype: "application/javascript",
|
||||||
|
offset: 1205566,
|
||||||
|
len: 749829,
|
||||||
|
},
|
||||||
|
"js/chunk-vendors.1fd55121.js.map": {
|
||||||
|
filename: "js/chunk-vendors.1fd55121.js.map",
|
||||||
|
contenttype: "application/json",
|
||||||
|
offset: 1955395,
|
||||||
|
len: 2793251,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
defaultpath: "/index.html",
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
skylinkVerification(done, linkInfo);
|
skylinkVerification(done, linkInfo);
|
||||||
|
@ -187,8 +332,12 @@ function skyGalleryIndexFileCheck(done) {
|
||||||
const linkInfo = {
|
const linkInfo = {
|
||||||
description: "SkyGallery Index File",
|
description: "SkyGallery Index File",
|
||||||
skylink: "AADW6GsQcetwDBaDYnGCSTbYjSKY743NtY1A5VRx5sj3Dg/index.html",
|
skylink: "AADW6GsQcetwDBaDYnGCSTbYjSKY743NtY1A5VRx5sj3Dg/index.html",
|
||||||
metadataHash: "203dcc63e6c3db7501822d9f0d38fab26f3dbceb",
|
|
||||||
bodyHash: "077e54054748d278114f1870f8045a162eb73641",
|
bodyHash: "077e54054748d278114f1870f8045a162eb73641",
|
||||||
|
metadata: {
|
||||||
|
filename: "/index.html",
|
||||||
|
length: 2534,
|
||||||
|
subfiles: { "index.html": { filename: "index.html", contenttype: "text/html", len: 2534 } },
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
skylinkVerification(done, linkInfo);
|
skylinkVerification(done, linkInfo);
|
||||||
|
@ -200,8 +349,129 @@ function skyGalleryRedirectCheck(done) {
|
||||||
const linkInfo = {
|
const linkInfo = {
|
||||||
description: "SkyGallery Redirect",
|
description: "SkyGallery Redirect",
|
||||||
skylink: "AADW6GsQcetwDBaDYnGCSTbYjSKY743NtY1A5VRx5sj3Dg",
|
skylink: "AADW6GsQcetwDBaDYnGCSTbYjSKY743NtY1A5VRx5sj3Dg",
|
||||||
metadataHash: "b17a16a3522f2877b5b9ebdcdfd98956eade8721",
|
|
||||||
bodyHash: "077e54054748d278114f1870f8045a162eb73641",
|
bodyHash: "077e54054748d278114f1870f8045a162eb73641",
|
||||||
|
metadata: {
|
||||||
|
filename: "skygallery-v0.1.1-76c4c115fcb526716b2564568850f433",
|
||||||
|
subfiles: {
|
||||||
|
"css/app.84a130ed.css": { filename: "css/app.84a130ed.css", contenttype: "text/css", len: 698 },
|
||||||
|
"css/chunk-5ce44031.d4e78528.css": {
|
||||||
|
filename: "css/chunk-5ce44031.d4e78528.css",
|
||||||
|
contenttype: "text/css",
|
||||||
|
offset: 698,
|
||||||
|
len: 45,
|
||||||
|
},
|
||||||
|
"css/chunk-6bef839b.593aa2be.css": {
|
||||||
|
filename: "css/chunk-6bef839b.593aa2be.css",
|
||||||
|
contenttype: "text/css",
|
||||||
|
offset: 743,
|
||||||
|
len: 5013,
|
||||||
|
},
|
||||||
|
"css/chunk-8ed50a48.8ba8c09d.css": {
|
||||||
|
filename: "css/chunk-8ed50a48.8ba8c09d.css",
|
||||||
|
contenttype: "text/css",
|
||||||
|
offset: 5756,
|
||||||
|
len: 7204,
|
||||||
|
},
|
||||||
|
"css/chunk-eb4c1efc.2a7e25ed.css": {
|
||||||
|
filename: "css/chunk-eb4c1efc.2a7e25ed.css",
|
||||||
|
contenttype: "text/css",
|
||||||
|
offset: 12960,
|
||||||
|
len: 45,
|
||||||
|
},
|
||||||
|
"css/chunk-vendors.b4f58487.css": {
|
||||||
|
filename: "css/chunk-vendors.b4f58487.css",
|
||||||
|
contenttype: "text/css",
|
||||||
|
offset: 13005,
|
||||||
|
len: 382063,
|
||||||
|
},
|
||||||
|
"img/skygallery_logo.2336197e.svg": {
|
||||||
|
filename: "img/skygallery_logo.2336197e.svg",
|
||||||
|
contenttype: "image/svg+xml",
|
||||||
|
offset: 395068,
|
||||||
|
len: 923,
|
||||||
|
},
|
||||||
|
"img/skynet-logo-animated.4d24345c.svg": {
|
||||||
|
filename: "img/skynet-logo-animated.4d24345c.svg",
|
||||||
|
contenttype: "image/svg+xml",
|
||||||
|
offset: 395991,
|
||||||
|
len: 2600,
|
||||||
|
},
|
||||||
|
"index.html": { filename: "index.html", contenttype: "text/html", offset: 398591, len: 2534 },
|
||||||
|
"js/app.cff1e0a4.js": {
|
||||||
|
filename: "js/app.cff1e0a4.js",
|
||||||
|
contenttype: "application/javascript",
|
||||||
|
offset: 401125,
|
||||||
|
len: 15604,
|
||||||
|
},
|
||||||
|
"js/app.cff1e0a4.js.map": {
|
||||||
|
filename: "js/app.cff1e0a4.js.map",
|
||||||
|
contenttype: "application/json",
|
||||||
|
offset: 416729,
|
||||||
|
len: 54424,
|
||||||
|
},
|
||||||
|
"js/chunk-5ce44031.7fb55da9.js": {
|
||||||
|
filename: "js/chunk-5ce44031.7fb55da9.js",
|
||||||
|
contenttype: "application/javascript",
|
||||||
|
offset: 471153,
|
||||||
|
len: 3644,
|
||||||
|
},
|
||||||
|
"js/chunk-5ce44031.7fb55da9.js.map": {
|
||||||
|
filename: "js/chunk-5ce44031.7fb55da9.js.map",
|
||||||
|
contenttype: "application/json",
|
||||||
|
offset: 474797,
|
||||||
|
len: 13494,
|
||||||
|
},
|
||||||
|
"js/chunk-6bef839b.b543fe7d.js": {
|
||||||
|
filename: "js/chunk-6bef839b.b543fe7d.js",
|
||||||
|
contenttype: "application/javascript",
|
||||||
|
offset: 488291,
|
||||||
|
len: 13349,
|
||||||
|
},
|
||||||
|
"js/chunk-6bef839b.b543fe7d.js.map": {
|
||||||
|
filename: "js/chunk-6bef839b.b543fe7d.js.map",
|
||||||
|
contenttype: "application/json",
|
||||||
|
offset: 501640,
|
||||||
|
len: 46690,
|
||||||
|
},
|
||||||
|
"js/chunk-8ed50a48.35f8ef35.js": {
|
||||||
|
filename: "js/chunk-8ed50a48.35f8ef35.js",
|
||||||
|
contenttype: "application/javascript",
|
||||||
|
offset: 548330,
|
||||||
|
len: 130329,
|
||||||
|
},
|
||||||
|
"js/chunk-8ed50a48.35f8ef35.js.map": {
|
||||||
|
filename: "js/chunk-8ed50a48.35f8ef35.js.map",
|
||||||
|
contenttype: "application/json",
|
||||||
|
offset: 678659,
|
||||||
|
len: 507145,
|
||||||
|
},
|
||||||
|
"js/chunk-eb4c1efc.57b6e01c.js": {
|
||||||
|
filename: "js/chunk-eb4c1efc.57b6e01c.js",
|
||||||
|
contenttype: "application/javascript",
|
||||||
|
offset: 1185804,
|
||||||
|
len: 4407,
|
||||||
|
},
|
||||||
|
"js/chunk-eb4c1efc.57b6e01c.js.map": {
|
||||||
|
filename: "js/chunk-eb4c1efc.57b6e01c.js.map",
|
||||||
|
contenttype: "application/json",
|
||||||
|
offset: 1190211,
|
||||||
|
len: 15355,
|
||||||
|
},
|
||||||
|
"js/chunk-vendors.1fd55121.js": {
|
||||||
|
filename: "js/chunk-vendors.1fd55121.js",
|
||||||
|
contenttype: "application/javascript",
|
||||||
|
offset: 1205566,
|
||||||
|
len: 749829,
|
||||||
|
},
|
||||||
|
"js/chunk-vendors.1fd55121.js.map": {
|
||||||
|
filename: "js/chunk-vendors.1fd55121.js.map",
|
||||||
|
contenttype: "application/json",
|
||||||
|
offset: 1955395,
|
||||||
|
len: 2793251,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
defaultpath: "/index.html",
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
skylinkVerification(done, linkInfo);
|
skylinkVerification(done, linkInfo);
|
||||||
|
@ -213,8 +483,12 @@ function uniswapIndexFileCheck(done) {
|
||||||
const linkInfo = {
|
const linkInfo = {
|
||||||
description: "Uniswap Skylink Index File",
|
description: "Uniswap Skylink Index File",
|
||||||
skylink: "IAC6CkhNYuWZqMVr1gob1B6tPg4MrBGRzTaDvAIAeu9A9w/index.html",
|
skylink: "IAC6CkhNYuWZqMVr1gob1B6tPg4MrBGRzTaDvAIAeu9A9w/index.html",
|
||||||
metadataHash: "5baef23f7cc138a41d945727eb862fc2cd94ae45",
|
|
||||||
bodyHash: "3965f9a7def085b3a764ddc76a528eda38d72359",
|
bodyHash: "3965f9a7def085b3a764ddc76a528eda38d72359",
|
||||||
|
metadata: {
|
||||||
|
filename: "/index.html",
|
||||||
|
length: 3268,
|
||||||
|
subfiles: { "index.html": { filename: "index.html", contenttype: "text/html", len: 3268 } },
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
skylinkVerification(done, linkInfo);
|
skylinkVerification(done, linkInfo);
|
||||||
|
@ -246,12 +520,15 @@ function skylinkVerification(done, linkInfo) {
|
||||||
const validBody = hash(res.body) === linkInfo.bodyHash;
|
const validBody = hash(res.body) === linkInfo.bodyHash;
|
||||||
// Check if the metadata is valid by checking against the known
|
// Check if the metadata is valid by checking against the known
|
||||||
// hash
|
// hash
|
||||||
const validMetadata = hash(res.header["skynet-file-metadata"]) === linkInfo.metadataHash;
|
const validMetadata = isEqual(res.header["skynet-file-metadata"], linkInfo.metadata);
|
||||||
// Redetermine if the Skylink is up based on the results from the body
|
// Redetermine if the Skylink is up based on the results from the body
|
||||||
// and metadata hash checks
|
// and metadata hash checks
|
||||||
up = up && validBody && validMetadata;
|
up = up && validBody && validMetadata;
|
||||||
|
|
||||||
info = { validBody, validMetadata, metadata: res.header["skynet-file-metadata"] };
|
info = {
|
||||||
|
body: { valid: validBody },
|
||||||
|
metadata: { valid: validMetadata, diff: detailedDiff(res.header["skynet-file-metadata"], linkInfo.metadata) },
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return the entry information
|
// Return the entry information
|
||||||
|
|
|
@ -4880,6 +4880,11 @@ deep-is@^0.1.3, deep-is@~0.1.3:
|
||||||
resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34"
|
resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34"
|
||||||
integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=
|
integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=
|
||||||
|
|
||||||
|
deep-object-diff@^1.1.0:
|
||||||
|
version "1.1.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/deep-object-diff/-/deep-object-diff-1.1.0.tgz#d6fabf476c2ed1751fc94d5ca693d2ed8c18bc5a"
|
||||||
|
integrity sha512-b+QLs5vHgS+IoSNcUE4n9HP2NwcHj7aqnJWsjPtuG75Rh5TOaGt0OjAYInh77d5T16V5cRDC+Pw/6ZZZiETBGw==
|
||||||
|
|
||||||
deepmerge@^2.1.1:
|
deepmerge@^2.1.1:
|
||||||
version "2.2.1"
|
version "2.2.1"
|
||||||
resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-2.2.1.tgz#5d3ff22a01c00f645405a2fbc17d0778a1801170"
|
resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-2.2.1.tgz#5d3ff22a01c00f645405a2fbc17d0778a1801170"
|
||||||
|
@ -9473,7 +9478,7 @@ lodash.uniq@4.5.0, lodash.uniq@^4.5.0:
|
||||||
resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773"
|
resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773"
|
||||||
integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=
|
integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=
|
||||||
|
|
||||||
lodash@4, lodash@^4.0.0, lodash@^4.11.1, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.3.0, lodash@~4.17.10:
|
lodash@4, lodash@^4.0.0, lodash@^4.11.1, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.3.0, lodash@~4.17.10:
|
||||||
version "4.17.20"
|
version "4.17.20"
|
||||||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52"
|
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52"
|
||||||
integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==
|
integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==
|
||||||
|
|
Reference in New Issue