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
|
||||
```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
|
||||
|
62
curl_template/frontend/package-lock.json
generated
62
curl_template/frontend/package-lock.json
generated
@ -1200,18 +1200,17 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"@fluencelabs/aquamarine-stepper": {
|
||||
"version": "0.4.2",
|
||||
"resolved": "https://registry.npmjs.org/@fluencelabs/aquamarine-stepper/-/aquamarine-stepper-0.4.2.tgz",
|
||||
"integrity": "sha512-Cz1jJmuj7tk3n2g9bzRTcDgymF5mwI7AvrKKgfiOrEfopbcXqlFA1ypO+FFNSP/M7VN0o3KFNkwG5GnTTkg3Fw=="
|
||||
"@fluencelabs/aquamarine-interpreter": {
|
||||
"version": "0.7.1",
|
||||
"resolved": "https://registry.npmjs.org/@fluencelabs/aquamarine-interpreter/-/aquamarine-interpreter-0.7.1.tgz",
|
||||
"integrity": "sha512-XWc1OE+5PtmK6tiSUiel74YVIly2b+l0UeV/W65Vzp1c6iYFsNDa6ztd7sTcYiQlneXLCdytDmIqRDrccDB+Qg=="
|
||||
},
|
||||
"@fluencelabs/fluence": {
|
||||
"version": "0.9.17",
|
||||
"resolved": "https://registry.npmjs.org/@fluencelabs/fluence/-/fluence-0.9.17.tgz",
|
||||
"integrity": "sha512-tAosUW874xfpr7RL5Ees9JT8gqMB9BwAM/7nmw1K4ZqnbNw5XIP645NWiSsAgQGHjkhJk4HVAEJrz1wKzAPYEA==",
|
||||
"version": "0.9.26",
|
||||
"resolved": "https://registry.npmjs.org/@fluencelabs/fluence/-/fluence-0.9.26.tgz",
|
||||
"integrity": "sha512-Wsq8vmclAONp0xwyeRifOFLtyztK6gaOwT84HxvXLUc3/ZrmbleuGzDNKdDtwz7SxPg1AC5wBOCxuIIGtSq/BA==",
|
||||
"requires": {
|
||||
"@fluencelabs/aquamarine-stepper": "0.4.2",
|
||||
"@fluencelabs/fluence-network-environment": "1.0.8",
|
||||
"@fluencelabs/aquamarine-interpreter": "^0.7.0",
|
||||
"async": "3.2.0",
|
||||
"base64-js": "1.3.1",
|
||||
"bs58": "4.0.1",
|
||||
@ -2615,6 +2614,12 @@
|
||||
"resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz",
|
||||
"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": {
|
||||
"version": "2.0.5",
|
||||
"resolved": "https://registry.npmjs.org/abab/-/abab-2.0.5.tgz",
|
||||
@ -3575,9 +3580,9 @@
|
||||
}
|
||||
},
|
||||
"bl": {
|
||||
"version": "4.0.4",
|
||||
"resolved": "https://registry.npmjs.org/bl/-/bl-4.0.4.tgz",
|
||||
"integrity": "sha512-7tdr4EpSd7jJ6tuQ21vu2ke8w7pNEstzj1O8wwq6sNNzO3UDi5MA8Gny/gquCj7r2C6fHudg8tKRGyjRgmvNxQ==",
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz",
|
||||
"integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==",
|
||||
"requires": {
|
||||
"buffer": "^5.5.0",
|
||||
"inherits": "^2.0.4",
|
||||
@ -8712,9 +8717,9 @@
|
||||
}
|
||||
},
|
||||
"it-all": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/it-all/-/it-all-1.0.4.tgz",
|
||||
"integrity": "sha512-7K+gjHHzZ7t+bCkrtulYiow35k3UgqH7miC+iUa9RGiyDRXJ6hVDeFsDrnWrlscjrkLFOJRKHxNOke4FNoQnhw=="
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/it-all/-/it-all-1.0.5.tgz",
|
||||
"integrity": "sha512-ygD4kA4vp8fi+Y+NBgEKt6W06xSbv6Ub/0V8d1r3uCyJ9Izwa1UspkIOlqY9fOee0Z1w3WRo1+VWyAU4DgtufA=="
|
||||
},
|
||||
"it-buffer": {
|
||||
"version": "0.1.2",
|
||||
@ -8726,9 +8731,9 @@
|
||||
}
|
||||
},
|
||||
"it-drain": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/it-drain/-/it-drain-1.0.3.tgz",
|
||||
"integrity": "sha512-KxwHBEpWW+0/EkGCOPR2MaHanvBW2A76tOC5CiitoJGLd8J56FxM6jJX3uow20v5qMidX5lnKgwH5oCIyYDszQ=="
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/it-drain/-/it-drain-1.0.4.tgz",
|
||||
"integrity": "sha512-coB7mcyZ4lWBQKoQGJuqM+P94pvpn2T3KY27vcVWPqeB1WmoysRC76VZnzAqrBWzpWcoEJMjZ+fsMBslxNaWfQ=="
|
||||
},
|
||||
"it-glob": {
|
||||
"version": "0.0.8",
|
||||
@ -8838,9 +8843,9 @@
|
||||
}
|
||||
},
|
||||
"it-pushable": {
|
||||
"version": "1.4.1",
|
||||
"resolved": "https://registry.npmjs.org/it-pushable/-/it-pushable-1.4.1.tgz",
|
||||
"integrity": "sha512-XOnbDxD5YoiVtL/vobQW/ZGkzQzJv9Fs9TJlO2McfkIbolBBO2IGY6XjE1ooLfw8gQeH8XbgpoLajtPUVO8Qew==",
|
||||
"version": "1.4.2",
|
||||
"resolved": "https://registry.npmjs.org/it-pushable/-/it-pushable-1.4.2.tgz",
|
||||
"integrity": "sha512-vVPu0CGRsTI8eCfhMknA7KIBqqGFolbRx+1mbQ6XuZ7YCz995Qj7L4XUviwClFunisDq96FdxzF5FnAbw15afg==",
|
||||
"requires": {
|
||||
"fast-fifo": "^1.0.0"
|
||||
}
|
||||
@ -11464,9 +11469,9 @@
|
||||
"integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ=="
|
||||
},
|
||||
"nise": {
|
||||
"version": "4.0.4",
|
||||
"resolved": "https://registry.npmjs.org/nise/-/nise-4.0.4.tgz",
|
||||
"integrity": "sha512-bTTRUNlemx6deJa+ZyoCUTRvH3liK5+N6VQZ4NIw90AgDXY6iPnsqplNFf6STcj+ePk0H/xqxnP75Lr0J0Fq3A==",
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/nise/-/nise-4.1.0.tgz",
|
||||
"integrity": "sha512-eQMEmGN/8arp0xsvGoQ+B1qvSkR73B1nWSCh7nOt5neMCtwcQVYQGdzQMhcNscktTsWB54xnlSQFzOAPJD8nXA==",
|
||||
"requires": {
|
||||
"@sinonjs/commons": "^1.7.0",
|
||||
"@sinonjs/fake-timers": "^6.0.0",
|
||||
@ -17343,9 +17348,12 @@
|
||||
}
|
||||
},
|
||||
"web-encoding": {
|
||||
"version": "1.0.6",
|
||||
"resolved": "https://registry.npmjs.org/web-encoding/-/web-encoding-1.0.6.tgz",
|
||||
"integrity": "sha512-26wEnRPEFAc5d5lmH1Q/DuvWEYsRF1D2alX2jlKpdmqv7cj+BbANL7Xlcl9r4s72Eg9kItZa9RWVbBMC9dMv4w=="
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/web-encoding/-/web-encoding-1.1.0.tgz",
|
||||
"integrity": "sha512-KzYonGdJnZB3qvhK8hKca5qXk/wp+hgwGNTY1TnqtF2CzDzpN8szOC3ejhX9+wbhCq3vQs/TjM8BykS1kor0lQ==",
|
||||
"requires": {
|
||||
"@zxing/text-encoding": "0.9.0"
|
||||
}
|
||||
},
|
||||
"web-vitals": {
|
||||
"version": "0.2.4",
|
||||
|
@ -3,7 +3,7 @@
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@fluencelabs/fluence": "^0.9.17",
|
||||
"@fluencelabs/fluence": "^0.9.25",
|
||||
"@fluencelabs/fluence-network-environment": "^1.0.8",
|
||||
"@testing-library/jest-dom": "^5.11.6",
|
||||
"@testing-library/react": "^11.2.2",
|
||||
|
@ -30,7 +30,8 @@ const App = () => {
|
||||
}
|
||||
|
||||
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 () => {
|
||||
|
@ -5,7 +5,7 @@ import { v4 as uuidv4 } from 'uuid';
|
||||
export const relayNode = testNet[3];
|
||||
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) => {
|
||||
const script = `
|
||||
@ -30,5 +30,5 @@ export const curlRequest = async (client: FluenceClient, url: String, ttl: numbe
|
||||
data.set('callback', callbackId);
|
||||
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