mirror of
https://github.com/fluencelabs/examples
synced 2024-12-04 19:20:17 +00:00
Fix curl_template
This commit is contained in:
parent
9ef4755d81
commit
b3b47fc930
@ -29,7 +29,7 @@ P.S. JSON5 has comments! yaaay!
|
|||||||
|
|
||||||
# Call it
|
# Call it
|
||||||
```shell
|
```shell
|
||||||
fldist run_air -p request.air -d '{"service": "e90bfbaf-ede7-4fbe-b45a-6250bf36ed3e"}'
|
fldist run_air -p request.air -d '{"service": "19e70712-04b6-496e-96d9-9eab87bef9c6"}'
|
||||||
```
|
```
|
||||||
|
|
||||||
# Run frontend
|
# Run frontend
|
||||||
|
62
curl_template/frontend/package-lock.json
generated
62
curl_template/frontend/package-lock.json
generated
@ -1200,18 +1200,17 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@fluencelabs/aquamarine-stepper": {
|
"@fluencelabs/aquamarine-interpreter": {
|
||||||
"version": "0.4.2",
|
"version": "0.7.1",
|
||||||
"resolved": "https://registry.npmjs.org/@fluencelabs/aquamarine-stepper/-/aquamarine-stepper-0.4.2.tgz",
|
"resolved": "https://registry.npmjs.org/@fluencelabs/aquamarine-interpreter/-/aquamarine-interpreter-0.7.1.tgz",
|
||||||
"integrity": "sha512-Cz1jJmuj7tk3n2g9bzRTcDgymF5mwI7AvrKKgfiOrEfopbcXqlFA1ypO+FFNSP/M7VN0o3KFNkwG5GnTTkg3Fw=="
|
"integrity": "sha512-XWc1OE+5PtmK6tiSUiel74YVIly2b+l0UeV/W65Vzp1c6iYFsNDa6ztd7sTcYiQlneXLCdytDmIqRDrccDB+Qg=="
|
||||||
},
|
},
|
||||||
"@fluencelabs/fluence": {
|
"@fluencelabs/fluence": {
|
||||||
"version": "0.9.17",
|
"version": "0.9.26",
|
||||||
"resolved": "https://registry.npmjs.org/@fluencelabs/fluence/-/fluence-0.9.17.tgz",
|
"resolved": "https://registry.npmjs.org/@fluencelabs/fluence/-/fluence-0.9.26.tgz",
|
||||||
"integrity": "sha512-tAosUW874xfpr7RL5Ees9JT8gqMB9BwAM/7nmw1K4ZqnbNw5XIP645NWiSsAgQGHjkhJk4HVAEJrz1wKzAPYEA==",
|
"integrity": "sha512-Wsq8vmclAONp0xwyeRifOFLtyztK6gaOwT84HxvXLUc3/ZrmbleuGzDNKdDtwz7SxPg1AC5wBOCxuIIGtSq/BA==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@fluencelabs/aquamarine-stepper": "0.4.2",
|
"@fluencelabs/aquamarine-interpreter": "^0.7.0",
|
||||||
"@fluencelabs/fluence-network-environment": "1.0.8",
|
|
||||||
"async": "3.2.0",
|
"async": "3.2.0",
|
||||||
"base64-js": "1.3.1",
|
"base64-js": "1.3.1",
|
||||||
"bs58": "4.0.1",
|
"bs58": "4.0.1",
|
||||||
@ -2615,6 +2614,12 @@
|
|||||||
"resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz",
|
"resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz",
|
||||||
"integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ=="
|
"integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ=="
|
||||||
},
|
},
|
||||||
|
"@zxing/text-encoding": {
|
||||||
|
"version": "0.9.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@zxing/text-encoding/-/text-encoding-0.9.0.tgz",
|
||||||
|
"integrity": "sha512-U/4aVJ2mxI0aDNI8Uq0wEhMgY+u4CNtEb0om3+y3+niDAsoTCOB33UF0sxpzqzdqXLqmvc+vZyAt4O8pPdfkwA==",
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
"abab": {
|
"abab": {
|
||||||
"version": "2.0.5",
|
"version": "2.0.5",
|
||||||
"resolved": "https://registry.npmjs.org/abab/-/abab-2.0.5.tgz",
|
"resolved": "https://registry.npmjs.org/abab/-/abab-2.0.5.tgz",
|
||||||
@ -3575,9 +3580,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"bl": {
|
"bl": {
|
||||||
"version": "4.0.4",
|
"version": "4.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/bl/-/bl-4.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz",
|
||||||
"integrity": "sha512-7tdr4EpSd7jJ6tuQ21vu2ke8w7pNEstzj1O8wwq6sNNzO3UDi5MA8Gny/gquCj7r2C6fHudg8tKRGyjRgmvNxQ==",
|
"integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"buffer": "^5.5.0",
|
"buffer": "^5.5.0",
|
||||||
"inherits": "^2.0.4",
|
"inherits": "^2.0.4",
|
||||||
@ -8712,9 +8717,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"it-all": {
|
"it-all": {
|
||||||
"version": "1.0.4",
|
"version": "1.0.5",
|
||||||
"resolved": "https://registry.npmjs.org/it-all/-/it-all-1.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/it-all/-/it-all-1.0.5.tgz",
|
||||||
"integrity": "sha512-7K+gjHHzZ7t+bCkrtulYiow35k3UgqH7miC+iUa9RGiyDRXJ6hVDeFsDrnWrlscjrkLFOJRKHxNOke4FNoQnhw=="
|
"integrity": "sha512-ygD4kA4vp8fi+Y+NBgEKt6W06xSbv6Ub/0V8d1r3uCyJ9Izwa1UspkIOlqY9fOee0Z1w3WRo1+VWyAU4DgtufA=="
|
||||||
},
|
},
|
||||||
"it-buffer": {
|
"it-buffer": {
|
||||||
"version": "0.1.2",
|
"version": "0.1.2",
|
||||||
@ -8726,9 +8731,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"it-drain": {
|
"it-drain": {
|
||||||
"version": "1.0.3",
|
"version": "1.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/it-drain/-/it-drain-1.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/it-drain/-/it-drain-1.0.4.tgz",
|
||||||
"integrity": "sha512-KxwHBEpWW+0/EkGCOPR2MaHanvBW2A76tOC5CiitoJGLd8J56FxM6jJX3uow20v5qMidX5lnKgwH5oCIyYDszQ=="
|
"integrity": "sha512-coB7mcyZ4lWBQKoQGJuqM+P94pvpn2T3KY27vcVWPqeB1WmoysRC76VZnzAqrBWzpWcoEJMjZ+fsMBslxNaWfQ=="
|
||||||
},
|
},
|
||||||
"it-glob": {
|
"it-glob": {
|
||||||
"version": "0.0.8",
|
"version": "0.0.8",
|
||||||
@ -8838,9 +8843,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"it-pushable": {
|
"it-pushable": {
|
||||||
"version": "1.4.1",
|
"version": "1.4.2",
|
||||||
"resolved": "https://registry.npmjs.org/it-pushable/-/it-pushable-1.4.1.tgz",
|
"resolved": "https://registry.npmjs.org/it-pushable/-/it-pushable-1.4.2.tgz",
|
||||||
"integrity": "sha512-XOnbDxD5YoiVtL/vobQW/ZGkzQzJv9Fs9TJlO2McfkIbolBBO2IGY6XjE1ooLfw8gQeH8XbgpoLajtPUVO8Qew==",
|
"integrity": "sha512-vVPu0CGRsTI8eCfhMknA7KIBqqGFolbRx+1mbQ6XuZ7YCz995Qj7L4XUviwClFunisDq96FdxzF5FnAbw15afg==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"fast-fifo": "^1.0.0"
|
"fast-fifo": "^1.0.0"
|
||||||
}
|
}
|
||||||
@ -11464,9 +11469,9 @@
|
|||||||
"integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ=="
|
"integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ=="
|
||||||
},
|
},
|
||||||
"nise": {
|
"nise": {
|
||||||
"version": "4.0.4",
|
"version": "4.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/nise/-/nise-4.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/nise/-/nise-4.1.0.tgz",
|
||||||
"integrity": "sha512-bTTRUNlemx6deJa+ZyoCUTRvH3liK5+N6VQZ4NIw90AgDXY6iPnsqplNFf6STcj+ePk0H/xqxnP75Lr0J0Fq3A==",
|
"integrity": "sha512-eQMEmGN/8arp0xsvGoQ+B1qvSkR73B1nWSCh7nOt5neMCtwcQVYQGdzQMhcNscktTsWB54xnlSQFzOAPJD8nXA==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@sinonjs/commons": "^1.7.0",
|
"@sinonjs/commons": "^1.7.0",
|
||||||
"@sinonjs/fake-timers": "^6.0.0",
|
"@sinonjs/fake-timers": "^6.0.0",
|
||||||
@ -17343,9 +17348,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"web-encoding": {
|
"web-encoding": {
|
||||||
"version": "1.0.6",
|
"version": "1.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/web-encoding/-/web-encoding-1.0.6.tgz",
|
"resolved": "https://registry.npmjs.org/web-encoding/-/web-encoding-1.1.0.tgz",
|
||||||
"integrity": "sha512-26wEnRPEFAc5d5lmH1Q/DuvWEYsRF1D2alX2jlKpdmqv7cj+BbANL7Xlcl9r4s72Eg9kItZa9RWVbBMC9dMv4w=="
|
"integrity": "sha512-KzYonGdJnZB3qvhK8hKca5qXk/wp+hgwGNTY1TnqtF2CzDzpN8szOC3ejhX9+wbhCq3vQs/TjM8BykS1kor0lQ==",
|
||||||
|
"requires": {
|
||||||
|
"@zxing/text-encoding": "0.9.0"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"web-vitals": {
|
"web-vitals": {
|
||||||
"version": "0.2.4",
|
"version": "0.2.4",
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fluencelabs/fluence": "^0.9.17",
|
"@fluencelabs/fluence": "^0.9.25",
|
||||||
"@fluencelabs/fluence-network-environment": "^1.0.8",
|
"@fluencelabs/fluence-network-environment": "^1.0.8",
|
||||||
"@testing-library/jest-dom": "^5.11.6",
|
"@testing-library/jest-dom": "^5.11.6",
|
||||||
"@testing-library/react": "^11.2.2",
|
"@testing-library/react": "^11.2.2",
|
||||||
|
@ -30,7 +30,8 @@ const App = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let response = await curlRequest(client, url, 10000);
|
let response = await curlRequest(client, url, 10000);
|
||||||
setData((prev) => [...prev, { url, response }]);
|
console.log(JSON.stringify(response));
|
||||||
|
setData((prev) => [...prev, { url, response: response[0].stdout }]);
|
||||||
};
|
};
|
||||||
|
|
||||||
const stop = async () => {
|
const stop = async () => {
|
||||||
|
@ -5,7 +5,7 @@ import { v4 as uuidv4 } from 'uuid';
|
|||||||
export const relayNode = testNet[3];
|
export const relayNode = testNet[3];
|
||||||
const node = relayNode.peerId;
|
const node = relayNode.peerId;
|
||||||
|
|
||||||
const serviceId = 'e90bfbaf-ede7-4fbe-b45a-6250bf36ed3e';
|
const serviceId = '4d082281-c72c-468b-b30a-e9ebad70546c';
|
||||||
|
|
||||||
export const curlRequest = async (client: FluenceClient, url: String, ttl: number) => {
|
export const curlRequest = async (client: FluenceClient, url: String, ttl: number) => {
|
||||||
const script = `
|
const script = `
|
||||||
@ -30,5 +30,5 @@ export const curlRequest = async (client: FluenceClient, url: String, ttl: numbe
|
|||||||
data.set('callback', callbackId);
|
data.set('callback', callbackId);
|
||||||
data.set('url', url);
|
data.set('url', url);
|
||||||
|
|
||||||
return await sendParticleAsFetch<String>(client, new Particle(script, data, ttl), callbackId);
|
return await sendParticleAsFetch<any>(client, new Particle(script, data, ttl), callbackId);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user