mirror of
https://github.com/fluencelabs/examples
synced 2025-05-28 10:11:19 +00:00
Merge branch 'npm-workspaces' into new-js-sdk-api
This commit is contained in:
commit
cd1f1723f3
@ -1,30 +1,37 @@
|
|||||||
# IPFS code execution example
|
# IPFS code execution example
|
||||||
|
|
||||||
This example showcases 2 things:
|
This example showcases 2 things:
|
||||||
|
|
||||||
1. how it's possible to store .wasm modules on IPFS, then deploy them to Fluence as a service
|
1. how it's possible to store .wasm modules on IPFS, then deploy them to Fluence as a service
|
||||||
2. ability to process IPFS files via a Fluence service. In this example, we get a size of a file
|
2. ability to process IPFS files via a Fluence service. In this example, we get a size of a file
|
||||||
|
|
||||||
## Learn about AquaIPFS
|
## Learn about AquaIPFS
|
||||||
|
|
||||||
See [Aqua Book](https://doc.fluence.dev/aqua-book/libraries/aqua-ipfs).
|
See [Aqua Book](https://doc.fluence.dev/aqua-book/libraries/aqua-ipfs).
|
||||||
|
|
||||||
## How to run & use this example
|
## How to run & use this example
|
||||||
|
|
||||||
|
You need npm v7 or later to run the examples
|
||||||
|
|
||||||
### Web example
|
### Web example
|
||||||
|
|
||||||
1. Run it
|
1. Run it
|
||||||
|
|
||||||
```
|
```
|
||||||
cd web
|
|
||||||
npm i
|
npm i
|
||||||
npm start
|
npm start -w web
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Press "deploy"
|
2. Press "deploy"
|
||||||
3. Copy WASM service CID and press "get_size"
|
3. Copy WASM service CID and press "get_size"
|
||||||
|
|
||||||
### NodeJS example
|
### NodeJS example
|
||||||
|
|
||||||
```
|
```
|
||||||
cd nodejs
|
|
||||||
npm i
|
npm i
|
||||||
npm start
|
npm start -w nodejs
|
||||||
```
|
```
|
||||||
|
|
||||||
## Aqua implementation
|
## Aqua implementation
|
||||||
The business logic is implemented in Aqua in [process.aqua](aqua/aqua/process.aqua)
|
|
||||||
|
|
||||||
|
The business logic is implemented in Aqua in [process.aqua](aqua/aqua/process.aqua)
|
||||||
|
@ -4,8 +4,8 @@
|
|||||||
"description": "An example of executing WASM code from IPFS over IPFS files",
|
"description": "An example of executing WASM code from IPFS over IPFS files",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"postinstall": "../service/scripts/build.sh && npm run build",
|
"postinstall": "../service/scripts/build.sh",
|
||||||
"compile-aqua": "aqua -i aqua -o src",
|
"compile-aqua": "aqua -m ../node_modules -i aqua -o src",
|
||||||
"build": "npm run compile-aqua && tsc"
|
"build": "npm run compile-aqua && tsc"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
@ -22,16 +22,16 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fluencelabs/aqua-ipfs": "0.4.2",
|
"@fluencelabs/aqua-ipfs": "0.4.2",
|
||||||
"@fluencelabs/fluence": "0.11.0",
|
|
||||||
"@fluencelabs/aqua-lib": "0.1.14",
|
"@fluencelabs/aqua-lib": "0.1.14",
|
||||||
|
"@fluencelabs/fluence": "0.11.0",
|
||||||
"@fluencelabs/fluence-network-environment": "1.0.10",
|
"@fluencelabs/fluence-network-environment": "1.0.10",
|
||||||
"ipfs-http-client": "^50.1.2",
|
"ipfs-http-client": "^50.1.2",
|
||||||
"it-all": "^1.0.5",
|
"it-all": "^1.0.5",
|
||||||
"uint8arrays": "^2.1.5",
|
"multiaddr": "^10.0.0",
|
||||||
"multiaddr": "^10.0.0"
|
"uint8arrays": "^2.1.5"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@fluencelabs/aqua": "^0.3.0-224",
|
"@fluencelabs/aqua": "^0.3.0-225",
|
||||||
"typescript": "^3.9.5"
|
"typescript": "^3.9.5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.3.0-224
|
* Aqua version: 0.3.0-225
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { FluencePeer } from '@fluencelabs/fluence';
|
import { FluencePeer } from '@fluencelabs/fluence';
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.3.0-224
|
* Aqua version: 0.3.0-225
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { FluencePeer } from '@fluencelabs/fluence';
|
import { FluencePeer } from '@fluencelabs/fluence';
|
||||||
|
39224
aqua-examples/aqua-ipfs-integration/package-lock.json
generated
Normal file
39224
aqua-examples/aqua-ipfs-integration/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
11
aqua-examples/aqua-ipfs-integration/package.json
Normal file
11
aqua-examples/aqua-ipfs-integration/package.json
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"name": "aqua-ipfs-integration",
|
||||||
|
"workspaces": [
|
||||||
|
"aqua",
|
||||||
|
"nodejs",
|
||||||
|
"web"
|
||||||
|
],
|
||||||
|
"scripts": {
|
||||||
|
"build": "npm run build -w aqua -w nodejs -w web"
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user